its_ui_vite 1.2.2 → 1.2.4
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
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="svg" :style="`--svg-
|
|
2
|
+
<div class="svg" :style="`--svg-width: ${iconWidth}px; --svg-height: ${iconHeight}px;`" v-html="iconHTML">
|
|
3
3
|
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
@@ -11,6 +11,8 @@ import { TIcon, iconContent } from '../../assets/icon/icons-manifest';
|
|
|
11
11
|
const prop = withDefaults(defineProps<{
|
|
12
12
|
name: TIcon,
|
|
13
13
|
size?: number,
|
|
14
|
+
width?: number,
|
|
15
|
+
height?: number,
|
|
14
16
|
}>(), {
|
|
15
17
|
size: 24
|
|
16
18
|
})
|
|
@@ -20,15 +22,23 @@ const iconHTML = computed(() => {
|
|
|
20
22
|
return iconContent[iconName] || '<span>ico</span>'
|
|
21
23
|
});
|
|
22
24
|
|
|
25
|
+
const iconWidth = computed(() => {
|
|
26
|
+
return prop.width || prop.size
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const iconHeight = computed(() => {
|
|
30
|
+
return prop.height || prop.size
|
|
31
|
+
});
|
|
32
|
+
|
|
23
33
|
</script>
|
|
24
34
|
<style lang="scss" scoped>
|
|
25
35
|
.svg {
|
|
26
|
-
width: var(--svg-
|
|
27
|
-
height: var(--svg-
|
|
36
|
+
width: var(--svg-width, 20px);
|
|
37
|
+
height: var(--svg-height, 20px);
|
|
28
38
|
}
|
|
29
39
|
|
|
30
40
|
.svg:deep(svg) {
|
|
31
|
-
width: var(--svg-
|
|
32
|
-
height: var(--svg-
|
|
41
|
+
width: var(--svg-width, 20px);
|
|
42
|
+
height: var(--svg-height, 20px);
|
|
33
43
|
}
|
|
34
44
|
</style>
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
</template>
|
|
31
31
|
|
|
32
32
|
<script lang="ts" setup>
|
|
33
|
-
import { CClasses } from '../assets/js/helpers'
|
|
34
|
-
import { ref, onMounted, onUnmounted, computed } from 'vue';
|
|
33
|
+
import { CClasses } from '../assets/js/helpers'
|
|
34
|
+
import { ref, nextTick, onMounted, onUnmounted, computed } from 'vue';
|
|
35
35
|
|
|
36
36
|
type TProps = {
|
|
37
37
|
scrollY?: number,
|
|
@@ -54,30 +54,31 @@ const root = ref<null | HTMLDivElement>(null);
|
|
|
54
54
|
const content = ref<null | HTMLDivElement>(null);
|
|
55
55
|
const scrollRail = ref<null | HTMLDivElement>(null);
|
|
56
56
|
|
|
57
|
-
let
|
|
57
|
+
let resizeObserver: ResizeObserver;
|
|
58
|
+
let mutationObserver: MutationObserver;
|
|
58
59
|
let lockThumbDrag = ref<boolean>(true);
|
|
59
60
|
let isShow = ref<boolean>(false);
|
|
60
61
|
let mousePosition: number = 0;
|
|
61
62
|
|
|
62
63
|
onMounted(() => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}, 40);
|
|
64
|
+
if (!root.value || !content.value) return;
|
|
65
|
+
|
|
66
|
+
document.body.addEventListener('mousemove', handleDrag);
|
|
67
|
+
document.body.addEventListener('mouseup', removeDragThumb);
|
|
68
|
+
|
|
69
|
+
resizeObserver = new ResizeObserver(handleContent);
|
|
70
|
+
resizeObserver.observe(root.value);
|
|
71
|
+
|
|
72
|
+
mutationObserver = new MutationObserver(handleContent);
|
|
73
|
+
mutationObserver.observe(content.value, {
|
|
74
|
+
childList: true,
|
|
75
|
+
subtree: true,
|
|
76
|
+
});
|
|
77
77
|
});
|
|
78
78
|
|
|
79
79
|
onUnmounted(() => {
|
|
80
|
-
|
|
80
|
+
resizeObserver?.disconnect();
|
|
81
|
+
mutationObserver?.disconnect();
|
|
81
82
|
|
|
82
83
|
document.body.removeEventListener('mousemove', handleDrag);
|
|
83
84
|
document.body.removeEventListener('mouseup', removeDragThumb);
|
|
@@ -109,11 +110,12 @@ function handleContent() {
|
|
|
109
110
|
isShow.value = rootHeight < contentHeight;
|
|
110
111
|
if (!isShow.value) return;
|
|
111
112
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
nextTick(() => {
|
|
114
|
+
const scrollRailHeight = scrollRail.value?.offsetHeight || 1;
|
|
115
|
+
scrollStyle.value.thumbHeight = scrollRailHeight / (contentHeight / rootHeight);
|
|
116
|
+
scrollStyle.value.content = 0;
|
|
117
|
+
scrollStyle.value.thumb = 0;
|
|
118
|
+
});
|
|
117
119
|
}
|
|
118
120
|
|
|
119
121
|
function handleDrag(evt: MouseEvent) {
|
|
@@ -651,7 +651,17 @@ defineExpose({
|
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
653
|
|
|
654
|
+
.c-select__inp_icon {
|
|
655
|
+
display: flex;
|
|
656
|
+
align-items: center;
|
|
657
|
+
justify-content: center;
|
|
658
|
+
}
|
|
659
|
+
|
|
654
660
|
.c-input__custom-icon {
|
|
661
|
+
display: flex;
|
|
662
|
+
align-items: center;
|
|
663
|
+
justify-content: center;
|
|
664
|
+
|
|
655
665
|
cursor: pointer;
|
|
656
666
|
|
|
657
667
|
opacity: 1;
|
package/src/pages/index.vue
CHANGED
|
@@ -1981,8 +1981,8 @@ body {
|
|
|
1981
1981
|
|
|
1982
1982
|
.table-icon {
|
|
1983
1983
|
display: grid;
|
|
1984
|
-
grid-template-rows: repeat(
|
|
1985
|
-
grid-template-columns: repeat(
|
|
1984
|
+
grid-template-rows: repeat(5, 70px);
|
|
1985
|
+
grid-template-columns: repeat(24, 70px);
|
|
1986
1986
|
}
|
|
1987
1987
|
|
|
1988
1988
|
.scroll-item {
|
|
@@ -17,6 +17,14 @@ const manyOptions = [
|
|
|
17
17
|
{ value: 6, text: 'Option 6' },
|
|
18
18
|
{ value: 7, text: 'Option 7' },
|
|
19
19
|
{ value: 8, text: 'Option 8' },
|
|
20
|
+
{ value: 9, text: 'Option 9' },
|
|
21
|
+
{ value: 10, text: 'Option 10' },
|
|
22
|
+
{ value: 11, text: 'Option 11' },
|
|
23
|
+
{ value: 12, text: 'Option 12' },
|
|
24
|
+
{ value: 13, text: 'Option 13' },
|
|
25
|
+
{ value: 14, text: 'Option 14' },
|
|
26
|
+
{ value: 15, text: 'Option 15' },
|
|
27
|
+
{ value: 16, text: 'Option 16' },
|
|
20
28
|
];
|
|
21
29
|
|
|
22
30
|
export default {
|