@aerogel/core 0.0.0-next.c29ffcd25bffdbed37ecce3aac1ba14cde3e9d39 → 0.0.0-next.c2e6acc000e97a1020c2e232678563c53884dd0e
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 +1223 -1792
- package/dist/aerogel-core.js +2968 -0
- package/dist/aerogel-core.js.map +1 -0
- package/package.json +27 -37
- package/src/bootstrap/bootstrap.test.ts +4 -7
- package/src/bootstrap/index.ts +14 -15
- package/src/bootstrap/options.ts +1 -1
- package/src/components/{AGAppLayout.vue → AppLayout.vue} +4 -4
- package/src/components/{AGAppModals.vue → AppModals.vue} +3 -4
- package/src/components/{AGAppOverlays.vue → AppOverlays.vue} +5 -5
- package/src/components/composition.ts +1 -1
- package/src/components/contracts/AlertModal.ts +4 -0
- package/src/components/contracts/Button.ts +15 -0
- package/src/components/contracts/ConfirmModal.ts +41 -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 +9 -0
- package/src/components/contracts/PromptModal.ts +28 -0
- package/src/components/contracts/index.ts +7 -0
- package/src/components/contracts/shared.ts +9 -0
- package/src/components/forms/AGSelect.vue +11 -17
- package/src/components/forms/index.ts +0 -4
- package/src/components/headless/HeadlessButton.vue +45 -0
- package/src/components/headless/HeadlessInput.vue +59 -0
- package/src/components/headless/{forms/AGHeadlessInputDescription.vue → HeadlessInputDescription.vue} +6 -7
- package/src/components/headless/{forms/AGHeadlessInputError.vue → HeadlessInputError.vue} +4 -8
- package/src/components/headless/{forms/AGHeadlessInputInput.vue → HeadlessInputInput.vue} +10 -19
- package/src/components/headless/{forms/AGHeadlessInputLabel.vue → HeadlessInputLabel.vue} +3 -7
- package/src/components/headless/{forms/AGHeadlessInputTextArea.vue → HeadlessInputTextArea.vue} +6 -9
- package/src/components/headless/{modals/AGHeadlessModal.vue → HeadlessModal.vue} +16 -24
- 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/forms/AGHeadlessSelect.ts +3 -3
- package/src/components/headless/forms/AGHeadlessSelect.vue +16 -16
- package/src/components/headless/forms/AGHeadlessSelectError.vue +2 -2
- package/src/components/headless/forms/AGHeadlessSelectOption.vue +10 -18
- package/src/components/headless/forms/AGHeadlessSelectOptions.vue +19 -0
- package/src/components/headless/forms/AGHeadlessSelectTrigger.vue +25 -0
- package/src/components/headless/forms/composition.ts +2 -2
- package/src/components/headless/forms/index.ts +2 -12
- package/src/components/headless/index.ts +12 -1
- package/src/components/headless/snackbars/index.ts +3 -3
- package/src/components/index.ts +5 -5
- package/src/components/lib/AGErrorMessage.vue +5 -5
- package/src/components/lib/AGMeasured.vue +2 -2
- package/src/components/lib/AGStartupCrash.vue +8 -8
- package/src/components/lib/index.ts +0 -3
- package/src/components/snackbars/AGSnackbar.vue +10 -8
- package/src/components/ui/AlertModal.vue +13 -0
- package/src/components/ui/Button.vue +58 -0
- package/src/components/ui/Checkbox.vue +49 -0
- package/src/components/ui/ConfirmModal.vue +42 -0
- package/src/components/ui/ErrorReportModal.vue +62 -0
- package/src/components/{modals/AGErrorReportModalButtons.vue → ui/ErrorReportModalButtons.vue} +29 -20
- package/src/components/ui/ErrorReportModalTitle.vue +24 -0
- package/src/components/{forms/AGForm.vue → ui/Form.vue} +4 -5
- package/src/components/ui/Input.vue +52 -0
- package/src/components/ui/Link.vue +12 -0
- package/src/components/ui/LoadingModal.vue +32 -0
- package/src/components/ui/Markdown.vue +62 -0
- package/src/components/ui/Modal.vue +55 -0
- package/src/components/{modals/AGModalContext.vue → ui/ModalContext.vue} +7 -9
- package/src/components/ui/ProgressBar.vue +50 -0
- package/src/components/ui/PromptModal.vue +35 -0
- package/src/components/ui/index.ts +16 -0
- package/src/components/utils.ts +106 -9
- package/src/directives/index.ts +9 -5
- package/src/directives/measure.ts +1 -1
- package/src/errors/Errors.state.ts +1 -1
- package/src/errors/Errors.ts +14 -14
- package/src/errors/index.ts +9 -6
- package/src/errors/utils.ts +1 -1
- package/src/forms/{Form.test.ts → FormController.test.ts} +5 -4
- package/src/forms/{Form.ts → FormController.ts} +22 -19
- package/src/forms/composition.ts +4 -4
- package/src/forms/index.ts +2 -2
- package/src/forms/utils.ts +2 -2
- package/src/index.css +8 -0
- package/src/jobs/Job.ts +2 -2
- package/src/lang/DefaultLangProvider.ts +7 -4
- package/src/lang/Lang.state.ts +1 -1
- package/src/lang/Lang.ts +1 -1
- package/src/lang/index.ts +8 -6
- package/src/plugins/Plugin.ts +1 -1
- package/src/plugins/index.ts +10 -7
- package/src/services/App.state.ts +4 -3
- package/src/services/App.ts +4 -4
- package/src/services/Cache.ts +1 -1
- package/src/services/Events.ts +2 -2
- package/src/services/Service.ts +21 -21
- package/src/services/Storage.ts +3 -3
- package/src/services/index.ts +5 -4
- package/src/services/utils.ts +2 -2
- package/src/testing/index.ts +4 -3
- package/src/testing/setup.ts +3 -19
- package/src/ui/UI.state.ts +10 -5
- package/src/ui/UI.ts +53 -40
- package/src/ui/index.ts +16 -16
- package/src/utils/composition/events.ts +2 -2
- package/src/utils/composition/forms.ts +4 -3
- package/src/utils/markdown.ts +3 -5
- package/src/utils/vdom.ts +31 -0
- package/src/utils/vue.ts +7 -12
- 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/histoire.config.ts +0 -7
- package/noeldemartin.config.js +0 -5
- package/postcss.config.js +0 -6
- package/src/assets/histoire.css +0 -3
- package/src/components/forms/AGButton.vue +0 -44
- package/src/components/forms/AGCheckbox.vue +0 -41
- package/src/components/forms/AGInput.vue +0 -40
- package/src/components/headless/forms/AGHeadlessButton.ts +0 -3
- package/src/components/headless/forms/AGHeadlessButton.vue +0 -62
- package/src/components/headless/forms/AGHeadlessInput.ts +0 -34
- package/src/components/headless/forms/AGHeadlessInput.vue +0 -70
- package/src/components/headless/forms/AGHeadlessSelectButton.vue +0 -24
- package/src/components/headless/forms/AGHeadlessSelectLabel.vue +0 -24
- package/src/components/headless/forms/AGHeadlessSelectOptions.ts +0 -3
- package/src/components/headless/modals/AGHeadlessModal.ts +0 -36
- package/src/components/headless/modals/AGHeadlessModalPanel.vue +0 -32
- package/src/components/headless/modals/AGHeadlessModalTitle.vue +0 -23
- package/src/components/headless/modals/index.ts +0 -4
- package/src/components/interfaces.ts +0 -24
- package/src/components/lib/AGLink.vue +0 -9
- package/src/components/lib/AGMarkdown.vue +0 -54
- package/src/components/lib/AGProgressBar.vue +0 -45
- package/src/components/modals/AGAlertModal.ts +0 -18
- package/src/components/modals/AGAlertModal.vue +0 -14
- package/src/components/modals/AGConfirmModal.ts +0 -42
- package/src/components/modals/AGConfirmModal.vue +0 -26
- package/src/components/modals/AGErrorReportModal.ts +0 -49
- package/src/components/modals/AGErrorReportModal.vue +0 -54
- package/src/components/modals/AGErrorReportModalTitle.vue +0 -25
- package/src/components/modals/AGLoadingModal.ts +0 -29
- package/src/components/modals/AGLoadingModal.vue +0 -15
- package/src/components/modals/AGModal.ts +0 -11
- package/src/components/modals/AGModal.vue +0 -39
- package/src/components/modals/AGModalContext.ts +0 -8
- package/src/components/modals/AGModalTitle.vue +0 -9
- package/src/components/modals/AGPromptModal.ts +0 -41
- package/src/components/modals/AGPromptModal.vue +0 -34
- package/src/components/modals/index.ts +0 -17
- package/src/directives/initial-focus.ts +0 -11
- package/src/main.histoire.ts +0 -1
- package/tailwind.config.js +0 -4
- package/tsconfig.json +0 -11
- package/vite.config.ts +0 -17
- /package/src/components/{AGAppSnackbars.vue → AppSnackbars.vue} +0 -0
- /package/src/{main.ts → index.ts} +0 -0
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<AGModal v-slot="{ close }: IAGModalDefaultSlotProps" :cancellable="false" :title="title">
|
|
3
|
-
<AGMarkdown :text="message" :actions="actions" />
|
|
4
|
-
|
|
5
|
-
<div class="mt-2 flex flex-row-reverse gap-2">
|
|
6
|
-
<AGButton :color="acceptColor" @click="close(true)">
|
|
7
|
-
{{ renderedAcceptText }}
|
|
8
|
-
</AGButton>
|
|
9
|
-
<AGButton v-if="!required" :color="cancelColor" @click="close()">
|
|
10
|
-
{{ renderedCancelText }}
|
|
11
|
-
</AGButton>
|
|
12
|
-
</div>
|
|
13
|
-
</AGModal>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script setup lang="ts">
|
|
17
|
-
import AGModal from './AGModal.vue';
|
|
18
|
-
import { useConfirmModal, useConfirmModalProps } from './AGConfirmModal';
|
|
19
|
-
import type { IAGModalDefaultSlotProps } from './AGModal';
|
|
20
|
-
|
|
21
|
-
import AGButton from '../forms/AGButton.vue';
|
|
22
|
-
import AGMarkdown from '../lib/AGMarkdown.vue';
|
|
23
|
-
|
|
24
|
-
const props = defineProps(useConfirmModalProps());
|
|
25
|
-
const { renderedAcceptText, renderedCancelText } = useConfirmModal(props);
|
|
26
|
-
</script>
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { computed, ref } from 'vue';
|
|
2
|
-
import type { Component, ExtractPropTypes } from 'vue';
|
|
3
|
-
import type { ObjectWithout, Pretty } from '@noeldemartin/utils';
|
|
4
|
-
|
|
5
|
-
import { requiredArrayProp } from '@/utils/vue';
|
|
6
|
-
import { translateWithDefault } from '@/lang';
|
|
7
|
-
import type { AcceptRefs } from '@/utils/vue';
|
|
8
|
-
import type { ErrorReport } from '@/errors';
|
|
9
|
-
|
|
10
|
-
export interface IAGErrorReportModalButtonsDefaultSlotProps {
|
|
11
|
-
id: string;
|
|
12
|
-
description: string;
|
|
13
|
-
iconComponent: Component;
|
|
14
|
-
url?: string;
|
|
15
|
-
handler?(): void;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const errorReportModalProps = {
|
|
19
|
-
reports: requiredArrayProp<ErrorReport>(),
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type AGErrorReportModalProps = Pretty<
|
|
23
|
-
AcceptRefs<ObjectWithout<ExtractPropTypes<typeof errorReportModalProps>, null | undefined>>
|
|
24
|
-
>;
|
|
25
|
-
|
|
26
|
-
export function useErrorReportModalProps(): typeof errorReportModalProps {
|
|
27
|
-
return errorReportModalProps;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
31
|
-
export function useErrorReportModal(props: ExtractPropTypes<typeof errorReportModalProps>) {
|
|
32
|
-
const activeReportIndex = ref(0);
|
|
33
|
-
const report = computed(() => props.reports[activeReportIndex.value] as ErrorReport);
|
|
34
|
-
const details = computed(
|
|
35
|
-
() =>
|
|
36
|
-
report.value.details?.trim() ||
|
|
37
|
-
translateWithDefault('errors.detailsEmpty', 'This error is missing a stacktrace.'),
|
|
38
|
-
);
|
|
39
|
-
const previousReportText = translateWithDefault('errors.previousReport', 'Show previous report');
|
|
40
|
-
const nextReportText = translateWithDefault('errors.nextReport', 'Show next report');
|
|
41
|
-
|
|
42
|
-
return {
|
|
43
|
-
activeReportIndex,
|
|
44
|
-
details,
|
|
45
|
-
nextReportText,
|
|
46
|
-
previousReportText,
|
|
47
|
-
report,
|
|
48
|
-
};
|
|
49
|
-
}
|
|
@@ -1,54 +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="previousReportText"
|
|
16
|
-
:aria-label="previousReportText"
|
|
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="nextReportText"
|
|
25
|
-
:aria-label="nextReportText"
|
|
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 class="h-full overflow-auto bg-gray-200 p-4 text-xs text-red-900" v-text="details" />
|
|
37
|
-
</AGModal>
|
|
38
|
-
</template>
|
|
39
|
-
|
|
40
|
-
<script setup lang="ts">
|
|
41
|
-
import IconCheveronRight from '~icons/zondicons/cheveron-right';
|
|
42
|
-
import IconCheveronLeft from '~icons/zondicons/cheveron-left';
|
|
43
|
-
|
|
44
|
-
import { useErrorReportModal, useErrorReportModalProps } from './AGErrorReportModal';
|
|
45
|
-
|
|
46
|
-
import AGButton from '../forms/AGButton.vue';
|
|
47
|
-
import AGErrorReportModalButtons from './AGErrorReportModalButtons.vue';
|
|
48
|
-
import AGErrorReportModalTitle from './AGErrorReportModalTitle.vue';
|
|
49
|
-
import AGMarkdown from '../lib/AGMarkdown.vue';
|
|
50
|
-
import AGModal from './AGModal.vue';
|
|
51
|
-
|
|
52
|
-
const props = defineProps(useErrorReportModalProps());
|
|
53
|
-
const { activeReportIndex, details, nextReportText, previousReportText, report } = useErrorReportModal(props);
|
|
54
|
-
</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 '../lib/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,29 +0,0 @@
|
|
|
1
|
-
import { computed } from 'vue';
|
|
2
|
-
import type { ExtractPropTypes } from 'vue';
|
|
3
|
-
import type { ObjectWithout } from '@noeldemartin/utils';
|
|
4
|
-
|
|
5
|
-
import { numberProp, stringProp } from '@/utils';
|
|
6
|
-
import { translateWithDefault } from '@/lang';
|
|
7
|
-
import type { AcceptRefs } from '@/utils';
|
|
8
|
-
|
|
9
|
-
export const loadingModalProps = {
|
|
10
|
-
title: stringProp(),
|
|
11
|
-
message: stringProp(),
|
|
12
|
-
progress: numberProp(),
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export type AGLoadingModalProps = AcceptRefs<
|
|
16
|
-
ObjectWithout<ExtractPropTypes<typeof loadingModalProps>, null | undefined>
|
|
17
|
-
>;
|
|
18
|
-
|
|
19
|
-
export function useLoadingModalProps(): typeof loadingModalProps {
|
|
20
|
-
return loadingModalProps;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
24
|
-
export function useLoadingModal(props: ExtractPropTypes<typeof loadingModalProps>) {
|
|
25
|
-
const renderedMessage = computed(() => props.message ?? translateWithDefault('ui.loading', 'Loading...'));
|
|
26
|
-
const showProgress = computed(() => typeof props.progress === 'number');
|
|
27
|
-
|
|
28
|
-
return { renderedMessage, showProgress };
|
|
29
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<AGModal :cancellable="false">
|
|
3
|
-
<AGMarkdown :text="renderedMessage" />
|
|
4
|
-
</AGModal>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script setup lang="ts">
|
|
8
|
-
import AGModal from './AGModal.vue';
|
|
9
|
-
import { useLoadingModal, useLoadingModalProps } from './AGLoadingModal';
|
|
10
|
-
|
|
11
|
-
import AGMarkdown from '../lib/AGMarkdown.vue';
|
|
12
|
-
|
|
13
|
-
const props = defineProps(useLoadingModalProps());
|
|
14
|
-
const { renderedMessage } = useLoadingModal(props);
|
|
15
|
-
</script>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<AGHeadlessModal
|
|
3
|
-
ref="$modal"
|
|
4
|
-
v-slot="{ close }: IAGHeadlessModalDefaultSlotProps"
|
|
5
|
-
v-bind="props"
|
|
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 p-4">
|
|
10
|
-
<AGHeadlessModalTitle v-if="title" class="mb-2 text-lg font-semibold">
|
|
11
|
-
<AGMarkdown :text="title" inline />
|
|
12
|
-
</AGHeadlessModalTitle>
|
|
13
|
-
<div class="flex max-h-full flex-col overflow-auto" v-bind="$attrs">
|
|
14
|
-
<slot :close="close" />
|
|
15
|
-
</div>
|
|
16
|
-
</AGHeadlessModalPanel>
|
|
17
|
-
</div>
|
|
18
|
-
</AGHeadlessModal>
|
|
19
|
-
</template>
|
|
20
|
-
|
|
21
|
-
<script setup lang="ts">
|
|
22
|
-
import { ref } from 'vue';
|
|
23
|
-
|
|
24
|
-
import { useModalExpose, useModalProps } from '@/components/headless/modals/AGHeadlessModal';
|
|
25
|
-
import type { IAGHeadlessModal, IAGHeadlessModalDefaultSlotProps } from '@/components/headless/modals/AGHeadlessModal';
|
|
26
|
-
|
|
27
|
-
import type { IAGModal } from './AGModal';
|
|
28
|
-
|
|
29
|
-
import AGHeadlessModal from '../headless/modals/AGHeadlessModal.vue';
|
|
30
|
-
import AGHeadlessModalPanel from '../headless/modals/AGHeadlessModalPanel.vue';
|
|
31
|
-
import AGHeadlessModalTitle from '../headless/modals/AGHeadlessModalTitle.vue';
|
|
32
|
-
import AGMarkdown from '../lib/AGMarkdown.vue';
|
|
33
|
-
|
|
34
|
-
const props = defineProps(useModalProps());
|
|
35
|
-
const $modal = ref<IAGHeadlessModal>();
|
|
36
|
-
|
|
37
|
-
defineOptions({ inheritAttrs: false });
|
|
38
|
-
defineExpose<IAGModal>(useModalExpose($modal));
|
|
39
|
-
</script>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { computed } from 'vue';
|
|
2
|
-
import type { ExtractPropTypes } from 'vue';
|
|
3
|
-
import type { ObjectWithout, Pretty, SubPartial } from '@noeldemartin/utils';
|
|
4
|
-
|
|
5
|
-
import { Colors } from '@/components/constants';
|
|
6
|
-
import { enumProp, requiredStringProp, stringProp } from '@/utils';
|
|
7
|
-
import { translateWithDefault } from '@/lang';
|
|
8
|
-
import type { AcceptRefs } from '@/utils';
|
|
9
|
-
|
|
10
|
-
export const promptModalProps = {
|
|
11
|
-
title: stringProp(),
|
|
12
|
-
message: requiredStringProp(),
|
|
13
|
-
label: stringProp(),
|
|
14
|
-
defaultValue: stringProp(),
|
|
15
|
-
placeholder: stringProp(),
|
|
16
|
-
acceptText: stringProp(),
|
|
17
|
-
acceptColor: enumProp(Colors, Colors.Primary),
|
|
18
|
-
cancelText: stringProp(),
|
|
19
|
-
cancelColor: enumProp(Colors, Colors.Clear),
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type AGPromptModalProps = Pretty<
|
|
23
|
-
AcceptRefs<
|
|
24
|
-
SubPartial<
|
|
25
|
-
ObjectWithout<ExtractPropTypes<typeof promptModalProps>, null | undefined>,
|
|
26
|
-
'acceptColor' | 'cancelColor'
|
|
27
|
-
>
|
|
28
|
-
>
|
|
29
|
-
>;
|
|
30
|
-
|
|
31
|
-
export function usePromptModalProps(): typeof promptModalProps {
|
|
32
|
-
return promptModalProps;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
36
|
-
export function usePromptModal(props: ExtractPropTypes<typeof promptModalProps>) {
|
|
37
|
-
const renderedAcceptText = computed(() => props.acceptText ?? translateWithDefault('ui.accept', 'Ok'));
|
|
38
|
-
const renderedCancelText = computed(() => props.cancelText ?? translateWithDefault('ui.cancel', 'Cancel'));
|
|
39
|
-
|
|
40
|
-
return { renderedAcceptText, renderedCancelText };
|
|
41
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<AGModal v-slot="{ close }: IAGModalDefaultSlotProps" :cancellable="false" :title="title">
|
|
3
|
-
<AGMarkdown :text="message" />
|
|
4
|
-
|
|
5
|
-
<AGForm :form="form" @submit="close(form.draft)">
|
|
6
|
-
<AGInput name="draft" :placeholder="placeholder" :label="label" />
|
|
7
|
-
|
|
8
|
-
<div class="mt-2 flex flex-row-reverse gap-2">
|
|
9
|
-
<AGButton :color="acceptColor" submit>
|
|
10
|
-
{{ renderedAcceptText }}
|
|
11
|
-
</AGButton>
|
|
12
|
-
<AGButton :color="cancelColor" @click="close()">
|
|
13
|
-
{{ renderedCancelText }}
|
|
14
|
-
</AGButton>
|
|
15
|
-
</div>
|
|
16
|
-
</AGForm>
|
|
17
|
-
</AGModal>
|
|
18
|
-
</template>
|
|
19
|
-
|
|
20
|
-
<script setup lang="ts">
|
|
21
|
-
import AGModal from './AGModal.vue';
|
|
22
|
-
import { usePromptModal, usePromptModalProps } from './AGPromptModal';
|
|
23
|
-
import type { IAGModalDefaultSlotProps } from './AGModal';
|
|
24
|
-
|
|
25
|
-
import AGButton from '../forms/AGButton.vue';
|
|
26
|
-
import AGForm from '../forms/AGForm.vue';
|
|
27
|
-
import AGInput from '../forms/AGInput.vue';
|
|
28
|
-
import AGMarkdown from '../lib/AGMarkdown.vue';
|
|
29
|
-
import { requiredStringInput, useForm } from '../../forms';
|
|
30
|
-
|
|
31
|
-
const props = defineProps(usePromptModalProps());
|
|
32
|
-
const form = useForm({ draft: requiredStringInput(props.defaultValue ?? '') });
|
|
33
|
-
const { renderedAcceptText, renderedCancelText } = usePromptModal(props);
|
|
34
|
-
</script>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export * from './AGAlertModal';
|
|
2
|
-
export * from './AGConfirmModal';
|
|
3
|
-
export * from './AGErrorReportModal';
|
|
4
|
-
export * from './AGLoadingModal';
|
|
5
|
-
export * from './AGModal';
|
|
6
|
-
export * from './AGModalContext';
|
|
7
|
-
export * from './AGPromptModal';
|
|
8
|
-
|
|
9
|
-
export { default as AGAlertModal } from './AGAlertModal.vue';
|
|
10
|
-
export { default as AGConfirmModal } from './AGConfirmModal.vue';
|
|
11
|
-
export { default as AGErrorReportModalButtons } from './AGErrorReportModalButtons.vue';
|
|
12
|
-
export { default as AGErrorReportModalTitle } from './AGErrorReportModalTitle.vue';
|
|
13
|
-
export { default as AGLoadingModal } from './AGLoadingModal.vue';
|
|
14
|
-
export { default as AGModal } from './AGModal.vue';
|
|
15
|
-
export { default as AGModalContext } from './AGModalContext.vue';
|
|
16
|
-
export { default as AGModalTitle } from './AGModalTitle.vue';
|
|
17
|
-
export { default as AGPromptModal } from './AGPromptModal.vue';
|
package/src/main.histoire.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './assets/histoire.css';
|
package/tailwind.config.js
DELETED
package/tsconfig.json
DELETED
package/vite.config.ts
DELETED
|
@@ -1,17 +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: {
|
|
8
|
-
clearMocks: true,
|
|
9
|
-
setupFiles: ['./src/testing/setup.ts'],
|
|
10
|
-
},
|
|
11
|
-
plugins: [Aerogel(), Icons()],
|
|
12
|
-
resolve: {
|
|
13
|
-
alias: {
|
|
14
|
-
'@': resolve(__dirname, './src'),
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
});
|
|
File without changes
|
|
File without changes
|