@globalbrain/sefirot 2.5.1 → 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.
|
@@ -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/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/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",
|
|
@@ -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",
|
|
@@ -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"
|