@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
@@ -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
+ };
@@ -0,0 +1,25 @@
1
+ <template>
2
+ <div
3
+ class="b-Contents w-full grid grid-cols-1 gap-4 lg:grid-cols-2"
4
+ :class="{ 'max-w-screen-xl 3xl:max-w-screen-2xl': !fullScreen }"
5
+ >
6
+ <slot v-if="$slots.default" />
7
+ <Bake
8
+ v-for="content in contents"
9
+ :key="`content-${content.key}`"
10
+ :name="`${mergedNamePrefix}/${content.key}`"
11
+ :descriptor="content.component"
12
+ :class="{ 'lg:col-span-2': !content.narrow }"
13
+ />
14
+ </div>
15
+ </template>
16
+
17
+ <script setup>
18
+ import { Bake } from "#components";
19
+ const { namePrefix } = defineProps({
20
+ contents: { type: Array, default: () => [] },
21
+ namePrefix: { type: String, default: null },
22
+ fullScreen: { type: Boolean, default: false }
23
+ });
24
+ const mergedNamePrefix = namePrefix ? `${namePrefix}/contents` : "contents";
25
+ </script>
@@ -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
+ };
@@ -4,17 +4,19 @@ 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 = {
13
- parameters?: ((props: {}) => any) | undefined;
19
+ inputs?: ((props: {}) => any) | undefined;
14
20
  } & {
15
- parameters?: ((props: {}) => any) | undefined;
16
- };
17
- declare const __VLS_props: {
18
- readonly schema: any;
19
- readonly data: any;
21
+ inputs?: ((props: {}) => any) | undefined;
20
22
  };
@@ -13,25 +13,26 @@
13
13
  @update:collapsed="onCollapsed"
14
14
  >
15
15
  <template
16
- v-if="$slots.parameters || parameters.length > 0"
16
+ v-if="$slots.inputs || inputs.length > 0"
17
17
  #icons
18
18
  >
19
19
  <template v-if="isMd">
20
- <Parameters
21
- v-if="parameters.length > 0"
22
- :parameters="parameters"
23
- class="text-xs"
24
- @ready="onReady"
25
- @changed="onChanged"
26
- />
27
- <slot
28
- v-if="$slots.parameters"
29
- name="parameters"
30
- />
20
+ <div class="flex gap-2 text-xs">
21
+ <Inputs
22
+ v-if="inputs.length > 0"
23
+ :inputs="inputs"
24
+ @ready="onReady"
25
+ @changed="onChanged"
26
+ />
27
+ <slot
28
+ v-if="$slots.inputs"
29
+ name="inputs"
30
+ />
31
+ </div>
31
32
  </template>
32
33
  <template v-else>
33
34
  <Button
34
- v-if="parameters.length > 0 || $slots.parameters"
35
+ v-if="inputs.length > 0 || $slots.inputs"
35
36
  variant="text"
36
37
  icon="pi pi-sliders-h"
37
38
  class="lg:hidden"
@@ -41,21 +42,20 @@
41
42
  <PersistentPopover ref="popover">
42
43
  <div
43
44
  class="
44
- flex flex-row flex-start
45
- justify-between w-full
46
- gap-4 text-xs px-2 py-2
45
+ flex flex-col gap-2 min-w-24
46
+ w-full px-2 py-2 text-xs
47
47
  "
48
48
  >
49
- <Parameters
50
- v-if="parameters.length > 0"
51
- :parameters="parameters"
52
- class="text-xs"
49
+ <Inputs
50
+ v-if="inputs.length > 0"
51
+ :inputs="inputs"
52
+ input-class="max-md:w-full"
53
53
  @ready="onReady"
54
54
  @changed="onChanged"
55
55
  />
56
56
  <slot
57
- v-if="$slots.parameters"
58
- name="parameters"
57
+ v-if="$slots.inputs"
58
+ name="inputs"
59
59
  />
60
60
  </div>
61
61
  </PersistentPopover>
@@ -82,7 +82,7 @@
82
82
  <script setup>
83
83
  import { computed, onMounted, ref, useTemplateRef } from "vue";
84
84
  import { Message, Panel, Button } from "primevue";
