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.
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,215 +1,215 @@
1
- <template>
2
- <div v-if="isShow" class="sh-notice-bar" :class="[round && 'sh-notice-bar-round', type]" :style="styles">
3
- <div class="sh-notice-bar-left" :class="[!customLeft && !icon && 'sh-notice-bar-empty']">
4
- <template v-if="customLeft">
5
- <slot name="left"></slot>
6
- </template>
7
- <template v-else-if="icon">
8
- <sh-icon class="sh-notice-icon" :type="icon" size="20" />
9
- </template>
10
- </div>
11
- <div ref="wrapRef" class="sh-notice-bar-content" :class="[multiRows && 'sh-notice-bar-multi-content']">
12
- <div ref="contentRef" :class="[overflow && scrollable && 'sh-notice-bar-content-animate']" :style="animateStyles">
13
- <slot></slot>
14
- </div>
15
- </div>
16
- <div class="sh-notice-bar-right">
17
- <template v-if="customRight">
18
- <slot name="right"></slot>
19
- </template>
20
- <template v-else-if="mode || closable">
21
- <sh-icon class="sh-notice-icon sh-notice-icon-right" :type="rightIcon" size="20" @click.stop="noticebarClose" />
22
- </template>
23
- </div>
24
- </div>
25
- </template>
26
-
27
- <script>
28
- import { defineComponent, computed, onMounted, onUpdated, getCurrentInstance, ref } from 'vue'
29
- export default defineComponent({
30
- name: 'ShNoticebar',
31
- props: {
32
- mode: {
33
- type: String,
34
- default: ''
35
- },
36
- type: {
37
- type: String,
38
- default: 'default' // default/activity/warning
39
- },
40
- color: {
41
- type: String,
42
- default: '#1890ff'
43
- },
44
- time: {
45
- type: Number,
46
- default: 0
47
- },
48
- round: {
49
- type: Boolean,
50
- default: false
51
- },
52
- multiRows: {
53
- type: Boolean,
54
- default: false
55
- },
56
- scrollable: {
57
- type: Boolean,
58
- default: false
59
- },
60
- icon: {
61
- type: String,
62
- default: ''
63
- },
64
- closable: {
65
- type: Boolean,
66
- default: false
67
- },
68
- speed: {
69
- type: Number,
70
- default: 50
71
- }
72
- },
73
- emits: ['close'],
74
- setup(props, context) {
75
- const vm = getCurrentInstance()
76
- const { $vUtils } = vm.proxy
77
- const { emit, slots } = context
78
-
79
- const wrapRef = ref()
80
- const contentRef = ref()
81
- const isShow = ref(true)
82
- const overflow = ref(false)
83
-
84
- const styles = computed(() => {
85
- return {
86
- color: props.color,
87
- backgroundColor: $vUtils.fade(props.color, 30)
88
- }
89
- })
90
- const animateStyles = computed(() => {
91
- return {
92
- animationDuration: props.speed + 's'
93
- }
94
- })
95
- const customLeft = computed(() => {
96
- return Boolean(slots.left)
97
- })
98
- const customRight = computed(() => {
99
- return Boolean(slots.right)
100
- })
101
- const rightIcon = computed(() => {
102
- return props.mode === 'link' ? 'ios-arrow-forward' : 'md-close'
103
- })
104
-
105
- const noticebarHide = time => {
106
- setTimeout(() => {
107
- isShow.value = false
108
- }, time)
109
- }
110
- const noticebarClose = () => {
111
- if (props.mode === 'closable' || props.closable) {
112
- isShow.value = false
113
- }
114
- emit('close')
115
- }
116
- const noticebarCheckOverflow = () => {
117
- if (!props.scrollable) {
118
- return
119
- }
120
- if (!wrapRef.value || !contentRef.value) {
121
- return
122
- }
123
- /**
124
- * 计算 padding-left 对宽度的影响
125
- * 替换 clientWidth 为 getBoundingClientRect
126
- */
127
- const paddingLeft = window.getComputedStyle(contentRef.value, null).getPropertyValue('padding').split(' ')[3] || '0px'
128
- const left = Number(paddingLeft.match(/\d+/g)[0])
129
- overflow.value = contentRef.value.scrollWidth - left > Math.ceil(wrapRef.value.getBoundingClientRect().width)
130
- }
131
-
132
- onMounted(() => {
133
- if (props.time) {
134
- noticebarHide(props.time)
135
- }
136
- noticebarCheckOverflow()
137
- })
138
- onUpdated(() => {
139
- noticebarCheckOverflow()
140
- })
141
-
142
- return {
143
- contentRef,
144
- wrapRef,
145
- isShow,
146
- styles,
147
- customLeft,
148
- overflow,
149
- animateStyles,
150
- customRight,
151
- rightIcon,
152
- noticebarClose
153
- }
154
- }
155
- })
156
- </script>
157
-
158
- <style lang="scss" scoped>
159
- .sh-notice-bar {
160
- display: flex;
161
- background-color: rgba(0, 0, 0, 0.05);
162
- color: inherit;
163
- position: relative;
164
- z-index: 15;
165
- padding: 10px 0 10px 15px;
166
- box-sizing: border-box;
167
- &.sh-notice-bar-round {
168
- border-radius: 6px;
169
- }
170
- .sh-notice-icon {
171
- cursor: pointer;
172
- }
173
- }
174
- .sh-notice-bar-left,
175
- .sh-notice-bar-right {
176
- display: flex;
177
- align-items: center;
178
- }
179
-
180
- .sh-notice-bar-left {
181
- padding-right: 10px;
182
- }
183
- .sh-notice-bar-right {
184
- padding: 0 10px;
185
- }
186
- .sh-notice-bar-empty {
187
- padding-right: 0;
188
- }
189
-
190
- .sh-notice-bar-content {
191
- flex: 1;
192
- margin: auto;
193
- width: auto;
194
- white-space: nowrap;
195
- overflow: hidden;
196
- &.sh-notice-bar-multi-content {
197
- padding: 0;
198
- line-height: 1.5;
199
- white-space: normal;
200
- }
201
- .sh-notice-bar-content-animate {
202
- padding-left: 100%;
203
- display: inline-block;
204
- animation: sh-notice-bar-animation linear 30s infinite both;
205
- }
206
- }
207
- @keyframes sh-notice-bar-animation {
208
- 0% {
209
- transform: translate3d(0, 0, 0);
210
- }
211
- 100% {
212
- transform: translate3d(-100%, 0, 0);
213
- }
214
- }
215
- </style>
1
+ <template>
2
+ <div v-if="isShow" class="sh-notice-bar" :class="[round && 'sh-notice-bar-round', type]" :style="styles">
3
+ <div class="sh-notice-bar-left" :class="[!customLeft && !icon && 'sh-notice-bar-empty']">
4
+ <template v-if="customLeft">
5
+ <slot name="left"></slot>
6
+ </template>
7
+ <template v-else-if="icon">
8
+ <sh-icon class="sh-notice-icon" :type="icon" size="20" />
9
+ </template>
10
+ </div>
11
+ <div ref="wrapRef" class="sh-notice-bar-content" :class="[multiRows && 'sh-notice-bar-multi-content']">
12
+ <div ref="contentRef" :class="[overflow && scrollable && 'sh-notice-bar-content-animate']" :style="animateStyles">
13
+ <slot></slot>
14
+ </div>
15
+ </div>
16
+ <div class="sh-notice-bar-right">
17
+ <template v-if="customRight">
18
+ <slot name="right"></slot>
19
+ </template>
20
+ <template v-else-if="mode || closable">
21
+ <sh-icon class="sh-notice-icon sh-notice-icon-right" :type="rightIcon" size="20" @click.stop="noticebarClose" />
22
+ </template>
23
+ </div>
24
+ </div>
25
+ </template>
26
+
27
+ <script>
28
+ import { defineComponent, computed, onMounted, onUpdated, getCurrentInstance, ref } from 'vue'
29
+ export default defineComponent({
30
+ name: 'ShNoticebar',
31
+ props: {
32
+ mode: {
33
+ type: String,
34
+ default: ''
35
+ },
36
+ type: {
37
+ type: String,
38
+ default: 'default' // default/activity/warning
39
+ },
40
+ color: {
41
+ type: String,
42
+ default: '#1890ff'
43
+ },
44
+ time: {
45
+ type: Number,
46
+ default: 0
47
+ },
48
+ round: {
49
+ type: Boolean,
50
+ default: false
51
+ },
52
+ multiRows: {
53
+ type: Boolean,
54
+ default: false
55
+ },
56
+ scrollable: {
57
+ type: Boolean,
58
+ default: false
59
+ },
60
+ icon: {
61
+ type: String,
62
+ default: ''
63
+ },
64
+ closable: {
65
+ type: Boolean,
66
+ default: false
67
+ },
68
+ speed: {
69
+ type: Number,
70
+ default: 50
71
+ }
72
+ },
73
+ emits: ['close'],
74
+ setup(props, context) {
75
+ const vm = getCurrentInstance()
76
+ const { $vUtils } = vm.proxy
77
+ const { emit, slots } = context
78
+
79
+ const wrapRef = ref()
80
+ const contentRef = ref()
81
+ const isShow = ref(true)
82
+ const overflow = ref(false)
83
+
84
+ const styles = computed(() => {
85
+ return {
86
+ color: props.color,
87
+ backgroundColor: $vUtils.fade(props.color, 30)
88
+ }
89
+ })
90
+ const animateStyles = computed(() => {
91
+ return {
92
+ animationDuration: props.speed + 's'
93
+ }
94
+ })
95
+ const customLeft = computed(() => {
96
+ return Boolean(slots.left)
97
+ })
98
+ const customRight = computed(() => {
99
+ return Boolean(slots.right)
100
+ })
101
+ const rightIcon = computed(() => {
102
+ return props.mode === 'link' ? 'ios-arrow-forward' : 'md-close'
103
+ })
104
+
105
+ const noticebarHide = time => {
106
+ setTimeout(() => {
107
+ isShow.value = false
108
+ }, time)
109
+ }
110
+ const noticebarClose = () => {
111
+ if (props.mode === 'closable' || props.closable) {
112
+ isShow.value = false
113
+ }
114
+ emit('close')
115
+ }
116
+ const noticebarCheckOverflow = () => {
117
+ if (!props.scrollable) {
118
+ return
119
+ }
120
+ if (!wrapRef.value || !contentRef.value) {
121
+ return
122
+ }
123
+ /**
124
+ * 计算 padding-left 对宽度的影响
125
+ * 替换 clientWidth 为 getBoundingClientRect
126
+ */
127
+ const paddingLeft = window.getComputedStyle(contentRef.value, null).getPropertyValue('padding').split(' ')[3] || '0px'
128
+ const left = Number(paddingLeft.match(/\d+/g)[0])
129
+ overflow.value = contentRef.value.scrollWidth - left > Math.ceil(wrapRef.value.getBoundingClientRect().width)
130
+ }
131
+
132
+ onMounted(() => {
133
+ if (props.time) {
134
+ noticebarHide(props.time)
135
+ }
136
+ noticebarCheckOverflow()
137
+ })
138
+ onUpdated(() => {
139
+ noticebarCheckOverflow()
140
+ })
141
+
142
+ return {
143
+ contentRef,
144
+ wrapRef,
145
+ isShow,
146
+ styles,
147
+ customLeft,
148
+ overflow,
149
+ animateStyles,
150
+ customRight,
151
+ rightIcon,
152
+ noticebarClose
153
+ }
154
+ }
155
+ })
156
+ </script>
157
+
158
+ <style lang="scss" scoped>
159
+ .sh-notice-bar {
160
+ display: flex;
161
+ background-color: rgba(0, 0, 0, 0.05);
162
+ color: inherit;
163
+ position: relative;
164
+ z-index: 15;
165
+ padding: 10px 0 10px 15px;
166
+ box-sizing: border-box;
167
+ &.sh-notice-bar-round {
168
+ border-radius: 6px;
169
+ }
170
+ .sh-notice-icon {
171
+ cursor: pointer;
172
+ }
173
+ }
174
+ .sh-notice-bar-left,
175
+ .sh-notice-bar-right {
176
+ display: flex;
177
+ align-items: center;
178
+ }
179
+
180
+ .sh-notice-bar-left {
181
+ padding-right: 10px;
182
+ }
183
+ .sh-notice-bar-right {
184
+ padding: 0 10px;
185
+ }
186
+ .sh-notice-bar-empty {
187
+ padding-right: 0;
188
+ }
189
+
190
+ .sh-notice-bar-content {
191
+ flex: 1;
192
+ margin: auto;
193
+ width: auto;
194
+ white-space: nowrap;
195
+ overflow: hidden;
196
+ &.sh-notice-bar-multi-content {
197
+ padding: 0;
198
+ line-height: 1.5;
199
+ white-space: normal;
200
+ }
201
+ .sh-notice-bar-content-animate {
202
+ padding-left: 100%;
203
+ display: inline-block;
204
+ animation: sh-notice-bar-animation linear 30s infinite both;
205
+ }
206
+ }
207
+ @keyframes sh-notice-bar-animation {
208
+ 0% {
209
+ transform: translate3d(0, 0, 0);
210
+ }
211
+ 100% {
212
+ transform: translate3d(-100%, 0, 0);
213
+ }
214
+ }
215
+ </style>