@globalbrain/sefirot 2.5.0 → 2.6.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/SDropdownSectionFilter.vue +2 -2
- package/lib/components/SDropdownSectionFilterItemText.vue +3 -0
- 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/STableFooter.vue +3 -3
- package/lib/components/STableHeader.vue +1 -1
- package/lib/composables/Data.ts +8 -5
- package/lib/composables/Grid.ts +1 -1
- package/lib/composables/Markdown.ts +1 -1
- package/lib/composables/Table.ts +8 -8
- 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 +6 -6
|
@@ -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(() => {
|
|
@@ -144,7 +144,7 @@ function handleClick(option: DropdownSectionFilterOption, value: string | number
|
|
|
144
144
|
|
|
145
145
|
.checkbox {
|
|
146
146
|
display: block;
|
|
147
|
-
padding-top:
|
|
147
|
+
padding-top: 8px;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
.checkbox-box {
|
|
@@ -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)
|
|
@@ -6,9 +6,9 @@ import { format } from '../support/Num'
|
|
|
6
6
|
import SIcon from './SIcon.vue'
|
|
7
7
|
|
|
8
8
|
const props = defineProps<{
|
|
9
|
-
total?: number
|
|
10
|
-
page?: number
|
|
11
|
-
perPage?: number
|
|
9
|
+
total?: number | null
|
|
10
|
+
page?: number | null
|
|
11
|
+
perPage?: number | null
|
|
12
12
|
borderless?: boolean
|
|
13
13
|
onPrev?(): void
|
|
14
14
|
onNext?(): void
|
package/lib/composables/Data.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { watchOnce } from '@vueuse/core'
|
|
2
2
|
import cloneDeep from 'lodash-es/cloneDeep'
|
|
3
3
|
import { WatchSource, reactive } from 'vue'
|
|
4
|
-
import { isObject } from '../support/Utils'
|
|
4
|
+
import { isNullish, isObject } from '../support/Utils'
|
|
5
5
|
|
|
6
6
|
export interface Data<T extends Record<string, any>> {
|
|
7
7
|
state: T
|
|
@@ -25,7 +25,7 @@ export interface UseDataInputUtils {
|
|
|
25
25
|
def<T>(
|
|
26
26
|
value: any,
|
|
27
27
|
source: WatchSource<T>,
|
|
28
|
-
cb: (value: Exclude<T, undefined>) => void
|
|
28
|
+
cb: (value: Exclude<T, null | undefined>) => void
|
|
29
29
|
): Def<T>
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -81,11 +81,14 @@ function createState<T extends Record<string, any>>(
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
function handleDefs<T extends Record<string, any>>(
|
|
84
|
-
defs: [string, Def][],
|
|
84
|
+
defs: [string, Def][],
|
|
85
|
+
state: T
|
|
85
86
|
): void {
|
|
86
87
|
defs.forEach(([key, def]) => {
|
|
87
88
|
watchOnce(def.source, (value: any) => {
|
|
88
|
-
|
|
89
|
+
if (!isNullish(value)) {
|
|
90
|
+
(state as any)[key] = def.cb(value)
|
|
91
|
+
}
|
|
89
92
|
})
|
|
90
93
|
})
|
|
91
94
|
}
|
|
@@ -93,7 +96,7 @@ function handleDefs<T extends Record<string, any>>(
|
|
|
93
96
|
function def<T>(
|
|
94
97
|
value: any,
|
|
95
98
|
source: WatchSource<T>,
|
|
96
|
-
cb: (value: Exclude<T, undefined>) => void
|
|
99
|
+
cb: (value: Exclude<T, null | undefined>) => void
|
|
97
100
|
): Def {
|
|
98
101
|
return {
|
|
99
102
|
__isDef: true,
|
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
|
@@ -5,10 +5,10 @@ import { DropdownSection } from './Dropdown'
|
|
|
5
5
|
export interface Table {
|
|
6
6
|
orders: string[]
|
|
7
7
|
columns: TableColumns
|
|
8
|
-
records?: Record<string, any>[]
|
|
9
|
-
total?: number
|
|
10
|
-
page?: number
|
|
11
|
-
perPage?: number
|
|
8
|
+
records?: Record<string, any>[] | null
|
|
9
|
+
total?: number | null
|
|
10
|
+
page?: number | null
|
|
11
|
+
perPage?: number | null
|
|
12
12
|
reset?: boolean
|
|
13
13
|
borderless?: boolean
|
|
14
14
|
loading?: boolean
|
|
@@ -93,10 +93,10 @@ export interface TableCellAvatarsOption {
|
|
|
93
93
|
export interface UseTableOptions {
|
|
94
94
|
orders: string[]
|
|
95
95
|
columns: TableColumns
|
|
96
|
-
records?: MaybeRef<Record<string, any>[] | undefined>
|
|
97
|
-
total?: MaybeRef<number | undefined>
|
|
98
|
-
page?: MaybeRef<number | undefined>
|
|
99
|
-
perPage?: MaybeRef<number | undefined>
|
|
96
|
+
records?: MaybeRef<Record<string, any>[] | null | undefined>
|
|
97
|
+
total?: MaybeRef<number | null | undefined>
|
|
98
|
+
page?: MaybeRef<number | null | undefined>
|
|
99
|
+
perPage?: MaybeRef<number | null | undefined>
|
|
100
100
|
reset?: MaybeRef<boolean | undefined>
|
|
101
101
|
borderless?: boolean
|
|
102
102
|
loading?: MaybeRef<boolean | undefined>
|
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.6.0",
|
|
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",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"@types/markdown-it": "^12.2.3",
|
|
53
53
|
"@types/node": "^18.8.0",
|
|
54
54
|
"@vitejs/plugin-vue": "^3.1.2",
|
|
55
|
-
"@vitest/coverage-c8": "^0.
|
|
56
|
-
"@vue/test-utils": "^2.1
|
|
55
|
+
"@vitest/coverage-c8": "^0.25.1",
|
|
56
|
+
"@vue/test-utils": "^2.2.1",
|
|
57
57
|
"@vuelidate/core": "^2.0.0",
|
|
58
58
|
"@vuelidate/validators": "^2.0.0",
|
|
59
59
|
"@vueuse/core": "^9.3.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",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"v-calendar": "3.0.0-alpha.8",
|
|
79
79
|
"vite": "^3.1.4",
|
|
80
80
|
"vitepress": "1.0.0-alpha.19",
|
|
81
|
-
"vitest": "^0.
|
|
81
|
+
"vitest": "^0.25.1",
|
|
82
82
|
"vue": "^3.2.40",
|
|
83
83
|
"vue-router": "^4.1.5",
|
|
84
84
|
"vue-tsc": "^1.0.8"
|