@globalbrain/sefirot 4.7.0 → 4.8.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/SActionMenu.vue +6 -2
- package/lib/components/SButton.vue +1 -3
- package/lib/components/SControlActionBarButton.vue +2 -1
- package/lib/components/SControlActionMenu.vue +6 -1
- package/lib/components/SControlButton.vue +6 -1
- package/lib/components/SFragment.vue +2 -4
- 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/composables/Table.ts +3 -3
- package/package.json +20 -20
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { ref } from 'vue'
|
|
2
|
+
import { type Component, ref } from 'vue'
|
|
3
3
|
import { type DropdownSection, useManualDropdownPosition } from '../composables/Dropdown'
|
|
4
4
|
import { useFlyout } from '../composables/Flyout'
|
|
5
5
|
import SButton, { type Mode, type Size, type Tooltip, type Type } from './SButton.vue'
|
|
@@ -12,7 +12,9 @@ const props = defineProps<{
|
|
|
12
12
|
size?: Size
|
|
13
13
|
type?: Type
|
|
14
14
|
mode?: Mode
|
|
15
|
-
icon?:
|
|
15
|
+
icon?: Component
|
|
16
|
+
leadIcon?: Component
|
|
17
|
+
trailIcon?: Component
|
|
16
18
|
iconMode?: Mode
|
|
17
19
|
label?: string
|
|
18
20
|
labelMode?: Mode
|
|
@@ -46,6 +48,8 @@ async function onOpen() {
|
|
|
46
48
|
:type="type"
|
|
47
49
|
:mode="mode"
|
|
48
50
|
:icon="icon"
|
|
51
|
+
:lead-icon="leadIcon"
|
|
52
|
+
:trail-icon="trailIcon"
|
|
49
53
|
:icon-mode="iconMode"
|
|
50
54
|
:label="label"
|
|
51
55
|
:label-mode="labelMode"
|
|
@@ -116,9 +116,7 @@ function handleClick(): void {
|
|
|
116
116
|
<span v-if="_leadIcon" class="icon" :class="iconMode">
|
|
117
117
|
<component :is="_leadIcon" class="icon-svg" />
|
|
118
118
|
</span>
|
|
119
|
-
<span v-if="label" class="label" :class="labelMode"
|
|
120
|
-
{{ label }}
|
|
121
|
-
</span>
|
|
119
|
+
<span v-if="label" class="label" :class="labelMode" v-html="label" />
|
|
122
120
|
<span v-if="trailIcon" class="icon" :class="iconMode">
|
|
123
121
|
<component :is="trailIcon" class="icon-svg" />
|
|
124
122
|
</span>
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { type Component } from 'vue'
|
|
2
3
|
import { useControlSize } from '../composables/Control'
|
|
3
4
|
import SButton, { type Tooltip } from './SButton.vue'
|
|
4
5
|
|
|
5
6
|
defineProps<{
|
|
6
7
|
as?: string
|
|
7
|
-
icon?:
|
|
8
|
+
icon?: Component
|
|
8
9
|
href?: string
|
|
9
10
|
disabled?: boolean
|
|
10
11
|
tooltip?: string | Tooltip
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { type Component } from 'vue'
|
|
2
3
|
import { useControlSize } from '../composables/Control'
|
|
3
4
|
import { type DropdownSection } from '../composables/Dropdown'
|
|
4
5
|
import SActionMenu, { type Mode, type Tooltip, type Type } from './SActionMenu.vue'
|
|
@@ -7,7 +8,9 @@ defineProps<{
|
|
|
7
8
|
tag?: string
|
|
8
9
|
type?: Type
|
|
9
10
|
mode?: Mode
|
|
10
|
-
icon?:
|
|
11
|
+
icon?: Component
|
|
12
|
+
leadIcon?: Component
|
|
13
|
+
trailIcon?: Component
|
|
11
14
|
iconMode?: Mode
|
|
12
15
|
label?: string
|
|
13
16
|
labelMode?: Mode
|
|
@@ -29,6 +32,8 @@ const size = useControlSize()
|
|
|
29
32
|
:type="type"
|
|
30
33
|
:mode="mode"
|
|
31
34
|
:icon="icon"
|
|
35
|
+
:lead-icon="leadIcon"
|
|
36
|
+
:trail-icon="trailIcon"
|
|
32
37
|
:icon-mode="iconMode"
|
|
33
38
|
:label="label"
|
|
34
39
|
:label-mode="labelMode"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { type Component } from 'vue'
|
|
2
3
|
import { useControlSize } from '../composables/Control'
|
|
3
4
|
import SButton, { type Mode, type Tooltip, type Type } from './SButton.vue'
|
|
4
5
|
|
|
@@ -6,7 +7,9 @@ defineProps<{
|
|
|
6
7
|
tag?: string
|
|
7
8
|
type?: Type
|
|
8
9
|
mode?: Mode
|
|
9
|
-
icon?:
|
|
10
|
+
icon?: Component
|
|
11
|
+
leadIcon?: Component
|
|
12
|
+
trailIcon?: Component
|
|
10
13
|
iconMode?: Mode
|
|
11
14
|
label?: string
|
|
12
15
|
labelMode?: Mode
|
|
@@ -31,6 +34,8 @@ const size = useControlSize()
|
|
|
31
34
|
:type="type"
|
|
32
35
|
:mode="mode"
|
|
33
36
|
:icon="icon"
|
|
37
|
+
:lead-icon="leadIcon"
|
|
38
|
+
:trail-icon="trailIcon"
|
|
34
39
|
:icon-mode="iconMode"
|
|
35
40
|
:label="label"
|
|
36
41
|
:label-mode="labelMode"
|
|
@@ -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>
|
package/lib/composables/Table.ts
CHANGED
|
@@ -96,7 +96,7 @@ export interface TableCellBase {
|
|
|
96
96
|
export interface TableCellText<V = any, R = any> extends TableCellBase {
|
|
97
97
|
type: 'text'
|
|
98
98
|
align?: 'left' | 'center' | 'right'
|
|
99
|
-
icon?:
|
|
99
|
+
icon?: Component
|
|
100
100
|
value?: string | null
|
|
101
101
|
link?: string | null
|
|
102
102
|
color?: TableCellValueColor
|
|
@@ -107,7 +107,7 @@ export interface TableCellText<V = any, R = any> extends TableCellBase {
|
|
|
107
107
|
export interface TableCellNumber<V = any, R = any> extends TableCellBase {
|
|
108
108
|
type: 'number'
|
|
109
109
|
align?: 'left' | 'center' | 'right'
|
|
110
|
-
icon?:
|
|
110
|
+
icon?: Component
|
|
111
111
|
value?: number | null
|
|
112
112
|
separator?: boolean
|
|
113
113
|
link?: string | null
|
|
@@ -194,7 +194,7 @@ export interface TableCellActions<R = any> extends TableCellBase {
|
|
|
194
194
|
|
|
195
195
|
export interface TableCellAction<R = any> {
|
|
196
196
|
mode?: Mode
|
|
197
|
-
icon?:
|
|
197
|
+
icon?: Component
|
|
198
198
|
iconMode?: Mode
|
|
199
199
|
label?: string
|
|
200
200
|
labelMode?: Mode
|
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.8.0",
|
|
5
|
+
"packageManager": "pnpm@9.15.3",
|
|
6
6
|
"description": "Vue Components for Global Brain Design System.",
|
|
7
7
|
"author": "Kia Ishii <ka.ishii@globalbrains.com>",
|
|
8
8
|
"license": "MIT",
|
|
@@ -43,22 +43,22 @@
|
|
|
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.2",
|
|
47
|
+
"@iconify-json/ri": "^1.2.5",
|
|
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
51
|
"@vue/reactivity": "^3.5.13",
|
|
52
52
|
"@vuelidate/core": "^2.0.3",
|
|
53
53
|
"@vuelidate/validators": "^2.0.4",
|
|
54
|
-
"@vueuse/core": "^12.
|
|
54
|
+
"@vueuse/core": "^12.4.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.
|
|
61
|
+
"pinia": "^2.3.0",
|
|
62
62
|
"postcss": "^8.4.49",
|
|
63
63
|
"postcss-nested": "^7.0.2",
|
|
64
64
|
"v-calendar": "3.0.1",
|
|
@@ -66,35 +66,35 @@
|
|
|
66
66
|
"vue-router": "^4.5.0"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@sentry/browser": "^8.
|
|
69
|
+
"@sentry/browser": "^8.48.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
74
|
"@types/qs": "^6.9.17",
|
|
75
75
|
"file-saver": "^2.0.5",
|
|
76
|
-
"magic-string": "^0.30.
|
|
76
|
+
"magic-string": "^0.30.17",
|
|
77
77
|
"ofetch": "^1.4.1",
|
|
78
78
|
"qs": "^6.13.1",
|
|
79
|
-
"unplugin-icons": "^0.
|
|
79
|
+
"unplugin-icons": "^22.0.0"
|
|
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.2",
|
|
85
|
+
"@iconify-json/ri": "^1.2.5",
|
|
86
|
+
"@release-it/conventional-changelog": "^10.0.0",
|
|
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.10.
|
|
90
|
+
"@types/node": "^22.10.5",
|
|
91
91
|
"@vitejs/plugin-vue": "^5.2.1",
|
|
92
|
-
"@vitest/coverage-v8": "
|
|
92
|
+
"@vitest/coverage-v8": ">=3.0.0-beta.0",
|
|
93
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": "^12.
|
|
97
|
+
"@vueuse/core": "^12.4.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.
|
|
107
|
+
"pinia": "^2.3.0",
|
|
108
108
|
"postcss": "^8.4.49",
|
|
109
109
|
"postcss-nested": "^7.0.2",
|
|
110
110
|
"punycode": "^2.3.1",
|
|
111
|
-
"release-it": "^
|
|
111
|
+
"release-it": "^18.1.1",
|
|
112
112
|
"typescript": "~5.6.3",
|
|
113
113
|
"v-calendar": "3.0.1",
|
|
114
|
-
"vite": "^6.0.
|
|
114
|
+
"vite": "^6.0.7",
|
|
115
115
|
"vitepress": "^1.5.0",
|
|
116
|
-
"vitest": "
|
|
116
|
+
"vitest": ">=3.0.0-beta.0",
|
|
117
117
|
"vue": "^3.5.13",
|
|
118
118
|
"vue-router": "^4.5.0",
|
|
119
|
-
"vue-tsc": "^2.
|
|
119
|
+
"vue-tsc": "^2.2.0"
|
|
120
120
|
}
|
|
121
121
|
}
|