@signal24/vue-foundation 3.1.0 → 3.3.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/package.json
CHANGED
package/src/components/alert.vue
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<modal class="vf-alert" :class="classes">
|
|
3
|
-
<
|
|
3
|
+
<template v-if="!this.isBare" v-slot:header>
|
|
4
|
+
<h1>{{ title }}</h1>
|
|
5
|
+
</template>
|
|
4
6
|
|
|
5
7
|
<div v-if="isHtml" v-html="message" class="user-message"></div>
|
|
6
8
|
<div v-else v-user-text="message"></div>
|
|
7
9
|
|
|
8
|
-
<template v-if="!this.isBare" slot
|
|
10
|
+
<template v-if="!this.isBare" v-slot:footer>
|
|
9
11
|
<template v-if="shouldConfirm">
|
|
10
12
|
<button class="primary" @click="ok" v-autofocus>Confirm</button>
|
|
11
13
|
<button class="default" @click="$dismiss()">Cancel</button>
|
package/src/helpers/array.js
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(Array.prototype, 'diff', {
|
|
|
7
7
|
return false;
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
return true;
|
|
12
12
|
});
|
|
13
13
|
}
|
|
@@ -29,19 +29,12 @@ Object.defineProperty(Array.prototype, 'intersect', {
|
|
|
29
29
|
return true;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
return false;
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
Object.defineProperty(Array.prototype, 'unique', {
|
|
39
|
-
enumerable: false,
|
|
40
|
-
value: function() {
|
|
41
|
-
return [...new Set(this)]
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
|
|
45
38
|
Object.defineProperty(Array.prototype, 'keyBy', {
|
|
46
39
|
enumerable: false,
|
|
47
40
|
value: function(keyProp) {
|
|
@@ -77,7 +70,7 @@ Object.defineProperty(Array.prototype, 'pluck', {
|
|
|
77
70
|
Object.defineProperty(Array.prototype, 'remove', {
|
|
78
71
|
enumerable: false,
|
|
79
72
|
value: function(element) {
|
|
80
|
-
|
|
73
|
+
const index = this.indexOf(element);
|
|
81
74
|
index > -1 && this.splice(index, 1);
|
|
82
75
|
}
|
|
83
76
|
});
|
|
@@ -85,7 +78,7 @@ Object.defineProperty(Array.prototype, 'remove', {
|
|
|
85
78
|
Object.defineProperty(Array.prototype, 'replace', {
|
|
86
79
|
enumerable: false,
|
|
87
80
|
value: function(element, replacement) {
|
|
88
|
-
|
|
81
|
+
const index = this.indexOf(element);
|
|
89
82
|
index > -1 && this.splice(index, 1, replacement);
|
|
90
83
|
}
|
|
91
84
|
});
|
|
@@ -98,3 +91,10 @@ Object.defineProperty(Array.prototype, 'sortBy', {
|
|
|
98
91
|
});
|
|
99
92
|
}
|
|
100
93
|
});
|
|
94
|
+
|
|
95
|
+
Object.defineProperty(Array.prototype, 'unique', {
|
|
96
|
+
enumerable: false,
|
|
97
|
+
value: function() {
|
|
98
|
+
return [...new Set(this)]
|
|
99
|
+
}
|
|
100
|
+
});
|
package/src/helpers/error.js
CHANGED
|
@@ -15,6 +15,12 @@ app.config.globalProperties.$reportError = err => {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
app.config.globalProperties.$throwUserError = msg => {
|
|
19
|
+
let err = new Error(msg);
|
|
20
|
+
err.code = 'USERERR';
|
|
21
|
+
throw err;
|
|
22
|
+
};
|
|
23
|
+
|
|
18
24
|
Object.defineProperty(Error.prototype, 'userMessage', {
|
|
19
25
|
get() {
|
|
20
26
|
if (this.code == 'USERERR')
|
package/src/helpers/index.js
CHANGED
|
@@ -4,6 +4,19 @@ import InfiniteScrollHook from './infinite-scroll/hook';
|
|
|
4
4
|
|
|
5
5
|
class InfiniteScroll {
|
|
6
6
|
static install(app, options) {
|
|
7
|
+
const scrollableValues = ['auto', 'scroll'];
|
|
8
|
+
const discoverScrollableAncestorEl = function(el) {
|
|
9
|
+
el = el.parentElement;
|
|
10
|
+
if (!el) return null;
|
|
11
|
+
|
|
12
|
+
const computedStyle = window.getComputedStyle(el);
|
|
13
|
+
if (scrollableValues.includes(computedStyle.overflow) || scrollableValues.includes(computedStyle.overflowX) || scrollableValues.includes(computedStyle.overflowY)) {
|
|
14
|
+
return el;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return discoverScrollableAncestorEl(el);
|
|
18
|
+
};
|
|
19
|
+
|
|
7
20
|
const installScrollHook = function() {
|
|
8
21
|
if (this.$options.windowScrolledToBottom) {
|
|
9
22
|
this._windowScrollHook = new InfiniteScrollHook(window, this.$options.windowScrolledToBottom.bind(this));
|
|
@@ -14,6 +27,16 @@ class InfiniteScroll {
|
|
|
14
27
|
this._elScrollHook = new InfiniteScrollHook(this.$el, this.$options.elScrolledToBottom.bind(this));
|
|
15
28
|
this._elScrollHook.install();
|
|
16
29
|
}
|
|
30
|
+
|
|
31
|
+
if (this.$options.ancestorScrolledToBottom) {
|
|
32
|
+
const scrollableAncestorEl = discoverScrollableAncestorEl(this.$el);
|
|
33
|
+
if (scrollableAncestorEl) {
|
|
34
|
+
this._ancestorScrollHook = new InfiniteScrollHook(scrollableAncestorEl, this.$options.ancestorScrolledToBottom.bind(this));
|
|
35
|
+
this._ancestorScrollHook.install();
|
|
36
|
+
} else {
|
|
37
|
+
console.warn('no scollable ancestor found for component:', this);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
17
40
|
};
|
|
18
41
|
|
|
19
42
|
const reinstallScrollHook = function() {
|
|
@@ -24,6 +47,10 @@ class InfiniteScroll {
|
|
|
24
47
|
if (this._elScrollHandler) {
|
|
25
48
|
this._elScrollHandler.install();
|
|
26
49
|
}
|
|
50
|
+
|
|
51
|
+
if (this._ancestorScrollHook) {
|
|
52
|
+
this._ancestorScrollHook.install();
|
|
53
|
+
}
|
|
27
54
|
};
|
|
28
55
|
|
|
29
56
|
const removeScrollHook = function() {
|
|
@@ -34,6 +61,10 @@ class InfiniteScroll {
|
|
|
34
61
|
if (this._elScrollHandler) {
|
|
35
62
|
this._elScrollHandler.uninstall();
|
|
36
63
|
}
|
|
64
|
+
|
|
65
|
+
if (this._ancestorScrollHook) {
|
|
66
|
+
this._ancestorScrollHook.uninstall();
|
|
67
|
+
}
|
|
37
68
|
}
|
|
38
69
|
|
|
39
70
|
app.mixin({
|