@globalbrain/sefirot 4.10.0 → 4.12.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/SDescFile.vue +1 -1
- package/lib/components/SDescItem.vue +11 -1
- package/lib/components/SDescLabel.vue +67 -6
- package/lib/components/SInputBase.vue +41 -18
- package/lib/components/SInputDropdown.vue +49 -29
- package/lib/components/SInputDropdownItem.vue +255 -25
- package/lib/components/SInputNumber.vue +16 -25
- package/lib/components/SInputText.vue +19 -23
- package/lib/components/SInputTextarea.vue +19 -23
- package/lib/composables/App.ts +22 -0
- package/lib/composables/Error.ts +3 -1
- package/lib/composables/Http.ts +17 -0
- package/lib/composables/Lang.ts +18 -6
- package/lib/composables/Theme.ts +25 -0
- package/lib/composables/Url.ts +12 -3
- package/lib/styles/variables.css +2 -0
- package/package.json +1 -1
- package/lib/components/SInputDropdownItemAvatar.vue +0 -175
- package/lib/components/SInputDropdownItemText.vue +0 -154
package/lib/composables/Url.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import isEqual from 'lodash-es/isEqual'
|
|
2
|
-
import { type MaybeRef, nextTick, unref, watch } from 'vue'
|
|
2
|
+
import { type MaybeRef, computed, nextTick, unref, watch } from 'vue'
|
|
3
3
|
import { type LocationQuery, useRoute, useRouter } from 'vue-router'
|
|
4
4
|
|
|
5
5
|
export interface UseUrlQuerySyncOptions {
|
|
@@ -21,13 +21,22 @@ export function useUrlQuerySync(
|
|
|
21
21
|
const route = useRoute()
|
|
22
22
|
const router = useRouter()
|
|
23
23
|
|
|
24
|
+
const routeQuery = computed(() => ({
|
|
25
|
+
path: route.path,
|
|
26
|
+
query: route.query
|
|
27
|
+
}))
|
|
28
|
+
|
|
24
29
|
const flattenedDefaultState = flattenObject(unref(state))
|
|
25
30
|
|
|
26
31
|
let isSyncing = false
|
|
27
32
|
|
|
28
33
|
watch(
|
|
29
|
-
|
|
30
|
-
async () => {
|
|
34
|
+
routeQuery,
|
|
35
|
+
async (to, from) => {
|
|
36
|
+
if (from && from.path !== to.path) {
|
|
37
|
+
return
|
|
38
|
+
}
|
|
39
|
+
|
|
31
40
|
if (!isSyncing) {
|
|
32
41
|
isSyncing = true
|
|
33
42
|
await setState()
|
package/lib/styles/variables.css
CHANGED
|
@@ -858,6 +858,8 @@
|
|
|
858
858
|
--input-focus-border-color: var(--c-border-info-1);
|
|
859
859
|
--input-error-text-color: var(--c-text-danger-1);
|
|
860
860
|
--input-error-border-color: var(--c-border-danger-1);
|
|
861
|
+
--input-warning-text-color: var(--c-text-warning-1);
|
|
862
|
+
--input-warning-border-color: var(--c-border-warning-1);
|
|
861
863
|
--input-disabled-border-color: var(--c-border-mute-1);
|
|
862
864
|
--input-disabled-value-color: var(--c-text-1);
|
|
863
865
|
--input-disabled-bg-color: var(--c-bg-mute-1);
|
package/package.json
CHANGED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import IconX from '~icons/ph/x-bold'
|
|
3
|
-
import SAvatar from './SAvatar.vue'
|
|
4
|
-
|
|
5
|
-
export type Size = 'mini' | 'small' | 'medium'
|
|
6
|
-
|
|
7
|
-
defineProps<{
|
|
8
|
-
size: Size
|
|
9
|
-
label: string
|
|
10
|
-
image?: string | null
|
|
11
|
-
value: any
|
|
12
|
-
removable: boolean
|
|
13
|
-
disabled: boolean
|
|
14
|
-
}>()
|
|
15
|
-
|
|
16
|
-
defineEmits<{
|
|
17
|
-
(e: 'remove', value: any): void
|
|
18
|
-
}>()
|
|
19
|
-
|
|
20
|
-
const avatarSizeDict = {
|
|
21
|
-
mini: 'nano',
|
|
22
|
-
small: 'mini',
|
|
23
|
-
medium: 'mini'
|
|
24
|
-
} as const
|
|
25
|
-
</script>
|
|
26
|
-
|
|
27
|
-
<template>
|
|
28
|
-
<div class="SInputDropdownItemAvatar" :class="[size, { disabled, removable }]">
|
|
29
|
-
<div class="user">
|
|
30
|
-
<div class="avatar">
|
|
31
|
-
<SAvatar :size="avatarSizeDict[size]" :avatar="image" :name="label" />
|
|
32
|
-
</div>
|
|
33
|
-
<p class="name">{{ label }}</p>
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
<div v-if="!disabled && removable" class="remove" role="button" @click="$emit('remove', value)">
|
|
37
|
-
<div class="remove-box">
|
|
38
|
-
<IconX class="remove-icon" />
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
</template>
|
|
43
|
-
|
|
44
|
-
<style lang="postcss" scoped>
|
|
45
|
-
.SInputDropdownItemAvatar {
|
|
46
|
-
display: flex;
|
|
47
|
-
align-items: center;
|
|
48
|
-
border: 1px solid var(--c-border-mute-1);
|
|
49
|
-
background-color: var(--c-bg-mute-1);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.user {
|
|
53
|
-
display: flex;
|
|
54
|
-
align-items: center;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.avatar {
|
|
58
|
-
display: flex;
|
|
59
|
-
align-items: center;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.name {
|
|
63
|
-
font-size: 12px;
|
|
64
|
-
font-weight: 500;
|
|
65
|
-
white-space: nowrap;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.remove {
|
|
69
|
-
display: flex;
|
|
70
|
-
justify-content: center;
|
|
71
|
-
align-items: center;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.remove-box {
|
|
75
|
-
display: flex;
|
|
76
|
-
justify-content: center;
|
|
77
|
-
align-items: center;
|
|
78
|
-
border-radius: 50%;
|
|
79
|
-
color: var(--c-text-2);
|
|
80
|
-
transition: color 0.25s, background-color 0.25s;
|
|
81
|
-
|
|
82
|
-
.remove:hover & {
|
|
83
|
-
color: var(--c-text-1);
|
|
84
|
-
background-color: var(--c-bg-mute-2)
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.SInputDropdownItemAvatar.mini {
|
|
89
|
-
gap: 2px;
|
|
90
|
-
border-radius: 12px;
|
|
91
|
-
padding: 0 8px 0 0;
|
|
92
|
-
height: 24px;
|
|
93
|
-
|
|
94
|
-
.avatar {
|
|
95
|
-
padding: 0 0 0 1px;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.name {
|
|
99
|
-
margin-left: 6px;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.remove {
|
|
103
|
-
width: 23px;
|
|
104
|
-
height: 23px;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.remove-box {
|
|
108
|
-
width: 20px;
|
|
109
|
-
height: 20px;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.remove-icon {
|
|
113
|
-
width: 12px;
|
|
114
|
-
height: 12px;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.SInputDropdownItemAvatar.small {
|
|
119
|
-
border-radius: 14px;
|
|
120
|
-
padding: 0 12px 0 0;
|
|
121
|
-
height: 28px;
|
|
122
|
-
|
|
123
|
-
.avatar {
|
|
124
|
-
padding: 0 0 0 1px;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.name {
|
|
128
|
-
margin-left: 6px;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.remove {
|
|
132
|
-
width: 26px;
|
|
133
|
-
height: 26px;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.remove-box {
|
|
137
|
-
width: 20px;
|
|
138
|
-
height: 20px;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.remove-icon {
|
|
142
|
-
width: 12px;
|
|
143
|
-
height: 12px;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.SInputDropdownItemAvatar.medium {
|
|
148
|
-
border-radius: 16px;
|
|
149
|
-
padding: 0 12px 0 0;
|
|
150
|
-
height: 32px;
|
|
151
|
-
|
|
152
|
-
.avatar {
|
|
153
|
-
padding: 0 0 0 4px;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.name {
|
|
157
|
-
margin-left: 6px;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.remove {
|
|
161
|
-
width: 26px;
|
|
162
|
-
height: 26px;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.remove-box {
|
|
166
|
-
width: 20px;
|
|
167
|
-
height: 20px;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.remove-icon {
|
|
171
|
-
width: 12px;
|
|
172
|
-
height: 12px;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
</style>
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import IconX from '~icons/ph/x-bold'
|
|
3
|
-
|
|
4
|
-
export type Size = 'mini' | 'small' | 'medium'
|
|
5
|
-
|
|
6
|
-
defineProps<{
|
|
7
|
-
size: Size
|
|
8
|
-
label: string
|
|
9
|
-
value: any
|
|
10
|
-
removable: boolean
|
|
11
|
-
disabled: boolean
|
|
12
|
-
}>()
|
|
13
|
-
|
|
14
|
-
defineEmits<{
|
|
15
|
-
(e: 'remove', value: any): void
|
|
16
|
-
}>()
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<template>
|
|
20
|
-
<div class="SInputDropdownItemText" :class="[size, { disabled, removable }]">
|
|
21
|
-
<p class="text">{{ label }}</p>
|
|
22
|
-
|
|
23
|
-
<div v-if="!disabled && removable" class="remove" role="button" @click.stop="$emit('remove', value)">
|
|
24
|
-
<div class="remove-box">
|
|
25
|
-
<IconX class="remove-icon" />
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
</template>
|
|
30
|
-
|
|
31
|
-
<style lang="postcss" scoped>
|
|
32
|
-
.SInputDropdownItemText {
|
|
33
|
-
display: flex;
|
|
34
|
-
align-items: center;
|
|
35
|
-
border: 1px solid var(--c-border-mute-1);
|
|
36
|
-
background-color: var(--c-bg-mute-1);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.text {
|
|
40
|
-
margin: 0;
|
|
41
|
-
line-height: 20px;
|
|
42
|
-
font-size: 12px;
|
|
43
|
-
font-weight: 500;
|
|
44
|
-
white-space: nowrap;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.remove {
|
|
48
|
-
display: flex;
|
|
49
|
-
justify-content: center;
|
|
50
|
-
align-items: center;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.remove-box {
|
|
54
|
-
display: flex;
|
|
55
|
-
justify-content: center;
|
|
56
|
-
align-items: center;
|
|
57
|
-
border-radius: 50%;
|
|
58
|
-
color: var(--c-text-2);
|
|
59
|
-
transition: color 0.25s, background-color 0.25s;
|
|
60
|
-
|
|
61
|
-
.remove:hover & {
|
|
62
|
-
color: var(--c-text-1);
|
|
63
|
-
background-color: var(--c-bg-mute-3);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.SInputDropdownItemText.mini {
|
|
68
|
-
gap: 2px;
|
|
69
|
-
border-radius: 12px;
|
|
70
|
-
padding: 0 8px;
|
|
71
|
-
height: 24px;
|
|
72
|
-
|
|
73
|
-
&.removable {
|
|
74
|
-
padding: 0 0 0 8px;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
&.disabled {
|
|
78
|
-
padding: 0 10px;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.remove {
|
|
82
|
-
width: 23px;
|
|
83
|
-
height: 23px;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.remove-box {
|
|
87
|
-
width: 20px;
|
|
88
|
-
height: 20px;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.remove-icon {
|
|
92
|
-
width: 12px;
|
|
93
|
-
height: 12px;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.SInputDropdownItemText.small {
|
|
98
|
-
border-radius: 14px;
|
|
99
|
-
padding: 0 12px;
|
|
100
|
-
height: 28px;
|
|
101
|
-
|
|
102
|
-
&.removable {
|
|
103
|
-
padding: 0 0 0 12px;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
&.disabled {
|
|
107
|
-
padding: 0 12px;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.remove {
|
|
111
|
-
width: 26px;
|
|
112
|
-
height: 26px;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.remove-box {
|
|
116
|
-
width: 20px;
|
|
117
|
-
height: 20px;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.remove-icon {
|
|
121
|
-
width: 12px;
|
|
122
|
-
height: 12px;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.SInputDropdownItemText.medium {
|
|
127
|
-
border-radius: 16px;
|
|
128
|
-
padding: 0 12px;
|
|
129
|
-
height: 32px;
|
|
130
|
-
|
|
131
|
-
&.removable {
|
|
132
|
-
padding: 0 0 0 12px;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
&.disabled {
|
|
136
|
-
padding: 0 12px;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.remove {
|
|
140
|
-
width: 26px;
|
|
141
|
-
height: 26px;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.remove-box {
|
|
145
|
-
width: 20px;
|
|
146
|
-
height: 20px;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.remove-icon {
|
|
150
|
-
width: 12px;
|
|
151
|
-
height: 12px;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
</style>
|