sh-view 2.8.0 → 2.8.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 (91) hide show
  1. package/.eslintrc.js +25 -20
  2. package/other.js +8 -8
  3. package/package.json +9 -6
  4. package/packages/components/index.js +91 -91
  5. package/packages/components/sh-alert/alert.ts +30 -0
  6. package/packages/components/sh-alert/index.vue +143 -168
  7. package/packages/components/sh-badge/index.vue +242 -242
  8. package/packages/components/sh-calendar/index.vue +650 -650
  9. package/packages/components/sh-card/index.vue +148 -148
  10. package/packages/components/sh-code-editor/index.vue +19 -19
  11. package/packages/components/sh-col/index.vue +92 -92
  12. package/packages/components/sh-corner/index.vue +230 -230
  13. package/packages/components/sh-count-to/index.vue +131 -131
  14. package/packages/components/sh-date/index.vue +301 -301
  15. package/packages/components/sh-drawer/index.vue +579 -579
  16. package/packages/components/sh-drawer/scrollbar.js +78 -78
  17. package/packages/components/sh-empty/index.vue +42 -42
  18. package/packages/components/sh-form/js/props.js +76 -76
  19. package/packages/components/sh-form/js/useForm.js +229 -229
  20. package/packages/components/sh-header/index.vue +261 -260
  21. package/packages/components/sh-icon/css/default/ionicons.svg +869 -869
  22. package/packages/components/sh-icon/css/font/iconfont.json +247 -247
  23. package/packages/components/sh-icon/index.vue +41 -41
  24. package/packages/components/sh-image/index.vue +133 -133
  25. package/packages/components/sh-list/index.vue +146 -146
  26. package/packages/components/sh-loading/index.vue +53 -53
  27. package/packages/components/sh-modal/index.vue +188 -188
  28. package/packages/components/sh-noticebar/index.vue +215 -215
  29. package/packages/components/sh-poptip/index.vue +597 -597
  30. package/packages/components/sh-progress/index.vue +276 -276
  31. package/packages/components/sh-pull-refresh/index.vue +289 -289
  32. package/packages/components/sh-result/index.vue +114 -114
  33. package/packages/components/sh-row/index.vue +66 -66
  34. package/packages/components/sh-split/components/trigger.vue +33 -33
  35. package/packages/components/sh-split/index.vue +342 -342
  36. package/packages/components/sh-table/components/importModal.vue +363 -363
  37. package/packages/components/sh-table/components/sh-column.vue +68 -68
  38. package/packages/components/sh-table/js/excel_to_json.js +313 -313
  39. package/packages/components/sh-table/js/props.js +305 -305
  40. package/packages/components/sh-table/js/tableMethods.js +167 -167
  41. package/packages/components/sh-table/js/useTable.js +636 -636
  42. package/packages/components/sh-table/table.vue +217 -217
  43. package/packages/components/sh-tabs/index.vue +426 -426
  44. package/packages/components/sh-tag/index.vue +168 -168
  45. package/packages/components/sh-toolbar/index.vue +182 -182
  46. package/packages/components/sh-tree/components/table-tree.vue +289 -289
  47. package/packages/components/sh-tree/mixin/treeProps.js +122 -122
  48. package/packages/components/sh-upload/index.vue +535 -535
  49. package/packages/components/sh-water-fall/index.vue +80 -80
  50. package/packages/components/sh-water-mark/index.vue +96 -96
  51. package/packages/css/index.js +4 -4
  52. package/packages/directive/index.js +19 -19
  53. package/packages/directive/module/click-out.js +14 -14
  54. package/packages/directive/module/draggable.js +42 -42
  55. package/packages/directive/module/line-clamp.js +22 -22
  56. package/packages/directive/module/prevent-click.js +18 -18
  57. package/packages/directive/module/resize.js +14 -14
  58. package/packages/directive/module/ripple.js +166 -166
  59. package/packages/index.js +39 -39
  60. package/packages/mixin/index.js +86 -86
  61. package/packages/other/sh-cron-modal/components/cron-content.vue +294 -294
  62. package/packages/other/sh-cron-modal/index.vue +81 -81
  63. package/packages/other/sh-cron-modal/mixin/cron-emits.js +1 -1
  64. package/packages/other/sh-cron-modal/mixin/cron-props.js +9 -9
  65. package/packages/other/sh-cron-modal/tabs/cron-week-box.vue +126 -126
  66. package/packages/other/sh-menu/index.vue +326 -326
  67. package/packages/other/sh-menu/menu-group-content.vue +136 -136
  68. package/packages/other/sh-menu/menu-item-content.vue +71 -71
  69. package/packages/other/sh-menu-card/index.vue +250 -250
  70. package/packages/other/sh-menu-card/menu-box.vue +87 -87
  71. package/packages/other/sh-preview/components/sh-excel.vue +163 -163
  72. package/packages/other/sh-preview/js/data-hook.js +41 -41
  73. package/packages/other/sh-preview/js/data-props.js +15 -15
  74. package/packages/other/sh-system-tip/index.vue +115 -115
  75. package/packages/utils/resize.js +69 -70
  76. package/packages/utils/transfer-queue.js +12 -12
  77. package/packages/vxeTable/index.js +193 -184
  78. package/packages/vxeTable/plugins/export.js +450 -450
  79. package/packages/vxeTable/render/cell/vxe-render-img.vue +27 -27
  80. package/packages/vxeTable/render/cell/vxe-render-table.vue +51 -51
  81. package/packages/vxeTable/render/cell/vxe-render-time.vue +44 -44
  82. package/packages/vxeTable/render/cell/vxe-render-tree.vue +70 -70
  83. package/packages/vxeTable/render/filters/vxe-filter-input.vue +26 -26
  84. package/packages/vxeTable/render/filters/vxe-filter-time.vue +26 -26
  85. package/packages/vxeTable/render/globalRenders.jsx +514 -514
  86. package/packages/vxeTable/render/mixin/cell-hooks.js +198 -198
  87. package/packages/vxeTable/render/mixin/cell-props.js +23 -23
  88. package/packages/vxeTable/render/mixin/filter-hooks.js +46 -46
  89. package/tsconfig.json +25 -0
  90. package/types/component.d.ts +1 -0
  91. package/types/index.ts +0 -0
