@mouseless/baked 1.0.3 → 1.1.1
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/module.d.mts +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +5 -4
- package/dist/runtime/components/AwaitLoading.d.ts +14 -0
- package/dist/runtime/components/AwaitLoading.js +27 -0
- package/dist/runtime/components/Bake.d.vue.ts +25 -11
- package/dist/runtime/components/Bake.vue +87 -16
- package/dist/runtime/components/Bake.vue.d.ts +25 -11
- package/dist/runtime/components/Button.d.vue.ts +27 -0
- package/dist/runtime/components/Button.vue +26 -0
- package/dist/runtime/components/Button.vue.d.ts +27 -0
- package/dist/runtime/components/CardLink.d.vue.ts +11 -9
- package/dist/runtime/components/CardLink.vue +1 -2
- package/dist/runtime/components/CardLink.vue.d.ts +11 -9
- package/dist/runtime/components/Composite.d.vue.ts +13 -0
- package/dist/runtime/components/Composite.vue +17 -0
- package/dist/runtime/components/Composite.vue.d.ts +13 -0
- package/dist/runtime/components/Conditional.d.vue.ts +23 -0
- package/dist/runtime/components/Conditional.vue +31 -0
- package/dist/runtime/components/Conditional.vue.d.ts +23 -0
- package/dist/runtime/components/Contents.d.vue.ts +40 -0
- package/dist/runtime/components/Contents.vue +25 -0
- package/dist/runtime/components/Contents.vue.d.ts +40 -0
- package/dist/runtime/components/DataPanel.d.vue.ts +13 -11
- package/dist/runtime/components/DataPanel.vue +35 -36
- package/dist/runtime/components/DataPanel.vue.d.ts +13 -11
- package/dist/runtime/components/DataTable.d.vue.ts +19 -9
- package/dist/runtime/components/DataTable.vue +69 -55
- package/dist/runtime/components/DataTable.vue.d.ts +19 -9
- package/dist/runtime/components/DefaultLayout.d.vue.ts +11 -9
- package/dist/runtime/components/DefaultLayout.vue +1 -2
- package/dist/runtime/components/DefaultLayout.vue.d.ts +11 -9
- package/dist/runtime/components/DeferredTabContent.d.vue.ts +26 -8
- package/dist/runtime/components/DeferredTabContent.vue +4 -3
- package/dist/runtime/components/DeferredTabContent.vue.d.ts +26 -8
- package/dist/runtime/components/Dialog.d.vue.ts +17 -0
- package/dist/runtime/components/Dialog.vue +57 -0
- package/dist/runtime/components/Dialog.vue.d.ts +17 -0
- package/dist/runtime/components/Error.vue +6 -0
- package/dist/runtime/components/ErrorPage.d.vue.ts +20 -8
- package/dist/runtime/components/ErrorPage.vue.d.ts +20 -8
- package/dist/runtime/components/Fieldset.d.vue.ts +21 -0
- package/dist/runtime/components/Fieldset.vue +38 -0
- package/dist/runtime/components/Fieldset.vue.d.ts +21 -0
- package/dist/runtime/components/Filter.d.vue.ts +23 -9
- package/dist/runtime/components/Filter.vue +5 -7
- package/dist/runtime/components/Filter.vue.d.ts +23 -9
- package/dist/runtime/components/FormPage.d.vue.ts +17 -0
- package/dist/runtime/components/FormPage.vue +48 -0
- package/dist/runtime/components/FormPage.vue.d.ts +17 -0
- package/dist/runtime/components/Header.d.vue.ts +19 -9
- package/dist/runtime/components/Header.vue +27 -29
- package/dist/runtime/components/Header.vue.d.ts +19 -9
- package/dist/runtime/components/Icon.d.vue.ts +11 -9
- package/dist/runtime/components/Icon.vue +1 -2
- package/dist/runtime/components/Icon.vue.d.ts +11 -9
- package/dist/runtime/components/Input.d.vue.ts +25 -0
- package/dist/runtime/components/Input.vue +78 -0
- package/dist/runtime/components/Input.vue.d.ts +25 -0
- package/dist/runtime/components/InputNumber.d.vue.ts +25 -0
- package/dist/runtime/components/InputNumber.vue +35 -0
- package/dist/runtime/components/InputNumber.vue.d.ts +25 -0
- package/dist/runtime/components/InputText.d.vue.ts +25 -0
- package/dist/runtime/components/InputText.vue +31 -0
- package/dist/runtime/components/InputText.vue.d.ts +25 -0
- package/dist/runtime/components/Inputs.d.vue.ts +29 -0
- package/dist/runtime/components/Inputs.vue +50 -0
- package/dist/runtime/components/Inputs.vue.d.ts +29 -0
- package/dist/runtime/components/LanguageSwitcher.d.vue.ts +1 -9
- package/dist/runtime/components/LanguageSwitcher.vue +0 -4
- package/dist/runtime/components/LanguageSwitcher.vue.d.ts +1 -9
- package/dist/runtime/components/Layout.vue +9 -5
- package/dist/runtime/components/Logo.d.vue.ts +11 -7
- package/dist/runtime/components/Logo.vue.d.ts +11 -7
- package/dist/runtime/components/MenuPage.d.vue.ts +11 -9
- package/dist/runtime/components/MenuPage.vue +28 -29
- package/dist/runtime/components/MenuPage.vue.d.ts +11 -9
- package/dist/runtime/components/Message.d.vue.ts +19 -9
- package/dist/runtime/components/Message.vue +10 -14
- package/dist/runtime/components/Message.vue.d.ts +19 -9
- package/dist/runtime/components/MissingComponent.d.vue.ts +21 -0
- package/dist/runtime/components/MissingComponent.vue +174 -0
- package/dist/runtime/components/MissingComponent.vue.d.ts +21 -0
- package/dist/runtime/components/ModalLayout.d.vue.ts +10 -15
- package/dist/runtime/components/ModalLayout.vue +0 -7
- package/dist/runtime/components/ModalLayout.vue.d.ts +10 -15
- package/dist/runtime/components/Money.d.vue.ts +11 -9
- package/dist/runtime/components/Money.vue +10 -15
- package/dist/runtime/components/Money.vue.d.ts +11 -9
- package/dist/runtime/components/NavLink.d.vue.ts +19 -9
- package/dist/runtime/components/NavLink.vue +34 -20
- package/dist/runtime/components/NavLink.vue.d.ts +19 -9
- package/dist/runtime/components/Number.d.vue.ts +11 -9
- package/dist/runtime/components/Number.vue +10 -15
- package/dist/runtime/components/Number.vue.d.ts +11 -9
- package/dist/runtime/components/Page.vue +7 -4
- package/dist/runtime/components/PageTitle.d.vue.ts +15 -9
- package/dist/runtime/components/PageTitle.vue +39 -8
- package/dist/runtime/components/PageTitle.vue.d.ts +15 -9
- package/dist/runtime/components/PersistentPopover.vue +1 -1
- package/dist/runtime/components/ProvideParentContext.d.vue.ts +28 -0
- package/dist/runtime/components/ProvideParentContext.vue +14 -0
- package/dist/runtime/components/ProvideParentContext.vue.d.ts +28 -0
- package/dist/runtime/components/Rate.d.vue.ts +11 -9
- package/dist/runtime/components/Rate.vue +6 -11
- package/dist/runtime/components/Rate.vue.d.ts +11 -9
- package/dist/runtime/components/Select.d.vue.ts +31 -9
- package/dist/runtime/components/Select.vue +30 -49
- package/dist/runtime/components/Select.vue.d.ts +31 -9
- package/dist/runtime/components/SelectButton.d.vue.ts +31 -9
- package/dist/runtime/components/SelectButton.vue +21 -36
- package/dist/runtime/components/SelectButton.vue.d.ts +31 -9
- package/dist/runtime/components/SideMenu.d.vue.ts +19 -9
- package/dist/runtime/components/SideMenu.vue.d.ts +19 -9
- package/dist/runtime/components/SideMenuItem.d.vue.ts +19 -9
- package/dist/runtime/components/SideMenuItem.vue.d.ts +19 -9
- package/dist/runtime/components/SimpleForm.d.vue.ts +17 -0
- package/dist/runtime/components/SimpleForm.vue +108 -0
- package/dist/runtime/components/SimpleForm.vue.d.ts +17 -0
- package/dist/runtime/components/SimplePage.d.vue.ts +13 -0
- package/dist/runtime/components/SimplePage.vue +19 -0
- package/dist/runtime/components/SimplePage.vue.d.ts +13 -0
- package/dist/runtime/components/TabbedPage.d.vue.ts +13 -0
- package/dist/runtime/components/{ReportPage.vue → TabbedPage.vue} +47 -65
- package/dist/runtime/components/TabbedPage.vue.d.ts +13 -0
- package/dist/runtime/components/Text.d.vue.ts +19 -9
- package/dist/runtime/components/Text.vue +9 -13
- package/dist/runtime/components/Text.vue.d.ts +19 -9
- package/dist/runtime/composables/useActionExecuter.d.ts +7 -0
- package/dist/runtime/composables/useActionExecuter.js +108 -0
- package/dist/runtime/composables/useConstraintEvaluator.d.ts +7 -0
- package/dist/runtime/composables/useConstraintEvaluator.js +58 -0
- package/dist/runtime/composables/useContext.d.ts +13 -8
- package/dist/runtime/composables/useContext.js +42 -18
- package/dist/runtime/composables/useDataFetcher.d.ts +6 -6
- package/dist/runtime/composables/useDataFetcher.js +66 -40
- package/dist/runtime/composables/useEvents.d.ts +7 -0
- package/dist/runtime/composables/useEvents.js +33 -0
- package/dist/runtime/composables/useFormat.d.ts +0 -1
- package/dist/runtime/composables/useFormat.js +0 -13
- package/dist/runtime/composables/useLoginRedirect.d.ts +1 -1
- package/dist/runtime/composables/useLoginRedirect.js +2 -2
- package/dist/runtime/composables/useNuxtError.d.ts +1 -1
- package/dist/runtime/composables/useNuxtError.js +2 -2
- package/dist/runtime/composables/useNuxtRoute.d.ts +1 -1
- package/dist/runtime/composables/useNuxtRoute.js +3 -3
- package/dist/runtime/composables/usePathBuilder.d.ts +3 -0
- package/dist/runtime/composables/usePathBuilder.js +18 -0
- package/dist/runtime/composables/useReactionHandler.d.ts +6 -0
- package/dist/runtime/composables/useReactionHandler.js +104 -0
- package/dist/runtime/composables/useRedirect.d.ts +3 -0
- package/dist/runtime/composables/useRedirect.js +17 -0
- package/dist/runtime/composables/useToken.js +2 -2
- package/dist/runtime/plugins/auth.js +16 -3
- package/dist/runtime/plugins/baked.js +23 -0
- package/dist/runtime/plugins/fetch.js +2 -2
- package/package.json +18 -18
- package/dist/runtime/components/None.d.vue.ts +0 -11
- package/dist/runtime/components/None.vue +0 -25
- package/dist/runtime/components/None.vue.d.ts +0 -11
- package/dist/runtime/components/Parameters.d.vue.ts +0 -11
- package/dist/runtime/components/Parameters.vue +0 -61
- package/dist/runtime/components/Parameters.vue.d.ts +0 -11
- package/dist/runtime/components/QueryParameters.d.vue.ts +0 -11
- package/dist/runtime/components/QueryParameters.vue +0 -109
- package/dist/runtime/components/QueryParameters.vue.d.ts +0 -11
- package/dist/runtime/components/ReportPage.d.vue.ts +0 -11
- package/dist/runtime/components/ReportPage.vue.d.ts +0 -11
- package/dist/runtime/composables/useConditional.d.ts +0 -3
- package/dist/runtime/composables/useConditional.js +0 -15
- package/dist/runtime/composables/useQuery.d.ts +0 -3
- package/dist/runtime/composables/useQuery.js +0 -13
package/dist/module.d.mts
CHANGED
|
@@ -2,6 +2,7 @@ import * as _nuxt_schema from '@nuxt/schema';
|
|
|
2
2
|
import { NuxtI18nOptions } from '@nuxtjs/i18n';
|
|
3
3
|
|
|
4
4
|
interface ModuleOptions {
|
|
5
|
+
apiBaseURL: String;
|
|
5
6
|
components?: Components;
|
|
6
7
|
composables: Composables;
|
|
7
8
|
primevue: PrimeVueOptions;
|
|
@@ -23,7 +24,6 @@ interface Composables {
|
|
|
23
24
|
useFormat?: UseFormatOptions;
|
|
24
25
|
}
|
|
25
26
|
interface UseDataFetcherOptions {
|
|
26
|
-
baseURL: String;
|
|
27
27
|
retry?: RetryOptions | Boolean;
|
|
28
28
|
}
|
|
29
29
|
interface RetryOptions {
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { pathToFileURL } from 'url';
|
|
|
3
3
|
import { join } from 'path';
|
|
4
4
|
|
|
5
5
|
const metaUrlResolver = createResolver(import.meta.url);
|
|
6
|
-
const module = defineNuxtModule({
|
|
6
|
+
const module$1 = defineNuxtModule({
|
|
7
7
|
meta: {
|
|
8
8
|
name: "@mouseless/baked",
|
|
9
9
|
configKey: "baked"
|
|
@@ -11,7 +11,7 @@ const module = defineNuxtModule({
|
|
|
11
11
|
defaults: {},
|
|
12
12
|
moduleDependencies: {
|
|
13
13
|
"@nuxtjs/i18n": {
|
|
14
|
-
version: "10.
|
|
14
|
+
version: "10.2.1",
|
|
15
15
|
defaults: {
|
|
16
16
|
strategy: "no_prefix",
|
|
17
17
|
detectBrowserLanguage: {
|
|
@@ -67,6 +67,7 @@ const module = defineNuxtModule({
|
|
|
67
67
|
_nuxt.options.runtimeConfig.public.primevue = _options.primevue;
|
|
68
68
|
_nuxt.options.runtimeConfig.public.components = _options.components;
|
|
69
69
|
_nuxt.options.runtimeConfig.public.composables = _options.composables;
|
|
70
|
+
_nuxt.options.runtimeConfig.public.apiBaseURL = _options.apiBaseURL;
|
|
70
71
|
_nuxt.options.css.push("primeicons/primeicons.css");
|
|
71
72
|
_nuxt.options.css.push(resolver.metaUrl.resolve("./runtime/assets/overrides.css"));
|
|
72
73
|
_nuxt.options.devtools = { enabled: false };
|
|
@@ -77,7 +78,7 @@ const module = defineNuxtModule({
|
|
|
77
78
|
addImportsDir(resolver.metaUrl.resolve("./runtime/composables"));
|
|
78
79
|
for (const plugin of app?.plugins ?? []) {
|
|
79
80
|
_nuxt.options.runtimeConfig.public[plugin.name] = plugin;
|
|
80
|
-
addPlugin(resolver[camelize(plugin.resolver)].resolve(join(plugin.basePath, plugin.name)));
|
|
81
|
+
addPlugin(resolver[camelize(plugin.resolver ?? "MetaUrl")].resolve(join(plugin.basePath, plugin.name)));
|
|
81
82
|
}
|
|
82
83
|
addPlugin(resolver.metaUrl.resolve("./runtime/plugins/mutex"));
|
|
83
84
|
addPlugin(resolver.metaUrl.resolve("./runtime/plugins/toast"));
|
|
@@ -126,4 +127,4 @@ function camelize(str) {
|
|
|
126
127
|
return `${str.charAt(0).toLowerCase()}${str.slice(1)}`;
|
|
127
128
|
}
|
|
128
129
|
|
|
129
|
-
export { module as default };
|
|
130
|
+
export { module$1 as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
namespace props {
|
|
3
|
+
namespace skeleton {
|
|
4
|
+
export let type: ObjectConstructor;
|
|
5
|
+
export let required: boolean;
|
|
6
|
+
function _default(): void;
|
|
7
|
+
export { _default as default };
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
function setup(): (props: any) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}> | undefined;
|
|
13
|
+
}
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { h, useSlots } from "vue";
|
|
2
|
+
import { Skeleton } from "primevue";
|
|
3
|
+
import { useContext } from "#imports";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
props: {
|
|
7
|
+
skeleton: { type: Object, required: false, default: () => { } }
|
|
8
|
+
},
|
|
9
|
+
setup() {
|
|
10
|
+
const context = useContext();
|
|
11
|
+
const slots = useSlots();
|
|
12
|
+
|
|
13
|
+
const loading = context.injectLoading();
|
|
14
|
+
|
|
15
|
+
return props => {
|
|
16
|
+
if(loading.value) {
|
|
17
|
+
if(slots.loading) {
|
|
18
|
+
return slots.loading()[0];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return h(Skeleton, props.skeleton);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return slots.default()[0];
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
};
|
|
@@ -4,17 +4,31 @@ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
|
4
4
|
type __VLS_WithSlots<T, S> = T & (new () => {
|
|
5
5
|
$slots: S;
|
|
6
6
|
});
|
|
7
|
-
declare const __VLS_base: import("vue").DefineComponent<{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
8
|
+
name: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
descriptor: {
|
|
13
|
+
type: null;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
modelValue: {
|
|
17
|
+
type: import("vue").PropType<any>;
|
|
18
|
+
};
|
|
19
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
+
name: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
descriptor: {
|
|
25
|
+
type: null;
|
|
26
|
+
required: true;
|
|
27
|
+
};
|
|
28
|
+
modelValue: {
|
|
29
|
+
type: import("vue").PropType<any>;
|
|
30
|
+
};
|
|
31
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
13
32
|
type __VLS_Slots = {
|
|
14
33
|
default?: ((props: {}) => any) | undefined;
|
|
15
34
|
};
|
|
16
|
-
declare const emit: (event: "loaded", ...args: any[]) => void;
|
|
17
|
-
declare const __VLS_props: {
|
|
18
|
-
readonly name: string;
|
|
19
|
-
readonly descriptor: any;
|
|
20
|
-
};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<component
|
|
3
|
-
:is="
|
|
3
|
+
:is="render()"
|
|
4
|
+
v-if="visible"
|
|
4
5
|
:key="loading"
|
|
5
|
-
v-model="model"
|
|
6
|
-
:schema="descriptor.schema"
|
|
7
|
-
:data
|
|
8
6
|
:class="classes"
|
|
9
7
|
>
|
|
10
8
|
<slot v-if="$slots.default" />
|
|
@@ -12,39 +10,112 @@
|
|
|
12
10
|
</template>
|
|
13
11
|
|
|
14
12
|
<script setup>
|
|
15
|
-
import { onMounted, ref } from "vue";
|
|
16
|
-
import { useComponentResolver, useContext, useDataFetcher, useFormat } from "#imports";
|
|
13
|
+
import { h, nextTick, onBeforeUnmount, onMounted, ref } from "vue";
|
|
14
|
+
import { useActionExecuter, useComponentResolver, useContext, useDataFetcher, useFormat, useReactionHandler } from "#imports";
|
|
15
|
+
const actionExecuter = useActionExecuter();
|
|
17
16
|
const componentResolver = useComponentResolver();
|
|
18
17
|
const context = useContext();
|
|
19
18
|
const dataFetcher = useDataFetcher();
|
|
20
19
|
const { asClasses } = useFormat();
|
|
20
|
+
const reactionHandler = useReactionHandler();
|
|
21
21
|
const { name, descriptor } = defineProps({
|
|
22
22
|
name: { type: String, required: true },
|
|
23
23
|
descriptor: { type: null, required: true }
|
|
24
24
|
});
|
|
25
25
|
const model = defineModel({ type: null });
|
|
26
26
|
const emit = defineEmits(["loaded"]);
|
|
27
|
-
context.
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
27
|
+
const parentPath = context.injectPath();
|
|
28
|
+
const path = parentPath && parentPath !== "" ? `${parentPath}/${name}` : name;
|
|
29
|
+
const events = context.injectEvents();
|
|
30
|
+
const contextData = context.injectContextData();
|
|
31
|
+
const component = componentResolver.resolve(descriptor.type, "MissingComponent");
|
|
32
|
+
const componentProps = buildComponentProps();
|
|
33
|
+
const data = ref(dataFetcher.get({ data: descriptor.data, contextData }));
|
|
32
34
|
const shouldLoad = dataFetcher.shouldLoad(descriptor.data?.type);
|
|
33
35
|
const loading = ref(shouldLoad);
|
|
36
|
+
const executing = ref(false);
|
|
37
|
+
const visible = ref(true);
|
|
34
38
|
const classes = [`b-component--${descriptor.type}`, ...asClasses(name)];
|
|
35
|
-
|
|
39
|
+
let reactions = null;
|
|
40
|
+
context.providePath(path);
|
|
41
|
+
context.provideDataDescriptor(descriptor.data);
|
|
42
|
+
context.provideParentContext({ ...contextData.parent, data });
|
|
43
|
+
context.provideExecuting(executing);
|
|
36
44
|
if (shouldLoad) {
|
|
37
45
|
context.provideLoading(loading);
|
|
38
46
|
}
|
|
47
|
+
if (descriptor.reactions) {
|
|
48
|
+
reactions = reactionHandler.create(`${path}:bake`, {
|
|
49
|
+
reload(success) {
|
|
50
|
+
if (!success) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
load();
|
|
54
|
+
},
|
|
55
|
+
show(success) {
|
|
56
|
+
visible.value = success;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
reactions.bind(descriptor.reactions);
|
|
60
|
+
}
|
|
39
61
|
onMounted(async () => {
|
|
40
|
-
if (
|
|
41
|
-
|
|
62
|
+
if (shouldLoad) {
|
|
63
|
+
await load();
|
|
42
64
|
}
|
|
65
|
+
});
|
|
66
|
+
onBeforeUnmount(() => {
|
|
67
|
+
if (descriptor.reactions) {
|
|
68
|
+
reactions.unbind();
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
async function load() {
|
|
72
|
+
loading.value = true;
|
|
43
73
|
data.value = await dataFetcher.fetch({
|
|
44
74
|
data: descriptor.data,
|
|
45
|
-
|
|
75
|
+
contextData
|
|
46
76
|
});
|
|
47
77
|
loading.value = false;
|
|
48
78
|
emit("loaded");
|
|
49
|
-
}
|
|
79
|
+
}
|
|
80
|
+
function buildComponentProps() {
|
|
81
|
+
const result = {};
|
|
82
|
+
if (descriptor.schema) {
|
|
83
|
+
result.schema = descriptor.schema;
|
|
84
|
+
}
|
|
85
|
+
if (component.emits?.includes("submit")) {
|
|
86
|
+
result.onSubmit = onModelUpdate;
|
|
87
|
+
}
|
|
88
|
+
if (component.props?.modelValue) {
|
|
89
|
+
result["onUpdate:modelValue"] = onModelUpdate;
|
|
90
|
+
nextTick(() => onModelUpdate(model.value));
|
|
91
|
+
}
|
|
92
|
+
return result;
|
|
93
|
+
}
|
|
94
|
+
function render() {
|
|
95
|
+
if (descriptor.data) {
|
|
96
|
+
componentProps.data = data.value;
|
|
97
|
+
}
|
|
98
|
+
if (component.props?.modelValue) {
|
|
99
|
+
componentProps.modelValue = model.value;
|
|
100
|
+
}
|
|
101
|
+
return h(component, componentProps);
|
|
102
|
+
}
|
|
103
|
+
async function onModelUpdate(newModel) {
|
|
104
|
+
if (component.props?.modelValue) {
|
|
105
|
+
model.value = newModel;
|
|
106
|
+
}
|
|
107
|
+
if (!descriptor.action) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
try {
|
|
111
|
+
executing.value = true;
|
|
112
|
+
await actionExecuter.execute({
|
|
113
|
+
action: descriptor.action,
|
|
114
|
+
contextData: { ...contextData, model: newModel },
|
|
115
|
+
events
|
|
116
|
+
});
|
|
117
|
+
} finally {
|
|
118
|
+
executing.value = false;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
50
121
|
</script>
|
|
@@ -4,17 +4,31 @@ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
|
4
4
|
type __VLS_WithSlots<T, S> = T & (new () => {
|
|
5
5
|
$slots: S;
|
|
6
6
|
});
|
|
7
|
-
declare const __VLS_base: import("vue").DefineComponent<{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
8
|
+
name: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
descriptor: {
|
|
13
|
+
type: null;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
modelValue: {
|
|
17
|
+
type: import("vue").PropType<any>;
|
|
18
|
+
};
|
|
19
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
+
name: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
descriptor: {
|
|
25
|
+
type: null;
|
|
26
|
+
required: true;
|
|
27
|
+
};
|
|
28
|
+
modelValue: {
|
|
29
|
+
type: import("vue").PropType<any>;
|
|
30
|
+
};
|
|
31
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
13
32
|
type __VLS_Slots = {
|
|
14
33
|
default?: ((props: {}) => any) | undefined;
|
|
15
34
|
};
|
|
16
|
-
declare const emit: (event: "loaded", ...args: any[]) => void;
|
|
17
|
-
declare const __VLS_props: {
|
|
18
|
-
readonly name: string;
|
|
19
|
-
readonly descriptor: any;
|
|
20
|
-
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
schema: {
|
|
5
|
+
type: null;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
ready: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
default: boolean;
|
|
11
|
+
};
|
|
12
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
submit: (...args: any[]) => void;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
|
+
schema: {
|
|
16
|
+
type: null;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
ready: {
|
|
20
|
+
type: BooleanConstructor;
|
|
21
|
+
default: boolean;
|
|
22
|
+
};
|
|
23
|
+
}>> & Readonly<{
|
|
24
|
+
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
25
|
+
}>, {
|
|
26
|
+
ready: boolean;
|
|
27
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Button
|
|
3
|
+
:disabled="!ready || executing"
|
|
4
|
+
:loading="executing"
|
|
5
|
+
:icon
|
|
6
|
+
:label="l(label)"
|
|
7
|
+
:rounded
|
|
8
|
+
:severity
|
|
9
|
+
:variant
|
|
10
|
+
@click="$emit('submit')"
|
|
11
|
+
/>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup>
|
|
15
|
+
import { useContext, useLocalization } from "#imports";
|
|
16
|
+
import { Button } from "primevue";
|
|
17
|
+
const context = useContext();
|
|
18
|
+
const { localize: l } = useLocalization();
|
|
19
|
+
const { schema } = defineProps({
|
|
20
|
+
schema: { type: null, required: true },
|
|
21
|
+
ready: { type: Boolean, default: true }
|
|
22
|
+
});
|
|
23
|
+
defineEmits(["submit"]);
|
|
24
|
+
const { icon, label, rounded, severity = "secondary", variant } = schema;
|
|
25
|
+
const executing = context.injectExecuting();
|
|
26
|
+
</script>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
schema: {
|
|
5
|
+
type: null;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
ready: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
default: boolean;
|
|
11
|
+
};
|
|
12
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
submit: (...args: any[]) => void;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
|
+
schema: {
|
|
16
|
+
type: null;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
ready: {
|
|
20
|
+
type: BooleanConstructor;
|
|
21
|
+
default: boolean;
|
|
22
|
+
};
|
|
23
|
+
}>> & Readonly<{
|
|
24
|
+
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
25
|
+
}>, {
|
|
26
|
+
ready: boolean;
|
|
27
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
declare const _default: typeof __VLS_export;
|
|
2
2
|
export default _default;
|
|
3
|
-
declare const __VLS_export: import("vue").DefineComponent<{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
schema: {
|
|
5
|
+
type: null;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
+
schema: {
|
|
10
|
+
type: null;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -43,8 +43,7 @@ import { Button, Tag } from "primevue";
|
|
|
43
43
|
import { useLocalization } from "#imports";
|
|
44
44
|
const { localize: l } = useLocalization();
|
|
45
45
|
const { schema } = defineProps({
|
|
46
|
-
schema: { type: null, required: true }
|
|
47
|
-
data: { type: null, default: null }
|
|
46
|
+
schema: { type: null, required: true }
|
|
48
47
|
});
|
|
49
48
|
const {
|
|
50
49
|
route,
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
declare const _default: typeof __VLS_export;
|
|
2
2
|
export default _default;
|
|
3
|
-
declare const __VLS_export: import("vue").DefineComponent<{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
schema: {
|
|
5
|
+
type: null;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
+
schema: {
|
|
10
|
+
type: null;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
schema: {
|
|
5
|
+
type: ObjectConstructor;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
+
schema: {
|
|
10
|
+
type: ObjectConstructor;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Bake
|
|
3
|
+
v-for="(part, i) in parts"
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
:key="`part-${i}`"
|
|
6
|
+
:name="`parts/${i}`"
|
|
7
|
+
:descriptor="part"
|
|
8
|
+
/>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
import { Bake } from "#components";
|
|
13
|
+
const { schema } = defineProps({
|
|
14
|
+
schema: { type: Object, required: true }
|
|
15
|
+
});
|
|
16
|
+
const { parts } = schema;
|
|
17
|
+
</script>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
schema: {
|
|
5
|
+
type: ObjectConstructor;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
+
schema: {
|
|
10
|
+
type: ObjectConstructor;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
schema: {
|
|
5
|
+
type: null;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
data: {
|
|
9
|
+
type: null;
|
|
10
|
+
default: null;
|
|
11
|
+
};
|
|
12
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
schema: {
|
|
14
|
+
type: null;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
data: {
|
|
18
|
+
type: null;
|
|
19
|
+
default: null;
|
|
20
|
+
};
|
|
21
|
+
}>> & Readonly<{}>, {
|
|
22
|
+
data: any;
|
|
23
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<AwaitLoading>
|
|
3
|
+
<Bake
|
|
4
|
+
v-if="data"
|
|
5
|
+
:name="`${path}/${component.type}`"
|
|
6
|
+
:descriptor="component"
|
|
7
|
+
/>
|
|
8
|
+
</AwaitLoading>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
import { computed, useContext } from "#imports";
|
|
13
|
+
import { AwaitLoading, Bake } from "#components";
|
|
14
|
+
const context = useContext();
|
|
15
|
+
const { data, schema } = defineProps({
|
|
16
|
+
schema: { type: null, required: true },
|
|
17
|
+
data: { type: null, default: null }
|
|
18
|
+
});
|
|
19
|
+
const path = context.injectPath();
|
|
20
|
+
const { conditions, fallback } = schema;
|
|
21
|
+
const component = computed(() => {
|
|
22
|
+
if (!conditions) {
|
|
23
|
+
return fallback;
|
|
24
|
+
}
|
|
25
|
+
const successConditions = conditions.filter((condition) => condition.prop && data[condition.prop] === condition.value);
|
|
26
|
+
if (successConditions.length <= 0) {
|
|
27
|
+
return fallback;
|
|
28
|
+
}
|
|
29
|
+
return successConditions[0].component;
|
|
30
|
+
});
|
|
31
|
+
</script>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
schema: {
|
|
5
|
+
type: null;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
data: {
|
|
9
|
+
type: null;
|
|
10
|
+
default: null;
|
|
11
|
+
};
|
|
12
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
schema: {
|
|
14
|
+
type: null;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
data: {
|
|
18
|
+
type: null;
|
|
19
|
+
default: null;
|
|
20
|
+
};
|
|
21
|
+
}>> & Readonly<{}>, {
|
|
22
|
+
data: any;
|
|
23
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
4
|
+
type __VLS_WithSlots<T, S> = T & (new () => {
|
|
5
|
+
$slots: S;
|
|
6
|
+
});
|
|
7
|
+
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
8
|
+
contents: {
|
|
9
|
+
type: ArrayConstructor;
|
|
10
|
+
default: () => never[];
|
|
11
|
+
};
|
|
12
|
+
namePrefix: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: null;
|
|
15
|
+
};
|
|
16
|
+
fullScreen: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
default: boolean;
|
|
19
|
+
};
|
|
20
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
21
|
+
contents: {
|
|
22
|
+
type: ArrayConstructor;
|
|
23
|
+
default: () => never[];
|
|
24
|
+
};
|
|
25
|
+
namePrefix: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
default: null;
|
|
28
|
+
};
|
|
29
|
+
fullScreen: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
default: boolean;
|
|
32
|
+
};
|
|
33
|
+
}>> & Readonly<{}>, {
|
|
34
|
+
contents: unknown[];
|
|
35
|
+
namePrefix: string;
|
|
36
|
+
fullScreen: boolean;
|
|
37
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
38
|
+
type __VLS_Slots = {
|
|
39
|
+
default?: ((props: {}) => any) | undefined;
|
|
40
|
+
};
|