@aerogel/core 0.0.0-next.b58141fee5d2fe7d25debdbca6b1d2bf1c13e48e → 0.0.0-next.b656a964404fbde17d9cce7668722596098e47fd
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 +2082 -813
- package/dist/aerogel-core.js +3119 -0
- package/dist/aerogel-core.js.map +1 -0
- package/package.json +36 -34
- package/src/bootstrap/bootstrap.test.ts +7 -10
- package/src/bootstrap/index.ts +43 -14
- package/src/bootstrap/options.ts +4 -1
- package/src/components/AppLayout.vue +16 -0
- package/src/components/{AGAppModals.vue → AppModals.vue} +3 -4
- package/src/components/{AGAppOverlays.vue → AppOverlays.vue} +5 -6
- package/src/components/AppToasts.vue +16 -0
- package/src/components/contracts/AlertModal.ts +4 -0
- package/src/components/contracts/Button.ts +16 -0
- package/src/components/contracts/ConfirmModal.ts +41 -0
- package/src/components/contracts/DropdownMenu.ts +11 -0
- package/src/components/contracts/ErrorReportModal.ts +29 -0
- package/src/components/contracts/Input.ts +26 -0
- package/src/components/contracts/LoadingModal.ts +18 -0
- package/src/components/contracts/Modal.ts +13 -0
- package/src/components/contracts/PromptModal.ts +28 -0
- package/src/components/contracts/Select.ts +36 -0
- package/src/components/contracts/Toast.ts +13 -0
- package/src/components/contracts/index.ts +9 -0
- package/src/components/contracts/shared.ts +9 -0
- package/src/components/headless/HeadlessButton.vue +50 -0
- package/src/components/headless/HeadlessInput.vue +59 -0
- package/src/components/headless/HeadlessInputDescription.vue +27 -0
- package/src/components/headless/{forms/AGHeadlessInputError.vue → HeadlessInputError.vue} +4 -8
- package/src/components/headless/HeadlessInputInput.vue +75 -0
- package/src/components/headless/HeadlessInputLabel.vue +18 -0
- package/src/components/headless/HeadlessInputTextArea.vue +40 -0
- package/src/components/headless/{modals/AGHeadlessModal.vue → HeadlessModal.vue} +17 -19
- package/src/components/headless/HeadlessModalContent.vue +24 -0
- package/src/components/headless/HeadlessModalOverlay.vue +12 -0
- package/src/components/headless/HeadlessModalTitle.vue +12 -0
- package/src/components/headless/HeadlessSelect.vue +104 -0
- package/src/components/headless/HeadlessSelectError.vue +25 -0
- package/src/components/headless/HeadlessSelectLabel.vue +25 -0
- package/src/components/headless/HeadlessSelectOption.vue +34 -0
- package/src/components/headless/HeadlessSelectOptions.vue +30 -0
- package/src/components/headless/HeadlessSelectTrigger.vue +22 -0
- package/src/components/headless/HeadlessSelectValue.vue +15 -0
- package/src/components/headless/HeadlessToast.vue +18 -0
- package/src/components/headless/HeadlessToastAction.vue +13 -0
- package/src/components/headless/index.ts +18 -3
- package/src/components/index.ts +6 -9
- package/src/components/ui/AdvancedOptions.vue +18 -0
- package/src/components/ui/AlertModal.vue +13 -0
- package/src/components/ui/Button.vue +98 -0
- package/src/components/ui/Checkbox.vue +56 -0
- package/src/components/ui/ConfirmModal.vue +42 -0
- package/src/components/ui/DropdownMenu.vue +33 -0
- package/src/components/ui/EditableContent.vue +82 -0
- package/src/components/ui/ErrorMessage.vue +15 -0
- package/src/components/ui/ErrorReportModal.vue +62 -0
- package/src/components/{modals/AGErrorReportModalButtons.vue → ui/ErrorReportModalButtons.vue} +38 -29
- package/src/components/ui/ErrorReportModalTitle.vue +24 -0
- package/src/components/ui/Form.vue +24 -0
- package/src/components/ui/Input.vue +56 -0
- package/src/components/ui/Link.vue +12 -0
- package/src/components/ui/LoadingModal.vue +32 -0
- package/src/components/ui/Markdown.vue +69 -0
- package/src/components/ui/Modal.vue +70 -0
- package/src/components/ui/ModalContext.vue +30 -0
- package/src/components/ui/ProgressBar.vue +50 -0
- package/src/components/ui/PromptModal.vue +35 -0
- package/src/components/ui/Select.vue +21 -0
- package/src/components/ui/SelectLabel.vue +10 -0
- package/src/components/ui/SelectOptions.vue +31 -0
- package/src/components/ui/SelectTrigger.vue +29 -0
- package/src/components/ui/SettingsModal.vue +15 -0
- package/src/components/ui/StartupCrash.vue +31 -0
- package/src/components/ui/Toast.vue +42 -0
- package/src/components/ui/index.ts +27 -0
- package/src/directives/index.ts +13 -5
- package/src/directives/measure.ts +40 -0
- package/src/errors/Errors.state.ts +1 -1
- package/src/errors/Errors.ts +35 -34
- package/src/errors/JobCancelledError.ts +3 -0
- package/src/errors/index.ts +19 -29
- package/src/errors/utils.ts +35 -0
- package/src/forms/{Form.test.ts → FormController.test.ts} +33 -4
- package/src/forms/{Form.ts → FormController.ts} +94 -25
- package/src/forms/composition.ts +4 -4
- package/src/forms/index.ts +3 -1
- package/src/forms/utils.ts +36 -5
- package/src/forms/validation.ts +19 -0
- package/src/index.css +46 -0
- package/src/{main.ts → index.ts} +3 -0
- package/src/jobs/Job.ts +147 -0
- package/src/jobs/index.ts +10 -0
- package/src/jobs/listeners.ts +3 -0
- package/src/jobs/status.ts +4 -0
- package/src/lang/DefaultLangProvider.ts +46 -0
- package/src/lang/Lang.state.ts +11 -0
- package/src/lang/Lang.ts +44 -29
- package/src/lang/index.ts +11 -6
- package/src/lang/settings/Language.vue +48 -0
- package/src/lang/settings/index.ts +10 -0
- package/src/plugins/Plugin.ts +2 -1
- package/src/plugins/index.ts +22 -0
- package/src/services/App.state.ts +40 -6
- package/src/services/App.ts +48 -5
- package/src/services/Cache.ts +43 -0
- package/src/services/Events.test.ts +39 -0
- package/src/services/Events.ts +112 -32
- package/src/services/Service.ts +154 -49
- package/src/services/Storage.ts +20 -0
- package/src/services/index.ts +18 -6
- package/src/services/store.ts +8 -5
- package/src/services/utils.ts +18 -0
- package/src/testing/index.ts +26 -0
- package/src/testing/setup.ts +11 -0
- package/src/ui/UI.state.ts +19 -7
- package/src/ui/UI.ts +268 -57
- package/src/ui/index.ts +23 -17
- package/src/ui/utils.ts +16 -0
- package/src/utils/classes.ts +49 -0
- package/src/utils/composition/events.ts +3 -2
- package/src/utils/composition/forms.ts +14 -4
- package/src/utils/composition/persistent.test.ts +33 -0
- package/src/utils/composition/persistent.ts +11 -0
- package/src/utils/composition/state.test.ts +47 -0
- package/src/utils/composition/state.ts +33 -0
- package/src/utils/index.ts +4 -0
- package/src/utils/markdown.test.ts +50 -0
- package/src/utils/markdown.ts +19 -6
- package/src/utils/vue.ts +28 -118
- package/.eslintrc.js +0 -3
- package/dist/aerogel-core.cjs.js +0 -2
- package/dist/aerogel-core.cjs.js.map +0 -1
- package/dist/aerogel-core.esm.js +0 -2
- package/dist/aerogel-core.esm.js.map +0 -1
- package/dist/virtual.d.ts +0 -11
- package/noeldemartin.config.js +0 -5
- package/src/components/AGAppLayout.vue +0 -11
- package/src/components/AGAppSnackbars.vue +0 -13
- package/src/components/basic/AGErrorMessage.vue +0 -16
- package/src/components/basic/AGLink.vue +0 -9
- package/src/components/basic/AGMarkdown.vue +0 -36
- package/src/components/basic/index.ts +0 -5
- package/src/components/constants.ts +0 -8
- package/src/components/forms/AGButton.vue +0 -44
- package/src/components/forms/AGCheckbox.vue +0 -35
- package/src/components/forms/AGForm.vue +0 -26
- package/src/components/forms/AGInput.vue +0 -36
- package/src/components/forms/index.ts +0 -6
- package/src/components/headless/forms/AGHeadlessButton.vue +0 -51
- package/src/components/headless/forms/AGHeadlessInput.ts +0 -8
- package/src/components/headless/forms/AGHeadlessInput.vue +0 -54
- package/src/components/headless/forms/AGHeadlessInputInput.vue +0 -45
- package/src/components/headless/forms/AGHeadlessInputLabel.vue +0 -16
- package/src/components/headless/forms/index.ts +0 -6
- package/src/components/headless/modals/AGHeadlessModal.ts +0 -7
- package/src/components/headless/modals/AGHeadlessModalPanel.vue +0 -28
- package/src/components/headless/modals/AGHeadlessModalTitle.vue +0 -13
- package/src/components/headless/modals/index.ts +0 -6
- package/src/components/headless/snackbars/AGHeadlessSnackbar.vue +0 -10
- package/src/components/headless/snackbars/index.ts +0 -25
- package/src/components/modals/AGAlertModal.vue +0 -25
- package/src/components/modals/AGConfirmModal.vue +0 -30
- package/src/components/modals/AGErrorReportModal.ts +0 -20
- package/src/components/modals/AGErrorReportModal.vue +0 -62
- package/src/components/modals/AGErrorReportModalTitle.vue +0 -25
- package/src/components/modals/AGLoadingModal.vue +0 -19
- package/src/components/modals/AGModal.ts +0 -10
- package/src/components/modals/AGModal.vue +0 -37
- package/src/components/modals/AGModalContext.ts +0 -8
- package/src/components/modals/AGModalContext.vue +0 -22
- package/src/components/modals/AGModalTitle.vue +0 -9
- package/src/components/modals/index.ts +0 -23
- package/src/components/snackbars/AGSnackbar.vue +0 -42
- package/src/components/snackbars/index.ts +0 -3
- package/src/directives/initial-focus.ts +0 -11
- package/src/types/virtual.d.ts +0 -11
- package/tsconfig.json +0 -11
- package/vite.config.ts +0 -14
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component :is="as" v-if="as">
|
|
3
|
-
<slot />
|
|
4
|
-
</component>
|
|
5
|
-
<slot v-else />
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<script setup lang="ts">
|
|
9
|
-
import { computed, inject, provide, readonly } from 'vue';
|
|
10
|
-
import { uuid } from '@noeldemartin/utils';
|
|
11
|
-
|
|
12
|
-
import { mixedProp, stringProp } from '@/utils/vue';
|
|
13
|
-
import type Form from '@/forms/Form';
|
|
14
|
-
|
|
15
|
-
import type { IAGHeadlessInput } from './AGHeadlessInput';
|
|
16
|
-
|
|
17
|
-
const emit = defineEmits(['update:modelValue']);
|
|
18
|
-
const props = defineProps({
|
|
19
|
-
as: stringProp('div'),
|
|
20
|
-
name: stringProp(),
|
|
21
|
-
modelValue: mixedProp<string | number | boolean>([String, Number, Boolean]),
|
|
22
|
-
});
|
|
23
|
-
const errors = computed(() => {
|
|
24
|
-
if (!form || !props.name) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return form.errors[props.name] ?? null;
|
|
29
|
-
});
|
|
30
|
-
const form = inject<Form | null>('form', null);
|
|
31
|
-
const publicApi: IAGHeadlessInput = {
|
|
32
|
-
id: `input-${uuid()}`,
|
|
33
|
-
value: computed(() => {
|
|
34
|
-
if (form && props.name) {
|
|
35
|
-
return form.getFieldValue(props.name);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return props.modelValue;
|
|
39
|
-
}),
|
|
40
|
-
errors: readonly(errors),
|
|
41
|
-
update(value) {
|
|
42
|
-
if (form && props.name) {
|
|
43
|
-
form.setFieldValue(props.name, value);
|
|
44
|
-
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
emit('update:modelValue', value);
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
provide<IAGHeadlessInput>('input', publicApi);
|
|
53
|
-
defineExpose<IAGHeadlessInput>(publicApi);
|
|
54
|
-
</script>
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<input
|
|
3
|
-
:id="input.id"
|
|
4
|
-
ref="$input"
|
|
5
|
-
:type="type"
|
|
6
|
-
:value="value"
|
|
7
|
-
:aria-invalid="input.errors ? 'true' : 'false'"
|
|
8
|
-
:aria-describedby="input.errors ? `${input.id}-error` : undefined"
|
|
9
|
-
:checked="checked"
|
|
10
|
-
@input="update"
|
|
11
|
-
>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script setup lang="ts">
|
|
15
|
-
import { computed, ref } from 'vue';
|
|
16
|
-
|
|
17
|
-
import { injectReactiveOrFail, stringProp } from '@/utils';
|
|
18
|
-
import type { IAGHeadlessInput } from '@/components/headless/forms/AGHeadlessInput';
|
|
19
|
-
|
|
20
|
-
const props = defineProps({
|
|
21
|
-
type: stringProp('text'),
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const $input = ref<HTMLInputElement>();
|
|
25
|
-
const input = injectReactiveOrFail<IAGHeadlessInput>(
|
|
26
|
-
'input',
|
|
27
|
-
'<AGHeadlessInputInput> must be a child of a <AGHeadlessInput>',
|
|
28
|
-
);
|
|
29
|
-
const value = computed(() => input.value);
|
|
30
|
-
const checked = computed(() => {
|
|
31
|
-
if (props.type !== 'checkbox') {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return !!value.value;
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
function update() {
|
|
39
|
-
if (!$input.value) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
input.update(props.type === 'checkbox' ? $input.value.checked : $input.value.value);
|
|
44
|
-
}
|
|
45
|
-
</script>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<label :for="input.id">
|
|
3
|
-
<slot />
|
|
4
|
-
</label>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script setup lang="ts">
|
|
8
|
-
import { injectReactiveOrFail } from '@/utils/vue';
|
|
9
|
-
|
|
10
|
-
import type { IAGHeadlessInput } from './AGHeadlessInput';
|
|
11
|
-
|
|
12
|
-
const input = injectReactiveOrFail<IAGHeadlessInput>(
|
|
13
|
-
'input',
|
|
14
|
-
'<AGHeadlessInputLabel> must be a child of a <AGHeadlessInput>',
|
|
15
|
-
);
|
|
16
|
-
</script>
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { IAGHeadlessInput } from './AGHeadlessInput';
|
|
2
|
-
export { default as AGHeadlessButton } from './AGHeadlessButton.vue';
|
|
3
|
-
export { default as AGHeadlessInput } from './AGHeadlessInput.vue';
|
|
4
|
-
export { default as AGHeadlessInputError } from './AGHeadlessInputError.vue';
|
|
5
|
-
export { default as AGHeadlessInputInput } from './AGHeadlessInputInput.vue';
|
|
6
|
-
export { default as AGHeadlessInputLabel } from './AGHeadlessInputLabel.vue';
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<DialogPanel>
|
|
3
|
-
<slot />
|
|
4
|
-
|
|
5
|
-
<template v-if="childModal">
|
|
6
|
-
<div class="pointer-events-none fixed inset-0 z-50 bg-black/30" />
|
|
7
|
-
<AGModalContext :child-index="modal.childIndex + 1" :modal="childModal" />
|
|
8
|
-
</template>
|
|
9
|
-
</DialogPanel>
|
|
10
|
-
</template>
|
|
11
|
-
|
|
12
|
-
<script setup lang="ts">
|
|
13
|
-
import { computed } from 'vue';
|
|
14
|
-
import { DialogPanel } from '@headlessui/vue';
|
|
15
|
-
|
|
16
|
-
import UI from '@/ui/UI';
|
|
17
|
-
import { injectReactiveOrFail } from '@/utils/vue';
|
|
18
|
-
import type { IAGModalContext } from '@/components/modals/AGModalContext';
|
|
19
|
-
|
|
20
|
-
import AGModalContext from '../../modals/AGModalContext.vue';
|
|
21
|
-
|
|
22
|
-
const modal = injectReactiveOrFail<IAGModalContext>(
|
|
23
|
-
'modal',
|
|
24
|
-
'could not obtain modal reference from <AGHeadlessModalPanel>, ' +
|
|
25
|
-
'did you render this component manually? Show it using $ui.openModal() instead',
|
|
26
|
-
);
|
|
27
|
-
const childModal = computed(() => UI.modals[modal.childIndex] ?? null);
|
|
28
|
-
</script>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<DialogTitle :as="as">
|
|
3
|
-
<slot />
|
|
4
|
-
</DialogTitle>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script setup lang="ts">
|
|
8
|
-
import { DialogTitle } from '@headlessui/vue';
|
|
9
|
-
|
|
10
|
-
import { stringProp } from '@/utils/vue';
|
|
11
|
-
|
|
12
|
-
defineProps({ as: stringProp('h2') });
|
|
13
|
-
</script>
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import AGHeadlessModal from './AGHeadlessModal.vue';
|
|
2
|
-
import AGHeadlessModalPanel from './AGHeadlessModalPanel.vue';
|
|
3
|
-
import AGHeadlessModalTitle from './AGHeadlessModalTitle.vue';
|
|
4
|
-
import type { IAGHeadlessModal } from './AGHeadlessModal';
|
|
5
|
-
|
|
6
|
-
export { AGHeadlessModal, AGHeadlessModalPanel, AGHeadlessModalTitle, IAGHeadlessModal };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { arrayProp, enumProp, requiredStringProp } from '@/utils/vue';
|
|
2
|
-
import { Colors } from '@/components/constants';
|
|
3
|
-
import { objectWithout } from '@noeldemartin/utils';
|
|
4
|
-
|
|
5
|
-
export { default as AGHeadlessSnackbar } from './AGHeadlessSnackbar.vue';
|
|
6
|
-
|
|
7
|
-
export interface SnackbarAction {
|
|
8
|
-
text: string;
|
|
9
|
-
dismiss?: boolean;
|
|
10
|
-
handler?(): unknown;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export type SnackbarColor = (typeof SnackbarColors)[keyof typeof SnackbarColors];
|
|
14
|
-
|
|
15
|
-
export const SnackbarColors = objectWithout(Colors, ['Primary', 'Clear']);
|
|
16
|
-
export const snackbarProps = {
|
|
17
|
-
id: requiredStringProp(),
|
|
18
|
-
message: requiredStringProp(),
|
|
19
|
-
actions: arrayProp<SnackbarAction>(() => []),
|
|
20
|
-
color: enumProp(SnackbarColors, Colors.Secondary),
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export function useSnackbarProps(): typeof snackbarProps {
|
|
24
|
-
return snackbarProps;
|
|
25
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<AGModal>
|
|
3
|
-
<AGMarkdown
|
|
4
|
-
v-if="title"
|
|
5
|
-
:text="title"
|
|
6
|
-
as="h2"
|
|
7
|
-
class="font-semibold"
|
|
8
|
-
inline
|
|
9
|
-
/>
|
|
10
|
-
<AGMarkdown :text="message" />
|
|
11
|
-
</AGModal>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script setup lang="ts">
|
|
15
|
-
import { requiredStringProp, stringProp } from '@/utils/vue';
|
|
16
|
-
|
|
17
|
-
import AGModal from './AGModal.vue';
|
|
18
|
-
|
|
19
|
-
import AGMarkdown from '../basic/AGMarkdown.vue';
|
|
20
|
-
|
|
21
|
-
defineProps({
|
|
22
|
-
title: stringProp(),
|
|
23
|
-
message: requiredStringProp(),
|
|
24
|
-
});
|
|
25
|
-
</script>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<AGModal v-slot="{ close }: IAGModalDefaultSlotProps" :cancellable="false">
|
|
3
|
-
<AGMarkdown v-if="title" :text="title" as="h1" />
|
|
4
|
-
<AGMarkdown :text="message" />
|
|
5
|
-
|
|
6
|
-
<div class="mt-2 flex flex-row-reverse gap-2">
|
|
7
|
-
<AGButton @click="close(true)">
|
|
8
|
-
{{ $td('ui.ok', 'OK') }}
|
|
9
|
-
</AGButton>
|
|
10
|
-
<AGButton color="secondary" @click="close()">
|
|
11
|
-
{{ $td('ui.cancel', 'Cancel') }}
|
|
12
|
-
</AGButton>
|
|
13
|
-
</div>
|
|
14
|
-
</AGModal>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script setup lang="ts">
|
|
18
|
-
import { requiredStringProp, stringProp } from '@/utils/vue';
|
|
19
|
-
|
|
20
|
-
import AGModal from './AGModal.vue';
|
|
21
|
-
import type { IAGModalDefaultSlotProps } from './AGModal';
|
|
22
|
-
|
|
23
|
-
import AGButton from '../forms/AGButton.vue';
|
|
24
|
-
import AGMarkdown from '../basic/AGMarkdown.vue';
|
|
25
|
-
|
|
26
|
-
defineProps({
|
|
27
|
-
title: stringProp(),
|
|
28
|
-
message: requiredStringProp(),
|
|
29
|
-
});
|
|
30
|
-
</script>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Component } from 'vue';
|
|
2
|
-
|
|
3
|
-
import { requiredArrayProp } from '@/utils/vue';
|
|
4
|
-
import type { ErrorReport } from '@/errors';
|
|
5
|
-
|
|
6
|
-
export interface IAGErrorReportModalButtonsDefaultSlotProps {
|
|
7
|
-
id: string;
|
|
8
|
-
description: string;
|
|
9
|
-
iconComponent: Component;
|
|
10
|
-
url?: string;
|
|
11
|
-
handler?(): void;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const errorReportModalProps = {
|
|
15
|
-
reports: requiredArrayProp<ErrorReport>(),
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export function useErrorReportModalProps(): typeof errorReportModalProps {
|
|
19
|
-
return errorReportModalProps;
|
|
20
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<AGModal>
|
|
3
|
-
<div>
|
|
4
|
-
<h2 class="flex items-center justify-between text-lg font-medium">
|
|
5
|
-
<div class="flex items-center">
|
|
6
|
-
<AGErrorReportModalTitle
|
|
7
|
-
:report="report"
|
|
8
|
-
:current-report="activeReportIndex + 1"
|
|
9
|
-
:total-reports="reports.length"
|
|
10
|
-
/>
|
|
11
|
-
<template v-if="reports.length > 1">
|
|
12
|
-
<AGButton
|
|
13
|
-
color="clear"
|
|
14
|
-
:disabled="activeReportIndex === 0"
|
|
15
|
-
:title="$td('errors.previousReport', 'Show previous report')"
|
|
16
|
-
:aria-label="$td('errors.previousReport', 'Show previous report')"
|
|
17
|
-
@click="activeReportIndex--"
|
|
18
|
-
>
|
|
19
|
-
<IconCheveronLeft aria-hidden="true" class="h-4 w-4" />
|
|
20
|
-
</AGButton>
|
|
21
|
-
<AGButton
|
|
22
|
-
color="clear"
|
|
23
|
-
:disabled="activeReportIndex === reports.length - 1"
|
|
24
|
-
:title="$td('errors.nextReport', 'Show next report')"
|
|
25
|
-
:aria-label="$td('errors.nextReport', 'Show next report')"
|
|
26
|
-
@click="activeReportIndex++"
|
|
27
|
-
>
|
|
28
|
-
<IconCheveronRight aria-hidden="true" class="h-4 w-4" />
|
|
29
|
-
</AGButton>
|
|
30
|
-
</template>
|
|
31
|
-
</div>
|
|
32
|
-
<AGErrorReportModalButtons :report="report" />
|
|
33
|
-
</h2>
|
|
34
|
-
<AGMarkdown v-if="report.description" :text="report.description" class="mt-2" />
|
|
35
|
-
</div>
|
|
36
|
-
<pre
|
|
37
|
-
class="h-full overflow-auto bg-gray-200 p-4 text-xs text-red-900"
|
|
38
|
-
v-text="report.details ?? $td('errors.detailsEmpty', 'This error is missing a stacktrace.')"
|
|
39
|
-
/>
|
|
40
|
-
</AGModal>
|
|
41
|
-
</template>
|
|
42
|
-
|
|
43
|
-
<script setup lang="ts">
|
|
44
|
-
import IconCheveronRight from '~icons/zondicons/cheveron-right';
|
|
45
|
-
import IconCheveronLeft from '~icons/zondicons/cheveron-left';
|
|
46
|
-
|
|
47
|
-
import { computed, ref } from 'vue';
|
|
48
|
-
|
|
49
|
-
import type { ErrorReport } from '@/errors';
|
|
50
|
-
|
|
51
|
-
import { useErrorReportModalProps } from './AGErrorReportModal';
|
|
52
|
-
|
|
53
|
-
import AGButton from '../forms/AGButton.vue';
|
|
54
|
-
import AGErrorReportModalButtons from './AGErrorReportModalButtons.vue';
|
|
55
|
-
import AGErrorReportModalTitle from './AGErrorReportModalTitle.vue';
|
|
56
|
-
import AGMarkdown from '../basic/AGMarkdown.vue';
|
|
57
|
-
import AGModal from './AGModal.vue';
|
|
58
|
-
|
|
59
|
-
const props = defineProps(useErrorReportModalProps());
|
|
60
|
-
const activeReportIndex = ref(0);
|
|
61
|
-
const report = computed(() => props.reports[activeReportIndex.value] as ErrorReport);
|
|
62
|
-
</script>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<AGMarkdown :text="text" inline />
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script setup lang="ts">
|
|
6
|
-
import { computed } from 'vue';
|
|
7
|
-
|
|
8
|
-
import { numberProp, requiredObjectProp } from '@/utils/vue';
|
|
9
|
-
import type { ErrorReport } from '@/errors';
|
|
10
|
-
|
|
11
|
-
import AGMarkdown from '../basic/AGMarkdown.vue';
|
|
12
|
-
|
|
13
|
-
const props = defineProps({
|
|
14
|
-
report: requiredObjectProp<ErrorReport>(),
|
|
15
|
-
currentReport: numberProp(),
|
|
16
|
-
totalReports: numberProp(),
|
|
17
|
-
});
|
|
18
|
-
const text = computed(() => {
|
|
19
|
-
if (!props.totalReports || props.totalReports <= 1) {
|
|
20
|
-
return props.report.title;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return `${props.report.title} (${props.currentReport}/${props.totalReports})`;
|
|
24
|
-
});
|
|
25
|
-
</script>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<AGModal :cancellable="false">
|
|
3
|
-
<AGMarkdown :text="renderedMessage" />
|
|
4
|
-
</AGModal>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script setup lang="ts">
|
|
8
|
-
import { computed } from 'vue';
|
|
9
|
-
|
|
10
|
-
import { stringProp } from '@/utils/vue';
|
|
11
|
-
import { translateWithDefault } from '@/lang/utils';
|
|
12
|
-
|
|
13
|
-
import AGModal from './AGModal.vue';
|
|
14
|
-
|
|
15
|
-
import AGMarkdown from '../basic/AGMarkdown.vue';
|
|
16
|
-
|
|
17
|
-
const props = defineProps({ message: stringProp() });
|
|
18
|
-
const renderedMessage = computed(() => props.message ?? translateWithDefault('ui.loading', 'Loading...'));
|
|
19
|
-
</script>
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<AGHeadlessModal
|
|
3
|
-
ref="$headlessModal"
|
|
4
|
-
v-slot="{ close }: IAGHeadlessModalDefaultSlotProps"
|
|
5
|
-
:cancellable="cancellable"
|
|
6
|
-
class="relative z-50"
|
|
7
|
-
>
|
|
8
|
-
<div class="fixed inset-0 flex items-center justify-center p-8">
|
|
9
|
-
<AGHeadlessModalPanel class="flex max-h-full max-w-full flex-col overflow-hidden bg-white">
|
|
10
|
-
<div class="flex max-h-full flex-col overflow-auto p-4" v-bind="$attrs">
|
|
11
|
-
<slot :close="close" />
|
|
12
|
-
</div>
|
|
13
|
-
</AGHeadlessModalPanel>
|
|
14
|
-
</div>
|
|
15
|
-
</AGHeadlessModal>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script setup lang="ts">
|
|
19
|
-
import { computed, ref } from 'vue';
|
|
20
|
-
|
|
21
|
-
import { booleanProp } from '@/utils';
|
|
22
|
-
import type { IAGHeadlessModal, IAGHeadlessModalDefaultSlotProps } from '@/components/headless/modals/AGHeadlessModal';
|
|
23
|
-
|
|
24
|
-
import type { IAGModal } from './AGModal';
|
|
25
|
-
|
|
26
|
-
import AGHeadlessModal from '../headless/modals/AGHeadlessModal.vue';
|
|
27
|
-
import AGHeadlessModalPanel from '../headless/modals/AGHeadlessModalPanel.vue';
|
|
28
|
-
|
|
29
|
-
const $headlessModal = ref<IAGHeadlessModal>();
|
|
30
|
-
|
|
31
|
-
defineOptions({ inheritAttrs: false });
|
|
32
|
-
defineProps({ cancellable: booleanProp(true) });
|
|
33
|
-
defineExpose<IAGModal>({
|
|
34
|
-
close: async () => $headlessModal.value?.close(),
|
|
35
|
-
cancellable: computed(() => !!$headlessModal.value?.cancellable),
|
|
36
|
-
});
|
|
37
|
-
</script>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component :is="modal.component" v-bind="modal.properties" />
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script setup lang="ts">
|
|
6
|
-
import { provide, toRef } from 'vue';
|
|
7
|
-
|
|
8
|
-
import { requiredNumberProp, requiredObjectProp } from '@/utils/vue';
|
|
9
|
-
import type { Modal } from '@/ui/UI.state';
|
|
10
|
-
|
|
11
|
-
import type { IAGModalContext } from './AGModalContext';
|
|
12
|
-
|
|
13
|
-
const props = defineProps({
|
|
14
|
-
modal: requiredObjectProp<Modal>(),
|
|
15
|
-
childIndex: requiredNumberProp(),
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
provide<IAGModalContext>('modal', {
|
|
19
|
-
modal: toRef(props, 'modal'),
|
|
20
|
-
childIndex: toRef(props, 'childIndex'),
|
|
21
|
-
});
|
|
22
|
-
</script>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import AGAlertModal from './AGAlertModal.vue';
|
|
2
|
-
import AGConfirmModal from './AGConfirmModal.vue';
|
|
3
|
-
import AGErrorReportModalButtons from './AGErrorReportModalButtons.vue';
|
|
4
|
-
import AGErrorReportModalTitle from './AGErrorReportModalTitle.vue';
|
|
5
|
-
import AGLoadingModal from './AGLoadingModal.vue';
|
|
6
|
-
import AGModal from './AGModal.vue';
|
|
7
|
-
import AGModalTitle from './AGModalTitle.vue';
|
|
8
|
-
import AGModalContext from './AGModalContext.vue';
|
|
9
|
-
|
|
10
|
-
export * from './AGErrorReportModal';
|
|
11
|
-
export * from './AGModal';
|
|
12
|
-
export * from './AGModalContext';
|
|
13
|
-
|
|
14
|
-
export {
|
|
15
|
-
AGAlertModal,
|
|
16
|
-
AGConfirmModal,
|
|
17
|
-
AGErrorReportModalButtons,
|
|
18
|
-
AGErrorReportModalTitle,
|
|
19
|
-
AGLoadingModal,
|
|
20
|
-
AGModal,
|
|
21
|
-
AGModalTitle,
|
|
22
|
-
AGModalContext,
|
|
23
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<AGHeadlessSnackbar class="flex flex-row items-center justify-center gap-3 p-4" :class="styleClasses">
|
|
3
|
-
<AGMarkdown :text="message" inline />
|
|
4
|
-
<AGButton
|
|
5
|
-
v-for="(action, i) of actions"
|
|
6
|
-
:key="i"
|
|
7
|
-
:color="color"
|
|
8
|
-
@click="activate(action)"
|
|
9
|
-
>
|
|
10
|
-
{{ action.text }}
|
|
11
|
-
</AGButton>
|
|
12
|
-
</AGHeadlessSnackbar>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<script setup lang="ts">
|
|
16
|
-
import { computed } from 'vue';
|
|
17
|
-
|
|
18
|
-
import UI from '@/ui/UI';
|
|
19
|
-
import { Colors } from '@/components/constants';
|
|
20
|
-
import { useSnackbarProps } from '@/components/headless';
|
|
21
|
-
import type { SnackbarAction } from '@/components/headless';
|
|
22
|
-
|
|
23
|
-
import AGButton from '../forms/AGButton.vue';
|
|
24
|
-
import AGHeadlessSnackbar from '../headless/snackbars/AGHeadlessSnackbar.vue';
|
|
25
|
-
import AGMarkdown from '../basic/AGMarkdown.vue';
|
|
26
|
-
|
|
27
|
-
const props = defineProps(useSnackbarProps());
|
|
28
|
-
const styleClasses = computed(() => {
|
|
29
|
-
switch (props.color) {
|
|
30
|
-
case Colors.Danger:
|
|
31
|
-
return 'bg-red-200 text-red-900';
|
|
32
|
-
default:
|
|
33
|
-
case Colors.Secondary:
|
|
34
|
-
return 'bg-gray-900 text-white';
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
function activate(action: SnackbarAction): void {
|
|
39
|
-
action.handler?.();
|
|
40
|
-
action.dismiss && UI.hideSnackbar(props.id);
|
|
41
|
-
}
|
|
42
|
-
</script>
|
package/src/types/virtual.d.ts
DELETED
package/tsconfig.json
DELETED
package/vite.config.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import Aerogel from '@aerogel/vite';
|
|
2
|
-
import Icons from 'unplugin-icons/vite';
|
|
3
|
-
import { defineConfig } from 'vitest/config';
|
|
4
|
-
import { resolve } from 'path';
|
|
5
|
-
|
|
6
|
-
export default defineConfig({
|
|
7
|
-
test: { clearMocks: true },
|
|
8
|
-
plugins: [Aerogel(), Icons()],
|
|
9
|
-
resolve: {
|
|
10
|
-
alias: {
|
|
11
|
-
'@': resolve(__dirname, './src'),
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
});
|