@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.
- package/.eslintrc.js +16 -0
- package/.prettierrc.json +7 -0
- package/CHANGES.md +6 -3
- package/package.json +26 -13
- package/postcss.config.js +1 -1
- package/src/app.js +2 -2
- package/src/components/ajax-select.vue +10 -6
- package/src/components/alert.vue +25 -27
- package/src/components/index.js +6 -11
- package/src/components/modal.vue +18 -10
- package/src/components/smart-select.vue +8 -6
- package/src/config.js +1 -1
- package/src/directives/autofocus.js +4 -3
- package/src/directives/confirm-button.js +2 -2
- package/src/directives/date-input.js +7 -9
- package/src/directives/datetime.js +11 -9
- package/src/directives/disabled.js +4 -5
- package/src/directives/duration.js +7 -8
- package/src/directives/index.js +1 -1
- package/src/directives/infinite-scroll.js +1 -1
- package/src/directives/readonly.js +5 -6
- package/src/directives/tooltip.js +58 -61
- package/src/directives/user-text.js +1 -1
- package/src/filters/index.js +9 -6
- package/src/helpers/array.js +13 -14
- package/src/helpers/context-menu.js +16 -18
- package/src/helpers/delay.js +1 -1
- package/src/helpers/error.js +6 -9
- package/src/helpers/http.js +27 -25
- package/src/helpers/index.js +1 -1
- package/src/helpers/mask.js +27 -20
- package/src/helpers/number.js +2 -2
- package/src/helpers/string.js +17 -17
- package/src/helpers/vue.js +2 -2
- package/src/index.js +5 -5
- package/src/plugins/index.js +6 -6
- package/src/plugins/infinite-scroll/hook.js +2 -2
- package/src/plugins/infinite-scroll.js +20 -10
- package/src/plugins/resize-watcher.js +2 -4
package/src/helpers/string.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
String.prototype.escapeHtml = function() {
|
|
1
|
+
String.prototype.escapeHtml = function () {
|
|
2
2
|
return this.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
|
3
|
-
}
|
|
3
|
+
};
|
|
4
4
|
|
|
5
|
-
String.prototype.nl2br = function() {
|
|
5
|
+
String.prototype.nl2br = function () {
|
|
6
6
|
return this.replace(/\n/g, '<br>');
|
|
7
|
-
}
|
|
7
|
+
};
|
|
8
8
|
|
|
9
9
|
// this isn't implemented in Vue filters because why would you ever turn something _into_ kebab case for user display?
|
|
10
|
-
String.prototype.kebab = function() {
|
|
10
|
+
String.prototype.kebab = function () {
|
|
11
11
|
return this.replace(/ /g, '-');
|
|
12
|
-
}
|
|
12
|
+
};
|
|
13
13
|
|
|
14
14
|
// TODO: what would this be used for?
|
|
15
|
-
String.prototype.lcfirst = function() {
|
|
15
|
+
String.prototype.lcfirst = function () {
|
|
16
16
|
return this.substr(0, 1).toLowerCase() + this.substr(1);
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
18
|
|
|
19
19
|
// this isn't implemented in Vue filters because why would you ever turn something _into_ Snake case for user display?
|
|
20
|
-
String.prototype.snake = function() {
|
|
20
|
+
String.prototype.snake = function () {
|
|
21
21
|
return this.replace(/ /g, '_');
|
|
22
|
-
}
|
|
22
|
+
};
|
|
23
23
|
|
|
24
|
-
String.prototype.ucfirst = function() {
|
|
24
|
+
String.prototype.ucfirst = function () {
|
|
25
25
|
return this.substr(0, 1).toUpperCase() + this.substr(1);
|
|
26
|
-
}
|
|
26
|
+
};
|
|
27
27
|
|
|
28
|
-
String.prototype.ucwords = function() {
|
|
29
|
-
return this.replace(/^[a-z]| [a-z]/gi, function(value) {
|
|
28
|
+
String.prototype.ucwords = function () {
|
|
29
|
+
return this.replace(/^[a-z]| [a-z]/gi, function (value) {
|
|
30
30
|
return value.toUpperCase();
|
|
31
31
|
});
|
|
32
|
-
}
|
|
32
|
+
};
|
|
33
33
|
|
|
34
|
-
String.prototype.unsnake = function() {
|
|
34
|
+
String.prototype.unsnake = function () {
|
|
35
35
|
return this.replace(/_/g, ' ');
|
|
36
|
-
}
|
|
36
|
+
};
|
package/src/helpers/vue.js
CHANGED
package/src/index.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
// the 'Vue' imports here will _not_ be the same as the 'Vue' imports from the app due to absolute path differences
|
|
3
3
|
// thus, nothing that's attached to Vue here will be attached to Vue there, and everything will be broken
|
|
4
4
|
|
|
5
|
-
import vfConfig from './config';
|
|
6
|
-
|
|
7
|
-
import app, { setRootComponent } from './app';
|
|
8
5
|
import './components';
|
|
9
6
|
import './directives';
|
|
10
|
-
import { registerFilter, registerFilters } from './filters';
|
|
11
7
|
import './helpers';
|
|
12
8
|
import './plugins';
|
|
13
9
|
|
|
10
|
+
import app, { setRootComponent } from './app';
|
|
11
|
+
import vfConfig from './config';
|
|
12
|
+
import { registerFilter, registerFilters } from './filters';
|
|
13
|
+
|
|
14
14
|
export default {
|
|
15
15
|
getApp,
|
|
16
16
|
configure,
|
|
@@ -30,4 +30,4 @@ function mount(rootComponent, target) {
|
|
|
30
30
|
|
|
31
31
|
function getApp() {
|
|
32
32
|
return app;
|
|
33
|
-
}
|
|
33
|
+
}
|
package/src/plugins/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import VueStash from 'vue-stash-nested';
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
app.use(VueStash)
|
|
3
|
+
import app from '../app';
|
|
4
|
+
app.use(VueStash);
|
|
5
5
|
|
|
6
|
-
import InfiniteScroll from './infinite-scroll'
|
|
6
|
+
import InfiniteScroll from './infinite-scroll';
|
|
7
7
|
app.use(InfiniteScroll);
|
|
8
8
|
|
|
9
|
-
import ResizeWatcher from './resize-watcher'
|
|
10
|
-
app.use(ResizeWatcher)
|
|
9
|
+
import ResizeWatcher from './resize-watcher';
|
|
10
|
+
app.use(ResizeWatcher);
|
|
@@ -10,7 +10,7 @@ export default class InfiniteScrollHook {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
install() {
|
|
13
|
-
this.el.addEventListener('scroll', this.onScroll);
|
|
13
|
+
this.el.addEventListener('scroll', this.onScroll);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
uninstall() {
|
|
@@ -27,4 +27,4 @@ export default class InfiniteScrollHook {
|
|
|
27
27
|
this.isTripped = false;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
}
|
|
30
|
+
}
|
|
@@ -3,23 +3,30 @@
|
|
|
3
3
|
import InfiniteScrollHook from './infinite-scroll/hook';
|
|
4
4
|
|
|
5
5
|
class InfiniteScroll {
|
|
6
|
-
static install(app
|
|
6
|
+
static install(app) {
|
|
7
7
|
const scrollableValues = ['auto', 'scroll'];
|
|
8
|
-
const discoverScrollableAncestorEl = function(el) {
|
|
8
|
+
const discoverScrollableAncestorEl = function (el) {
|
|
9
9
|
el = el.parentElement;
|
|
10
10
|
if (!el) return null;
|
|
11
11
|
|
|
12
12
|
const computedStyle = window.getComputedStyle(el);
|
|
13
|
-
if (
|
|
13
|
+
if (
|
|
14
|
+
scrollableValues.includes(computedStyle.overflow) ||
|
|
15
|
+
scrollableValues.includes(computedStyle.overflowX) ||
|
|
16
|
+
scrollableValues.includes(computedStyle.overflowY)
|
|
17
|
+
) {
|
|
14
18
|
return el;
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
return discoverScrollableAncestorEl(el);
|
|
18
22
|
};
|
|
19
23
|
|
|
20
|
-
const installScrollHook = function() {
|
|
24
|
+
const installScrollHook = function () {
|
|
21
25
|
if (this.$options.windowScrolledToBottom) {
|
|
22
|
-
this._windowScrollHook = new InfiniteScrollHook(
|
|
26
|
+
this._windowScrollHook = new InfiniteScrollHook(
|
|
27
|
+
window,
|
|
28
|
+
this.$options.windowScrolledToBottom.bind(this)
|
|
29
|
+
);
|
|
23
30
|
this._windowScrollHook.install();
|
|
24
31
|
}
|
|
25
32
|
|
|
@@ -31,7 +38,10 @@ class InfiniteScroll {
|
|
|
31
38
|
if (this.$options.ancestorScrolledToBottom) {
|
|
32
39
|
const scrollableAncestorEl = discoverScrollableAncestorEl(this.$el);
|
|
33
40
|
if (scrollableAncestorEl) {
|
|
34
|
-
this._ancestorScrollHook = new InfiniteScrollHook(
|
|
41
|
+
this._ancestorScrollHook = new InfiniteScrollHook(
|
|
42
|
+
scrollableAncestorEl,
|
|
43
|
+
this.$options.ancestorScrolledToBottom.bind(this)
|
|
44
|
+
);
|
|
35
45
|
this._ancestorScrollHook.install();
|
|
36
46
|
} else {
|
|
37
47
|
console.warn('no scollable ancestor found for component:', this);
|
|
@@ -39,7 +49,7 @@ class InfiniteScroll {
|
|
|
39
49
|
}
|
|
40
50
|
};
|
|
41
51
|
|
|
42
|
-
const reinstallScrollHook = function() {
|
|
52
|
+
const reinstallScrollHook = function () {
|
|
43
53
|
if (this._windowScrollHandler) {
|
|
44
54
|
this._windowScrollHandler.install();
|
|
45
55
|
}
|
|
@@ -53,7 +63,7 @@ class InfiniteScroll {
|
|
|
53
63
|
}
|
|
54
64
|
};
|
|
55
65
|
|
|
56
|
-
const removeScrollHook = function() {
|
|
66
|
+
const removeScrollHook = function () {
|
|
57
67
|
if (this._windowScrollHandler) {
|
|
58
68
|
this._windowScrollHandler.uninstall();
|
|
59
69
|
}
|
|
@@ -65,7 +75,7 @@ class InfiniteScroll {
|
|
|
65
75
|
if (this._ancestorScrollHook) {
|
|
66
76
|
this._ancestorScrollHook.uninstall();
|
|
67
77
|
}
|
|
68
|
-
}
|
|
78
|
+
};
|
|
69
79
|
|
|
70
80
|
app.mixin({
|
|
71
81
|
mounted() {
|
|
@@ -87,4 +97,4 @@ class InfiniteScroll {
|
|
|
87
97
|
}
|
|
88
98
|
}
|
|
89
99
|
|
|
90
|
-
export default InfiniteScroll;
|
|
100
|
+
export default InfiniteScroll;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import Vue from 'vue'
|
|
2
|
-
|
|
3
1
|
// TODO: find out if we can use the Vue options array for the functions instead of making them part of "methods"
|
|
4
2
|
|
|
5
3
|
class ResizeWatcher {
|
|
6
|
-
static install(app
|
|
4
|
+
static install(app) {
|
|
7
5
|
app.mixin({
|
|
8
6
|
mounted() {
|
|
9
7
|
if (this.$options.windowResized) {
|
|
@@ -27,4 +25,4 @@ class ResizeWatcher {
|
|
|
27
25
|
}
|
|
28
26
|
}
|
|
29
27
|
|
|
30
|
-
export default ResizeWatcher;
|
|
28
|
+
export default ResizeWatcher;
|