@mouseless/baked 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/dist/module.d.mts +1 -1
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +5 -4
  4. package/dist/runtime/components/AwaitLoading.d.ts +14 -0
  5. package/dist/runtime/components/AwaitLoading.js +27 -0
  6. package/dist/runtime/components/Bake.d.vue.ts +25 -11
  7. package/dist/runtime/components/Bake.vue +87 -16
  8. package/dist/runtime/components/Bake.vue.d.ts +25 -11
  9. package/dist/runtime/components/Button.d.vue.ts +27 -0
  10. package/dist/runtime/components/Button.vue +26 -0
  11. package/dist/runtime/components/Button.vue.d.ts +27 -0
  12. package/dist/runtime/components/CardLink.d.vue.ts +11 -9
  13. package/dist/runtime/components/CardLink.vue +1 -2
  14. package/dist/runtime/components/CardLink.vue.d.ts +11 -9
  15. package/dist/runtime/components/Composite.d.vue.ts +13 -0
  16. package/dist/runtime/components/Composite.vue +17 -0
  17. package/dist/runtime/components/Composite.vue.d.ts +13 -0
  18. package/dist/runtime/components/Conditional.d.vue.ts +23 -0
  19. package/dist/runtime/components/Conditional.vue +31 -0
  20. package/dist/runtime/components/Conditional.vue.d.ts +23 -0
  21. package/dist/runtime/components/Contents.d.vue.ts +40 -0
  22. package/dist/runtime/components/Contents.vue +25 -0
  23. package/dist/runtime/components/Contents.vue.d.ts +40 -0
  24. package/dist/runtime/components/DataPanel.d.vue.ts +13 -11
  25. package/dist/runtime/components/DataPanel.vue +35 -36
  26. package/dist/runtime/components/DataPanel.vue.d.ts +13 -11
  27. package/dist/runtime/components/DataTable.d.vue.ts +19 -9
  28. package/dist/runtime/components/DataTable.vue +69 -55
  29. package/dist/runtime/components/DataTable.vue.d.ts +19 -9
  30. package/dist/runtime/components/DefaultLayout.d.vue.ts +11 -9
  31. package/dist/runtime/components/DefaultLayout.vue +1 -2
  32. package/dist/runtime/components/DefaultLayout.vue.d.ts +11 -9
  33. package/dist/runtime/components/DeferredTabContent.d.vue.ts +26 -8
  34. package/dist/runtime/components/DeferredTabContent.vue +4 -3
  35. package/dist/runtime/components/DeferredTabContent.vue.d.ts +26 -8
  36. package/dist/runtime/components/Dialog.d.vue.ts +17 -0
  37. package/dist/runtime/components/Dialog.vue +57 -0
  38. package/dist/runtime/components/Dialog.vue.d.ts +17 -0
  39. package/dist/runtime/components/Error.vue +6 -0
  40. package/dist/runtime/components/ErrorPage.d.vue.ts +20 -8
  41. package/dist/runtime/components/ErrorPage.vue.d.ts +20 -8
  42. package/dist/runtime/components/Fieldset.d.vue.ts +21 -0
  43. package/dist/runtime/components/Fieldset.vue +38 -0
  44. package/dist/runtime/components/Fieldset.vue.d.ts +21 -0
  45. package/dist/runtime/components/Filter.d.vue.ts +23 -9
  46. package/dist/runtime/components/Filter.vue +5 -7
  47. package/dist/runtime/components/Filter.vue.d.ts +23 -9
  48. package/dist/runtime/components/FormPage.d.vue.ts +17 -0
  49. package/dist/runtime/components/FormPage.vue +48 -0
  50. package/dist/runtime/components/FormPage.vue.d.ts +17 -0
  51. package/dist/runtime/components/Header.d.vue.ts +19 -9
  52. package/dist/runtime/components/Header.vue +27 -29
  53. package/dist/runtime/components/Header.vue.d.ts +19 -9
  54. package/dist/runtime/components/Icon.d.vue.ts +11 -9
  55. package/dist/runtime/components/Icon.vue +1 -2
  56. package/dist/runtime/components/Icon.vue.d.ts +11 -9
  57. package/dist/runtime/components/Input.d.vue.ts +25 -0
  58. package/dist/runtime/components/Input.vue +78 -0
  59. package/dist/runtime/components/Input.vue.d.ts +25 -0
  60. package/dist/runtime/components/InputNumber.d.vue.ts +25 -0
  61. package/dist/runtime/components/InputNumber.vue +35 -0
  62. package/dist/runtime/components/InputNumber.vue.d.ts +25 -0
  63. package/dist/runtime/components/InputText.d.vue.ts +25 -0
  64. package/dist/runtime/components/InputText.vue +31 -0
  65. package/dist/runtime/components/InputText.vue.d.ts +25 -0
  66. package/dist/runtime/components/Inputs.d.vue.ts +29 -0
  67. package/dist/runtime/components/Inputs.vue +50 -0
  68. package/dist/runtime/components/Inputs.vue.d.ts +29 -0
  69. package/dist/runtime/components/LanguageSwitcher.d.vue.ts +1 -9
  70. package/dist/runtime/components/LanguageSwitcher.vue +0 -4
  71. package/dist/runtime/components/LanguageSwitcher.vue.d.ts +1 -9
  72. package/dist/runtime/components/Layout.vue +9 -5
  73. package/dist/runtime/components/Logo.d.vue.ts +11 -7
  74. package/dist/runtime/components/Logo.vue.d.ts +11 -7
  75. package/dist/runtime/components/MenuPage.d.vue.ts +11 -9
  76. package/dist/runtime/components/MenuPage.vue +28 -29
  77. package/dist/runtime/components/MenuPage.vue.d.ts +11 -9
  78. package/dist/runtime/components/Message.d.vue.ts +19 -9
  79. package/dist/runtime/components/Message.vue +10 -14
  80. package/dist/runtime/components/Message.vue.d.ts +19 -9
  81. package/dist/runtime/components/MissingComponent.d.vue.ts +21 -0
  82. package/dist/runtime/components/MissingComponent.vue +174 -0
  83. package/dist/runtime/components/MissingComponent.vue.d.ts +21 -0
  84. package/dist/runtime/components/ModalLayout.d.vue.ts +10 -15
  85. package/dist/runtime/components/ModalLayout.vue +0 -7
  86. package/dist/runtime/components/ModalLayout.vue.d.ts +10 -15
  87. package/dist/runtime/components/Money.d.vue.ts +11 -9
  88. package/dist/runtime/components/Money.vue +10 -15
  89. package/dist/runtime/components/Money.vue.d.ts +11 -9
  90. package/dist/runtime/components/NavLink.d.vue.ts +19 -9
  91. package/dist/runtime/components/NavLink.vue +34 -20
  92. package/dist/runtime/components/NavLink.vue.d.ts +19 -9
  93. package/dist/runtime/components/Number.d.vue.ts +11 -9
  94. package/dist/runtime/components/Number.vue +10 -15
  95. package/dist/runtime/components/Number.vue.d.ts +11 -9
  96. package/dist/runtime/components/Page.vue +7 -4
  97. package/dist/runtime/components/PageTitle.d.vue.ts +15 -9
  98. package/dist/runtime/components/PageTitle.vue +39 -8
  99. package/dist/runtime/components/PageTitle.vue.d.ts +15 -9
  100. package/dist/runtime/components/PersistentPopover.vue +1 -1
  101. package/dist/runtime/components/ProvideParentContext.d.vue.ts +28 -0
  102. package/dist/runtime/components/ProvideParentContext.vue +14 -0
  103. package/dist/runtime/components/ProvideParentContext.vue.d.ts +28 -0
  104. package/dist/runtime/components/Rate.d.vue.ts +11 -9
  105. package/dist/runtime/components/Rate.vue +6 -11
  106. package/dist/runtime/components/Rate.vue.d.ts +11 -9
  107. package/dist/runtime/components/Select.d.vue.ts +31 -9
  108. package/dist/runtime/components/Select.vue +30 -49
  109. package/dist/runtime/components/Select.vue.d.ts +31 -9
  110. package/dist/runtime/components/SelectButton.d.vue.ts +31 -9
  111. package/dist/runtime/components/SelectButton.vue +21 -36
  112. package/dist/runtime/components/SelectButton.vue.d.ts +31 -9
  113. package/dist/runtime/components/SideMenu.d.vue.ts +19 -9
  114. package/dist/runtime/components/SideMenu.vue.d.ts +19 -9
  115. package/dist/runtime/components/SideMenuItem.d.vue.ts +19 -9
  116. package/dist/runtime/components/SideMenuItem.vue.d.ts +19 -9
  117. package/dist/runtime/components/SimpleForm.d.vue.ts +17 -0
  118. package/dist/runtime/components/SimpleForm.vue +108 -0
  119. package/dist/runtime/components/SimpleForm.vue.d.ts +17 -0
  120. package/dist/runtime/components/SimplePage.d.vue.ts +13 -0
  121. package/dist/runtime/components/SimplePage.vue +19 -0
  122. package/dist/runtime/components/SimplePage.vue.d.ts +13 -0
  123. package/dist/runtime/components/TabbedPage.d.vue.ts +13 -0
  124. package/dist/runtime/components/{ReportPage.vue → TabbedPage.vue} +47 -65
  125. package/dist/runtime/components/TabbedPage.vue.d.ts +13 -0
  126. package/dist/runtime/components/Text.d.vue.ts +19 -9
  127. package/dist/runtime/components/Text.vue +9 -13
  128. package/dist/runtime/components/Text.vue.d.ts +19 -9
  129. package/dist/runtime/composables/useActionExecuter.d.ts +7 -0
  130. package/dist/runtime/composables/useActionExecuter.js +108 -0
  131. package/dist/runtime/composables/useConstraintEvaluator.d.ts +7 -0
  132. package/dist/runtime/composables/useConstraintEvaluator.js +58 -0
  133. package/dist/runtime/composables/useContext.d.ts +13 -8
  134. package/dist/runtime/composables/useContext.js +42 -18
  135. package/dist/runtime/composables/useDataFetcher.d.ts +6 -6
  136. package/dist/runtime/composables/useDataFetcher.js +66 -40
  137. package/dist/runtime/composables/useEvents.d.ts +7 -0
  138. package/dist/runtime/composables/useEvents.js +33 -0
  139. package/dist/runtime/composables/useFormat.d.ts +0 -1
  140. package/dist/runtime/composables/useFormat.js +0 -13
  141. package/dist/runtime/composables/useLoginRedirect.d.ts +1 -1
  142. package/dist/runtime/composables/useLoginRedirect.js +2 -2
  143. package/dist/runtime/composables/useNuxtError.d.ts +1 -1
  144. package/dist/runtime/composables/useNuxtError.js +2 -2
  145. package/dist/runtime/composables/useNuxtRoute.d.ts +1 -1
  146. package/dist/runtime/composables/useNuxtRoute.js +3 -3
  147. package/dist/runtime/composables/usePathBuilder.d.ts +3 -0
  148. package/dist/runtime/composables/usePathBuilder.js +18 -0
  149. package/dist/runtime/composables/useReactionHandler.d.ts +6 -0
  150. package/dist/runtime/composables/useReactionHandler.js +104 -0
  151. package/dist/runtime/composables/useRedirect.d.ts +3 -0
  152. package/dist/runtime/composables/useRedirect.js +17 -0
  153. package/dist/runtime/composables/useToken.js +2 -2
  154. package/dist/runtime/plugins/auth.js +16 -3
  155. package/dist/runtime/plugins/baked.js +23 -0
  156. package/dist/runtime/plugins/fetch.js +2 -2
  157. package/package.json +18 -18
  158. package/dist/runtime/components/None.d.vue.ts +0 -11
  159. package/dist/runtime/components/None.vue +0 -25
  160. package/dist/runtime/components/None.vue.d.ts +0 -11
  161. package/dist/runtime/components/Parameters.d.vue.ts +0 -11
  162. package/dist/runtime/components/Parameters.vue +0 -61
  163. package/dist/runtime/components/Parameters.vue.d.ts +0 -11
  164. package/dist/runtime/components/QueryParameters.d.vue.ts +0 -11
  165. package/dist/runtime/components/QueryParameters.vue +0 -109
  166. package/dist/runtime/components/QueryParameters.vue.d.ts +0 -11
  167. package/dist/runtime/components/ReportPage.d.vue.ts +0 -11
  168. package/dist/runtime/components/ReportPage.vue.d.ts +0 -11
  169. package/dist/runtime/composables/useConditional.d.ts +0 -3
  170. package/dist/runtime/composables/useConditional.js +0 -15
  171. package/dist/runtime/composables/useQuery.d.ts +0 -3
  172. package/dist/runtime/composables/useQuery.js +0 -13
