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,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>