@mouseless/baked 0.19.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 (176) hide show
  1. package/README.md +11 -0
  2. package/dist/module.d.mts +45 -0
  3. package/dist/module.json +9 -0
  4. package/dist/module.mjs +110 -0
  5. package/dist/runtime/assets/overrides.css +1 -0
  6. package/dist/runtime/assets/tailwind.css +1 -0
  7. package/dist/runtime/components/AuthorizedContent.d.vue.ts +10 -0
  8. package/dist/runtime/components/AuthorizedContent.vue +14 -0
  9. package/dist/runtime/components/AuthorizedContent.vue.d.ts +10 -0
  10. package/dist/runtime/components/Bake.d.vue.ts +20 -0
  11. package/dist/runtime/components/Bake.vue +50 -0
  12. package/dist/runtime/components/Bake.vue.d.ts +20 -0
  13. package/dist/runtime/components/BasePersistentPopover.d.vue.ts +178 -0
  14. package/dist/runtime/components/BasePersistentPopover.vue +41 -0
  15. package/dist/runtime/components/BasePersistentPopover.vue.d.ts +178 -0
  16. package/dist/runtime/components/CardLink.d.vue.ts +11 -0
  17. package/dist/runtime/components/CardLink.vue +57 -0
  18. package/dist/runtime/components/CardLink.vue.d.ts +11 -0
  19. package/dist/runtime/components/DataPanel.d.vue.ts +20 -0
  20. package/dist/runtime/components/DataPanel.vue +138 -0
  21. package/dist/runtime/components/DataPanel.vue.d.ts +20 -0
  22. package/dist/runtime/components/DataTable.d.vue.ts +11 -0
  23. package/dist/runtime/components/DataTable.vue +213 -0
  24. package/dist/runtime/components/DataTable.vue.d.ts +11 -0
  25. package/dist/runtime/components/DefaultLayout.d.vue.ts +18 -0
  26. package/dist/runtime/components/DefaultLayout.vue +44 -0
  27. package/dist/runtime/components/DefaultLayout.vue.d.ts +18 -0
  28. package/dist/runtime/components/DeferredTabContent.d.vue.ts +16 -0
  29. package/dist/runtime/components/DeferredTabContent.vue +23 -0
  30. package/dist/runtime/components/DeferredTabContent.vue.d.ts +16 -0
  31. package/dist/runtime/components/Error.d.vue.ts +3 -0
  32. package/dist/runtime/components/Error.vue +13 -0
  33. package/dist/runtime/components/Error.vue.d.ts +3 -0
  34. package/dist/runtime/components/ErrorPage.d.vue.ts +11 -0
  35. package/dist/runtime/components/ErrorPage.vue +65 -0
  36. package/dist/runtime/components/ErrorPage.vue.d.ts +11 -0
  37. package/dist/runtime/components/Filter.d.vue.ts +11 -0
  38. package/dist/runtime/components/Filter.vue +23 -0
  39. package/dist/runtime/components/Filter.vue.d.ts +11 -0
  40. package/dist/runtime/components/Header.d.vue.ts +11 -0
  41. package/dist/runtime/components/Header.vue +78 -0
  42. package/dist/runtime/components/Header.vue.d.ts +11 -0
  43. package/dist/runtime/components/Icon.d.vue.ts +11 -0
  44. package/dist/runtime/components/Icon.vue +14 -0
  45. package/dist/runtime/components/Icon.vue.d.ts +11 -0
  46. package/dist/runtime/components/LanguageSwitcher.d.vue.ts +11 -0
  47. package/dist/runtime/components/LanguageSwitcher.vue +57 -0
  48. package/dist/runtime/components/LanguageSwitcher.vue.d.ts +11 -0
  49. package/dist/runtime/components/Layout.d.vue.ts +10 -0
  50. package/dist/runtime/components/Layout.vue +38 -0
  51. package/dist/runtime/components/Layout.vue.d.ts +10 -0
  52. package/dist/runtime/components/Logo.d.vue.ts +9 -0
  53. package/dist/runtime/components/Logo.vue +18 -0
  54. package/dist/runtime/components/Logo.vue.d.ts +9 -0
  55. package/dist/runtime/components/MenuPage.d.vue.ts +11 -0
  56. package/dist/runtime/components/MenuPage.vue +93 -0
  57. package/dist/runtime/components/MenuPage.vue.d.ts +11 -0
  58. package/dist/runtime/components/Message.d.vue.ts +11 -0
  59. package/dist/runtime/components/Message.vue +33 -0
  60. package/dist/runtime/components/Message.vue.d.ts +11 -0
  61. package/dist/runtime/components/ModalLayout.d.vue.ts +18 -0
  62. package/dist/runtime/components/ModalLayout.vue +14 -0
  63. package/dist/runtime/components/ModalLayout.vue.d.ts +18 -0
  64. package/dist/runtime/components/Money.d.vue.ts +11 -0
  65. package/dist/runtime/components/Money.vue +27 -0
  66. package/dist/runtime/components/Money.vue.d.ts +11 -0
  67. package/dist/runtime/components/NavLink.d.vue.ts +11 -0
  68. package/dist/runtime/components/NavLink.vue +30 -0
  69. package/dist/runtime/components/NavLink.vue.d.ts +11 -0
  70. package/dist/runtime/components/None.d.vue.ts +11 -0
  71. package/dist/runtime/components/None.vue +25 -0
  72. package/dist/runtime/components/None.vue.d.ts +11 -0
  73. package/dist/runtime/components/Number.d.vue.ts +11 -0
  74. package/dist/runtime/components/Number.vue +27 -0
  75. package/dist/runtime/components/Number.vue.d.ts +11 -0
  76. package/dist/runtime/components/Page.d.vue.ts +3 -0
  77. package/dist/runtime/components/Page.vue +24 -0
  78. package/dist/runtime/components/Page.vue.d.ts +3 -0
  79. package/dist/runtime/components/PageTitle.d.vue.ts +22 -0
  80. package/dist/runtime/components/PageTitle.vue +171 -0
  81. package/dist/runtime/components/PageTitle.vue.d.ts +22 -0
  82. package/dist/runtime/components/Parameters.d.vue.ts +11 -0
  83. package/dist/runtime/components/Parameters.vue +60 -0
  84. package/dist/runtime/components/Parameters.vue.d.ts +11 -0
  85. package/dist/runtime/components/PersistentPopover.d.vue.ts +46 -0
  86. package/dist/runtime/components/PersistentPopover.vue +335 -0
  87. package/dist/runtime/components/PersistentPopover.vue.d.ts +46 -0
  88. package/dist/runtime/components/QueryParameters.d.vue.ts +11 -0
  89. package/dist/runtime/components/QueryParameters.vue +103 -0
  90. package/dist/runtime/components/QueryParameters.vue.d.ts +11 -0
  91. package/dist/runtime/components/Rate.d.vue.ts +11 -0
  92. package/dist/runtime/components/Rate.vue +22 -0
  93. package/dist/runtime/components/Rate.vue.d.ts +11 -0
  94. package/dist/runtime/components/ReportPage.d.vue.ts +11 -0
  95. package/dist/runtime/components/ReportPage.vue +147 -0
  96. package/dist/runtime/components/ReportPage.vue.d.ts +11 -0
  97. package/dist/runtime/components/Select.d.vue.ts +11 -0
  98. package/dist/runtime/components/Select.vue +120 -0
  99. package/dist/runtime/components/Select.vue.d.ts +11 -0
  100. package/dist/runtime/components/SelectButton.d.vue.ts +11 -0
  101. package/dist/runtime/components/SelectButton.vue +94 -0
  102. package/dist/runtime/components/SelectButton.vue.d.ts +11 -0
  103. package/dist/runtime/components/SideMenu.d.vue.ts +20 -0
  104. package/dist/runtime/components/SideMenu.vue +121 -0
  105. package/dist/runtime/components/SideMenu.vue.d.ts +20 -0
  106. package/dist/runtime/components/SideMenuItem.d.vue.ts +11 -0
  107. package/dist/runtime/components/SideMenuItem.vue +33 -0
  108. package/dist/runtime/components/SideMenuItem.vue.d.ts +11 -0
  109. package/dist/runtime/components/Text.d.vue.ts +11 -0
  110. package/dist/runtime/components/Text.vue +36 -0
  111. package/dist/runtime/components/Text.vue.d.ts +11 -0
  112. package/dist/runtime/composables/useBreakpoints.d.ts +1 -0
  113. package/dist/runtime/composables/useBreakpoints.js +48 -0
  114. package/dist/runtime/composables/useCache.d.ts +13 -0
  115. package/dist/runtime/composables/useCache.js +60 -0
  116. package/dist/runtime/composables/useComponentResolver.d.ts +3 -0
  117. package/dist/runtime/composables/useComponentResolver.js +13 -0
  118. package/dist/runtime/composables/useComposableResolver.d.ts +3 -0
  119. package/dist/runtime/composables/useComposableResolver.js +15 -0
  120. package/dist/runtime/composables/useConditional.d.ts +3 -0
  121. package/dist/runtime/composables/useConditional.js +15 -0
  122. package/dist/runtime/composables/useContext.d.ts +15 -0
  123. package/dist/runtime/composables/useContext.js +60 -0
  124. package/dist/runtime/composables/useDataFetcher.d.ts +15 -0
  125. package/dist/runtime/composables/useDataFetcher.js +203 -0
  126. package/dist/runtime/composables/useFormat.d.ts +16 -0
  127. package/dist/runtime/composables/useFormat.js +116 -0
  128. package/dist/runtime/composables/useLayouts.d.ts +3 -0
  129. package/dist/runtime/composables/useLayouts.js +21 -0
  130. package/dist/runtime/composables/useLocalization.d.ts +6 -0
  131. package/dist/runtime/composables/useLocalization.js +34 -0
  132. package/dist/runtime/composables/useLoginRedirect.d.ts +3 -0
  133. package/dist/runtime/composables/useLoginRedirect.js +15 -0
  134. package/dist/runtime/composables/useMutex.d.ts +3 -0
  135. package/dist/runtime/composables/useMutex.js +26 -0
  136. package/dist/runtime/composables/useNuxtError.d.ts +3 -0
  137. package/dist/runtime/composables/useNuxtError.js +13 -0
  138. package/dist/runtime/composables/useNuxtRoute.d.ts +3 -0
  139. package/dist/runtime/composables/useNuxtRoute.js +13 -0
  140. package/dist/runtime/composables/usePages.d.ts +5 -0
  141. package/dist/runtime/composables/usePages.js +27 -0
  142. package/dist/runtime/composables/useQuery.d.ts +3 -0
  143. package/dist/runtime/composables/useQuery.js +13 -0
  144. package/dist/runtime/composables/useToast.d.ts +1 -0
  145. package/dist/runtime/composables/useToast.js +5 -0
  146. package/dist/runtime/composables/useToken.d.ts +11 -0
  147. package/dist/runtime/composables/useToken.js +99 -0
  148. package/dist/runtime/composables/useUiStates.d.ts +9 -0
  149. package/dist/runtime/composables/useUiStates.js +9 -0
  150. package/dist/runtime/composables/useUnref.d.ts +3 -0
  151. package/dist/runtime/composables/useUnref.js +109 -0
  152. package/dist/runtime/plugins/auth.d.ts +2 -0
  153. package/dist/runtime/plugins/auth.js +81 -0
  154. package/dist/runtime/plugins/baked.d.ts +10 -0
  155. package/dist/runtime/plugins/baked.js +50 -0
  156. package/dist/runtime/plugins/cacheApplication.d.ts +2 -0
  157. package/dist/runtime/plugins/cacheApplication.js +27 -0
  158. package/dist/runtime/plugins/cacheUser.d.ts +2 -0
  159. package/dist/runtime/plugins/cacheUser.js +37 -0
  160. package/dist/runtime/plugins/errorHandling.d.ts +14 -0
  161. package/dist/runtime/plugins/errorHandling.js +96 -0
  162. package/dist/runtime/plugins/fetch.d.ts +2 -0
  163. package/dist/runtime/plugins/fetch.js +80 -0
  164. package/dist/runtime/plugins/localization.d.ts +2 -0
  165. package/dist/runtime/plugins/localization.js +18 -0
  166. package/dist/runtime/plugins/mutex.d.ts +7 -0
  167. package/dist/runtime/plugins/mutex.js +15 -0
  168. package/dist/runtime/plugins/primeVue.d.ts +2 -0
  169. package/dist/runtime/plugins/primeVue.js +75 -0
  170. package/dist/runtime/plugins/toast.d.ts +6 -0
  171. package/dist/runtime/plugins/toast.js +18 -0
  172. package/dist/runtime/plugins/trailingSlash.d.ts +2 -0
  173. package/dist/runtime/plugins/trailingSlash.js +18 -0
  174. package/dist/runtime/server/tsconfig.json +3 -0
  175. package/dist/types.d.mts +3 -0
  176. package/package.json +74 -0
