vxe-pc-ui 4.4.26 → 4.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.
Files changed (121) hide show
  1. package/es/col/style.css +0 -105
  2. package/es/col/style.min.css +0 -1
  3. package/es/components.js +6 -0
  4. package/es/icon/style.css +1 -1
  5. package/es/modal/src/modal.js +2 -4
  6. package/es/row/style.css +106 -0
  7. package/es/row/style.min.css +1 -1
  8. package/es/split/index.js +12 -0
  9. package/es/split/src/split-item.js +93 -0
  10. package/es/split/src/split.js +292 -0
  11. package/es/split/src/util.js +17 -0
  12. package/es/split/style.css +88 -0
  13. package/es/split/style.min.css +1 -0
  14. package/es/split-item/index.js +12 -0
  15. package/es/split-item/style.css +0 -0
  16. package/es/split-item/style.min.css +0 -0
  17. package/es/style.css +1 -1
  18. package/es/style.min.css +1 -1
  19. package/es/ui/index.js +6 -1
  20. package/es/ui/src/log.js +1 -1
  21. package/es/ui/src/utils.js +6 -0
  22. package/es/vxe-col/style.css +0 -105
  23. package/es/vxe-col/style.min.css +0 -1
  24. package/es/vxe-row/style.css +106 -0
  25. package/es/vxe-row/style.min.css +1 -1
  26. package/es/vxe-split/index.js +3 -0
  27. package/es/vxe-split/style.css +88 -0
  28. package/es/vxe-split/style.min.css +1 -0
  29. package/es/vxe-split-item/index.js +3 -0
  30. package/es/vxe-split-item/style.css +0 -0
  31. package/es/vxe-split-item/style.min.css +0 -0
  32. package/lib/col/style/style.css +0 -105
  33. package/lib/col/style/style.min.css +0 -1
  34. package/lib/components.js +25 -1
  35. package/lib/components.min.js +1 -1
  36. package/lib/icon/style/style.css +1 -1
  37. package/lib/icon/style/style.min.css +1 -1
  38. package/lib/index.umd.js +481 -7
  39. package/lib/index.umd.min.js +1 -1
  40. package/lib/modal/src/modal.js +2 -4
  41. package/lib/modal/src/modal.min.js +1 -1
  42. package/lib/row/style/style.css +106 -0
  43. package/lib/row/style/style.min.css +1 -1
  44. package/lib/split/index.js +19 -0
  45. package/lib/split/index.min.js +1 -0
  46. package/lib/split/src/split-item.js +105 -0
  47. package/lib/split/src/split-item.min.js +1 -0
  48. package/lib/split/src/split.js +315 -0
  49. package/lib/split/src/split.min.js +1 -0
  50. package/lib/split/src/util.js +25 -0
  51. package/lib/split/src/util.min.js +1 -0
  52. package/lib/split/style/index.js +1 -0
  53. package/lib/split/style/style.css +88 -0
  54. package/lib/split/style/style.min.css +1 -0
  55. package/lib/split-item/index.js +19 -0
  56. package/lib/split-item/index.min.js +1 -0
  57. package/lib/split-item/style/index.js +1 -0
  58. package/lib/split-item/style/style.css +0 -0
  59. package/lib/split-item/style/style.min.css +0 -0
  60. package/lib/style.css +1 -1
  61. package/lib/style.min.css +1 -1
  62. package/lib/ui/index.js +6 -1
  63. package/lib/ui/index.min.js +1 -1
  64. package/lib/ui/src/log.js +1 -1
  65. package/lib/ui/src/log.min.js +1 -1
  66. package/lib/ui/src/utils.js +7 -0
  67. package/lib/ui/src/utils.min.js +1 -1
  68. package/lib/vxe-col/style/style.css +0 -105
  69. package/lib/vxe-col/style/style.min.css +0 -1
  70. package/lib/vxe-row/style/style.css +106 -0
  71. package/lib/vxe-row/style/style.min.css +1 -1
  72. package/lib/vxe-split/index.js +22 -0
  73. package/lib/vxe-split/index.min.js +1 -0
  74. package/lib/vxe-split/style/index.js +1 -0
  75. package/lib/vxe-split/style/style.css +88 -0
  76. package/lib/vxe-split/style/style.min.css +1 -0
  77. package/lib/vxe-split-item/index.js +22 -0
  78. package/lib/vxe-split-item/index.min.js +1 -0
  79. package/lib/vxe-split-item/style/index.js +1 -0
  80. package/lib/vxe-split-item/style/style.css +0 -0
  81. package/lib/vxe-split-item/style/style.min.css +0 -0
  82. package/package.json +2 -2
  83. package/packages/components.ts +6 -0
  84. package/packages/modal/src/modal.ts +2 -4
  85. package/packages/row/src/col.ts +5 -5
  86. package/packages/split/index.ts +16 -0
  87. package/packages/split/src/split-item.ts +125 -0
  88. package/packages/split/src/split.ts +315 -0
  89. package/packages/split/src/util.ts +21 -0
  90. package/packages/split-item/index.ts +16 -0
  91. package/packages/ui/index.ts +5 -0
  92. package/packages/ui/src/utils.ts +7 -0
  93. package/styles/all.scss +2 -0
  94. package/styles/components/col.scss +0 -61
  95. package/styles/components/row.scss +59 -0
  96. package/styles/components/split-item.scss +0 -0
  97. package/styles/components/split.scss +103 -0
  98. package/styles/helpers/baseVar.scss +4 -0
  99. package/styles/theme/base.scss +5 -1
  100. package/styles/theme/dark.scss +3 -0
  101. package/styles/theme/light.scss +3 -0
  102. package/styles/variable.scss +4 -0
  103. package/types/all.d.ts +6 -0
  104. package/types/components/col.d.ts +11 -1
  105. package/types/components/split-item.d.ts +89 -0
  106. package/types/components/split.d.ts +96 -0
  107. package/types/components/table-plugins/extend-cell-area.d.ts +54 -0
  108. package/types/components/table.d.ts +131 -11
  109. package/types/ui/global-config.d.ts +4 -0
  110. /package/es/icon/{iconfont.1742955913094.ttf → iconfont.1743044808708.ttf} +0 -0
  111. /package/es/icon/{iconfont.1742955913094.woff → iconfont.1743044808708.woff} +0 -0
  112. /package/es/icon/{iconfont.1742955913094.woff2 → iconfont.1743044808708.woff2} +0 -0
  113. /package/es/{iconfont.1742955913094.ttf → iconfont.1743044808708.ttf} +0 -0
  114. /package/es/{iconfont.1742955913094.woff → iconfont.1743044808708.woff} +0 -0
  115. /package/es/{iconfont.1742955913094.woff2 → iconfont.1743044808708.woff2} +0 -0
  116. /package/lib/icon/style/{iconfont.1742955913094.ttf → iconfont.1743044808708.ttf} +0 -0
  117. /package/lib/icon/style/{iconfont.1742955913094.woff → iconfont.1743044808708.woff} +0 -0
  118. /package/lib/icon/style/{iconfont.1742955913094.woff2 → iconfont.1743044808708.woff2} +0 -0
  119. /package/lib/{iconfont.1742955913094.ttf → iconfont.1743044808708.ttf} +0 -0
  120. /package/lib/{iconfont.1742955913094.woff → iconfont.1743044808708.woff} +0 -0
  121. /package/lib/{iconfont.1742955913094.woff2 → iconfont.1743044808708.woff2} +0 -0