@@ -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
- $props: Partial<typeof __VLS_props>;
5
- schema: any;
6
- data: any;
7
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
8
- declare const __VLS_props: {
9
- readonly schema: any;
10
- readonly data: any;
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,25 @@
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
+ modelValue: {
9
+ type: import("vue").PropType<any>;
10
+ required: true;
11
+ };
12
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ "update:modelValue": (value: any) => any;
14
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
15
+ schema: {
16
+ type: ObjectConstructor;
17
+ required: true;
18
+ };
19
+ modelValue: {
20
+ type: import("vue").PropType<any>;
21
+ required: true;
22
+ };
23
+ }>> & Readonly<{
24
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
25
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,78 @@
1
+ <template>
2
+ <Bake
3
+ v-model="model"
4
+ :name="schema.name"
5
+ :descriptor="schema.component"
6
+ />
7
+ </template>
8
+
9
+ <script setup>
10
+ import { computed, onMounted, watch } from "vue";
11
+ import { useRoute, useRouter } from "#app";
12
+ import { useContext, useDataFetcher } from "#imports";
13
+ import { Bake } from "#components";
14
+ const context = useContext();
15
+ const dataFetcher = useDataFetcher();
16
+ const route = useRoute();
17
+ const router = useRouter();
18
+ const { schema } = defineProps({
19
+ schema: { type: Object, required: true }
20
+ });
21
+ const model = defineModel({ type: null, required: true });
22
+ const contextData = context.injectContextData();
23
+ let defaultValue = schema.default ? dataFetcher.get({ data: schema.default, contextData }) : void 0;
24
+ const query = schema.queryBound ? computed(() => route.query[schema.name]) : void 0;
25
+ onMounted(async () => {
26
+ if (schema.default && dataFetcher.shouldLoad(schema.default.type)) {
27
+ defaultValue = await dataFetcher.fetch({ data: schema.default, contextData });
28
+ }
29
+ if (schema.queryBound && checkValue(query.value)) {
30
+ model.value = query.value;
31
+ } else {
32
+ await set(defaultValue);
33
+ }
34
+ if (schema.queryBound) {
35
+ watch(() => route.query, async (newQuery) => {
36
+ const newValue = newQuery[schema.name];
37
+ if (!checkValue(newValue) && schema.required && defaultValue) {
38
+ await set(defaultValue);
39
+ return;
40
+ }
41
+ model.value = newValue;
42
+ }, { immediate: true });
43
+ }
44
+ watch(model, async (newValue) => {
45
+ if (!checkValue(newValue)) {
46
+ newValue = schema.required ? defaultValue : void 0;
47
+ }
48
+ await set(newValue);
49
+ });
50
+ });
51
+ async function set(value) {
52
+ if (schema.queryBound) {
53
+ if (value === query.value) {
54
+ return;
55
+ }
56
+ await router.push({
57
+ path: route.path,
58
+ query: {
59
+ ...route.query,
60
+ [schema.name]: value
61
+ },
62
+ // prevents extra browser history when setting default value of input
63
+ replace: schema.required && (schema.default || schema.defaultSelfManaged) && !query.value
64
+ });
65
+ } else {
66
+ if (!value) {
67
+ return;
68
+ }
69
+ model.value = value;
70
+ }
71
+ }
72
+ function checkValue(value) {
73
+ if (typeof value === "string") {
74
+ return value !== "";
75
+ }
76
+ return value !== void 0 && value !== null;
77
+ }
78
+ </script>
@@ -0,0 +1,25 @@
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
+ modelValue: {
9
+ type: import("vue").PropType<any>;
10
+ required: true;
11
+ };
12
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ "update:modelValue": (value: any) => any;
14
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
15
+ schema: {
16
+ type: ObjectConstructor;
17
+ required: true;
18
+ };
19
+ modelValue: {
20
+ type: import("vue").PropType<any>;
21
+ required: true;
22
+ };
23
+ }>> & Readonly<{
24
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
25
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,25 @@
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
+ modelValue: {
9
+ type: import("vue").PropType<any>;
10
+ required: true;
11
+ };
12
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ "update:modelValue": (value: any) => any;
14
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
15
+ schema: {
16
+ type: null;
17
+ required: true;
18
+ };
19
+ modelValue: {
20
+ type: import("vue").PropType<any>;
21
+ required: true;
22
+ };
23
+ }>> & Readonly<{
24
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
25
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,35 @@
1
+ <template>
2
+ <AwaitLoading>
3
+ <template #loading>
4
+ <div class="min-w-60">
5
+ <Skeleton class="min-h-10" />
6
+ </div>
7
+ </template>
8
+ <FloatLabel variant="on">
9
+ <InputNumber
10
+ v-model="model"
11
+ v-bind="$attrs"
12
+ class="min-w-60"
13
+ @input="onInput"
14
+ />
15
+ <label :for="path">{{ l(label) }}</label>
16
+ </FloatLabel>
17
+ </AwaitLoading>
18
+ </template>
19
+
20
+ <script setup>
21
+ import { FloatLabel, InputNumber, Skeleton } from "primevue";
22
+ import { useContext, useLocalization } from "#imports";
23
+ import { AwaitLoading } from "#components";
24
+ const context = useContext();
25
+ const { localize: l } = useLocalization();
26
+ const { schema } = defineProps({
27
+ schema: { type: null, required: true }
28
+ });
29
+ const model = defineModel({ type: null, required: true });
30
+ const { label } = schema;
31
+ const path = context.injectPath();
32
+ function onInput(event) {
33
+ model.value = event.value;
34
+ }
35
+ </script>
@@ -0,0 +1,25 @@
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
+ modelValue: {
9
+ type: import("vue").PropType<any>;
10
+ required: true;
11
+ };
12
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ "update:modelValue": (value: any) => any;
14
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
15
+ schema: {
16
+ type: null;
17
+ required: true;
18
+ };
19
+ modelValue: {
20
+ type: import("vue").PropType<any>;
21
+ required: true;
22
+ };
23
+ }>> & Readonly<{
24
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
25
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,25 @@
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
+ modelValue: {
9
+ type: import("vue").PropType<any>;
10
+ required: true;
11
+ };
12
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ "update:modelValue": (value: any) => any;
14
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
15
+ schema: {
16
+ type: null;
17
+ required: true;
18
+ };
19
+ modelValue: {
20
+ type: import("vue").PropType<any>;
21
+ required: true;
22
+ };
23
+ }>> & Readonly<{
24
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
25
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,31 @@
1
+ <template>
2
+ <AwaitLoading>
3
+ <template #loading>
4
+ <div class="min-w-60">
5
+ <Skeleton class="min-h-10" />
6
+ </div>
7
+ </template>
8
+ <FloatLabel variant="on">
9
+ <InputText
10
+ v-model="model"
11
+ v-bind="$attrs"
12
+ class="min-w-60"
13
+ />
14
+ <label :for="path">{{ l(label) }}</label>
15
+ </FloatLabel>
16
+ </AwaitLoading>
17
+ </template>
18
+
19
+ <script setup>
20
+ import { FloatLabel, InputText, Skeleton } from "primevue";
21
+ import { useContext, useLocalization } from "#imports";
22
+ import { AwaitLoading } from "#components";
23
+ const context = useContext();
24
+ const { localize: l } = useLocalization();
25
+ const { schema } = defineProps({
26
+ schema: { type: null, required: true }
27
+ });
28
+ const model = defineModel({ type: null, required: true });
29
+ const { label } = schema;
30
+ const path = context.injectPath();
31
+ </script>
@@ -0,0 +1,25 @@
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
+ modelValue: {
9
+ type: import("vue").PropType<any>;
10
+ required: true;
11
+ };
12
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ "update:modelValue": (value: any) => any;
14
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
15
+ schema: {
16
+ type: null;
17
+ required: true;
18
+ };
19
+ modelValue: {
20
+ type: import("vue").PropType<any>;
21
+ required: true;
22
+ };
23
+ }>> & Readonly<{
24
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
25
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,29 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ inputs: {
5
+ type: ArrayConstructor;
6
+ required: true;
7
+ };
8
+ inputClass: {
9
+ type: StringConstructor;
10
+ default: string;
11
+ };
12
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ ready: (...args: any[]) => void;
14
+ changed: (...args: any[]) => void;
15
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
16
+ inputs: {
17
+ type: ArrayConstructor;
18
+ required: true;
19
+ };
20
+ inputClass: {
21
+ type: StringConstructor;
22
+ default: string;
23
+ };
24
+ }>> & Readonly<{
25
+ onReady?: ((...args: any[]) => any) | undefined;
26
+ onChanged?: ((...args: any[]) => any) | undefined;
27
+ }>, {
28
+ inputClass: string;
29
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,50 @@
1
+ <template>
2
+ <Input
3
+ v-for="input in inputs"
4
+ :key="input.name"
5
+ v-model="values[input.name]"
6
+ :schema="input"
7
+ :class="inputClass"
8
+ />
9
+ </template>
10
+
11
+ <script setup>
12
+ import { onMounted, watch, reactive } from "vue";
13
+ import { useContext } from "#imports";
14
+ import { Input } from "#components";
15
+ const context = useContext();
16
+ const { inputs } = defineProps({
17
+ inputs: { type: Array, required: true },
18
+ inputClass: { type: String, default: "" }
19
+ });
20
+ const emit = defineEmits(["ready", "changed"]);
21
+ const parentPath = context.injectPath();
22
+ const values = reactive({});
23
+ context.providePath(`${parentPath}/inputs`);
24
+ watch(values, async () => {
25
+ emitChanged();
26
+ emitReady();
27
+ }, { deep: true });
28
+ onMounted(async () => {
29
+ emitChanged();
30
+ emitReady();
31
+ });
32
+ function emitReady() {
33
+ emit(
34
+ "ready",
35
+ inputs.filter((i) => i.required).reduce((result, i) => result && checkValue(values[i.name]), true)
36
+ );
37
+ }
38
+ function emitChanged() {
39
+ emit("changed", {
40
+ uniqueKey: inputs.map((i) => values[i.name]).filter(checkValue).join("-"),
41
+ values
42
+ });
43
+ }
44
+ function checkValue(value) {
45
+ if (typeof value === "string") {
46
+ return value !== "";
47
+ }
48
+ return value !== void 0 && value !== null;
49
+ }
50
+ </script>
@@ -0,0 +1,29 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ inputs: {
5
+ type: ArrayConstructor;
6
+ required: true;
7
+ };
8
+ inputClass: {
9
+ type: StringConstructor;
10
+ default: string;
11
+ };
12
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ ready: (...args: any[]) => void;
14
+ changed: (...args: any[]) => void;
15
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
16
+ inputs: {
17
+ type: ArrayConstructor;
18
+ required: true;
19
+ };
20
+ inputClass: {
21
+ type: StringConstructor;
22
+ default: string;
23
+ };
24
+ }>> & Readonly<{
25
+ onReady?: ((...args: any[]) => any) | undefined;
26
+ onChanged?: ((...args: any[]) => any) | undefined;
27
+ }>, {
28
+ inputClass: string;
29
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,11 +1,3 @@
1
1
  declare const _default: typeof __VLS_export;
2
2
  export default _default;
3
- declare const __VLS_export: import("vue").DefineComponent<{}, {
4
- $props: Partial<typeof __VLS_props>;
5
- schema: any;
6
- data: any;
7
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
8
- declare const __VLS_props: {
9
- readonly schema: any;
10
- readonly data: any;
11
- };
3
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -39,10 +39,6 @@ import { Button, Menu } from "primevue";
39
39
  import { useLocalization } from "#imports";
40
40
  const { locale, getLocales, setLocale, localize: l } = useLocalization();
41
41
  const { localize: lc } = useLocalization({ group: "LanguageSwitcher" });
42
- defineProps({
43
- schema: { type: null, required: true },
44
- data: { type: null, default: null }
45
- });
46
42
  const menu = ref();
47
43
  const model = computed(
48
44
  () => getLocales().map((currentLocale) => ({
@@ -1,11 +1,3 @@
1
1
  declare const _default: typeof __VLS_export;
2
2
  export default _default;
3
- declare const __VLS_export: import("vue").DefineComponent<{}, {
4
- $props: Partial<typeof __VLS_props>;
5
- schema: any;
6
- data: any;
7
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
8
- declare const __VLS_props: {
9
- readonly schema: any;
10
- readonly data: any;
11
- };
3
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -13,17 +13,21 @@
13
13
  </template>
14
14
 
15
15
  <script setup>
16
- import { ref, watch } from "vue";
16
+ import { reactive, ref, watch } from "vue";
17
17
  import { useRoute } from "#app";
18
18
  import { Toast } from "primevue";
19
- import { useLayouts, usePages } from "#imports";
19
+ import { useContext, useEvents, useLayouts, usePages } from "#imports";
20
20
  import { Bake } from "#components";
21
- const route = useRoute();
21
+ const context = useContext();
22
+ const events = useEvents();
22
23
  const layouts = useLayouts();
23
24
  const pages = usePages();
24
- const descriptor = ref(await findLayout(route.params.baked?.[0]));
25
+ const route = useRoute();
26
+ context.provideEvents(events.create());
27
+ context.providePageContext(reactive({}));
28
+ const descriptor = ref(await findLayout(route.matched[0].name));
25
29
  watch(
26
- () => route.params.baked?.[0],
30
+ () => route.matched[0].name,
27
31
  async (newPageName, oldPageName) => {
28
32
  if (newPageName === oldPageName) {
29
33
  return;
@@ -1,9 +1,13 @@
1
1
  declare const _default: typeof __VLS_export;
2
2
  export default _default;
3
- declare const __VLS_export: import("vue").DefineComponent<{}, {
4
- $props: Partial<typeof __VLS_props>;
5
- src: any;
6
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
7
- declare const __VLS_props: {
8
- readonly src: any;
9
- };
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ src: {
5
+ type: null;
6
+ required: true;
7
+ };
8
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
+ src: {
10
+ type: null;
11
+ required: true;
12
+ };
13
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,9 +1,13 @@
1
1
  declare const _default: typeof __VLS_export;
2
2
  export default _default;
3
- declare const __VLS_export: import("vue").DefineComponent<{}, {
4
- $props: Partial<typeof __VLS_props>;
5
- src: any;
6
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
7
- declare const __VLS_props: {
8
- readonly src: any;
9
- };
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ src: {
5
+ type: null;
6
+ required: true;
7
+ };
8
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
+ src: {
10
+ type: null;
11
+ required: true;
12
+ };
13
+ }>> & Readonly<{}>, {}, {}, {}, {}, 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
- $props: Partial<typeof __VLS_props>;
5
- schema: any;
6
- data: any;
7
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
8
- declare const __VLS_props: {
9
- readonly schema: any;
10
- readonly data: any;
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>;
@@ -49,45 +49,44 @@
49
49
  </template>
50
50
 
51
51
  <script setup>
52
+ import { onBeforeUnmount, ref } from "vue";
53
+ import { Divider } from "primevue";
52
54
  import { useRuntimeConfig } from "#app";
53
55
  import { Bake } from "#components";
54
56
  import { useContext, useLocalization } from "#imports";
55
- import { Divider } from "primevue";
56
- import { ref, watch } from "vue";
57
57
  const context = useContext();
58
58
  const { localize: l } = useLocalization();
59
59
  const { localize: lc } = useLocalization({ group: "MenuPage" });
60
60
  const { public: { composables } } = useRuntimeConfig();
61
61
  const { schema } = defineProps({
62
- schema: { type: null, required: true },
63
- data: { type: null, default: null }
62
+ schema: { type: null, required: true }
64
63
  });
65
- const { header, sections, filterPageContextKey } = schema;
64
+ const { header, sections, filterEvent } = schema;
65
+ const path = context.injectPath();
66
66
  const locale = composables?.useFormat?.locale || "en-US";
67
+ const events = context.injectEvents();
67
68
  const sectionsData = ref(sections);
68
- const page = context.injectPage();
69
- if (filterPageContextKey) {
70
- watch(
71
- () => page[filterPageContextKey],
72
- (newValue, oldValue) => {
73
- if (newValue === oldValue || newValue === void 0) {
74
- return;
75
- }
76
- if (!newValue.trim()) {
77
- sectionsData.value = sections;
78
- return;
79
- }
80
- const searchTerm = newValue.toLocaleLowerCase(locale);
81
- const sectionsWithFilteredLinks = sections.map((section) => ({
82
- title: section.title,
83
- links: section.links.filter((link) => {
84
- const title = l(link.title);
85
- return title?.toLocaleLowerCase(locale).startsWith(searchTerm);
86
- })
87
- }));
88
- sectionsData.value = sectionsWithFilteredLinks.filter((section) => section.links.length > 0);
89
- },
90
- { immediate: true }
91
- );
69
+ if (filterEvent) {
70
+ events.on(filterEvent, path, filterSections);
71
+ }
72
+ onBeforeUnmount(() => {
73
+ if (filterEvent) {
74
+ events.off(filterEvent, path);
75
+ }
76
+ });
77
+ function filterSections(filter) {
78
+ if (!filter?.trim()) {
79
+ sectionsData.value = sections;
80
+ return;
81
+ }
82
+ const searchTerm = filter.toLocaleLowerCase(locale);
83
+ const sectionsWithFilteredLinks = sections.map((section) => ({
84
+ title: section.title,
85
+ links: section.links.filter((link) => {
86
+ const title = l(link.title);
87
+ return title?.toLocaleLowerCase(locale).startsWith(searchTerm);
88
+ })
89
+ }));
90
+ sectionsData.value = sectionsWithFilteredLinks.filter((section) => section.links.length > 0);
92
91
  }
93
92
  </script>