vxe-pc-ui 3.5.0 → 3.5.2

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.
Files changed (51) hide show
  1. package/es/icon/style.css +1 -1
  2. package/es/split/src/split-item.js +17 -22
  3. package/es/split/src/split.js +42 -24
  4. package/es/split/src/util.js +4 -4
  5. package/es/split/style.css +13 -1
  6. package/es/split/style.min.css +1 -1
  7. package/es/style.css +1 -1
  8. package/es/style.min.css +1 -1
  9. package/es/ui/index.js +5 -3
  10. package/es/ui/src/log.js +1 -1
  11. package/es/vxe-split/style.css +13 -1
  12. package/es/vxe-split/style.min.css +1 -1
  13. package/lib/icon/style/style.css +1 -1
  14. package/lib/icon/style/style.min.css +1 -1
  15. package/lib/index.umd.js +72 -59
  16. package/lib/index.umd.min.js +1 -1
  17. package/lib/split/src/split-item.js +17 -22
  18. package/lib/split/src/split-item.min.js +1 -1
  19. package/lib/split/src/split.js +44 -29
  20. package/lib/split/src/split.min.js +1 -1
  21. package/lib/split/src/util.js +4 -4
  22. package/lib/split/style/style.css +13 -1
  23. package/lib/split/style/style.min.css +1 -1
  24. package/lib/style.css +1 -1
  25. package/lib/style.min.css +1 -1
  26. package/lib/ui/index.js +5 -3
  27. package/lib/ui/index.min.js +1 -1
  28. package/lib/ui/src/log.js +1 -1
  29. package/lib/ui/src/log.min.js +1 -1
  30. package/lib/vxe-split/style/style.css +13 -1
  31. package/lib/vxe-split/style/style.min.css +1 -1
  32. package/package.json +1 -1
  33. package/packages/split/src/split-item.ts +17 -23
  34. package/packages/split/src/split.ts +45 -25
  35. package/packages/split/src/util.ts +4 -4
  36. package/packages/ui/index.ts +4 -2
  37. package/styles/components/split.scss +14 -1
  38. package/types/components/split-item.d.ts +0 -2
  39. package/types/components/split.d.ts +14 -8
  40. /package/es/icon/{iconfont.1743044787719.ttf → iconfont.1743056503870.ttf} +0 -0
  41. /package/es/icon/{iconfont.1743044787719.woff → iconfont.1743056503870.woff} +0 -0
  42. /package/es/icon/{iconfont.1743044787719.woff2 → iconfont.1743056503870.woff2} +0 -0
  43. /package/es/{iconfont.1743044787719.ttf → iconfont.1743056503870.ttf} +0 -0
  44. /package/es/{iconfont.1743044787719.woff → iconfont.1743056503870.woff} +0 -0
  45. /package/es/{iconfont.1743044787719.woff2 → iconfont.1743056503870.woff2} +0 -0
  46. /package/lib/icon/style/{iconfont.1743044787719.ttf → iconfont.1743056503870.ttf} +0 -0
  47. /package/lib/icon/style/{iconfont.1743044787719.woff → iconfont.1743056503870.woff} +0 -0
  48. /package/lib/icon/style/{iconfont.1743044787719.woff2 → iconfont.1743056503870.woff2} +0 -0
  49. /package/lib/{iconfont.1743044787719.ttf → iconfont.1743056503870.ttf} +0 -0
  50. /package/lib/{iconfont.1743044787719.woff → iconfont.1743056503870.woff} +0 -0
  51. /package/lib/{iconfont.1743044787719.woff2 → iconfont.1743056503870.woff2} +0 -0