@@ -0,0 +1,125 @@
1
+ import { defineComponent, PropType, ref, h, reactive, watch, provide, inject, onMounted, onUnmounted } from 'vue'
2
+ import { createEvent } from '../../ui'
3
+ import { assembleSplitItem, destroySplitItem } from './util'
4
+ import XEUtils from 'xe-utils'
5
+
6
+ import type { SplitItemReactData, VxeSplitItemPropTypes, SplitItemPrivateRef, SplitItemInternalData, SplitItemMethods, VxeSplitItemPrivateComputed, SplitItemPrivateMethods, VxeSplitItemEmits, VxeSplitItemConstructor, ValueOf, VxeSplitDefines, VxeSplitItemPrivateMethods, VxeSplitConstructor, VxeSplitPrivateMethods } from '../../../types'
7
+
8
+ export default defineComponent({
9
+ name: 'VxeSplitItem',
10
+ props: {
11
+ width: [Number, String] as PropType<VxeSplitItemPropTypes.Width>,
12
+ height: [Number, String] as PropType<VxeSplitItemPropTypes.Height>,
13
+ minWidth: {
14
+ type: [Number, String] as PropType<VxeSplitItemPropTypes.MinWidth>,
15
+ default: () => null
16
+ },
17
+ minHeight: {
18
+ type: [Number, String] as PropType<VxeSplitItemPropTypes.MinHeight>,
19
+ default: () => null
20
+ }
21
+ },
22
+ emits: [
23
+ ] as VxeSplitItemEmits,
24
+ setup (props, context) {
25
+ const { emit, slots } = context
26
+
27
+ const xID = XEUtils.uniqueId()
28
+
29
+ const $xeSplit = inject<(VxeSplitConstructor & VxeSplitPrivateMethods) | null>('$xeSplit', null)
30
+
31
+ const refElem = ref<HTMLDivElement>()
32
+
33
+ const itemConfig = reactive<VxeSplitDefines.ItemConfig>({
34
+ id: xID,
35
+ width: props.width,
36
+ height: props.height,
37
+ minWidth: props.minWidth,
38
+ minHeight: props.minHeight,
39
+ renderWidth: 0,
40
+ renderHeight: 0,
41
+ slots: slots
42
+ })
43
+
44
+ const reactData = reactive<SplitItemReactData>({
45
+ })
46
+
47
+ const internalData: SplitItemInternalData = {
48
+ }
49
+
50
+ const computeMaps: VxeSplitItemPrivateComputed = {
51
+ }
52
+
53
+ const refMaps: SplitItemPrivateRef = {
54
+ refElem
55
+ }
56
+
57
+ const $xeSplitItem = {
58
+ xID,
59
+ props,
60
+ context,
61
+ reactData,
62
+ internalData,
63
+
64
+ getRefMaps: () => refMaps,
65
+ getComputeMaps: () => computeMaps
66
+ } as unknown as VxeSplitItemConstructor & VxeSplitItemPrivateMethods
67
+
68
+ const dispatchEvent = (type: ValueOf<VxeSplitItemEmits>, params: Record<string, any>, evnt: Event | null) => {
69
+ emit(type, createEvent(evnt, { $splitItem: $xeSplitItem }, params))
70
+ }
71
+
72
+ const splitItemMethods: SplitItemMethods = {
73
+ dispatchEvent
74
+ }
75
+
76
+ const splitItemPrivateMethods: SplitItemPrivateMethods = {
77
+ }
78
+
79
+ Object.assign($xeSplitItem, splitItemMethods, splitItemPrivateMethods)
80
+
81
+ const renderVN = () => {
82
+ return h('div', {
83
+ ref: refElem
84
+ })
85
+ }
86
+
87
+ watch(() => props.width, (val) => {
88
+ itemConfig.width = val
89
+ })
90
+
91
+ watch(() => props.height, (val) => {
92
+ itemConfig.height = val
93
+ })
94
+
95
+ watch(() => props.minWidth, (val) => {
96
+ itemConfig.minWidth = val
97
+ })
98
+
99
+ watch(() => props.minHeight, (val) => {
100
+ itemConfig.minHeight = val
101
+ })
102
+
103
+ onMounted(() => {
104
+ const elem = refElem.value
105
+ if ($xeSplit && elem) {
106
+ assembleSplitItem($xeSplit, elem, itemConfig)
107
+ }
108
+ })
109
+
110
+ onUnmounted(() => {
111
+ if ($xeSplit) {
112
+ destroySplitItem($xeSplit, itemConfig)
113
+ }
114
+ })
115
+
116
+ provide('$xeSplitItem', $xeSplitItem)
117
+
118
+ $xeSplitItem.renderVN = renderVN
119
+
120
+ return $xeSplitItem
121
+ },
122
+ render () {
123
+ return this.renderVN()
124
+ }
125
+ })
@@ -0,0 +1,315 @@
1
+ import { defineComponent, PropType, ref, h, reactive, provide, VNode, watch, nextTick, onMounted, onActivated } from 'vue'
2
+ import { getConfig, createEvent, renderEmptyElement } from '../../ui'
3
+ import { getSlotVNs } from '../../ui/src/vn'
4
+ import { toCssUnit, isScale, addClass, removeClass } from '../../ui/src/dom'
5
+ import { getGlobalDefaultConfig } from '../../ui/src/utils'
6
+ import XEUtils from 'xe-utils'
7
+
8
+ import type { SplitReactData, SplitPrivateRef, VxeSplitPropTypes, SplitInternalData, SplitMethods, VxeSplitDefines, VxeSplitPrivateComputed, SplitPrivateMethods, VxeSplitEmits, VxeSplitConstructor, ValueOf, VxeSplitPrivateMethods } from '../../../types'
9
+
10
+ export default defineComponent({
11
+ name: 'VxeSplit',
12
+ props: {
13
+ resize: {
14
+ type: Boolean as PropType<VxeSplitPropTypes.Resize>,
15
+ default: null
16
+ },
17
+ vertical: {
18
+ type: Boolean as PropType<VxeSplitPropTypes.Vertical>,
19
+ default: () => getConfig().split.vertical
20
+ },
21
+ border: {
22
+ type: Boolean as PropType<VxeSplitPropTypes.Border>,
23
+ default: () => getConfig().split.border
24
+ },
25
+ minWidth: {
26
+ type: [Number, String] as PropType<VxeSplitPropTypes.MinWidth>,
27
+ default: () => getConfig().split.minWidth
28
+ },
29
+ minHeight: {
30
+ type: [Number, String] as PropType<VxeSplitPropTypes.MinHeight>,
31
+ default: () => getConfig().split.minHeight
32
+ }
33
+ },
34
+ emits: [
35
+ ] as VxeSplitEmits,
36
+ setup (props, context) {
37
+ const { emit, slots } = context
38
+
39
+ const xID = XEUtils.uniqueId()
40
+
41
+ const refElem = ref<HTMLDivElement>()
42
+
43
+ const reactData = reactive<SplitReactData>({
44
+ staticItems: []
45
+ })
46
+
47
+ const internalData: SplitInternalData = {
48
+ }
49
+
50
+ const computeMaps: VxeSplitPrivateComputed = {
51
+ }
52
+
53
+ const refMaps: SplitPrivateRef = {
54
+ refElem
55
+ }
56
+
57
+ const $xeSplit = {
58
+ xID,
59
+ props,
60
+ context,
61
+ reactData,
62
+ internalData,
63
+
64
+ getRefMaps: () => refMaps,
65
+ getComputeMaps: () => computeMaps
66
+ } as unknown as VxeSplitConstructor & VxeSplitPrivateMethods
67
+
68
+ const dispatchEvent = (type: ValueOf<VxeSplitEmits>, params: Record<string, any>, evnt: Event | null) => {
69
+ emit(type, createEvent(evnt, { $split: $xeSplit }, params))
70
+ }
71
+
72
+ const callSlot = (slotFunc: any, params: any) => {
73
+ if (slotFunc) {
74
+ if (XEUtils.isString(slotFunc)) {
75
+ slotFunc = slots[slotFunc] || null
76
+ }
77
+ if (XEUtils.isFunction(slotFunc)) {
78
+ return getSlotVNs(slotFunc(params))
79
+ }
80
+ }
81
+ return []
82
+ }
83
+
84
+ const recalculate = () => {
85
+ return nextTick().then(() => {
86
+ const { vertical, minWidth, minHeight } = props
87
+ const { staticItems } = reactData
88
+ const el = refElem.value
89
+ if (!el) {
90
+ return
91
+ }
92
+ const wrapperWidth = el.clientWidth
93
+ const wrapperHeight = el.clientHeight
94
+ if (!wrapperWidth || !wrapperHeight) {
95
+ return
96
+ }
97
+ const residueItems: VxeSplitDefines.ItemConfig[] = []
98
+ if (vertical) {
99
+ let countHeight = 0
100
+ staticItems.forEach(item => {
101
+ const { height } = item
102
+ let itemHeight = 0
103
+ if (height) {
104
+ if (isScale(height)) {
105
+ itemHeight = wrapperHeight * XEUtils.toNumber(height)
106
+ } else {
107
+ itemHeight = XEUtils.toNumber(height)
108
+ }
109
+ item.renderHeight = itemHeight
110
+ } else {
111
+ residueItems.push(item)
112
+ }
113
+ countHeight += itemHeight
114
+ })
115
+ if (residueItems.length) {
116
+ const reMeanHeight = (wrapperHeight - countHeight) / residueItems.length
117
+ residueItems.forEach(item => {
118
+ item.renderHeight = Math.max(getGlobalDefaultConfig(item.minHeight, minHeight), reMeanHeight)
119
+ })
120
+ }
121
+ } else {
122
+ let countWidth = 0
123
+ staticItems.forEach(item => {
124
+ const { width } = item
125
+ let itemWidth = 0
126
+ if (width) {
127
+ if (isScale(width)) {
128
+ itemWidth = wrapperWidth * XEUtils.toNumber(width)
129
+ } else {
130
+ itemWidth = XEUtils.toNumber(width)
131
+ }
132
+ item.renderWidth = itemWidth
133
+ } else {
134
+ residueItems.push(item)
135
+ }
136
+ countWidth += itemWidth
137
+ })
138
+ if (residueItems.length) {
139
+ const reMeanWidth = (wrapperWidth - countWidth) / residueItems.length
140
+ residueItems.forEach(item => {
141
+ item.renderWidth = Math.max(getGlobalDefaultConfig(item.minWidth, minWidth), reMeanWidth)
142
+ })
143
+ }
144
+ }
145
+ })
146
+ }
147
+
148
+ const dragEvent = (evnt: MouseEvent) => {
149
+ evnt.preventDefault()
150
+ const { vertical, minWidth, minHeight } = props
151
+ const { staticItems } = reactData
152
+ const handleEl = evnt.currentTarget as HTMLDivElement
153
+ const el = refElem.value
154
+ if (!el) {
155
+ return
156
+ }
157
+ const itemId = handleEl.getAttribute('xid')
158
+ const itemIndex = XEUtils.findIndexOf(staticItems, item => item.id === itemId)
159
+ const item = staticItems[itemIndex]
160
+ if (!item) {
161
+ return
162
+ }
163
+ const prevItem = staticItems[itemIndex - 1]
164
+ const prevItemEl = prevItem ? el.querySelector<HTMLDivElement>(`.vxe-split-item[xid="${prevItem.id}"]`) : null
165
+ const currItemEl = item ? el.querySelector<HTMLDivElement>(`.vxe-split-item[xid="${item.id}"]`) : null
166
+ const prevWidth = prevItemEl ? prevItemEl.clientWidth : 0
167
+ const currWidth = currItemEl ? currItemEl.clientWidth : 0
168
+ const prevHeight = prevItemEl ? prevItemEl.clientHeight : 0
169
+ const currHeight = currItemEl ? currItemEl.clientHeight : 0
170
+ const prevMinWidth = prevItem ? getGlobalDefaultConfig(prevItem.minWidth, minWidth) : minWidth
171
+ const currMinWidth = getGlobalDefaultConfig(item.minWidth, minWidth)
172
+ const prevMinHeight = prevItem ? getGlobalDefaultConfig(prevItem.minHeight, minHeight) : minHeight
173
+ const currMinHeight = getGlobalDefaultConfig(item.minHeight, minHeight)
174
+ const disX = evnt.clientX
175
+ const disY = evnt.clientY
176
+ addClass(el, 'is--drag')
177
+ document.onmousemove = evnt => {
178
+ evnt.preventDefault()
179
+ if (vertical) {
180
+ const offsetTop = evnt.clientY - disY
181
+ if (offsetTop > 0) {
182
+ if (prevItem) {
183
+ if (currHeight - offsetTop >= currMinHeight) {
184
+ prevItem.renderHeight = prevHeight + offsetTop
185
+ item.renderHeight = currHeight - offsetTop
186
+ }
187
+ }
188
+ } else {
189
+ if (prevItem) {
190
+ if (prevHeight + offsetTop >= prevMinHeight) {
191
+ prevItem.renderHeight = prevHeight + offsetTop
192
+ item.renderHeight = currHeight - offsetTop
193
+ }
194
+ }
195
+ }
196
+ } else {
197
+ const offsetLeft = evnt.clientX - disX
198
+ if (offsetLeft > 0) {
199
+ if (prevItem) {
200
+ if (currWidth - offsetLeft >= currMinWidth) {
201
+ prevItem.renderWidth = prevWidth + offsetLeft
202
+ item.renderWidth = currWidth - offsetLeft
203
+ }
204
+ }
205
+ } else {
206
+ if (prevItem) {
207
+ if (prevWidth + offsetLeft >= prevMinWidth) {
208
+ prevItem.renderWidth = prevWidth + offsetLeft
209
+ item.renderWidth = currWidth - offsetLeft
210
+ }
211
+ }
212
+ }
213
+ }
214
+ }
215
+ document.onmouseup = () => {
216
+ document.onmousemove = null
217
+ document.onmouseup = null
218
+ removeClass(el, 'is--drag')
219
+ }
220
+ }
221
+
222
+ const splitMethods: SplitMethods = {
223
+ dispatchEvent,
224
+ recalculate
225
+ }
226
+
227
+ const splitPrivateMethods: SplitPrivateMethods = {
228
+ }
229
+
230
+ Object.assign($xeSplit, splitMethods, splitPrivateMethods)
231
+
232
+ const renderItems = () => {
233
+ const { border, vertical } = props
234
+ const { staticItems } = reactData
235
+ const itemVNs: VNode[] = []
236
+ staticItems.forEach((item, index) => {
237
+ const { id, slots, renderHeight, renderWidth } = item
238
+ const defaultSlot = slots ? slots.default : null
239
+ const stys: Record<string, string | number> = {}
240
+ if (vertical) {
241
+ if (renderHeight) {
242
+ stys.height = toCssUnit(renderHeight)
243
+ }
244
+ } else {
245
+ if (renderWidth) {
246
+ stys.width = toCssUnit(renderWidth)
247
+ }
248
+ }
249
+ itemVNs.push(
250
+ h('div', {
251
+ xid: id,
252
+ class: ['vxe-split-item', vertical ? 'is--vertical' : 'is--horizontal', {
253
+ 'is--border': border,
254
+ 'is--height': renderHeight,
255
+ 'is--width': renderWidth,
256
+ 'is--fill': !renderHeight && !renderWidth,
257
+ 'is--handle': index > 0
258
+ }],
259
+ style: stys
260
+ }, [
261
+ index
262
+ ? h('div', {
263
+ xid: id,
264
+ class: 'vxe-split-item-handle',
265
+ onMousedown: dragEvent
266
+ })
267
+ : renderEmptyElement($xeSplit),
268
+ h('div', {
269
+ xid: id,
270
+ class: 'vxe-split-item--wrapper'
271
+ }, defaultSlot ? callSlot(defaultSlot, { }) : [])
272
+ ])
273
+ )
274
+ })
275
+ return h('div', {
276
+ class: 'vxe-split-wrapper'
277
+ }, itemVNs)
278
+ }
279
+
280
+ const renderVN = () => {
281
+ const { vertical } = props
282
+ const defaultSlot = slots.default
283
+ return h('div', {
284
+ ref: refElem,
285
+ class: ['vxe-split', vertical ? 'is--vertical' : 'is--horizontal']
286
+ }, [
287
+ h('div', {
288
+ class: 'vxe-split-slots'
289
+ }, defaultSlot ? defaultSlot({}) : []),
290
+ renderItems()
291
+ ])
292
+ }
293
+
294
+ watch(() => reactData.staticItems, () => {
295
+ recalculate()
296
+ })
297
+
298
+ onMounted(() => {
299
+ recalculate()
300
+ })
301
+
302
+ onActivated(() => {
303
+ recalculate()
304
+ })
305
+
306
+ provide('$xeSplit', $xeSplit)
307
+
308
+ $xeSplit.renderVN = renderVN
309
+
310
+ return $xeSplit
311
+ },
312
+ render () {
313
+ return this.renderVN()
314
+ }
315
+ })
@@ -0,0 +1,21 @@
1
+ import XEUtils from 'xe-utils'
2
+
3
+ import type { VxeSplitConstructor, VxeSplitPrivateMethods, VxeSplitDefines } from '../../../types'
4
+
5
+ export function assembleSplitItem ($xeSplit: VxeSplitConstructor & VxeSplitPrivateMethods, elem: HTMLElement, itemConfig: VxeSplitDefines.ItemConfig) {
6
+ const staticItems = $xeSplit.reactData.staticItems
7
+ const parentElem = elem.parentNode
8
+ if (parentElem) {
9
+ staticItems.splice(XEUtils.arrayIndexOf(parentElem.children, elem), 0, itemConfig)
10
+ $xeSplit.reactData.staticItems = staticItems.slice(0)
11
+ }
12
+ }
13
+
14
+ export function destroySplitItem ($xeSplit: VxeSplitConstructor & VxeSplitPrivateMethods, itemConfig: VxeSplitDefines.ItemConfig) {
15
+ const staticItems = $xeSplit.reactData.staticItems
16
+ const index = XEUtils.findIndexOf(staticItems, item => item.id === itemConfig.id)
17
+ if (index > -1) {
18
+ staticItems.splice(index, 1)
19
+ }
20
+ $xeSplit.reactData.staticItems = staticItems.slice(0)
21
+ }
@@ -0,0 +1,16 @@
1
+ import { App } from 'vue'
2
+ import { VxeUI } from '@vxe-ui/core'
3
+ import VxeSplitItemComponent from '../split/src/split-item'
4
+ import { dynamicApp } from '../dynamics'
5
+
6
+ export const VxeSplitItem = Object.assign({}, VxeSplitItemComponent, {
7
+ install (app: App) {
8
+ app.component(VxeSplitItemComponent.name as string, VxeSplitItemComponent)
9
+ }
10
+ })
11
+
12
+ dynamicApp.use(VxeSplitItem)
13
+ VxeUI.component(VxeSplitItemComponent)
14
+
15
+ export const SplitItem = VxeSplitItem
16
+ export default VxeSplitItem
@@ -277,6 +277,11 @@ setConfig({
277
277
  oSize: 2
278
278
  }
279
279
  },
