vxe-pc-ui 3.4.26 → 3.5.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/es/carousel/src/carousel-item.js +2 -0
- package/es/col/style.css +0 -105
- package/es/col/style.min.css +0 -1
- package/es/components.js +6 -0
- package/es/icon/style.css +1 -1
- package/es/modal/src/modal.js +2 -4
- package/es/row/style.css +106 -0
- package/es/row/style.min.css +1 -1
- package/es/select/src/select.js +6 -4
- package/es/split/index.js +12 -0
- package/es/split/src/split-item.js +134 -0
- package/es/split/src/split.js +304 -0
- package/es/split/src/util.js +17 -0
- package/es/split/style.css +90 -0
- package/es/split/style.min.css +1 -0
- package/es/split-item/index.js +12 -0
- package/es/split-item/style.css +0 -0
- package/es/split-item/style.min.css +0 -0
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +6 -1
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/utils.js +6 -0
- package/es/vxe-col/style.css +0 -105
- package/es/vxe-col/style.min.css +0 -1
- package/es/vxe-row/style.css +106 -0
- package/es/vxe-row/style.min.css +1 -1
- package/es/vxe-split/index.js +3 -0
- package/es/vxe-split/style.css +90 -0
- package/es/vxe-split/style.min.css +1 -0
- package/es/vxe-split-item/index.js +3 -0
- package/es/vxe-split-item/style.css +0 -0
- package/es/vxe-split-item/style.min.css +0 -0
- package/lib/carousel/src/carousel-item.js +2 -0
- package/lib/carousel/src/carousel-item.min.js +1 -1
- package/lib/col/style/style.css +0 -105
- package/lib/col/style/style.min.css +0 -1
- package/lib/components.js +25 -1
- package/lib/components.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +665 -11
- package/lib/index.umd.min.js +1 -1
- package/lib/modal/src/modal.js +2 -4
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/row/style/style.css +106 -0
- package/lib/row/style/style.min.css +1 -1
- package/lib/select/src/select.js +7 -4
- package/lib/select/src/select.min.js +1 -1
- package/lib/split/index.js +19 -0
- package/lib/split/index.min.js +1 -0
- package/lib/split/src/split-item.js +146 -0
- package/lib/split/src/split-item.min.js +1 -0
- package/lib/split/src/split.js +313 -0
- package/lib/split/src/split.min.js +1 -0
- package/lib/split/src/util.js +27 -0
- package/lib/split/src/util.min.js +1 -0
- package/lib/split/style/index.js +1 -0
- package/lib/split/style/style.css +90 -0
- package/lib/split/style/style.min.css +1 -0
- package/lib/split-item/index.js +19 -0
- package/lib/split-item/index.min.js +1 -0
- package/lib/split-item/style/index.js +1 -0
- package/lib/split-item/style/style.css +0 -0
- package/lib/split-item/style/style.min.css +0 -0
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/ui/index.js +6 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/ui/src/utils.js +7 -0
- package/lib/ui/src/utils.min.js +1 -1
- package/lib/vxe-col/style/style.css +0 -105
- package/lib/vxe-col/style/style.min.css +0 -1
- package/lib/vxe-row/style/style.css +106 -0
- package/lib/vxe-row/style/style.min.css +1 -1
- package/lib/vxe-split/index.js +23 -0
- package/lib/vxe-split/index.min.js +1 -0
- package/lib/vxe-split/style/index.js +1 -0
- package/lib/vxe-split/style/style.css +90 -0
- package/lib/vxe-split/style/style.min.css +1 -0
- package/lib/vxe-split-item/index.js +23 -0
- package/lib/vxe-split-item/index.min.js +1 -0
- package/lib/vxe-split-item/style/index.js +1 -0
- package/lib/vxe-split-item/style/style.css +0 -0
- package/lib/vxe-split-item/style/style.min.css +0 -0
- package/package.json +2 -2
- package/packages/carousel/src/carousel-item.ts +3 -0
- package/packages/components.ts +6 -0
- package/packages/modal/src/modal.ts +2 -4
- package/packages/row/src/col.ts +5 -5
- package/packages/select/src/select.ts +6 -4
- package/packages/split/index.ts +16 -0
- package/packages/split/src/split-item.ts +154 -0
- package/packages/split/src/split.ts +312 -0
- package/packages/split/src/util.ts +21 -0
- package/packages/split-item/index.ts +16 -0
- package/packages/ui/index.ts +5 -0
- package/packages/ui/src/utils.ts +7 -0
- package/styles/all.scss +2 -0
- package/styles/components/col.scss +0 -61
- package/styles/components/row.scss +59 -0
- package/styles/components/split-item.scss +0 -0
- package/styles/components/split.scss +103 -0
- package/styles/helpers/baseVar.scss +4 -0
- package/styles/theme/base.scss +6 -1
- package/styles/theme/dark.scss +3 -0
- package/styles/theme/light.scss +3 -0
- package/styles/variable.scss +4 -0
- package/types/all.d.ts +6 -0
- package/types/components/col.d.ts +11 -1
- package/types/components/split-item.d.ts +84 -0
- package/types/components/split.d.ts +89 -0
- package/types/components/table-plugins/extend-cell-area.d.ts +54 -0
- package/types/components/table.d.ts +133 -11
- package/types/ui/global-config.d.ts +4 -0
- /package/es/icon/{iconfont.1742881754362.ttf → iconfont.1743044787719.ttf} +0 -0
- /package/es/icon/{iconfont.1742881754362.woff → iconfont.1743044787719.woff} +0 -0
- /package/es/icon/{iconfont.1742881754362.woff2 → iconfont.1743044787719.woff2} +0 -0
- /package/es/{iconfont.1742881754362.ttf → iconfont.1743044787719.ttf} +0 -0
- /package/es/{iconfont.1742881754362.woff → iconfont.1743044787719.woff} +0 -0
- /package/es/{iconfont.1742881754362.woff2 → iconfont.1743044787719.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1742881754362.ttf → iconfont.1743044787719.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1742881754362.woff → iconfont.1743044787719.woff} +0 -0
- /package/lib/icon/style/{iconfont.1742881754362.woff2 → iconfont.1743044787719.woff2} +0 -0
- /package/lib/{iconfont.1742881754362.ttf → iconfont.1743044787719.ttf} +0 -0
- /package/lib/{iconfont.1742881754362.woff → iconfont.1743044787719.woff} +0 -0
- /package/lib/{iconfont.1742881754362.woff2 → iconfont.1743044787719.woff2} +0 -0
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _comp = require("../../ui/src/comp");
|
|
8
|
+
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
9
|
+
var _ui = require("../../ui");
|
|
10
|
+
var _vn = require("../../ui/src/vn");
|
|
11
|
+
var _dom = require("../../ui/src/dom");
|
|
12
|
+
var _utils = require("../../ui/src/utils");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defineVxeComponent)({
|
|
15
|
+
name: 'VxeSplit',
|
|
16
|
+
mixins: [_ui.globalMixins.sizeMixin],
|
|
17
|
+
props: {
|
|
18
|
+
resize: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: null
|
|
21
|
+
},
|
|
22
|
+
vertical: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: function _default() {
|
|
25
|
+
return (0, _ui.getConfig)().split.vertical;
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
border: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: function _default() {
|
|
31
|
+
return (0, _ui.getConfig)().split.border;
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
minWidth: {
|
|
35
|
+
type: [Number, String],
|
|
36
|
+
default: function _default() {
|
|
37
|
+
return (0, _ui.getConfig)().split.minWidth;
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
minHeight: {
|
|
41
|
+
type: [Number, String],
|
|
42
|
+
default: function _default() {
|
|
43
|
+
return (0, _ui.getConfig)().split.minHeight;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
data: function data() {
|
|
48
|
+
var xID = _xeUtils.default.uniqueId();
|
|
49
|
+
var reactData = {
|
|
50
|
+
staticItems: []
|
|
51
|
+
};
|
|
52
|
+
var internalData = {};
|
|
53
|
+
return {
|
|
54
|
+
xID: xID,
|
|
55
|
+
reactData: reactData,
|
|
56
|
+
internalData: internalData
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
provide: function provide() {
|
|
60
|
+
var $xeSplit = this;
|
|
61
|
+
return {
|
|
62
|
+
$xeSplit: $xeSplit
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
computed: Object.assign({}, {}),
|
|
66
|
+
methods: {
|
|
67
|
+
//
|
|
68
|
+
// Method
|
|
69
|
+
//
|
|
70
|
+
dispatchEvent: function dispatchEvent(type, params, evnt) {
|
|
71
|
+
var $xeSplit = this;
|
|
72
|
+
$xeSplit.$emit(type, (0, _ui.createEvent)(evnt, {
|
|
73
|
+
$split: $xeSplit
|
|
74
|
+
}, params));
|
|
75
|
+
},
|
|
76
|
+
callSlot: function callSlot(slotFunc, params) {
|
|
77
|
+
var $xeSplit = this;
|
|
78
|
+
var slots = $xeSplit.$scopedSlots;
|
|
79
|
+
if (slotFunc) {
|
|
80
|
+
if (_xeUtils.default.isString(slotFunc)) {
|
|
81
|
+
slotFunc = slots[slotFunc] || null;
|
|
82
|
+
}
|
|
83
|
+
if (_xeUtils.default.isFunction(slotFunc)) {
|
|
84
|
+
return (0, _vn.getSlotVNs)(slotFunc(params));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return [];
|
|
88
|
+
},
|
|
89
|
+
recalculate: function recalculate() {
|
|
90
|
+
var $xeSplit = this;
|
|
91
|
+
var props = $xeSplit;
|
|
92
|
+
var reactData = $xeSplit.reactData;
|
|
93
|
+
return $xeSplit.$nextTick().then(function () {
|
|
94
|
+
var vertical = props.vertical,
|
|
95
|
+
minWidth = props.minWidth,
|
|
96
|
+
minHeight = props.minHeight;
|
|
97
|
+
var staticItems = reactData.staticItems;
|
|
98
|
+
var el = $xeSplit.$refs.refElem;
|
|
99
|
+
if (!el) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
var wrapperWidth = el.clientWidth;
|
|
103
|
+
var wrapperHeight = el.clientHeight;
|
|
104
|
+
if (!wrapperWidth || !wrapperHeight) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
var residueItems = [];
|
|
108
|
+
if (vertical) {
|
|
109
|
+
var countHeight = 0;
|
|
110
|
+
staticItems.forEach(function (item) {
|
|
111
|
+
var height = item.height;
|
|
112
|
+
var itemHeight = 0;
|
|
113
|
+
if (height) {
|
|
114
|
+
if ((0, _dom.isScale)(height)) {
|
|
115
|
+
itemHeight = wrapperHeight * _xeUtils.default.toNumber(height);
|
|
116
|
+
} else {
|
|
117
|
+
itemHeight = _xeUtils.default.toNumber(height);
|
|
118
|
+
}
|
|
119
|
+
item.renderHeight = itemHeight;
|
|
120
|
+
} else {
|
|
121
|
+
residueItems.push(item);
|
|
122
|
+
}
|
|
123
|
+
countHeight += itemHeight;
|
|
124
|
+
});
|
|
125
|
+
if (residueItems.length) {
|
|
126
|
+
var reMeanHeight = (wrapperHeight - countHeight) / residueItems.length;
|
|
127
|
+
residueItems.forEach(function (item) {
|
|
128
|
+
item.renderHeight = Math.max((0, _utils.getGlobalDefaultConfig)(item.minHeight, minHeight), reMeanHeight);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
} else {
|
|
132
|
+
var countWidth = 0;
|
|
133
|
+
staticItems.forEach(function (item) {
|
|
134
|
+
var width = item.width;
|
|
135
|
+
var itemWidth = 0;
|
|
136
|
+
if (width) {
|
|
137
|
+
if ((0, _dom.isScale)(width)) {
|
|
138
|
+
itemWidth = wrapperWidth * _xeUtils.default.toNumber(width);
|
|
139
|
+
} else {
|
|
140
|
+
itemWidth = _xeUtils.default.toNumber(width);
|
|
141
|
+
}
|
|
142
|
+
item.renderWidth = itemWidth;
|
|
143
|
+
} else {
|
|
144
|
+
residueItems.push(item);
|
|
145
|
+
}
|
|
146
|
+
countWidth += itemWidth;
|
|
147
|
+
});
|
|
148
|
+
if (residueItems.length) {
|
|
149
|
+
var reMeanWidth = (wrapperWidth - countWidth) / residueItems.length;
|
|
150
|
+
residueItems.forEach(function (item) {
|
|
151
|
+
item.renderWidth = Math.max((0, _utils.getGlobalDefaultConfig)(item.minWidth, minWidth), reMeanWidth);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
},
|
|
157
|
+
dragEvent: function dragEvent(evnt) {
|
|
158
|
+
var $xeSplit = this;
|
|
159
|
+
var props = $xeSplit;
|
|
160
|
+
var reactData = $xeSplit.reactData;
|
|
161
|
+
evnt.preventDefault();
|
|
162
|
+
var vertical = props.vertical,
|
|
163
|
+
minWidth = props.minWidth,
|
|
164
|
+
minHeight = props.minHeight;
|
|
165
|
+
var staticItems = reactData.staticItems;
|
|
166
|
+
var handleEl = evnt.currentTarget;
|
|
167
|
+
var el = $xeSplit.$refs.refElem;
|
|
168
|
+
if (!el) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
var itemId = handleEl.getAttribute('xid');
|
|
172
|
+
var itemIndex = _xeUtils.default.findIndexOf(staticItems, function (item) {
|
|
173
|
+
return item.id === itemId;
|
|
174
|
+
});
|
|
175
|
+
var item = staticItems[itemIndex];
|
|
176
|
+
if (!item) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
var prevItem = staticItems[itemIndex - 1];
|
|
180
|
+
var prevItemEl = prevItem ? el.querySelector(".vxe-split-item[xid=\"".concat(prevItem.id, "\"]")) : null;
|
|
181
|
+
var currItemEl = item ? el.querySelector(".vxe-split-item[xid=\"".concat(item.id, "\"]")) : null;
|
|
182
|
+
var prevWidth = prevItemEl ? prevItemEl.clientWidth : 0;
|
|
183
|
+
var currWidth = currItemEl ? currItemEl.clientWidth : 0;
|
|
184
|
+
var prevHeight = prevItemEl ? prevItemEl.clientHeight : 0;
|
|
185
|
+
var currHeight = currItemEl ? currItemEl.clientHeight : 0;
|
|
186
|
+
var prevMinWidth = prevItem ? (0, _utils.getGlobalDefaultConfig)(prevItem.minWidth, minWidth) : minWidth;
|
|
187
|
+
var currMinWidth = (0, _utils.getGlobalDefaultConfig)(item.minWidth, minWidth);
|
|
188
|
+
var prevMinHeight = prevItem ? (0, _utils.getGlobalDefaultConfig)(prevItem.minHeight, minHeight) : minHeight;
|
|
189
|
+
var currMinHeight = (0, _utils.getGlobalDefaultConfig)(item.minHeight, minHeight);
|
|
190
|
+
var disX = evnt.clientX;
|
|
191
|
+
var disY = evnt.clientY;
|
|
192
|
+
(0, _dom.addClass)(el, 'is--drag');
|
|
193
|
+
document.onmousemove = function (evnt) {
|
|
194
|
+
evnt.preventDefault();
|
|
195
|
+
if (vertical) {
|
|
196
|
+
var offsetTop = evnt.clientY - disY;
|
|
197
|
+
if (offsetTop > 0) {
|
|
198
|
+
if (prevItem) {
|
|
199
|
+
if (currHeight - offsetTop >= currMinHeight) {
|
|
200
|
+
prevItem.renderHeight = prevHeight + offsetTop;
|
|
201
|
+
item.renderHeight = currHeight - offsetTop;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
} else {
|
|
205
|
+
if (prevItem) {
|
|
206
|
+
if (prevHeight + offsetTop >= prevMinHeight) {
|
|
207
|
+
prevItem.renderHeight = prevHeight + offsetTop;
|
|
208
|
+
item.renderHeight = currHeight - offsetTop;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
} else {
|
|
213
|
+
var offsetLeft = evnt.clientX - disX;
|
|
214
|
+
if (offsetLeft > 0) {
|
|
215
|
+
if (prevItem) {
|
|
216
|
+
if (currWidth - offsetLeft >= currMinWidth) {
|
|
217
|
+
prevItem.renderWidth = prevWidth + offsetLeft;
|
|
218
|
+
item.renderWidth = currWidth - offsetLeft;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
} else {
|
|
222
|
+
if (prevItem) {
|
|
223
|
+
if (prevWidth + offsetLeft >= prevMinWidth) {
|
|
224
|
+
prevItem.renderWidth = prevWidth + offsetLeft;
|
|
225
|
+
item.renderWidth = currWidth - offsetLeft;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
document.onmouseup = function () {
|
|
232
|
+
document.onmousemove = null;
|
|
233
|
+
document.onmouseup = null;
|
|
234
|
+
(0, _dom.removeClass)(el, 'is--drag');
|
|
235
|
+
};
|
|
236
|
+
},
|
|
237
|
+
//
|
|
238
|
+
// Render
|
|
239
|
+
//
|
|
240
|
+
renderItems: function renderItems(h) {
|
|
241
|
+
var $xeSplit = this;
|
|
242
|
+
var props = $xeSplit;
|
|
243
|
+
var reactData = $xeSplit.reactData;
|
|
244
|
+
var border = props.border,
|
|
245
|
+
vertical = props.vertical;
|
|
246
|
+
var staticItems = reactData.staticItems;
|
|
247
|
+
var itemVNs = [];
|
|
248
|
+
staticItems.forEach(function (item, index) {
|
|
249
|
+
var id = item.id,
|
|
250
|
+
slots = item.slots,
|
|
251
|
+
renderHeight = item.renderHeight,
|
|
252
|
+
renderWidth = item.renderWidth;
|
|
253
|
+
var defaultSlot = slots ? slots.default : null;
|
|
254
|
+
var stys = {};
|
|
255
|
+
if (vertical) {
|
|
256
|
+
if (renderHeight) {
|
|
257
|
+
stys.height = (0, _dom.toCssUnit)(renderHeight);
|
|
258
|
+
}
|
|
259
|
+
} else {
|
|
260
|
+
if (renderWidth) {
|
|
261
|
+
stys.width = (0, _dom.toCssUnit)(renderWidth);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
itemVNs.push(h('div', {
|
|
265
|
+
attrs: {
|
|
266
|
+
xid: id
|
|
267
|
+
},
|
|
268
|
+
class: ['vxe-split-item', vertical ? 'is--vertical' : 'is--horizontal', {
|
|
269
|
+
'is--border': border,
|
|
270
|
+
'is--height': renderHeight,
|
|
271
|
+
'is--width': renderWidth,
|
|
272
|
+
'is--fill': !renderHeight && !renderWidth,
|
|
273
|
+
'is--handle': index > 0
|
|
274
|
+
}],
|
|
275
|
+
style: stys
|
|
276
|
+
}, [index ? h('div', {
|
|
277
|
+
attrs: {
|
|
278
|
+
xid: id
|
|
279
|
+
},
|
|
280
|
+
class: 'vxe-split-item-handle',
|
|
281
|
+
on: {
|
|
282
|
+
mousedown: $xeSplit.dragEvent
|
|
283
|
+
}
|
|
284
|
+
}) : (0, _ui.renderEmptyElement)($xeSplit), h('div', {
|
|
285
|
+
attrs: {
|
|
286
|
+
xid: id
|
|
287
|
+
},
|
|
288
|
+
class: 'vxe-split-item--wrapper'
|
|
289
|
+
}, defaultSlot ? $xeSplit.callSlot(defaultSlot, {}) : [])]));
|
|
290
|
+
});
|
|
291
|
+
return h('div', {
|
|
292
|
+
class: 'vxe-split-wrapper'
|
|
293
|
+
}, itemVNs);
|
|
294
|
+
},
|
|
295
|
+
renderVN: function renderVN(h) {
|
|
296
|
+
var $xeSplit = this;
|
|
297
|
+
var props = $xeSplit;
|
|
298
|
+
var slots = $xeSplit.$scopedSlots;
|
|
299
|
+
var vertical = props.vertical;
|
|
300
|
+
var defaultSlot = slots.default;
|
|
301
|
+
return h('div', {
|
|
302
|
+
ref: 'refElem',
|
|
303
|
+
class: ['vxe-split', vertical ? 'is--vertical' : 'is--horizontal']
|
|
304
|
+
}, [h('div', {
|
|
305
|
+
class: 'vxe-split-slots'
|
|
306
|
+
}, defaultSlot ? defaultSlot({}) : []), $xeSplit.renderItems(h)]);
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
render: function render(h) {
|
|
310
|
+
return this.renderVN(h);
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
/* define-vxe-component end */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_vn=require("../../ui/src/vn"),_dom=require("../../ui/src/dom"),_utils=require("../../ui/src/utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeSplit",mixins:[_ui.globalMixins.sizeMixin],props:{resize:{type:Boolean,default:null},vertical:{type:Boolean,default:function(){return(0,_ui.getConfig)().split.vertical}},border:{type:Boolean,default:function(){return(0,_ui.getConfig)().split.border}},minWidth:{type:[Number,String],default:function(){return(0,_ui.getConfig)().split.minWidth}},minHeight:{type:[Number,String],default:function(){return(0,_ui.getConfig)().split.minHeight}}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{staticItems:[]},internalData:{}}},provide:function(){return{$xeSplit:this}},computed:Object.assign({},{}),methods:{dispatchEvent:function(e,t,i){this.$emit(e,(0,_ui.createEvent)(i,{$split:this},t))},callSlot:function(e,t){var i=this.$scopedSlots;return e&&(_xeUtils.default.isString(e)&&(e=i[e]||null),_xeUtils.default.isFunction(e))?(0,_vn.getSlotVNs)(e(t)):[]},recalculate:function(){var f=this,h=f,m=f.reactData;return f.$nextTick().then(function(){var n,r,l,u,t,s,i,e=h.vertical,a=h.minWidth,o=h.minHeight,d=m.staticItems,c=f.$refs.refElem;c&&(n=c.clientWidth,r=c.clientHeight,n)&&r&&(l=[],e?(u=0,d.forEach(function(e){var t=e.height,i=0;t?(i=(0,_dom.isScale)(t)?r*_xeUtils.default.toNumber(t):_xeUtils.default.toNumber(t),e.renderHeight=i):l.push(e),u+=i}),l.length&&(t=(r-u)/l.length,l.forEach(function(e){e.renderHeight=Math.max((0,_utils.getGlobalDefaultConfig)(e.minHeight,o),t)}))):(s=0,d.forEach(function(e){var t=e.width,i=0;t?(i=(0,_dom.isScale)(t)?n*_xeUtils.default.toNumber(t):_xeUtils.default.toNumber(t),e.renderWidth=i):l.push(e),s+=i}),l.length&&(i=(n-s)/l.length,l.forEach(function(e){e.renderWidth=Math.max((0,_utils.getGlobalDefaultConfig)(e.minWidth,a),i)}))))})},dragEvent:function(e){var t,i,n,r,l,u,s,a,o,d,c,f,h,m=this,g=m,p=m.reactData,v=(e.preventDefault(),g.vertical),_=g.minWidth,g=g.minHeight,p=p.staticItems,x=e.currentTarget,b=m.$refs.refElem;b&&(t=x.getAttribute("xid"),m=_xeUtils.default.findIndexOf(p,function(e){return e.id===t}),i=p[m])&&(x=(n=p[m-1])?b.querySelector('.vxe-split-item[xid="'.concat(n.id,'"]')):null,p=i?b.querySelector('.vxe-split-item[xid="'.concat(i.id,'"]')):null,r=x?x.clientWidth:0,l=p?p.clientWidth:0,u=x?x.clientHeight:0,s=p?p.clientHeight:0,a=n?(0,_utils.getGlobalDefaultConfig)(n.minWidth,_):_,o=(0,_utils.getGlobalDefaultConfig)(i.minWidth,_),d=n?(0,_utils.getGlobalDefaultConfig)(n.minHeight,g):g,c=(0,_utils.getGlobalDefaultConfig)(i.minHeight,g),f=e.clientX,h=e.clientY,(0,_dom.addClass)(b,"is--drag"),document.onmousemove=function(e){var t;e.preventDefault(),v?0<(t=e.clientY-h)?n&&c<=s-t&&(n.renderHeight=u+t,i.renderHeight=s-t):n&&d<=u+t&&(n.renderHeight=u+t,i.renderHeight=s-t):0<(t=e.clientX-f)?n&&o<=l-t&&(n.renderWidth=r+t,i.renderWidth=l-t):n&&a<=r+t&&(n.renderWidth=r+t,i.renderWidth=l-t)},document.onmouseup=function(){document.onmousemove=null,(document.onmouseup=null,_dom.removeClass)(b,"is--drag")})},renderItems:function(u){var s=this,e=s.reactData,a=s.border,o=s.vertical,e=e.staticItems,d=[];return e.forEach(function(e,t){var i=e.id,n=e.slots,r=e.renderHeight,e=e.renderWidth,n=n?n.default:null,l={};o?r&&(l.height=(0,_dom.toCssUnit)(r)):e&&(l.width=(0,_dom.toCssUnit)(e)),d.push(u("div",{attrs:{xid:i},class:["vxe-split-item",o?"is--vertical":"is--horizontal",{"is--border":a,"is--height":r,"is--width":e,"is--fill":!r&&!e,"is--handle":0<t}],style:l},[t?u("div",{attrs:{xid:i},class:"vxe-split-item-handle",on:{mousedown:s.dragEvent}}):(0,_ui.renderEmptyElement)(s),u("div",{attrs:{xid:i},class:"vxe-split-item--wrapper"},n?s.callSlot(n,{}):[])]))}),u("div",{class:"vxe-split-wrapper"},d)},renderVN:function(e){var t=this.$scopedSlots,i=this.vertical,t=t.default;return e("div",{ref:"refElem",class:["vxe-split",i?"is--vertical":"is--horizontal"]},[e("div",{class:"vxe-split-slots"},t?t({}):[]),this.renderItems(e)])}},render:function(e){return this.renderVN(e)}});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.assembleSplitItem = assembleSplitItem;
|
|
7
|
+
exports.destroySplitItem = destroySplitItem;
|
|
8
|
+
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function assembleSplitItem($xeSplit, elem, itemConfig) {
|
|
11
|
+
var staticItems = $xeSplit.reactData.staticItems;
|
|
12
|
+
var parentElem = elem.parentNode;
|
|
13
|
+
if (parentElem) {
|
|
14
|
+
staticItems.splice(_xeUtils.default.arrayIndexOf(parentElem.children, elem), 0, itemConfig);
|
|
15
|
+
$xeSplit.reactData.staticItems = staticItems.slice(0);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function destroySplitItem($xeSplit, itemConfig) {
|
|
19
|
+
var staticItems = $xeSplit.reactData.staticItems;
|
|
20
|
+
var index = _xeUtils.default.findIndexOf(staticItems, function (item) {
|
|
21
|
+
return item.id === itemConfig.id;
|
|
22
|
+
});
|
|
23
|
+
if (index > -1) {
|
|
24
|
+
staticItems.splice(index, 1);
|
|
25
|
+
}
|
|
26
|
+
$xeSplit.reactData.staticItems = staticItems.slice(0);
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.assembleSplitItem=assembleSplitItem,exports.destroySplitItem=destroySplitItem;var _xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function assembleSplitItem(e,t,i){var a=e.reactData.staticItems,s=t.parentNode;s&&(a.splice(_xeUtils.default.arrayIndexOf(s.children,t),0,i),e.reactData.staticItems=a.slice(0))}function destroySplitItem(e,t){var i=e.reactData.staticItems,a=_xeUtils.default.findIndexOf(i,function(e){return e.id===t.id});-1<a&&i.splice(a,1),e.reactData.staticItems=i.slice(0)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('./style.css')
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
.vxe-split.is--vertical > .vxe-split-wrapper {
|
|
2
|
+
flex-direction: column;
|
|
3
|
+
}
|
|
4
|
+
.vxe-split.is--vertical > .vxe-split-wrapper > .vxe-split-item {
|
|
5
|
+
width: 100%;
|
|
6
|
+
}
|
|
7
|
+
.vxe-split.is--drag {
|
|
8
|
+
-webkit-user-select: none;
|
|
9
|
+
-moz-user-select: none;
|
|
10
|
+
-ms-user-select: none;
|
|
11
|
+
user-select: none;
|
|
12
|
+
}
|
|
13
|
+
.vxe-split.is--drag > .vxe-split-wrapper > .vxe-split-item > .vxe-split-item--wrapper::after {
|
|
14
|
+
content: "";
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: 0;
|
|
17
|
+
left: 0;
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 100%;
|
|
20
|
+
z-index: 1;
|
|
21
|
+
background: transparent;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.vxe-split-wrapper {
|
|
25
|
+
height: 100%;
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: row;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.vxe-split-slots {
|
|
32
|
+
display: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.vxe-split-item-handle {
|
|
36
|
+
flex-shrink: 0;
|
|
37
|
+
background-color: var(--vxe-split-handle-bar-background-color);
|
|
38
|
+
-webkit-user-select: none;
|
|
39
|
+
-moz-user-select: none;
|
|
40
|
+
-ms-user-select: none;
|
|
41
|
+
user-select: none;
|
|
42
|
+
}
|
|
43
|
+
.vxe-split-item-handle:hover {
|
|
44
|
+
background-color: var(--vxe-ui-font-primary-lighten-color);
|
|
45
|
+
}
|
|
46
|
+
.vxe-split-item-handle:active {
|
|
47
|
+
background-color: var(--vxe-ui-font-primary-darken-color);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.vxe-split-item--wrapper {
|
|
51
|
+
position: relative;
|
|
52
|
+
word-break: break-word;
|
|
53
|
+
overflow: auto;
|
|
54
|
+
flex-grow: 1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.vxe-split-item {
|
|
58
|
+
display: flex;
|
|
59
|
+
position: relative;
|
|
60
|
+
overflow: auto;
|
|
61
|
+
}
|
|
62
|
+
.vxe-split-item.is--fill {
|
|
63
|
+
flex-grow: 1;
|
|
64
|
+
}
|
|
65
|
+
.vxe-split-item.is--width, .vxe-split-item.is--height {
|
|
66
|
+
flex-shrink: 0;
|
|
67
|
+
}
|
|
68
|
+
.vxe-split-item.is--border > .vxe-split-item--wrapper, .vxe-split-item.is--border > .vxe-split-item-handle {
|
|
69
|
+
border: 1px solid var(--vxe-ui-base-popup-border-color);
|
|
70
|
+
}
|
|
71
|
+
.vxe-split-item.is--horizontal {
|
|
72
|
+
flex-direction: row;
|
|
73
|
+
}
|
|
74
|
+
.vxe-split-item.is--horizontal > .vxe-split-item-handle {
|
|
75
|
+
width: var(--vxe-split-handle-bar-width);
|
|
76
|
+
cursor: w-resize;
|
|
77
|
+
}
|
|
78
|
+
.vxe-split-item.is--horizontal.is--border > .vxe-split-item-handle {
|
|
79
|
+
border-width: 1px 0 1px 0;
|
|
80
|
+
}
|
|
81
|
+
.vxe-split-item.is--vertical {
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
}
|
|
84
|
+
.vxe-split-item.is--vertical > .vxe-split-item-handle {
|
|
85
|
+
height: var(--vxe-split-handle-bar-height);
|
|
86
|
+
cursor: n-resize;
|
|
87
|
+
}
|
|
88
|
+
.vxe-split-item.is--vertical.is--border > .vxe-split-item-handle {
|
|
89
|
+
border-width: 0 1px 0 1px;
|
|
90
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.vxe-split.is--vertical>.vxe-split-wrapper{flex-direction:column}.vxe-split.is--vertical>.vxe-split-wrapper>.vxe-split-item{width:100%}.vxe-split.is--drag{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vxe-split.is--drag>.vxe-split-wrapper>.vxe-split-item>.vxe-split-item--wrapper::after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;background:0 0}.vxe-split-wrapper{height:100%;display:flex;flex-direction:row;overflow:hidden}.vxe-split-slots{display:none}.vxe-split-item-handle{flex-shrink:0;background-color:var(--vxe-split-handle-bar-background-color);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vxe-split-item-handle:hover{background-color:var(--vxe-ui-font-primary-lighten-color)}.vxe-split-item-handle:active{background-color:var(--vxe-ui-font-primary-darken-color)}.vxe-split-item--wrapper{position:relative;word-break:break-word;overflow:auto;flex-grow:1}.vxe-split-item{display:flex;position:relative;overflow:auto}.vxe-split-item.is--fill{flex-grow:1}.vxe-split-item.is--height,.vxe-split-item.is--width{flex-shrink:0}.vxe-split-item.is--border>.vxe-split-item--wrapper,.vxe-split-item.is--border>.vxe-split-item-handle{border:1px solid var(--vxe-ui-base-popup-border-color)}.vxe-split-item.is--horizontal{flex-direction:row}.vxe-split-item.is--horizontal>.vxe-split-item-handle{width:var(--vxe-split-handle-bar-width);cursor:w-resize}.vxe-split-item.is--horizontal.is--border>.vxe-split-item-handle{border-width:1px 0 1px 0}.vxe-split-item.is--vertical{flex-direction:column}.vxe-split-item.is--vertical>.vxe-split-item-handle{height:var(--vxe-split-handle-bar-height);cursor:n-resize}.vxe-split-item.is--vertical.is--border>.vxe-split-item-handle{border-width:0 1px 0 1px}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.VxeSplitItem = exports.SplitItem = void 0;
|
|
7
|
+
var _core = require("@vxe-ui/core");
|
|
8
|
+
var _splitItem = _interopRequireDefault(require("../split/src/split-item"));
|
|
9
|
+
var _dynamics = require("../dynamics");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
var VxeSplitItem = exports.VxeSplitItem = Object.assign({}, _splitItem.default, {
|
|
12
|
+
install: function install(app) {
|
|
13
|
+
app.component(_splitItem.default.name, _splitItem.default);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
_dynamics.dynamicApp.use(VxeSplitItem);
|
|
17
|
+
_core.VxeUI.component(_splitItem.default);
|
|
18
|
+
var SplitItem = exports.SplitItem = VxeSplitItem;
|
|
19
|
+
var _default = exports.default = VxeSplitItem;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.VxeSplitItem=exports.SplitItem=void 0;var _core=require("@vxe-ui/core"),_splitItem=_interopRequireDefault(require("../split/src/split-item")),_dynamics=require("../dynamics");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var VxeSplitItem=exports.VxeSplitItem=Object.assign({},_splitItem.default,{install:function(e){e.component(_splitItem.default.name,_splitItem.default)}}),SplitItem=(_dynamics.dynamicApp.use(VxeSplitItem),_core.VxeUI.component(_splitItem.default),exports.SplitItem=VxeSplitItem),_default=exports.default=VxeSplitItem;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('./style.css')
|
|
File without changes
|
|
File without changes
|