85
- import { Bake, Parameters, PersistentPopover } from "#components";
85
+ import { Bake, Inputs, PersistentPopover } from "#components";
86
86
  import { useBreakpoints, useContext, useDataFetcher, useUiStates, useLocalization } from "#imports";
87
87
  const { value: { panelStates } } = useUiStates();
88
88
  const { isMd } = useBreakpoints();
@@ -91,32 +91,31 @@ const dataFetcher = useDataFetcher();
91
91
  const { localize: l } = useLocalization();
92
92
  const { localize: lc } = useLocalization({ group: "DataPanel" });
93
93
  const panel = useTemplateRef("panel");
94
- const popover = ref();
95
- function togglePopover(event) {
96
- popover.value.toggle(event);
97
- }
98
94
  const { schema } = defineProps({
99
- schema: { type: null, required: true },
100
- data: { type: null, default: null }
95
+ schema: { type: null, required: true }
101
96
  });
102
- const { collapsed, content, localizeTitle, parameters, title: titleData } = schema;
103
- const injectedData = context.injectData();
97
+ const { collapsed, content, inputs, localizeTitle, title: titleData } = schema;
98
+ const contextData = context.injectContextData();
104
99
  const path = context.injectPath();
105
100
  const collapsedState = computed(() => panelStates[path] ?? collapsed);
106
101
  const loaded = ref(!collapsedState.value);
107
- const ready = ref(parameters.length === 0);
102
+ const ready = ref(inputs.length === 0);
108
103
  const uniqueKey = ref("");
104
+ const popover = ref();
109
105
  const values = ref({});
