sh-view 2.4.0 → 2.4.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.
- package/package.json +1 -1
- package/packages/components/global-components/sh-table/components/sh-column.vue +1 -1
- package/packages/components/global-components/sh-table/table.vue +3 -3
- package/packages/components/other-components/sh-menu/index.vue +3 -3
- package/packages/components/other-components/sh-menu/menu-group-content.vue +3 -4
- package/packages/components/other-components/sh-menu/menu-item-content.vue +1 -1
- package/packages/components/other-components/sh-menu-card/index.vue +3 -3
- package/packages/directive/module/resize.js +4 -3
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@ export default defineComponent({
|
|
|
18
18
|
})
|
|
19
19
|
const columnConfig = computed(() => {
|
|
20
20
|
let renderObj = { name: props.column.renderName, props: props.column.renderProps }
|
|
21
|
-
let config = Object.assign({}, shTable.columnObjConfig
|
|
21
|
+
let config = Object.assign({}, shTable.columnObjConfig, props.column)
|
|
22
22
|
if (props.column.readonly) {
|
|
23
23
|
config.cellRender = config.cellRender || renderObj
|
|
24
24
|
} else {
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
</template>
|
|
155
155
|
|
|
156
156
|
<script>
|
|
157
|
-
import { computed, defineComponent, getCurrentInstance, provide, ref } from 'vue'
|
|
157
|
+
import { computed, defineComponent, getCurrentInstance, provide, ref, reactive } from 'vue'
|
|
158
158
|
import './css/index.scss'
|
|
159
159
|
|
|
160
160
|
import props from './js/props'
|
|
@@ -224,11 +224,11 @@ export default defineComponent({
|
|
|
224
224
|
const isPagerSlot = computed(() => useTableHooks.tablePagerConfig.value.enabled)
|
|
225
225
|
const isBottomSlot = computed(() => Boolean(slots.bottom))
|
|
226
226
|
|
|
227
|
-
provide('ShTableInstance', {
|
|
227
|
+
provide('ShTableInstance', reactive({
|
|
228
228
|
columnObjConfig: useTableHooks.tableColumnObjConfig,
|
|
229
229
|
turnColumnItemFilters: useTableHooks.turnColumnItemFilters,
|
|
230
230
|
slots: useTableHooks.slots
|
|
231
|
-
})
|
|
231
|
+
}))
|
|
232
232
|
|
|
233
233
|
const handleResize = e => {
|
|
234
234
|
if (useTableHooks.wrapHeight.value === 'auto') return
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<script>
|
|
12
|
-
import { defineComponent, computed, provide, ref, getCurrentInstance, watch, onMounted } from 'vue'
|
|
12
|
+
import { defineComponent, computed, provide, ref, reactive, getCurrentInstance, watch, onMounted } from 'vue'
|
|
13
13
|
import menuGroupContent from './menu-group-content.vue'
|
|
14
14
|
export default defineComponent({
|
|
15
15
|
name: 'ShMenu',
|
|
@@ -113,14 +113,14 @@ export default defineComponent({
|
|
|
113
113
|
openedNames.value = []
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
provide('MenuInstance', {
|
|
116
|
+
provide('MenuInstance', reactive({
|
|
117
117
|
...props,
|
|
118
118
|
activeName,
|
|
119
119
|
activeNames,
|
|
120
120
|
openedNames,
|
|
121
121
|
onMenuSelect,
|
|
122
122
|
onMenuExpand
|
|
123
|
-
})
|
|
123
|
+
}))
|
|
124
124
|
|
|
125
125
|
watch(
|
|
126
126
|
() => props.modelValue,
|
|
@@ -49,7 +49,7 @@ export default defineComponent({
|
|
|
49
49
|
const groupClass = computed(() => {
|
|
50
50
|
return {
|
|
51
51
|
is__level: !props.menuLevel,
|
|
52
|
-
is__active: MenuInstance.activeNames.
|
|
52
|
+
is__active: MenuInstance.activeNames.includes(props.menuItem.name),
|
|
53
53
|
is__expand: expand.value
|
|
54
54
|
}
|
|
55
55
|
})
|
|
@@ -63,8 +63,7 @@ export default defineComponent({
|
|
|
63
63
|
|
|
64
64
|
const setMenuExpand = () => {
|
|
65
65
|
const { mode, collapsed, openedNames } = MenuInstance
|
|
66
|
-
|
|
67
|
-
expand.value = names.includes(props.menuItem.name)
|
|
66
|
+
expand.value = openedNames.includes(props.menuItem.name)
|
|
68
67
|
if (expand.value && groupItemRef.value && ((mode === 'vertical' && collapsed) || mode === 'horizontal')) {
|
|
69
68
|
nextTick(() => {
|
|
70
69
|
const { offsetHeight, offsetWidth, itemRef } = groupItemRef.value
|
|
@@ -105,7 +104,7 @@ export default defineComponent({
|
|
|
105
104
|
}
|
|
106
105
|
|
|
107
106
|
watch(
|
|
108
|
-
() => MenuInstance.openedNames
|
|
107
|
+
() => MenuInstance.openedNames,
|
|
109
108
|
() => {
|
|
110
109
|
setMenuExpand()
|
|
111
110
|
}
|
|
@@ -41,7 +41,7 @@ export default defineComponent({
|
|
|
41
41
|
const itemClass = computed(() => {
|
|
42
42
|
return {
|
|
43
43
|
'sh-menu-item-level': !props.menuLevel,
|
|
44
|
-
'sh-menu-item-active': MenuInstance.activeName
|
|
44
|
+
'sh-menu-item-active': MenuInstance.activeName === props.menuItem.name
|
|
45
45
|
}
|
|
46
46
|
})
|
|
47
47
|
const itemStyle = computed(() => {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
</template>
|
|
43
43
|
|
|
44
44
|
<script>
|
|
45
|
-
import { defineComponent, computed, provide, getCurrentInstance, ref, onMounted } from 'vue'
|
|
45
|
+
import { defineComponent, computed, provide, getCurrentInstance, ref, reactive, onMounted } from 'vue'
|
|
46
46
|
import menuBox from './menu-box.vue'
|
|
47
47
|
export default defineComponent({
|
|
48
48
|
name: 'MenuCard',
|
|
@@ -169,10 +169,10 @@ export default defineComponent({
|
|
|
169
169
|
emit('select', menu)
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
provide('MenuCardInstance', {
|
|
172
|
+
provide('MenuCardInstance', reactive({
|
|
173
173
|
...props,
|
|
174
174
|
onMenuSelect
|
|
175
|
-
})
|
|
175
|
+
}))
|
|
176
176
|
|
|
177
177
|
return {
|
|
178
178
|
cardActive,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import ResizeObserver from 'resize-observer-polyfill'
|
|
2
|
-
import { utils } from 'sh-tools'
|
|
3
|
-
const throttleTime = 200
|
|
2
|
+
// import { utils } from 'sh-tools'
|
|
3
|
+
// const throttleTime = 200
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
beforeMount(el, binding) {
|
|
7
|
-
const _callback = utils.throttle(binding.value, throttleTime)
|
|
7
|
+
// const _callback = utils.throttle(binding.value, throttleTime)
|
|
8
|
+
const _callback = binding.value
|
|
8
9
|
el.__observer__ = new ResizeObserver(_callback)
|
|
9
10
|
el.__observer__.observe(el)
|
|
10
11
|
},
|