@@ -42,7 +42,7 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
42
42
  data: function data() {
43
43
  var xID = _xeUtils.default.uniqueId();
44
44
  var reactData = {};
45
- var itemConfig = {
45
+ var chunkConfig = {
46
46
  id: xID,
47
47
  width: 0,
48
48
  height: 0,
@@ -55,35 +55,30 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
55
55
  return {
56
56
  xID: xID,
57
57
  reactData: reactData,
58
- itemConfig: itemConfig
58
+ chunkConfig: chunkConfig
59
59
  };
60
60
  },
61
61
  computed: Object.assign({}, {}),
62
62
  watch: {
63
- span: function span(val) {
64
- var $xeSplitItem = this;
65
- var itemConfig = $xeSplitItem.itemConfig;
66
- itemConfig.span = val;
67
- },
68
63
  width: function width(val) {
69
64
  var $xeSplitItem = this;
70
- var itemConfig = $xeSplitItem.itemConfig;
71
- itemConfig.width = val;
65
+ var chunkConfig = $xeSplitItem.chunkConfig;
66
+ chunkConfig.width = val;
72
67
  },
73
68
  height: function height(val) {
74
69
  var $xeSplitItem = this;
75
- var itemConfig = $xeSplitItem.itemConfig;
76
- itemConfig.height = val;
70
+ var chunkConfig = $xeSplitItem.chunkConfig;
71
+ chunkConfig.height = val;
77
72
  },
78
73
  minWidth: function minWidth(val) {
79
74
  var $xeSplitItem = this;
80
- var itemConfig = $xeSplitItem.itemConfig;
81
- itemConfig.minWidth = val;
75
+ var chunkConfig = $xeSplitItem.chunkConfig;
76
+ chunkConfig.minWidth = val;
82
77
  },
83
78
  minHeight: function minHeight(val) {
84
79
  var $xeSplitItem = this;
85
- var itemConfig = $xeSplitItem.itemConfig;
86
- itemConfig.minHeight = val;
80
+ var chunkConfig = $xeSplitItem.chunkConfig;
81
+ chunkConfig.minHeight = val;
87
82
  }
88
83
  },
89
84
  methods: {
@@ -109,8 +104,8 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
109
104
  var $xeSplitItem = this;
110
105
  var props = $xeSplitItem;
111
106
  var slots = $xeSplitItem.$scopedSlots;
112
- var itemConfig = $xeSplitItem.itemConfig;
113
- Object.assign(itemConfig, {
107
+ var chunkConfig = $xeSplitItem.chunkConfig;
108
+ Object.assign(chunkConfig, {
114
109
  width: props.width,
115
110
  height: props.height,
116
111
  minWidth: props.minWidth,
@@ -123,20 +118,20 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
123
118
  mounted: function mounted() {
124
119
  var $xeSplitItem = this;
125
120
  var slots = $xeSplitItem.$scopedSlots;
126
- var itemConfig = $xeSplitItem.itemConfig;
121
+ var chunkConfig = $xeSplitItem.chunkConfig;
127
122
  var $xeSplit = $xeSplitItem.$xeSplit;
128
- itemConfig.slots = slots;
123
+ chunkConfig.slots = slots;
129
124
  var elem = $xeSplitItem.$refs.refElem;
130
125
  if ($xeSplit && elem) {
131
- (0, _util.assembleSplitItem)($xeSplit, elem, itemConfig);
126
+ (0, _util.assembleSplitItem)($xeSplit, elem, chunkConfig);
132
127
  }
133
128
  },
134
129
  beforeDestroy: function beforeDestroy() {
135
130
  var $xeSplitItem = this;
136
- var itemConfig = $xeSplitItem.itemConfig;
131
+ var chunkConfig = $xeSplitItem.chunkConfig;
137
132
  var $xeSplit = $xeSplitItem.$xeSplit;
138
133
  if ($xeSplit) {
139
- (0, _util.destroySplitItem)($xeSplit, itemConfig);
134
+ (0, _util.destroySplitItem)($xeSplit, chunkConfig);
140
135
  }
141
136
  },
142
137
  render: function render(h) {
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_ui=require("../../ui"),_util=require("./util"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeSplitItem",mixins:[_ui.globalMixins.sizeMixin],props:{width:[Number,String],height:[Number,String],minWidth:{type:[Number,String],default:function(){return null}},minHeight:{type:[Number,String],default:function(){return null}}},inject:{$xeSplit:{default:null}},provide:function(){return{$xeSplitItem:this}},data:function(){var t=_xeUtils.default.uniqueId();return{xID:t,reactData:{},itemConfig:{id:t,width:0,height:0,minWidth:0,minHeight:0,renderWidth:0,renderHeight:0,slots:{}}}},computed:Object.assign({},{}),watch:{span:function(t){this.itemConfig.span=t},width:function(t){this.itemConfig.width=t},height:function(t){this.itemConfig.height=t},minWidth:function(t){this.itemConfig.minWidth=t},minHeight:function(t){this.itemConfig.minHeight=t}},methods:{dispatchEvent:function(t,i,e){this.$emit(t,(0,_ui.createEvent)(e,{$splitItem:this},i))},renderVN:function(t){return t("div",{ref:"refElem"})}},created:function(){var t=this,i=t.$scopedSlots;Object.assign(t.itemConfig,{width:t.width,height:t.height,minWidth:t.minWidth,minHeight:t.minHeight,renderWidth:0,renderHeight:0,slots:i})},mounted:function(){var t=this,i=t.$scopedSlots,e=t.itemConfig,n=t.$xeSplit,i=(e.slots=i,t.$refs.refElem);n&&i&&(0,_util.assembleSplitItem)(n,i,e)},beforeDestroy:function(){var t=this.itemConfig,i=this.$xeSplit;i&&(0,_util.destroySplitItem)(i,t)},render:function(t){return this.renderVN(t)}});
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_ui=require("../../ui"),_util=require("./util"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeSplitItem",mixins:[_ui.globalMixins.sizeMixin],props:{width:[Number,String],height:[Number,String],minWidth:{type:[Number,String],default:function(){return null}},minHeight:{type:[Number,String],default:function(){return null}}},inject:{$xeSplit:{default:null}},provide:function(){return{$xeSplitItem:this}},data:function(){var t=_xeUtils.default.uniqueId();return{xID:t,reactData:{},chunkConfig:{id:t,width:0,height:0,minWidth:0,minHeight:0,renderWidth:0,renderHeight:0,slots:{}}}},computed:Object.assign({},{}),watch:{width:function(t){this.chunkConfig.width=t},height:function(t){this.chunkConfig.height=t},minWidth:function(t){this.chunkConfig.minWidth=t},minHeight:function(t){this.chunkConfig.minHeight=t}},methods:{dispatchEvent:function(t,e,i){this.$emit(t,(0,_ui.createEvent)(i,{$splitItem:this},e))},renderVN:function(t){return t("div",{ref:"refElem"})}},created:function(){var t=this,e=t.$scopedSlots;Object.assign(t.chunkConfig,{width:t.width,height:t.height,minWidth:t.minWidth,minHeight:t.minHeight,renderWidth:0,renderHeight:0,slots:e})},mounted:function(){var t=this,e=t.$scopedSlots,i=t.chunkConfig,n=t.$xeSplit,e=(i.slots=e,t.$refs.refElem);n&&e&&(0,_util.assembleSplitItem)(n,e,i)},beforeDestroy:function(){var t=this.chunkConfig,e=this.$xeSplit;e&&(0,_util.destroySplitItem)(e,t)},render:function(t){return this.renderVN(t)}});
@@ -15,10 +15,8 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
15
15
  name: 'VxeSplit',
16
16
  mixins: [_ui.globalMixins.sizeMixin],
17
17
  props: {
18
- resize: {
19
- type: Boolean,
20
- default: null
21
- },
18
+ width: [Number, String],
19
+ height: [Number, String],
22
20
  vertical: {
23
21
  type: Boolean,
24
22
  default: function _default() {
@@ -31,18 +29,13 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
31
29
  return (0, _ui.getConfig)().split.border;
32
30
  }
33
31
  },
34
- minWidth: {
35
- type: [Number, String],
32
+ padding: {
33
+ type: Boolean,
36
34
  default: function _default() {
37
- return (0, _ui.getConfig)().split.minWidth;
35
+ return (0, _ui.getConfig)().split.padding;
38
36
  }
39
37
  },
40
- minHeight: {
41
- type: [Number, String],
42
- default: function _default() {
43
- return (0, _ui.getConfig)().split.minHeight;
44
- }
45
- }
38
+ itemConfig: Object
46
39
  },
47
40
  data: function data() {
48
41
  var xID = _xeUtils.default.uniqueId();
@@ -62,7 +55,13 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
62
55
  $xeSplit: $xeSplit
63
56
  };
64
57
  },
65
- computed: Object.assign({}, {}),
58
+ computed: Object.assign(Object.assign({}, {}), {
59
+ computeItemOpts: function computeItemOpts() {
60
+ var $xeSplit = this;
61
+ var props = $xeSplit;
62
+ return Object.assign({}, (0, _ui.getConfig)().split.itemConfig, props.itemConfig);
63
+ }
64
+ }),
66
65
  methods: {
67
66
  //
68
67
  // Method
@@ -91,9 +90,7 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
91
90
  var props = $xeSplit;
92
91
  var reactData = $xeSplit.reactData;
93
92
  return $xeSplit.$nextTick().then(function () {
94
- var vertical = props.vertical,
95
- minWidth = props.minWidth,
96
- minHeight = props.minHeight;
93
+ var vertical = props.vertical;
97
94
  var staticItems = reactData.staticItems;
98
95
  var el = $xeSplit.$refs.refElem;
99
96
  if (!el) {
@@ -104,6 +101,9 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
104
101
  if (!wrapperWidth || !wrapperHeight) {
105
102
  return;
106
103
  }
104
+ var itemOpts = $xeSplit.computeItemOpts;
105
+ var allMinWidth = _xeUtils.default.toNumber(itemOpts.minWidth);
106
+ var allMinHeight = _xeUtils.default.toNumber(itemOpts.minHeight);
107
107
  var residueItems = [];
108
108
  if (vertical) {
109
109
  var countHeight = 0;
@@ -125,7 +125,7 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
125
125
  if (residueItems.length) {
126
126
  var reMeanHeight = (wrapperHeight - countHeight) / residueItems.length;
127
127
  residueItems.forEach(function (item) {
128
- item.renderHeight = Math.max((0, _utils.getGlobalDefaultConfig)(item.minHeight, minHeight), reMeanHeight);
128
+ item.renderHeight = Math.max(_xeUtils.default.toNumber((0, _utils.getGlobalDefaultConfig)(item.minHeight, allMinHeight)), reMeanHeight);
129
129
  });
130
130
  }
131
131
  } else {
@@ -148,7 +148,7 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
148
148
  if (residueItems.length) {
149
149
  var reMeanWidth = (wrapperWidth - countWidth) / residueItems.length;
150
150
  residueItems.forEach(function (item) {
151
- item.renderWidth = Math.max((0, _utils.getGlobalDefaultConfig)(item.minWidth, minWidth), reMeanWidth);
151
+ item.renderWidth = Math.max(_xeUtils.default.toNumber((0, _utils.getGlobalDefaultConfig)(item.minWidth, allMinWidth)), reMeanWidth);
152
152
  });
153
153
  }
154
154
  }
@@ -159,9 +159,7 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
159
159
  var props = $xeSplit;
160
160
  var reactData = $xeSplit.reactData;
161
161
  evnt.preventDefault();
162
- var vertical = props.vertical,
163
- minWidth = props.minWidth,
164
- minHeight = props.minHeight;
162
+ var vertical = props.vertical;
165
163
  var staticItems = reactData.staticItems;
166
164
  var handleEl = evnt.currentTarget;
167
165
  var el = $xeSplit.$refs.refElem;
@@ -176,6 +174,9 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
176
174
  if (!item) {
177
175
  return;
178
176
  }
177
+ var itemOpts = $xeSplit.computeItemOpts;
178
+ var allMinWidth = _xeUtils.default.toNumber(itemOpts.minWidth);
179
+ var allMinHeight = _xeUtils.default.toNumber(itemOpts.minHeight);
179
180
  var prevItem = staticItems[itemIndex - 1];
180
181
  var prevItemEl = prevItem ? el.querySelector(".vxe-split-item[xid=\"".concat(prevItem.id, "\"]")) : null;
181
182
  var currItemEl = item ? el.querySelector(".vxe-split-item[xid=\"".concat(item.id, "\"]")) : null;
@@ -183,10 +184,10 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
183
184
  var currWidth = currItemEl ? currItemEl.clientWidth : 0;
184
185
  var prevHeight = prevItemEl ? prevItemEl.clientHeight : 0;
185
186
  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);
187
+ var prevMinWidth = _xeUtils.default.toNumber(prevItem ? (0, _utils.getGlobalDefaultConfig)(prevItem.minWidth, allMinWidth) : allMinWidth);
188
+ var currMinWidth = _xeUtils.default.toNumber((0, _utils.getGlobalDefaultConfig)(item.minWidth, allMinWidth));
189
+ var prevMinHeight = _xeUtils.default.toNumber(prevItem ? (0, _utils.getGlobalDefaultConfig)(prevItem.minHeight, allMinHeight) : allMinHeight);
190
+ var currMinHeight = _xeUtils.default.toNumber((0, _utils.getGlobalDefaultConfig)(item.minHeight, allMinHeight));
190
191
  var disX = evnt.clientX;
191
192
  var disY = evnt.clientY;
192
193
  (0, _dom.addClass)(el, 'is--drag');
@@ -242,6 +243,7 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
242
243
  var props = $xeSplit;
243
244
  var reactData = $xeSplit.reactData;
244
245
  var border = props.border,
246
+ padding = props.padding,
245
247
  vertical = props.vertical;
246
248
  var staticItems = reactData.staticItems;
247
249
  var itemVNs = [];
@@ -266,6 +268,7 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
266
268
  xid: id
267
269
  },
268
270
  class: ['vxe-split-item', vertical ? 'is--vertical' : 'is--horizontal', {
271
+ 'is--padding': padding,
269
272
  'is--border': border,
270
273
  'is--height': renderHeight,
271
274
  'is--width': renderWidth,
@@ -286,7 +289,9 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
286
289
  xid: id
287
290
  },
288
291
  class: 'vxe-split-item--wrapper'
289
- }, defaultSlot ? $xeSplit.callSlot(defaultSlot, {}) : [])]));
292
+ }, [h('div', {
293
+ class: 'vxe-split-item--inner'
294
+ }, defaultSlot ? $xeSplit.callSlot(defaultSlot, {}) : [])])]));
290
295
  });
291
296
  return h('div', {
292
297
  class: 'vxe-split-wrapper'
@@ -296,11 +301,21 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
296
301
  var $xeSplit = this;
297
302
  var props = $xeSplit;
298
303
  var slots = $xeSplit.$scopedSlots;
299
- var vertical = props.vertical;
304
+ var vertical = props.vertical,
305
+ width = props.width,
306
+ height = props.height;
300
307
  var defaultSlot = slots.default;
308
+ var stys = {};
309
+ if (height) {
310
+ stys.height = (0, _dom.toCssUnit)(height);
311
+ }
312
+ if (width) {
313
+ stys.width = (0, _dom.toCssUnit)(width);
314
+ }
301
315
  return h('div', {
302
316
  ref: 'refElem',
303
- class: ['vxe-split', vertical ? 'is--vertical' : 'is--horizontal']
317
+ class: ['vxe-split', vertical ? 'is--vertical' : 'is--horizontal'],
318
+ style: stys
304
319
  }, [h('div', {
305
320
  class: 'vxe-split-slots'
306
321
  }, defaultSlot ? defaultSlot({}) : []), $xeSplit.renderItems(h)]);
@@ -1 +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)}});
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(t){return t&&t.__esModule?t:{default:t}}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeSplit",mixins:[_ui.globalMixins.sizeMixin],props:{width:[Number,String],height:[Number,String],vertical:{type:Boolean,default:function(){return(0,_ui.getConfig)().split.vertical}},border:{type:Boolean,default:function(){return(0,_ui.getConfig)().split.border}},padding:{type:Boolean,default:function(){return(0,_ui.getConfig)().split.padding}},itemConfig:Object},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{staticItems:[]},internalData:{}}},provide:function(){return{$xeSplit:this}},computed:Object.assign(Object.assign({},{}),{computeItemOpts:function(){return Object.assign({},(0,_ui.getConfig)().split.itemConfig,this.itemConfig)}}),methods:{dispatchEvent:function(t,e,i){this.$emit(t,(0,_ui.createEvent)(i,{$split:this},e))},callSlot:function(t,e){var i=this.$scopedSlots;return t&&(_xeUtils.default.isString(t)&&(t=i[t]||null),_xeUtils.default.isFunction(t))?(0,_vn.getSlotVNs)(t(e)):[]},recalculate:function(){var f=this,m=f,h=f.reactData;return f.$nextTick().then(function(){var n,r,e,i,l,s,u,o,a,t=m.vertical,d=h.staticItems,c=f.$refs.refElem;c&&(n=c.clientWidth,r=c.clientHeight,n)&&r&&(c=f.computeItemOpts,e=_xeUtils.default.toNumber(c.minWidth),i=_xeUtils.default.toNumber(c.minHeight),l=[],t?(s=0,d.forEach(function(t){var e=t.height,i=0;e?(i=(0,_dom.isScale)(e)?r*_xeUtils.default.toNumber(e):_xeUtils.default.toNumber(e),t.renderHeight=i):l.push(t),s+=i}),l.length&&(u=(r-s)/l.length,l.forEach(function(t){t.renderHeight=Math.max(_xeUtils.default.toNumber((0,_utils.getGlobalDefaultConfig)(t.minHeight,i)),u)}))):(o=0,d.forEach(function(t){var e=t.width,i=0;e?(i=(0,_dom.isScale)(e)?n*_xeUtils.default.toNumber(e):_xeUtils.default.toNumber(e),t.renderWidth=i):l.push(t),o+=i}),l.length&&(a=(n-o)/l.length,l.forEach(function(t){t.renderWidth=Math.max(_xeUtils.default.toNumber((0,_utils.getGlobalDefaultConfig)(t.minWidth,e)),a)}))))})},dragEvent:function(t){var e,i,n,r,l,s,u,o,a,d,c,f,m,h,g=this,p=g,_=g.reactData,v=(t.preventDefault(),p.vertical),p=_.staticItems,_=t.currentTarget,x=g.$refs.refElem;x&&(e=_.getAttribute("xid"),_=_xeUtils.default.findIndexOf(p,function(t){return t.id===e}),i=p[_])&&(g=g.computeItemOpts,n=_xeUtils.default.toNumber(g.minWidth),g=_xeUtils.default.toNumber(g.minHeight),p=(r=p[_-1])?x.querySelector('.vxe-split-item[xid="'.concat(r.id,'"]')):null,_=i?x.querySelector('.vxe-split-item[xid="'.concat(i.id,'"]')):null,l=p?p.clientWidth:0,s=_?_.clientWidth:0,u=p?p.clientHeight:0,o=_?_.clientHeight:0,a=_xeUtils.default.toNumber(r?(0,_utils.getGlobalDefaultConfig)(r.minWidth,n):n),d=_xeUtils.default.toNumber((0,_utils.getGlobalDefaultConfig)(i.minWidth,n)),c=_xeUtils.default.toNumber(r?(0,_utils.getGlobalDefaultConfig)(r.minHeight,g):g),f=_xeUtils.default.toNumber((0,_utils.getGlobalDefaultConfig)(i.minHeight,g)),m=t.clientX,h=t.clientY,(0,_dom.addClass)(x,"is--drag"),document.onmousemove=function(t){var e;t.preventDefault(),v?0<(e=t.clientY-h)?r&&f<=o-e&&(r.renderHeight=u+e,i.renderHeight=o-e):r&&c<=u+e&&(r.renderHeight=u+e,i.renderHeight=o-e):0<(e=t.clientX-m)?r&&d<=s-e&&(r.renderWidth=l+e,i.renderWidth=s-e):r&&a<=l+e&&(r.renderWidth=l+e,i.renderWidth=s-e)},document.onmouseup=function(){document.onmousemove=null,(document.onmouseup=null,_dom.removeClass)(x,"is--drag")})},renderItems:function(s){var u=this,t=u.reactData,o=u.border,a=u.padding,d=u.vertical,t=t.staticItems,c=[];return t.forEach(function(t,e){var i=t.id,n=t.slots,r=t.renderHeight,t=t.renderWidth,n=n?n.default:null,l={};d?r&&(l.height=(0,_dom.toCssUnit)(r)):t&&(l.width=(0,_dom.toCssUnit)(t)),c.push(s("div",{attrs:{xid:i},class:["vxe-split-item",d?"is--vertical":"is--horizontal",{"is--padding":a,"is--border":o,"is--height":r,"is--width":t,"is--fill":!r&&!t,"is--handle":0<e}],style:l},[e?s("div",{attrs:{xid:i},class:"vxe-split-item-handle",on:{mousedown:u.dragEvent}}):(0,_ui.renderEmptyElement)(u),s("div",{attrs:{xid:i},class:"vxe-split-item--wrapper"},[s("div",{class:"vxe-split-item--inner"},n?u.callSlot(n,{}):[])])]))}),s("div",{class:"vxe-split-wrapper"},c)},renderVN:function(t){var e=this.$scopedSlots,i=this.vertical,n=this.width,r=this.height,e=e.default,l={};return r&&(l.height=(0,_dom.toCssUnit)(r)),n&&(l.width=(0,_dom.toCssUnit)(n)),t("div",{ref:"refElem",class:["vxe-split",i?"is--vertical":"is--horizontal"],style:l},[t("div",{class:"vxe-split-slots"},e?e({}):[]),this.renderItems(t)])}},render:function(t){return this.renderVN(t)}});
@@ -7,18 +7,18 @@ exports.assembleSplitItem = assembleSplitItem;
7
7
  exports.destroySplitItem = destroySplitItem;
