sh-view 2.8.1 → 2.8.3
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/.eslintrc.js +25 -20
- package/other.js +8 -8
- package/package.json +9 -6
- package/packages/components/index.js +91 -91
- package/packages/components/sh-alert/alert.ts +30 -0
- package/packages/components/sh-alert/index.vue +143 -168
- package/packages/components/sh-badge/index.vue +242 -242
- package/packages/components/sh-calendar/index.vue +650 -650
- package/packages/components/sh-card/index.vue +148 -148
- package/packages/components/sh-code-editor/index.vue +19 -19
- package/packages/components/sh-col/index.vue +92 -92
- package/packages/components/sh-corner/index.vue +230 -230
- package/packages/components/sh-count-to/index.vue +131 -131
- package/packages/components/sh-date/index.vue +301 -301
- package/packages/components/sh-drawer/index.vue +579 -579
- package/packages/components/sh-drawer/scrollbar.js +78 -78
- package/packages/components/sh-empty/index.vue +42 -42
- package/packages/components/sh-form/js/props.js +76 -76
- package/packages/components/sh-form/js/useForm.js +229 -229
- package/packages/components/sh-header/index.vue +261 -260
- package/packages/components/sh-icon/css/default/ionicons.svg +869 -869
- package/packages/components/sh-icon/css/font/iconfont.json +247 -247
- package/packages/components/sh-icon/index.vue +41 -41
- package/packages/components/sh-image/index.vue +133 -133
- package/packages/components/sh-list/index.vue +146 -146
- package/packages/components/sh-loading/index.vue +53 -53
- package/packages/components/sh-modal/index.vue +188 -188
- package/packages/components/sh-noticebar/index.vue +215 -215
- package/packages/components/sh-poptip/index.vue +597 -597
- package/packages/components/sh-progress/index.vue +276 -276
- package/packages/components/sh-pull-refresh/index.vue +289 -289
- package/packages/components/sh-result/index.vue +114 -114
- package/packages/components/sh-row/index.vue +66 -66
- package/packages/components/sh-split/components/trigger.vue +33 -33
- package/packages/components/sh-split/index.vue +342 -342
- package/packages/components/sh-table/components/importModal.vue +363 -363
- package/packages/components/sh-table/components/sh-column.vue +68 -68
- package/packages/components/sh-table/js/excel_to_json.js +313 -313
- package/packages/components/sh-table/js/props.js +305 -305
- package/packages/components/sh-table/js/tableMethods.js +167 -167
- package/packages/components/sh-table/js/useTable.js +636 -636
- package/packages/components/sh-table/table.vue +217 -217
- package/packages/components/sh-tabs/index.vue +426 -426
- package/packages/components/sh-tag/index.vue +168 -168
- package/packages/components/sh-toolbar/index.vue +182 -182
- package/packages/components/sh-tree/components/table-tree.vue +289 -289
- package/packages/components/sh-tree/mixin/treeProps.js +122 -122
- package/packages/components/sh-upload/index.vue +535 -535
- package/packages/components/sh-water-fall/index.vue +80 -80
- package/packages/components/sh-water-mark/index.vue +96 -96
- package/packages/css/index.js +4 -4
- package/packages/directive/index.js +19 -19
- package/packages/directive/module/click-out.js +14 -14
- package/packages/directive/module/draggable.js +42 -42
- package/packages/directive/module/line-clamp.js +22 -22
- package/packages/directive/module/prevent-click.js +18 -18
- package/packages/directive/module/resize.js +14 -14
- package/packages/directive/module/ripple.js +166 -166
- package/packages/index.js +39 -39
- package/packages/mixin/index.js +86 -86
- package/packages/other/sh-cron-modal/components/cron-content.vue +294 -294
- package/packages/other/sh-cron-modal/index.vue +81 -81
- package/packages/other/sh-cron-modal/mixin/cron-emits.js +1 -1
- package/packages/other/sh-cron-modal/mixin/cron-props.js +9 -9
- package/packages/other/sh-cron-modal/tabs/cron-week-box.vue +126 -126
- package/packages/other/sh-menu/index.vue +326 -326
- package/packages/other/sh-menu/menu-group-content.vue +136 -136
- package/packages/other/sh-menu/menu-item-content.vue +71 -71
- package/packages/other/sh-menu-card/index.vue +250 -250
- package/packages/other/sh-menu-card/menu-box.vue +87 -87
- package/packages/other/sh-preview/components/sh-excel.vue +163 -163
- package/packages/other/sh-preview/js/data-hook.js +41 -41
- package/packages/other/sh-preview/js/data-props.js +15 -15
- package/packages/other/sh-system-tip/index.vue +115 -115
- package/packages/utils/resize.js +69 -70
- package/packages/utils/transfer-queue.js +12 -12
- package/packages/vxeTable/index.js +193 -184
- package/packages/vxeTable/plugins/export.js +450 -450
- package/packages/vxeTable/render/cell/vxe-render-img.vue +27 -27
- package/packages/vxeTable/render/cell/vxe-render-table.vue +51 -51
- package/packages/vxeTable/render/cell/vxe-render-time.vue +44 -44
- package/packages/vxeTable/render/cell/vxe-render-tree.vue +70 -70
- package/packages/vxeTable/render/filters/vxe-filter-input.vue +26 -26
- package/packages/vxeTable/render/filters/vxe-filter-time.vue +26 -26
- package/packages/vxeTable/render/globalRenders.jsx +514 -514
- package/packages/vxeTable/render/mixin/cell-hooks.js +198 -198
- package/packages/vxeTable/render/mixin/cell-props.js +23 -23
- package/packages/vxeTable/render/mixin/filter-hooks.js +46 -46
- package/tsconfig.json +25 -0
- package/types/component.d.ts +1 -0
- package/types/index.ts +0 -0
|
@@ -1,168 +1,168 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="sh-tag" :class="classes" :style="[borderStyle, backgroundStyle]" @click.stop="check">
|
|
3
|
-
<span v-if="type === 'dot'" class="sh-tag-other"><span class="sh-tag-dot" :style="[backgroundStyle]"></span></span>
|
|
4
|
-
<span class="sh-tag-text" :style="[fontStyle]"><slot></slot></span>
|
|
5
|
-
<a v-if="closable" class="sh-tag-other sh-tag-close" :style="[borderStyle]" @click="close">
|
|
6
|
-
<slot name="close"><sh-icon type="ios-close"></sh-icon></slot>
|
|
7
|
-
</a>
|
|
8
|
-
</div>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script>
|
|
12
|
-
import { defineComponent, computed, getCurrentInstance, ref, watch, onBeforeMount } from 'vue'
|
|
13
|
-
const colorMap = {
|
|
14
|
-
default: 'var(-vxe-table-header-background-color)',
|
|
15
|
-
primary: 'var(--vxe-primary-color)',
|
|
16
|
-
success: 'var(--vxe-success-color)',
|
|
17
|
-
warning: 'var(--vxe-warning-color)',
|
|
18
|
-
error: 'var(--vxe-danger-color)'
|
|
19
|
-
}
|
|
20
|
-
const fontColorMap = {
|
|
21
|
-
default: 'var(--vxe-font-color)'
|
|
22
|
-
}
|
|
23
|
-
const borderColorMap = {
|
|
24
|
-
default: 'null'
|
|
25
|
-
}
|
|
26
|
-
export default defineComponent({
|
|
27
|
-
name: 'ShTag',
|
|
28
|
-
props: {
|
|
29
|
-
closable: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
default: false
|
|
32
|
-
},
|
|
33
|
-
checkable: {
|
|
34
|
-
type: Boolean,
|
|
35
|
-
default: false
|
|
36
|
-
},
|
|
37
|
-
checked: {
|
|
38
|
-
type: Boolean,
|
|
39
|
-
default: false
|
|
40
|
-
},
|
|
41
|
-
color: {
|
|
42
|
-
type: String
|
|
43
|
-
},
|
|
44
|
-
type: {
|
|
45
|
-
type: String,
|
|
46
|
-
default: '' // 'border', 'dot'
|
|
47
|
-
},
|
|
48
|
-
name: {
|
|
49
|
-
type: [String, Number]
|
|
50
|
-
},
|
|
51
|
-
size: {
|
|
52
|
-
type: String,
|
|
53
|
-
default: 'default' // medium / small / mini
|
|
54
|
-
},
|
|
55
|
-
opacity: {
|
|
56
|
-
type: Number,
|
|
57
|
-
default: 75
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
emits: ['change', 'close'],
|
|
61
|
-
setup(props, context) {
|
|
62
|
-
const { proxy } = getCurrentInstance()
|
|
63
|
-
const { $vUtils } = proxy
|
|
64
|
-
const { emit, slots } = context
|
|
65
|
-
|
|
66
|
-
const isChecked = ref(props.checked)
|
|
67
|
-
const colorIn = computed(() => props.color || 'default')
|
|
68
|
-
const colorRgb = computed(() => colorMap[colorIn.value] || $vUtils.lighten(colorIn.value))
|
|
69
|
-
const isCustom = computed(() => !!colorMap[colorIn.value])
|
|
70
|
-
const fontStyle = computed(() => {
|
|
71
|
-
return { color: isCustom.value && !props.type ? fontColorMap[colorIn.value] || '#fff' : colorRgb.value }
|
|
72
|
-
})
|
|
73
|
-
const borderStyle = computed(() => {
|
|
74
|
-
return { borderWidth: '1px', borderStyle: 'solid', borderColor: borderColorMap[colorIn.value] || colorRgb.value }
|
|
75
|
-
})
|
|
76
|
-
const backgroundStyle = computed(() => {
|
|
77
|
-
if (isCustom.value) return { backgroundColor: colorRgb.value, color: '#fff' }
|
|
78
|
-
return { backgroundColor: $vUtils.lighten(colorIn.value, props.opacity) }
|
|
79
|
-
})
|
|
80
|
-
const classes = computed(() => {
|
|
81
|
-
return {
|
|
82
|
-
[`${props.size}`]: !!props.size,
|
|
83
|
-
[`${props.type}`]: !!props.type,
|
|
84
|
-
[`closable`]: props.closable,
|
|
85
|
-
[`checked`]: isChecked.value,
|
|
86
|
-
[`checkable`]: props.checkable
|
|
87
|
-
}
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
const close = event => {
|
|
91
|
-
emit('close', event, props.name)
|
|
92
|
-
}
|
|
93
|
-
const check = () => {
|
|
94
|
-
if (!props.checkable) return
|
|
95
|
-
isChecked.value = !isChecked.value
|
|
96
|
-
emit('change', isChecked.value, props.name)
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
watch(
|
|
100
|
-
() => props.checked,
|
|
101
|
-
value => {
|
|
102
|
-
isChecked.value = val
|
|
103
|
-
}
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
return {
|
|
107
|
-
classes,
|
|
108
|
-
borderStyle,
|
|
109
|
-
backgroundStyle,
|
|
110
|
-
fontStyle,
|
|
111
|
-
check,
|
|
112
|
-
close
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
})
|
|
116
|
-
</script>
|
|
117
|
-
|
|
118
|
-
<style scoped lang="scss">
|
|
119
|
-
$default-color: #f7f7f7;
|
|
120
|
-
.sh-tag {
|
|
121
|
-
display: inline-flex;
|
|
122
|
-
align-items: stretch;
|
|
123
|
-
margin: 2px 4px 2px 0;
|
|
124
|
-
border: 1px solid var(--vxe-table-border-color);
|
|
125
|
-
border-radius: var(--vxe-border-radius);
|
|
126
|
-
background-color: $default-color;
|
|
127
|
-
vertical-align: top;
|
|
128
|
-
overflow: hidden;
|
|
129
|
-
&.border,
|
|
130
|
-
&.dot {
|
|
131
|
-
background-color: transparent !important;
|
|
132
|
-
color: var(--vxe-font-color) !important;
|
|
133
|
-
}
|
|
134
|
-
&.dot {
|
|
135
|
-
border-color: var(--vxe-table-border-color) !important;
|
|
136
|
-
color: var(--vxe-font-color) !important;
|
|
137
|
-
.sh-tag-text {
|
|
138
|
-
color: inherit !important;
|
|
139
|
-
line-height: 30px;
|
|
140
|
-
}
|
|
141
|
-
.sh-tag-close {
|
|
142
|
-
border: none !important;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
&-other {
|
|
146
|
-
display: inline-flex;
|
|
147
|
-
align-items: center;
|
|
148
|
-
}
|
|
149
|
-
&-dot {
|
|
150
|
-
display: inline-block;
|
|
151
|
-
width: 12px;
|
|
152
|
-
height: 12px;
|
|
153
|
-
border-radius: 50%;
|
|
154
|
-
background-color: #ccc;
|
|
155
|
-
margin: 0 2px 0 8px;
|
|
156
|
-
}
|
|
157
|
-
&-text {
|
|
158
|
-
padding: 0 8px;
|
|
159
|
-
flex: 1;
|
|
160
|
-
}
|
|
161
|
-
&-close {
|
|
162
|
-
padding: 0 3px;
|
|
163
|
-
border-top: none !important;
|
|
164
|
-
border-right: none !important;
|
|
165
|
-
border-bottom: none !important;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sh-tag" :class="classes" :style="[borderStyle, backgroundStyle]" @click.stop="check">
|
|
3
|
+
<span v-if="type === 'dot'" class="sh-tag-other"><span class="sh-tag-dot" :style="[backgroundStyle]"></span></span>
|
|
4
|
+
<span class="sh-tag-text" :style="[fontStyle]"><slot></slot></span>
|
|
5
|
+
<a v-if="closable" class="sh-tag-other sh-tag-close" :style="[borderStyle]" @click="close">
|
|
6
|
+
<slot name="close"><sh-icon type="ios-close"></sh-icon></slot>
|
|
7
|
+
</a>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
import { defineComponent, computed, getCurrentInstance, ref, watch, onBeforeMount } from 'vue'
|
|
13
|
+
const colorMap = {
|
|
14
|
+
default: 'var(-vxe-table-header-background-color)',
|
|
15
|
+
primary: 'var(--vxe-primary-color)',
|
|
16
|
+
success: 'var(--vxe-success-color)',
|
|
17
|
+
warning: 'var(--vxe-warning-color)',
|
|
18
|
+
error: 'var(--vxe-danger-color)'
|
|
19
|
+
}
|
|
20
|
+
const fontColorMap = {
|
|
21
|
+
default: 'var(--vxe-font-color)'
|
|
22
|
+
}
|
|
23
|
+
const borderColorMap = {
|
|
24
|
+
default: 'null'
|
|
25
|
+
}
|
|
26
|
+
export default defineComponent({
|
|
27
|
+
name: 'ShTag',
|
|
28
|
+
props: {
|
|
29
|
+
closable: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false
|
|
32
|
+
},
|
|
33
|
+
checkable: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false
|
|
36
|
+
},
|
|
37
|
+
checked: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false
|
|
40
|
+
},
|
|
41
|
+
color: {
|
|
42
|
+
type: String
|
|
43
|
+
},
|
|
44
|
+
type: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: '' // 'border', 'dot'
|
|
47
|
+
},
|
|
48
|
+
name: {
|
|
49
|
+
type: [String, Number]
|
|
50
|
+
},
|
|
51
|
+
size: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: 'default' // medium / small / mini
|
|
54
|
+
},
|
|
55
|
+
opacity: {
|
|
56
|
+
type: Number,
|
|
57
|
+
default: 75
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
emits: ['change', 'close'],
|
|
61
|
+
setup(props, context) {
|
|
62
|
+
const { proxy } = getCurrentInstance()
|
|
63
|
+
const { $vUtils } = proxy
|
|
64
|
+
const { emit, slots } = context
|
|
65
|
+
|
|
66
|
+
const isChecked = ref(props.checked)
|
|
67
|
+
const colorIn = computed(() => props.color || 'default')
|
|
68
|
+
const colorRgb = computed(() => colorMap[colorIn.value] || $vUtils.lighten(colorIn.value))
|
|
69
|
+
const isCustom = computed(() => !!colorMap[colorIn.value])
|
|
70
|
+
const fontStyle = computed(() => {
|
|
71
|
+
return { color: isCustom.value && !props.type ? fontColorMap[colorIn.value] || '#fff' : colorRgb.value }
|
|
72
|
+
})
|
|
73
|
+
const borderStyle = computed(() => {
|
|
74
|
+
return { borderWidth: '1px', borderStyle: 'solid', borderColor: borderColorMap[colorIn.value] || colorRgb.value }
|
|
75
|
+
})
|
|
76
|
+
const backgroundStyle = computed(() => {
|
|
77
|
+
if (isCustom.value) return { backgroundColor: colorRgb.value, color: '#fff' }
|
|
78
|
+
return { backgroundColor: $vUtils.lighten(colorIn.value, props.opacity) }
|
|
79
|
+
})
|
|
80
|
+
const classes = computed(() => {
|
|
81
|
+
return {
|
|
82
|
+
[`${props.size}`]: !!props.size,
|
|
83
|
+
[`${props.type}`]: !!props.type,
|
|
84
|
+
[`closable`]: props.closable,
|
|
85
|
+
[`checked`]: isChecked.value,
|
|
86
|
+
[`checkable`]: props.checkable
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
const close = event => {
|
|
91
|
+
emit('close', event, props.name)
|
|
92
|
+
}
|
|
93
|
+
const check = () => {
|
|
94
|
+
if (!props.checkable) return
|
|
95
|
+
isChecked.value = !isChecked.value
|
|
96
|
+
emit('change', isChecked.value, props.name)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
watch(
|
|
100
|
+
() => props.checked,
|
|
101
|
+
value => {
|
|
102
|
+
isChecked.value = val
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
classes,
|
|
108
|
+
borderStyle,
|
|
109
|
+
backgroundStyle,
|
|
110
|
+
fontStyle,
|
|
111
|
+
check,
|
|
112
|
+
close
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
})
|
|
116
|
+
</script>
|
|
117
|
+
|
|
118
|
+
<style scoped lang="scss">
|
|
119
|
+
$default-color: #f7f7f7;
|
|
120
|
+
.sh-tag {
|
|
121
|
+
display: inline-flex;
|
|
122
|
+
align-items: stretch;
|
|
123
|
+
margin: 2px 4px 2px 0;
|
|
124
|
+
border: 1px solid var(--vxe-table-border-color);
|
|
125
|
+
border-radius: var(--vxe-border-radius);
|
|
126
|
+
background-color: $default-color;
|
|
127
|
+
vertical-align: top;
|
|
128
|
+
overflow: hidden;
|
|
129
|
+
&.border,
|
|
130
|
+
&.dot {
|
|
131
|
+
background-color: transparent !important;
|
|
132
|
+
color: var(--vxe-font-color) !important;
|
|
133
|
+
}
|
|
134
|
+
&.dot {
|
|
135
|
+
border-color: var(--vxe-table-border-color) !important;
|
|
136
|
+
color: var(--vxe-font-color) !important;
|
|
137
|
+
.sh-tag-text {
|
|
138
|
+
color: inherit !important;
|
|
139
|
+
line-height: 30px;
|
|
140
|
+
}
|
|
141
|
+
.sh-tag-close {
|
|
142
|
+
border: none !important;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
&-other {
|
|
146
|
+
display: inline-flex;
|
|
147
|
+
align-items: center;
|
|
148
|
+
}
|
|
149
|
+
&-dot {
|
|
150
|
+
display: inline-block;
|
|
151
|
+
width: 12px;
|
|
152
|
+
height: 12px;
|
|
153
|
+
border-radius: 50%;
|
|
154
|
+
background-color: #ccc;
|
|
155
|
+
margin: 0 2px 0 8px;
|
|
156
|
+
}
|
|
157
|
+
&-text {
|
|
158
|
+
padding: 0 8px;
|
|
159
|
+
flex: 1;
|
|
160
|
+
}
|
|
161
|
+
&-close {
|
|
162
|
+
padding: 0 3px;
|
|
163
|
+
border-top: none !important;
|
|
164
|
+
border-right: none !important;
|
|
165
|
+
border-bottom: none !important;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
</style>
|