@globalbrain/sefirot 2.18.0 → 2.20.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/SButton.vue +2 -2
- package/lib/components/SButtonGroup.vue +9 -140
- package/lib/components/SDropdownSectionFilter.vue +1 -2
- package/lib/components/SDropdownSectionFilterItemAvatar.vue +1 -1
- package/lib/components/SDropdownSectionFilterItemText.vue +1 -1
- package/lib/components/SDropdownSectionMenu.vue +1 -1
- package/lib/components/SInputBase.vue +4 -4
- package/lib/components/SInputHMS.vue +51 -44
- package/lib/components/SInputRadio.vue +1 -1
- package/lib/components/SInputYMD.vue +71 -60
- package/lib/components/SPill.vue +1 -1
- package/lib/composables/Dropdown.ts +3 -1
- package/lib/styles/base.css +5 -8
- package/lib/styles/variables.css +6 -2
- package/package.json +1 -1
|
@@ -81,7 +81,7 @@ function handleClick(): void {
|
|
|
81
81
|
</component>
|
|
82
82
|
</template>
|
|
83
83
|
|
|
84
|
-
<style lang="postcss"
|
|
84
|
+
<style scoped lang="postcss">
|
|
85
85
|
.SButton {
|
|
86
86
|
position: relative;
|
|
87
87
|
display: inline-flex;
|
|
@@ -156,7 +156,7 @@ function handleClick(): void {
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
.SButton.fill {
|
|
159
|
-
font-weight:
|
|
159
|
+
font-weight: 500;
|
|
160
160
|
|
|
161
161
|
&.neutral {
|
|
162
162
|
border-color: var(--button-fill-neutral-border-color);
|
|
@@ -1,148 +1,17 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { PropType, computed } from 'vue'
|
|
3
|
-
|
|
4
|
-
export interface ButtonGroupItem {
|
|
5
|
-
label: string
|
|
6
|
-
value: string
|
|
7
|
-
mode?: Mode
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export type Mode = 'neutral' | 'info' | 'success' | 'warning' | 'danger'
|
|
11
|
-
export type Size = 'mini' | 'small' | 'medium' | 'large' | 'jumbo'
|
|
12
|
-
|
|
13
|
-
const props = defineProps({
|
|
14
|
-
items: { type: Array as PropType<ButtonGroupItem[]>, required: true },
|
|
15
|
-
size: { type: String as PropType<Size>, default: 'medium' },
|
|
16
|
-
modelValue: { type: String, default: null }
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
const emit = defineEmits(['update:modelValue'])
|
|
20
|
-
|
|
21
|
-
const classes = computed(() => [props.size])
|
|
22
|
-
|
|
23
|
-
function getButtonClasses(button: ButtonGroupItem) {
|
|
24
|
-
return [
|
|
25
|
-
{ active: button.value === props.modelValue },
|
|
26
|
-
button.mode ?? 'neutral'
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function handleClick(value: string) {
|
|
31
|
-
emit('update:modelValue', value)
|
|
32
|
-
}
|
|
33
|
-
</script>
|
|
34
|
-
|
|
35
1
|
<template>
|
|
36
|
-
<div class="SButtonGroup"
|
|
37
|
-
<
|
|
38
|
-
v-for="item in items"
|
|
39
|
-
:key="item.value"
|
|
40
|
-
class="button"
|
|
41
|
-
:class="getButtonClasses(item)"
|
|
42
|
-
@click="handleClick(item.value)"
|
|
43
|
-
>
|
|
44
|
-
<span class="content">
|
|
45
|
-
{{ item.label }}
|
|
46
|
-
</span>
|
|
47
|
-
</button>
|
|
2
|
+
<div class="SButtonGroup">
|
|
3
|
+
<slot />
|
|
48
4
|
</div>
|
|
49
5
|
</template>
|
|
50
6
|
|
|
51
|
-
<style lang="postcss"
|
|
52
|
-
.SButtonGroup {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
border: 1px solid var(--c-divider);
|
|
56
|
-
border-radius: 4px;
|
|
57
|
-
overflow: hidden;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.SButtonGroup.mini {
|
|
61
|
-
height: 28px;
|
|
62
|
-
|
|
63
|
-
.button {
|
|
64
|
-
padding: 0 8px;
|
|
65
|
-
height: 28px;
|
|
66
|
-
font-size: 12px;
|
|
67
|
-
font-weight: 500;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.SButtonGroup.small {
|
|
72
|
-
height: 32px;
|
|
73
|
-
|
|
74
|
-
.button {
|
|
75
|
-
padding: 0 10px;
|
|
76
|
-
height: 32px;
|
|
77
|
-
font-size: 12px;
|
|
78
|
-
font-weight: 500;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.SButtonGroup.medium {
|
|
83
|
-
height: 40px;
|
|
84
|
-
|
|
85
|
-
.button {
|
|
86
|
-
padding: 0 12px;
|
|
87
|
-
height: 40px;
|
|
88
|
-
font-size: 13px;
|
|
89
|
-
font-weight: 500;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.SButtonGroup.large {
|
|
94
|
-
height: 48px;
|
|
95
|
-
|
|
96
|
-
.button {
|
|
97
|
-
padding: 0 14px;
|
|
98
|
-
height: 48px;
|
|
99
|
-
font-size: 14px;
|
|
100
|
-
font-weight: 500;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.SButtonGroup.jumbo {
|
|
105
|
-
height: 64px;
|
|
106
|
-
|
|
107
|
-
.button {
|
|
108
|
-
padding: 0 24px;
|
|
109
|
-
height: 64px;
|
|
110
|
-
font-size: 14px;
|
|
111
|
-
font-weight: 500;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.button {
|
|
116
|
-
border-left: 1px solid transparent;
|
|
117
|
-
letter-spacing: .4px;
|
|
118
|
-
color: var(--c-text-2);
|
|
119
|
-
white-space: nowrap;
|
|
120
|
-
transition: color .25s, background-color .25s;
|
|
121
|
-
|
|
122
|
-
&:hover {
|
|
123
|
-
color: var(--c-text-1);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.button:not(:first-child) {
|
|
128
|
-
border-left: 1px solid var(--c-divider);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.button.active {
|
|
132
|
-
color: var(--c-text-dark-1);
|
|
133
|
-
}
|
|
7
|
+
<style scoped lang="postcss">
|
|
8
|
+
.SButtonGroup :slotted(.SButton) {
|
|
9
|
+
border-left-width: 0;
|
|
10
|
+
border-radius: 0;
|
|
134
11
|
|
|
135
|
-
|
|
136
|
-
.button.info.active { background-color: var(--c-info); }
|
|
137
|
-
.button.success.active { background-color: var(--c-success); }
|
|
138
|
-
.button.warning.active { background-color: var(--c-warning); }
|
|
139
|
-
.button.danger.active { background-color: var(--c-danger); }
|
|
12
|
+
&:first-child { border-left-width: 1px; }
|
|
140
13
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
justify-content: center;
|
|
144
|
-
align-items: center;
|
|
145
|
-
width: 100%;
|
|
146
|
-
height: 100%;
|
|
14
|
+
&:first-child { border-radius: 6px 0 0 6px; }
|
|
15
|
+
&:last-child { border-radius: 0 6px 6px 0; }
|
|
147
16
|
}
|
|
148
17
|
</style>
|
|
@@ -102,13 +102,12 @@ function handleClick(option: DropdownSectionFilterOption, value: string | number
|
|
|
102
102
|
border-radius: 6px;
|
|
103
103
|
padding: 0 8px;
|
|
104
104
|
width: 100%;
|
|
105
|
-
font-size:
|
|
105
|
+
font-size: 14px;
|
|
106
106
|
line-height: 32px;
|
|
107
107
|
background-color: var(--c-bg);
|
|
108
108
|
transition: border-color 0.25s;
|
|
109
109
|
|
|
110
110
|
&::placeholder {
|
|
111
|
-
font-weight: 500;
|
|
112
111
|
color: var(--c-text-3);
|
|
113
112
|
}
|
|
114
113
|
|
|
@@ -114,7 +114,6 @@ function getErrorMsg(validation: Validatable) {
|
|
|
114
114
|
align-items: baseline;
|
|
115
115
|
width: 100%;
|
|
116
116
|
line-height: 16px;
|
|
117
|
-
font-weight: 500;
|
|
118
117
|
cursor: pointer;
|
|
119
118
|
transition: color 0.25s;
|
|
120
119
|
}
|
|
@@ -126,6 +125,7 @@ function getErrorMsg(validation: Validatable) {
|
|
|
126
125
|
}
|
|
127
126
|
|
|
128
127
|
.label-text-value {
|
|
128
|
+
font-weight: 500;
|
|
129
129
|
color: var(--input-label-color);
|
|
130
130
|
}
|
|
131
131
|
|
|
@@ -144,7 +144,7 @@ function getErrorMsg(validation: Validatable) {
|
|
|
144
144
|
display: inline-block;
|
|
145
145
|
margin-left: 8px;
|
|
146
146
|
font-size: 12px;
|
|
147
|
-
font-weight:
|
|
147
|
+
font-weight: 400;
|
|
148
148
|
color: var(--c-text-2);
|
|
149
149
|
}
|
|
150
150
|
|
|
@@ -158,7 +158,7 @@ function getErrorMsg(validation: Validatable) {
|
|
|
158
158
|
padding: 6px 0 0 0;
|
|
159
159
|
line-height: 18px;
|
|
160
160
|
font-size: 12px;
|
|
161
|
-
font-weight:
|
|
161
|
+
font-weight: 400;
|
|
162
162
|
color: var(--input-error-text-color);
|
|
163
163
|
transition: opacity 0.25s, transform 0.25s;
|
|
164
164
|
}
|
|
@@ -168,7 +168,7 @@ function getErrorMsg(validation: Validatable) {
|
|
|
168
168
|
padding: 4px 0 0;
|
|
169
169
|
line-height: 20px;
|
|
170
170
|
font-size: 12px;
|
|
171
|
-
font-weight:
|
|
171
|
+
font-weight: 400;
|
|
172
172
|
color: var(--c-text-2);
|
|
173
173
|
}
|
|
174
174
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { IconifyIcon } from '@iconify/vue/dist/offline'
|
|
3
|
-
import { DefineComponent, ref } from 'vue'
|
|
3
|
+
import { DefineComponent, computed, ref } from 'vue'
|
|
4
4
|
import { Validatable } from '../composables/Validation'
|
|
5
5
|
import SInputBase from './SInputBase.vue'
|
|
6
6
|
|
|
@@ -28,15 +28,23 @@ const props = defineProps<{
|
|
|
28
28
|
noMinute?: boolean
|
|
29
29
|
noSecond?: boolean
|
|
30
30
|
disabled?: boolean
|
|
31
|
-
|
|
32
|
-
modelValue
|
|
31
|
+
value?: Value
|
|
32
|
+
modelValue?: Value
|
|
33
33
|
validation?: Validatable
|
|
34
|
+
hideError?: boolean
|
|
34
35
|
}>()
|
|
35
36
|
|
|
36
37
|
const emit = defineEmits<{
|
|
37
|
-
(e: 'update:
|
|
38
|
+
(e: 'update:model-value', value: Value): void
|
|
39
|
+
(e: 'change', value: Value): void
|
|
38
40
|
}>()
|
|
39
41
|
|
|
42
|
+
const _value = computed(() => {
|
|
43
|
+
return props.modelValue !== undefined
|
|
44
|
+
? props.modelValue
|
|
45
|
+
: props.value !== undefined ? props.value : null
|
|
46
|
+
})
|
|
47
|
+
|
|
40
48
|
const isFocused = ref(false)
|
|
41
49
|
|
|
42
50
|
const touched = {
|
|
@@ -66,10 +74,17 @@ function updateSecond(e: FocusEvent): void {
|
|
|
66
74
|
}
|
|
67
75
|
|
|
68
76
|
function update(type: ValueType, value: string | null) {
|
|
69
|
-
|
|
70
|
-
|
|
77
|
+
if (_value.value === null) {
|
|
78
|
+
return
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const newValue = {
|
|
82
|
+
..._value.value,
|
|
71
83
|
[type]: value !== null ? value.padStart(2, '0') : null
|
|
72
|
-
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
emit('update:model-value', newValue)
|
|
87
|
+
emit('change', newValue)
|
|
73
88
|
|
|
74
89
|
emitTouch(type)
|
|
75
90
|
|
|
@@ -114,7 +129,7 @@ function createRequiredTouched(): boolean[] {
|
|
|
114
129
|
<template>
|
|
115
130
|
<SInputBase
|
|
116
131
|
class="SInputHMS"
|
|
117
|
-
:class="[size, { disabled }]"
|
|
132
|
+
:class="[size ?? 'small', { disabled }]"
|
|
118
133
|
:label="label"
|
|
119
134
|
:note="note"
|
|
120
135
|
:info="info"
|
|
@@ -129,8 +144,9 @@ function createRequiredTouched(): boolean[] {
|
|
|
129
144
|
<input
|
|
130
145
|
v-if="!noHour"
|
|
131
146
|
class="input hour"
|
|
132
|
-
:value="
|
|
147
|
+
:value="_value?.hour"
|
|
133
148
|
placeholder="00"
|
|
149
|
+
:maxlength="2"
|
|
134
150
|
:disabled="disabled"
|
|
135
151
|
@focus="onFocus"
|
|
136
152
|
@blur="updateHour"
|
|
@@ -139,8 +155,9 @@ function createRequiredTouched(): boolean[] {
|
|
|
139
155
|
<input
|
|
140
156
|
v-if="!noMinute"
|
|
141
157
|
class="input minute"
|
|
142
|
-
:value="
|
|
158
|
+
:value="_value?.minute"
|
|
143
159
|
placeholder="00"
|
|
160
|
+
:maxlength="2"
|
|
144
161
|
:disabled="disabled"
|
|
145
162
|
@focus="onFocus"
|
|
146
163
|
@blur="updateMinute"
|
|
@@ -149,8 +166,9 @@ function createRequiredTouched(): boolean[] {
|
|
|
149
166
|
<input
|
|
150
167
|
v-if="!noSecond"
|
|
151
168
|
class="input second"
|
|
152
|
-
:value="
|
|
169
|
+
:value="_value?.second"
|
|
153
170
|
placeholder="00"
|
|
171
|
+
:maxlength="2"
|
|
154
172
|
:disabled="disabled"
|
|
155
173
|
@focus="onFocus"
|
|
156
174
|
@blur="updateSecond"
|
|
@@ -170,15 +188,15 @@ function createRequiredTouched(): boolean[] {
|
|
|
170
188
|
|
|
171
189
|
.input {
|
|
172
190
|
padding: 3px 0;
|
|
173
|
-
text-align: center;
|
|
174
|
-
font-size: 14px;
|
|
175
191
|
width: 20px;
|
|
192
|
+
text-align: center;
|
|
193
|
+
font-size: var(--input-font-size, var(--input-mini-font-size));
|
|
176
194
|
}
|
|
177
195
|
|
|
178
196
|
.separator {
|
|
179
197
|
padding: 3px 0;
|
|
180
198
|
line-height: 24px;
|
|
181
|
-
font-size:
|
|
199
|
+
font-size: var(--input-font-size, var(--input-mini-font-size));
|
|
182
200
|
}
|
|
183
201
|
|
|
184
202
|
.separator::before {
|
|
@@ -189,20 +207,21 @@ function createRequiredTouched(): boolean[] {
|
|
|
189
207
|
.SInputHMS.small {
|
|
190
208
|
.container {
|
|
191
209
|
padding: 0 12px;
|
|
210
|
+
min-height: 40px;
|
|
192
211
|
}
|
|
193
212
|
|
|
194
213
|
.input {
|
|
195
214
|
flex-shrink: 0;
|
|
196
|
-
padding:
|
|
197
|
-
text-align: center;
|
|
198
|
-
font-size: 16px;
|
|
215
|
+
padding: 7px 0 6px;
|
|
199
216
|
width: 20px;
|
|
217
|
+
text-align: center;
|
|
218
|
+
font-size: var(--input-font-size, var(--input-small-font-size));
|
|
200
219
|
}
|
|
201
220
|
|
|
202
221
|
.separator {
|
|
203
222
|
padding: 7px 0;
|
|
204
223
|
line-height: 24px;
|
|
205
|
-
font-size:
|
|
224
|
+
font-size: var(--input-font-size, var(--input-small-font-size));
|
|
206
225
|
}
|
|
207
226
|
|
|
208
227
|
.separator::before {
|
|
@@ -218,14 +237,14 @@ function createRequiredTouched(): boolean[] {
|
|
|
218
237
|
.input {
|
|
219
238
|
padding: 12px 0 10px;
|
|
220
239
|
text-align: center;
|
|
221
|
-
font-size:
|
|
240
|
+
font-size: var(--input-font-size, var(--input-medium-font-size));
|
|
222
241
|
width: 24px;
|
|
223
242
|
}
|
|
224
243
|
|
|
225
244
|
.separator {
|
|
226
245
|
padding: 11px 0;
|
|
227
246
|
line-height: 24px;
|
|
228
|
-
font-size:
|
|
247
|
+
font-size: var(--input-font-size, var(--input-medium-font-size));
|
|
229
248
|
}
|
|
230
249
|
|
|
231
250
|
.separator::before {
|
|
@@ -240,49 +259,37 @@ function createRequiredTouched(): boolean[] {
|
|
|
240
259
|
}
|
|
241
260
|
|
|
242
261
|
.container {
|
|
243
|
-
|
|
244
|
-
background-color: var(--input-disabled-bg);
|
|
262
|
+
background-color: var(--input-disabled-bg-color);
|
|
245
263
|
}
|
|
264
|
+
|
|
265
|
+
.container:hover { border-color: var(--input-border-color); }
|
|
266
|
+
.container.focus { border-color: var(--input-border-color); }
|
|
246
267
|
}
|
|
247
268
|
|
|
248
269
|
.SInputHMS.has-error {
|
|
249
270
|
.container {
|
|
250
|
-
border-color: var(--
|
|
271
|
+
border-color: var(--input-error-border-color);
|
|
251
272
|
}
|
|
252
273
|
}
|
|
253
274
|
|
|
254
275
|
.container {
|
|
255
276
|
display: inline-flex;
|
|
256
|
-
border: 1px solid var(--
|
|
277
|
+
border: 1px solid var(--input-border-color);
|
|
257
278
|
border-radius: 6px;
|
|
258
|
-
background-color: var(--
|
|
279
|
+
background-color: var(--input-bg-color);
|
|
259
280
|
transition: border-color 0.25s;
|
|
260
281
|
|
|
261
|
-
&:hover {
|
|
262
|
-
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
&.focus,
|
|
266
|
-
&:hover.focus {
|
|
267
|
-
border-color: var(--c-info);
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
.dark &:hover {
|
|
271
|
-
border-color: var(--c-gray);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
.dark &.focus,
|
|
275
|
-
.dark &:hover.focus {
|
|
276
|
-
border-color: var(--c-info);
|
|
277
|
-
}
|
|
282
|
+
&:hover { border-color: var(--input-hover-border-color); }
|
|
283
|
+
&.focus { border-color: var(--input-focus-border-color); }
|
|
278
284
|
}
|
|
279
285
|
|
|
280
286
|
.input {
|
|
287
|
+
font-family: var(--font-family-number);
|
|
288
|
+
line-height: 24px;
|
|
281
289
|
background-color: transparent;
|
|
282
290
|
|
|
283
291
|
&::placeholder {
|
|
284
|
-
|
|
285
|
-
color: var(--c-text-3);
|
|
292
|
+
color: var(--input-placeholder-color);
|
|
286
293
|
}
|
|
287
294
|
}
|
|
288
295
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { IconifyIcon } from '@iconify/vue/dist/offline'
|
|
3
|
-
import { DefineComponent, ref } from 'vue'
|
|
3
|
+
import { DefineComponent, computed, ref } from 'vue'
|
|
4
4
|
import { Validatable } from '../composables/Validation'
|
|
5
5
|
import SInputBase from './SInputBase.vue'
|
|
6
6
|
|
|
@@ -28,15 +28,31 @@ const props = defineProps<{
|
|
|
28
28
|
noMonth?: boolean
|
|
29
29
|
noDate?: boolean
|
|
30
30
|
disabled?: boolean
|
|
31
|
-
|
|
32
|
-
modelValue
|
|
31
|
+
value?: Value
|
|
32
|
+
modelValue?: Value
|
|
33
33
|
validation?: Validatable
|
|
34
|
+
hideError?: boolean
|
|
34
35
|
}>()
|
|
35
36
|
|
|
36
37
|
const emit = defineEmits<{
|
|
37
|
-
(e: 'update:
|
|
38
|
+
(e: 'update:model-value', value: Value): void
|
|
39
|
+
(e: 'change', value: Value): void
|
|
38
40
|
}>()
|
|
39
41
|
|
|
42
|
+
const _value = computed(() => {
|
|
43
|
+
return props.modelValue !== undefined
|
|
44
|
+
? props.modelValue
|
|
45
|
+
: props.value !== undefined ? props.value : null
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const padValue = computed(() => {
|
|
49
|
+
return {
|
|
50
|
+
year: _value.value?.year?.toString().padStart(4, '0') ?? null,
|
|
51
|
+
month: _value.value?.month?.toString().padStart(2, '0') ?? null,
|
|
52
|
+
date: _value.value?.date?.toString().padStart(2, '0') ?? null
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
|
|
40
56
|
const isFocused = ref(false)
|
|
41
57
|
|
|
42
58
|
const touched = {
|
|
@@ -54,22 +70,29 @@ function blur() {
|
|
|
54
70
|
}
|
|
55
71
|
|
|
56
72
|
function updateYear(e: FocusEvent) {
|
|
57
|
-
update('year',
|
|
73
|
+
update('year', (e.target as HTMLInputElement).value)
|
|
58
74
|
}
|
|
59
75
|
|
|
60
76
|
function updateMonth(e: FocusEvent) {
|
|
61
|
-
update('month',
|
|
77
|
+
update('month', (e.target as HTMLInputElement).value)
|
|
62
78
|
}
|
|
63
79
|
|
|
64
80
|
function updateDate(e: FocusEvent) {
|
|
65
|
-
update('date',
|
|
81
|
+
update('date', (e.target as HTMLInputElement).value)
|
|
66
82
|
}
|
|
67
83
|
|
|
68
|
-
function update(type: ValueType, value:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
84
|
+
function update(type: ValueType, value: string) {
|
|
85
|
+
if (_value.value === null) {
|
|
86
|
+
return
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const newValue = {
|
|
90
|
+
..._value.value,
|
|
91
|
+
[type]: value ? Number(value) : null
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
emit('update:model-value', newValue)
|
|
95
|
+
emit('change', newValue)
|
|
73
96
|
|
|
74
97
|
emitTouch(type)
|
|
75
98
|
|
|
@@ -119,9 +142,9 @@ function createRequiredTouched(): boolean[] {
|
|
|
119
142
|
<input
|
|
120
143
|
v-if="!noYear"
|
|
121
144
|
class="input year"
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
145
|
+
:value="padValue?.year"
|
|
146
|
+
placeholder="1998"
|
|
147
|
+
:maxlength="4"
|
|
125
148
|
:disabled="disabled"
|
|
126
149
|
@focus="onFocus"
|
|
127
150
|
@blur="updateYear"
|
|
@@ -133,9 +156,9 @@ function createRequiredTouched(): boolean[] {
|
|
|
133
156
|
<input
|
|
134
157
|
v-if="!noMonth"
|
|
135
158
|
class="input month"
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
159
|
+
:value="padValue?.month"
|
|
160
|
+
placeholder="01"
|
|
161
|
+
:maxlength="2"
|
|
139
162
|
:disabled="disabled"
|
|
140
163
|
@focus="onFocus"
|
|
141
164
|
@blur="updateMonth"
|
|
@@ -147,9 +170,9 @@ function createRequiredTouched(): boolean[] {
|
|
|
147
170
|
<input
|
|
148
171
|
v-if="!noDate"
|
|
149
172
|
class="input date"
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
173
|
+
:value="padValue?.date"
|
|
174
|
+
placeholder="14"
|
|
175
|
+
:maxlength="2"
|
|
153
176
|
:disabled="disabled"
|
|
154
177
|
@focus="onFocus"
|
|
155
178
|
@blur="updateDate"
|
|
@@ -159,7 +182,7 @@ function createRequiredTouched(): boolean[] {
|
|
|
159
182
|
</SInputBase>
|
|
160
183
|
</template>
|
|
161
184
|
|
|
162
|
-
<style lang="postcss"
|
|
185
|
+
<style scoped lang="postcss">
|
|
163
186
|
.SInputYMD.mini {
|
|
164
187
|
.container {
|
|
165
188
|
padding: 0 4px;
|
|
@@ -168,7 +191,7 @@ function createRequiredTouched(): boolean[] {
|
|
|
168
191
|
.input {
|
|
169
192
|
padding: 3px 0;
|
|
170
193
|
text-align: center;
|
|
171
|
-
font-size:
|
|
194
|
+
font-size: var(--input-font-size, var(--input-mini-font-size));
|
|
172
195
|
}
|
|
173
196
|
|
|
174
197
|
.input.year { width: 48px; }
|
|
@@ -178,51 +201,53 @@ function createRequiredTouched(): boolean[] {
|
|
|
178
201
|
.separator {
|
|
179
202
|
padding: 3px 0;
|
|
180
203
|
line-height: 24px;
|
|
181
|
-
font-size:
|
|
204
|
+
font-size: var(--input-font-size, var(--input-mini-font-size));
|
|
182
205
|
}
|
|
183
206
|
}
|
|
184
207
|
|
|
185
208
|
.SInputYMD.small {
|
|
186
209
|
.container {
|
|
187
|
-
padding: 0
|
|
210
|
+
padding: 0 8px;
|
|
188
211
|
}
|
|
189
212
|
|
|
190
213
|
.input {
|
|
191
|
-
padding: 7px 0;
|
|
214
|
+
padding: 7px 0 6px;
|
|
192
215
|
text-align: center;
|
|
193
|
-
font-size:
|
|
216
|
+
font-size: var(--input-font-size, var(--input-small-font-size));
|
|
194
217
|
}
|
|
195
218
|
|
|
196
|
-
.input.year {
|
|
219
|
+
.input.year { margin-right: 2px; }
|
|
220
|
+
.input.year { width: 48px; }
|
|
197
221
|
.input.month { width: 32px; }
|
|
198
|
-
.input.date { width:
|
|
222
|
+
.input.date { width: 32px; }
|
|
199
223
|
|
|
200
224
|
.separator {
|
|
201
225
|
padding: 7px 0;
|
|
202
226
|
line-height: 24px;
|
|
203
|
-
font-size:
|
|
227
|
+
font-size: var(--input-font-size, var(--input-small-font-size));
|
|
204
228
|
}
|
|
205
229
|
}
|
|
206
230
|
|
|
207
231
|
.SInputYMD.medium {
|
|
208
232
|
.container {
|
|
209
|
-
padding: 0
|
|
233
|
+
padding: 0 8px;
|
|
210
234
|
}
|
|
211
235
|
|
|
212
236
|
.input {
|
|
213
237
|
padding: 11px 0;
|
|
214
238
|
text-align: center;
|
|
215
|
-
font-size:
|
|
239
|
+
font-size: var(--input-font-size, var(--input-medium-font-size));
|
|
216
240
|
}
|
|
217
241
|
|
|
218
|
-
.input.year {
|
|
219
|
-
.input.
|
|
220
|
-
.input.
|
|
242
|
+
.input.year { margin-right: 2px; }
|
|
243
|
+
.input.year { width: 52px; }
|
|
244
|
+
.input.month { width: 36px; }
|
|
245
|
+
.input.date { width: 36px; }
|
|
221
246
|
|
|
222
247
|
.separator {
|
|
223
248
|
padding: 11px 0;
|
|
224
249
|
line-height: 24px;
|
|
225
|
-
font-size:
|
|
250
|
+
font-size: var(--input-font-size, var(--input-medium-font-size));
|
|
226
251
|
}
|
|
227
252
|
}
|
|
228
253
|
|
|
@@ -233,48 +258,34 @@ function createRequiredTouched(): boolean[] {
|
|
|
233
258
|
}
|
|
234
259
|
|
|
235
260
|
.container {
|
|
236
|
-
background-color: var(--input-disabled-bg);
|
|
261
|
+
background-color: var(--input-disabled-bg-color);
|
|
237
262
|
}
|
|
238
263
|
}
|
|
239
264
|
|
|
240
265
|
.SInputYMD.has-error {
|
|
241
266
|
.container {
|
|
242
|
-
border-color: var(--
|
|
267
|
+
border-color: var(--input-error-border-color);
|
|
243
268
|
}
|
|
244
269
|
}
|
|
245
270
|
|
|
246
271
|
.container {
|
|
247
272
|
display: inline-flex;
|
|
248
|
-
border: 1px solid var(--
|
|
273
|
+
border: 1px solid var(--input-border-color);
|
|
249
274
|
border-radius: 6px;
|
|
250
|
-
background-color: var(--
|
|
251
|
-
transition: border-color 0.25s;
|
|
252
|
-
|
|
253
|
-
&:hover {
|
|
254
|
-
border-color: var(--c-black);
|
|
255
|
-
}
|
|
275
|
+
background-color: var(--input-bg-color);
|
|
276
|
+
transition: border-color 0.25s, background-color 0.25s;
|
|
256
277
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
border-color: var(--c-info);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
.dark &:hover {
|
|
263
|
-
border-color: var(--c-gray);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
.dark &.focus,
|
|
267
|
-
.dark &:hover.focus {
|
|
268
|
-
border-color: var(--c-info);
|
|
269
|
-
}
|
|
278
|
+
&:hover { border-color: var(--input-hover-border-color); }
|
|
279
|
+
&.focus { border-color: var(--input-focus-border-color); }
|
|
270
280
|
}
|
|
271
281
|
|
|
272
282
|
.input {
|
|
283
|
+
font-family: var(--font-family-number);
|
|
284
|
+
line-height: 24px;
|
|
273
285
|
background-color: transparent;
|
|
274
286
|
|
|
275
287
|
&::placeholder {
|
|
276
|
-
|
|
277
|
-
color: var(--c-text-3);
|
|
288
|
+
color: var(--input-placeholder-color);
|
|
278
289
|
}
|
|
279
290
|
}
|
|
280
291
|
|
package/lib/components/SPill.vue
CHANGED
|
@@ -57,6 +57,7 @@ export interface DropdownSectionFilterOptionAvatar extends DropdownSectionFilter
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
export interface ManualDropdownPosition {
|
|
60
|
+
container: Ref<any>
|
|
60
61
|
position: Ref<'top' | 'bottom'>
|
|
61
62
|
update(): void
|
|
62
63
|
}
|
|
@@ -74,7 +75,7 @@ export function useManualDropdownPosition(
|
|
|
74
75
|
const { top, bottom } = useElementBounding(el)
|
|
75
76
|
const { height } = useWindowSize()
|
|
76
77
|
|
|
77
|
-
const position = ref<'top' | 'bottom'>('bottom')
|
|
78
|
+
const position = ref<'top' | 'bottom'>(initPosition ?? 'bottom')
|
|
78
79
|
|
|
79
80
|
const dialogHeight = 400
|
|
80
81
|
|
|
@@ -100,6 +101,7 @@ export function useManualDropdownPosition(
|
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
return {
|
|
104
|
+
container: el,
|
|
103
105
|
position,
|
|
104
106
|
update
|
|
105
107
|
}
|
package/lib/styles/base.css
CHANGED
|
@@ -9,17 +9,11 @@ body {
|
|
|
9
9
|
min-width: 320px;
|
|
10
10
|
min-height: 100vh;
|
|
11
11
|
font-family: var(--font-family-base);
|
|
12
|
-
letter-spacing: .4px;
|
|
13
12
|
line-height: 24px;
|
|
14
13
|
font-size: 16px;
|
|
15
14
|
font-weight: 400;
|
|
16
15
|
color: var(--c-text-1);
|
|
17
16
|
background-color: var(--c-bg);
|
|
18
|
-
direction: ltr;
|
|
19
|
-
font-synthesis: none;
|
|
20
|
-
text-rendering: optimizeLegibility;
|
|
21
|
-
-webkit-font-smoothing: antialiased;
|
|
22
|
-
-moz-osx-font-smoothing: grayscale;
|
|
23
17
|
}
|
|
24
18
|
|
|
25
19
|
blockquote,
|
|
@@ -103,7 +97,6 @@ iframe,
|
|
|
103
97
|
embed,
|
|
104
98
|
object {
|
|
105
99
|
display: block;
|
|
106
|
-
vertical-align: middle;
|
|
107
100
|
}
|
|
108
101
|
|
|
109
102
|
img,
|
|
@@ -119,6 +112,7 @@ select,
|
|
|
119
112
|
textarea {
|
|
120
113
|
border: 0;
|
|
121
114
|
padding: 0;
|
|
115
|
+
letter-spacing: inherit;
|
|
122
116
|
line-height: inherit;
|
|
123
117
|
color: inherit;
|
|
124
118
|
}
|
|
@@ -171,17 +165,20 @@ textarea {
|
|
|
171
165
|
|
|
172
166
|
input[type="number"] {
|
|
173
167
|
-moz-appearance: textfield;
|
|
168
|
+
appearance: textfield;
|
|
174
169
|
}
|
|
175
170
|
|
|
176
171
|
input[type="number"]::-webkit-outer-spin-button,
|
|
177
172
|
input[type="number"]::-webkit-inner-spin-button {
|
|
178
|
-
-webkit-appearance: none;
|
|
179
173
|
margin: 0;
|
|
174
|
+
-webkit-appearance: none;
|
|
175
|
+
appearance: none;
|
|
180
176
|
}
|
|
181
177
|
|
|
182
178
|
input[type="select"],
|
|
183
179
|
select {
|
|
184
180
|
-webkit-appearance: none;
|
|
181
|
+
appearance: none;
|
|
185
182
|
}
|
|
186
183
|
|
|
187
184
|
fieldset {
|
package/lib/styles/variables.css
CHANGED
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
--c-neutral-dark-dimm-2: rgba(255, 255, 255, 0.24);
|
|
59
59
|
|
|
60
60
|
--c-text-light-1: #1f1f1f;
|
|
61
|
-
--c-text-light-2: rgba(60, 60, 67, 0.
|
|
62
|
-
--c-text-light-3: rgba(60, 60, 67, 0.
|
|
61
|
+
--c-text-light-2: rgba(60, 60, 67, 0.72);
|
|
62
|
+
--c-text-light-3: rgba(60, 60, 67, 0.39);
|
|
63
63
|
|
|
64
64
|
--c-text-dark-1: rgba(235, 235, 245, 0.98);
|
|
65
65
|
--c-text-dark-2: rgba(235, 235, 245, 0.6);
|
|
@@ -198,6 +198,8 @@
|
|
|
198
198
|
--c-text-inverse-2: var(--c-text-dark-2);
|
|
199
199
|
--c-text-inverse-3: var(--c-text-dark-3);
|
|
200
200
|
|
|
201
|
+
--c-soft: var(--c-white-soft);
|
|
202
|
+
|
|
201
203
|
--c-mute: #f1f1f1;
|
|
202
204
|
--c-mute-light: #f9f9f9;
|
|
203
205
|
--c-mute-lighter: #ffffff;
|
|
@@ -251,6 +253,8 @@
|
|
|
251
253
|
--c-text-inverse-2: var(--c-text-light-2);
|
|
252
254
|
--c-text-inverse-3: var(--c-text-light-3);
|
|
253
255
|
|
|
256
|
+
--c-soft: #222226;
|
|
257
|
+
|
|
254
258
|
--c-mute: #2c2c2e;
|
|
255
259
|
--c-mute-light: #3a3a3c;
|
|
256
260
|
--c-mute-lighter: #505053;
|