@mouseless/baked 1.0.2 → 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 +34 -23
  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,30 +1,44 @@
1
1
  <template>
2
- <Skeleton
3
- v-if="loading"
4
- height="1.5rem"
5
- />
6
- <Button
7
- v-else-if="data"
8
- as="router-link"
9
- link
10
- :label="l(text)"
11
- :to
12
- />
2
+ <AwaitLoading :skeleton="{ height: '1.5rem' }">
3
+ <Button
4
+ :icon
5
+ :label="data"
6
+ :to
7
+ as="router-link"
8
+ link
9
+ class="m-0 p-0"
10
+ />
11
+ </AwaitLoading>
13
12
  </template>
14
13
 
15
14
  <script setup>
16
- import { computed } from "vue";
17
- import { Button, Skeleton } from "primevue";
18
- import { useContext, useFormat, useLocalization } from "#imports";
15
+ import { computed, onMounted, ref } from "vue";
16
+ import { Button } from "primevue";
17
+ import { useContext, useDataFetcher, usePathBuilder } from "#imports";
18
+ import { AwaitLoading } from "#components";
19
19
  const context = useContext();
20
- const { format } = useFormat();
21
- const { localize: l } = useLocalization();
20
+ const dataFetcher = useDataFetcher();
21
+ const pathBuilder = usePathBuilder();
22
22
  const { schema, data } = defineProps({
23
23
  schema: { type: null, required: true },
24
24
  data: { type: null, required: true }
25
25
  });
26
- const { path, idProp, textProp } = schema;
27
- const loading = context.injectLoading();
28
- const to = computed(() => format(path, [data[idProp]]));
29
- const text = computed(() => data[textProp]);
26
+ const { icon, path, query: queryData, params: paramsData } = schema;
27
+ const contextData = context.injectContextData();
28
+ const query = ref(queryData ? dataFetcher.get({ data: queryData, contextData }) : null);
29
+ const shouldLoadQuery = queryData ? dataFetcher.shouldLoad(queryData.type) : false;
30
+ const params = ref(paramsData ? dataFetcher.get({ data: paramsData, contextData }) : null);
31
+ const shouldLoadParams = paramsData ? dataFetcher.shouldLoad(paramsData.type) : false;
32
+ const to = computed(() => ({
33
+ path: params.value ? pathBuilder.build(path, params.value, { forRoute: true }) : path,
34
+ query: query.value
35
+ }));
36
+ onMounted(async () => {
37
+ if (shouldLoadQuery) {
38
+ query.value = await dataFetcher.fetch({ data: queryData, contextData });
39
+ }
40
+ if (shouldLoadParams) {
41
+ params.value = await dataFetcher.fetch({ data: paramsData, contextData });
42
+ }
43
+ });
30
44
  </script>
@@ -1,11 +1,21 @@
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
+ data: {
9
+ type: null;
10
+ required: true;
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
+ required: true;
20
+ };
21
+ }>> & 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
+ data: {
5
+ type: null;
6
+ required: true;
7
+ };
8
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
+ data: {
10
+ type: null;
11
+ required: true;
12
+ };
13
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,27 +1,22 @@
1
1
  <template>
2
- <Skeleton
3
- v-if="loading"
4
- height="1.5rem"
5
- />
6
- <span
7
- v-else-if="data"
8
- v-tooltip.bottom="tooltip"
9
- class="max-sm:select-none"
10
- >{{ display }}</span>
11
- <span v-else>-</span>
2
+ <AwaitLoading :skeleton="{ height: '1.5rem' }">
3
+ <span
4
+ v-if="data"
5
+ v-tooltip.bottom="tooltip"
6
+ class="max-sm:select-none"
7
+ >{{ display }}</span>
8
+ <span v-else>-</span>
9
+ </AwaitLoading>
12
10
  </template>
13
11
 
14
12
  <script setup>
15
13
  import { computed } from "vue";
16
- import { Skeleton } from "primevue";
17
- import { useContext, useFormat } from "#imports";
18
- const context = useContext();
14
+ import { useFormat } from "#imports";
15
+ import { AwaitLoading } from "#components";
19
16
  const { asNumber } = useFormat();
20
17
  const { data } = defineProps({
21
- schema: { type: null, required: true },
22
18
  data: { type: null, required: true }
23
19
  });
24
- const loading = context.injectLoading();
25
20
  const display = computed(() => asNumber(data));
26
21
  const tooltip = computed(() => display.value.shortened ? `${asNumber(data, { shorten: false })}` : null);
27
22
  </script>
@@ -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
+ data: {
5
+ type: null;
6
+ required: true;
7
+ };
8
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
+ data: {
10
+ type: null;
11
+ required: true;
12
+ };
13
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -9,16 +9,19 @@
9
9
  <script setup>
10
10
  import { reactive } from "vue";