110
- if (parameters.length > 0) {
111
- context.provideData(values, "Custom");
106
+ if (inputs.length > 0) {
107
+ contextData.parent["parameters"] = values;
112
108
  }
113
- const title = ref(dataFetcher.get({ data: titleData, injectedData }));
109
+ const title = ref(dataFetcher.get({ data: titleData, contextData }));
114
110
  const shouldLoadTitle = dataFetcher.shouldLoad(titleData.type);
115
111
  onMounted(async () => {
116
112
  if (shouldLoadTitle) {
117
- title.value = await dataFetcher.fetch({ data: titleData, injectedData });
113
+ title.value = await dataFetcher.fetch({ data: titleData, contextData });
118
114
  }
119
115
  });
116
+ function togglePopover(event) {
117
+ popover.value.toggle(event);
118
+ }
120
119
  function onCollapsed(collapsed2) {
121
120
  panelStates[path] = collapsed2;
122
121
  if (!collapsed2 && !loaded.value) {
@@ -4,17 +4,19 @@ 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 = {
13
- parameters?: ((props: {}) => any) | undefined;
19
+ inputs?: ((props: {}) => any) | undefined;
14
20
  } & {
15
- parameters?: ((props: {}) => any) | undefined;
16
- };
17
- declare const __VLS_props: {
18
- readonly schema: any;
19
- readonly data: any;
21
+ inputs?: ((props: {}) => any) | undefined;
20
22
  };
@@ -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>;
@@ -24,9 +24,9 @@
24
24
  </template>
25
25
  <Column
26
26
  v-for="column in columns"
27
- :key="column.prop"
27
+ :key="column.key"
28
28
  :header="l(column.title)"
29
- :field="column.prop"
29
+ :field="column.key"
30
30
  class="text-nowrap"
31
31
  :class="{ 'min-w-40': column.minWidth, 'text-right': column.alignRight }"
32
32
  :exportable="column.exportable"
@@ -39,50 +39,70 @@
39
39
  :frozen="column.frozen"
40
40
  >
41
41
  <template #body="{ data: row, index }">
42
- <Skeleton
43
- v-if="loading"
44
- class="min-h-5"
45
- />
46
- <Bake
47
- v-else-if="data"
48
- :name="`rows/${index}/${column.prop}`"
49
- :descriptor="{
50
- ...conditional.find(column.component, row.$getRow()),
51
- data: {
52
- type: 'Inline',
53
- value: row[column.prop].value
54
- }
55
- }"
56
- />
57
- <span v-else>-</span>
42
+ <AwaitLoading :skeleton="{ class:'min-h-5' }">
43
+ <ProvideParentContext
44
+ v-if="data"
45
+ :data="row.$getRow()"
46
+ data-key="row"
47
+ >
48
+ <Bake
49
+ :name="`rows/${index}/${column.key}`"
50
+ :descriptor="column.component"
51
+ />
52
+ </ProvideParentContext>
53
+ <span v-else>-</span>
54
+ </AwaitLoading>
58
55
  </template>
59
56
  </Column>
60
57
  <Column
61
- v-if="exportOptions"
58
+ v-if="exportOptions || actions"
62
59
  :pt="{
63
60
  bodyCell: { class: 'max-xs:!inset-auto' },
64
- headerCell: { class: 'max-xs:!inset-auto' }
61
+ headerCell: { class: 'max-xs:!inset-auto' },
62
+ columnHeaderContent: 'justify-end'
65
63
  }"
66
64
  :exportable="false"
67
65
  class="w-0 py-0"
68
66
  frozen
69
67
  align-frozen="right"
70
68
  >
71
- <template #header>
69
+ <template
70
+ v-if="exportOptions"
71
+ #header
72
+ >
72
73
  <Button
73
74
  type="button"
74
75
  icon="pi pi-ellipsis-v"
75
76
  severity="secondary"
76
77
  variant="text"
77
78
  size="small"
78
- @click="toggleActionsMenu"
79
+ @click="toggleHeaderActionsMenu"
79
80
  />
80
81
  <Menu
81
- ref="actionsMenu"
82
- :model="actions"
82
+ ref="headerActionsMenu"
83
+ :model="headerActions"
83
84
  :popup="true"
84
85
  />
85
86
  </template>
87
+ <template
88
+ v-if="actions"
89
+ #body="{ data: row, index }"
90
+ >
91
+ <AwaitLoading :skeleton="{ class:'min-h-5' }">
92
+ <ProvideParentContext
93
+ v-if="data"
94
+ :data="row.$getRow()"
95
+ data-key="row"
96
+ >
97
+ <div class="flex">
98
+ <Bake
99
+ :name="`rows/${index}/actions`"
100
+ :descriptor="actions.component"
101
+ />
102
+ </div>
103
+ </ProvideParentContext>
104
+ </AwaitLoading>
105
+ </template>
86
106
  </Column>
87
107
  <ColumnGroup
88
108
  v-if="footerTemplate"
@@ -96,30 +116,22 @@
96
116
  />
97
117
  <Column
98
118
  v-for="column in footerTemplate.columns"
99
- :key="column.prop"
119
+ :key="column.key"
100
120
  :class="{ 'text-right': column.alignRight }"
101
121
  >
102
122
  <template #footer>
103
- <Skeleton
104
- v-if="loading"
105
- class="min-h-5"
106
- />
107
- <Bake
108
- v-else-if="data"
109
- :name="`rows/footer/${column.prop}`"
110
- :descriptor="{
111
- ...conditional.find(column.component, data),
112
- data: {
113
- type: 'Inline',
114
- value: data[column.prop]
115
- }
116
- }"
117
- />
118
- <span v-else>-</span>
123
+ <AwaitLoading :skeleton="{ class:'min-h-5' }">
124
+ <Bake
125
+ v-if="data"
126
+ :name="`rows/footer/${column.key}`"
127
+ :descriptor="column.component"
128
+ />
129
+ <span v-else>-</span>
130
+ </AwaitLoading>
119
131
  </template>
120
132
  </Column>
121
133
  <Column
122
- v-if="exportOptions"
134
+ v-if="exportOptions || actions"
123
135
  :exportable="false"
124
136
  class="w-0"
125
137
  frozen
@@ -133,11 +145,10 @@
133
145
  <script setup>
134
146
  import { computed, onMounted, ref } from "vue";
135
147
  import Column from "primevue/column";
136
- import { Button, ColumnGroup, DataTable, Menu, Row, Skeleton } from "primevue";
148
+ import { Button, ColumnGroup, DataTable, Menu, Row } from "primevue";
137
149
  import { useRuntimeConfig } from "#app";
138
- import { Bake } from "#components";
139
- import { useComposableResolver, useConditional, useContext, useDataFetcher, useLocalization } from "#imports";
140
- const conditional = useConditional();
150
+ import { AwaitLoading, Bake, ProvideParentContext } from "#components";
151
+ import { useComposableResolver, useContext, useDataFetcher, useLocalization } from "#imports";
141
152
  const context = useContext();
