@globalbrain/sefirot 4.7.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.
@@ -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="padValue?.hour"
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="padValue?.minute"
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="padValue?.second"
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
- <SLocalNavTitle :title="title" />
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>
@@ -24,6 +24,8 @@ defineProps<{
24
24
  <style scoped lang="postcss">
25
25
  .SLocalNavTitle {
26
26
  display: flex;
27
+ flex-grow: 1;
28
+ width: 100%;
27
29
  overflow: hidden;
28
30
  }
29
31
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@globalbrain/sefirot",
3
3
  "type": "module",
4
- "version": "4.7.0",
4
+ "version": "4.7.1",
5
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>",