@globalbrain/sefirot 3.22.0 → 3.23.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/STableCellAvatar.vue +5 -3
- package/lib/composables/Api.ts +1 -1
- package/lib/http/Http.ts +30 -6
- package/package.json +11 -11
|
@@ -38,10 +38,12 @@ function resolve(
|
|
|
38
38
|
:role="onClick ? 'button' : null"
|
|
39
39
|
@click="() => onClick?.(value, record)"
|
|
40
40
|
>
|
|
41
|
-
<div v-if="_image" class="avatar">
|
|
41
|
+
<div v-if="_image || _name" class="avatar">
|
|
42
42
|
<SAvatar size="mini" :avatar="_image" :name="_name" />
|
|
43
43
|
</div>
|
|
44
|
-
<span v-if="_name" class="name">
|
|
44
|
+
<span v-if="_name" class="name">
|
|
45
|
+
{{ _name }}
|
|
46
|
+
</span>
|
|
45
47
|
</SLink>
|
|
46
48
|
</div>
|
|
47
49
|
</template>
|
|
@@ -62,7 +64,7 @@ function resolve(
|
|
|
62
64
|
|
|
63
65
|
.name {
|
|
64
66
|
display: inline-block;
|
|
65
|
-
margin-left:
|
|
67
|
+
margin-left: 8px;
|
|
66
68
|
line-height: 24px;
|
|
67
69
|
font-size: 14px;
|
|
68
70
|
font-weight: 400;
|
package/lib/composables/Api.ts
CHANGED
package/lib/http/Http.ts
CHANGED
|
@@ -1,12 +1,36 @@
|
|
|
1
1
|
import { parse as parseContentDisposition } from '@tinyhttp/content-disposition'
|
|
2
2
|
import { parse as parseCookie } from '@tinyhttp/cookie'
|
|
3
3
|
import FileSaver from 'file-saver'
|
|
4
|
-
import {
|
|
4
|
+
import { type FetchOptions, type FetchRequest, type FetchResponse, ofetch } from 'ofetch'
|
|
5
5
|
import { stringify } from 'qs'
|
|
6
6
|
|
|
7
|
+
export interface HttpClient {
|
|
8
|
+
<T = any>(request: FetchRequest, options?: Omit<FetchOptions, 'method'>): Promise<T>
|
|
9
|
+
raw<T = any>(request: FetchRequest, options?: Omit<FetchOptions, 'method'>): Promise<FetchResponse<T>>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface HttpOptions {
|
|
13
|
+
baseUrl?: string
|
|
14
|
+
xsrfUrl?: string | false
|
|
15
|
+
client?: HttpClient
|
|
16
|
+
}
|
|
17
|
+
|
|
7
18
|
export class Http {
|
|
8
|
-
static
|
|
9
|
-
static xsrfUrl: string | false = '/api/csrf-cookie'
|
|
19
|
+
private static baseUrl: string | undefined = undefined
|
|
20
|
+
private static xsrfUrl: string | false = '/api/csrf-cookie'
|
|
21
|
+
private static client: HttpClient = ofetch
|
|
22
|
+
|
|
23
|
+
static config(options: HttpOptions) {
|
|
24
|
+
if (options.baseUrl) {
|
|
25
|
+
Http.baseUrl = options.baseUrl
|
|
26
|
+
}
|
|
27
|
+
if (options.xsrfUrl !== undefined) {
|
|
28
|
+
Http.xsrfUrl = options.xsrfUrl
|
|
29
|
+
}
|
|
30
|
+
if (options.client) {
|
|
31
|
+
Http.client = options.client
|
|
32
|
+
}
|
|
33
|
+
}
|
|
10
34
|
|
|
11
35
|
private async ensureXsrfToken(): Promise<string | undefined> {
|
|
12
36
|
if (!Http.xsrfUrl) {
|
|
@@ -40,7 +64,7 @@ export class Http {
|
|
|
40
64
|
return [
|
|
41
65
|
`${url}${queryString ? `?${queryString}` : ''}`,
|
|
42
66
|
{
|
|
43
|
-
baseURL: Http.
|
|
67
|
+
baseURL: Http.baseUrl,
|
|
44
68
|
method,
|
|
45
69
|
credentials: 'include',
|
|
46
70
|
...options,
|
|
@@ -54,11 +78,11 @@ export class Http {
|
|
|
54
78
|
}
|
|
55
79
|
|
|
56
80
|
private async performRequest<T>(url: string, options: FetchOptions = {}) {
|
|
57
|
-
return
|
|
81
|
+
return Http.client<T>(...(await this.buildRequest(url, options)))
|
|
58
82
|
}
|
|
59
83
|
|
|
60
84
|
private async performRequestRaw<T>(url: string, options: FetchOptions = {}) {
|
|
61
|
-
return
|
|
85
|
+
return Http.client.raw<T>(...(await this.buildRequest(url, options)))
|
|
62
86
|
}
|
|
63
87
|
|
|
64
88
|
async get<T = any>(url: string, options?: FetchOptions): Promise<T> {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@globalbrain/sefirot",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"packageManager": "pnpm@8.14.
|
|
3
|
+
"version": "3.23.0",
|
|
4
|
+
"packageManager": "pnpm@8.14.1",
|
|
5
5
|
"description": "Vue Components for Global Brain Design System.",
|
|
6
6
|
"author": "Kia Ishii <ka.ishii@globalbrains.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"postcss": "^8.4.33",
|
|
57
57
|
"postcss-nested": "^6.0.1",
|
|
58
58
|
"v-calendar": "^3.1.2",
|
|
59
|
-
"vue": "^3.4.
|
|
59
|
+
"vue": "^3.4.10",
|
|
60
60
|
"vue-router": "^4.2.5"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
@@ -80,9 +80,9 @@
|
|
|
80
80
|
"@types/body-scroll-lock": "^3.1.2",
|
|
81
81
|
"@types/lodash-es": "^4.17.12",
|
|
82
82
|
"@types/markdown-it": "^13.0.7",
|
|
83
|
-
"@types/node": "^20.
|
|
84
|
-
"@vitejs/plugin-vue": "^5.0.
|
|
85
|
-
"@vitest/coverage-v8": "^1.1.
|
|
83
|
+
"@types/node": "^20.11.0",
|
|
84
|
+
"@vitejs/plugin-vue": "^5.0.3",
|
|
85
|
+
"@vitest/coverage-v8": "^1.1.3",
|
|
86
86
|
"@vue/test-utils": "^2.4.3",
|
|
87
87
|
"@vuelidate/core": "^2.0.3",
|
|
88
88
|
"@vuelidate/validators": "^2.0.4",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"body-scroll-lock": "4.0.0-beta.0",
|
|
91
91
|
"eslint": "^8.56.0",
|
|
92
92
|
"fuse.js": "^7.0.0",
|
|
93
|
-
"happy-dom": "^
|
|
93
|
+
"happy-dom": "^13.0.2",
|
|
94
94
|
"histoire": "^0.17.6",
|
|
95
95
|
"lodash-es": "^4.17.21",
|
|
96
96
|
"markdown-it": "^14.0.0",
|
|
@@ -102,10 +102,10 @@
|
|
|
102
102
|
"release-it": "^17.0.1",
|
|
103
103
|
"typescript": "~5.3.3",
|
|
104
104
|
"v-calendar": "^3.1.2",
|
|
105
|
-
"vite": "^5.0.
|
|
106
|
-
"vitepress": "1.0.0-rc.
|
|
107
|
-
"vitest": "^1.1.
|
|
108
|
-
"vue": "^3.4.
|
|
105
|
+
"vite": "^5.0.11",
|
|
106
|
+
"vitepress": "1.0.0-rc.36",
|
|
107
|
+
"vitest": "^1.1.3",
|
|
108
|
+
"vue": "^3.4.10",
|
|
109
109
|
"vue-router": "^4.2.5",
|
|
110
110
|
"vue-tsc": "^1.8.27"
|
|
111
111
|
}
|