11
11
  import { useRoute, useRuntimeConfig } from "#app";
12
- import { useContext, useFormat, useHead, usePages } from "#imports";
12
+ import { useContext, useEvents, useFormat, useHead, usePages } from "#imports";
13
13
  import { Bake } from "#components";
14
14
  const context = useContext();
15
+ const events = useEvents();
15
16
  const { asClasses } = useFormat();
16
17
  const pages = usePages();
17
18
  const route = useRoute();
18
19
  const { public: { components } } = useRuntimeConfig();
19
20
  useHead({ title: components?.Page?.title });
20
- context.providePage(reactive({}));
21
- const name = route.params?.baked === "" ? "index" : route.params?.baked.join("/");
21
+ context.provideEvents(events.create());
22
+ context.providePageContext(reactive({}));
23
+ const name = route.matched[0].name;
24
+ const className = name.replace("[", "").replace("]", "");
22
25
  const descriptor = await pages.fetch(name);
23
- const classes = [asClasses("page"), asClasses(name, "b-route--")];
26
+ const classes = [asClasses("page"), asClasses(className, "b-route--")];
24
27
  </script>
@@ -4,19 +4,25 @@ 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
- $props: Partial<typeof __VLS_props>;
9
- schema: any;
10
- data: any;
11
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
7
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
+ schema: {
9
+ type: null;
10
+ required: true;
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
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
12
18
  type __VLS_Slots = {
19
+ inputs?: ((props: {}) => any) | undefined;
20
+ } & {
13
21
  actions?: ((props: {}) => any) | undefined;
22
+ } & {
23
+ inputs?: ((props: {}) => any) | undefined;
14
24
  } & {
15
25
  actions?: ((props: {}) => any) | undefined;
16
26
  } & {
17
27
  extra?: ((props: {}) => any) | undefined;
18
28
  };
19
- declare const __VLS_props: {
20
- readonly schema: any;
21
- readonly data: any;
22
- };
@@ -57,6 +57,10 @@
57
57
  "
58
58
  >
59
59
  <template v-if="isMd">
60
+ <slot
61
+ v-if="$slots.inputs"
62
+ name="inputs"
63
+ />
60
64
  <Bake
61
65
  v-for="action in actions"
62
66
  :key="action.schema.name"
@@ -70,15 +74,15 @@
70
74
  </template>
71
75
  <template v-else>
72
76
  <Button
73
- v-if="actions?.length > 0 || $slots.actions"
77
+ v-if="$slots.inputs"
74
78
  variant="text"
75
79
  icon="pi pi-filter"
76
80
  class="lg:hidden"
77
81
  rounded
78
- @click="togglePopover"
82
+ @click="togglePopoverInputs"
79
83
  />
80
84
  <PersistentPopover
81
- ref="popover"
85
+ ref="popoverInputs"
82
86
  fixed
83
87
  >
84
88
  <div
@@ -86,6 +90,30 @@
86
90
  flex flex-col flex-start
87
91
  justify-between w-full
88
92
  gap-4 text-sm px-2 py-2"
93
+ >
94
+ <slot
95
+ v-if="$slots.inputs"
96
+ name="inputs"
97
+ />
98
+ </div>
99
+ </PersistentPopover>
100
+ <Button
101
+ v-if="$slots.actions || actions?.length > 0"
102
+ variant="text"
103
+ icon="pi pi-ellipsis-h"
104
+ class="lg:hidden"
105
+ rounded
106
+ @click="togglePopoverActions"
107
+ />
108
+ <PersistentPopover
109
+ ref="popoverActions"
110
+ fixed
111
+ >
112
+ <div
113
+ class="
114
+ flex flex-col flex-start
115
+ justify-between w-full min-w-52
116
+ gap-4 text-sm px-2 py-2"
89
117
  >
90
118
  <Bake
91
119
  v-for="action in actions"
@@ -116,11 +144,11 @@ const { isMd } = useBreakpoints();
116
144
  const { localize: l } = useLocalization();
117
145
  const { public: { components } } = useRuntimeConfig();
118
146
  const { schema } = defineProps({
119
- schema: { type: null, required: true },
120
- data: { type: null, default: null }
147
+ schema: { type: null, required: true }
121
148
  });
122
149
  const { title, description, actions } = schema;
123
- const popover = ref();
150
+ const popoverInputs = ref();
151
+ const popoverActions = ref();
124
152
  useHead({
125
153
  title: components?.Page?.title ? `${components.Page.title} - ${title}` : title
126
154
  });
@@ -161,8 +189,11 @@ function toggleClasses(element, toggle, classes) {
161
189
  element.classList.toggle(cls, toggle);
162
190
  }
163
191
  }
