@web-utils/component 1.2.4 → 1.2.6
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/README.md +27 -27
- package/dist/chunks/163eed3b.js +16 -1
- package/dist/chunks/2bd4e340.js +184 -0
- package/dist/chunks/6499de3a.js +30 -1
- package/dist/chunks/7af3ceb1.js +75 -0
- package/dist/chunks/86bcadec.js +24 -0
- package/dist/chunks/8bbde9bf.js +81 -1
- package/dist/chunks/90bd3d52.js +26 -1
- package/dist/chunks/92404ceb.js +126 -0
- package/dist/chunks/a73fe8ee.js +11 -0
- package/dist/chunks/df803484.js +60 -0
- package/dist/components/address-input/index.js +113 -1
- package/dist/components/aside-menu/index.js +58 -1
- package/dist/components/awesome-button/index.js +82 -1
- package/dist/components/capsule-tab/index.js +52 -1
- package/dist/components/chunk-file-uploader/index.js +119 -1
- package/dist/components/chunk-file-uploader-button/index.js +60 -1
- package/dist/components/chunk-file-uploader-drop/index.js +65 -1
- package/dist/components/chunk-file-uploader-file/index.js +311 -1
- package/dist/components/chunk-file-uploader-files/index.js +49 -1
- package/dist/components/chunk-file-uploader-list/index.js +50 -1
- package/dist/components/chunk-file-uploader-un-support/index.js +51 -1
- package/dist/components/code-mirror-editor/index.js +310 -6
- package/dist/components/color-picker/index.js +110 -1
- package/dist/components/confirm-button/index.js +57 -1
- package/dist/components/confirmable/index.js +28 -1
- package/dist/components/context-menu/index.js +236 -1
- package/dist/components/custom-scrollbar/index.js +150 -1
- package/dist/components/data-table-picker/index.js +137 -1
- package/dist/components/dynamic-table/index.js +195 -1
- package/dist/components/e-charts/index.js +229 -1
- package/dist/components/editable-progress/index.js +141 -1
- package/dist/components/editable-tree/index.js +789 -1
- package/dist/components/egd-collapse/index.js +79 -1
- package/dist/components/egd-collapse-item/index.js +132 -1
- package/dist/components/el-color-picker-dropdown/index.js +170 -1
- package/dist/components/element-dialog/index.js +242 -1
- package/dist/components/empty-view/index.js +69 -1
- package/dist/components/error-view/index.js +61 -1
- package/dist/components/flex-column/index.js +50 -1
- package/dist/components/flex-item/index.js +66 -1
- package/dist/components/flex-row/index.js +50 -1
- package/dist/components/flex-scroller/index.js +47 -1
- package/dist/components/form-button/index.js +80 -1
- package/dist/components/form-cascader/index.js +151 -1
- package/dist/components/form-checkbox-group/index.js +192 -1
- package/dist/components/form-date-picker/index.js +182 -1
- package/dist/components/form-holder/index.js +90 -1
- package/dist/components/form-input/index.js +106 -1
- package/dist/components/form-input-email/index.js +97 -1
- package/dist/components/form-input-id-card/index.js +104 -1
- package/dist/components/form-input-number/index.js +123 -1
- package/dist/components/form-input-phone-number/index.js +98 -1
- package/dist/components/form-input-time/index.js +124 -1
- package/dist/components/form-item/index.js +120 -1
- package/dist/components/form-item-config-provider/index.js +63 -1
- package/dist/components/form-item-group/index.js +169 -1
- package/dist/components/form-radio-group/index.js +170 -1
- package/dist/components/form-select/index.js +154 -1
- package/dist/components/form-switch/index.js +97 -1
- package/dist/components/form-textarea/index.js +102 -1
- package/dist/components/form-view/index.js +343 -1
- package/dist/components/guide-steps/index.js +94 -1
- package/dist/components/icon-card/index.js +62 -1
- package/dist/components/iframe-window/index.js +99 -1
- package/dist/components/input-number/index.js +274 -1
- package/dist/components/input-number-range/index.js +110 -1
- package/dist/components/j-s-x-component/index.js +16 -1
- package/dist/components/keep-view-alive/index.js +119 -1
- package/dist/components/loading-view/index.js +61 -1
- package/dist/components/nav-bar/index.js +52 -1
- package/dist/components/not-implement/index.js +35 -1
- package/dist/components/page/index.js +40 -1
- package/dist/components/page-header/index.js +56 -1
- package/dist/components/page-index/index.js +151 -1
- package/dist/components/page-index-top/index.js +119 -1
- package/dist/components/page-skeleton/index.js +56 -1
- package/dist/components/page-skeleton-new/index.js +98 -1
- package/dist/components/pageable-table/index.js +429 -1
- package/dist/components/pageable-view/index.js +328 -2
- package/dist/components/photo-swipe/index.js +187 -1
- package/dist/components/resize-observer/index.js +62 -1
- package/dist/components/search-popover/index.js +391 -2
- package/dist/components/sign-panel/index.js +242 -1
- package/dist/components/split-pane/index.js +209 -1
- package/dist/components/stateful/index.js +84 -1
- package/dist/components/static-pageable-table/index.js +92 -1
- package/dist/components/swiper/index.js +158 -1
- package/dist/components/tab/index.js +145 -1
- package/dist/components/tab-item/index.js +73 -1
- package/dist/components/table-column/index.js +89 -1
- package/dist/components/table-view/index.js +363 -1
- package/dist/components/tag-render/index.js +97 -1
- package/dist/components/tinymce-editor/index.js +173 -1
- package/dist/components/tinymce-wrapper/index.js +618 -1
- package/dist/components/toolbar/index.js +217 -1
- package/dist/components/toolbar-button/index.js +90 -1
- package/dist/components/trigger/index.js +71 -1
- package/dist/components/vue-tags-input/index.js +439 -1
- package/dist/components/watermark/index.js +63 -1
- package/dist/components/x-dialog/index.js +173 -1
- package/dist/index.css +2102 -1
- package/dist/index.es.js +2995 -2078
- package/package.json +29 -29
- package/web-types.json +22 -16
- package/dist/chunks/23bd3525.js +0 -1
- package/dist/chunks/65f4f4f2.js +0 -1
- package/dist/chunks/8473fc69.js +0 -1
- package/dist/chunks/addb6ed5.js +0 -1
- package/dist/chunks/b8305633.js +0 -1
- package/dist/chunks/e8547f66.js +0 -1
|
@@ -1 +1,209 @@
|
|
|
1
|
-
import{n as
|
|
1
|
+
import { n as h } from "../../chunks/6499de3a.js";
|
|
2
|
+
function l(t, e) {
|
|
3
|
+
for (let s = 0; s < e.length; s++)
|
|
4
|
+
if (t === e[s])
|
|
5
|
+
return !0;
|
|
6
|
+
return !1;
|
|
7
|
+
}
|
|
8
|
+
const n = function() {
|
|
9
|
+
return document.addEventListener ? function(t, e, s) {
|
|
10
|
+
t && e && s && t.addEventListener(e, s, !1);
|
|
11
|
+
} : function(t, e, s) {
|
|
12
|
+
t && e && s && t.attachEvent(`on${e}`, s);
|
|
13
|
+
};
|
|
14
|
+
}(), a = function() {
|
|
15
|
+
return document.removeEventListener ? function(t, e, s) {
|
|
16
|
+
t && e && t.removeEventListener(e, s, !1);
|
|
17
|
+
} : function(t, e, s) {
|
|
18
|
+
t && e && t.detachEvent(`on${e}`, s);
|
|
19
|
+
};
|
|
20
|
+
}();
|
|
21
|
+
var p = function() {
|
|
22
|
+
var t = this, e = t.$createElement, s = t._self._c || e;
|
|
23
|
+
return s("div", {
|
|
24
|
+
ref: "outerWrapper",
|
|
25
|
+
class: t.wrapperClasses
|
|
26
|
+
}, [t.isHorizontal ? s("div", {
|
|
27
|
+
class: `${t.prefix}-horizontal`
|
|
28
|
+
}, [t.hideLeft ? s("div", {
|
|
29
|
+
class: [`${t.prefix}-pane`, "right-pane"],
|
|
30
|
+
staticStyle: {
|
|
31
|
+
left: "0"
|
|
32
|
+
}
|
|
33
|
+
}, [t._t("right")], 2) : [s("div", {
|
|
34
|
+
class: [`${t.prefix}-pane`, "left-pane"],
|
|
35
|
+
style: {
|
|
36
|
+
right: `${t.anotherOffset}%`
|
|
37
|
+
}
|
|
38
|
+
}, [t._t("left")], 2), s("div", {
|
|
39
|
+
class: `${t.prefix}-trigger-con`,
|
|
40
|
+
style: {
|
|
41
|
+
left: `calc(${t.offset}% + ${t.triggerSize / 2}px)`,
|
|
42
|
+
width: `${t.triggerSize}px`
|
|
43
|
+
},
|
|
44
|
+
on: {
|
|
45
|
+
mousedown: t.handleMousedown
|
|
46
|
+
}
|
|
47
|
+
}, [t._t("trigger", function() {
|
|
48
|
+
return [s("Trigger", {
|
|
49
|
+
attrs: {
|
|
50
|
+
mode: "vertical"
|
|
51
|
+
}
|
|
52
|
+
})];
|
|
53
|
+
})], 2), s("div", {
|
|
54
|
+
class: [`${t.prefix}-pane`, "right-pane"],
|
|
55
|
+
style: {
|
|
56
|
+
left: `calc(${t.offset}% + ${t.triggerSize}px)`
|
|
57
|
+
}
|
|
58
|
+
}, [t._t("right")], 2)]], 2) : s("div", {
|
|
59
|
+
class: `${t.prefix}-vertical`
|
|
60
|
+
}, [s("div", {
|
|
61
|
+
class: [`${t.prefix}-pane`, "top-pane"],
|
|
62
|
+
style: {
|
|
63
|
+
bottom: `${t.anotherOffset}%`
|
|
64
|
+
}
|
|
65
|
+
}, [t._t("top")], 2), s("div", {
|
|
66
|
+
class: `${t.prefix}-trigger-con`,
|
|
67
|
+
style: {
|
|
68
|
+
top: `calc(${t.offset}% + ${t.triggerSize / 2}px)`,
|
|
69
|
+
height: `${t.triggerSize}px`
|
|
70
|
+
},
|
|
71
|
+
on: {
|
|
72
|
+
mousedown: t.handleMousedown
|
|
73
|
+
}
|
|
74
|
+
}, [t._t("trigger", function() {
|
|
75
|
+
return [s("Trigger", {
|
|
76
|
+
attrs: {
|
|
77
|
+
mode: "horizontal"
|
|
78
|
+
}
|
|
79
|
+
})];
|
|
80
|
+
})], 2), s("div", {
|
|
81
|
+
class: [`${t.prefix}-pane`, "bottom-pane"],
|
|
82
|
+
style: {
|
|
83
|
+
top: `calc(${t.offset}% + ${t.triggerSize}px)`
|
|
84
|
+
}
|
|
85
|
+
}, [t._t("bottom")], 2)]), s("ResizeObserver", {
|
|
86
|
+
on: {
|
|
87
|
+
notify: t.resetOffset
|
|
88
|
+
}
|
|
89
|
+
})], 1);
|
|
90
|
+
}, u = [];
|
|
91
|
+
const d = {
|
|
92
|
+
name: "SplitPane",
|
|
93
|
+
props: {
|
|
94
|
+
value: {
|
|
95
|
+
type: [Number, String],
|
|
96
|
+
default: 0.5
|
|
97
|
+
},
|
|
98
|
+
mode: {
|
|
99
|
+
validator(t) {
|
|
100
|
+
return l(t, ["horizontal", "vertical"]);
|
|
101
|
+
},
|
|
102
|
+
default: "horizontal"
|
|
103
|
+
},
|
|
104
|
+
hideLeft: Boolean,
|
|
105
|
+
triggerSize: {
|
|
106
|
+
type: Number,
|
|
107
|
+
default: 6
|
|
108
|
+
},
|
|
109
|
+
min: {
|
|
110
|
+
type: [Number, String],
|
|
111
|
+
default: "40px"
|
|
112
|
+
},
|
|
113
|
+
max: {
|
|
114
|
+
type: [Number, String],
|
|
115
|
+
default: "40px"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
data() {
|
|
119
|
+
return {
|
|
120
|
+
prefix: "egd-split",
|
|
121
|
+
offset: 0,
|
|
122
|
+
oldOffset: 0,
|
|
123
|
+
isMoving: !1
|
|
124
|
+
};
|
|
125
|
+
},
|
|
126
|
+
computed: {
|
|
127
|
+
wrapperClasses() {
|
|
128
|
+
return [`${this.prefix}-wrapper`, this.isMoving ? "no-select" : ""];
|
|
129
|
+
},
|
|
130
|
+
isHorizontal() {
|
|
131
|
+
return this.mode === "horizontal";
|
|
132
|
+
},
|
|
133
|
+
anotherOffset() {
|
|
134
|
+
return 100 - this.offset;
|
|
135
|
+
},
|
|
136
|
+
valueIsPx() {
|
|
137
|
+
return typeof this.value == "string";
|
|
138
|
+
},
|
|
139
|
+
offsetSize() {
|
|
140
|
+
return this.isHorizontal ? "offsetWidth" : "offsetHeight";
|
|
141
|
+
},
|
|
142
|
+
computedMin() {
|
|
143
|
+
return this.getComputedThresholdValue("min");
|
|
144
|
+
},
|
|
145
|
+
computedMax() {
|
|
146
|
+
return this.getComputedThresholdValue("max");
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
watch: {
|
|
150
|
+
value: "resetOffset"
|
|
151
|
+
},
|
|
152
|
+
async mounted() {
|
|
153
|
+
await this.$nextTick(), this.resetOffset();
|
|
154
|
+
},
|
|
155
|
+
methods: {
|
|
156
|
+
resetOffset() {
|
|
157
|
+
this.offset = (this.valueIsPx ? this.px2percent(this.value, this.$refs.outerWrapper[this.offsetSize]) : this.value) * 1e4 / 100;
|
|
158
|
+
},
|
|
159
|
+
px2percent(t, e) {
|
|
160
|
+
return parseFloat(t) / parseFloat(e);
|
|
161
|
+
},
|
|
162
|
+
getComputedThresholdValue(t) {
|
|
163
|
+
const e = this.$refs.outerWrapper[this.offsetSize];
|
|
164
|
+
return this.valueIsPx ? typeof this[t] == "string" ? this[t] : e * this[t] : typeof this[t] == "string" ? this.px2percent(this[t], e) : this[t];
|
|
165
|
+
},
|
|
166
|
+
getMin(t, e) {
|
|
167
|
+
return this.valueIsPx ? `${Math.min(parseFloat(t), parseFloat(e))}px` : Math.min(t, e);
|
|
168
|
+
},
|
|
169
|
+
getMax(t, e) {
|
|
170
|
+
return this.valueIsPx ? `${Math.max(parseFloat(t), parseFloat(e))}px` : Math.max(t, e);
|
|
171
|
+
},
|
|
172
|
+
getAnotherOffset(t) {
|
|
173
|
+
let e = 0;
|
|
174
|
+
return this.valueIsPx ? e = `${this.$refs.outerWrapper[this.offsetSize] - parseFloat(t)}px` : e = 1 - t, e;
|
|
175
|
+
},
|
|
176
|
+
handleMove(t) {
|
|
177
|
+
const s = (this.isHorizontal ? t.pageX : t.pageY) - this.initOffset, r = this.$refs.outerWrapper[this.offsetSize];
|
|
178
|
+
let i = this.valueIsPx ? `${parseFloat(this.oldOffset) + s}px` : this.px2percent(r * this.oldOffset + s, r);
|
|
179
|
+
const o = this.getAnotherOffset(i);
|
|
180
|
+
parseFloat(i) <= parseFloat(this.computedMin) && (i = this.getMax(i, this.computedMin)), parseFloat(o) <= parseFloat(this.computedMax) && (i = this.getAnotherOffset(this.getMax(o, this.computedMax))), t.atMin = this.value === this.computedMin, t.atMax = this.valueIsPx ? this.getAnotherOffset(this.value) === this.computedMax : this.getAnotherOffset(this.value).toFixed(5) === this.computedMax.toFixed(5), this.$emit("input", i), this.$emit("on-moving", t);
|
|
181
|
+
},
|
|
182
|
+
handleUp() {
|
|
183
|
+
this.isMoving = !1, a(window, "mousemove", this.handleMove), a(window, "mouseup", this.handleUp), this.$emit("on-move-end");
|
|
184
|
+
},
|
|
185
|
+
handleMousedown(t) {
|
|
186
|
+
this.initOffset = this.isHorizontal ? t.pageX : t.pageY, this.oldOffset = this.value, this.isMoving = !0, n(window, "mousemove", this.handleMove), n(window, "mouseup", this.handleUp), this.$emit("on-move-start");
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}, f = {};
|
|
190
|
+
var c = /* @__PURE__ */ h(
|
|
191
|
+
d,
|
|
192
|
+
p,
|
|
193
|
+
u,
|
|
194
|
+
!1,
|
|
195
|
+
g,
|
|
196
|
+
null,
|
|
197
|
+
null,
|
|
198
|
+
null
|
|
199
|
+
);
|
|
200
|
+
function g(t) {
|
|
201
|
+
for (let e in f)
|
|
202
|
+
this[e] = f[e];
|
|
203
|
+
}
|
|
204
|
+
const x = /* @__PURE__ */ function() {
|
|
205
|
+
return c.exports;
|
|
206
|
+
}();
|
|
207
|
+
export {
|
|
208
|
+
x as default
|
|
209
|
+
};
|
|
@@ -1 +1,84 @@
|
|
|
1
|
-
import{n as
|
|
1
|
+
import { n as A } from "../../chunks/6499de3a.js";
|
|
2
|
+
const v = {
|
|
3
|
+
name: "Stateful",
|
|
4
|
+
functional: !0,
|
|
5
|
+
props: {
|
|
6
|
+
tag: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: "div"
|
|
9
|
+
},
|
|
10
|
+
draft: {
|
|
11
|
+
type: [Array, Boolean],
|
|
12
|
+
default: () => []
|
|
13
|
+
},
|
|
14
|
+
doing: {
|
|
15
|
+
type: [Array, Boolean],
|
|
16
|
+
default: () => []
|
|
17
|
+
},
|
|
18
|
+
overdue: {
|
|
19
|
+
type: [Array, Boolean],
|
|
20
|
+
default: () => []
|
|
21
|
+
},
|
|
22
|
+
error: {
|
|
23
|
+
type: [Array, Boolean],
|
|
24
|
+
default: () => []
|
|
25
|
+
},
|
|
26
|
+
done: {
|
|
27
|
+
type: [Array, Boolean],
|
|
28
|
+
default: () => []
|
|
29
|
+
},
|
|
30
|
+
closed: {
|
|
31
|
+
type: [Array, Boolean],
|
|
32
|
+
default: () => []
|
|
33
|
+
},
|
|
34
|
+
type: {
|
|
35
|
+
type: String,
|
|
36
|
+
validator: (r) => ["doing", "overdue", "error", "done", "closed"].indexOf(r) > -1
|
|
37
|
+
},
|
|
38
|
+
status: {
|
|
39
|
+
type: [String, Number]
|
|
40
|
+
},
|
|
41
|
+
size: {
|
|
42
|
+
type: String
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
render(r, { props: t, data: y, children: c }) {
|
|
46
|
+
const { draft: n, doing: a, overdue: o, error: s, done: l, closed: d, status: e, tag: _, size: u, type: f } = t, p = {
|
|
47
|
+
draft: Array.isArray(n) ? n.includes(e) : n,
|
|
48
|
+
doing: Array.isArray(a) ? a.includes(e) : a,
|
|
49
|
+
overdue: Array.isArray(o) ? o.includes(e) : o,
|
|
50
|
+
error: Array.isArray(s) ? s.includes(e) : s,
|
|
51
|
+
done: Array.isArray(l) ? l.includes(e) : l,
|
|
52
|
+
closed: Array.isArray(d) ? d.includes(e) : d
|
|
53
|
+
};
|
|
54
|
+
return r(_, y, [
|
|
55
|
+
r("span", {
|
|
56
|
+
style: { width: u, height: u },
|
|
57
|
+
class: ["stateful", f, p]
|
|
58
|
+
}),
|
|
59
|
+
c
|
|
60
|
+
]);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
let g, S;
|
|
64
|
+
const i = {};
|
|
65
|
+
var m = /* @__PURE__ */ A(
|
|
66
|
+
v,
|
|
67
|
+
g,
|
|
68
|
+
S,
|
|
69
|
+
!1,
|
|
70
|
+
B,
|
|
71
|
+
null,
|
|
72
|
+
null,
|
|
73
|
+
null
|
|
74
|
+
);
|
|
75
|
+
function B(r) {
|
|
76
|
+
for (let t in i)
|
|
77
|
+
this[t] = i[t];
|
|
78
|
+
}
|
|
79
|
+
const h = /* @__PURE__ */ function() {
|
|
80
|
+
return m.exports;
|
|
81
|
+
}();
|
|
82
|
+
export {
|
|
83
|
+
h as default
|
|
84
|
+
};
|
|
@@ -1 +1,92 @@
|
|
|
1
|
-
import{chunk as n}
|
|
1
|
+
import { chunk as n } from "lodash";
|
|
2
|
+
import { n as i } from "../../chunks/6499de3a.js";
|
|
3
|
+
var o = function() {
|
|
4
|
+
var e = this, t = e.$createElement, a = e._self._c || t;
|
|
5
|
+
return a("div", {
|
|
6
|
+
staticClass: "static-pageable-table"
|
|
7
|
+
}, [a("ElTable", e._g(e._b({
|
|
8
|
+
attrs: {
|
|
9
|
+
size: "mini",
|
|
10
|
+
data: e.records
|
|
11
|
+
}
|
|
12
|
+
}, "ElTable", e.$attrs, !1), e.$listeners), [e._t("default", function() {
|
|
13
|
+
return [e._v("\u8BF7\u6DFB\u52A0\u8868\u683C\u5217")];
|
|
14
|
+
})], 2), a("ElPagination", {
|
|
15
|
+
attrs: {
|
|
16
|
+
"current-page": e.page.page,
|
|
17
|
+
"hide-on-single-page": !0,
|
|
18
|
+
"page-size": e.page.limit,
|
|
19
|
+
total: e.page.total,
|
|
20
|
+
background: "",
|
|
21
|
+
layout: "total, prev, pager, next"
|
|
22
|
+
},
|
|
23
|
+
on: {
|
|
24
|
+
"current-change": function(s) {
|
|
25
|
+
e.page.page = s;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
})], 1);
|
|
29
|
+
}, l = [];
|
|
30
|
+
const c = {
|
|
31
|
+
name: "StaticPageableTable",
|
|
32
|
+
props: {
|
|
33
|
+
rows: {
|
|
34
|
+
type: Array,
|
|
35
|
+
default: () => []
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
data() {
|
|
39
|
+
return {
|
|
40
|
+
page: {
|
|
41
|
+
total: 0,
|
|
42
|
+
page: 1,
|
|
43
|
+
limit: 25
|
|
44
|
+
},
|
|
45
|
+
records: []
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
computed: {
|
|
49
|
+
observer() {
|
|
50
|
+
return {
|
|
51
|
+
page: this.page.page,
|
|
52
|
+
rows: this.rows
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
watch: {
|
|
57
|
+
rows() {
|
|
58
|
+
this.page.page = 1;
|
|
59
|
+
},
|
|
60
|
+
observer: {
|
|
61
|
+
immediate: !0,
|
|
62
|
+
handler() {
|
|
63
|
+
this.page.total = this.rows.length, this.fetchData();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
methods: {
|
|
68
|
+
fetchData() {
|
|
69
|
+
this.records = n(this.rows, this.page.limit)[this.page.page - 1];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}, r = {};
|
|
73
|
+
var p = /* @__PURE__ */ i(
|
|
74
|
+
c,
|
|
75
|
+
o,
|
|
76
|
+
l,
|
|
77
|
+
!1,
|
|
78
|
+
g,
|
|
79
|
+
null,
|
|
80
|
+
null,
|
|
81
|
+
null
|
|
82
|
+
);
|
|
83
|
+
function g(e) {
|
|
84
|
+
for (let t in r)
|
|
85
|
+
this[t] = r[t];
|
|
86
|
+
}
|
|
87
|
+
const h = /* @__PURE__ */ function() {
|
|
88
|
+
return p.exports;
|
|
89
|
+
}();
|
|
90
|
+
export {
|
|
91
|
+
h as default
|
|
92
|
+
};
|
|
@@ -1 +1,158 @@
|
|
|
1
|
-
import{getEleWidth as
|
|
1
|
+
import { getEleWidth as a } from "@web-utils/core";
|
|
2
|
+
import { n as o } from "../../chunks/6499de3a.js";
|
|
3
|
+
var h = function() {
|
|
4
|
+
var t = this, e = t.$createElement, s = t._self._c || e;
|
|
5
|
+
return s("div", {
|
|
6
|
+
staticClass: "egd-swiper"
|
|
7
|
+
}, [s("ElButton", {
|
|
8
|
+
staticClass: "el-carousel__arrow el-carousel__arrow--left",
|
|
9
|
+
attrs: {
|
|
10
|
+
disabled: t.reachedLeft,
|
|
11
|
+
icon: "el-icon-arrow-left"
|
|
12
|
+
},
|
|
13
|
+
on: {
|
|
14
|
+
click: t.clickLeft
|
|
15
|
+
}
|
|
16
|
+
}), s("div", {
|
|
17
|
+
ref: "swiperBox",
|
|
18
|
+
staticClass: "egd-swiper-box",
|
|
19
|
+
on: {
|
|
20
|
+
wheel: function(i) {
|
|
21
|
+
return i.stopPropagation(), i.preventDefault(), t.onMouseWheel.apply(null, arguments);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}, [s("div", {
|
|
25
|
+
ref: "swiperContent",
|
|
26
|
+
staticClass: "egd-swiper-content",
|
|
27
|
+
style: t.swiperContentStyle
|
|
28
|
+
}, [t._t("default")], 2)]), s("ElButton", {
|
|
29
|
+
staticClass: "el-carousel__arrow el-carousel__arrow--right",
|
|
30
|
+
attrs: {
|
|
31
|
+
disabled: t.reachedRight,
|
|
32
|
+
icon: "el-icon-arrow-right"
|
|
33
|
+
},
|
|
34
|
+
on: {
|
|
35
|
+
click: t.clickRight
|
|
36
|
+
}
|
|
37
|
+
}), s("ResizeObserver", {
|
|
38
|
+
on: {
|
|
39
|
+
notify: t.resize
|
|
40
|
+
}
|
|
41
|
+
})], 1);
|
|
42
|
+
}, l = [];
|
|
43
|
+
const d = {
|
|
44
|
+
name: "Swiper",
|
|
45
|
+
data() {
|
|
46
|
+
return {
|
|
47
|
+
mouseDown: !1,
|
|
48
|
+
swiperBoxWith: 0,
|
|
49
|
+
swiperContentWidth: 0,
|
|
50
|
+
translateX: 0,
|
|
51
|
+
reachedLeft: !0,
|
|
52
|
+
reachedRight: !1,
|
|
53
|
+
childrenWidth: [],
|
|
54
|
+
swiperContentStyle: {
|
|
55
|
+
transitionDuration: "0ms",
|
|
56
|
+
transform: "translate3d(0px, 0px, 0px)"
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
async mounted() {
|
|
61
|
+
await this.layout();
|
|
62
|
+
},
|
|
63
|
+
updated() {
|
|
64
|
+
this.computeContentWidth();
|
|
65
|
+
},
|
|
66
|
+
methods: {
|
|
67
|
+
async layout() {
|
|
68
|
+
await this.$nextTick(), this.computeContentWidth(), this.resize();
|
|
69
|
+
},
|
|
70
|
+
resize() {
|
|
71
|
+
console.log(1), this.swiperBoxWith = this.$refs.swiperBox.offsetWidth;
|
|
72
|
+
},
|
|
73
|
+
computeContentWidth() {
|
|
74
|
+
let t = 0;
|
|
75
|
+
const e = [], { children: s } = this.$refs.swiperContent;
|
|
76
|
+
Array.prototype.forEach.call(s, (i) => {
|
|
77
|
+
const n = a(i);
|
|
78
|
+
t += n, e.push(n);
|
|
79
|
+
}), this.childrenWidth = e, this.swiperContentWidth = t;
|
|
80
|
+
},
|
|
81
|
+
updateDuration(t) {
|
|
82
|
+
this.swiperContentStyle.transitionDuration = t ? "300ms" : "0ms";
|
|
83
|
+
},
|
|
84
|
+
setTranslateX(t) {
|
|
85
|
+
this.swiperContentWidth <= this.swiperBoxWith || (t > 0 ? (this.translateX = 0, this.reachedLeft = !0, this.reachedRight = !1) : t - this.swiperBoxWith < -this.swiperContentWidth ? (this.translateX = -this.swiperContentWidth + this.swiperBoxWith, this.reachedLeft = !1, this.reachedRight = !0) : (this.translateX = t, this.reachedLeft = !1, this.reachedRight = !1), this.swiperContentStyle.transform = `translate3d(${this.translateX}px, 0px, 0px)`);
|
|
86
|
+
},
|
|
87
|
+
clickLeft() {
|
|
88
|
+
this.updateDuration(!0);
|
|
89
|
+
let t = this.translateX + this.swiperBoxWith, e = t;
|
|
90
|
+
if (t < 0) {
|
|
91
|
+
e = 0, t = -t;
|
|
92
|
+
for (let s = 0, i = this.childrenWidth.length; s < i && (e += this.childrenWidth[s], !(e >= t)); s++)
|
|
93
|
+
;
|
|
94
|
+
e = -e;
|
|
95
|
+
}
|
|
96
|
+
this.setTranslateX(e);
|
|
97
|
+
},
|
|
98
|
+
clickRight() {
|
|
99
|
+
this.updateDuration(!0);
|
|
100
|
+
const t = Math.abs(this.translateX - this.swiperBoxWith);
|
|
101
|
+
let e = 0;
|
|
102
|
+
for (let s = 0, i = this.childrenWidth.length; s < i; s++)
|
|
103
|
+
if (e += this.childrenWidth[s], e >= t) {
|
|
104
|
+
e > t && (e -= this.childrenWidth[s]);
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
this.setTranslateX(-e);
|
|
108
|
+
},
|
|
109
|
+
onMouseWheel(t) {
|
|
110
|
+
this.updateDuration(!0), t.deltaMode === WheelEvent.DOM_DELTA_LINE ? this.setTranslateX(this.translateX - t.deltaY * 30) : t.deltaMode === WheelEvent.DOM_DELTA_PAGE ? t.deltaY > 0 ? this.clickRight() : this.clickLeft() : this.setTranslateX(this.translateX - t.deltaY);
|
|
111
|
+
},
|
|
112
|
+
onMouseDown(t) {
|
|
113
|
+
this.mouseDown = !0, this.startX = t.clientX, this.translateXRaw = this.translateX, window.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), window.addEventListener("mouseup", this.onMouseUp, { passive: !1 });
|
|
114
|
+
},
|
|
115
|
+
onMouseUp(t) {
|
|
116
|
+
this.mouseDown = !1, this.updateDuration(!0), this.$refs.swiperContent.addEventListener("transitionend", this.transitionend), this.$refs.swiperContent.addEventListener("webkitTransitionEnd", this.transitionend);
|
|
117
|
+
const e = t.clientX - this.startX;
|
|
118
|
+
if (e < 0) {
|
|
119
|
+
const s = this.translateX + e;
|
|
120
|
+
this.setTranslateX(s);
|
|
121
|
+
}
|
|
122
|
+
if (e > 0) {
|
|
123
|
+
const s = this.translateX + e;
|
|
124
|
+
this.setTranslateX(s);
|
|
125
|
+
}
|
|
126
|
+
window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("mouseup", this.onMouseUp);
|
|
127
|
+
},
|
|
128
|
+
onMouseMove(t) {
|
|
129
|
+
this.mouseDown && requestAnimationFrame(() => {
|
|
130
|
+
const e = t.clientX - this.startX, s = this.translateXRaw + e;
|
|
131
|
+
this.setTranslateX(s);
|
|
132
|
+
});
|
|
133
|
+
},
|
|
134
|
+
transitionend() {
|
|
135
|
+
this.updateDuration(!1), this.$refs.swiperContent.removeEventListener("transitionend", this.transitionend), this.$refs.swiperContent.removeEventListener("webkitTransitionEnd", this.transitionend);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}, r = {};
|
|
139
|
+
var c = /* @__PURE__ */ o(
|
|
140
|
+
d,
|
|
141
|
+
h,
|
|
142
|
+
l,
|
|
143
|
+
!1,
|
|
144
|
+
u,
|
|
145
|
+
null,
|
|
146
|
+
null,
|
|
147
|
+
null
|
|
148
|
+
);
|
|
149
|
+
function u(t) {
|
|
150
|
+
for (let e in r)
|
|
151
|
+
this[e] = r[e];
|
|
152
|
+
}
|
|
153
|
+
const w = /* @__PURE__ */ function() {
|
|
154
|
+
return c.exports;
|
|
155
|
+
}();
|
|
156
|
+
export {
|
|
157
|
+
w as default
|
|
158
|
+
};
|