@redseed/redseed-ui-vue3 2.23.0 → 2.23.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
CHANGED
|
@@ -1,36 +1,63 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { computed } from 'vue'
|
|
2
3
|
import LinkedListItem from './LinkedListItem.vue'
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
default: () =>[],
|
|
8
|
-
}
|
|
9
|
-
});
|
|
5
|
+
defineOptions({
|
|
6
|
+
inheritAttrs: false,
|
|
7
|
+
})
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
items: {
|
|
11
|
+
type: Array,
|
|
12
|
+
default: () =>[],
|
|
13
|
+
},
|
|
14
|
+
active: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: false,
|
|
17
|
+
},
|
|
18
|
+
done: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false,
|
|
21
|
+
},
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const componentClass = computed(() => [
|
|
25
|
+
'rsui-linked-list',
|
|
26
|
+
{
|
|
27
|
+
'rsui-linked-list--active': props.active,
|
|
28
|
+
'rsui-linked-list--done': props.done,
|
|
29
|
+
}
|
|
30
|
+
])
|
|
14
31
|
</script>
|
|
15
32
|
|
|
16
33
|
<template>
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
34
|
+
<ul :class="componentClass" v-bind="$attrs">
|
|
35
|
+
<slot>
|
|
36
|
+
<LinkedListItem
|
|
37
|
+
v-for="item in props.items"
|
|
38
|
+
:key="item"
|
|
39
|
+
:active="!!item.active || props.active"
|
|
40
|
+
:done="!!item.done || props.done"
|
|
41
|
+
>
|
|
42
|
+
<template #title>
|
|
43
|
+
{{ item.title }}
|
|
44
|
+
</template>
|
|
45
|
+
<template #body v-if="item.body">
|
|
46
|
+
{{ item.body }}
|
|
47
|
+
</template>
|
|
48
|
+
</LinkedListItem>
|
|
49
|
+
</slot>
|
|
50
|
+
</ul>
|
|
23
51
|
</template>
|
|
24
52
|
|
|
25
53
|
<style lang="scss" scoped>
|
|
26
54
|
.rsui-linked-list {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
55
|
+
@apply list-none p-0 m-0;
|
|
56
|
+
|
|
57
|
+
&--active {
|
|
58
|
+
:deep(.rsui-linked-list-item--active) {
|
|
59
|
+
@apply before:bg-current;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
30
62
|
}
|
|
31
63
|
</style>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
@@ -1,55 +1,114 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed } from 'vue'
|
|
2
|
+
import { ref, computed, watch, useAttrs } from 'vue'
|
|
3
|
+
import { CheckIcon } from '@heroicons/vue/24/outline'
|
|
4
|
+
|
|
5
|
+
defineOptions({
|
|
6
|
+
inheritAttrs: false,
|
|
7
|
+
})
|
|
3
8
|
|
|
4
9
|
const props = defineProps({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
const
|
|
10
|
+
active: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: false,
|
|
13
|
+
},
|
|
14
|
+
done: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: false,
|
|
17
|
+
},
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
const isActive = ref(props.active)
|
|
21
|
+
watch(() => props.active, () => { isActive.value = props.active })
|
|
22
|
+
|
|
23
|
+
const isDone = ref(props.done)
|
|
24
|
+
watch(() => props.done, () => { isDone.value = props.done })
|
|
25
|
+
|
|
26
|
+
const componentClass = computed(() => [
|
|
27
|
+
'rsui-linked-list-item',
|
|
28
|
+
isActive.value || isDone.value ? useAttrs().class : '',
|
|
29
|
+
{
|
|
30
|
+
'rsui-linked-list-item--active': isActive.value,
|
|
31
|
+
'rsui-linked-list-item--done': isDone.value,
|
|
32
|
+
},
|
|
33
|
+
])
|
|
34
|
+
|
|
35
|
+
const statusClass = computed(() => [
|
|
36
|
+
'rsui-linked-list-item__status',
|
|
37
|
+
{
|
|
38
|
+
'rsui-linked-list-item__status--active': isActive.value,
|
|
39
|
+
'rsui-linked-list-item__status--done': isDone.value,
|
|
40
|
+
}
|
|
41
|
+
])
|
|
16
42
|
</script>
|
|
17
43
|
|
|
18
44
|
<template>
|
|
19
|
-
|
|
20
|
-
<div
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
45
|
+
<li :class="componentClass">
|
|
46
|
+
<div :class="statusClass">
|
|
47
|
+
<div class="rsui-linked-list-item__active-icon"
|
|
48
|
+
v-if="$slots['active-icon']"
|
|
49
|
+
>
|
|
50
|
+
<slot name="active-icon" v-if="isActive" />
|
|
51
|
+
</div>
|
|
52
|
+
<div class="rsui-linked-list-item__done-icon"
|
|
53
|
+
>
|
|
54
|
+
<slot name="done-icon" v-if="isDone">
|
|
55
|
+
<CheckIcon />
|
|
56
|
+
</slot>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
<div class="rsui-linked-list-item__title">
|
|
24
60
|
<slot name="title"></slot>
|
|
25
|
-
|
|
26
|
-
|
|
61
|
+
</div>
|
|
62
|
+
<div class="rsui-linked-list-item__body" v-if="$slots.body">
|
|
27
63
|
<slot name="body"></slot>
|
|
28
|
-
</div>
|
|
29
64
|
</div>
|
|
30
|
-
|
|
65
|
+
</li>
|
|
31
66
|
</template>
|
|
32
67
|
|
|
33
68
|
<style lang="scss" scoped>
|
|
34
69
|
.rsui-linked-list-item {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
@apply
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
70
|
+
@apply pl-9 pr-3 pt-0 pb-2 relative text-rsui-light;
|
|
71
|
+
|
|
72
|
+
/** Line style */
|
|
73
|
+
@apply before:absolute before:content-[''] before:top-1.5 before:left-[17px] before:h-full;
|
|
74
|
+
@apply last:before:hidden before:transition;
|
|
75
|
+
@apply before:inline-block before:w-0.5 before:bg-current;
|
|
76
|
+
|
|
77
|
+
&--active {
|
|
78
|
+
@apply text-primary before:bg-rsui-light;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&--done {
|
|
82
|
+
@apply text-primary;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&__status {
|
|
86
|
+
@apply absolute top-1.5 left-3 size-3 border border-current bg-current rounded-full;
|
|
87
|
+
@apply flex items-center justify-center transition;
|
|
88
|
+
|
|
89
|
+
&--active {
|
|
90
|
+
@apply bg-white;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&__active-icon {
|
|
95
|
+
:deep(svg), svg {
|
|
96
|
+
@apply size-2 text-current;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&__done-icon {
|
|
101
|
+
:deep(svg), svg {
|
|
102
|
+
@apply size-2 text-white;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&__title {
|
|
107
|
+
@apply font-semibold text-base text-rsui-default leading-normal;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&__body {
|
|
111
|
+
@apply font-normal text-sm text-rsui-medium leading-normal;
|
|
112
|
+
}
|
|
54
113
|
}
|
|
55
114
|
</style>
|