8
8
  var _xeUtils = _interopRequireDefault(require("xe-utils"));
9
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
- function assembleSplitItem($xeSplit, elem, itemConfig) {
10
+ function assembleSplitItem($xeSplit, elem, chunkConfig) {
11
11
  var staticItems = $xeSplit.reactData.staticItems;
12
12
  var parentElem = elem.parentNode;
13
13
  if (parentElem) {
14
- staticItems.splice(_xeUtils.default.arrayIndexOf(parentElem.children, elem), 0, itemConfig);
14
+ staticItems.splice(_xeUtils.default.arrayIndexOf(parentElem.children, elem), 0, chunkConfig);
15
15
  $xeSplit.reactData.staticItems = staticItems.slice(0);
16
16
  }
17
17
  }
18
- function destroySplitItem($xeSplit, itemConfig) {
18
+ function destroySplitItem($xeSplit, chunkConfig) {
19
19
  var staticItems = $xeSplit.reactData.staticItems;
20
20
  var index = _xeUtils.default.findIndexOf(staticItems, function (item) {
21
- return item.id === itemConfig.id;
21
+ return item.id === chunkConfig.id;
22
22
  });
23
23
  if (index > -1) {
24
24
  staticItems.splice(index, 1);
@@ -50,15 +50,27 @@
50
50
  .vxe-split-item--wrapper {
51
51
  position: relative;
52
52
  word-break: break-word;
53
- overflow: auto;
53
+ overflow: hidden;
54
54
  flex-grow: 1;
55
55
  }
56
+ .vxe-split-item--wrapper > .vxe-split {
57
+ height: 100%;
58
+ }
59
+
60
+ .vxe-split-item--inner {
61
+ height: 100%;
62
+ width: 100%;
63
+ overflow: auto;
64
+ }
56
65
 
57
66
  .vxe-split-item {
58
67
  display: flex;
59
68
  position: relative;
60
69
  overflow: auto;
61
70
  }
71
+ .vxe-split-item.is--padding > .vxe-split-item--wrapper {
72
+ padding: var(--vxe-ui-layout-padding-default);
73
+ }
62
74
  .vxe-split-item.is--fill {
63
75
  flex-grow: 1;
64
76
  }
@@ -1 +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}
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:hidden;flex-grow:1}.vxe-split-item--wrapper>.vxe-split{height:100%}.vxe-split-item--inner{height:100%;width:100%;overflow:auto}.vxe-split-item{display:flex;position:relative;overflow:auto}.vxe-split-item.is--padding>.vxe-split-item--wrapper{padding:var(--vxe-ui-layout-padding-default)}.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}