@web-utils/component 2.8.30 → 2.9.0
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/custom-scrollbar/index.mjs +60 -111
- package/package.json +7 -2
- package/web-types.json +10 -18
|
@@ -1,93 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}, a = (t, e) => h(t, d(e));
|
|
13
|
-
import r from "overlayscrollbars";
|
|
14
|
-
import "overlayscrollbars/css/OverlayScrollbars.css";
|
|
15
|
-
import { n as f } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
|
|
16
|
-
var u = function() {
|
|
17
|
-
var t = this, e = t.$createElement, s = t._self._c || e;
|
|
18
|
-
return s("div", {
|
|
19
|
-
staticClass: "os-host"
|
|
20
|
-
}, [s("div", {
|
|
21
|
-
staticClass: "os-resize-observer-host"
|
|
22
|
-
}), s("div", {
|
|
23
|
-
staticClass: "os-padding"
|
|
24
|
-
}, [s("div", {
|
|
25
|
-
ref: "viewport",
|
|
26
|
-
staticClass: "os-viewport"
|
|
27
|
-
}, [s("div", {
|
|
28
|
-
ref: "content",
|
|
29
|
-
staticClass: "os-content"
|
|
30
|
-
}, [t._t("default")], 2)])]), t._m(0), t._m(1), s("div", {
|
|
31
|
-
staticClass: "os-scrollbar-corner"
|
|
32
|
-
})]);
|
|
33
|
-
}, m = [function() {
|
|
34
|
-
var t = this, e = t.$createElement, s = t._self._c || e;
|
|
35
|
-
return s("div", {
|
|
36
|
-
staticClass: "os-scrollbar os-scrollbar-horizontal "
|
|
37
|
-
}, [s("div", {
|
|
38
|
-
staticClass: "os-scrollbar-track"
|
|
39
|
-
}, [s("div", {
|
|
40
|
-
staticClass: "os-scrollbar-handle"
|
|
41
|
-
})])]);
|
|
42
|
-
}, function() {
|
|
43
|
-
var t = this, e = t.$createElement, s = t._self._c || e;
|
|
44
|
-
return s("div", {
|
|
45
|
-
staticClass: "os-scrollbar os-scrollbar-vertical"
|
|
46
|
-
}, [s("div", {
|
|
47
|
-
staticClass: "os-scrollbar-track"
|
|
48
|
-
}, [s("div", {
|
|
49
|
-
staticClass: "os-scrollbar-handle"
|
|
50
|
-
})])]);
|
|
51
|
-
}];
|
|
52
|
-
const _ = {
|
|
1
|
+
import "overlayscrollbars/overlayscrollbars.css";
|
|
2
|
+
import { OverlayScrollbars as r } from "overlayscrollbars";
|
|
3
|
+
import c from "lodash/defaults";
|
|
4
|
+
import { n as a } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
|
|
5
|
+
var h = function() {
|
|
6
|
+
var t = this, e = t.$createElement, o = t._self._c || e;
|
|
7
|
+
return o(t.element, {
|
|
8
|
+
tag: "Component"
|
|
9
|
+
}, [t._t("default")], 2);
|
|
10
|
+
}, p = [];
|
|
11
|
+
const u = {
|
|
53
12
|
name: "CustomScrollbar",
|
|
54
13
|
props: {
|
|
55
|
-
|
|
56
|
-
type:
|
|
57
|
-
default:
|
|
58
|
-
},
|
|
59
|
-
extensions: {
|
|
60
|
-
type: [String, Array, Object],
|
|
61
|
-
default: void 0
|
|
14
|
+
element: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: "div"
|
|
62
17
|
},
|
|
18
|
+
options: Object,
|
|
63
19
|
theme: {
|
|
64
20
|
type: String,
|
|
65
|
-
default:
|
|
66
|
-
},
|
|
67
|
-
onLoadMore: {
|
|
68
|
-
type: Function,
|
|
69
|
-
default: null
|
|
70
|
-
},
|
|
71
|
-
onScroll: {
|
|
72
|
-
type: Function
|
|
73
|
-
},
|
|
74
|
-
reverse: {
|
|
75
|
-
type: Boolean,
|
|
76
|
-
default: !1
|
|
21
|
+
default: "os-theme-dark"
|
|
77
22
|
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
23
|
+
onLoadMore: Function,
|
|
24
|
+
onScroll: Function,
|
|
25
|
+
reverse: Boolean
|
|
26
|
+
},
|
|
27
|
+
data() {
|
|
28
|
+
return {
|
|
29
|
+
scrollTop: 0
|
|
30
|
+
};
|
|
82
31
|
},
|
|
83
32
|
computed: {
|
|
84
33
|
innerOptions() {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
34
|
+
return c(
|
|
35
|
+
{
|
|
36
|
+
scrollbars: { autoHide: "leave", autoHideDelay: 100, theme: this.theme }
|
|
37
|
+
},
|
|
38
|
+
this.options
|
|
39
|
+
);
|
|
91
40
|
}
|
|
92
41
|
},
|
|
93
42
|
watch: {
|
|
@@ -97,71 +46,71 @@ const _ = {
|
|
|
97
46
|
}
|
|
98
47
|
},
|
|
99
48
|
mounted() {
|
|
100
|
-
this.
|
|
101
|
-
this
|
|
102
|
-
this.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
this.extensions
|
|
49
|
+
this.scroller = r(
|
|
50
|
+
this.$el,
|
|
51
|
+
this.innerOptions,
|
|
52
|
+
{
|
|
53
|
+
scroll: this.internalScroll,
|
|
54
|
+
initialized: this.initialized
|
|
55
|
+
}
|
|
108
56
|
);
|
|
109
57
|
},
|
|
110
58
|
activated() {
|
|
111
59
|
var t;
|
|
112
|
-
this
|
|
60
|
+
this.viewport.scrollTop = (t = this.scrollTop) != null ? t : 0;
|
|
113
61
|
},
|
|
114
62
|
deactivated() {
|
|
115
|
-
this.
|
|
63
|
+
this.scrollTop = this.viewport.scrollTop;
|
|
116
64
|
},
|
|
117
65
|
beforeDestroy() {
|
|
118
66
|
const t = this.scroller;
|
|
119
67
|
r.valid(t) && (t.destroy(), this.scroller = null);
|
|
120
68
|
},
|
|
121
69
|
methods: {
|
|
70
|
+
initialized(t) {
|
|
71
|
+
const { viewport: e } = t.elements();
|
|
72
|
+
this.viewport = e;
|
|
73
|
+
},
|
|
122
74
|
scrollBottom() {
|
|
123
|
-
this
|
|
75
|
+
this.viewport.scrollTop = this.viewport.scrollHeight;
|
|
124
76
|
},
|
|
125
77
|
getScroller() {
|
|
126
78
|
return this.scroller;
|
|
127
79
|
},
|
|
128
80
|
getScrollHeight() {
|
|
129
|
-
return this
|
|
81
|
+
return this.viewport.scrollHeight;
|
|
130
82
|
},
|
|
131
83
|
setScrollTop(t) {
|
|
132
|
-
this
|
|
133
|
-
},
|
|
134
|
-
getContentWrapper() {
|
|
135
|
-
return this.textarea ? this.$refs.content.querySelector("textarea") : this.$el;
|
|
84
|
+
this.viewport.scrollTop = t;
|
|
136
85
|
},
|
|
137
|
-
internalScroll(t) {
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
if (!this.reverse && Math.ceil(
|
|
141
|
-
this.onLoadMore
|
|
86
|
+
internalScroll(t, e) {
|
|
87
|
+
var l, i, s;
|
|
88
|
+
const o = this.viewport;
|
|
89
|
+
if ((l = this.onScroll) == null || l.call(this, e), !this.reverse && Math.ceil(o.clientHeight + o.scrollTop) >= o.scrollHeight) {
|
|
90
|
+
(i = this.onLoadMore) == null || i.call(this);
|
|
142
91
|
return;
|
|
143
92
|
}
|
|
144
|
-
this.reverse &&
|
|
93
|
+
this.reverse && o.scrollTop === 0 && ((s = this.onLoadMore) == null || s.call(this));
|
|
145
94
|
}
|
|
146
95
|
}
|
|
147
96
|
}, n = {};
|
|
148
|
-
var
|
|
149
|
-
_,
|
|
97
|
+
var d = /* @__PURE__ */ a(
|
|
150
98
|
u,
|
|
151
|
-
|
|
99
|
+
h,
|
|
100
|
+
p,
|
|
152
101
|
!1,
|
|
153
|
-
|
|
102
|
+
v,
|
|
154
103
|
null,
|
|
155
104
|
null,
|
|
156
105
|
null
|
|
157
106
|
);
|
|
158
|
-
function
|
|
107
|
+
function v(t) {
|
|
159
108
|
for (let e in n)
|
|
160
109
|
this[e] = n[e];
|
|
161
110
|
}
|
|
162
|
-
const
|
|
163
|
-
return
|
|
111
|
+
const g = /* @__PURE__ */ function() {
|
|
112
|
+
return d.exports;
|
|
164
113
|
}();
|
|
165
114
|
export {
|
|
166
|
-
|
|
115
|
+
g as default
|
|
167
116
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@web-utils/component",
|
|
3
3
|
"description": "Web Components",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.9.0",
|
|
5
5
|
"author": "Simple",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -13,5 +13,10 @@
|
|
|
13
13
|
},
|
|
14
14
|
"./*": "./*"
|
|
15
15
|
},
|
|
16
|
-
"web-types": "web-types.json"
|
|
16
|
+
"web-types": "web-types.json",
|
|
17
|
+
"sideEffects": [
|
|
18
|
+
"*.css",
|
|
19
|
+
"*.scss",
|
|
20
|
+
"*.sass"
|
|
21
|
+
]
|
|
17
22
|
}
|
package/web-types.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"framework": "vue",
|
|
4
4
|
"name": "@web-utils/component",
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.9.0",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"description-markup": "markdown",
|
|
@@ -1027,20 +1027,20 @@
|
|
|
1027
1027
|
"description": "",
|
|
1028
1028
|
"attributes": [
|
|
1029
1029
|
{
|
|
1030
|
-
"name": "
|
|
1030
|
+
"name": "element",
|
|
1031
1031
|
"value": {
|
|
1032
1032
|
"kind": "expression",
|
|
1033
|
-
"type": "
|
|
1033
|
+
"type": "string"
|
|
1034
1034
|
},
|
|
1035
|
-
"default": "
|
|
1035
|
+
"default": "'div'"
|
|
1036
1036
|
},
|
|
1037
1037
|
{
|
|
1038
|
-
"name": "
|
|
1038
|
+
"name": "options",
|
|
1039
1039
|
"value": {
|
|
1040
1040
|
"kind": "expression",
|
|
1041
|
-
"type": "
|
|
1041
|
+
"type": "object"
|
|
1042
1042
|
},
|
|
1043
|
-
"default": "
|
|
1043
|
+
"default": ""
|
|
1044
1044
|
},
|
|
1045
1045
|
{
|
|
1046
1046
|
"name": "theme",
|
|
@@ -1048,7 +1048,7 @@
|
|
|
1048
1048
|
"kind": "expression",
|
|
1049
1049
|
"type": "string"
|
|
1050
1050
|
},
|
|
1051
|
-
"default": "
|
|
1051
|
+
"default": "'os-theme-dark'"
|
|
1052
1052
|
},
|
|
1053
1053
|
{
|
|
1054
1054
|
"name": "onLoadMore",
|
|
@@ -1056,7 +1056,7 @@
|
|
|
1056
1056
|
"kind": "expression",
|
|
1057
1057
|
"type": "func"
|
|
1058
1058
|
},
|
|
1059
|
-
"default": "
|
|
1059
|
+
"default": ""
|
|
1060
1060
|
},
|
|
1061
1061
|
{
|
|
1062
1062
|
"name": "onScroll",
|
|
@@ -1072,15 +1072,7 @@
|
|
|
1072
1072
|
"kind": "expression",
|
|
1073
1073
|
"type": "boolean"
|
|
1074
1074
|
},
|
|
1075
|
-
"default": "
|
|
1076
|
-
},
|
|
1077
|
-
{
|
|
1078
|
-
"name": "textarea",
|
|
1079
|
-
"value": {
|
|
1080
|
-
"kind": "expression",
|
|
1081
|
-
"type": "boolean"
|
|
1082
|
-
},
|
|
1083
|
-
"default": "false"
|
|
1075
|
+
"default": ""
|
|
1084
1076
|
}
|
|
1085
1077
|
],
|
|
1086
1078
|
"slots": [
|