@globalbrain/sefirot 4.6.0 → 4.7.1
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/SContent.vue +37 -0
- package/lib/components/SInputHMS.vue +4 -12
- package/lib/components/SLocalNav.vue +18 -2
- package/lib/components/SLocalNavActions.vue +56 -0
- package/lib/components/SLocalNavTitle.vue +2 -0
- package/lib/validation/rules/maxLength.ts +4 -3
- package/lib/validation/rules/maxValue.ts +4 -3
- package/lib/validation/rules/minLength.ts +4 -3
- package/lib/validation/rules/minValue.ts +4 -3
- package/package.json +36 -36
|
@@ -110,4 +110,41 @@
|
|
|
110
110
|
font-feature-settings: "tnum";
|
|
111
111
|
content: counter(s-medium-counter)". ";
|
|
112
112
|
}
|
|
113
|
+
|
|
114
|
+
.SContent :deep(table) {
|
|
115
|
+
margin: 8px 0;
|
|
116
|
+
border-style: hidden;
|
|
117
|
+
border-radius: 6px;
|
|
118
|
+
text-align: left;
|
|
119
|
+
font-size: 14px;
|
|
120
|
+
color: var(--c-text-1);
|
|
121
|
+
overflow: clip;
|
|
122
|
+
box-shadow: 0 0 0 1px var(--c-divider);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.SContent :deep(table tr:hover td) {
|
|
126
|
+
background-color: var(--c-bg-elv-4);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.SContent :deep(table thead > tr > th) {
|
|
130
|
+
vertical-align: middle;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.SContent :deep(table th),
|
|
134
|
+
.SContent :deep(table td) {
|
|
135
|
+
border: 1px solid var(--c-gutter);
|
|
136
|
+
padding: 8px 16px;
|
|
137
|
+
height: 40px;
|
|
138
|
+
vertical-align: top;
|
|
139
|
+
text-wrap: pretty;
|
|
140
|
+
background-color: var(--c-bg-elv-3);
|
|
141
|
+
overflow-wrap: break-word;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.SContent :deep(table th) {
|
|
145
|
+
font-size: 12px;
|
|
146
|
+
font-weight: 600;
|
|
147
|
+
color: var(--c-text-2);
|
|
148
|
+
text-wrap: balance;
|
|
149
|
+
}
|
|
113
150
|
</style>
|
|
@@ -51,14 +51,6 @@ const _value = computed(() => {
|
|
|
51
51
|
: props.value !== undefined ? props.value : null
|
|
52
52
|
})
|
|
53
53
|
|
|
54
|
-
const padValue = computed(() => {
|
|
55
|
-
return {
|
|
56
|
-
hour: _value.value?.hour?.padStart(2, '0') ?? null,
|
|
57
|
-
minute: _value.value?.minute?.padStart(2, '0') ?? null,
|
|
58
|
-
second: _value.value?.second?.padStart(2, '0') ?? null
|
|
59
|
-
}
|
|
60
|
-
})
|
|
61
|
-
|
|
62
54
|
const padPlaceholder = computed(() => {
|
|
63
55
|
return {
|
|
64
56
|
hour: props.placeholder?.hour?.toString().padStart(2, '0') ?? '00',
|
|
@@ -102,7 +94,7 @@ function update(type: ValueType, value: string | null) {
|
|
|
102
94
|
|
|
103
95
|
const newValue = {
|
|
104
96
|
..._value.value,
|
|
105
|
-
[type]: value ?? null
|
|
97
|
+
[type]: value?.padStart(2, '0') ?? null
|
|
106
98
|
}
|
|
107
99
|
|
|
108
100
|
emit('update:model-value', newValue)
|
|
@@ -166,7 +158,7 @@ function createRequiredTouched(): boolean[] {
|
|
|
166
158
|
<input
|
|
167
159
|
v-if="!noHour"
|
|
168
160
|
class="input hour"
|
|
169
|
-
:value="
|
|
161
|
+
:value="_value?.hour"
|
|
170
162
|
:placeholder="padPlaceholder.hour"
|
|
171
163
|
:maxlength="2"
|
|
172
164
|
:disabled="disabled"
|
|
@@ -177,7 +169,7 @@ function createRequiredTouched(): boolean[] {
|
|
|
177
169
|
<input
|
|
178
170
|
v-if="!noMinute"
|
|
179
171
|
class="input minute"
|
|
180
|
-
:value="
|
|
172
|
+
:value="_value?.minute"
|
|
181
173
|
:placeholder="padPlaceholder.minute"
|
|
182
174
|
:maxlength="2"
|
|
183
175
|
:disabled="disabled"
|
|
@@ -188,7 +180,7 @@ function createRequiredTouched(): boolean[] {
|
|
|
188
180
|
<input
|
|
189
181
|
v-if="!noSecond"
|
|
190
182
|
class="input second"
|
|
191
|
-
:value="
|
|
183
|
+
:value="_value?.second"
|
|
192
184
|
:placeholder="padPlaceholder.second"
|
|
193
185
|
:maxlength="2"
|
|
194
186
|
:disabled="disabled"
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed } from 'vue'
|
|
3
|
+
import SLocalNavActions, { type Action } from './SLocalNavActions.vue'
|
|
3
4
|
import SLocalNavAvatar from './SLocalNavAvatar.vue'
|
|
4
5
|
import SLocalNavDescription from './SLocalNavDescription.vue'
|
|
5
6
|
import SLocalNavMenu, { type MenuItem } from './SLocalNavMenu.vue'
|
|
6
7
|
import SLocalNavTitle, { type Title } from './SLocalNavTitle.vue'
|
|
7
8
|
|
|
8
|
-
export type { Title, MenuItem }
|
|
9
|
+
export type { Title, Action, MenuItem }
|
|
9
10
|
|
|
10
11
|
export interface Avatar {
|
|
11
12
|
image?: string | null
|
|
@@ -16,6 +17,7 @@ const props = defineProps<{
|
|
|
16
17
|
avatar?: Avatar
|
|
17
18
|
title: Title[]
|
|
18
19
|
description?: string
|
|
20
|
+
actions?: Action[]
|
|
19
21
|
menu?: MenuItem[][]
|
|
20
22
|
}>()
|
|
21
23
|
|
|
@@ -37,7 +39,10 @@ const normalizedMenu = computed(() => {
|
|
|
37
39
|
/>
|
|
38
40
|
</div>
|
|
39
41
|
<div class="title-bar-body">
|
|
40
|
-
<
|
|
42
|
+
<div class="title-bar-title">
|
|
43
|
+
<SLocalNavTitle :title="title" />
|
|
44
|
+
<SLocalNavActions v-if="actions?.length" :actions="actions" />
|
|
45
|
+
</div>
|
|
41
46
|
<SLocalNavDescription v-if="description" :text="description" />
|
|
42
47
|
</div>
|
|
43
48
|
</div>
|
|
@@ -71,4 +76,15 @@ const normalizedMenu = computed(() => {
|
|
|
71
76
|
align-items: center;
|
|
72
77
|
gap: 16px;
|
|
73
78
|
}
|
|
79
|
+
|
|
80
|
+
.title-bar-body {
|
|
81
|
+
flex-grow: 1;
|
|
82
|
+
max-width: 100%;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.title-bar-title {
|
|
86
|
+
display: flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
gap: 24px;
|
|
89
|
+
}
|
|
74
90
|
</style>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type Component } from 'vue'
|
|
3
|
+
import SButton, { type Mode, type Tooltip, type Type } from './SButton.vue'
|
|
4
|
+
|
|
5
|
+
export interface Action {
|
|
6
|
+
tag?: string
|
|
7
|
+
type?: Type
|
|
8
|
+
mode?: Mode
|
|
9
|
+
icon?: Component
|
|
10
|
+
leadIcon?: Component
|
|
11
|
+
trailIcon?: Component
|
|
12
|
+
iconMode?: Mode
|
|
13
|
+
label?: string
|
|
14
|
+
labelMode?: Mode
|
|
15
|
+
href?: string
|
|
16
|
+
loading?: boolean
|
|
17
|
+
disabled?: boolean
|
|
18
|
+
tooltip?: string | Tooltip
|
|
19
|
+
onClick?(): void
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
defineProps<{
|
|
23
|
+
actions: Action[]
|
|
24
|
+
}>()
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<div class="SLocalNavActions">
|
|
29
|
+
<div v-for="action, i in actions" :key="i" class="action">
|
|
30
|
+
<SButton
|
|
31
|
+
size="small"
|
|
32
|
+
:type="action.type"
|
|
33
|
+
:mode="action.mode"
|
|
34
|
+
:icon="action.icon"
|
|
35
|
+
:lead-icon="action.leadIcon"
|
|
36
|
+
:trail-icon="action.trailIcon"
|
|
37
|
+
:icon-mode="action.iconMode"
|
|
38
|
+
:label="action.label"
|
|
39
|
+
:label-mode="action.labelMode"
|
|
40
|
+
:href="action.href"
|
|
41
|
+
:loading="action.loading"
|
|
42
|
+
:disabled="action.disabled"
|
|
43
|
+
:tooltip="action.tooltip"
|
|
44
|
+
@click="() => { action.onClick?.() }"
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<style scoped lang="postcss">
|
|
51
|
+
.SLocalNavActions {
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-shrink: 0;
|
|
54
|
+
gap: 8px;
|
|
55
|
+
}
|
|
56
|
+
</style>
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import { format } from '../../support/Num'
|
|
1
2
|
import { createRule } from '../Rule'
|
|
2
3
|
import { maxLength as baseMaxLength } from '../validators'
|
|
3
4
|
|
|
4
5
|
export const message = {
|
|
5
|
-
en: (length:
|
|
6
|
-
ja: (length:
|
|
6
|
+
en: (length: string) => `The value must be less than or equal to ${length} characters.`,
|
|
7
|
+
ja: (length: string) => `この値は最大${length}文字までです。`
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
export function maxLength(length: number, msg?: string) {
|
|
10
11
|
return createRule({
|
|
11
|
-
message: ({ lang }) => msg ?? message[lang](length),
|
|
12
|
+
message: ({ lang }) => msg ?? message[lang](format(length)),
|
|
12
13
|
optional: true,
|
|
13
14
|
validation: (value) => baseMaxLength(value, length)
|
|
14
15
|
})
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import { format } from '../../support/Num'
|
|
1
2
|
import { createRule } from '../Rule'
|
|
2
3
|
import { maxValue as baseMaxValue } from '../validators'
|
|
3
4
|
|
|
4
5
|
export const message = {
|
|
5
|
-
en: (max:
|
|
6
|
-
ja: (max:
|
|
6
|
+
en: (max: string) => `The value must be less than or equal to ${max}.`,
|
|
7
|
+
ja: (max: string) => `この値は最大${max}です。`
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
export function maxValue(max: number, msg?: string) {
|
|
10
11
|
return createRule({
|
|
11
|
-
message: ({ lang }) => msg ?? message[lang](max),
|
|
12
|
+
message: ({ lang }) => msg ?? message[lang](format(max)),
|
|
12
13
|
optional: true,
|
|
13
14
|
validation: (value) => baseMaxValue(value, max)
|
|
14
15
|
})
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import { format } from '../../support/Num'
|
|
1
2
|
import { createRule } from '../Rule'
|
|
2
3
|
import { minLength as baseMinLength } from '../validators'
|
|
3
4
|
|
|
4
5
|
export const message = {
|
|
5
|
-
en: (min:
|
|
6
|
-
ja: (min:
|
|
6
|
+
en: (min: string) => `The value must be greater than or equal to ${min} characters.`,
|
|
7
|
+
ja: (min: string) => `この値は最小${min}文字です。`
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
export function minLength(length: number, msg?: string) {
|
|
10
11
|
return createRule({
|
|
11
|
-
message: ({ lang }) => msg ?? message[lang](length),
|
|
12
|
+
message: ({ lang }) => msg ?? message[lang](format(length)),
|
|
12
13
|
optional: true,
|
|
13
14
|
validation: (value) => baseMinLength(value, length)
|
|
14
15
|
})
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import { format } from '../../support/Num'
|
|
1
2
|
import { createRule } from '../Rule'
|
|
2
3
|
import { minValue as baseMinValue } from '../validators'
|
|
3
4
|
|
|
4
5
|
export const message = {
|
|
5
|
-
en: (min:
|
|
6
|
-
ja: (min:
|
|
6
|
+
en: (min: string) => `The value must be greater than or equal to ${min}.`,
|
|
7
|
+
ja: (min: string) => `この値は最大${min}です。`
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
export function minValue(min: number, msg?: string) {
|
|
10
11
|
return createRule({
|
|
11
|
-
message: ({ lang }) => msg ?? message[lang](min),
|
|
12
|
+
message: ({ lang }) => msg ?? message[lang](format(min)),
|
|
12
13
|
optional: true,
|
|
13
14
|
validation: (value) => baseMinValue(value, min)
|
|
14
15
|
})
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@globalbrain/sefirot",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.
|
|
5
|
-
"packageManager": "pnpm@9.
|
|
4
|
+
"version": "4.7.1",
|
|
5
|
+
"packageManager": "pnpm@9.14.4",
|
|
6
6
|
"description": "Vue Components for Global Brain Design System.",
|
|
7
7
|
"author": "Kia Ishii <ka.ishii@globalbrains.com>",
|
|
8
8
|
"license": "MIT",
|
|
@@ -43,58 +43,58 @@
|
|
|
43
43
|
"release": "release-it"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@iconify-json/ph": "^1.2.
|
|
47
|
-
"@iconify-json/ri": "^1.2.
|
|
46
|
+
"@iconify-json/ph": "^1.2.1",
|
|
47
|
+
"@iconify-json/ri": "^1.2.3",
|
|
48
48
|
"@types/body-scroll-lock": "^3.1.2",
|
|
49
49
|
"@types/lodash-es": "^4.17.12",
|
|
50
50
|
"@types/markdown-it": "^14.1.2",
|
|
51
|
-
"@vue/reactivity": "^3.5.
|
|
51
|
+
"@vue/reactivity": "^3.5.13",
|
|
52
52
|
"@vuelidate/core": "^2.0.3",
|
|
53
53
|
"@vuelidate/validators": "^2.0.4",
|
|
54
|
-
"@vueuse/core": "^
|
|
54
|
+
"@vueuse/core": "^12.0.0",
|
|
55
55
|
"body-scroll-lock": "4.0.0-beta.0",
|
|
56
56
|
"dayjs": "^1.11.13",
|
|
57
57
|
"fuse.js": "^7.0.0",
|
|
58
58
|
"lodash-es": "^4.17.21",
|
|
59
59
|
"markdown-it": "^14.1.0",
|
|
60
60
|
"normalize.css": "^8.0.1",
|
|
61
|
-
"pinia": "^2.2.
|
|
62
|
-
"postcss": "^8.4.
|
|
63
|
-
"postcss-nested": "^
|
|
61
|
+
"pinia": "^2.2.8",
|
|
62
|
+
"postcss": "^8.4.49",
|
|
63
|
+
"postcss-nested": "^7.0.2",
|
|
64
64
|
"v-calendar": "3.0.1",
|
|
65
|
-
"vue": "^3.5.
|
|
66
|
-
"vue-router": "^4.
|
|
65
|
+
"vue": "^3.5.13",
|
|
66
|
+
"vue-router": "^4.5.0"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@sentry/browser": "^8.
|
|
69
|
+
"@sentry/browser": "^8.41.0",
|
|
70
70
|
"@tanstack/vue-virtual": "3.0.0-beta.62",
|
|
71
71
|
"@tinyhttp/content-disposition": "^2.2.2",
|
|
72
72
|
"@tinyhttp/cookie": "^2.1.1",
|
|
73
73
|
"@types/file-saver": "^2.0.7",
|
|
74
|
-
"@types/qs": "^6.9.
|
|
74
|
+
"@types/qs": "^6.9.17",
|
|
75
75
|
"file-saver": "^2.0.5",
|
|
76
|
-
"magic-string": "^0.30.
|
|
77
|
-
"ofetch": "^1.4.
|
|
78
|
-
"qs": "^6.13.
|
|
79
|
-
"unplugin-icons": "^0.
|
|
76
|
+
"magic-string": "^0.30.14",
|
|
77
|
+
"ofetch": "^1.4.1",
|
|
78
|
+
"qs": "^6.13.1",
|
|
79
|
+
"unplugin-icons": "^0.20.2"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@globalbrain/eslint-config": "^1.7.1",
|
|
83
83
|
"@histoire/plugin-vue": "0.16.5",
|
|
84
|
-
"@iconify-json/ph": "^1.2.
|
|
85
|
-
"@iconify-json/ri": "^1.2.
|
|
86
|
-
"@release-it/conventional-changelog": "^
|
|
84
|
+
"@iconify-json/ph": "^1.2.1",
|
|
85
|
+
"@iconify-json/ri": "^1.2.3",
|
|
86
|
+
"@release-it/conventional-changelog": "^9.0.3",
|
|
87
87
|
"@types/body-scroll-lock": "^3.1.2",
|
|
88
88
|
"@types/lodash-es": "^4.17.12",
|
|
89
89
|
"@types/markdown-it": "^14.1.2",
|
|
90
|
-
"@types/node": "^22.
|
|
91
|
-
"@vitejs/plugin-vue": "^5.1
|
|
92
|
-
"@vitest/coverage-v8": "^2.1.
|
|
93
|
-
"@vue/reactivity": "^3.5.
|
|
90
|
+
"@types/node": "^22.10.1",
|
|
91
|
+
"@vitejs/plugin-vue": "^5.2.1",
|
|
92
|
+
"@vitest/coverage-v8": "^2.1.6",
|
|
93
|
+
"@vue/reactivity": "^3.5.13",
|
|
94
94
|
"@vue/test-utils": "^2.4.6",
|
|
95
95
|
"@vuelidate/core": "^2.0.3",
|
|
96
96
|
"@vuelidate/validators": "^2.0.4",
|
|
97
|
-
"@vueuse/core": "^
|
|
97
|
+
"@vueuse/core": "^12.0.0",
|
|
98
98
|
"body-scroll-lock": "4.0.0-beta.0",
|
|
99
99
|
"dayjs": "^1.11.13",
|
|
100
100
|
"eslint": "8.57.0",
|
|
@@ -104,18 +104,18 @@
|
|
|
104
104
|
"lodash-es": "^4.17.21",
|
|
105
105
|
"markdown-it": "^14.1.0",
|
|
106
106
|
"normalize.css": "^8.0.1",
|
|
107
|
-
"pinia": "^2.2.
|
|
108
|
-
"postcss": "^8.4.
|
|
109
|
-
"postcss-nested": "^
|
|
107
|
+
"pinia": "^2.2.8",
|
|
108
|
+
"postcss": "^8.4.49",
|
|
109
|
+
"postcss-nested": "^7.0.2",
|
|
110
110
|
"punycode": "^2.3.1",
|
|
111
|
-
"release-it": "^17.
|
|
112
|
-
"typescript": "~5.6.
|
|
111
|
+
"release-it": "^17.10.0",
|
|
112
|
+
"typescript": "~5.6.3",
|
|
113
113
|
"v-calendar": "3.0.1",
|
|
114
|
-
"vite": "^
|
|
115
|
-
"vitepress": "^1.
|
|
116
|
-
"vitest": "^2.1.
|
|
117
|
-
"vue": "^3.5.
|
|
118
|
-
"vue-router": "^4.
|
|
119
|
-
"vue-tsc": "^2.1.
|
|
114
|
+
"vite": "^6.0.1",
|
|
115
|
+
"vitepress": "^1.5.0",
|
|
116
|
+
"vitest": "^2.1.6",
|
|
117
|
+
"vue": "^3.5.13",
|
|
118
|
+
"vue-router": "^4.5.0",
|
|
119
|
+
"vue-tsc": "^2.1.10"
|
|
120
120
|
}
|
|
121
121
|
}
|