@globalbrain/sefirot 3.27.1 → 3.28.0
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/lib/components/SControlActionBar.vue +12 -0
- package/lib/components/SControlActionBarButton.vue +29 -0
- package/lib/components/SControlActionBarClose.vue +22 -0
- package/lib/components/SControlActionBarCollapse.vue +38 -0
- package/lib/components/SDescAvatar.vue +5 -1
- package/lib/components/SDescNumber.vue +27 -1
- package/lib/mixins/Control.ts +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useControlSize } from '../composables/Control'
|
|
3
|
+
import SButton from './SButton.vue'
|
|
4
|
+
|
|
5
|
+
defineProps<{
|
|
6
|
+
as?: string
|
|
7
|
+
icon?: any
|
|
8
|
+
}>()
|
|
9
|
+
|
|
10
|
+
defineEmits<{
|
|
11
|
+
(e: 'click'): void
|
|
12
|
+
}>()
|
|
13
|
+
|
|
14
|
+
const size = useControlSize()
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<div class="SControlActionBarButton">
|
|
19
|
+
<SButton
|
|
20
|
+
:tag="as"
|
|
21
|
+
type="text"
|
|
22
|
+
mode="mute"
|
|
23
|
+
:size="size"
|
|
24
|
+
:icon="icon"
|
|
25
|
+
block
|
|
26
|
+
@click="$emit('click')"
|
|
27
|
+
/>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import IconX from '@iconify-icons/ph/x-bold'
|
|
3
|
+
import SControlActionBarButton from './SControlActionBarButton.vue'
|
|
4
|
+
|
|
5
|
+
defineProps<{
|
|
6
|
+
as?: string
|
|
7
|
+
}>()
|
|
8
|
+
|
|
9
|
+
defineEmits<{
|
|
10
|
+
(e: 'click'): void
|
|
11
|
+
}>()
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<div class="SControlActionBarClose">
|
|
16
|
+
<SControlActionBarButton
|
|
17
|
+
:as="as"
|
|
18
|
+
:icon="IconX"
|
|
19
|
+
@click="$emit('click')"
|
|
20
|
+
/>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import IconArrowsInLineVertical from '@iconify-icons/ph/arrows-in-line-vertical-bold'
|
|
3
|
+
import IconArrowsOutLineVertical from '@iconify-icons/ph/arrows-out-line-vertical-bold'
|
|
4
|
+
import { computed, shallowRef } from 'vue'
|
|
5
|
+
import { useCardState } from '../composables/Card'
|
|
6
|
+
import SControlActionBarButton from './SControlActionBarButton.vue'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<{
|
|
9
|
+
as?: string
|
|
10
|
+
collapsed?: boolean
|
|
11
|
+
}>()
|
|
12
|
+
|
|
13
|
+
defineEmits<{
|
|
14
|
+
(e: 'click'): void
|
|
15
|
+
}>()
|
|
16
|
+
|
|
17
|
+
const { isCollapsed, setCollapse, toggleCollapse } = useCardState()
|
|
18
|
+
|
|
19
|
+
setCollapse(props.collapsed)
|
|
20
|
+
|
|
21
|
+
const el = shallowRef<HTMLElement | null>(null)
|
|
22
|
+
|
|
23
|
+
const icon = computed(() => {
|
|
24
|
+
return isCollapsed.value
|
|
25
|
+
? IconArrowsOutLineVertical
|
|
26
|
+
: IconArrowsInLineVertical
|
|
27
|
+
})
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<div class="SControlActionBarCollapse" ref="el">
|
|
32
|
+
<SControlActionBarButton
|
|
33
|
+
:as="as"
|
|
34
|
+
:icon="icon"
|
|
35
|
+
@click="toggleCollapse"
|
|
36
|
+
/>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
@@ -16,7 +16,6 @@ defineProps<{
|
|
|
16
16
|
<div v-if="avatar" class="SDescAvatar">
|
|
17
17
|
<div class="value">
|
|
18
18
|
<SAvatar
|
|
19
|
-
v-if="avatar.avatar"
|
|
20
19
|
size="nano"
|
|
21
20
|
:avatar="avatar.avatar"
|
|
22
21
|
:name="avatar.name"
|
|
@@ -36,4 +35,9 @@ defineProps<{
|
|
|
36
35
|
gap: 8px;
|
|
37
36
|
height: 24px;
|
|
38
37
|
}
|
|
38
|
+
|
|
39
|
+
.name {
|
|
40
|
+
line-height: 24px;
|
|
41
|
+
font-size: 14px;
|
|
42
|
+
}
|
|
39
43
|
</style>
|
|
@@ -6,6 +6,8 @@ import SDescEmpty from './SDescEmpty.vue'
|
|
|
6
6
|
|
|
7
7
|
const props = defineProps<{
|
|
8
8
|
value?: number | null
|
|
9
|
+
leadUnit?: string
|
|
10
|
+
trailUnit?: string
|
|
9
11
|
separator?: boolean
|
|
10
12
|
}>()
|
|
11
13
|
|
|
@@ -26,21 +28,45 @@ const _value = computed(() => {
|
|
|
26
28
|
|
|
27
29
|
<template>
|
|
28
30
|
<div v-if="_value" class="SDescNumber">
|
|
31
|
+
<div v-if="leadUnit" class="lead-unit">
|
|
32
|
+
{{ leadUnit }}
|
|
33
|
+
</div>
|
|
29
34
|
<div class="value">
|
|
30
35
|
{{ _value }}
|
|
31
36
|
</div>
|
|
37
|
+
<div v-if="trailUnit" class="trail-unit">
|
|
38
|
+
{{ trailUnit }}
|
|
39
|
+
</div>
|
|
32
40
|
</div>
|
|
33
41
|
<SDescEmpty v-else />
|
|
34
42
|
</template>
|
|
35
43
|
|
|
36
44
|
<style scoped lang="postcss">
|
|
37
|
-
.
|
|
45
|
+
.SDescNumber {
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
gap: 4px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.value,
|
|
52
|
+
.lead-unit,
|
|
53
|
+
.trail-unit {
|
|
38
54
|
line-height: 24px;
|
|
39
55
|
font-size: 14px;
|
|
40
56
|
font-weight: 400;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.value {
|
|
60
|
+
flex-grow: 1;
|
|
41
61
|
font-feature-settings: "tnum";
|
|
42
62
|
white-space: nowrap;
|
|
43
63
|
overflow: hidden;
|
|
44
64
|
text-overflow: ellipsis;
|
|
45
65
|
}
|
|
66
|
+
|
|
67
|
+
.lead-unit,
|
|
68
|
+
.trail-unit {
|
|
69
|
+
flex-shrink: 0;
|
|
70
|
+
color: var(--c-text-2);
|
|
71
|
+
}
|
|
46
72
|
</style>
|
package/lib/mixins/Control.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type App } from 'vue'
|
|
2
2
|
import SControl from '../components/SControl.vue'
|
|
3
|
+
import SControlActionBar from '../components/SControlActionBar.vue'
|
|
4
|
+
import SControlActionBarButton from '../components/SControlActionBarButton.vue'
|
|
5
|
+
import SControlActionBarClose from '../components/SControlActionBarClose.vue'
|
|
6
|
+
import SControlActionBarCollapse from '../components/SControlActionBarCollapse.vue'
|
|
3
7
|
import SControlActionMenu from '../components/SControlActionMenu.vue'
|
|
4
8
|
import SControlButton from '../components/SControlButton.vue'
|
|
5
9
|
import SControlCenter from '../components/SControlCenter.vue'
|
|
@@ -11,6 +15,10 @@ import SControlText from '../components/SControlText.vue'
|
|
|
11
15
|
|
|
12
16
|
export function mixin(app: App): void {
|
|
13
17
|
app.component('SControl', SControl)
|
|
18
|
+
app.component('SControlActionBar', SControlActionBar)
|
|
19
|
+
app.component('SControlActionBarButton', SControlActionBarButton)
|
|
20
|
+
app.component('SControlActionBarClose', SControlActionBarClose)
|
|
21
|
+
app.component('SControlActionBarCollapse', SControlActionBarCollapse)
|
|
14
22
|
app.component('SControlActionMenu', SControlActionMenu)
|
|
15
23
|
app.component('SControlButton', SControlButton)
|
|
16
24
|
app.component('SControlCenter', SControlCenter)
|
|
@@ -24,6 +32,9 @@ export function mixin(app: App): void {
|
|
|
24
32
|
declare module 'vue' {
|
|
25
33
|
export interface GlobalComponents {
|
|
26
34
|
SControl: typeof SControl
|
|
35
|
+
SControlActionBar: typeof SControlActionBar
|
|
36
|
+
SControlActionBarButton: typeof SControlActionBarButton
|
|
37
|
+
SControlActionBarClose: typeof SControlActionBarClose
|
|
27
38
|
SControlActionMenu: typeof SControlActionMenu
|
|
28
39
|
SControlButton: typeof SControlButton
|
|
29
40
|
SControlCenter: typeof SControlCenter
|