@data-fair/lib-vuetify 1.10.1 → 1.11.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.js CHANGED
@@ -1,89 +1,91 @@
1
- import { fr, en } from 'vuetify/locale'
1
+ import { fr, en } from 'vuetify/locale';
2
2
  const baseColors = {
3
- primary: '#1E88E5', // blue.darken1
4
- secondary: '#42A5F5', // blue.lighten1,
5
- accent: '#FF9800', // orange.base
6
- error: '#FF5252', // red.accent2
7
- info: '#2196F3', // blue.base
8
- success: '#4CAF50', // green.base
9
- warning: '#E91E63', // pink.base
10
- admin: '#E53935' // red.darken1
11
- }
3
+ primary: '#1E88E5', // blue.darken1
4
+ secondary: '#42A5F5', // blue.lighten1,
5
+ accent: '#FF9800', // orange.base
6
+ error: '#FF5252', // red.accent2
7
+ info: '#2196F3', // blue.base
8
+ success: '#4CAF50', // green.base
9
+ warning: '#E91E63', // pink.base
10
+ admin: '#E53935' // red.darken1
11
+ };
12
12
  const baseDarkColors = {
13
- primary: '#2196F3', // blue.base
14
- success: '#00E676' // green.accent3
15
- }
16
- export function vuetifySessionOptions (session, cspNonce) {
17
- if (!session.site.value) { throw new Error('vuetifySessionOptions requires fething site info in session util') }
18
- const colors = { ...baseColors, ...session.site.value?.colors }
19
- return {
20
- ssr: false,
21
- locale: {
22
- locale: session.lang.value,
23
- messages: { fr, en }
24
- },
25
- theme: {
26
- cspNonce,
27
- defaultTheme: session.theme.value ?? 'default',
28
- themes: {
29
- [session.theme.value ?? 'default']: {
30
- dark: session.site.value?.dark,
31
- colors,
32
- variables: {
33
- // deactivate automatic partial transparencies
34
- // best to control colors precisely and ensure sufficient contrast for readability
35
- 'high-emphasis-opacity': 1,
36
- 'medium-emphasis-opacity': 0.87
37
- }
13
+ primary: '#2196F3', // blue.base
14
+ success: '#00E676' // green.accent3
15
+ };
16
+ export function vuetifySessionOptions(session, cspNonce) {
17
+ if (!session.site.value)
18
+ throw new Error('vuetifySessionOptions requires fething site info in session util');
19
+ const colors = { ...baseColors, ...session.site.value?.colors };
20
+ return {
21
+ ssr: false,
22
+ locale: {
23
+ locale: session.lang.value,
24
+ messages: { fr, en }
25
+ },
26
+ theme: {
27
+ cspNonce,
28
+ defaultTheme: session.theme.value ?? 'default',
29
+ themes: {
30
+ [session.theme.value ?? 'default']: {
31
+ dark: session.site.value?.dark,
32
+ colors,
33
+ variables: {
34
+ // deactivate automatic partial transparencies
35
+ // best to control colors precisely and ensure sufficient contrast for readability
36
+ 'high-emphasis-opacity': 1,
37
+ 'medium-emphasis-opacity': 0.87
38
+ }
39
+ }
40
+ }
41
+ },
42
+ defaults: {
43
+ VCard: {
44
+ // white card with light grey border by default
45
+ variant: 'flat',
46
+ border: 'sm'
47
+ }
38
48
  }
39
- }
40
- },
41
- defaults: {
42
- VCard: {
43
- // white card with light grey border by default
44
- variant: 'flat',
45
- border: 'sm'
46
- }
47
- }
48
- }
49
+ };
49
50
  }
50
51
  // TODO: deprecate this in favor of sessionVuetifyOptions
51
- export function defaultOptions (searchParams, darkCookie = false, locale = 'fr') {
52
- // console.warn('vuetify.defaultOptions is deprecated, use vuetifySessionOptions')
53
- const dark = searchParams?.dark ? searchParams.dark === 'true' : darkCookie
54
- const searchParamsColors = {}
55
- for (const colorCode of ['primary', 'secondary']) {
56
- if (searchParams?.[colorCode]) { searchParamsColors[colorCode] = searchParams[colorCode] }
57
- }
58
- const lightColors = { ...baseColors, ...searchParamsColors }
59
- const darkColors = { ...baseColors, ...baseDarkColors, ...searchParamsColors }
60
- const defaultTheme = dark ? 'dark' : 'light'
61
- return {
62
- ssr: false,
63
- locale: {
64
- locale,
65
- messages: { fr, en }
66
- },
67
- theme: {
68
- defaultTheme,
69
- themes: {
70
- light: {
71
- dark: false,
72
- colors: lightColors
52
+ export function defaultOptions(searchParams, darkCookie = false, locale = 'fr') {
53
+ // console.warn('vuetify.defaultOptions is deprecated, use vuetifySessionOptions')
54
+ const dark = searchParams?.dark ? searchParams.dark === 'true' : darkCookie;
55
+ const searchParamsColors = {};
56
+ for (const colorCode of ['primary', 'secondary']) {
57
+ if (searchParams?.[colorCode])
58
+ searchParamsColors[colorCode] = searchParams[colorCode];
59
+ }
60
+ const lightColors = { ...baseColors, ...searchParamsColors };
61
+ const darkColors = { ...baseColors, ...baseDarkColors, ...searchParamsColors };
62
+ const defaultTheme = dark ? 'dark' : 'light';
63
+ return {
64
+ ssr: false,
65
+ locale: {
66
+ locale,
67
+ messages: { fr, en }
73
68
  },
74
- dark: {
75
- dark: true,
76
- colors: darkColors
69
+ theme: {
70
+ defaultTheme,
71
+ themes: {
72
+ light: {
73
+ dark: false,
74
+ colors: lightColors
75
+ },
76
+ dark: {
77
+ dark: true,
78
+ colors: darkColors
79
+ }
80
+ }
81
+ },
82
+ defaults: {
83
+ VCard: {
84
+ // grey outlined card by default
85
+ variant: 'outlined',
86
+ style: 'border-color: rgba(var(--v-theme-on-surface), var(--v-focus-opacity)) !important;'
87
+ }
77
88
  }
78
- }
79
- },
80
- defaults: {
81
- VCard: {
82
- // grey outlined card by default
83
- variant: 'outlined',
84
- style: 'border-color: rgba(var(--v-theme-on-surface), var(--v-focus-opacity)) !important;'
85
- }
86
- }
87
- }
89
+ };
88
90
  }
89
- // # sourceMappingURL=index.js.map
91
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,49 @@
1
+ <template>
2
+ <v-navigation-drawer
3
+ v-if="display.lgAndUp.value"
4
+ class="navigation-right-drawer pl-2"
5
+ location="right"
6
+ permanent
7
+ floating
8
+ position="fixed"
9
+ color="surface"
10
+ style="padding-top: 60px; background-color: transparent;"
11
+ >
12
+ <slot />
13
+ </v-navigation-drawer>
14
+ <div
15
+ v-else
16
+ class="navigation-right-button mt-4"
17
+ >
18
+ <v-menu
19
+ location="bottom left"
20
+ :close-on-content-click="false"
21
+ >
22
+ <template #activator="{ props }">
23
+ <v-btn
24
+ v-bind="props"
25
+ size="small"
26
+ color="primary"
27
+ :icon="mdiDotsVertical"
28
+ />
29
+ </template>
30
+ <slot />
31
+ </v-menu>
32
+ </div>
33
+ </template>
34
+
35
+ <script setup lang="ts">
36
+ import { mdiDotsVertical } from '@mdi/js'
37
+ import { useDisplay } from 'vuetify'
38
+
39
+ const display = useDisplay()
40
+
41
+ </script>
42
+
43
+ <style>
44
+ .navigation-right-button {
45
+ z-index: 1000;
46
+ position: fixed;
47
+ right: 20px;
48
+ }
49
+ </style>
@@ -0,0 +1,17 @@
1
+ declare function __VLS_template(): {
2
+ slots: {
3
+ default?(_: {}): any;
4
+ default?(_: {}): any;
5
+ };
6
+ refs: {};
7
+ attrs: Partial<{}>;
8
+ };
9
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
10
+ declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
11
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
12
+ export default _default;
13
+ type __VLS_WithTemplateSlots<T, S> = T & {
14
+ new (): {
15
+ $slots: S;
16
+ };
17
+ };
@@ -0,0 +1,86 @@
1
+ /// <reference types=".vue-global-types/vue_3.5_false.d.ts" />
2
+ import { mdiDotsVertical } from '@mdi/js';
3
+ import { useDisplay } from 'vuetify';
4
+ const { defineProps, defineSlots, defineEmits, defineExpose, defineModel, defineOptions, withDefaults, } = await import('vue');
5
+ const display = useDisplay();
6
+ const __VLS_fnComponent = (await import('vue')).defineComponent({});
7
+ ;
8
+ let __VLS_functionalComponentProps;
9
+ function __VLS_template() {
10
+ const __VLS_ctx = {};
11
+ const __VLS_localComponents = {
12
+ ...{},
13
+ ...{},
14
+ ...__VLS_ctx,
15
+ };
16
+ let __VLS_components;
17
+ const __VLS_localDirectives = {
18
+ ...{},
19
+ ...__VLS_ctx,
20
+ };
21
+ let __VLS_directives;
22
+ let __VLS_styleScopedClasses;
23
+ // CSS variable injection
24
+ // CSS variable injection end
25
+ let __VLS_resolvedLocalAndGlobalComponents;
26
+ if (__VLS_ctx.display.lgAndUp.value) {
27
+ const __VLS_0 = __VLS_resolvedLocalAndGlobalComponents.VNavigationDrawer;
28
+ /** @type { [typeof __VLS_components.VNavigationDrawer, typeof __VLS_components.vNavigationDrawer, typeof __VLS_components.VNavigationDrawer, typeof __VLS_components.vNavigationDrawer, ] } */
29
+ // @ts-ignore
30
+ const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({ ...{ class: ("navigation-right-drawer pl-2") }, location: ("right"), permanent: (true), floating: (true), position: ("fixed"), color: ("surface"), ...{ style: ({}) }, }));
31
+ const __VLS_2 = __VLS_1({ ...{ class: ("navigation-right-drawer pl-2") }, location: ("right"), permanent: (true), floating: (true), position: ("fixed"), color: ("surface"), ...{ style: ({}) }, }, ...__VLS_functionalComponentArgsRest(__VLS_1));
32
+ var __VLS_6 = {};
33
+ __VLS_nonNullable(__VLS_5.slots).default;
34
+ const __VLS_5 = __VLS_pickFunctionalComponentCtx(__VLS_0, __VLS_2);
35
+ }
36
+ else {
37
+ __VLS_elementAsFunction(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({ ...{ class: ("navigation-right-button mt-4") }, });
38
+ const __VLS_7 = __VLS_resolvedLocalAndGlobalComponents.VMenu;
39
+ /** @type { [typeof __VLS_components.VMenu, typeof __VLS_components.vMenu, typeof __VLS_components.VMenu, typeof __VLS_components.vMenu, ] } */
40
+ // @ts-ignore
41
+ const __VLS_8 = __VLS_asFunctionalComponent(__VLS_7, new __VLS_7({ location: ("bottom left"), closeOnContentClick: ((false)), }));
42
+ const __VLS_9 = __VLS_8({ location: ("bottom left"), closeOnContentClick: ((false)), }, ...__VLS_functionalComponentArgsRest(__VLS_8));
43
+ __VLS_elementAsFunction(__VLS_intrinsicElements.template, __VLS_intrinsicElements.template)({});
44
+ {
45
+ const { activator: __VLS_thisSlot } = __VLS_nonNullable(__VLS_12.slots);
46
+ const [{ props }] = __VLS_getSlotParams(__VLS_thisSlot);
47
+ const __VLS_13 = __VLS_resolvedLocalAndGlobalComponents.VBtn;
48
+ /** @type { [typeof __VLS_components.VBtn, typeof __VLS_components.vBtn, ] } */
49
+ // @ts-ignore
50
+ const __VLS_14 = __VLS_asFunctionalComponent(__VLS_13, new __VLS_13({ ...(props), size: ("small"), color: ("primary"), icon: ((__VLS_ctx.mdiDotsVertical)), }));
51
+ const __VLS_15 = __VLS_14({ ...(props), size: ("small"), color: ("primary"), icon: ((__VLS_ctx.mdiDotsVertical)), }, ...__VLS_functionalComponentArgsRest(__VLS_14));
52
+ }
53
+ var __VLS_19 = {};
54
+ const __VLS_12 = __VLS_pickFunctionalComponentCtx(__VLS_7, __VLS_9);
55
+ }
56
+ __VLS_styleScopedClasses['navigation-right-drawer'];
57
+ __VLS_styleScopedClasses['pl-2'];
58
+ __VLS_styleScopedClasses['navigation-right-button'];
59
+ __VLS_styleScopedClasses['mt-4'];
60
+ var __VLS_slots;
61
+ var __VLS_inheritedAttrs;
62
+ const __VLS_refs = {};
63
+ var $refs;
64
+ return {
65
+ slots: __VLS_slots,
66
+ refs: $refs,
67
+ attrs: {},
68
+ };
69
+ }
70
+ ;
71
+ const __VLS_self = (await import('vue')).defineComponent({
72
+ setup() {
73
+ return {
74
+ mdiDotsVertical: mdiDotsVertical,
75
+ display: display,
76
+ };
77
+ },
78
+ });
79
+ const __VLS_component = (await import('vue')).defineComponent({
80
+ setup() {
81
+ return {};
82
+ },
83
+ });
84
+ export default {};
85
+ ;
86
+ //# sourceMappingURL=navigation-right.vue.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@data-fair/lib-vuetify",
3
- "version": "1.10.1",
3
+ "version": "1.11.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": [
package/vite.d.ts CHANGED
@@ -7,9 +7,20 @@ export declare const autoImports: (string | {
7
7
  '@data-fair/lib-vue/fetch.js': string[];
8
8
  '@data-fair/lib-vue/ws.js': string[];
9
9
  '@data-fair/lib-vue/async-action.js': string[];
10
+ '@data-fair/lib-vue/deep-diff.js': string[];
10
11
  } | {
12
+ '@data-fair/lib-vuetify/date-match-filter.vue': string[][];
13
+ '@data-fair/lib-vuetify/date-range-picker.vue': string[][];
14
+ '@data-fair/lib-vuetify/lang-switcher.vue': string[][];
15
+ '@data-fair/lib-vuetify/navigation-right.vue': string[][];
16
+ '@data-fair/lib-vuetify/owner-avatar.vue': string[][];
17
+ '@data-fair/lib-vuetify/owner-pick.vue': string[][];
11
18
  '@data-fair/lib-vuetify/personal-menu.vue': string[][];
19
+ '@data-fair/lib-vuetify/search-address.vue': string[][];
20
+ '@data-fair/lib-vuetify/theme-switcher.vue': string[][];
12
21
  '@data-fair/lib-vuetify/tutorial-alert.vue': string[][];
13
- '@data-fair/lib-vuetify/user-avatar.vue': string[][];
22
+ '@data-fair/lib-vuetify/ui-notif-alert.vue': string[][];
23
+ '@data-fair/lib-vuetify/ui-notif.vue': string[][];
24
+ '@data-fair/lib-vuetify/ui-user-avatar.vue': string[][];
14
25
  })[];
15
26
  export declare const settingsPath: string;
package/vite.js CHANGED
@@ -1,12 +1,22 @@
1
1
  // made for https://github.com/unplugin/unplugin-auto-import
2
- import { autoImports as vueAutoImports } from '@data-fair/lib-vue/vite.js'
2
+ import { autoImports as vueAutoImports } from '@data-fair/lib-vue/vite.js';
3
3
  export const autoImports = [
4
- ...vueAutoImports,
5
- {
6
- '@data-fair/lib-vuetify/personal-menu.vue': [['default', 'dfPersonalMenu']],
7
- '@data-fair/lib-vuetify/tutorial-alert.vue': [['default', 'dfTutorialAlert']],
8
- '@data-fair/lib-vuetify/user-avatar.vue': [['default', 'dfUserAvatar']]
9
- }
10
- ]
11
- export const settingsPath = new URL(import.meta.resolve('@data-fair/lib-vuetify/style/settings.scss')).pathname
12
- // # sourceMappingURL=vite.js.map
4
+ ...vueAutoImports,
5
+ {
6
+ '@data-fair/lib-vuetify/date-match-filter.vue': [['default', 'dfDateMatchFilter']],
7
+ '@data-fair/lib-vuetify/date-range-picker.vue': [['default', 'dfDateRangePicker']],
8
+ '@data-fair/lib-vuetify/lang-switcher.vue': [['default', 'dfLangSwitcher']],
9
+ '@data-fair/lib-vuetify/navigation-right.vue': [['default', 'dfNavigationRight']],
10
+ '@data-fair/lib-vuetify/owner-avatar.vue': [['default', 'dfOwnerAvatar']],
11
+ '@data-fair/lib-vuetify/owner-pick.vue': [['default', 'dfOwnerPick']],
12
+ '@data-fair/lib-vuetify/personal-menu.vue': [['default', 'dfPersonalMenu']],
13
+ '@data-fair/lib-vuetify/search-address.vue': [['default', 'dfSearchAddress']],
14
+ '@data-fair/lib-vuetify/theme-switcher.vue': [['default', 'dfThemeSwitcher']],
15
+ '@data-fair/lib-vuetify/tutorial-alert.vue': [['default', 'dfTutorialAlert']],
16
+ '@data-fair/lib-vuetify/ui-notif-alert.vue': [['default', 'dfUiNotifAlert']],
17
+ '@data-fair/lib-vuetify/ui-notif.vue': [['default', 'dfUiNotif']],
18
+ '@data-fair/lib-vuetify/ui-user-avatar.vue': [['default', 'dfUserAvatar']]
19
+ }
20
+ ];
21
+ export const settingsPath = new URL(import.meta.resolve('@data-fair/lib-vuetify/style/settings.scss')).pathname;
22
+ //# sourceMappingURL=vite.js.map