@@ -1,342 +1,342 @@
1
- <template>
2
- <div ref="splitRef" v-resize="computeOffset" class="sh-split" :class="{ 'no-select': isMoving }">
3
- <sh-loading v-if="loading" loading :content="loadingText" class="layout-loader"></sh-loading>
4
- <div v-if="isHorizontal" class="sh-split-horizontal">
5
- <div :style="{ right: `${anotherOffset}%` }" class="left-pane" :class="paneClasses">
6
- <slot name="left" />
7
- </div>
8
- <div class="sh-split-trigger-con" :style="{ left: `${offset}%` }" @mousedown="handleMousedown">
9
- <slot name="trigger">
10
- <trigger mode="vertical" />
11
- </slot>
12
- </div>
13
- <div :style="{ left: `${offset}%` }" class="right-pane" :class="paneClasses">
14
- <slot name="right" />
15
- </div>
16
- </div>
17
- <div v-else class="sh-split-vertical">
18
- <div :style="{ bottom: `${anotherOffset}%` }" class="top-pane" :class="paneClasses">
19
- <slot name="top" />
20
- </div>
21
- <div class="sh-split-trigger-con" :style="{ top: `${offset}%` }" @mousedown="handleMousedown">
22
- <slot name="trigger">
23
- <trigger mode="horizontal" />
24
- </slot>
25
- </div>
26
- <div :style="{ top: `${offset}%` }" class="bottom-pane" :class="paneClasses">
27
- <slot name="bottom" />
28
- </div>
29
- </div>
30
- </div>
31
- </template>
32
-
33
- <script>
34
- import { defineComponent, computed, getCurrentInstance, ref, watch, onMounted, nextTick } from 'vue'
35
- import trigger from './components/trigger.vue'
36
- export default defineComponent({
37
- name: 'ShSplit',
38
- components: {
39
- trigger
40
- },
41
- props: {
42
- modelValue: {
43
- type: [Number, String],
44
- default: 0.2
45
- },
46
- mode: {
47
- type: String,
48
- default: 'horizontal' // horizontal, vertical
49
- },
50
- min: {
51
- type: [Number, String],
52
- default: 0
53
- },
54
- max: {
55
- type: [Number, String],
56
- default: 0.6
57
- },
58
- disabled: {
59
- type: Boolean,
60
- default: false
61
- },
62
- dividerText: {
63
- type: String,
64
- default: ''
65
- },
66
- loading: {
67
- type: Boolean
68
- },
69
- loadingText: {
70
- type: String,
71
- default: ''
72
- },
73
- loadingType: {
74
- type: String,
75
- default: '2'
76
- }
77
- },
78
- emits: ['update:modelValue', 'move-start', 'moveing', 'move-end'],
79
- setup(props, context) {
80
- const vm = getCurrentInstance()
81
- const { $vUtils } = vm.proxy
82
- const { emit, slots } = context
83
-
84
- const splitRef = ref()
85
- const offset = ref(0)
86
- const initOffset = ref(0)
87
- const oldOffset = ref(0)
88
- const isMoving = ref(false)
89
- const computedMin = ref(0)
90
- const computedMax = ref(0)
91
- const currentValue = ref(props.modelValue)
92
-
93
- const paneClasses = computed(() => {
94
- return {
95
- 'sh-split-pane': true,
96
- 'sh-split-pane-moving': props.isMoving
97
- }
98
- })
99
- const isHorizontal = computed(() => {
100
- return props.mode === 'horizontal'
101
- })
102
- const anotherOffset = computed(() => {
103
- return 100 - offset.value
104
- })
105
- const valueIsPx = computed(() => {
106
- return typeof props.modelValue === 'string'
107
- })
108
- const offsetSize = computed(() => {
109
- return isHorizontal.value ? 'offsetWidth' : 'offsetHeight'
110
- })
111
-
112
- const px2percent = (numerator, denominator) => {
113
- return parseFloat(numerator) / parseFloat(denominator)
114
- }
115
- const getComputedThresholdValue = type => {
116
- let size = splitRef.value[offsetSize.value]
117
- if (valueIsPx.value) return typeof props[type] === 'string' ? props[type] : size * props[type]
118
- else return typeof props[type] === 'string' ? px2percent(props[type], size) : props[type]
119
- }
120
- const getMin = (value1, value2) => {
121
- if (valueIsPx.value) return `${Math.min(parseFloat(value1), parseFloat(value2))}px`
122
- else return Math.min(value1, value2)
123
- }
124
- const getMax = (value1, value2) => {
125
- if (valueIsPx.value) return `${Math.max(parseFloat(value1), parseFloat(value2))}px`
126
- else return Math.max(value1, value2)
127
- }
128
- const getAnotherOffset = value => {
129
- let res = 0
130
- if (valueIsPx.value) res = `${splitRef.value[offsetSize.value] - parseFloat(value)}px`
131
- else res = 1 - value
132
- return res
133
- }
134
- const handleMove = e => {
135
- let pageOffset = isHorizontal.value ? e.pageX : e.pageY
136
- let offset = pageOffset - initOffset.value
137
- let outerWidth = splitRef.value[offsetSize.value]
138
- let value = valueIsPx.value ? `${parseFloat(oldOffset.value) + offset}px` : px2percent(outerWidth * oldOffset.value + offset, outerWidth)
139
- let anotherValue = getAnotherOffset(value)
140
- if (parseFloat(value) <= parseFloat(computedMin.value)) value = computedMin.value
141
- if (parseFloat(anotherValue) <= parseFloat(computedMax.value)) value = getAnotherOffset(getMax(anotherValue, computedMax.value))
142
- e.atMin = currentValue.value === computedMin.value
143
- e.atMax = valueIsPx.value ? getAnotherOffset(currentValue.value) === computedMax.value : getAnotherOffset(currentValue.value).toFixed(5) === computedMax.value.toFixed(5)
144
- emitValue(value)
145
- emit('moveing', e)
146
- }
147
- const handleUp = () => {
148
- isMoving.value = false
149
- $vUtils.offListener(document, 'mousemove', handleMove)
150
- $vUtils.offListener(document, 'mouseup', handleUp)
151
- emit('move-end')
152
- }
153
- const handleMousedown = e => {
154
- initOffset.value = isHorizontal.value ? e.pageX : e.pageY
155
- oldOffset.value = currentValue.value
156
- isMoving.value = true
157
- $vUtils.onListener(document, 'mousemove', handleMove)
158
- $vUtils.onListener(document, 'mouseup', handleUp)
159
- emit('move-start')
160
- }
161
- const computeOffset = () => {
162
- computedMin.value = getComputedThresholdValue('min')
163
- computedMax.value = getComputedThresholdValue('max')
164
- offset.value = ((valueIsPx.value ? px2percent(currentValue.value, splitRef.value[offsetSize.value]) : currentValue.value) * 10000) / 100
165
- // return nextTick()
166
- }
167
- const resetOffset = val => {
168
- if (val !== currentValue.value) {
169
- currentValue.value = val
170
- computeOffset()
171
- }
172
- }
173
- const emitValue = value => {
174
- emit('update:modelValue', value)
175
- resetOffset(value)
176
- }
177
-
178
- watch(
179
- () => props.modelValue,
180
- val => {
181
- resetOffset(val)
182
- }
183
- )
184
-
185
- return {
186
- splitRef,
187
- isMoving,
188
- isHorizontal,
189
- anotherOffset,
190
- paneClasses,
191
- offset,
192
- computeOffset,
193
- handleMousedown
194
- }
195
- }
196
- })
197
- </script>
198
-
199
- <style lang="scss">
200
- $box-shadow: var(--box-shadow);
201
- $trigger-bar-background: rgba(23, 35, 61, 0.25);
202
- $trigger-background: #f8f8f9;
203
- $trigger-width: 6px;
204
- $trigger-bar-width: 4px;
205
- $trigger-bar-offset: calc(($trigger-width - $trigger-bar-width) / 2);
206
- $trigger-bar-interval: 3px;
207
- $trigger-bar-weight: 1px;
208
- $trigger-bar-con-height: calc(($trigger-bar-weight + $trigger-bar-interval) * 8);
209
-
210
- .sh-split {
211
- position: relative;
212
- width: 100%;
213
- height: 100%;
214
- .layout-loader {
215
- position: absolute;
216
- top: 0;
217
- left: 0;
218
- width: 100%;
219
- height: 100%;
220
- background: rgba(0, 0, 0, 0.4);
221
- transition: opacity 0.65s;
222
- display: flex;
223
- align-items: center;
224
- justify-content: center;
225
- flex-wrap: wrap;
226
- font-size: 15px;
227
- color: #fff;
228
- z-index: 100;
229
- }
230
- &-pane {
231
- position: absolute;
232
- overflow: auto;
233
- &.left-pane,
234
- &.right-pane {
235
- top: 0;
236
- bottom: 0;
237
- }
238
- &.left-pane {
239
- left: 0;
240
- margin-right: $trigger-bar-width;
241
- }
242
- &.right-pane {
243
- right: 0;
244
- margin-left: $trigger-bar-width;
245
- }
246
- &.top-pane,
247
- &.bottom-pane {
248
- left: 0;
249
- right: 0;
250
- }
251
- &.top-pane {
252
- top: 0;
253
- margin-bottom: $trigger-bar-width;
254
- }
255
- &.bottom-pane {
256
- bottom: 0;
257
- margin-top: $trigger-bar-width;
258
- }
259
- &-moving {
260
- -webkit-user-select: none;
261
- -moz-user-select: none;
262
- -ms-user-select: none;
263
- user-select: none;
264
- }
265
- }
266
- &-trigger {
267
- border: 1px solid var(--vxe-border-radius);
268
- &-con {
269
- position: absolute;
270
- transform: translate(-50%, -50%);
271
- z-index: 10;
272
- }
273
- &-bar-con {
274
- position: absolute;
275
- overflow: hidden;
276
- &.vertical {
277
- left: $trigger-bar-offset;
278
- top: 50%;
279
- height: $trigger-bar-con-height;
280
- transform: translate(0, -50%);
281
- }
282
- &.horizontal {
283
- left: 50%;
284
- top: $trigger-bar-offset;
285
- width: $trigger-bar-con-height;
286
- transform: translate(-50%, 0);
287
- }
288
- }
289
- &-vertical {
290
- width: $trigger-width;
291
- height: 100%;
292
- background: $trigger-background;
293
- border-top: none;
294
- border-bottom: none;
295
- cursor: col-resize;
296
- .sh-split-trigger-bar {
297
- width: $trigger-bar-width;
298
- height: 1px;
299
- background: $trigger-bar-background;
300
- float: left;
301
- margin-top: $trigger-bar-interval;
302
- }
303
- }
304
- &-horizontal {
305
- height: $trigger-width;
306
- width: 100%;
307
- background: $trigger-background;
308
- border-left: none;
309
- border-right: none;
310
- cursor: row-resize;
311
- .sh-split-trigger-bar {
312
- height: $trigger-bar-width;
313
- width: 1px;
314
- background: $trigger-bar-background;
315
- float: left;
316
- margin-right: $trigger-bar-interval;
317
- }
318
- }
319
- }
320
- &-horizontal {
321
- > .sh-split-trigger-con {
322
- top: 50%;
323
- height: 100%;
324
- width: $trigger-width;
325
- }
326
- }
327
- &-vertical {
328
- > .sh-split-trigger-con {
329
- left: 50%;
330
- height: $trigger-width;
331
- width: 100%;
332
- }
333
- }
334
- .no-select {
335
- -webkit-touch-callout: none;
336
- -webkit-user-select: none;
337
- -moz-user-select: none;
338
- -ms-user-select: none;
339
- user-select: none;
340
- }
341
- }
342
- </style>
1
+ <template>
2
+ <div ref="splitRef" v-resize="computeOffset" class="sh-split" :class="{ 'no-select': isMoving }">
3
+ <sh-loading v-if="loading" loading :content="loadingText" class="layout-loader"></sh-loading>
4
+ <div v-if="isHorizontal" class="sh-split-horizontal">
5
+ <div :style="{ right: `${anotherOffset}%` }" class="left-pane" :class="paneClasses">
6
+ <slot name="left" />
7
+ </div>
8
+ <div class="sh-split-trigger-con" :style="{ left: `${offset}%` }" @mousedown="handleMousedown">
9
+ <slot name="trigger">
10
+ <trigger mode="vertical" />
11
+ </slot>
12
+ </div>
13
+ <div :style="{ left: `${offset}%` }" class="right-pane" :class="paneClasses">
14
+ <slot name="right" />
15
+ </div>
16
+ </div>
17
+ <div v-else class="sh-split-vertical">
18
+ <div :style="{ bottom: `${anotherOffset}%` }" class="top-pane" :class="paneClasses">
19
+ <slot name="top" />
20
+ </div>
21
+ <div class="sh-split-trigger-con" :style="{ top: `${offset}%` }" @mousedown="handleMousedown">
22
+ <slot name="trigger">
23
+ <trigger mode="horizontal" />
24
+ </slot>
25
+ </div>
26
+ <div :style="{ top: `${offset}%` }" class="bottom-pane" :class="paneClasses">
27
+ <slot name="bottom" />
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </template>
32
+
33
+ <script>
34
+ import { defineComponent, computed, getCurrentInstance, ref, watch, onMounted, nextTick } from 'vue'
35
+ import trigger from './components/trigger.vue'
36
+ export default defineComponent({
37
+ name: 'ShSplit',
38
+ components: {
39
+ trigger
40
+ },
41
+ props: {
42
+ modelValue: {
43
+ type: [Number, String],
44
+ default: 0.2
45
+ },
46
+ mode: {
47
+ type: String,
48
+ default: 'horizontal' // horizontal, vertical
49
+ },
50
+ min: {
51
+ type: [Number, String],
52
+ default: 0
53
+ },
54
+ max: {
55
+ type: [Number, String],
56
+ default: 0.6
57
+ },
58
+ disabled: {
59
+ type: Boolean,
60
+ default: false
61
+ },
62
+ dividerText: {
63
+ type: String,
64
+ default: ''
65
+ },
66
+ loading: {
67
+ type: Boolean
68
+ },
69
+ loadingText: {
70
+ type: String,
71
+ default: ''
72
+ },
73
+ loadingType: {
74
+ type: String,
75
+ default: '2'
76
+ }
77
+ },
78
+ emits: ['update:modelValue', 'move-start', 'moveing', 'move-end'],
79
+ setup(props, context) {
80
+ const vm = getCurrentInstance()
81
+ const { $vUtils } = vm.proxy
82
+ const { emit, slots } = context
83
+
84
+ const splitRef = ref()
85
+ const offset = ref(0)
86
+ const initOffset = ref(0)
87
+ const oldOffset = ref(0)
88
+ const isMoving = ref(false)
89
+ const computedMin = ref(0)
90
+ const computedMax = ref(0)
91
+ const currentValue = ref(props.modelValue)
92
+
93
+ const paneClasses = computed(() => {
94
+ return {
95
+ 'sh-split-pane': true,
96
+ 'sh-split-pane-moving': props.isMoving
97
+ }
98
+ })
99
+ const isHorizontal = computed(() => {
100
+ return props.mode === 'horizontal'
101
+ })
102
+ const anotherOffset = computed(() => {
103
+ return 100 - offset.value
104
+ })
105
+ const valueIsPx = computed(() => {
106
+ return typeof props.modelValue === 'string'
107
+ })
108
+ const offsetSize = computed(() => {
109
+ return isHorizontal.value ? 'offsetWidth' : 'offsetHeight'
110
+ })
111
+
112
+ const px2percent = (numerator, denominator) => {
113
+ return parseFloat(numerator) / parseFloat(denominator)
114
+ }
115
+ const getComputedThresholdValue = type => {
116
+ let size = splitRef.value[offsetSize.value]
117
+ if (valueIsPx.value) return typeof props[type] === 'string' ? props[type] : size * props[type]
118
+ else return typeof props[type] === 'string' ? px2percent(props[type], size) : props[type]
119
+ }
120
+ const getMin = (value1, value2) => {
121
+ if (valueIsPx.value) return `${Math.min(parseFloat(value1), parseFloat(value2))}px`
122
+ else return Math.min(value1, value2)
123
+ }
124
+ const getMax = (value1, value2) => {
125
+ if (valueIsPx.value) return `${Math.max(parseFloat(value1), parseFloat(value2))}px`
126
+ else return Math.max(value1, value2)
127
+ }
128
+ const getAnotherOffset = value => {
129
+ let res = 0
130
+ if (valueIsPx.value) res = `${splitRef.value[offsetSize.value] - parseFloat(value)}px`
131
+ else res = 1 - value
132
+ return res
133
+ }
134
+ const handleMove = e => {
135
+ let pageOffset = isHorizontal.value ? e.pageX : e.pageY
136
+ let offset = pageOffset - initOffset.value
137
+ let outerWidth = splitRef.value[offsetSize.value]
138
+ let value = valueIsPx.value ? `${parseFloat(oldOffset.value) + offset}px` : px2percent(outerWidth * oldOffset.value + offset, outerWidth)
139
+ let anotherValue = getAnotherOffset(value)
140
+ if (parseFloat(value) <= parseFloat(computedMin.value)) value = computedMin.value
141
+ if (parseFloat(anotherValue) <= parseFloat(computedMax.value)) value = getAnotherOffset(getMax(anotherValue, computedMax.value))
142
+ e.atMin = currentValue.value === computedMin.value
143
+ e.atMax = valueIsPx.value ? getAnotherOffset(currentValue.value) === computedMax.value : getAnotherOffset(currentValue.value).toFixed(5) === computedMax.value.toFixed(5)
144
+ emitValue(value)
145
+ emit('moveing', e)
146
+ }
147
+ const handleUp = () => {
148
+ isMoving.value = false
149
+ $vUtils.offListener(document, 'mousemove', handleMove)
150
+ $vUtils.offListener(document, 'mouseup', handleUp)
151
+ emit('move-end')
152
+ }
153
+ const handleMousedown = e => {
154
+ initOffset.value = isHorizontal.value ? e.pageX : e.pageY
155
+ oldOffset.value = currentValue.value
156
+ isMoving.value = true
157
+ $vUtils.onListener(document, 'mousemove', handleMove)
158
+ $vUtils.onListener(document, 'mouseup', handleUp)
159
+ emit('move-start')
160
+ }
161
+ const computeOffset = () => {
162
+ computedMin.value = getComputedThresholdValue('min')
163
+ computedMax.value = getComputedThresholdValue('max')
164
+ offset.value = ((valueIsPx.value ? px2percent(currentValue.value, splitRef.value[offsetSize.value]) : currentValue.value) * 10000) / 100
165
+ // return nextTick()
166
+ }
167
+ const resetOffset = val => {
168
+ if (val !== currentValue.value) {
169
+ currentValue.value = val
170
+ computeOffset()
171
+ }
172
+ }
173
+ const emitValue = value => {
174
+ emit('update:modelValue', value)
175
+ resetOffset(value)
176
+ }
177
+
178
+ watch(
179
+ () => props.modelValue,
180
+ val => {
181
+ resetOffset(val)
182
+ }
183
+ )
184
+
185
+ return {
186
+ splitRef,
187
+ isMoving,
188
+ isHorizontal,
189
+ anotherOffset,
190
+ paneClasses,
191
+ offset,
192
+ computeOffset,
193
+ handleMousedown
194
+ }
195
+ }
196
+ })
197
+ </script>
198
+
199
+ <style lang="scss">
200
+ $box-shadow: var(--box-shadow);
201
+ $trigger-bar-background: rgba(23, 35, 61, 0.25);
202
+ $trigger-background: #f8f8f9;
203
+ $trigger-width: 6px;
204
+ $trigger-bar-width: 4px;
205
+ $trigger-bar-offset: calc(($trigger-width - $trigger-bar-width) / 2);
206
+ $trigger-bar-interval: 3px;
207
+ $trigger-bar-weight: 1px;
208
+ $trigger-bar-con-height: calc(($trigger-bar-weight + $trigger-bar-interval) * 8);
209
+
210
+ .sh-split {
211
+ position: relative;
212
+ width: 100%;
213
+ height: 100%;
214
+ .layout-loader {
215
+ position: absolute;
216
+ top: 0;
217
+ left: 0;
218
+ width: 100%;
219
+ height: 100%;
220
+ background: rgba(0, 0, 0, 0.4);
221
+ transition: opacity 0.65s;
222
+ display: flex;
223
+ align-items: center;
224
+ justify-content: center;
225
+ flex-wrap: wrap;
226
+ font-size: 15px;
227
+ color: #fff;
228
+ z-index: 100;
229
+ }
230
+ &-pane {
231
+ position: absolute;
232
+ overflow: auto;
233
+ &.left-pane,
234
+ &.right-pane {
235
+ top: 0;
236
+ bottom: 0;
237
+ }
238
+ &.left-pane {
239
+ left: 0;
240
+ margin-right: $trigger-bar-width;
241
+ }
242
+ &.right-pane {
243
+ right: 0;
244
+ margin-left: $trigger-bar-width;
245
+ }
246
+ &.top-pane,
247
+ &.bottom-pane {
248
+ left: 0;
249
+ right: 0;
250
+ }
251
+ &.top-pane {
252
+ top: 0;
253
+ margin-bottom: $trigger-bar-width;
254
+ }
255
+ &.bottom-pane {
256
+ bottom: 0;
257
+ margin-top: $trigger-bar-width;
258
+ }
259
+ &-moving {
260
+ -webkit-user-select: none;
261
+ -moz-user-select: none;
262
+ -ms-user-select: none;
263
+ user-select: none;
264
+ }
265
+ }
266
+ &-trigger {
267
+ border: 1px solid var(--vxe-border-radius);
268
+ &-con {
269
+ position: absolute;
270
+ transform: translate(-50%, -50%);
271
+ z-index: 10;
272
+ }
273
+ &-bar-con {
274
+ position: absolute;
275
+ overflow: hidden;
276
+ &.vertical {
277
+ left: $trigger-bar-offset;
278
+ top: 50%;
279
+ height: $trigger-bar-con-height;
280
+ transform: translate(0, -50%);
281
+ }
282
+ &.horizontal {
283
+ left: 50%;
284
+ top: $trigger-bar-offset;
285
+ width: $trigger-bar-con-height;
286
+ transform: translate(-50%, 0);
287
+ }
288
+ }
289
+ &-vertical {
290
+ width: $trigger-width;
291
+ height: 100%;
292
+ background: $trigger-background;
293
+ border-top: none;
294
+ border-bottom: none;
295
+ cursor: col-resize;
296
+ .sh-split-trigger-bar {
297
+ width: $trigger-bar-width;
298
+ height: 1px;
299
+ background: $trigger-bar-background;
300
+ float: left;
301
+ margin-top: $trigger-bar-interval;
302
+ }
303
+ }
304
+ &-horizontal {
305
+ height: $trigger-width;
306
+ width: 100%;
307
+ background: $trigger-background;
308
+ border-left: none;
309
+ border-right: none;
310
+ cursor: row-resize;
311
+ .sh-split-trigger-bar {
312
+ height: $trigger-bar-width;
313
+ width: 1px;
314
+ background: $trigger-bar-background;
315
+ float: left;
316
+ margin-right: $trigger-bar-interval;
317
+ }
318
+ }
319
+ }
320
+ &-horizontal {
321
+ > .sh-split-trigger-con {
322
+ top: 50%;
323
+ height: 100%;
324
+ width: $trigger-width;
325
+ }
326
+ }
327
+ &-vertical {
328
+ > .sh-split-trigger-con {
329
+ left: 50%;
330
+ height: $trigger-width;
331
+ width: 100%;
332
+ }
333
+ }
334
+ .no-select {
335
+ -webkit-touch-callout: none;
336
+ -webkit-user-select: none;
337
+ -moz-user-select: none;
338
+ -ms-user-select: none;
339
+ user-select: none;
340
+ }
341
+ }
342
+ </style>