@signal24/vue-foundation 3.3.3 → 3.3.4

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 (39) hide show
  1. package/.eslintrc.js +16 -0
  2. package/.prettierrc.json +7 -0
  3. package/CHANGES.md +6 -3
  4. package/package.json +26 -13
  5. package/postcss.config.js +1 -1
  6. package/src/app.js +2 -2
  7. package/src/components/ajax-select.vue +10 -6
  8. package/src/components/alert.vue +25 -27
  9. package/src/components/index.js +6 -11
  10. package/src/components/modal.vue +18 -10
  11. package/src/components/smart-select.vue +8 -6
  12. package/src/config.js +1 -1
  13. package/src/directives/autofocus.js +4 -3
  14. package/src/directives/confirm-button.js +2 -2
  15. package/src/directives/date-input.js +7 -9
  16. package/src/directives/datetime.js +11 -9
  17. package/src/directives/disabled.js +4 -5
  18. package/src/directives/duration.js +7 -8
  19. package/src/directives/index.js +1 -1
  20. package/src/directives/infinite-scroll.js +1 -1
  21. package/src/directives/readonly.js +5 -6
  22. package/src/directives/tooltip.js +58 -61
  23. package/src/directives/user-text.js +1 -1
  24. package/src/filters/index.js +9 -6
  25. package/src/helpers/array.js +13 -14
  26. package/src/helpers/context-menu.js +16 -18
  27. package/src/helpers/delay.js +1 -1
  28. package/src/helpers/error.js +6 -9
  29. package/src/helpers/http.js +27 -25
  30. package/src/helpers/index.js +1 -1
  31. package/src/helpers/mask.js +27 -20
  32. package/src/helpers/number.js +2 -2
  33. package/src/helpers/string.js +17 -17
  34. package/src/helpers/vue.js +2 -2
  35. package/src/index.js +5 -5
  36. package/src/plugins/index.js +6 -6
  37. package/src/plugins/infinite-scroll/hook.js +2 -2
  38. package/src/plugins/infinite-scroll.js +20 -10
  39. package/src/plugins/resize-watcher.js +2 -4
@@ -1,48 +1,43 @@
1
- import app from '../app';
2
1
  import $ from 'jquery';
3
2
 
3
+ import app from '../app';
4
+
4
5
  app.directive('tip', {
5
6
  mounted: createTip,
6
7
  updated: createTip,
7
8
  unmounted: destroyTip
8
9
  });
9
10
 
10
- function createTip(el, binding, vnode, oldVnode) {
11
+ function createTip(el, binding) {
11
12
  let tipText = el.attributes.tip ? el.attributes.tip.value : binding.value;
12
- if (binding.value === false)
13
- tipText = null;
13
+ if (binding.value === false) tipText = null;
14
14
  if (tipText) {
15
15
  let config = {};
16
16
  config[binding.modifiers.html ? 'html' : 'text'] = tipText;
17
- if (el.attributes['tip-class'])
18
- config.class = el.attributes['tip-class'].value;
17
+ if (el.attributes['tip-class']) config.class = el.attributes['tip-class'].value;
19
18
  $(el).vfTooltip(config);
20
- }
21
- else
22
- $(el).vfTooltip('destroy');
19
+ } else $(el).vfTooltip('destroy');
23
20
  }
24
21
 
25
22
  function destroyTip(el) {
26
23
  $(el).vfTooltip('destroy');
27
24
  }
28
25
 
