@globalbrain/sefirot 2.4.0 → 2.5.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/SDropdownSectionFilter.vue +7 -2
- package/lib/components/SDropdownSectionFilterItemAvatar.vue +12 -3
- package/lib/components/SDropdownSectionFilterItemText.vue +10 -3
- package/lib/components/SInputCheckboxes.vue +1 -1
- package/lib/components/SInputDropdown.vue +2 -2
- package/lib/components/SInputHMS.vue +1 -1
- package/lib/components/SInputSwitches.vue +1 -1
- package/lib/components/SInputYMD.vue +1 -1
- package/lib/components/SMarkdown.vue +1 -1
- package/lib/components/STableCell.vue +7 -0
- package/lib/composables/Grid.ts +1 -1
- package/lib/composables/Markdown.ts +1 -1
- package/lib/composables/Table.ts +9 -2
- package/lib/stores/Snackbars.ts +1 -1
- package/lib/support/Time.ts +1 -1
- package/lib/validation/validators/requiredHms.ts +1 -1
- package/lib/validation/validators/requiredYmd.ts +1 -1
- package/package.json +3 -3
|
@@ -25,7 +25,7 @@ const fuse = computed(() => {
|
|
|
25
25
|
const filteredOptions = computed(() => {
|
|
26
26
|
return !props.search || !query.value
|
|
27
27
|
? unref(props.options)
|
|
28
|
-
: fuse.value.search(query.value).map(r => r.item)
|
|
28
|
+
: fuse.value.search(query.value).map((r) => r.item)
|
|
29
29
|
})
|
|
30
30
|
|
|
31
31
|
onMounted(() => {
|
|
@@ -125,7 +125,6 @@ function handleClick(option: DropdownSectionFilterOption, value: string | number
|
|
|
125
125
|
|
|
126
126
|
.button {
|
|
127
127
|
display: flex;
|
|
128
|
-
align-items: center;
|
|
129
128
|
border-radius: 6px;
|
|
130
129
|
padding: 0 8px;
|
|
131
130
|
width: 100%;
|
|
@@ -145,6 +144,7 @@ function handleClick(option: DropdownSectionFilterOption, value: string | number
|
|
|
145
144
|
|
|
146
145
|
.checkbox {
|
|
147
146
|
display: block;
|
|
147
|
+
padding-top: 8px;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
.checkbox-box {
|
|
@@ -177,6 +177,11 @@ function handleClick(option: DropdownSectionFilterOption, value: string | number
|
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
+
.option-item {
|
|
181
|
+
padding-left: 8px;
|
|
182
|
+
width: 100%;
|
|
183
|
+
}
|
|
184
|
+
|
|
180
185
|
.empty {
|
|
181
186
|
padding: 16px;
|
|
182
187
|
font-size: 12px;
|
|
@@ -9,23 +9,32 @@ defineProps<{
|
|
|
9
9
|
|
|
10
10
|
<template>
|
|
11
11
|
<span class="SDropdownSectionFilterItemAvatar">
|
|
12
|
-
<
|
|
12
|
+
<div class="avatar">
|
|
13
|
+
<SAvatar size="nano" :avatar="image" :name="label" />
|
|
14
|
+
</div>
|
|
13
15
|
<span class="name">{{ label }}</span>
|
|
14
16
|
</span>
|
|
15
17
|
</template>
|
|
16
18
|
|
|
17
19
|
<style scoped lang="postcss">
|
|
18
20
|
.SDropdownSectionFilterItemAvatar {
|
|
19
|
-
display:
|
|
21
|
+
display: flex;
|
|
20
22
|
align-items: center;
|
|
21
|
-
padding-
|
|
23
|
+
padding-right: 16px;
|
|
22
24
|
min-height: 32px;
|
|
23
25
|
}
|
|
24
26
|
|
|
27
|
+
.avatar {
|
|
28
|
+
flex-shrink: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
25
31
|
.name {
|
|
26
32
|
display: inline-block;
|
|
27
33
|
padding-left: 8px;
|
|
28
34
|
font-size: 12px;
|
|
29
35
|
font-weight: 500;
|
|
36
|
+
white-space: nowrap;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
text-overflow: ellipsis;
|
|
30
39
|
}
|
|
31
40
|
</style>
|
|
@@ -6,14 +6,21 @@ defineProps<{
|
|
|
6
6
|
|
|
7
7
|
<template>
|
|
8
8
|
<span class="SDropdownSectionFilterItemText">
|
|
9
|
-
{{ label }}
|
|
9
|
+
<span class="text">{{ label }}</span>
|
|
10
10
|
</span>
|
|
11
11
|
</template>
|
|
12
12
|
|
|
13
13
|
<style scoped lang="postcss">
|
|
14
14
|
.SDropdownSectionFilterItemText {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
display: inline-block;
|
|
16
|
+
padding: 6px 0;
|
|
17
|
+
line-height: 20px;
|
|
18
|
+
font-size: 12px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.text {
|
|
22
|
+
display: inline-block;
|
|
23
|
+
line-height: 20px;
|
|
17
24
|
font-size: 12px;
|
|
18
25
|
font-weight: 500;
|
|
19
26
|
}
|
|
@@ -28,7 +28,7 @@ function isChecked(value: unknown): boolean {
|
|
|
28
28
|
|
|
29
29
|
function handleChange(value: unknown): void {
|
|
30
30
|
const distinct = props.modelValue
|
|
31
|
-
.filter(v => v !== value)
|
|
31
|
+
.filter((v) => v !== value)
|
|
32
32
|
.concat(props.modelValue.includes(value) ? [] : [value])
|
|
33
33
|
|
|
34
34
|
emit('update:modelValue', distinct)
|
|
@@ -71,10 +71,10 @@ const dropdownOptions = computed<DropdownSectionFilter[]>(() => [{
|
|
|
71
71
|
|
|
72
72
|
const selected = computed(() => {
|
|
73
73
|
if (isArray(props.modelValue)) {
|
|
74
|
-
return props.options.filter(o => (props.modelValue as ArrayValue).includes(o.value))
|
|
74
|
+
return props.options.filter((o) => (props.modelValue as ArrayValue).includes(o.value))
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
const item = props.options.find(o => o.value === props.modelValue)
|
|
77
|
+
const item = props.options.find((o) => o.value === props.modelValue)
|
|
78
78
|
|
|
79
79
|
return item ? [item] : []
|
|
80
80
|
})
|
|
@@ -38,7 +38,7 @@ function isChecked(value: string | number | boolean): boolean {
|
|
|
38
38
|
|
|
39
39
|
function handleChange(value: string | number | boolean): void {
|
|
40
40
|
const difference = props.modelValue
|
|
41
|
-
.filter(v => v !== value)
|
|
41
|
+
.filter((v) => v !== value)
|
|
42
42
|
.concat(props.modelValue.includes(value) ? [] : [value])
|
|
43
43
|
|
|
44
44
|
emit('update:modelValue', difference)
|
package/lib/composables/Grid.ts
CHANGED
|
@@ -46,7 +46,7 @@ export function useGrid(options: UseGridOptions): Grid {
|
|
|
46
46
|
|
|
47
47
|
function adjustSpacer() {
|
|
48
48
|
container.value?.querySelectorAll(`${toClassSelector(spacerClass)}`)
|
|
49
|
-
.forEach(n => n.remove())
|
|
49
|
+
.forEach((n) => n.remove())
|
|
50
50
|
|
|
51
51
|
const track = container.value?.firstElementChild
|
|
52
52
|
|
|
@@ -70,7 +70,7 @@ export function useLink({ container, callbacks }: UseLinkOptions): UseLink {
|
|
|
70
70
|
const isExternal = isExternalUrl(href)
|
|
71
71
|
const isCallback = isCallbackUrl(href)
|
|
72
72
|
|
|
73
|
-
subscribers.forEach(sub => sub({
|
|
73
|
+
subscribers.forEach((sub) => sub({
|
|
74
74
|
event,
|
|
75
75
|
target,
|
|
76
76
|
isExternal,
|
package/lib/composables/Table.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MaybeRef } from '@vueuse/core'
|
|
2
|
-
import { reactive } from 'vue'
|
|
2
|
+
import { Component, reactive } from 'vue'
|
|
3
3
|
import { DropdownSection } from './Dropdown'
|
|
4
4
|
|
|
5
5
|
export interface Table {
|
|
@@ -34,8 +34,9 @@ export type TableCell =
|
|
|
34
34
|
| TableCellPill
|
|
35
35
|
| TableCellAvatar
|
|
36
36
|
| TableCellAvatars
|
|
37
|
+
| TableCellComponent
|
|
37
38
|
|
|
38
|
-
export type TableCellType = 'text' | 'day' | 'pill' | 'avatar' | 'avatars'
|
|
39
|
+
export type TableCellType = 'text' | 'day' | 'pill' | 'avatar' | 'avatars' | 'component'
|
|
39
40
|
|
|
40
41
|
export interface TableCellBase {
|
|
41
42
|
type: TableCellType
|
|
@@ -78,6 +79,12 @@ export interface TableCellAvatars extends TableCellBase {
|
|
|
78
79
|
color?: 'neutral' | 'soft' | 'mute'
|
|
79
80
|
}
|
|
80
81
|
|
|
82
|
+
export interface TableCellComponent extends TableCellBase {
|
|
83
|
+
type: 'component'
|
|
84
|
+
component: Component
|
|
85
|
+
props?: Record<string, any>
|
|
86
|
+
}
|
|
87
|
+
|
|
81
88
|
export interface TableCellAvatarsOption {
|
|
82
89
|
image?: string
|
|
83
90
|
name?: string
|
package/lib/stores/Snackbars.ts
CHANGED
package/lib/support/Time.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
type Awaited<T> = T extends undefined ? T : T extends PromiseLike<infer U> ? U : T
|
|
2
2
|
|
|
3
3
|
export function sleep(ms = 500): Promise<undefined> {
|
|
4
|
-
return new Promise<undefined>(resolve => setTimeout(resolve, ms))
|
|
4
|
+
return new Promise<undefined>((resolve) => setTimeout(resolve, ms))
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export function delay<T extends any[]>(
|
|
@@ -3,5 +3,5 @@ import { Ymd, YmdMap, YmdType } from './ymd'
|
|
|
3
3
|
export type { Ymd, YmdType, YmdMap }
|
|
4
4
|
|
|
5
5
|
export function requiredYmd(ymd: Ymd, required: YmdType[] = ['y', 'm', 'd']): boolean {
|
|
6
|
-
return required.every(r => ymd[YmdMap[r]] !== null)
|
|
6
|
+
return required.every((r) => ymd[YmdMap[r]] !== null)
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@globalbrain/sefirot",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"description": "Vue Components for Global Brain Design System.",
|
|
5
5
|
"author": "Kia Ishii <ka.ishii@globalbrains.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"vue-router": "^4.1.5"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@globalbrain/eslint-config": "^
|
|
46
|
+
"@globalbrain/eslint-config": "^1.0.0",
|
|
47
47
|
"@histoire/plugin-vue": "^0.10.7",
|
|
48
48
|
"@iconify-icons/ph": "^1.2.2",
|
|
49
49
|
"@iconify/vue": "^4.0.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"conventional-changelog-cli": "^2.2.2",
|
|
63
63
|
"dayjs": "^1.11.5",
|
|
64
64
|
"enquirer": "^2.3.6",
|
|
65
|
-
"eslint": "^8.
|
|
65
|
+
"eslint": "^8.27.0",
|
|
66
66
|
"execa": "^5.1.1",
|
|
67
67
|
"fuse.js": "^6.6.2",
|
|
68
68
|
"happy-dom": "^6.0.4",
|