@@ -0,0 +1,178 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ dismissable: {
5
+ type: BooleanConstructor;
6
+ default: boolean;
7
+ };
8
+ appendTo: {
9
+ type: (StringConstructor | ObjectConstructor)[];
10
+ default: string;
11
+ };
12
+ baseZIndex: {
13
+ type: NumberConstructor;
14
+ default: number;
15
+ };
16
+ autoZIndex: {
17
+ type: BooleanConstructor;
18
+ default: boolean;
19
+ };
20
+ breakpoints: {
21
+ type: ObjectConstructor;
22
+ default: null;
23
+ };
24
+ closeOnEscape: {
25
+ type: BooleanConstructor;
26
+ default: boolean;
27
+ };
28
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, typeof BaseComponent, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
29
+ dismissable: {
30
+ type: BooleanConstructor;
31
+ default: boolean;
32
+ };
33
+ appendTo: {
34
+ type: (StringConstructor | ObjectConstructor)[];
35
+ default: string;
36
+ };
37
+ baseZIndex: {
38
+ type: NumberConstructor;
39
+ default: number;
40
+ };
41
+ autoZIndex: {
42
+ type: BooleanConstructor;
43
+ default: boolean;
44
+ };
45
+ breakpoints: {
46
+ type: ObjectConstructor;
47
+ default: null;
48
+ };
49
+ closeOnEscape: {
50
+ type: BooleanConstructor;
51
+ default: boolean;
52
+ };
53
+ }>> & Readonly<{}>, {
54
+ dismissable: boolean;
55
+ appendTo: string | Record<string, any>;
56
+ baseZIndex: number;
57
+ autoZIndex: boolean;
58
+ breakpoints: Record<string, any>;
59
+ closeOnEscape: boolean;
60
+ }, {}, {}, {}, string, () => {
61
+ $pcPopover: import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
62
+ dismissable: {
63
+ type: BooleanConstructor;
64
+ default: boolean;
65
+ };
66
+ appendTo: {
67
+ type: (StringConstructor | ObjectConstructor)[];
68
+ default: string;
69
+ };
70
+ baseZIndex: {
71
+ type: NumberConstructor;
72
+ default: number;
73
+ };
74
+ autoZIndex: {
75
+ type: BooleanConstructor;
76
+ default: boolean;
77
+ };
78
+ breakpoints: {
79
+ type: ObjectConstructor;
80
+ default: null;
81
+ };
82
+ closeOnEscape: {
83
+ type: BooleanConstructor;
84
+ default: boolean;
85
+ };
86
+ }>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, typeof BaseComponent, {}, {}, {}, false, {}, {}, {}, {}, string, {}, any, import("vue").ComponentProvideOptions, {
87
+ P: {};
88
+ B: {};
89
+ D: {};
90
+ C: {};
91
+ M: {};
92
+ Defaults: {};
93
+ }, Readonly<import("vue").ExtractPropTypes<{
94
+ dismissable: {
95
+ type: BooleanConstructor;
96
+ default: boolean;
97
+ };
98
+ appendTo: {
99
+ type: (StringConstructor | ObjectConstructor)[];
100
+ default: string;
101
+ };
102
+ baseZIndex: {
103
+ type: NumberConstructor;
104
+ default: number;
105
+ };
106
+ autoZIndex: {
107
+ type: BooleanConstructor;
108
+ default: boolean;
109
+ };
110
+ breakpoints: {
111
+ type: ObjectConstructor;
112
+ default: null;
113
+ };
114
+ closeOnEscape: {
115
+ type: BooleanConstructor;
116
+ default: boolean;
117
+ };
118
+ }>> & Readonly<{}>, {}, {}, {}, {}, {}>;
119
+ $parentInstance: import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
120
+ dismissable: {
121
+ type: BooleanConstructor;
122
+ default: boolean;
123
+ };
124
+ appendTo: {
125
+ type: (StringConstructor | ObjectConstructor)[];
126
+ default: string;
127
+ };
128
+ baseZIndex: {
129
+ type: NumberConstructor;
130
+ default: number;
131
+ };
132
+ autoZIndex: {
133
+ type: BooleanConstructor;
134
+ default: boolean;
135
+ };
136
+ breakpoints: {
137
+ type: ObjectConstructor;
138
+ default: null;
139
+ };
140
+ closeOnEscape: {
141
+ type: BooleanConstructor;
142
+ default: boolean;
143
+ };
144
+ }>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, typeof BaseComponent, {}, {}, {}, false, {}, {}, {}, {}, string, {}, any, import("vue").ComponentProvideOptions, {
145
+ P: {};
146
+ B: {};
147
+ D: {};
148
+ C: {};
149
+ M: {};
150
+ Defaults: {};
151
+ }, Readonly<import("vue").ExtractPropTypes<{
152
+ dismissable: {
153
+ type: BooleanConstructor;
154
+ default: boolean;
155
+ };
156
+ appendTo: {
157
+ type: (StringConstructor | ObjectConstructor)[];
158
+ default: string;
159
+ };
160
+ baseZIndex: {
161
+ type: NumberConstructor;
162
+ default: number;
163
+ };
164
+ autoZIndex: {
165
+ type: BooleanConstructor;
166
+ default: boolean;
167
+ };
168
+ breakpoints: {
169
+ type: ObjectConstructor;
170
+ default: null;
171
+ };
172
+ closeOnEscape: {
173
+ type: BooleanConstructor;
174
+ default: boolean;
175
+ };
176
+ }>> & Readonly<{}>, {}, {}, {}, {}, {}>;
177
+ }, true, {}, any>;
178
+ import BaseComponent from "@primevue/core/basecomponent";
@@ -0,0 +1,11 @@
1
+ declare const _default: typeof __VLS_export;
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
+ };
@@ -0,0 +1,57 @@
1
+ <template>
2
+ <Button
3
+ :to="route"
4
+ :as="disabled ? 'button' : 'router-link'"
5
+ outlined
6
+ plain
7
+ class="w-auto !p-6"
8
+ :disabled="disabled"
9
+ >
10
+ <div class="flex flex-col gap-4 text-start items-start w-full h-full">
11
+ <div
12
+ v-if="icon || disabled"
13
+ class="flex gap-4"
14
+ >
15
+ <span
16
+ v-if="icon"
17
+ :class="icon"
18
+ class="!text-4xl"
19
+ />
20
+ <Tag
21
+ v-if="disabled"
22
+ severity="secondary"
23
+ >
24
+ {{ l(disabledReason) }}
25
+ </Tag>
26
+ </div>
27
+ <h2 class="text-lg">
28
+ {{ l(title) }}
29
+ </h2>
30
+ <div
31
+ v-if="description"
32
+ data-testid="description"
33
+ class="text-sm"
34
+ >
35
+ {{ l(description) }}
36
+ </div>
37
+ </div>
38
+ </Button>
39
+ </template>
40
+
41
+ <script setup>
42
+ import { Button, Tag } from "primevue";
43
+ import { useLocalization } from "#imports";
44
+ const { localize: l } = useLocalization();
45
+ const { schema } = defineProps({
46
+ schema: { type: null, required: true },
47
+ data: { type: null, default: null }
48
+ });
49
+ const {
50
+ route,
51
+ icon,
52
+ title,
53
+ description,
54
+ disabled,
55
+ disabledReason
56
+ } = schema;
57
+ </script>
@@ -0,0 +1,11 @@
1
+ declare const _default: typeof __VLS_export;
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
+ };
@@ -0,0 +1,20 @@
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<{}, {
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>;
12
+ type __VLS_Slots = {
13
+ parameters?: ((props: {}) => any) | undefined;
14
+ } & {
15
+ parameters?: ((props: {}) => any) | undefined;
16
+ };
17
+ declare const __VLS_props: {
18
+ readonly schema: any;
19
+ readonly data: any;
20
+ };
@@ -0,0 +1,138 @@
1
+ <template>
2
+ <Panel
3
+ ref="panel"
4
+ :header="localizeTitle ? l(title) : title"
5
+ :collapsed="collapsedState"
6
+ toggleable
7
+ :pt="
8
+ {
9
+ headerActions: 'flex gap-2 items-center',
10
+ title: 'max-sm:truncate'
11
+ }
12
+ "
13
+ @update:collapsed="onCollapsed"
14
+ >
15
+ <template
16
+ v-if="$slots.parameters || parameters.length > 0"
17
+ #icons
18
+ >
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
+ />
31
+ </template>
32
+ <template v-else>
33
+ <Button
34
+ v-if="parameters.length > 0 || $slots.parameters"
35
+ variant="text"
36
+ icon="pi pi-sliders-h"
37
+ class="lg:hidden"
38
+ rounded
39
+ @click="togglePopover"
40
+ />
41
+ <PersistentPopover ref="popover">
42
+ <div
43
+ class="
44
+ flex flex-row flex-start
45
+ justify-between w-full
46
+ gap-4 text-xs px-2 py-2
47
+ "
48
+ >
49
+ <Parameters
50
+ v-if="parameters.length > 0"
51
+ :parameters="parameters"
52
+ class="text-xs"
53
+ @ready="onReady"
54
+ @changed="onChanged"
55
+ />
56
+ <slot
57
+ v-if="$slots.parameters"
58
+ name="parameters"
59
+ />
60
+ </div>
61
+ </PersistentPopover>
62
+ </template>
63
+ </template>
64
+ <template #default>
65
+ <Bake
66
+ v-if="loaded && ready"
67
+ :key="uniqueKey"
68
+ name="content"
69
+ :descriptor="content"
70
+ />
71
+ <Message
72
+ v-else-if="!ready"
73
+ severity="info"
74
+ >
75
+ <i class="pi pi-info-circle" />
76
+ <span class="ml-3">{{ lc("Select required values to view this data") }}</span>
77
+ </Message>
78
+ </template>
79
+ </Panel>
80
+ </template>
81
+
82
+ <script setup>
83
+ import { computed, onMounted, ref, useTemplateRef } from "vue";
84
+ import { Message, Panel, Button } from "primevue";
85
+ import { Bake, Parameters, PersistentPopover } from "#components";
86
+ import { useBreakpoints, useContext, useDataFetcher, useUiStates, useLocalization } from "#imports";
87
+ const { value: { panelStates } } = useUiStates();
88
+ const { isMd } = useBreakpoints();
89
+ const context = useContext();
90
+ const dataFetcher = useDataFetcher();
91
+ const { localize: l } = useLocalization();
92
+ const { localize: lc } = useLocalization({ group: "DataPanel" });
93
+ const panel = useTemplateRef("panel");
94
+ const popover = ref();
95
+ function togglePopover(event) {
96
+ popover.value.toggle(event);
97
+ }
98
+ const { schema } = defineProps({
99
+ schema: { type: null, required: true },
100
+ data: { type: null, default: null }
101
+ });
102
+ const { collapsed, content, localizeTitle, parameters, title: titleData } = schema;
103
+ const injectedData = context.injectData();
104
+ const path = context.injectPath();
105
+ const collapsedState = computed(() => panelStates[path] ?? collapsed);
106
+ const loaded = ref(!collapsedState.value);
107
+ const ready = ref(parameters.length === 0);
108
+ const uniqueKey = ref("");
109
+ const values = ref({});
110
+ if (parameters.length > 0) {
111
+ context.provideData(values, "Custom");
112
+ }
113
+ const title = ref(dataFetcher.get({ data: titleData, injectedData }));
114
+ const shouldLoadTitle = dataFetcher.shouldLoad(titleData.type);
115
+ onMounted(async () => {
116
+ if (shouldLoadTitle) {
117
+ title.value = await dataFetcher.fetch({ data: titleData, injectedData });
118
+ }
119
+ });
120
+ function onCollapsed(collapsed2) {
121
+ panelStates[path] = collapsed2;
122
+ if (!collapsed2 && !loaded.value) {
123
+ loaded.value = true;
124
+ }
125
+ if (!collapsed2) {
126
+ setTimeout(() => {
127
+ panel.value.$el.scrollIntoView({ behavior: "smooth", block: "nearest" });
128
+ }, 750);
129
+ }
130
+ }
131
+ function onReady(value) {
132
+ ready.value = value;
133
+ }
134
+ function onChanged(event) {
135
+ uniqueKey.value = event.uniqueKey;
136
+ values.value = event.values;
137
+ }
138
+ </script>
@@ -0,0 +1,20 @@
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<{}, {
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>;
12
+ type __VLS_Slots = {
13
+ parameters?: ((props: {}) => any) | undefined;
14
+ } & {
15
+ parameters?: ((props: {}) => any) | undefined;
16
+ };
17
+ declare const __VLS_props: {
18
+ readonly schema: any;
19
+ readonly data: any;
20
+ };
@@ -0,0 +1,11 @@
1
+ declare const _default: typeof __VLS_export;
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
+ };
@@ -0,0 +1,213 @@
1
+ <template>
2
+ <DataTable
3
+ ref="dataTable"
4
+ :value
5
+ class="text-sm min-h-24"
6
+ striped-rows
7
+ :data-key
8
+ :paginator="paginator && value.length > rows"
9
+ :paginator-template="{
10
+ [screens['2xs']]: 'JumpToPageDropdown',
11
+ [screens.xs]: 'FirstPageLink PrevPageLink JumpToPageDropdown NextPageLink LastPageLink',
12
+ default: 'FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink'
13
+ }"
14
+ :rows
15
+ scrollable
16
+ :scroll-height
17
+ :virtual-scroller-options="scrollHeight ? virtualScrollerOptions : null"
18
+ :csv-separator="exportOptions?.csvSeparator"
19
+ :export-filename
20
+ :export-function
21
+ >
22
+ <template #empty>
23
+ {{ lc("No records found") }}
24
+ </template>
25
+ <Column
26
+ v-for="column in columns"
27
+ :key="column.prop"
28
+ :header="l(column.title)"
29
+ :field="column.prop"
30
+ class="text-nowrap"
31
+ :class="{ 'min-w-40': column.minWidth, 'text-right': column.alignRight }"
32
+ :exportable="column.exportable"
33
+ :export-header="l(column.title)"
34
+ :pt="{
35
+ columnHeaderContent: { class: column.alignRight ? 'justify-end' : '' },
36
+ bodyCell: { class: { 'max-xs:!inset-auto': column.frozen } },
37
+ headerCell: { class: { 'max-xs:!inset-auto': column.frozen } }
38
+ }"
39
+ :frozen="column.frozen"
40
+ >
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>
58
+ </template>
59
+ </Column>
60
+ <Column
61
+ v-if="exportOptions"
62
+ :pt="{
63
+ bodyCell: { class: 'max-xs:!inset-auto' },
64
+ headerCell: { class: 'max-xs:!inset-auto' }
65
+ }"
66
+ :exportable="false"
67
+ class="w-0 py-0"
68
+ frozen
69
+ align-frozen="right"
70
+ >
71
+ <template #header>
72
+ <Button
73
+ type="button"
74
+ icon="pi pi-ellipsis-v"
75
+ severity="secondary"
76
+ variant="text"
77
+ size="small"
78
+ @click="toggleActionsMenu"
79
+ />
80
+ <Menu
81
+ ref="actionsMenu"
82
+ :model="actions"
83
+ :popup="true"
84
+ />
85
+ </template>
86
+ </Column>
87
+ <ColumnGroup
88
+ v-if="footerTemplate"
89
+ type="footer"
90
+ >
91
+ <Row>
92
+ <Column
93
+ :footer="l(footerTemplate.label)"
94
+ :colspan="footerColSpan"
95
+ footer-style="text-align:right"
96
+ />
97
+ <Column
98
+ v-for="column in footerTemplate.columns"
99
+ :key="column.prop"
100
+ :class="{ 'text-right': column.alignRight }"
101
+ >
102
+ <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>
119
+ </template>
120
+ </Column>
121
+ <Column
122
+ v-if="exportOptions"
123
+ :exportable="false"
124
+ class="w-0"
125
+ frozen
126
+ align-frozen="right"
127
+ />
128
+ </Row>
129
+ </ColumnGroup>
130
+ </DataTable>
131
+ </template>
132
+
133
+ <script setup>
134
+ import { computed, onMounted, ref } from "vue";
135
+ import Column from "primevue/column";
136
+ import { Button, ColumnGroup, DataTable, Menu, Row, Skeleton } from "primevue";
137
+ import { useRuntimeConfig } from "#app";
138
+ import { Bake } from "#components";
139
+ import { useComposableResolver, useConditional, useContext, useDataFetcher, useLocalization } from "#imports";
140
+ const conditional = useConditional();
141
+ const context = useContext();
142
+ const composableResolver = useComposableResolver();
143
+ const dataFetcher = useDataFetcher();
144
+ const { localize: l } = useLocalization();
145
+ const { localize: lc } = useLocalization({ group: "DataTable" });
146
+ const { public: { composables: { useBreakpoints: { screens } } } } = useRuntimeConfig();
147
+ const { schema, data } = defineProps({
148
+ schema: { type: null, required: true },
149
+ data: { type: null, required: true }
150
+ });
151
+ const { columns, dataKey, exportOptions, footerTemplate, itemsProp, paginator, rows, rowsWhenLoading, scrollHeight, virtualScrollerOptions } = schema;
152
+ const dataDescriptor = context.injectDataDescriptor();
153
+ const injectedData = context.injectData();
154
+ const loading = context.injectLoading();
155
+ const dataTable = ref();
156
+ const actionsMenu = ref();
157
+ const actions = ref([]);
158
+ const value = computed(() => {
159
+ const items = data ? itemsProp ? data[itemsProp] : data : new Array(rowsWhenLoading || 5).fill({});
160
+ const result = [];
161
+ for (const itemRow of items) {
162
+ const resultRow = { $getRow: () => itemRow };
163
+ for (const column of columns) {
164
+ resultRow[column.prop] = { value: itemRow[column.prop], $getRow: () => itemRow };
165
+ }
166
+ result.push(resultRow);
167
+ }
168
+ return result;
169
+ });
170
+ const footerColSpan = computed(() => columns.length - footerTemplate?.columns.length);
171
+ const exportFilename = ref(exportOptions?.fileName ? l(exportOptions.fileName) : null);
172
+ let formatter = null;
173
+ if (exportOptions) {
174
+ actions.value.push({
175
+ label: l(exportOptions.buttonLabel),
176
+ icon: exportOptions.buttonIcon,
177
+ command: () => dataTable.value.exportCSV()
178
+ });
179
+ }
180
+ onMounted(async () => {
181
+ if (exportOptions) {
182
+ const {
183
+ formatter: formatterName,
184
+ appendParameters,
185
+ parameterSeparator,
186
+ parameterFormatter: parameterFormatterName
187
+ } = exportOptions;
188
+ if (formatterName) {
189
+ formatter = (await composableResolver.resolve(formatterName)).default();
190
+ }
191
+ let parameterFormatter = null;
192
+ if (parameterFormatterName) {
193
+ parameterFormatter = (await composableResolver.resolve(parameterFormatterName)).default();
194
+ }
195
+ if (appendParameters && dataDescriptor) {
196
+ let parameters = await dataFetcher.fetchParameters({ data: dataDescriptor, injectedData });
197
+ if (parameterFormatter) {
198
+ parameters = parameters.map((p, i) => parameterFormatter.format(p, i));
199
+ }
200
+ exportFilename.value = [exportFilename.value, ...parameters].join(parameterSeparator ?? "-");
201
+ }
202
+ }
203
+ });
204
+ function toggleActionsMenu(event) {
205
+ actionsMenu.value.toggle(event);
206
+ }
207
+ function exportFunction({ data: data2, field }) {
208
+ if (!formatter) {
209
+ return data2.value;
210
+ }
211
+ return formatter.format(data2.value, { prop: field, row: data2.$getRow() });
212
+ }
213
+ </script>
@@ -0,0 +1,11 @@
1
+ declare const _default: typeof __VLS_export;
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
+ };
@@ -0,0 +1,18 @@
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<{}, {
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>;
12
+ type __VLS_Slots = {
13
+ default?: ((props: {}) => any) | undefined;
14
+ };
15
+ declare const __VLS_props: {
16
+ readonly schema: any;
17
+ readonly data: any;
18
+ };