@aerogel/core 0.1.1-next.38e999a09609d7c9cfa836fe396028ab230f6c89 → 0.1.1-next.47ee6e5e3485291a8763a804016f87a051476893
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/dist/aerogel-core.d.ts +14 -7
- package/dist/aerogel-core.js +459 -440
- package/dist/aerogel-core.js.map +1 -1
- package/package.json +1 -1
- package/src/components/AppLayout.vue +1 -1
- package/src/components/contracts/Modal.ts +1 -1
- package/src/components/ui/Details.vue +19 -6
- package/src/components/ui/Modal.vue +2 -2
- package/src/components/ui/SettingsModal.vue +1 -1
- package/src/index.css +1 -0
- package/src/services/App.state.ts +1 -0
- package/src/services/App.ts +4 -0
- package/src/services/index.ts +5 -0
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="flex min-h-full flex-col text-base leading-tight font-normal
|
|
2
|
+
<div class="text-primary-text flex min-h-full flex-col text-base leading-tight font-normal antialiased">
|
|
3
3
|
<slot v-if="$errors.hasStartupErrors" name="startup-crash">
|
|
4
4
|
<component :is="$ui.requireComponent('startup-crash')" />
|
|
5
5
|
</slot>
|
|
@@ -6,7 +6,7 @@ export type ModalContentInstance = Nullable<InstanceType<typeof DialogContent>>;
|
|
|
6
6
|
export interface ModalProps {
|
|
7
7
|
persistent?: boolean;
|
|
8
8
|
fullscreen?: boolean;
|
|
9
|
-
|
|
9
|
+
fullscreenOnMobile?: boolean;
|
|
10
10
|
title?: string;
|
|
11
11
|
titleHidden?: boolean;
|
|
12
12
|
description?: string;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<details class="group">
|
|
3
|
-
<summary
|
|
4
|
-
class="-ml-2 flex w-[max-content] items-center rounded-lg py-2 pr-3 pl-1 hover:bg-gray-100 focus-visible:outline focus-visible:outline-gray-700"
|
|
5
|
-
>
|
|
3
|
+
<summary :class="renderedSummaryClasses">
|
|
6
4
|
<IconCheveronRight class="size-6 transition-transform group-open:rotate-90" />
|
|
7
|
-
<
|
|
5
|
+
<slot name="label">
|
|
6
|
+
<span>{{ label ?? $td('ui.details', 'Details') }}</span>
|
|
7
|
+
</slot>
|
|
8
8
|
</summary>
|
|
9
9
|
|
|
10
|
-
<div class="
|
|
10
|
+
<div :class="renderedContentClasses">
|
|
11
11
|
<slot />
|
|
12
12
|
</div>
|
|
13
13
|
</details>
|
|
@@ -15,6 +15,19 @@
|
|
|
15
15
|
|
|
16
16
|
<script setup lang="ts">
|
|
17
17
|
import IconCheveronRight from '~icons/zondicons/cheveron-right';
|
|
18
|
+
import { classes } from '@aerogel/core/utils';
|
|
19
|
+
import { type HTMLAttributes, computed } from 'vue';
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
const {
|
|
22
|
+
label = undefined,
|
|
23
|
+
contentClass,
|
|
24
|
+
summaryClass,
|
|
25
|
+
} = defineProps<{ label?: string; contentClass?: HTMLAttributes['class']; summaryClass?: HTMLAttributes['class'] }>();
|
|
26
|
+
const renderedContentClasses = computed(() => classes('pt-2 pl-4', contentClass));
|
|
27
|
+
const renderedSummaryClasses = computed(() =>
|
|
28
|
+
classes(
|
|
29
|
+
'-ml-2 flex w-[max-content] items-center rounded-lg py-2 pr-3 pl-1',
|
|
30
|
+
'hover:bg-gray-100 focus-visible:outline focus-visible:outline-gray-700',
|
|
31
|
+
summaryClass,
|
|
32
|
+
));
|
|
20
33
|
</script>
|
|
@@ -95,7 +95,7 @@ const {
|
|
|
95
95
|
persistent,
|
|
96
96
|
closeHidden,
|
|
97
97
|
fullscreen,
|
|
98
|
-
|
|
98
|
+
fullscreenOnMobile,
|
|
99
99
|
...props
|
|
100
100
|
} = defineProps<
|
|
101
101
|
ModalProps & {
|
|
@@ -126,7 +126,7 @@ const renderedContentClass = computed(() =>
|
|
|
126
126
|
{ 'pt-4': !title || titleHidden, 'max-h-[90vh]': !renderFullscreen.value },
|
|
127
127
|
contentClass,
|
|
128
128
|
));
|
|
129
|
-
const renderFullscreen = computed(() => fullscreen || (
|
|
129
|
+
const renderFullscreen = computed(() => fullscreen || (fullscreenOnMobile && UI.mobile));
|
|
130
130
|
const renderedWrapperClass = computed(() =>
|
|
131
131
|
classes(
|
|
132
132
|
'isolate fixed z-50 flex flex-col overflow-hidden bg-white text-left duration-300',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Modal :title="$td('settings.title', 'Settings')">
|
|
2
|
+
<Modal :title="$td('settings.title', 'Settings')" :fullscreen-on-mobile="$app.settingsFullscreenOnMobile">
|
|
3
3
|
<component :is="setting.component" v-for="(setting, key) in settings" :key />
|
|
4
4
|
</Modal>
|
|
5
5
|
</template>
|
package/src/index.css
CHANGED
package/src/services/App.ts
CHANGED
|
@@ -30,6 +30,10 @@ export class AppService extends Service {
|
|
|
30
30
|
this.settings.push(markRaw(setting));
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
public setSettingsFullscreenOnMobile(fullscreenOnMobile: boolean): void {
|
|
34
|
+
this.settingsFullscreenOnMobile = fullscreenOnMobile;
|
|
35
|
+
}
|
|
36
|
+
|
|
33
37
|
public async whenReady<T>(callback: () => T): Promise<T> {
|
|
34
38
|
const result = await this.ready.then(callback);
|
|
35
39
|
|
package/src/services/index.ts
CHANGED
|
@@ -56,6 +56,10 @@ export default definePlugin({
|
|
|
56
56
|
app.use(getPiniaStore());
|
|
57
57
|
options.settings?.forEach((setting) => App.addSetting(setting));
|
|
58
58
|
|
|
59
|
+
if (options.settingsFullscreenOnMobile !== undefined) {
|
|
60
|
+
App.setSettingsFullscreenOnMobile(options.settingsFullscreenOnMobile);
|
|
61
|
+
}
|
|
62
|
+
|
|
59
63
|
await bootServices(app, services);
|
|
60
64
|
},
|
|
61
65
|
});
|
|
@@ -64,6 +68,7 @@ declare module '@aerogel/core/bootstrap/options' {
|
|
|
64
68
|
export interface AerogelOptions {
|
|
65
69
|
services?: Record<string, Service>;
|
|
66
70
|
settings?: AppSetting[];
|
|
71
|
+
settingsFullscreenOnMobile?: boolean;
|
|
67
72
|
}
|
|
68
73
|
}
|
|
69
74
|
|