dld-vue-ui 0.0.7 → 0.0.9
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 +52 -20
- package/dist/dld-vue-ui.js +230 -115
- package/dist/dld-vue-ui.umd.cjs +1 -1
- package/dist/packages/{component/SplitPanes → SplitPanes}/index.vue.d.ts +0 -8
- package/dist/packages/UpLoadFile/index.vue.d.ts +61 -0
- package/dist/packages/index.d.ts +3 -4
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/packages/component/Button/index.d.ts +0 -2
- package/dist/packages/component/Button/index.vue.d.ts +0 -18
- package/dist/packages/component/P/index.d.ts +0 -2
- package/dist/packages/component/P/index.vue.d.ts +0 -18
- /package/dist/packages/{component/SplitPanes → SplitPanes}/index.d.ts +0 -0
- /package/dist/packages/{component/SplitPanes → SplitPanes}/pane.vue.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,20 +1,52 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
# 分割面板
|
|
2
|
+
|
|
3
|
+
## Splitpanes
|
|
4
|
+
|
|
5
|
+
属性
|
|
6
|
+
|
|
7
|
+
|属性名|说明|类型|默认值|
|
|
8
|
+
|-----|----|-----|----|
|
|
9
|
+
|`horizontal`|布局方向|`bool`|`false`|
|
|
10
|
+
|`styles`|样式|`ISplitPaneStyle`|`{ width: '100%', height: '100%' }`|
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
interface ISplitPaneStyle {
|
|
14
|
+
[name: string]: string | number,
|
|
15
|
+
width: string,
|
|
16
|
+
height: string
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Pane
|
|
21
|
+
|
|
22
|
+
属性
|
|
23
|
+
|
|
24
|
+
|属性名|说明|类型|默认值|
|
|
25
|
+
|-----|----|-----|----|
|
|
26
|
+
|`styles`|样式|`IPaneStyle`||
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
interface IPaneStyle {
|
|
30
|
+
[name: string]: string | number
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## UpLoadFile
|
|
35
|
+
|
|
36
|
+
属性
|
|
37
|
+
|属性名|说明|类型|默认值|
|
|
38
|
+
|-----|----|-----|----|
|
|
39
|
+
|`size`|组件大小|`small | default | large`|`default`|
|
|
40
|
+
|`name`|上传按钮名称|`string`|上传文件|
|
|
41
|
+
|`icon`|自`@element-plus/icons-vue`导入的图标|`Component`|`Upload`|
|
|
42
|
+
|`type`|选择文件和上传文件的按钮类型|`ButtonType`|`success`|
|
|
43
|
+
|
|
44
|
+
方法
|
|
45
|
+
|方法名|说明|类型|默认值|
|
|
46
|
+
|-----|----|-----|----|
|
|
47
|
+
|`upload`|上传文件方法,返回选中的File|`Function`|`(file: File): void`|
|
|
48
|
+
|
|
49
|
+
暴露变量
|
|
50
|
+
|变量名|说明|类型|默认值|
|
|
51
|
+
|-----|----|-----|----|
|
|
52
|
+
|`Clear`|清空选中文件|`Function`||
|
package/dist/dld-vue-ui.js
CHANGED
|
@@ -1,28 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
3
|
-
__name: "index",
|
|
4
|
-
props: {
|
|
5
|
-
name: { type: String, required: !1, default: "\u9ED8\u8BA4\u6309\u94AE" }
|
|
6
|
-
},
|
|
7
|
-
setup(e) {
|
|
8
|
-
const t = e;
|
|
9
|
-
return (n, i) => (l(), u("button", null, v(t.name), 1));
|
|
10
|
-
}
|
|
11
|
-
}), d = (e, t) => {
|
|
12
|
-
const n = e.__vccOpts || e;
|
|
13
|
-
for (const [i, s] of t)
|
|
14
|
-
n[i] = s;
|
|
15
|
-
return n;
|
|
16
|
-
}, y = /* @__PURE__ */ d(M, [["__file", "D:/Code/front/dld-vue-ui/src/packages/component/Button/index.vue"]]), C = /* @__PURE__ */ p({
|
|
17
|
-
__name: "index",
|
|
18
|
-
props: {
|
|
19
|
-
title: { type: String, required: !1, default: "\u9ED8\u8BA4\u5B57\u6BB5" }
|
|
20
|
-
},
|
|
21
|
-
setup(e) {
|
|
22
|
-
const t = e;
|
|
23
|
-
return (n, i) => (l(), u("p", null, v(t.title), 1));
|
|
24
|
-
}
|
|
25
|
-
}), k = /* @__PURE__ */ d(C, [["__file", "D:/Code/front/dld-vue-ui/src/packages/component/P/index.vue"]]), E = {
|
|
1
|
+
import { h as E, openBlock as u, createElementBlock as m, normalizeStyle as v, renderSlot as f, defineComponent as x, createBlock as w, unref as d, withCtx as p, createElementVNode as c, ref as b, onMounted as k, resolveComponent as N, createVNode as g, createTextVNode as y, withDirectives as $, vShow as R, toDisplayString as M } from "vue";
|
|
2
|
+
const D = {
|
|
26
3
|
name: "splitpanes",
|
|
27
4
|
emits: ["ready", "resize", "resized", "pane-click", "pane-maximize", "pane-add", "pane-remove", "splitter-click"],
|
|
28
5
|
props: {
|
|
@@ -94,16 +71,16 @@ const M = /* @__PURE__ */ p({
|
|
|
94
71
|
},
|
|
95
72
|
onSplitterDblClick(e, t) {
|
|
96
73
|
let n = 0;
|
|
97
|
-
this.panes = this.panes.map((
|
|
74
|
+
this.panes = this.panes.map((s, i) => (s.size = i === t ? s.max : s.min, i !== t && (n += s.min), s)), this.panes[t].size -= n, this.$emit("pane-maximize", this.panes[t]), this.$emit("resized", this.panes.map((s) => ({ min: s.min, max: s.max, size: s.size })));
|
|
98
75
|
},
|
|
99
76
|
onPaneClick(e, t) {
|
|
100
77
|
this.$emit("pane-click", this.indexedPanes[t]);
|
|
101
78
|
},
|
|
102
79
|
getCurrentMouseDrag(e) {
|
|
103
|
-
const t = this.container.getBoundingClientRect(), { clientX: n, clientY:
|
|
80
|
+
const t = this.container.getBoundingClientRect(), { clientX: n, clientY: s } = "ontouchstart" in window && e.touches ? e.touches[0] : e;
|
|
104
81
|
return {
|
|
105
82
|
x: n - t.left,
|
|
106
|
-
y:
|
|
83
|
+
y: s - t.top
|
|
107
84
|
};
|
|
108
85
|
},
|
|
109
86
|
getCurrentDragPercentage(e) {
|
|
@@ -119,38 +96,38 @@ const M = /* @__PURE__ */ p({
|
|
|
119
96
|
prevReachedMinPanes: 0,
|
|
120
97
|
nextReachedMinPanes: 0
|
|
121
98
|
};
|
|
122
|
-
const
|
|
123
|
-
let o = [t, t + 1], r = this.panes[o[0]] || null,
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
126
|
-
|
|
99
|
+
const s = 0 + (this.pushOtherPanes ? 0 : n.prevPanesSize), i = 100 - (this.pushOtherPanes ? 0 : n.nextPanesSize), a = Math.max(Math.min(this.getCurrentDragPercentage(e), i), s);
|
|
100
|
+
let o = [t, t + 1], r = this.panes[o[0]] || null, l = this.panes[o[1]] || null;
|
|
101
|
+
const h = r.max < 100 && a >= r.max + n.prevPanesSize, P = l.max < 100 && a <= 100 - (l.max + this.sumNextPanesSize(t + 1));
|
|
102
|
+
if (h || P) {
|
|
103
|
+
h ? (r.size = r.max, l.size = Math.max(100 - r.max - n.prevPanesSize - n.nextPanesSize, 0)) : (r.size = Math.max(100 - l.max - n.prevPanesSize - this.sumNextPanesSize(t + 1), 0), l.size = l.max);
|
|
127
104
|
return;
|
|
128
105
|
}
|
|
129
106
|
if (this.pushOtherPanes) {
|
|
130
|
-
const
|
|
131
|
-
if (!
|
|
107
|
+
const z = this.doPushOtherPanes(n, a);
|
|
108
|
+
if (!z)
|
|
132
109
|
return;
|
|
133
|
-
({ sums: n, panesToResize: o } =
|
|
110
|
+
({ sums: n, panesToResize: o } = z), r = this.panes[o[0]] || null, l = this.panes[o[1]] || null;
|
|
134
111
|
}
|
|
135
|
-
r !== null && (r.size = Math.min(Math.max(a - n.prevPanesSize - n.prevReachedMinPanes, r.min), r.max)),
|
|
112
|
+
r !== null && (r.size = Math.min(Math.max(a - n.prevPanesSize - n.prevReachedMinPanes, r.min), r.max)), l !== null && (l.size = Math.min(Math.max(100 - a - n.nextPanesSize - n.nextReachedMinPanes, l.min), l.max));
|
|
136
113
|
},
|
|
137
114
|
doPushOtherPanes(e, t) {
|
|
138
|
-
const n = this.touch.activeSplitter,
|
|
139
|
-
return t < e.prevPanesSize + this.panes[
|
|
140
|
-
a >
|
|
141
|
-
}), e.prevPanesSize = this.sumPrevPanesSize(
|
|
142
|
-
a > 0 && a <= n && (
|
|
143
|
-
}), this.panes[
|
|
144
|
-
a > n && a <
|
|
145
|
-
}), e.nextPanesSize = this.sumNextPanesSize(
|
|
146
|
-
a < this.panesCount - 1 && a >= n + 1 && (
|
|
147
|
-
}), this.panes[
|
|
115
|
+
const n = this.touch.activeSplitter, s = [n, n + 1];
|
|
116
|
+
return t < e.prevPanesSize + this.panes[s[0]].min && (s[0] = this.findPrevExpandedPane(n).index, e.prevReachedMinPanes = 0, s[0] < n && this.panes.forEach((i, a) => {
|
|
117
|
+
a > s[0] && a <= n && (i.size = i.min, e.prevReachedMinPanes += i.min);
|
|
118
|
+
}), e.prevPanesSize = this.sumPrevPanesSize(s[0]), s[0] === void 0) ? (e.prevReachedMinPanes = 0, this.panes[0].size = this.panes[0].min, this.panes.forEach((i, a) => {
|
|
119
|
+
a > 0 && a <= n && (i.size = i.min, e.prevReachedMinPanes += i.min);
|
|
120
|
+
}), this.panes[s[1]].size = 100 - e.prevReachedMinPanes - this.panes[0].min - e.prevPanesSize - e.nextPanesSize, null) : t > 100 - e.nextPanesSize - this.panes[s[1]].min && (s[1] = this.findNextExpandedPane(n).index, e.nextReachedMinPanes = 0, s[1] > n + 1 && this.panes.forEach((i, a) => {
|
|
121
|
+
a > n && a < s[1] && (i.size = i.min, e.nextReachedMinPanes += i.min);
|
|
122
|
+
}), e.nextPanesSize = this.sumNextPanesSize(s[1] - 1), s[1] === void 0) ? (e.nextReachedMinPanes = 0, this.panes[this.panesCount - 1].size = this.panes[this.panesCount - 1].min, this.panes.forEach((i, a) => {
|
|
123
|
+
a < this.panesCount - 1 && a >= n + 1 && (i.size = i.min, e.nextReachedMinPanes += i.min);
|
|
124
|
+
}), this.panes[s[0]].size = 100 - e.prevPanesSize - e.nextReachedMinPanes - this.panes[this.panesCount - 1].min - e.nextPanesSize, null) : { sums: e, panesToResize: s };
|
|
148
125
|
},
|
|
149
126
|
sumPrevPanesSize(e) {
|
|
150
|
-
return this.panes.reduce((t, n,
|
|
127
|
+
return this.panes.reduce((t, n, s) => t + (s < e ? n.size : 0), 0);
|
|
151
128
|
},
|
|
152
129
|
sumNextPanesSize(e) {
|
|
153
|
-
return this.panes.reduce((t, n,
|
|
130
|
+
return this.panes.reduce((t, n, s) => t + (s > e + 1 ? n.size : 0), 0);
|
|
154
131
|
},
|
|
155
132
|
findPrevExpandedPane(e) {
|
|
156
133
|
return [...this.panes].reverse().find((t) => t.index < e && t.size > t.min) || {};
|
|
@@ -165,8 +142,8 @@ const M = /* @__PURE__ */ p({
|
|
|
165
142
|
});
|
|
166
143
|
},
|
|
167
144
|
addSplitter(e, t, n = !1) {
|
|
168
|
-
const
|
|
169
|
-
|
|
145
|
+
const s = e - 1, i = document.createElement("div");
|
|
146
|
+
i.classList.add("splitpanes__splitter"), n || (i.onmousedown = (a) => this.onMouseDown(a, s), typeof window < "u" && "ontouchstart" in window && (i.ontouchstart = (a) => this.onMouseDown(a, s)), i.onclick = (a) => this.onSplitterClick(a, s + 1)), this.dblClickSplitter && (i.ondblclick = (a) => this.onSplitterDblClick(a, s + 1)), t.parentNode.insertBefore(i, t);
|
|
170
147
|
},
|
|
171
148
|
removeSplitter(e) {
|
|
172
149
|
e.onmousedown = void 0, e.onclick = void 0, e.ondblclick = void 0, e.parentNode.removeChild(e);
|
|
@@ -183,28 +160,28 @@ const M = /* @__PURE__ */ p({
|
|
|
183
160
|
},
|
|
184
161
|
requestUpdate({ target: e, ...t }) {
|
|
185
162
|
const n = this.indexedPanes[e._.uid];
|
|
186
|
-
Object.entries(t).forEach(([
|
|
163
|
+
Object.entries(t).forEach(([s, i]) => n[s] = i);
|
|
187
164
|
},
|
|
188
165
|
onPaneAdd(e) {
|
|
189
166
|
let t = -1;
|
|
190
|
-
Array.from(e.$el.parentNode.children).some((
|
|
191
|
-
const n = parseFloat(e.minSize),
|
|
167
|
+
Array.from(e.$el.parentNode.children).some((i) => (i.className.includes("splitpanes__pane") && t++, i === e.$el));
|
|
168
|
+
const n = parseFloat(e.minSize), s = parseFloat(e.maxSize);
|
|
192
169
|
this.panes.splice(t, 0, {
|
|
193
170
|
id: e._.uid,
|
|
194
171
|
index: t,
|
|
195
172
|
min: isNaN(n) ? 0 : n,
|
|
196
|
-
max: isNaN(
|
|
173
|
+
max: isNaN(s) ? 100 : s,
|
|
197
174
|
size: e.size === null ? null : parseFloat(e.size),
|
|
198
175
|
givenSize: e.size,
|
|
199
176
|
update: e.update
|
|
200
|
-
}), this.panes.forEach((
|
|
201
|
-
this.redoSplitters(), this.resetPaneSizes({ addedPane: this.panes[t] }), this.$emit("pane-add", { index: t, panes: this.panes.map((
|
|
177
|
+
}), this.panes.forEach((i, a) => i.index = a), this.ready && this.$nextTick(() => {
|
|
178
|
+
this.redoSplitters(), this.resetPaneSizes({ addedPane: this.panes[t] }), this.$emit("pane-add", { index: t, panes: this.panes.map((i) => ({ min: i.min, max: i.max, size: i.size })) });
|
|
202
179
|
});
|
|
203
180
|
},
|
|
204
181
|
onPaneRemove(e) {
|
|
205
|
-
const t = this.panes.findIndex((
|
|
206
|
-
this.panes.forEach((
|
|
207
|
-
this.redoSplitters(), this.resetPaneSizes({ removedPane: { ...n, index: t } }), this.$emit("pane-remove", { removed: n, panes: this.panes.map((
|
|
182
|
+
const t = this.panes.findIndex((s) => s.id === e._.uid), n = this.panes.splice(t, 1)[0];
|
|
183
|
+
this.panes.forEach((s, i) => s.index = i), this.$nextTick(() => {
|
|
184
|
+
this.redoSplitters(), this.resetPaneSizes({ removedPane: { ...n, index: t } }), this.$emit("pane-remove", { removed: n, panes: this.panes.map((s) => ({ min: s.min, max: s.max, size: s.size })) });
|
|
208
185
|
});
|
|
209
186
|
},
|
|
210
187
|
resetPaneSizes(e = {}) {
|
|
@@ -213,44 +190,44 @@ const M = /* @__PURE__ */ p({
|
|
|
213
190
|
equalize() {
|
|
214
191
|
const e = 100 / this.panesCount;
|
|
215
192
|
let t = 0;
|
|
216
|
-
const n = [],
|
|
217
|
-
this.panes.forEach((
|
|
218
|
-
|
|
219
|
-
}), t > 0.1 && this.readjustSizes(t, n,
|
|
193
|
+
const n = [], s = [];
|
|
194
|
+
this.panes.forEach((i) => {
|
|
195
|
+
i.size = Math.max(Math.min(e, i.max), i.min), t -= i.size, i.size >= i.max && n.push(i.id), i.size <= i.min && s.push(i.id);
|
|
196
|
+
}), t > 0.1 && this.readjustSizes(t, n, s);
|
|
220
197
|
},
|
|
221
198
|
initialPanesSizing() {
|
|
222
199
|
let e = 100;
|
|
223
200
|
const t = [], n = [];
|
|
224
|
-
let
|
|
201
|
+
let s = 0;
|
|
225
202
|
this.panes.forEach((a) => {
|
|
226
|
-
e -= a.size, a.size !== null &&
|
|
203
|
+
e -= a.size, a.size !== null && s++, a.size >= a.max && t.push(a.id), a.size <= a.min && n.push(a.id);
|
|
227
204
|
});
|
|
228
|
-
let
|
|
205
|
+
let i = 100;
|
|
229
206
|
e > 0.1 && (this.panes.forEach((a) => {
|
|
230
|
-
a.size === null && (a.size = Math.max(Math.min(e / (this.panesCount -
|
|
231
|
-
}),
|
|
207
|
+
a.size === null && (a.size = Math.max(Math.min(e / (this.panesCount - s), a.max), a.min)), i -= a.size;
|
|
208
|
+
}), i > 0.1 && this.readjustSizes(e, t, n));
|
|
232
209
|
},
|
|
233
210
|
equalizeAfterAddOrRemove({ addedPane: e, removedPane: t } = {}) {
|
|
234
|
-
let n = 100 / this.panesCount,
|
|
235
|
-
const
|
|
211
|
+
let n = 100 / this.panesCount, s = 0;
|
|
212
|
+
const i = [], a = [];
|
|
236
213
|
e && e.givenSize !== null && (n = (100 - e.givenSize) / (this.panesCount - 1)), this.panes.forEach((o) => {
|
|
237
|
-
|
|
238
|
-
}), !(Math.abs(
|
|
239
|
-
e && e.givenSize !== null && e.id === o.id || (o.size = Math.max(Math.min(n, o.max), o.min)),
|
|
240
|
-
}),
|
|
214
|
+
s -= o.size, o.size >= o.max && i.push(o.id), o.size <= o.min && a.push(o.id);
|
|
215
|
+
}), !(Math.abs(s) < 0.1) && (this.panes.forEach((o) => {
|
|
216
|
+
e && e.givenSize !== null && e.id === o.id || (o.size = Math.max(Math.min(n, o.max), o.min)), s -= o.size, o.size >= o.max && i.push(o.id), o.size <= o.min && a.push(o.id);
|
|
217
|
+
}), s > 0.1 && this.readjustSizes(s, i, a));
|
|
241
218
|
},
|
|
242
219
|
readjustSizes(e, t, n) {
|
|
243
|
-
let
|
|
244
|
-
e > 0 ?
|
|
245
|
-
if (e > 0 && !t.includes(
|
|
246
|
-
const o = Math.max(Math.min(
|
|
247
|
-
e -= r,
|
|
248
|
-
} else if (!n.includes(
|
|
249
|
-
const o = Math.max(Math.min(
|
|
250
|
-
e -= r,
|
|
220
|
+
let s;
|
|
221
|
+
e > 0 ? s = e / (this.panesCount - t.length) : s = e / (this.panesCount - n.length), this.panes.forEach((i, a) => {
|
|
222
|
+
if (e > 0 && !t.includes(i.id)) {
|
|
223
|
+
const o = Math.max(Math.min(i.size + s, i.max), i.min), r = o - i.size;
|
|
224
|
+
e -= r, i.size = o;
|
|
225
|
+
} else if (!n.includes(i.id)) {
|
|
226
|
+
const o = Math.max(Math.min(i.size + s, i.max), i.min), r = o - i.size;
|
|
227
|
+
e -= r, i.size = o;
|
|
251
228
|
}
|
|
252
|
-
|
|
253
|
-
[this.horizontal ? "height" : "width"]: `${this.indexedPanes[
|
|
229
|
+
i.update({
|
|
230
|
+
[this.horizontal ? "height" : "width"]: `${this.indexedPanes[i.id].size}%`
|
|
254
231
|
});
|
|
255
232
|
}), Math.abs(e) > 0.1 && this.$nextTick(() => {
|
|
256
233
|
this.ready && console.warn("Splitpanes: Could not resize panes correctly due to their constraints.");
|
|
@@ -273,7 +250,7 @@ const M = /* @__PURE__ */ p({
|
|
|
273
250
|
},
|
|
274
251
|
dblClickSplitter(e) {
|
|
275
252
|
[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((t, n) => {
|
|
276
|
-
t.ondblclick = e ? (
|
|
253
|
+
t.ondblclick = e ? (s) => this.onSplitterDblClick(s, n) : void 0;
|
|
277
254
|
});
|
|
278
255
|
}
|
|
279
256
|
},
|
|
@@ -284,7 +261,7 @@ const M = /* @__PURE__ */ p({
|
|
|
284
261
|
this.container = this.$refs.container, this.checkSplitpanesNodes(), this.redoSplitters(), this.resetPaneSizes(), this.$emit("ready"), this.ready = !0;
|
|
285
262
|
},
|
|
286
263
|
render() {
|
|
287
|
-
return
|
|
264
|
+
return E(
|
|
288
265
|
"div",
|
|
289
266
|
{
|
|
290
267
|
ref: "container",
|
|
@@ -299,12 +276,12 @@ const M = /* @__PURE__ */ p({
|
|
|
299
276
|
this.$slots.default()
|
|
300
277
|
);
|
|
301
278
|
}
|
|
302
|
-
},
|
|
279
|
+
}, T = (e, t) => {
|
|
303
280
|
const n = e.__vccOpts || e;
|
|
304
|
-
for (const [
|
|
305
|
-
n[
|
|
281
|
+
for (const [s, i] of t)
|
|
282
|
+
n[s] = i;
|
|
306
283
|
return n;
|
|
307
|
-
},
|
|
284
|
+
}, q = {
|
|
308
285
|
name: "pane",
|
|
309
286
|
inject: ["requestUpdate", "onPaneAdd", "onPaneRemove", "onPaneClick"],
|
|
310
287
|
props: {
|
|
@@ -349,60 +326,198 @@ const M = /* @__PURE__ */ p({
|
|
|
349
326
|
}
|
|
350
327
|
}
|
|
351
328
|
};
|
|
352
|
-
function
|
|
353
|
-
return
|
|
329
|
+
function O(e, t, n, s, i, a) {
|
|
330
|
+
return u(), m("div", {
|
|
354
331
|
class: "splitpanes__pane",
|
|
355
332
|
onClick: t[0] || (t[0] = (o) => a.onPaneClick(o, e._.uid)),
|
|
356
|
-
style:
|
|
333
|
+
style: v(e.style)
|
|
357
334
|
}, [
|
|
358
|
-
|
|
335
|
+
f(e.$slots, "default")
|
|
359
336
|
], 4);
|
|
360
337
|
}
|
|
361
|
-
const
|
|
362
|
-
const
|
|
338
|
+
const U = /* @__PURE__ */ T(q, [["render", O]]);
|
|
339
|
+
const L = /* @__PURE__ */ x({
|
|
363
340
|
__name: "index",
|
|
364
341
|
props: {
|
|
365
342
|
styles: { type: Object, required: !1, default: () => ({ width: "100%", height: "100%" }) },
|
|
366
|
-
horizontal: { type: Boolean, required: !1, default: !1 }
|
|
367
|
-
title: { type: String, required: !1 }
|
|
343
|
+
horizontal: { type: Boolean, required: !1, default: !1 }
|
|
368
344
|
},
|
|
369
345
|
setup(e) {
|
|
370
|
-
return (t, n) => (
|
|
346
|
+
return (t, n) => (u(), w(d(D), {
|
|
371
347
|
horizontal: e.horizontal,
|
|
372
|
-
style:
|
|
348
|
+
style: v(e.styles),
|
|
373
349
|
class: "splitpanes"
|
|
374
350
|
}, {
|
|
375
|
-
default:
|
|
376
|
-
|
|
351
|
+
default: p(() => [
|
|
352
|
+
f(t.$slots, "default", {}, void 0, !0)
|
|
377
353
|
]),
|
|
378
354
|
_: 3
|
|
379
355
|
}, 8, ["horizontal", "style"]));
|
|
380
356
|
}
|
|
381
357
|
});
|
|
382
|
-
const
|
|
358
|
+
const _ = (e, t) => {
|
|
359
|
+
const n = e.__vccOpts || e;
|
|
360
|
+
for (const [s, i] of t)
|
|
361
|
+
n[s] = i;
|
|
362
|
+
return n;
|
|
363
|
+
}, A = /* @__PURE__ */ _(L, [["__scopeId", "data-v-4226b5d2"], ["__file", "D:/Code/front/dld-vue-ui/src/packages/SplitPanes/index.vue"]]), F = /* @__PURE__ */ x({
|
|
383
364
|
__name: "pane",
|
|
384
365
|
props: {
|
|
385
366
|
styles: { type: Object, required: !0, default: () => ({ background: "#ececec" }) }
|
|
386
367
|
},
|
|
387
368
|
setup(e) {
|
|
388
|
-
return (t, n) => (
|
|
389
|
-
style:
|
|
369
|
+
return (t, n) => (u(), w(d(U), {
|
|
370
|
+
style: v(e.styles)
|
|
390
371
|
}, {
|
|
391
|
-
default:
|
|
392
|
-
|
|
372
|
+
default: p(() => [
|
|
373
|
+
f(t.$slots, "default")
|
|
393
374
|
]),
|
|
394
375
|
_: 3
|
|
395
376
|
}, 8, ["style"]));
|
|
396
377
|
}
|
|
397
|
-
}),
|
|
378
|
+
}), B = /* @__PURE__ */ _(F, [["__file", "D:/Code/front/dld-vue-ui/src/packages/SplitPanes/pane.vue"]]);
|
|
379
|
+
/*! Element Plus Icons Vue v2.0.10 */
|
|
380
|
+
var C = (e, t) => {
|
|
381
|
+
let n = e.__vccOpts || e;
|
|
382
|
+
for (let [s, i] of t)
|
|
383
|
+
n[s] = i;
|
|
384
|
+
return n;
|
|
385
|
+
}, j = {
|
|
386
|
+
name: "FolderOpened"
|
|
387
|
+
}, I = {
|
|
388
|
+
viewBox: "0 0 1024 1024",
|
|
389
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
390
|
+
}, H = /* @__PURE__ */ c("path", {
|
|
391
|
+
fill: "currentColor",
|
|
392
|
+
d: "M878.08 448H241.92l-96 384h636.16l96-384zM832 384v-64H485.76L357.504 192H128v448l57.92-231.744A32 32 0 0 1 216.96 384H832zm-24.96 512H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h287.872l128.384 128H864a32 32 0 0 1 32 32v96h23.04a32 32 0 0 1 31.04 39.744l-112 448A32 32 0 0 1 807.04 896z"
|
|
393
|
+
}, null, -1), G = [
|
|
394
|
+
H
|
|
395
|
+
];
|
|
396
|
+
function V(e, t, n, s, i, a) {
|
|
397
|
+
return u(), m("svg", I, G);
|
|
398
|
+
}
|
|
399
|
+
var Y = /* @__PURE__ */ C(j, [["render", V], ["__file", "folder-opened.vue"]]), J = {
|
|
400
|
+
name: "Upload"
|
|
401
|
+
}, W = {
|
|
402
|
+
viewBox: "0 0 1024 1024",
|
|
403
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
404
|
+
}, X = /* @__PURE__ */ c("path", {
|
|
405
|
+
fill: "currentColor",
|
|
406
|
+
d: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64zm384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248L544 253.696z"
|
|
407
|
+
}, null, -1), K = [
|
|
408
|
+
X
|
|
409
|
+
];
|
|
410
|
+
function Q(e, t, n, s, i, a) {
|
|
411
|
+
return u(), m("svg", W, K);
|
|
412
|
+
}
|
|
413
|
+
var Z = /* @__PURE__ */ C(J, [["render", Q], ["__file", "upload.vue"]]), ee = function() {
|
|
414
|
+
function e(t) {
|
|
415
|
+
if (!t)
|
|
416
|
+
throw new TypeError("Invalid argument; `value` has no value.");
|
|
417
|
+
this.value = e.EMPTY, t && e.isGuid(t) && (this.value = t);
|
|
418
|
+
}
|
|
419
|
+
return e.isGuid = function(t) {
|
|
420
|
+
var n = t.toString();
|
|
421
|
+
return t && (t instanceof e || e.validator.test(n));
|
|
422
|
+
}, e.create = function() {
|
|
423
|
+
return new e([e.gen(2), e.gen(1), e.gen(1), e.gen(1), e.gen(3)].join("-"));
|
|
424
|
+
}, e.createEmpty = function() {
|
|
425
|
+
return new e("emptyguid");
|
|
426
|
+
}, e.parse = function(t) {
|
|
427
|
+
return new e(t);
|
|
428
|
+
}, e.raw = function() {
|
|
429
|
+
return [e.gen(2), e.gen(1), e.gen(1), e.gen(1), e.gen(3)].join("-");
|
|
430
|
+
}, e.gen = function(t) {
|
|
431
|
+
for (var n = "", s = 0; s < t; s++)
|
|
432
|
+
n += ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
433
|
+
return n;
|
|
434
|
+
}, e.prototype.equals = function(t) {
|
|
435
|
+
return e.isGuid(t) && this.value === t.toString();
|
|
436
|
+
}, e.prototype.isEmpty = function() {
|
|
437
|
+
return this.value === e.EMPTY;
|
|
438
|
+
}, e.prototype.toString = function() {
|
|
439
|
+
return this.value;
|
|
440
|
+
}, e.prototype.toJSON = function() {
|
|
441
|
+
return {
|
|
442
|
+
value: this.value
|
|
443
|
+
};
|
|
444
|
+
}, e.validator = new RegExp("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$", "i"), e.EMPTY = "00000000-0000-0000-0000-000000000000", e;
|
|
445
|
+
}(), te = ee;
|
|
446
|
+
const ie = { style: {} }, ne = ["id"], se = { class: "filename" }, ae = /* @__PURE__ */ x({
|
|
447
|
+
__name: "index",
|
|
448
|
+
props: {
|
|
449
|
+
size: { type: String, required: !1, default: "default" },
|
|
450
|
+
name: { type: String, required: !1, default: "\u4E0A\u4F20\u6587\u4EF6" },
|
|
451
|
+
icon: { type: null, required: !1, default: Z },
|
|
452
|
+
type: { type: null, required: !1, default: "success" }
|
|
453
|
+
},
|
|
454
|
+
emits: ["upload"],
|
|
455
|
+
setup(e, { expose: t, emit: n }) {
|
|
456
|
+
let s = te.create().toString(), i, a = b("");
|
|
457
|
+
function o() {
|
|
458
|
+
i.click();
|
|
459
|
+
}
|
|
460
|
+
function r() {
|
|
461
|
+
a.value = i.value;
|
|
462
|
+
}
|
|
463
|
+
function l() {
|
|
464
|
+
i.files !== null && n("upload", i.files[0]);
|
|
465
|
+
}
|
|
466
|
+
function h() {
|
|
467
|
+
i.value = "", a.value = "";
|
|
468
|
+
}
|
|
469
|
+
return k(() => {
|
|
470
|
+
i = document.getElementById(s);
|
|
471
|
+
}), t({
|
|
472
|
+
Clear: h
|
|
473
|
+
}), (P, z) => {
|
|
474
|
+
const S = N("el-button");
|
|
475
|
+
return u(), m("div", ie, [
|
|
476
|
+
g(S, {
|
|
477
|
+
type: e.type,
|
|
478
|
+
icon: d(Y),
|
|
479
|
+
size: e.size,
|
|
480
|
+
class: "btn",
|
|
481
|
+
onClick: o
|
|
482
|
+
}, {
|
|
483
|
+
default: p(() => [
|
|
484
|
+
y("\u9009\u62E9\u6587\u4EF6")
|
|
485
|
+
]),
|
|
486
|
+
_: 1
|
|
487
|
+
}, 8, ["type", "icon", "size"]),
|
|
488
|
+
$(c("input", {
|
|
489
|
+
type: "file",
|
|
490
|
+
id: d(s),
|
|
491
|
+
onChange: r
|
|
492
|
+
}, null, 40, ne), [
|
|
493
|
+
[R, !1]
|
|
494
|
+
]),
|
|
495
|
+
c("span", se, M(d(a)), 1),
|
|
496
|
+
g(S, {
|
|
497
|
+
type: e.type,
|
|
498
|
+
icon: e.icon,
|
|
499
|
+
size: e.size,
|
|
500
|
+
disabled: d(a) == null || d(a) == "",
|
|
501
|
+
class: "btn",
|
|
502
|
+
onClick: l
|
|
503
|
+
}, {
|
|
504
|
+
default: p(() => [
|
|
505
|
+
y(M(e.name), 1)
|
|
506
|
+
]),
|
|
507
|
+
_: 1
|
|
508
|
+
}, 8, ["type", "icon", "size", "disabled"])
|
|
509
|
+
]);
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
const oe = /* @__PURE__ */ _(ae, [["__scopeId", "data-v-83b9cdd7"], ["__file", "D:/Code/front/dld-vue-ui/src/packages/UpLoadFile/index.vue"]]), le = {
|
|
398
514
|
install: (e) => {
|
|
399
|
-
e.component("
|
|
515
|
+
e.component("SplitPanes", A), e.component("Pane", B), e.component("UpLoadFile", oe);
|
|
400
516
|
}
|
|
401
517
|
};
|
|
402
518
|
export {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
O as default
|
|
519
|
+
B as Pane,
|
|
520
|
+
A as SplitPanes,
|
|
521
|
+
oe as UpLoadFile,
|
|
522
|
+
le as default
|
|
408
523
|
};
|
package/dist/dld-vue-ui.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(h,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):(h=typeof globalThis<"u"?globalThis:h||self,r(h["dld-vue-ui"]={},h.Vue))})(this,function(h,r){"use strict";const P=r.defineComponent({__name:"index",props:{name:{type:String,required:!1,default:"\u9ED8\u8BA4\u6309\u94AE"}},setup(e){const t=e;return(s,n)=>(r.openBlock(),r.createElementBlock("button",null,r.toDisplayString(t.name),1))}}),d=(e,t)=>{const s=e.__vccOpts||e;for(const[n,i]of t)s[n]=i;return s},u=d(P,[["__file","D:/Code/front/dld-vue-ui/src/packages/component/Button/index.vue"]]),c=d(r.defineComponent({__name:"index",props:{title:{type:String,required:!1,default:"\u9ED8\u8BA4\u5B57\u6BB5"}},setup(e){const t=e;return(s,n)=>(r.openBlock(),r.createElementBlock("p",null,r.toDisplayString(t.title),1))}}),[["__file","D:/Code/front/dld-vue-ui/src/packages/component/P/index.vue"]]),S={name:"splitpanes",emits:["ready","resize","resized","pane-click","pane-maximize","pane-add","pane-remove","splitter-click"],props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((e,t)=>(e[t.id]=t)&&e,{})}},methods:{updatePaneComponents(){this.panes.forEach(e=>{e.update&&e.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[e.id].size}%`})})},bindEvents(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown(e,t){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=t},onMouseMove(e){this.touch.mouseDown&&(e.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(e)),this.$emit("resize",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(e,t){"ontouchstart"in window&&(e.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===t?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(e,t),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=t,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[t])},onSplitterDblClick(e,t){let s=0;this.panes=this.panes.map((n,i)=>(n.size=i===t?n.max:n.min,i!==t&&(s+=n.min),n)),this.panes[t].size-=s,this.$emit("pane-maximize",this.panes[t]),this.$emit("resized",this.panes.map(n=>({min:n.min,max:n.max,size:n.size})))},onPaneClick(e,t){this.$emit("pane-click",this.indexedPanes[t])},getCurrentMouseDrag(e){const t=this.container.getBoundingClientRect(),{clientX:s,clientY:n}="ontouchstart"in window&&e.touches?e.touches[0]:e;return{x:s-t.left,y:n-t.top}},getCurrentDragPercentage(e){e=e[this.horizontal?"y":"x"];const t=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(e=t-e),e*100/t},calculatePanesSize(e){const t=this.touch.activeSplitter;let s={prevPanesSize:this.sumPrevPanesSize(t),nextPanesSize:this.sumNextPanesSize(t),prevReachedMinPanes:0,nextReachedMinPanes:0};const n=0+(this.pushOtherPanes?0:s.prevPanesSize),i=100-(this.pushOtherPanes?0:s.nextPanesSize),a=Math.max(Math.min(this.getCurrentDragPercentage(e),i),n);let o=[t,t+1],l=this.panes[o[0]]||null,p=this.panes[o[1]]||null;const f=l.max<100&&a>=l.max+s.prevPanesSize,k=p.max<100&&a<=100-(p.max+this.sumNextPanesSize(t+1));if(f||k){f?(l.size=l.max,p.size=Math.max(100-l.max-s.prevPanesSize-s.nextPanesSize,0)):(l.size=Math.max(100-p.max-s.prevPanesSize-this.sumNextPanesSize(t+1),0),p.size=p.max);return}if(this.pushOtherPanes){const x=this.doPushOtherPanes(s,a);if(!x)return;({sums:s,panesToResize:o}=x),l=this.panes[o[0]]||null,p=this.panes[o[1]]||null}l!==null&&(l.size=Math.min(Math.max(a-s.prevPanesSize-s.prevReachedMinPanes,l.min),l.max)),p!==null&&(p.size=Math.min(Math.max(100-a-s.nextPanesSize-s.nextReachedMinPanes,p.min),p.max))},doPushOtherPanes(e,t){const s=this.touch.activeSplitter,n=[s,s+1];return t<e.prevPanesSize+this.panes[n[0]].min&&(n[0]=this.findPrevExpandedPane(s).index,e.prevReachedMinPanes=0,n[0]<s&&this.panes.forEach((i,a)=>{a>n[0]&&a<=s&&(i.size=i.min,e.prevReachedMinPanes+=i.min)}),e.prevPanesSize=this.sumPrevPanesSize(n[0]),n[0]===void 0)?(e.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((i,a)=>{a>0&&a<=s&&(i.size=i.min,e.prevReachedMinPanes+=i.min)}),this.panes[n[1]].size=100-e.prevReachedMinPanes-this.panes[0].min-e.prevPanesSize-e.nextPanesSize,null):t>100-e.nextPanesSize-this.panes[n[1]].min&&(n[1]=this.findNextExpandedPane(s).index,e.nextReachedMinPanes=0,n[1]>s+1&&this.panes.forEach((i,a)=>{a>s&&a<n[1]&&(i.size=i.min,e.nextReachedMinPanes+=i.min)}),e.nextPanesSize=this.sumNextPanesSize(n[1]-1),n[1]===void 0)?(e.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((i,a)=>{a<this.panesCount-1&&a>=s+1&&(i.size=i.min,e.nextReachedMinPanes+=i.min)}),this.panes[n[0]].size=100-e.prevPanesSize-e.nextReachedMinPanes-this.panes[this.panesCount-1].min-e.nextPanesSize,null):{sums:e,panesToResize:n}},sumPrevPanesSize(e){return this.panes.reduce((t,s,n)=>t+(n<e?s.size:0),0)},sumNextPanesSize(e){return this.panes.reduce((t,s,n)=>t+(n>e+1?s.size:0),0)},findPrevExpandedPane(e){return[...this.panes].reverse().find(t=>t.index<e&&t.size>t.min)||{}},findNextExpandedPane(e){return this.panes.find(t=>t.index>e+1&&t.size>t.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(e=>{const t=e.classList.contains("splitpanes__pane"),s=e.classList.contains("splitpanes__splitter");!t&&!s&&(e.parentNode.removeChild(e),console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed."))})},addSplitter(e,t,s=!1){const n=e-1,i=document.createElement("div");i.classList.add("splitpanes__splitter"),s||(i.onmousedown=a=>this.onMouseDown(a,n),typeof window<"u"&&"ontouchstart"in window&&(i.ontouchstart=a=>this.onMouseDown(a,n)),i.onclick=a=>this.onSplitterClick(a,n+1)),this.dblClickSplitter&&(i.ondblclick=a=>this.onSplitterDblClick(a,n+1)),t.parentNode.insertBefore(i,t)},removeSplitter(e){e.onmousedown=void 0,e.onclick=void 0,e.ondblclick=void 0,e.parentNode.removeChild(e)},redoSplitters(){const e=Array.from(this.container.children);e.forEach(s=>{s.className.includes("splitpanes__splitter")&&this.removeSplitter(s)});let t=0;e.forEach(s=>{s.className.includes("splitpanes__pane")&&(!t&&this.firstSplitter?this.addSplitter(t,s,!0):t&&this.addSplitter(t,s),t++)})},requestUpdate({target:e,...t}){const s=this.indexedPanes[e._.uid];Object.entries(t).forEach(([n,i])=>s[n]=i)},onPaneAdd(e){let t=-1;Array.from(e.$el.parentNode.children).some(i=>(i.className.includes("splitpanes__pane")&&t++,i===e.$el));const s=parseFloat(e.minSize),n=parseFloat(e.maxSize);this.panes.splice(t,0,{id:e._.uid,index:t,min:isNaN(s)?0:s,max:isNaN(n)?100:n,size:e.size===null?null:parseFloat(e.size),givenSize:e.size,update:e.update}),this.panes.forEach((i,a)=>i.index=a),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[t]}),this.$emit("pane-add",{index:t,panes:this.panes.map(i=>({min:i.min,max:i.max,size:i.size}))})})},onPaneRemove(e){const t=this.panes.findIndex(n=>n.id===e._.uid),s=this.panes.splice(t,1)[0];this.panes.forEach((n,i)=>n.index=i),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...s,index:t}}),this.$emit("pane-remove",{removed:s,panes:this.panes.map(n=>({min:n.min,max:n.max,size:n.size}))})})},resetPaneSizes(e={}){!e.addedPane&&!e.removedPane?this.initialPanesSizing():this.panes.some(t=>t.givenSize!==null||t.min||t.max<100)?this.equalizeAfterAddOrRemove(e):this.equalize(),this.ready&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size})))},equalize(){const e=100/this.panesCount;let t=0;const s=[],n=[];this.panes.forEach(i=>{i.size=Math.max(Math.min(e,i.max),i.min),t-=i.size,i.size>=i.max&&s.push(i.id),i.size<=i.min&&n.push(i.id)}),t>.1&&this.readjustSizes(t,s,n)},initialPanesSizing(){let e=100;const t=[],s=[];let n=0;this.panes.forEach(a=>{e-=a.size,a.size!==null&&n++,a.size>=a.max&&t.push(a.id),a.size<=a.min&&s.push(a.id)});let i=100;e>.1&&(this.panes.forEach(a=>{a.size===null&&(a.size=Math.max(Math.min(e/(this.panesCount-n),a.max),a.min)),i-=a.size}),i>.1&&this.readjustSizes(e,t,s))},equalizeAfterAddOrRemove({addedPane:e,removedPane:t}={}){let s=100/this.panesCount,n=0;const i=[],a=[];e&&e.givenSize!==null&&(s=(100-e.givenSize)/(this.panesCount-1)),this.panes.forEach(o=>{n-=o.size,o.size>=o.max&&i.push(o.id),o.size<=o.min&&a.push(o.id)}),!(Math.abs(n)<.1)&&(this.panes.forEach(o=>{e&&e.givenSize!==null&&e.id===o.id||(o.size=Math.max(Math.min(s,o.max),o.min)),n-=o.size,o.size>=o.max&&i.push(o.id),o.size<=o.min&&a.push(o.id)}),n>.1&&this.readjustSizes(n,i,a))},readjustSizes(e,t,s){let n;e>0?n=e/(this.panesCount-t.length):n=e/(this.panesCount-s.length),this.panes.forEach((i,a)=>{if(e>0&&!t.includes(i.id)){const o=Math.max(Math.min(i.size+n,i.max),i.min),l=o-i.size;e-=l,i.size=o}else if(!s.includes(i.id)){const o=Math.max(Math.min(i.size+n,i.max),i.min),l=o-i.size;e-=l,i.size=o}i.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[i.id].size}%`})}),Math.abs(e)>.1&&this.$nextTick(()=>{this.ready&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})}},watch:{panes:{deep:!0,immediate:!1,handler(){this.updatePaneComponents()}},horizontal(){this.updatePaneComponents()},firstSplitter(){this.redoSplitters()},dblClickSplitter(e){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((t,s)=>{t.ondblclick=e?n=>this.onSplitterDblClick(n,s):void 0})}},beforeUnmount(){this.ready=!1},mounted(){this.container=this.$refs.container,this.checkSplitpanesNodes(),this.redoSplitters(),this.resetPaneSizes(),this.$emit("ready"),this.ready=!0},render(){return r.h("div",{ref:"container",class:["splitpanes",`splitpanes--${this.horizontal?"horizontal":"vertical"}`,{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())}},v=(e,t)=>{const s=e.__vccOpts||e;for(const[n,i]of t)s[n]=i;return s},_={name:"pane",inject:["requestUpdate","onPaneAdd","onPaneRemove","onPaneClick"],props:{size:{type:[Number,String],default:null},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},data:()=>({style:{}}),mounted(){this.onPaneAdd(this)},beforeUnmount(){this.onPaneRemove(this)},methods:{update(e){this.style=e}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(e){this.requestUpdate({target:this,size:e})},minSizeNumber(e){this.requestUpdate({target:this,min:e})},maxSizeNumber(e){this.requestUpdate({target:this,max:e})}}};function g(e,t,s,n,i,a){return r.openBlock(),r.createElementBlock("div",{class:"splitpanes__pane",onClick:t[0]||(t[0]=o=>a.onPaneClick(o,e._.uid)),style:r.normalizeStyle(e.style)},[r.renderSlot(e.$slots,"default")],4)}const M=v(_,[["render",g]]),b="",y=r.defineComponent({__name:"index",props:{styles:{type:Object,required:!1,default:()=>({width:"100%",height:"100%"})},horizontal:{type:Boolean,required:!1,default:!1},title:{type:String,required:!1}},setup(e){return(t,s)=>(r.openBlock(),r.createBlock(r.unref(S),{horizontal:e.horizontal,style:r.normalizeStyle(e.styles),class:"splitpanes"},{default:r.withCtx(()=>[r.renderSlot(t.$slots,"default",{},void 0,!0)]),_:3},8,["horizontal","style"]))}}),w="",m=d(y,[["__scopeId","data-v-a9f55ace"],["__file","D:/Code/front/dld-vue-ui/src/packages/component/SplitPanes/index.vue"]]),z=d(r.defineComponent({__name:"pane",props:{styles:{type:Object,required:!0,default:()=>({background:"#ececec"})}},setup(e){return(t,s)=>(r.openBlock(),r.createBlock(r.unref(M),{style:r.normalizeStyle(e.styles)},{default:r.withCtx(()=>[r.renderSlot(t.$slots,"default")]),_:3},8,["style"]))}}),[["__file","D:/Code/front/dld-vue-ui/src/packages/component/SplitPanes/pane.vue"]]),C={install:e=>{e.component("DVButton",u),e.component("DVP",c),e.component("SplitPanes",m),e.component("Pane",z)}};h.DVButton=u,h.DVP=c,h.Pane=z,h.SplitPanes=m,h.default=C,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(p,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(p=typeof globalThis<"u"?globalThis:p||self,o(p["dld-vue-ui"]={},p.Vue))})(this,function(p,o){"use strict";const S={name:"splitpanes",emits:["ready","resize","resized","pane-click","pane-maximize","pane-add","pane-remove","splitter-click"],props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((e,t)=>(e[t.id]=t)&&e,{})}},methods:{updatePaneComponents(){this.panes.forEach(e=>{e.update&&e.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[e.id].size}%`})})},bindEvents(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown(e,t){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=t},onMouseMove(e){this.touch.mouseDown&&(e.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(e)),this.$emit("resize",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(e,t){"ontouchstart"in window&&(e.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===t?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(e,t),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=t,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[t])},onSplitterDblClick(e,t){let i=0;this.panes=this.panes.map((s,n)=>(s.size=n===t?s.max:s.min,n!==t&&(i+=s.min),s)),this.panes[t].size-=i,this.$emit("pane-maximize",this.panes[t]),this.$emit("resized",this.panes.map(s=>({min:s.min,max:s.max,size:s.size})))},onPaneClick(e,t){this.$emit("pane-click",this.indexedPanes[t])},getCurrentMouseDrag(e){const t=this.container.getBoundingClientRect(),{clientX:i,clientY:s}="ontouchstart"in window&&e.touches?e.touches[0]:e;return{x:i-t.left,y:s-t.top}},getCurrentDragPercentage(e){e=e[this.horizontal?"y":"x"];const t=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(e=t-e),e*100/t},calculatePanesSize(e){const t=this.touch.activeSplitter;let i={prevPanesSize:this.sumPrevPanesSize(t),nextPanesSize:this.sumNextPanesSize(t),prevReachedMinPanes:0,nextReachedMinPanes:0};const s=0+(this.pushOtherPanes?0:i.prevPanesSize),n=100-(this.pushOtherPanes?0:i.nextPanesSize),a=Math.max(Math.min(this.getCurrentDragPercentage(e),n),s);let r=[t,t+1],l=this.panes[r[0]]||null,d=this.panes[r[1]]||null;const h=l.max<100&&a>=l.max+i.prevPanesSize,_=d.max<100&&a<=100-(d.max+this.sumNextPanesSize(t+1));if(h||_){h?(l.size=l.max,d.size=Math.max(100-l.max-i.prevPanesSize-i.nextPanesSize,0)):(l.size=Math.max(100-d.max-i.prevPanesSize-this.sumNextPanesSize(t+1),0),d.size=d.max);return}if(this.pushOtherPanes){const c=this.doPushOtherPanes(i,a);if(!c)return;({sums:i,panesToResize:r}=c),l=this.panes[r[0]]||null,d=this.panes[r[1]]||null}l!==null&&(l.size=Math.min(Math.max(a-i.prevPanesSize-i.prevReachedMinPanes,l.min),l.max)),d!==null&&(d.size=Math.min(Math.max(100-a-i.nextPanesSize-i.nextReachedMinPanes,d.min),d.max))},doPushOtherPanes(e,t){const i=this.touch.activeSplitter,s=[i,i+1];return t<e.prevPanesSize+this.panes[s[0]].min&&(s[0]=this.findPrevExpandedPane(i).index,e.prevReachedMinPanes=0,s[0]<i&&this.panes.forEach((n,a)=>{a>s[0]&&a<=i&&(n.size=n.min,e.prevReachedMinPanes+=n.min)}),e.prevPanesSize=this.sumPrevPanesSize(s[0]),s[0]===void 0)?(e.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((n,a)=>{a>0&&a<=i&&(n.size=n.min,e.prevReachedMinPanes+=n.min)}),this.panes[s[1]].size=100-e.prevReachedMinPanes-this.panes[0].min-e.prevPanesSize-e.nextPanesSize,null):t>100-e.nextPanesSize-this.panes[s[1]].min&&(s[1]=this.findNextExpandedPane(i).index,e.nextReachedMinPanes=0,s[1]>i+1&&this.panes.forEach((n,a)=>{a>i&&a<s[1]&&(n.size=n.min,e.nextReachedMinPanes+=n.min)}),e.nextPanesSize=this.sumNextPanesSize(s[1]-1),s[1]===void 0)?(e.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((n,a)=>{a<this.panesCount-1&&a>=i+1&&(n.size=n.min,e.nextReachedMinPanes+=n.min)}),this.panes[s[0]].size=100-e.prevPanesSize-e.nextReachedMinPanes-this.panes[this.panesCount-1].min-e.nextPanesSize,null):{sums:e,panesToResize:s}},sumPrevPanesSize(e){return this.panes.reduce((t,i,s)=>t+(s<e?i.size:0),0)},sumNextPanesSize(e){return this.panes.reduce((t,i,s)=>t+(s>e+1?i.size:0),0)},findPrevExpandedPane(e){return[...this.panes].reverse().find(t=>t.index<e&&t.size>t.min)||{}},findNextExpandedPane(e){return this.panes.find(t=>t.index>e+1&&t.size>t.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(e=>{const t=e.classList.contains("splitpanes__pane"),i=e.classList.contains("splitpanes__splitter");!t&&!i&&(e.parentNode.removeChild(e),console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed."))})},addSplitter(e,t,i=!1){const s=e-1,n=document.createElement("div");n.classList.add("splitpanes__splitter"),i||(n.onmousedown=a=>this.onMouseDown(a,s),typeof window<"u"&&"ontouchstart"in window&&(n.ontouchstart=a=>this.onMouseDown(a,s)),n.onclick=a=>this.onSplitterClick(a,s+1)),this.dblClickSplitter&&(n.ondblclick=a=>this.onSplitterDblClick(a,s+1)),t.parentNode.insertBefore(n,t)},removeSplitter(e){e.onmousedown=void 0,e.onclick=void 0,e.ondblclick=void 0,e.parentNode.removeChild(e)},redoSplitters(){const e=Array.from(this.container.children);e.forEach(i=>{i.className.includes("splitpanes__splitter")&&this.removeSplitter(i)});let t=0;e.forEach(i=>{i.className.includes("splitpanes__pane")&&(!t&&this.firstSplitter?this.addSplitter(t,i,!0):t&&this.addSplitter(t,i),t++)})},requestUpdate({target:e,...t}){const i=this.indexedPanes[e._.uid];Object.entries(t).forEach(([s,n])=>i[s]=n)},onPaneAdd(e){let t=-1;Array.from(e.$el.parentNode.children).some(n=>(n.className.includes("splitpanes__pane")&&t++,n===e.$el));const i=parseFloat(e.minSize),s=parseFloat(e.maxSize);this.panes.splice(t,0,{id:e._.uid,index:t,min:isNaN(i)?0:i,max:isNaN(s)?100:s,size:e.size===null?null:parseFloat(e.size),givenSize:e.size,update:e.update}),this.panes.forEach((n,a)=>n.index=a),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[t]}),this.$emit("pane-add",{index:t,panes:this.panes.map(n=>({min:n.min,max:n.max,size:n.size}))})})},onPaneRemove(e){const t=this.panes.findIndex(s=>s.id===e._.uid),i=this.panes.splice(t,1)[0];this.panes.forEach((s,n)=>s.index=n),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...i,index:t}}),this.$emit("pane-remove",{removed:i,panes:this.panes.map(s=>({min:s.min,max:s.max,size:s.size}))})})},resetPaneSizes(e={}){!e.addedPane&&!e.removedPane?this.initialPanesSizing():this.panes.some(t=>t.givenSize!==null||t.min||t.max<100)?this.equalizeAfterAddOrRemove(e):this.equalize(),this.ready&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size})))},equalize(){const e=100/this.panesCount;let t=0;const i=[],s=[];this.panes.forEach(n=>{n.size=Math.max(Math.min(e,n.max),n.min),t-=n.size,n.size>=n.max&&i.push(n.id),n.size<=n.min&&s.push(n.id)}),t>.1&&this.readjustSizes(t,i,s)},initialPanesSizing(){let e=100;const t=[],i=[];let s=0;this.panes.forEach(a=>{e-=a.size,a.size!==null&&s++,a.size>=a.max&&t.push(a.id),a.size<=a.min&&i.push(a.id)});let n=100;e>.1&&(this.panes.forEach(a=>{a.size===null&&(a.size=Math.max(Math.min(e/(this.panesCount-s),a.max),a.min)),n-=a.size}),n>.1&&this.readjustSizes(e,t,i))},equalizeAfterAddOrRemove({addedPane:e,removedPane:t}={}){let i=100/this.panesCount,s=0;const n=[],a=[];e&&e.givenSize!==null&&(i=(100-e.givenSize)/(this.panesCount-1)),this.panes.forEach(r=>{s-=r.size,r.size>=r.max&&n.push(r.id),r.size<=r.min&&a.push(r.id)}),!(Math.abs(s)<.1)&&(this.panes.forEach(r=>{e&&e.givenSize!==null&&e.id===r.id||(r.size=Math.max(Math.min(i,r.max),r.min)),s-=r.size,r.size>=r.max&&n.push(r.id),r.size<=r.min&&a.push(r.id)}),s>.1&&this.readjustSizes(s,n,a))},readjustSizes(e,t,i){let s;e>0?s=e/(this.panesCount-t.length):s=e/(this.panesCount-i.length),this.panes.forEach((n,a)=>{if(e>0&&!t.includes(n.id)){const r=Math.max(Math.min(n.size+s,n.max),n.min),l=r-n.size;e-=l,n.size=r}else if(!i.includes(n.id)){const r=Math.max(Math.min(n.size+s,n.max),n.min),l=r-n.size;e-=l,n.size=r}n.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[n.id].size}%`})}),Math.abs(e)>.1&&this.$nextTick(()=>{this.ready&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})}},watch:{panes:{deep:!0,immediate:!1,handler(){this.updatePaneComponents()}},horizontal(){this.updatePaneComponents()},firstSplitter(){this.redoSplitters()},dblClickSplitter(e){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((t,i)=>{t.ondblclick=e?s=>this.onSplitterDblClick(s,i):void 0})}},beforeUnmount(){this.ready=!1},mounted(){this.container=this.$refs.container,this.checkSplitpanesNodes(),this.redoSplitters(),this.resetPaneSizes(),this.$emit("ready"),this.ready=!0},render(){return o.h("div",{ref:"container",class:["splitpanes",`splitpanes--${this.horizontal?"horizontal":"vertical"}`,{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())}},P=(e,t)=>{const i=e.__vccOpts||e;for(const[s,n]of t)i[s]=n;return i},g={name:"pane",inject:["requestUpdate","onPaneAdd","onPaneRemove","onPaneClick"],props:{size:{type:[Number,String],default:null},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},data:()=>({style:{}}),mounted(){this.onPaneAdd(this)},beforeUnmount(){this.onPaneRemove(this)},methods:{update(e){this.style=e}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(e){this.requestUpdate({target:this,size:e})},minSizeNumber(e){this.requestUpdate({target:this,min:e})},maxSizeNumber(e){this.requestUpdate({target:this,max:e})}}};function y(e,t,i,s,n,a){return o.openBlock(),o.createElementBlock("div",{class:"splitpanes__pane",onClick:t[0]||(t[0]=r=>a.onPaneClick(r,e._.uid)),style:o.normalizeStyle(e.style)},[o.renderSlot(e.$slots,"default")],4)}const M=P(g,[["render",y]]),H="",C=o.defineComponent({__name:"index",props:{styles:{type:Object,required:!1,default:()=>({width:"100%",height:"100%"})},horizontal:{type:Boolean,required:!1,default:!1}},setup(e){return(t,i)=>(o.openBlock(),o.createBlock(o.unref(S),{horizontal:e.horizontal,style:o.normalizeStyle(e.styles),class:"splitpanes"},{default:o.withCtx(()=>[o.renderSlot(t.$slots,"default",{},void 0,!0)]),_:3},8,["horizontal","style"]))}}),G="",u=(e,t)=>{const i=e.__vccOpts||e;for(const[s,n]of t)i[s]=n;return i},m=u(C,[["__scopeId","data-v-4226b5d2"],["__file","D:/Code/front/dld-vue-ui/src/packages/SplitPanes/index.vue"]]),z=u(o.defineComponent({__name:"pane",props:{styles:{type:Object,required:!0,default:()=>({background:"#ececec"})}},setup(e){return(t,i)=>(o.openBlock(),o.createBlock(o.unref(M),{style:o.normalizeStyle(e.styles)},{default:o.withCtx(()=>[o.renderSlot(t.$slots,"default")]),_:3},8,["style"]))}}),[["__file","D:/Code/front/dld-vue-ui/src/packages/SplitPanes/pane.vue"]]);/*! Element Plus Icons Vue v2.0.10 */var f=(e,t)=>{let i=e.__vccOpts||e;for(let[s,n]of t)i[s]=n;return i},E={name:"FolderOpened"},w={viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},k=o.createElementVNode("path",{fill:"currentColor",d:"M878.08 448H241.92l-96 384h636.16l96-384zM832 384v-64H485.76L357.504 192H128v448l57.92-231.744A32 32 0 0 1 216.96 384H832zm-24.96 512H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h287.872l128.384 128H864a32 32 0 0 1 32 32v96h23.04a32 32 0 0 1 31.04 39.744l-112 448A32 32 0 0 1 807.04 896z"},null,-1),b=[k];function N(e,t,i,s,n,a){return o.openBlock(),o.createElementBlock("svg",w,b)}var $=f(E,[["render",N],["__file","folder-opened.vue"]]),R={name:"Upload"},T={viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},D=o.createElementVNode("path",{fill:"currentColor",d:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64zm384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248L544 253.696z"},null,-1),B=[D];function q(e,t,i,s,n,a){return o.openBlock(),o.createElementBlock("svg",T,B)}var O=f(R,[["render",q],["__file","upload.vue"]]),U=function(){function e(t){if(!t)throw new TypeError("Invalid argument; `value` has no value.");this.value=e.EMPTY,t&&e.isGuid(t)&&(this.value=t)}return e.isGuid=function(t){var i=t.toString();return t&&(t instanceof e||e.validator.test(i))},e.create=function(){return new e([e.gen(2),e.gen(1),e.gen(1),e.gen(1),e.gen(3)].join("-"))},e.createEmpty=function(){return new e("emptyguid")},e.parse=function(t){return new e(t)},e.raw=function(){return[e.gen(2),e.gen(1),e.gen(1),e.gen(1),e.gen(3)].join("-")},e.gen=function(t){for(var i="",s=0;s<t;s++)i+=((1+Math.random())*65536|0).toString(16).substring(1);return i},e.prototype.equals=function(t){return e.isGuid(t)&&this.value===t.toString()},e.prototype.isEmpty=function(){return this.value===e.EMPTY},e.prototype.toString=function(){return this.value},e.prototype.toJSON=function(){return{value:this.value}},e.validator=new RegExp("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$","i"),e.EMPTY="00000000-0000-0000-0000-000000000000",e}(),L=U;const F={style:{}},A=["id"],j={class:"filename"},V=o.defineComponent({__name:"index",props:{size:{type:String,required:!1,default:"default"},name:{type:String,required:!1,default:"\u4E0A\u4F20\u6587\u4EF6"},icon:{type:null,required:!1,default:O},type:{type:null,required:!1,default:"success"}},emits:["upload"],setup(e,{expose:t,emit:i}){let s=L.create().toString(),n,a=o.ref("");function r(){n.click()}function l(){a.value=n.value}function d(){n.files!==null&&i("upload",n.files[0])}function h(){n.value="",a.value=""}return o.onMounted(()=>{n=document.getElementById(s)}),t({Clear:h}),(_,c)=>{const v=o.resolveComponent("el-button");return o.openBlock(),o.createElementBlock("div",F,[o.createVNode(v,{type:e.type,icon:o.unref($),size:e.size,class:"btn",onClick:r},{default:o.withCtx(()=>[o.createTextVNode("\u9009\u62E9\u6587\u4EF6")]),_:1},8,["type","icon","size"]),o.withDirectives(o.createElementVNode("input",{type:"file",id:o.unref(s),onChange:l},null,40,A),[[o.vShow,!1]]),o.createElementVNode("span",j,o.toDisplayString(o.unref(a)),1),o.createVNode(v,{type:e.type,icon:e.icon,size:e.size,disabled:o.unref(a)==null||o.unref(a)=="",class:"btn",onClick:d},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.name),1)]),_:1},8,["type","icon","size","disabled"])])}}}),J="",x=u(V,[["__scopeId","data-v-83b9cdd7"],["__file","D:/Code/front/dld-vue-ui/src/packages/UpLoadFile/index.vue"]]),I={install:e=>{e.component("SplitPanes",m),e.component("Pane",z),e.component("UpLoadFile",x)}};p.Pane=z,p.SplitPanes=m,p.UpLoadFile=x,p.default=I,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -13,10 +13,6 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
13
13
|
required: false;
|
|
14
14
|
default: boolean;
|
|
15
15
|
};
|
|
16
|
-
title: {
|
|
17
|
-
type: StringConstructor;
|
|
18
|
-
required: false;
|
|
19
|
-
};
|
|
20
16
|
}, {
|
|
21
17
|
readonly Splitpanes: Splitpanes;
|
|
22
18
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -33,10 +29,6 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
33
29
|
required: false;
|
|
34
30
|
default: boolean;
|
|
35
31
|
};
|
|
36
|
-
title: {
|
|
37
|
-
type: StringConstructor;
|
|
38
|
-
required: false;
|
|
39
|
-
};
|
|
40
32
|
}>>, {
|
|
41
33
|
styles: Record<string, any>;
|
|
42
34
|
horizontal: boolean;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
declare const _sfc_main: import("vue").DefineComponent<{
|
|
2
|
+
size: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: false;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
name: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
required: false;
|
|
10
|
+
default: string;
|
|
11
|
+
};
|
|
12
|
+
icon: {
|
|
13
|
+
type: null;
|
|
14
|
+
required: false;
|
|
15
|
+
default: import("vue").DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
16
|
+
};
|
|
17
|
+
type: {
|
|
18
|
+
type: null;
|
|
19
|
+
required: false;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
}, {
|
|
23
|
+
emit: (e: 'upload', file: File) => void;
|
|
24
|
+
fileId: string;
|
|
25
|
+
dom: HTMLInputElement;
|
|
26
|
+
fileName: import("vue").Ref<string>;
|
|
27
|
+
OpenFile: () => void;
|
|
28
|
+
GetFiles: () => void;
|
|
29
|
+
UpLoadFile: () => void;
|
|
30
|
+
Clear: () => void;
|
|
31
|
+
readonly FolderOpened: import("vue").DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
32
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "upload"[], "upload", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
33
|
+
size: {
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
required: false;
|
|
36
|
+
default: string;
|
|
37
|
+
};
|
|
38
|
+
name: {
|
|
39
|
+
type: StringConstructor;
|
|
40
|
+
required: false;
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
43
|
+
icon: {
|
|
44
|
+
type: null;
|
|
45
|
+
required: false;
|
|
46
|
+
default: import("vue").DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
47
|
+
};
|
|
48
|
+
type: {
|
|
49
|
+
type: null;
|
|
50
|
+
required: false;
|
|
51
|
+
default: string;
|
|
52
|
+
};
|
|
53
|
+
}>> & {
|
|
54
|
+
onUpload?: ((...args: any[]) => any) | undefined;
|
|
55
|
+
}, {
|
|
56
|
+
type: any;
|
|
57
|
+
size: string;
|
|
58
|
+
name: string;
|
|
59
|
+
icon: any;
|
|
60
|
+
}>;
|
|
61
|
+
export default _sfc_main;
|
package/dist/packages/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { App } from "vue";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
export { DVButton, DVP, SplitPanes, Pane };
|
|
2
|
+
import { SplitPanes, Pane } from './SplitPanes';
|
|
3
|
+
import UpLoadFile from './UpLoadFile/index.vue';
|
|
4
|
+
export { SplitPanes, Pane, UpLoadFile };
|
|
6
5
|
declare const _default: {
|
|
7
6
|
install: (app: App) => void;
|
|
8
7
|
};
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.splitpanes{display:flex;width:100%;height:100%}.splitpanes--vertical{flex-direction:row}.splitpanes--horizontal{flex-direction:column}.splitpanes--dragging *{user-select:none}.splitpanes__pane{width:100%;height:100%;overflow:hidden}.splitpanes--vertical .splitpanes__pane{transition:width .2s ease-out}.splitpanes--horizontal .splitpanes__pane{transition:height .2s ease-out}.splitpanes--dragging .splitpanes__pane{transition:none}.splitpanes__splitter{touch-action:none}.splitpanes--vertical>.splitpanes__splitter{min-width:1px;cursor:col-resize}.splitpanes--horizontal>.splitpanes__splitter{min-height:1px;cursor:row-resize}.splitpanes.default-theme .splitpanes__pane{background-color:#f2f2f2}.splitpanes.default-theme .splitpanes__splitter{background-color:#fff;box-sizing:border-box;position:relative;flex-shrink:0}.splitpanes.default-theme .splitpanes__splitter:before,.splitpanes.default-theme .splitpanes__splitter:after{content:"";position:absolute;top:50%;left:50%;background-color:#00000026;transition:background-color .3s}.splitpanes.default-theme .splitpanes__splitter:hover:before,.splitpanes.default-theme .splitpanes__splitter:hover:after{background-color:#00000040}.splitpanes.default-theme .splitpanes__splitter:first-child{cursor:auto}.default-theme.splitpanes .splitpanes .splitpanes__splitter{z-index:1}.default-theme.splitpanes--vertical>.splitpanes__splitter,.default-theme .splitpanes--vertical>.splitpanes__splitter{width:7px;border-left:1px solid #eee;margin-left:-1px}.default-theme.splitpanes--vertical>.splitpanes__splitter:before,.default-theme.splitpanes--vertical>.splitpanes__splitter:after,.default-theme .splitpanes--vertical>.splitpanes__splitter:before,.default-theme .splitpanes--vertical>.splitpanes__splitter:after{transform:translateY(-50%);width:1px;height:30px}.default-theme.splitpanes--vertical>.splitpanes__splitter:before,.default-theme .splitpanes--vertical>.splitpanes__splitter:before{margin-left:-2px}.default-theme.splitpanes--vertical>.splitpanes__splitter:after,.default-theme .splitpanes--vertical>.splitpanes__splitter:after{margin-left:1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter,.default-theme .splitpanes--horizontal>.splitpanes__splitter{height:7px;border-top:1px solid #eee;margin-top:-1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:before,.default-theme.splitpanes--horizontal>.splitpanes__splitter:after,.default-theme .splitpanes--horizontal>.splitpanes__splitter:before,.default-theme .splitpanes--horizontal>.splitpanes__splitter:after{transform:translate(-50%);width:30px;height:1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:before,.default-theme .splitpanes--horizontal>.splitpanes__splitter:before{margin-top:-2px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:after,.default-theme .splitpanes--horizontal>.splitpanes__splitter:after{margin-top:1px}.splitpanes[data-v-
|
|
1
|
+
.splitpanes{display:flex;width:100%;height:100%}.splitpanes--vertical{flex-direction:row}.splitpanes--horizontal{flex-direction:column}.splitpanes--dragging *{user-select:none}.splitpanes__pane{width:100%;height:100%;overflow:hidden}.splitpanes--vertical .splitpanes__pane{transition:width .2s ease-out}.splitpanes--horizontal .splitpanes__pane{transition:height .2s ease-out}.splitpanes--dragging .splitpanes__pane{transition:none}.splitpanes__splitter{touch-action:none}.splitpanes--vertical>.splitpanes__splitter{min-width:1px;cursor:col-resize}.splitpanes--horizontal>.splitpanes__splitter{min-height:1px;cursor:row-resize}.splitpanes.default-theme .splitpanes__pane{background-color:#f2f2f2}.splitpanes.default-theme .splitpanes__splitter{background-color:#fff;box-sizing:border-box;position:relative;flex-shrink:0}.splitpanes.default-theme .splitpanes__splitter:before,.splitpanes.default-theme .splitpanes__splitter:after{content:"";position:absolute;top:50%;left:50%;background-color:#00000026;transition:background-color .3s}.splitpanes.default-theme .splitpanes__splitter:hover:before,.splitpanes.default-theme .splitpanes__splitter:hover:after{background-color:#00000040}.splitpanes.default-theme .splitpanes__splitter:first-child{cursor:auto}.default-theme.splitpanes .splitpanes .splitpanes__splitter{z-index:1}.default-theme.splitpanes--vertical>.splitpanes__splitter,.default-theme .splitpanes--vertical>.splitpanes__splitter{width:7px;border-left:1px solid #eee;margin-left:-1px}.default-theme.splitpanes--vertical>.splitpanes__splitter:before,.default-theme.splitpanes--vertical>.splitpanes__splitter:after,.default-theme .splitpanes--vertical>.splitpanes__splitter:before,.default-theme .splitpanes--vertical>.splitpanes__splitter:after{transform:translateY(-50%);width:1px;height:30px}.default-theme.splitpanes--vertical>.splitpanes__splitter:before,.default-theme .splitpanes--vertical>.splitpanes__splitter:before{margin-left:-2px}.default-theme.splitpanes--vertical>.splitpanes__splitter:after,.default-theme .splitpanes--vertical>.splitpanes__splitter:after{margin-left:1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter,.default-theme .splitpanes--horizontal>.splitpanes__splitter{height:7px;border-top:1px solid #eee;margin-top:-1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:before,.default-theme.splitpanes--horizontal>.splitpanes__splitter:after,.default-theme .splitpanes--horizontal>.splitpanes__splitter:before,.default-theme .splitpanes--horizontal>.splitpanes__splitter:after{transform:translate(-50%);width:30px;height:1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:before,.default-theme .splitpanes--horizontal>.splitpanes__splitter:before{margin-top:-2px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:after,.default-theme .splitpanes--horizontal>.splitpanes__splitter:after{margin-top:1px}.splitpanes[data-v-4226b5d2] .splitpanes__splitter{min-width:4px;min-height:4px}.fileupload[data-v-83b9cdd7]{overflow-x:auto}.btn[data-v-83b9cdd7]{margin-left:5px;margin-right:5px}.filename[data-v-83b9cdd7]{font-size:12px;text-indent:1em}.filename[data-v-83b9cdd7]:hover{background:rgb(228,228,228)}
|
package/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
declare const _sfc_main: import("vue").DefineComponent<{
|
|
2
|
-
name: {
|
|
3
|
-
type: StringConstructor;
|
|
4
|
-
required: false;
|
|
5
|
-
default: string;
|
|
6
|
-
};
|
|
7
|
-
}, {
|
|
8
|
-
props: any;
|
|
9
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
10
|
-
name: {
|
|
11
|
-
type: StringConstructor;
|
|
12
|
-
required: false;
|
|
13
|
-
default: string;
|
|
14
|
-
};
|
|
15
|
-
}>>, {
|
|
16
|
-
name: string;
|
|
17
|
-
}>;
|
|
18
|
-
export default _sfc_main;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
declare const _sfc_main: import("vue").DefineComponent<{
|
|
2
|
-
title: {
|
|
3
|
-
type: StringConstructor;
|
|
4
|
-
required: false;
|
|
5
|
-
default: string;
|
|
6
|
-
};
|
|
7
|
-
}, {
|
|
8
|
-
props: any;
|
|
9
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
10
|
-
title: {
|
|
11
|
-
type: StringConstructor;
|
|
12
|
-
required: false;
|
|
13
|
-
default: string;
|
|
14
|
-
};
|
|
15
|
-
}>>, {
|
|
16
|
-
title: string;
|
|
17
|
-
}>;
|
|
18
|
-
export default _sfc_main;
|
|
File without changes
|
|
File without changes
|