164
- function togglePopover(event) {
165
- popover.value.toggle(event);
192
+ function togglePopoverInputs(event) {
193
+ popoverInputs.value.toggle(event);
194
+ }
195
+ function togglePopoverActions(event) {
196
+ popoverActions.value.toggle(event);
166
197
  }
167
198
  </script>
168
199
 
@@ -4,19 +4,25 @@ 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
- $props: Partial<typeof __VLS_props>;
9
- schema: any;
10
- data: any;
11
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
7
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
+ schema: {
9
+ type: null;
10
+ required: true;
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
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
12
18
  type __VLS_Slots = {
19
+ inputs?: ((props: {}) => any) | undefined;
20
+ } & {
13
21
  actions?: ((props: {}) => any) | undefined;
22
+ } & {
23
+ inputs?: ((props: {}) => any) | undefined;
14
24
  } & {
15
25
  actions?: ((props: {}) => any) | undefined;
16
26
  } & {
17
27
  extra?: ((props: {}) => any) | undefined;
18
28
  };
19
- declare const __VLS_props: {
20
- readonly schema: any;
21
- readonly data: any;
22
- };
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <Portal :append-to="appendTo">
3
3
  <transition
4
- name="p-popover"
4
+ name="p-anchored-overlay"
5
5
  v-bind="ptm('transition')"
6
6
  @enter="onEnter"
7
7
  @leave="onLeave"
@@ -0,0 +1,28 @@
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
+ data: {
9
+ type: null;
10
+ required: true;
11
+ };
12
+ dataKey: {
13
+ type: StringConstructor;
14
+ required: true;
15
+ };
16
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
17
+ data: {
18
+ type: null;
19
+ required: true;
20
+ };
21
+ dataKey: {
22
+ type: StringConstructor;
23
+ required: true;
24
+ };
25
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
26
+ type __VLS_Slots = {
27
+ default?: ((props: {}) => any) | undefined;
28
+ };
@@ -0,0 +1,14 @@
1
+ <template>
2
+ <slot />
3
+ </template>
4
+
5
+ <script setup>
6
+ import { useContext } from "#imports";
7
+ const context = useContext();
8
+ const { data, dataKey } = defineProps({
9
+ data: { type: null, required: true },
10
+ dataKey: { type: String, required: true }
11
+ });
12
+ const parentContext = context.injectParentContext();
13
+ context.provideParentContext({ ...parentContext, [dataKey]: data });
14
+ </script>
@@ -0,0 +1,28 @@
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
+ data: {
9
+ type: null;
10
+ required: true;
11
+ };
12
+ dataKey: {
13
+ type: StringConstructor;
14
+ required: true;
15
+ };
16
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
17
+ data: {
18
+ type: null;
19
+ required: true;
20
+ };
21
+ dataKey: {
22
+ type: StringConstructor;
23
+ required: true;
24
+ };
25
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
26
+ type __VLS_Slots = {
27
+ default?: ((props: {}) => any) | undefined;
28
+ };
@@ -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
+ data: {
5
+ type: null;
6
+ required: true;
7
+ };
8
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
+ data: {
10
+ type: null;
11
+ required: true;
12
+ };
13
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,22 +1,17 @@
1
1
  <template>
2
- <Skeleton
3
- v-if="loading"
4
- height="1.5rem"
5
- />
6
- <span v-else-if="data">{{ display }}</span>
7
- <span v-else>-</span>
2
+ <AwaitLoading :skeleton="{ height: '1.5rem' }">
3
+ <span v-if="data">{{ display }}</span>
4
+ <span v-else>-</span>
5
+ </AwaitLoading>
8
6
  </template>
9
7
 
10
8
  <script setup>
11
9
  import { computed } from "vue";
12
- import { Skeleton } from "primevue";
13
- import { useContext, useFormat } from "#imports";
14
- const context = useContext();
10
+ import { useFormat } from "#imports";
11
+ import { AwaitLoading } from "#components";
15
12
  const { asPercentage } = useFormat();
16
13
  const { data } = defineProps({
17
- schema: { type: null, required: true },
18
14
  data: { type: null, required: true }
19
15
  });
20
- const loading = context.injectLoading();
21
16
  const display = computed(() => asPercentage(data));
22
17
  </script>
@@ -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
+ data: {
5
+ type: null;
6
+ required: true;
7
+ };
8
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
+ data: {
10
+ type: null;
11
+ required: true;
12
+ };
13
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,11 +1,33 @@
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
+ data: {
9
+ type: null;
10
+ required: true;
11
+ };
12
+ modelValue: {
13
+ type: import("vue").PropType<any>;
14
+ required: true;
15
+ };
16
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
+ "update:modelValue": (value: any) => any;
18
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
19
+ schema: {
20
+ type: null;
21
+ required: true;
22
+ };
23
+ data: {
24
+ type: null;
25
+ required: true;
26
+ };
27
+ modelValue: {
28
+ type: import("vue").PropType<any>;
29
+ required: true;
30
+ };
31
+ }>> & Readonly<{
32
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
33
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;