@data-fair/lib-vuetify 1.3.0 → 1.4.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/index.d.ts +240 -1
- package/index.js +29 -0
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1,2 +1,241 @@
|
|
|
1
|
+
import { type Session } from '@data-fair/lib-vue/session.js';
|
|
1
2
|
import { VuetifyOptions } from 'vuetify';
|
|
2
|
-
export declare function
|
|
3
|
+
export declare function vuetifySessionOptions(session: Session): {
|
|
4
|
+
ssr: boolean;
|
|
5
|
+
locale: {
|
|
6
|
+
locale: import("vue").ComputedRef<string>;
|
|
7
|
+
messages: {
|
|
8
|
+
fr: {
|
|
9
|
+
badge: string;
|
|
10
|
+
open: string;
|
|
11
|
+
close: string;
|
|
12
|
+
dismiss: string;
|
|
13
|
+
confirmEdit: {
|
|
14
|
+
ok: string;
|
|
15
|
+
cancel: string;
|
|
16
|
+
};
|
|
17
|
+
dataIterator: {
|
|
18
|
+
noResultsText: string;
|
|
19
|
+
loadingText: string;
|
|
20
|
+
};
|
|
21
|
+
dataTable: {
|
|
22
|
+
itemsPerPageText: string;
|
|
23
|
+
ariaLabel: {
|
|
24
|
+
sortDescending: string;
|
|
25
|
+
sortAscending: string;
|
|
26
|
+
sortNone: string;
|
|
27
|
+
activateNone: string;
|
|
28
|
+
activateDescending: string;
|
|
29
|
+
activateAscending: string;
|
|
30
|
+
};
|
|
31
|
+
sortBy: string;
|
|
32
|
+
};
|
|
33
|
+
dataFooter: {
|
|
34
|
+
itemsPerPageText: string;
|
|
35
|
+
itemsPerPageAll: string;
|
|
36
|
+
nextPage: string;
|
|
37
|
+
prevPage: string;
|
|
38
|
+
firstPage: string;
|
|
39
|
+
lastPage: string;
|
|
40
|
+
pageText: string;
|
|
41
|
+
};
|
|
42
|
+
dateRangeInput: {
|
|
43
|
+
divider: string;
|
|
44
|
+
};
|
|
45
|
+
datePicker: {
|
|
46
|
+
itemsSelected: string;
|
|
47
|
+
range: {
|
|
48
|
+
title: string;
|
|
49
|
+
header: string;
|
|
50
|
+
};
|
|
51
|
+
title: string;
|
|
52
|
+
header: string;
|
|
53
|
+
input: {
|
|
54
|
+
placeholder: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
noDataText: string;
|
|
58
|
+
carousel: {
|
|
59
|
+
prev: string;
|
|
60
|
+
next: string;
|
|
61
|
+
ariaLabel: {
|
|
62
|
+
delimiter: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
calendar: {
|
|
66
|
+
moreEvents: string;
|
|
67
|
+
today: string;
|
|
68
|
+
};
|
|
69
|
+
input: {
|
|
70
|
+
clear: string;
|
|
71
|
+
prependAction: string;
|
|
72
|
+
appendAction: string;
|
|
73
|
+
otp: string;
|
|
74
|
+
};
|
|
75
|
+
fileInput: {
|
|
76
|
+
counter: string;
|
|
77
|
+
counterSize: string;
|
|
78
|
+
};
|
|
79
|
+
timePicker: {
|
|
80
|
+
am: string;
|
|
81
|
+
pm: string;
|
|
82
|
+
title: string;
|
|
83
|
+
};
|
|
84
|
+
pagination: {
|
|
85
|
+
ariaLabel: {
|
|
86
|
+
root: string;
|
|
87
|
+
next: string;
|
|
88
|
+
previous: string;
|
|
89
|
+
page: string;
|
|
90
|
+
currentPage: string;
|
|
91
|
+
first: string;
|
|
92
|
+
last: string;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
stepper: {
|
|
96
|
+
next: string;
|
|
97
|
+
prev: string;
|
|
98
|
+
};
|
|
99
|
+
rating: {
|
|
100
|
+
ariaLabel: {
|
|
101
|
+
item: string;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
loading: string;
|
|
105
|
+
infiniteScroll: {
|
|
106
|
+
loadMore: string;
|
|
107
|
+
empty: string;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
en: {
|
|
111
|
+
badge: string;
|
|
112
|
+
open: string;
|
|
113
|
+
close: string;
|
|
114
|
+
dismiss: string;
|
|
115
|
+
confirmEdit: {
|
|
116
|
+
ok: string;
|
|
117
|
+
cancel: string;
|
|
118
|
+
};
|
|
119
|
+
dataIterator: {
|
|
120
|
+
noResultsText: string;
|
|
121
|
+
loadingText: string;
|
|
122
|
+
};
|
|
123
|
+
dataTable: {
|
|
124
|
+
itemsPerPageText: string;
|
|
125
|
+
ariaLabel: {
|
|
126
|
+
sortDescending: string;
|
|
127
|
+
sortAscending: string;
|
|
128
|
+
sortNone: string;
|
|
129
|
+
activateNone: string;
|
|
130
|
+
activateDescending: string;
|
|
131
|
+
activateAscending: string;
|
|
132
|
+
};
|
|
133
|
+
sortBy: string;
|
|
134
|
+
};
|
|
135
|
+
dataFooter: {
|
|
136
|
+
itemsPerPageText: string;
|
|
137
|
+
itemsPerPageAll: string;
|
|
138
|
+
nextPage: string;
|
|
139
|
+
prevPage: string;
|
|
140
|
+
firstPage: string;
|
|
141
|
+
lastPage: string;
|
|
142
|
+
pageText: string;
|
|
143
|
+
};
|
|
144
|
+
dateRangeInput: {
|
|
145
|
+
divider: string;
|
|
146
|
+
};
|
|
147
|
+
datePicker: {
|
|
148
|
+
itemsSelected: string;
|
|
149
|
+
range: {
|
|
150
|
+
title: string;
|
|
151
|
+
header: string;
|
|
152
|
+
};
|
|
153
|
+
title: string;
|
|
154
|
+
header: string;
|
|
155
|
+
input: {
|
|
156
|
+
placeholder: string;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
noDataText: string;
|
|
160
|
+
carousel: {
|
|
161
|
+
prev: string;
|
|
162
|
+
next: string;
|
|
163
|
+
ariaLabel: {
|
|
164
|
+
delimiter: string;
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
calendar: {
|
|
168
|
+
moreEvents: string;
|
|
169
|
+
today: string;
|
|
170
|
+
};
|
|
171
|
+
input: {
|
|
172
|
+
clear: string;
|
|
173
|
+
prependAction: string;
|
|
174
|
+
appendAction: string;
|
|
175
|
+
otp: string;
|
|
176
|
+
};
|
|
177
|
+
fileInput: {
|
|
178
|
+
counter: string;
|
|
179
|
+
counterSize: string;
|
|
180
|
+
};
|
|
181
|
+
timePicker: {
|
|
182
|
+
am: string;
|
|
183
|
+
pm: string;
|
|
184
|
+
title: string;
|
|
185
|
+
};
|
|
186
|
+
pagination: {
|
|
187
|
+
ariaLabel: {
|
|
188
|
+
root: string;
|
|
189
|
+
next: string;
|
|
190
|
+
previous: string;
|
|
191
|
+
page: string;
|
|
192
|
+
currentPage: string;
|
|
193
|
+
first: string;
|
|
194
|
+
last: string;
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
stepper: {
|
|
198
|
+
next: string;
|
|
199
|
+
prev: string;
|
|
200
|
+
};
|
|
201
|
+
rating: {
|
|
202
|
+
ariaLabel: {
|
|
203
|
+
item: string;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
loading: string;
|
|
207
|
+
infiniteScroll: {
|
|
208
|
+
loadMore: string;
|
|
209
|
+
empty: string;
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
theme: {
|
|
215
|
+
defaultTheme: string;
|
|
216
|
+
themes: {
|
|
217
|
+
light: {
|
|
218
|
+
dark: boolean;
|
|
219
|
+
colors: {
|
|
220
|
+
background?: string | undefined;
|
|
221
|
+
surface?: string | undefined;
|
|
222
|
+
primary: string;
|
|
223
|
+
secondary: string;
|
|
224
|
+
accent: string;
|
|
225
|
+
error: string;
|
|
226
|
+
info: string;
|
|
227
|
+
success: string;
|
|
228
|
+
warning: string;
|
|
229
|
+
admin: string;
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
defaults: {
|
|
235
|
+
VCard: {
|
|
236
|
+
variant: string;
|
|
237
|
+
style: string;
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
export declare function defaultOptions(searchParams: Record<string, string>, darkCookie?: boolean, locale?: string): VuetifyOptions;
|
package/index.js
CHANGED
|
@@ -13,7 +13,36 @@ const baseDarkColors = {
|
|
|
13
13
|
primary: '#2196F3', // blue.base
|
|
14
14
|
success: '#00E676' // green.accent3
|
|
15
15
|
}
|
|
16
|
+
export function vuetifySessionOptions (session) {
|
|
17
|
+
const colors = { ...baseColors, ...session.site.value?.colors }
|
|
18
|
+
return {
|
|
19
|
+
ssr: false,
|
|
20
|
+
locale: {
|
|
21
|
+
locale: session.lang,
|
|
22
|
+
messages: { fr, en }
|
|
23
|
+
},
|
|
24
|
+
theme: {
|
|
25
|
+
defaultTheme: 'light',
|
|
26
|
+
themes: {
|
|
27
|
+
light: {
|
|
28
|
+
dark: false,
|
|
29
|
+
colors
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
defaults: {
|
|
34
|
+
VCard: {
|
|
35
|
+
// grey outlined card by default
|
|
36
|
+
variant: 'outlined',
|
|
37
|
+
// TODO: replace this with a cleaner border-opacity prop https://vuetifyjs.com/en/styles/borders/#theme-colors ?
|
|
38
|
+
style: 'border-color: rgba(var(--v-theme-on-surface), var(--v-focus-opacity)) !important;'
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// TODO: deprecate this in favor of sessionVuetifyOptions
|
|
16
44
|
export function defaultOptions (searchParams, darkCookie = false, locale = 'fr') {
|
|
45
|
+
console.warn('vuetify.defaultOptions is deprecated, use sessionVuetifyOptions')
|
|
17
46
|
const dark = searchParams?.dark ? searchParams.dark === 'true' : darkCookie
|
|
18
47
|
const searchParamsColors = {}
|
|
19
48
|
for (const colorCode of ['primary', 'secondary']) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@data-fair/lib-vuetify",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Components based on the Vuetify 3 UI lib for the data-fair stack.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"build": "cd .. && npm run build"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@data-fair/lib-vue": "^1.
|
|
19
|
+
"@data-fair/lib-vue": "^1.9.0",
|
|
20
20
|
"ofetch": "1",
|
|
21
21
|
"vue-i18n": "10",
|
|
22
22
|
"vuetify": "3"
|