280
+ split: {
281
+ minWidth: 40,
282
+ minHeight: 40
283
+ },
284
+ splitItem: {},
280
285
  slider: {
281
286
  max: 100,
282
287
  min: 0
@@ -14,6 +14,13 @@ export function getLastZIndex () {
14
14
  return DomZIndex.getCurrent()
15
15
  }
16
16
 
17
+ export function getGlobalDefaultConfig (value: any, globalValue: any) {
18
+ if (XEUtils.eqNull(value)) {
19
+ return globalValue
20
+ }
21
+ return value
22
+ }
23
+
17
24
  export function getFuncText (content: string | number | boolean | null | undefined, args?: any) {
18
25
  if (content) {
19
26
  const translate = getConfig().translate
package/styles/all.scss CHANGED
@@ -65,6 +65,8 @@
65
65
  @use './components/result.scss';
66
66
  @use './components/row.scss';
67
67
  @use './components/select.scss';
68
+ @use './components/split.scss';
69
+ @use './components/split-item.scss';
68
70
  @use './components/slider.scss';
69
71
  @use './components/steps.scss';
70
72
  @use './components/switch.scss';
@@ -1,61 +0,0 @@
1
- @use "sass:list";
2
-
3
- // 24 栅格布局
4
- $colSpanList: 4.16667%, 8.33333%, 12.5%, 16.66667%, 20.83333%, 25%, 29.16667%, 33.33333%,
5
- 37.5%, 41.66667%, 45.83333%, 50%, 54.16667%, 58.33333%, 62.5%, 66.66667%,
6
- 70.83333%, 75%, 79.16667%, 83.33333%, 87.5%, 91.66667%, 95.83333%, 100%;
7
- .vxe-col {
8
- display: block;
9
- &.is--ellipsis {
10
- overflow: hidden;
11
- text-overflow: ellipsis;
12
- white-space: nowrap;
13
- }
14
- &.is--fill {
15
- flex-grow: 1;
16
- }
17
- &:not(.is--fill) {
18
- flex-shrink: 0;
19
- }
20
- &.align--left {
21
- text-align: left;
22
- }
23
- &.align--center {
24
- text-align: center;
25
- }
26
- &.align--right {
27
- text-align: right;
28
- }
29
- @for $i from 0 to list.length($colSpanList) {
30
- &.span#{$i + 1} {
31
- width: list.nth($colSpanList, $i + 1);
32
- }
33
- }
34
- }
35
-
36
- .vxe-col--inner {
37
- display: flex;
38
- flex-direction: column;
39
- width: 100%;
40
- }
41
-
42
- .vxe-col {
43
- &.is--span,
44
- &.is--width {
45
- & > .vxe-col--inner {
46
- & > .vxe-default-textarea,
47
- & > .vxe-default-select,
48
- & > .vxe-input,
49
- & > .vxe-number-input,
50
- & > .vxe-password-input,
51
- & > .vxe-date-picker,
52
- & > .vxe-textarea,
53
- & > .vxe-select,
54
- & > .vxe-tree-select,
55
- & > .vxe-table-select,
56
- & > .vxe-ico-picker {
57
- width: 100%;
58
- }
59
- }
60
- }
61
- }
@@ -1,3 +1,6 @@
1
+ @use "sass:list";
2
+ @use '../helpers/baseVar.scss' as base_var;
3
+
1
4
  .vxe-row {
2
5
  position: relative;
3
6
  display: flex;
@@ -10,3 +13,59 @@
10
13
  flex-wrap: wrap;
11
14
  }
12
15
  }
16
+
17
+ .vxe-col {
18
+ display: block;
19
+ &.is--ellipsis {
20
+ overflow: hidden;
21
+ text-overflow: ellipsis;
22
+ white-space: nowrap;
23
+ }
24
+ &.is--fill {
25
+ flex-grow: 1;
26
+ }
27
+ &:not(.is--fill) {
28
+ flex-shrink: 0;
29
+ }
30
+ &.align--left {
31
+ text-align: left;
32
+ }
33
+ &.align--center {
34
+ text-align: center;
35
+ }
36
+ &.align--right {
37
+ text-align: right;
38
+ }
39
+ @for $i from 0 to list.length(base_var.$colSpanList) {
40
+ &.span#{$i + 1} {
41
+ width: list.nth(base_var.$colSpanList, $i + 1);
42
+ }
43
+ }
44
+ }
45
+
46
+ .vxe-col--inner {
47
+ display: flex;
48
+ flex-direction: column;
49
+ width: 100%;
50
+ }
51
+
52
+ .vxe-col {
53
+ &.is--span,
54
+ &.is--width {
55
+ & > .vxe-col--inner {
56
+ & > .vxe-default-textarea,
57
+ & > .vxe-default-select,
58
+ & > .vxe-input,
59
+ & > .vxe-number-input,
60
+ & > .vxe-password-input,
61
+ & > .vxe-date-picker,
62
+ & > .vxe-textarea,
63
+ & > .vxe-select,
64
+ & > .vxe-tree-select,
65
+ & > .vxe-table-select,
66
+ & > .vxe-ico-picker {
67
+ width: 100%;
68
+ }
69
+ }
70
+ }
71
+ }
File without changes