142
153
  const composableResolver = useComposableResolver();
143
154
  const dataFetcher = useDataFetcher();
@@ -148,13 +159,12 @@ const { schema, data } = defineProps({
148
159
  schema: { type: null, required: true },
149
160
  data: { type: null, required: true }
150
161
  });
151
- const { columns, dataKey, exportOptions, footerTemplate, itemsProp, paginator, rows, rowsWhenLoading, scrollHeight, virtualScrollerOptions } = schema;
162
+ const { actions, columns, dataKey, exportOptions, footerTemplate, itemsProp, paginator, rows, rowsWhenLoading, scrollHeight, virtualScrollerOptions } = schema;
163
+ const contextData = context.injectContextData();
152
164
  const dataDescriptor = context.injectDataDescriptor();
153
- const injectedData = context.injectData();
154
- const loading = context.injectLoading();
155
165
  const dataTable = ref();
156
- const actionsMenu = ref();
157
- const actions = ref([]);
166
+ const headerActionsMenu = ref();
167
+ const headerActions = ref([]);
158
168
  const value = computed(() => {
159
169
  const items = data ? itemsProp ? data[itemsProp] : data : new Array(rowsWhenLoading || 5).fill({});
160
170
  const result = [];
@@ -171,7 +181,7 @@ const footerColSpan = computed(() => columns.length - footerTemplate?.columns.le
171
181
  const exportFilename = ref(exportOptions?.fileName ? l(exportOptions.fileName) : null);
172
182
  let formatter = null;
173
183
  if (exportOptions) {
174
- actions.value.push({
184
+ headerActions.value.push({
175
185
  label: l(exportOptions.buttonLabel),
176
186
  icon: exportOptions.buttonIcon,
177
187
  command: () => dataTable.value.exportCSV()
@@ -193,7 +203,7 @@ onMounted(async () => {
193
203
  parameterFormatter = (await composableResolver.resolve(parameterFormatterName)).default();
194
204
  }
195
205
  if (appendParameters && dataDescriptor) {
196
- let parameters = await dataFetcher.fetchParameters({ data: dataDescriptor, injectedData });
206
+ let parameters = await dataFetcher.fetchParameters({ data: dataDescriptor, contextData });
197
207
  if (parameterFormatter) {
198
208
  parameters = parameters.map((p, i) => parameterFormatter.format(p, i));
199
209
  }
@@ -201,8 +211,8 @@ onMounted(async () => {
201
211
  }
202
212
  }
203
213
  });
204
- function toggleActionsMenu(event) {
205
- actionsMenu.value.toggle(event);
214
+ function toggleHeaderActionsMenu(event) {
215
+ headerActionsMenu.value.toggle(event);
206
216
  }
207
217
  function exportFunction({ data: data2, field }) {
208
218
  if (!formatter) {
@@ -211,3 +221,7 @@ function exportFunction({ data: data2, field }) {
211
221
  return formatter.format(data2.value, { prop: field, row: data2.$getRow() });
212
222
  }
213
223
  </script>
224
+
225
+ <style>
226
+ .b-component--DataTable .p-datatable-table-container{max-width:calc(100vw - 4.25rem)}.b-component--DataTable a{@apply text-sm}.b-component--DataTable .p-button{@apply -my-2}
227
+ </style>
@@ -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>;
@@ -4,15 +4,17 @@ 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 = {
13
19
  default?: ((props: {}) => any) | undefined;
14
20
  };
15
- declare const __VLS_props: {
16
- readonly schema: any;
17
- readonly data: any;
18
- };
@@ -35,8 +35,7 @@ import { ScrollTop } from "primevue";
35
35
  import { Bake } from "#components";
36
36
  const route = useRoute();
37
37
  const { schema } = defineProps({
38
- schema: { type: null, required: true },
39
- data: { type: null, default: null }
38
+ schema: { type: null, required: true }
40
39
  });
41
40
  const { header, sideMenu } = schema;
42
41
  const scrollTopOptions = { threshold: 250, ...schema.scrollTopOptions };
@@ -4,15 +4,17 @@ 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 = {
13
19
  default?: ((props: {}) => any) | undefined;
14
20
  };
15
- declare const __VLS_props: {
16
- readonly schema: any;
17
- readonly data: any;
18
- };