29
- $.fn.vfTooltip = function(option) {
30
- return this.each(function(index, el) {
26
+ $.fn.vfTooltip = function (option) {
27
+ return this.each(function (index, el) {
31
28
  var tooltip = $(el).data('vf-tooltip');
32
29
 
33
- if (typeof(option) == 'string') {
30
+ if (typeof option == 'string') {
34
31
  if (!tooltip) return;
35
32
  tooltip[option]();
36
- }
37
- else if (tooltip) {
33
+ } else if (tooltip) {
38
34
  tooltip.configure(option);
39
- }
40
- else {
41
- var tooltip = new VfTooltip(el, option);
42
- $(el).data('vf-tooltip', tooltip);
35
+ } else {
36
+ var vfTooltip = new VfTooltip(el, option);
37
+ $(el).data('vf-tooltip', vfTooltip);
43
38
  }
44
39
  });
45
- }
40
+ };
46
41
 
47
42
  function VfTooltip(el, configIn) {
48
43
  // exports
@@ -50,7 +45,11 @@ function VfTooltip(el, configIn) {
50
45
  this.destroy = _destroy;
51
46
 
52
47
  // state
53
- var $tip, config, lastMoveEvt, checkInterval, shouldShow = false;
48
+ var $tip,
49
+ config,
50
+ lastMoveEvt,
51
+ checkInterval,
52
+ shouldShow = false;
54
53
 
55
54
  // apply config
56
55
  this.configure(configIn);
@@ -62,9 +61,12 @@ function VfTooltip(el, configIn) {
62
61
  config.now && _handleTargetMouseEnter(config.now);
63
62
 
64
63
  function _configure(configIn) {
65
- config = $.extend({
66
- delay: 0
67
- }, configIn);
64
+ config = $.extend(
65
+ {
66
+ delay: 0
67
+ },
68
+ configIn
69
+ );
68
70
  }
69
71
 
70
72
  function _handleTargetMouseEnter(e) {
@@ -72,61 +74,54 @@ function VfTooltip(el, configIn) {
72
74
 
73
75
  shouldShow = true;
74
76
 
75
- setTimeout(function() {
77
+ setTimeout(function () {
76
78
  if (!shouldShow) return;
77
79
 
78
80
  _renderTooltip();
79
81
 
80
- if (config.static)
81
- _placeStaticTooltip();
82
- else
83
- _handleMouseMove(e);
82
+ if (config.static) _placeStaticTooltip();
83
+ else _handleMouseMove(e);
84
84
 
85
85
  $tip.show();
86
86
  }, config.delay);
87
87
  }
88
88
 
89
- function _handleTargetMouseLeave(e) {
89
+ function _handleTargetMouseLeave() {
90
90
  shouldShow = false;
91
91
  _deferredRemoveTooltip();
92
92
  }
93
93
 
94
94
  function _renderTooltip() {
95
- if (!$tip)
96
- config.static || $(window).on('mousemove', _handleMouseMove);
97
- else
98
- $tip.remove();
99
-
100
- $tip = $('<div class="vf-tooltip">').css('position', 'absolute').css('z-index', '1000000').addClass(config.class).appendTo(document.body);
95
+ if (!$tip) config.static || $(window).on('mousemove', _handleMouseMove);
96
+ else $tip.remove();
97
+
98
+ $tip = $('<div class="vf-tooltip">')
99
+ .css('position', 'absolute')
100
+ .css('z-index', '1000000')
101
+ .addClass(config.class)
102
+ .appendTo(document.body);
101
103
  config.title && $('<div class="title">').text(config.title).appendTo($tip);
102
104
  var $content = $('<div class="content">').appendTo($tip);
103
105
 
104
- if (config.callback)
105
- config.callback($content[0]);
106
- else if (config.text)
107
- $content.text(config.text).html($content.html().replace(/\n/g, '<br>'));
108
- else if (config.html)
109
- $content.html(config.html);
106
+ if (config.callback) config.callback($content[0]);
107
+ else if (config.text) $content.text(config.text).html($content.html().replace(/\n/g, '<br>'));
108
+ else if (config.html) $content.html(config.html);
110
109
 
111
110
  if (config.static) {
112
- $tip.mouseover(function() {
111
+ $tip.mouseover(function () {
113
112
  shouldShow = true;
114
- }).mouseout(function() {
113
+ }).mouseout(function () {
115
114
  shouldShow = false;
116
115
  _deferredRemoveTooltip();
117
116
  });
118
- }
119
-
120
- else {
117
+ } else {
121
118
  checkInterval = setInterval(_checkMoveEvent, 250);
122
119
  }
123
120
  }
124
121
 
125
122
  function _deferredRemoveTooltip() {
126
- if (config.static)
127
- setTimeout(_removeTooltip, 50);
128
- else
129
- _removeTooltip();
123
+ if (config.static) setTimeout(_removeTooltip, 50);
124
+ else _removeTooltip();
130
125
  }
131
126
 
132
127
  function _removeTooltip() {
@@ -148,25 +143,27 @@ function VfTooltip(el, configIn) {
148
143
  var tipX = targetPosition.left;
149
144
  var tipY = targetPosition.top - tipHeight - 1;
150
145
  if (tipY - 2 < 0) tipY = targetPosition.top + $target.outerHeight(true) + 1;
151
- $tip.css('min-width', tipW + 'px').css('left', tipX + 'px').css('top', tipY + 'px');
146
+ $tip.css('min-width', tipW + 'px')
147
+ .css('left', tipX + 'px')
148
+ .css('top', tipY + 'px');
152
149
  }
153
150
 
154
151
  function _handleMouseMove(e) {
155
- var tipWidth = $tip.outerWidth(), tipHeight = $tip.outerHeight();
156
- var viewWidth = window.innerWidth, viewHeight = window.innerHeight;
157
- var tipX = e.pageX + 10, tipY = e.pageY + 20;
158
- if (tipX + tipWidth > viewWidth)
159
- tipX = e.pageX - 5 - tipWidth;
160
- if (tipY + tipHeight > viewHeight)
161
- tipY = e.pageY - 5 - tipHeight;
152
+ var tipWidth = $tip.outerWidth(),
153
+ tipHeight = $tip.outerHeight();
154
+ var viewWidth = window.innerWidth,
155
+ viewHeight = window.innerHeight;
156
+ var tipX = e.pageX + 10,
157
+ tipY = e.pageY + 20;
158
+ if (tipX + tipWidth > viewWidth) tipX = e.pageX - 5 - tipWidth;
159
+ if (tipY + tipHeight > viewHeight) tipY = e.pageY - 5 - tipHeight;
162
160
  $tip.css('left', tipX + 'px').css('top', tipY + 'px');
163
161
  lastMoveEvt = e;
164
162
  }
165
163
 
166
164
  function _checkMoveEvent() {
167
165
  if (!lastMoveEvt) return;
168
- if (el != lastMoveEvt.target && !$.contains(el, lastMoveEvt.target))
169
- _handleTargetMouseLeave();
166
+ if (el != lastMoveEvt.target && !$.contains(el, lastMoveEvt.target)) _handleTargetMouseLeave();
170
167
  }
171
168
 
172
169
  function _destroy() {
@@ -178,4 +175,4 @@ function VfTooltip(el, configIn) {
178
175
  $target.off('mouseleave', _handleTargetMouseLeave);
179
176
  $target.removeData('vf-tooltip');
180
177
  }
181
- }
178
+ }
@@ -8,4 +8,4 @@ app.directive('user-text', {
8
8
  function fn(el, binding) {
9
9
  if (binding.value == binding.oldValue) return;
10
10
  el.innerHTML = binding.value.escapeHtml().nl2br();
11
- }
11
+ }
@@ -2,7 +2,7 @@ import app from '../app';
2
2
 
3
3
  const filterFns = {
4
4
  bytes(value) {
5
- var i = Math.floor( Math.log(value) / Math.log(1024) );
5
+ var i = Math.floor(Math.log(value) / Math.log(1024));
6
6
  return (value / Math.pow(1024, i)).toFixed(2) * 1 + ' ' + ['B', 'KB', 'MB', 'GB', 'TB'][i];
7
7
  },
8
8
 
@@ -51,7 +51,13 @@ const filterFns = {
51
51
  },
52
52
 
53
53
  usCurrency(value) {
54
- return '$' + Number(value).toFixed(3).replace(/0$/, '').replace(/\B(?=(\d{3})+(?!\d))/g, ',');
54
+ return (
55
+ '$' +
56
+ Number(value)
57
+ .toFixed(3)
58
+ .replace(/0$/, '')
59
+ .replace(/\B(?=(\d{3})+(?!\d))/g, ',')
60
+ );
55
61
  }
56
62
  };
57
63
 
@@ -73,7 +79,4 @@ app.config.globalProperties.$filter = (value, ...filters) => {
73
79
  return value;
74
80
  };
75
81
 
76
- export {
77
- registerFilter,
78
- registerFilters
79
- };
82
+ export { registerFilter, registerFilters };
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(Array.prototype, 'diff', {
2
2
  enumerable: false,
3
- value: function(...args) {
3
+ value: function (...args) {
4
4
  return this.filter(val => {
5
5
  for (let i = 0; i < args.length; i++) {
6
6
  if (args[i].includes(val)) {
@@ -15,14 +15,14 @@ Object.defineProperty(Array.prototype, 'diff', {
15
15
 
16
16
  Object.defineProperty(Array.prototype, 'first', {
17
17
  enumerable: false,
18
- value: function() {
18
+ value: function () {
19
19
  return this[0] || undefined;
20
20
  }
21
21
  });
22
22
 
23
23
  Object.defineProperty(Array.prototype, 'intersect', {
24
24
  enumerable: false,
25
- value: function(...args) {
25
+ value: function (...args) {
26
26
  return this.filter(val => {
27
27
  for (let i = 0; i < args.length; i++) {
28
28
  if (args[i].includes(val)) {
@@ -37,7 +37,7 @@ Object.defineProperty(Array.prototype, 'intersect', {
37
37
 
38
38
  Object.defineProperty(Array.prototype, 'keyBy', {
39
39
  enumerable: false,
40
- value: function(keyProp) {
40
+ value: function (keyProp) {
41
41
  let result = {};
42
42
  this.forEach(elem => {
43
43
  result[elem[keyProp]] = elem;
@@ -48,16 +48,15 @@ Object.defineProperty(Array.prototype, 'keyBy', {
48
48
 
49
49
  Object.defineProperty(Array.prototype, 'last', {
50
50
  enumerable: false,
51
- value: function() {
51
+ value: function () {
52
52
  return this.length ? this[this.length - 1] : undefined;
53
53
  }
54
54
  });
55
55
 
56
56
  Object.defineProperty(Array.prototype, 'pluck', {
57
57
  enumerable: false,
58
- value: function(prop, keyProp) {
59
- if (typeof keyProp === 'undefined')
60
- return this.map(elem => elem[prop]);
58
+ value: function (prop, keyProp) {
59
+ if (typeof keyProp === 'undefined') return this.map(elem => elem[prop]);
61
60
 
62
61
  let result = {};
63
62
  this.forEach(elem => {
@@ -69,7 +68,7 @@ Object.defineProperty(Array.prototype, 'pluck', {
69
68
 
70
69
  Object.defineProperty(Array.prototype, 'remove', {
71
70
  enumerable: false,
72
- value: function(element) {
71
+ value: function (element) {
73
72
  const index = this.indexOf(element);
74
73
  index > -1 && this.splice(index, 1);
75
74
  }
@@ -77,7 +76,7 @@ Object.defineProperty(Array.prototype, 'remove', {
77
76
 
78
77
  Object.defineProperty(Array.prototype, 'replace', {
79
78
  enumerable: false,
80
- value: function(element, replacement) {
79
+ value: function (element, replacement) {
81
80
  const index = this.indexOf(element);
82
81
  index > -1 && this.splice(index, 1, replacement);
83
82
  }
@@ -85,7 +84,7 @@ Object.defineProperty(Array.prototype, 'replace', {
85
84
 
86
85
  Object.defineProperty(Array.prototype, 'sortBy', {
87
86
  enumerable: false,
88
- value: function(key) {
87
+ value: function (key) {
89
88
  this.sort((a, b) => {
90
89
  return String(a[key]).toLowerCase().localeCompare(String(b[key]).toLowerCase());
91
90
  });
@@ -94,7 +93,7 @@ Object.defineProperty(Array.prototype, 'sortBy', {
94
93
 
95
94
  Object.defineProperty(Array.prototype, 'unique', {
96
95
  enumerable: false,
97
- value: function() {
98
- return [...new Set(this)]
96
+ value: function () {
97
+ return [...new Set(this)];
99
98
  }
100
- });
99
+ });
@@ -1,7 +1,8 @@
1
+ import $ from 'jquery';
2
+
1
3
  import app from '../app';
2
- import $ from 'jquery'
3
4
 
4
- app.config.globalProperties.$contextMenu = function(e, config) {
5
+ app.config.globalProperties.$contextMenu = function (e, config) {
5
6
  var $wrapper = $('<div class="vf-overlay">').click(_closeMenu).appendTo(document.body);
6
7
  var $menu = $('<div class="vf-context-menu">').css('position', 'absolute').appendTo($wrapper);
7
8
 
@@ -13,16 +14,14 @@ app.config.globalProperties.$contextMenu = function(e, config) {
13
14
  config.targetClass && $target.addClass(config.targetClass);
14
15
  config.class && $menu.addClass(config.class);
15
16
 
16
- config.items && config.items.forEach(item => {
17
- if (item == '-')
18
- return $('<div class="separator">').appendTo($menu);
19
- var $item = $('<div class="item">').css('user-select', 'none').text(item.title).appendTo($menu);
20
- item.class && $item.addClass(item.class);
21
- if (item.shouldConfirm)
22
- $item.data('handler', item.handler).click(_confirmAction);
23
- else if (item.handler)
24
- $item.click(item.handler);
25
- });
17
+ config.items &&
18
+ config.items.forEach(item => {
19
+ if (item == '-') return $('<div class="separator">').appendTo($menu);
20
+ var $item = $('<div class="item">').css('user-select', 'none').text(item.title).appendTo($menu);
21
+ item.class && $item.addClass(item.class);
22
+ if (item.shouldConfirm) $item.data('handler', item.handler).click(_confirmAction);
23
+ else if (item.handler) $item.click(item.handler);
24
+ });
26
25
 
27
26
  const dx = window.innerWidth - e.clientX;
28
27
  const dy = window.innerHeight - e.clientY;
@@ -32,7 +31,7 @@ app.config.globalProperties.$contextMenu = function(e, config) {
32
31
  const left = dx < menuWidth ? e.clientX - menuWidth - 1 : e.clientX + 1;
33
32
  const top = dy < menuHeight ? e.clientY - menuHeight - 1 : e.clientY + 1;
34
33
 
35
- $menu.css('left', left + 'px')
34
+ $menu.css('left', left + 'px');
36
35
  $menu.css('top', top + 'px');
37
36
 
38
37
  config.onCreate && config.onCreate($menu[0]);
@@ -53,16 +52,15 @@ app.config.globalProperties.$contextMenu = function(e, config) {
53
52
  if ($item.hasClass('pending-confirm')) {
54
53
  var handler = $item.data('handler');
55
54
  handler && handler();
56
- }
57
- else {
55
+ } else {
58
56
  var originalContent = $item.html();
59
57
  $item.addClass('pending-confirm').text('Confirm');
60
- $item.one('mouseleave', function() {
58
+ $item.one('mouseleave', function () {
61
59
  $item.removeClass('pending-confirm').html(originalContent);
62
60
  });
63
61
  e.stopPropagation();
64
62
  }
65
63
  }
66
- }
64
+ };
67
65
 
68
- // TODO: actually de-select text rather than just using CSS to hide its selection
66
+ // TODO: actually de-select text rather than just using CSS to hide its selection
@@ -1,3 +1,3 @@
1
1
  import app from '../app';
2
2
 
3
- app.config.globalProperties.$delay = ms => new Promise(resolve => setTimeout(resolve, ms));
3
+ app.config.globalProperties.$delay = ms => new Promise(resolve => setTimeout(resolve, ms));
@@ -1,5 +1,5 @@
1
1
  import app from '../app';
2
- import vfConfig from '../config'
2
+ import vfConfig from '../config';
3
3
 
4
4
  app.config.globalProperties.$reportError = err => {
5
5
  if (!(err instanceof Error)) {
@@ -8,12 +8,10 @@ app.config.globalProperties.$reportError = err => {
8
8
 
9
9
  if (vfConfig.reportErrorHandler) {
10
10
  vfConfig.reportErrorHandler(err);
11
- }
12
-
13
- else {
11
+ } else {
14
12
  console.error(err);
15
13
  }
16
- }
14
+ };
17
15
 
18
16
  app.config.globalProperties.$throwUserError = msg => {
19
17
  let err = new Error(msg);
@@ -23,17 +21,16 @@ app.config.globalProperties.$throwUserError = msg => {
23
21
 
24
22
  Object.defineProperty(Error.prototype, 'userMessage', {
25
23
  get() {
26
- if (this.code == 'USERERR')
27
- return this.message;
24
+ if (this.code == 'USERERR') return this.message;
28
25
  else
29
26
  return `An application error has occurred:\n\n${this.message}\n\nPlease refresh the page and try again. If this error persists, ${vfConfig.unhandledErrorSupportText}.`;
30
27
  }
31
28
  });
32
29
 
33
- Error.prototype.handle = function() {
30
+ Error.prototype.handle = function () {
34
31
  if (this.code != 'USERERR') {
35
32
  app.config.globalProperties.$reportError(this);
36
33
  }
37
34
 
38
35
  return this;
39
- };
36
+ };
@@ -1,6 +1,6 @@
1
- import app from '../app';
2
-
3
1
  import axios from 'axios';
2
+
3
+ import app from '../app';
4
4
  app.config.globalProperties.$http = axios;
5
5
 
6
6
  axios.postOrPut = (baseUrl, id, ...args) => {
@@ -11,32 +11,34 @@ axios.postOrPut = (baseUrl, id, ...args) => {
11
11
 
12
12
  import vfConfig from '../config';
13
13
 
14
- axios.interceptors.response.use(response => {
15
- // TODO: will Axios auto-reject non-JSON?
16
- if (response.data && typeof response.data != 'object') {
17
- throw new Error('response was not JSON');
18
- }
14
+ axios.interceptors.response.use(
15
+ response => {
16
+ // TODO: will Axios auto-reject non-JSON?
17
+ if (response.data && typeof response.data != 'object') {
18
+ throw new Error('response was not JSON');
19
+ }
19
20
 
20
- return response;
21
- },
21
+ return response;
22
+ },
22
23
 
23
- err => {
24
- if (err.response && err.response.status == 401) {
25
- if (vfConfig.unauthorizedHttpResponseHandler) {
26
- const result = vfConfig.unauthorizedHttpResponseHandler(err.response);
24
+ err => {
25
+ if (err.response && err.response.status == 401) {
26
+ if (vfConfig.unauthorizedHttpResponseHandler) {
27
+ const result = vfConfig.unauthorizedHttpResponseHandler(err.response);
27
28
 
28
- // if the handler said "ok, handled", then we're going to
29
- // return a promise that never resolves to prevent the userland code
30
- // from ever proceeding
31
- if (result) return new Promise(() => {});
29
+ // if the handler said "ok, handled", then we're going to
30
+ // return a promise that never resolves to prevent the userland code
31
+ // from ever proceeding
32
+ if (result) return new Promise(() => {});
33
+ }
32
34
  }
33
- }
34
35
 
35
- if (err.response && err.response.data && err.response.data.error) {
36
- err.code = err.response.status == 422 ? 'USERERR' : 'APIERR';
37
- err.message = err.response.data.error;
38
- err.field = err.response.data.errorField;
39
- }
36
+ if (err.response && err.response.data && err.response.data.error) {
37
+ err.code = err.response.status == 422 ? 'USERERR' : 'APIERR';
38
+ err.message = err.response.data.error;
39
+ err.field = err.response.data.errorField;
40
+ }
40
41
 
41
- throw err;
42
- });
42
+ throw err;
43
+ }
44
+ );
@@ -6,4 +6,4 @@ import './http';
6
6
  import './mask';
7
7
  import './number';
8
8
  import './string';
9
- import './vue';
9
+ import './vue';
@@ -1,26 +1,29 @@
1
+ import $ from 'jquery';
2
+
1
3
  import app from '../app';
2
- import $ from 'jquery'
3
4
 
4
5
  /*///////////////////////////////////////////////
5
6
  Masking
6
7
  //////////////////////////////////////////////*/
7
- app.config.globalProperties.$mask = function(message) {
8
+ app.config.globalProperties.$mask = function (message) {
8
9
  let $el = $(this.$el);
9
10
  this.$maskEl($el.hasClass('vf-overlay') ? $el.find('.vf-modal')[0] : this.$el, message);
10
- }
11
+ };
11
12
 
12
- app.config.globalProperties.$maskEl = function(el, message) {
13
+ app.config.globalProperties.$maskEl = function (el, message) {
13
14
  if (this._currentMask) return;
14
- this._currentMask = $('<div class="mask">').text(message || 'Please wait...').appendTo(el);
15
- }
15
+ this._currentMask = $('<div class="mask">')
16
+ .text(message || 'Please wait...')
17
+ .appendTo(el);
18
+ };
16
19
 
17
- app.config.globalProperties.$unmask = function() {
20
+ app.config.globalProperties.$unmask = function () {
18
21
  if (!this._currentMask) return;
19
22
  $(this._currentMask).remove();
20
23
  delete this._currentMask;
21
- }
24
+ };
22
25
 
23
- app.config.globalProperties.$maskForm = function(waitButton, waitText) {
26
+ app.config.globalProperties.$maskForm = function (waitButton, waitText) {
24
27
  let el = this.$el;
25
28
 
26
29
  if (waitButton !== undefined && waitButton.tagName == 'FORM') {
@@ -43,9 +46,9 @@ app.config.globalProperties.$maskForm = function(waitButton, waitText) {
43
46
  $waitButton.disable(waitText || 'Please wait...');
44
47
  $form.data('vf-masked-wait-btn', $waitButton);
45
48
  }
46
- }
49
+ };
47
50
 
48
- app.config.globalProperties.$unmaskForm = function() {
51
+ app.config.globalProperties.$unmaskForm = function () {
49
52
  let $form = this.$el.tagName == 'FORM' ? $(this.$el) : $(this.$el).find('form.masked');
50
53
  if (!$form.length) return;
51
54
  let $inputs = $form.data('vf-masked-inputs');
@@ -57,27 +60,31 @@ app.config.globalProperties.$unmaskForm = function() {
57
60
  $waitButton.enable();
58
61
  }
59
62
  $form.removeClass('masked');
60
- }
63
+ };
61
64
 
62
65
  /*///////////////////////////////////////////////
63
66
  Button Enable/Disable
64
67
  //////////////////////////////////////////////*/
65
- $.fn.disable = function(newText) {
66
- this.each(function(index, item) {
68
+ $.fn.disable = function (newText) {
69
+ this.each(function (index, item) {
67
70
  var $item = $(item);
68
71
  var isInput = item.tagName == 'INPUT';
69
- newText && $item.data('originalValue', isInput ? $item.val() : $item.html()) && $item[isInput ? 'val' : 'text'](newText);
72
+ newText &&
73
+ $item.data('originalValue', isInput ? $item.val() : $item.html()) &&
74
+ $item[isInput ? 'val' : 'text'](newText);
70
75
  $item.attr('disabled', 'disabled');
71
76
  });
72
77
  return this;
73
- }
78
+ };
74
79
 
75
- $.fn.enable = function() {
76
- this.each(function(index, item) {
80
+ $.fn.enable = function () {
81
+ this.each(function (index, item) {
77
82
  var $item = $(item);
78
83
  $item.removeAttr('disabled');
79
84
  var originalValue = $item.data('originalValue');
80
- originalValue != undefined && $item[item.tagName == 'INPUT' ? 'val' : 'html'](originalValue) && $item.removeData('originalValue');
85
+ originalValue != undefined &&
86
+ $item[item.tagName == 'INPUT' ? 'val' : 'html'](originalValue) &&
87
+ $item.removeData('originalValue');
81
88
  });
82
89
  return this;
83
- }
90
+ };
@@ -1,6 +1,6 @@
1
1
  /*///////////////////////////////////////////////
2
2
  Number Prototype Functions
3
3
  ///////////////////////////////////////////////*/
4
- Number.prototype.format = function() {
4
+ Number.prototype.format = function () {
5
5
  return this.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
6
- }
6
+ };