@mouseless/baked 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/dist/module.d.mts +1 -1
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +5 -4
  4. package/dist/runtime/components/AwaitLoading.d.ts +14 -0
  5. package/dist/runtime/components/AwaitLoading.js +27 -0
  6. package/dist/runtime/components/Bake.d.vue.ts +25 -11
  7. package/dist/runtime/components/Bake.vue +87 -16
  8. package/dist/runtime/components/Bake.vue.d.ts +25 -11
  9. package/dist/runtime/components/Button.d.vue.ts +27 -0
  10. package/dist/runtime/components/Button.vue +26 -0
  11. package/dist/runtime/components/Button.vue.d.ts +27 -0
  12. package/dist/runtime/components/CardLink.d.vue.ts +11 -9
  13. package/dist/runtime/components/CardLink.vue +1 -2
  14. package/dist/runtime/components/CardLink.vue.d.ts +11 -9
  15. package/dist/runtime/components/Composite.d.vue.ts +13 -0
  16. package/dist/runtime/components/Composite.vue +17 -0
  17. package/dist/runtime/components/Composite.vue.d.ts +13 -0
  18. package/dist/runtime/components/Conditional.d.vue.ts +23 -0
  19. package/dist/runtime/components/Conditional.vue +31 -0
  20. package/dist/runtime/components/Conditional.vue.d.ts +23 -0
  21. package/dist/runtime/components/Contents.d.vue.ts +40 -0
  22. package/dist/runtime/components/Contents.vue +25 -0
  23. package/dist/runtime/components/Contents.vue.d.ts +40 -0
  24. package/dist/runtime/components/DataPanel.d.vue.ts +13 -11
  25. package/dist/runtime/components/DataPanel.vue +35 -36
  26. package/dist/runtime/components/DataPanel.vue.d.ts +13 -11
  27. package/dist/runtime/components/DataTable.d.vue.ts +19 -9
  28. package/dist/runtime/components/DataTable.vue +69 -55
  29. package/dist/runtime/components/DataTable.vue.d.ts +19 -9
  30. package/dist/runtime/components/DefaultLayout.d.vue.ts +11 -9
  31. package/dist/runtime/components/DefaultLayout.vue +1 -2
  32. package/dist/runtime/components/DefaultLayout.vue.d.ts +11 -9
  33. package/dist/runtime/components/DeferredTabContent.d.vue.ts +26 -8
  34. package/dist/runtime/components/DeferredTabContent.vue +4 -3
  35. package/dist/runtime/components/DeferredTabContent.vue.d.ts +26 -8
  36. package/dist/runtime/components/Dialog.d.vue.ts +17 -0
  37. package/dist/runtime/components/Dialog.vue +57 -0
  38. package/dist/runtime/components/Dialog.vue.d.ts +17 -0
  39. package/dist/runtime/components/Error.vue +6 -0
  40. package/dist/runtime/components/ErrorPage.d.vue.ts +20 -8
  41. package/dist/runtime/components/ErrorPage.vue.d.ts +20 -8
  42. package/dist/runtime/components/Fieldset.d.vue.ts +21 -0
  43. package/dist/runtime/components/Fieldset.vue +38 -0
  44. package/dist/runtime/components/Fieldset.vue.d.ts +21 -0
  45. package/dist/runtime/components/Filter.d.vue.ts +23 -9
  46. package/dist/runtime/components/Filter.vue +5 -7
  47. package/dist/runtime/components/Filter.vue.d.ts +23 -9
  48. package/dist/runtime/components/FormPage.d.vue.ts +17 -0
  49. package/dist/runtime/components/FormPage.vue +48 -0
  50. package/dist/runtime/components/FormPage.vue.d.ts +17 -0
  51. package/dist/runtime/components/Header.d.vue.ts +19 -9
  52. package/dist/runtime/components/Header.vue +27 -29
  53. package/dist/runtime/components/Header.vue.d.ts +19 -9
  54. package/dist/runtime/components/Icon.d.vue.ts +11 -9
  55. package/dist/runtime/components/Icon.vue +1 -2
  56. package/dist/runtime/components/Icon.vue.d.ts +11 -9
  57. package/dist/runtime/components/Input.d.vue.ts +25 -0
  58. package/dist/runtime/components/Input.vue +78 -0
  59. package/dist/runtime/components/Input.vue.d.ts +25 -0
  60. package/dist/runtime/components/InputNumber.d.vue.ts +25 -0
  61. package/dist/runtime/components/InputNumber.vue +35 -0
  62. package/dist/runtime/components/InputNumber.vue.d.ts +25 -0
  63. package/dist/runtime/components/InputText.d.vue.ts +25 -0
  64. package/dist/runtime/components/InputText.vue +31 -0
  65. package/dist/runtime/components/InputText.vue.d.ts +25 -0
  66. package/dist/runtime/components/Inputs.d.vue.ts +29 -0
  67. package/dist/runtime/components/Inputs.vue +50 -0
  68. package/dist/runtime/components/Inputs.vue.d.ts +29 -0
  69. package/dist/runtime/components/LanguageSwitcher.d.vue.ts +1 -9
  70. package/dist/runtime/components/LanguageSwitcher.vue +0 -4
  71. package/dist/runtime/components/LanguageSwitcher.vue.d.ts +1 -9
  72. package/dist/runtime/components/Layout.vue +9 -5
  73. package/dist/runtime/components/Logo.d.vue.ts +11 -7
  74. package/dist/runtime/components/Logo.vue.d.ts +11 -7
  75. package/dist/runtime/components/MenuPage.d.vue.ts +11 -9
  76. package/dist/runtime/components/MenuPage.vue +28 -29
  77. package/dist/runtime/components/MenuPage.vue.d.ts +11 -9
  78. package/dist/runtime/components/Message.d.vue.ts +19 -9
  79. package/dist/runtime/components/Message.vue +10 -14
  80. package/dist/runtime/components/Message.vue.d.ts +19 -9
  81. package/dist/runtime/components/MissingComponent.d.vue.ts +21 -0
  82. package/dist/runtime/components/MissingComponent.vue +174 -0
  83. package/dist/runtime/components/MissingComponent.vue.d.ts +21 -0
  84. package/dist/runtime/components/ModalLayout.d.vue.ts +10 -15
  85. package/dist/runtime/components/ModalLayout.vue +0 -7
  86. package/dist/runtime/components/ModalLayout.vue.d.ts +10 -15
  87. package/dist/runtime/components/Money.d.vue.ts +11 -9
  88. package/dist/runtime/components/Money.vue +10 -15
  89. package/dist/runtime/components/Money.vue.d.ts +11 -9
  90. package/dist/runtime/components/NavLink.d.vue.ts +19 -9
  91. package/dist/runtime/components/NavLink.vue +34 -20
  92. package/dist/runtime/components/NavLink.vue.d.ts +19 -9
  93. package/dist/runtime/components/Number.d.vue.ts +11 -9
  94. package/dist/runtime/components/Number.vue +10 -15
  95. package/dist/runtime/components/Number.vue.d.ts +11 -9
  96. package/dist/runtime/components/Page.vue +7 -4
  97. package/dist/runtime/components/PageTitle.d.vue.ts +15 -9
  98. package/dist/runtime/components/PageTitle.vue +39 -8
  99. package/dist/runtime/components/PageTitle.vue.d.ts +15 -9
  100. package/dist/runtime/components/PersistentPopover.vue +1 -1
  101. package/dist/runtime/components/ProvideParentContext.d.vue.ts +28 -0
  102. package/dist/runtime/components/ProvideParentContext.vue +14 -0
  103. package/dist/runtime/components/ProvideParentContext.vue.d.ts +28 -0
  104. package/dist/runtime/components/Rate.d.vue.ts +11 -9
  105. package/dist/runtime/components/Rate.vue +6 -11
  106. package/dist/runtime/components/Rate.vue.d.ts +11 -9
  107. package/dist/runtime/components/Select.d.vue.ts +31 -9
  108. package/dist/runtime/components/Select.vue +30 -49
  109. package/dist/runtime/components/Select.vue.d.ts +31 -9
  110. package/dist/runtime/components/SelectButton.d.vue.ts +31 -9
  111. package/dist/runtime/components/SelectButton.vue +21 -36
  112. package/dist/runtime/components/SelectButton.vue.d.ts +31 -9
  113. package/dist/runtime/components/SideMenu.d.vue.ts +19 -9
  114. package/dist/runtime/components/SideMenu.vue.d.ts +19 -9
  115. package/dist/runtime/components/SideMenuItem.d.vue.ts +19 -9
  116. package/dist/runtime/components/SideMenuItem.vue.d.ts +19 -9
  117. package/dist/runtime/components/SimpleForm.d.vue.ts +17 -0
  118. package/dist/runtime/components/SimpleForm.vue +108 -0
  119. package/dist/runtime/components/SimpleForm.vue.d.ts +17 -0
  120. package/dist/runtime/components/SimplePage.d.vue.ts +13 -0
  121. package/dist/runtime/components/SimplePage.vue +19 -0
  122. package/dist/runtime/components/SimplePage.vue.d.ts +13 -0
  123. package/dist/runtime/components/TabbedPage.d.vue.ts +13 -0
  124. package/dist/runtime/components/{ReportPage.vue → TabbedPage.vue} +47 -65
  125. package/dist/runtime/components/TabbedPage.vue.d.ts +13 -0
  126. package/dist/runtime/components/Text.d.vue.ts +19 -9
  127. package/dist/runtime/components/Text.vue +9 -13
  128. package/dist/runtime/components/Text.vue.d.ts +19 -9
  129. package/dist/runtime/composables/useActionExecuter.d.ts +7 -0
  130. package/dist/runtime/composables/useActionExecuter.js +108 -0
  131. package/dist/runtime/composables/useConstraintEvaluator.d.ts +7 -0
  132. package/dist/runtime/composables/useConstraintEvaluator.js +58 -0
  133. package/dist/runtime/composables/useContext.d.ts +13 -8
  134. package/dist/runtime/composables/useContext.js +42 -18
  135. package/dist/runtime/composables/useDataFetcher.d.ts +6 -6
  136. package/dist/runtime/composables/useDataFetcher.js +66 -40
  137. package/dist/runtime/composables/useEvents.d.ts +7 -0
  138. package/dist/runtime/composables/useEvents.js +33 -0
  139. package/dist/runtime/composables/useFormat.d.ts +0 -1
  140. package/dist/runtime/composables/useFormat.js +0 -13
  141. package/dist/runtime/composables/useLoginRedirect.d.ts +1 -1
  142. package/dist/runtime/composables/useLoginRedirect.js +2 -2
  143. package/dist/runtime/composables/useNuxtError.d.ts +1 -1
  144. package/dist/runtime/composables/useNuxtError.js +2 -2
  145. package/dist/runtime/composables/useNuxtRoute.d.ts +1 -1
  146. package/dist/runtime/composables/useNuxtRoute.js +3 -3
  147. package/dist/runtime/composables/usePathBuilder.d.ts +3 -0
  148. package/dist/runtime/composables/usePathBuilder.js +18 -0
  149. package/dist/runtime/composables/useReactionHandler.d.ts +6 -0
  150. package/dist/runtime/composables/useReactionHandler.js +104 -0
  151. package/dist/runtime/composables/useRedirect.d.ts +3 -0
  152. package/dist/runtime/composables/useRedirect.js +17 -0
  153. package/dist/runtime/composables/useToken.js +2 -2
  154. package/dist/runtime/plugins/auth.js +16 -3
  155. package/dist/runtime/plugins/baked.js +23 -0
  156. package/dist/runtime/plugins/fetch.js +2 -2
  157. package/package.json +18 -18
  158. package/dist/runtime/components/None.d.vue.ts +0 -11
  159. package/dist/runtime/components/None.vue +0 -25
  160. package/dist/runtime/components/None.vue.d.ts +0 -11
  161. package/dist/runtime/components/Parameters.d.vue.ts +0 -11
  162. package/dist/runtime/components/Parameters.vue +0 -61
  163. package/dist/runtime/components/Parameters.vue.d.ts +0 -11
  164. package/dist/runtime/components/QueryParameters.d.vue.ts +0 -11
  165. package/dist/runtime/components/QueryParameters.vue +0 -109
  166. package/dist/runtime/components/QueryParameters.vue.d.ts +0 -11
  167. package/dist/runtime/components/ReportPage.d.vue.ts +0 -11
  168. package/dist/runtime/components/ReportPage.vue.d.ts +0 -11
  169. package/dist/runtime/composables/useConditional.d.ts +0 -3
  170. package/dist/runtime/composables/useConditional.js +0 -15
  171. package/dist/runtime/composables/useQuery.d.ts +0 -3
  172. package/dist/runtime/composables/useQuery.js +0 -13
@@ -1,11 +1,13 @@
1
1
  declare const _default: typeof __VLS_export;
2
2
  export default _default;
3
- declare const __VLS_export: import("vue").DefineComponent<{}, {
4
- $props: Partial<typeof __VLS_props>;
5
- schema: any;
6
- data: any;
7
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
8
- declare const __VLS_props: {
9
- readonly schema: any;
10
- readonly data: any;
11
- };
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ schema: {
5
+ type: null;
6
+ required: true;
7
+ };
8
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
+ schema: {
10
+ type: null;
11
+ required: true;
12
+ };
13
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -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>;
@@ -9,25 +9,21 @@
9
9
  >
10
10
  <i :class="`pi ${icon}`" />
11
11
  </template>
12
- <Skeleton
13
- v-if="loading"
14
- height="1.5rem"
15
- width="100%"
16
- />
17
- <span v-else-if="data">{{ localizeMessage ? l(data) : data }}</span>
18
- <span v-else>-</span>
12
+ <AwaitLoading :skeleton="{ height: '1.5rem', width: '100%' }">
13
+ <span v-if="data">{{ localizeMessage ? l(data) : data }}</span>
14
+ <span v-else>-</span>
15
+ </AwaitLoading>
19
16
  </Message>
20
17
  </template>
21
18
 
22
19
  <script setup>
23
- import { Message, Skeleton } from "primevue";
24
- import { useContext, useLocalization } from "#imports";
25
- const context = useContext();
20
+ import { Message } from "primevue";
21
+ import { useLocalization } from "#imports";
22
+ import { AwaitLoading } from "#components";
26
23
  const { localize: l } = useLocalization();
27
- const { schema } = defineProps({
28
- schema: { type: null, default: null },
29
- data: { type: null, default: null }
24
+ const { schema, data } = defineProps({
25
+ schema: { type: null, required: true },
26
+ data: { type: null, required: true }
30
27
  });
31
28
  const { icon, severity, localizeMessage } = schema;
32
- const loading = context.injectLoading();
33
29
  </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>;
@@ -0,0 +1,21 @@
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
+ 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>;
@@ -0,0 +1,174 @@
1
+ <template>
2
+ <AwaitLoading :skeleton="{ height:'2rem', class:'inline-block bg-red-500/20' }">
3
+ <Button
4
+ v-if="inlinesData"
5
+ v-bind="$attrs"
6
+ :label
7
+ size="small"
8
+ severity="danger"
9
+ class="px-1 py-0 hover:underline"
10
+ @click="visible = true"
11
+ />
12
+ <Button
13
+ v-else
14
+ v-bind="$attrs"
15
+ :label
16
+ size="small"
17
+ severity="danger"
18
+ icon="pi pi-plus"
19
+ @click="visible = true"
20
+ />
21
+ </AwaitLoading>
22
+ <Dialog
23
+ v-model:visible="visible"
24
+ header="Missing Component"
25
+ modal
26
+ dismissable-mask
27
+ class="min-w-[500px] max-w-[750px] mx-4"
28
+ >
29
+ <div class="flex flex-col gap-4 w-full">
30
+ <code v-if="path">{{ path.join('/') }}</code>
31
+ <span>A component descriptor is required but missing here.</span>
32
+ <span v-if="code">
33
+ You can use below convention in your theme feature
34
+ (<code>...ThemeFeature.cs</code>) or in one of your UI override
35
+ features (<code>...UiOverrideFeature.cs</code>).
36
+ </span>
37
+ <code
38
+ v-if="code"
39
+ class="flex flex-col"
40
+ >
41
+ <Button
42
+ :icon="copied ? 'pi pi-check' : 'pi pi-copy'"
43
+ variant="text"
44
+ severity="secondary"
45
+ size="small"
46
+ class="self-end p-1 hover:bg-transparent hover:text-white"
47
+ @click="copyToClipboard"
48
+ />
49
+ <!-- eslint-disable vue/no-v-html -->
50
+ <pre
51
+ class="-mt-[2.5em]"
52
+ v-html="highlightedCode"
53
+ />
54
+ <!-- eslint-enable vue/no-v-html -->
55
+ </code>
56
+ <template v-if="!inlinesData && data">
57
+ <Divider class="m-0" />
58
+ <Panel
59
+ header="Expand to see the data"
60
+ collapsed
61
+ toggleable
62
+ class="border-none"
63
+ :pt="{ header: 'p-0', content: 'px-0' }"
64
+ >
65
+ <code>
66
+ <!-- eslint-disable vue/no-v-html -->
67
+ <pre v-html="highlightedData" />
68
+ <!-- eslint-enable vue/no-v-html -->
69
+ </code>
70
+ </Panel>
71
+ </template>
72
+ </div>
73
+ </Dialog>
74
+ </template>
75
+
76
+ <script setup>
77
+ import { computed, ref } from "vue";
78
+ import { Button, Dialog, Panel, Divider } from "primevue";
79
+ import { AwaitLoading } from "#components";
80
+ const { schema, data } = defineProps({
81
+ schema: { type: null, required: true },
82
+ data: { type: null, required: true }
83
+ });
84
+ const { component, path, source } = schema;
85
+ const inlinesData = data !== void 0 && typeof data !== "object";
86
+ const label = inlinesData ? data : "Configure";
87
+ const visible = ref(false);
88
+ const copied = ref(false);
89
+ const code = computed(() => {
90
+ if (!source) {
91
+ return null;
92
+ }
93
+ if (!source.type) {
94
+ return null;
95
+ }
96
+ return source.type.startsWith("Type") ? renderTypeSample(source.path) : source.type.startsWith("Property") ? renderPropertySample(source.path) : source.type.startsWith("Method") ? renderMethodSample(source.path) : source.type.startsWith("Parameter") ? renderParameterSample(source.path) : null;
97
+ });
98
+ const highlightedCode = computed(() => {
99
+ if (!code.value) {
100
+ return null;
101
+ }
102
+ return highlightCSharp(code.value);
103
+ });
104
+ const highlightedData = computed(() => {
105
+ if (inlinesData) {
106
+ return null;
107
+ }
108
+ return highlightJson(JSON.stringify(data, null, 2));
109
+ });
110
+ function renderTypeSample([type]) {
111
+ return String.raw`builder.Conventions.AddTypeComponent${component ? `<${component}>` : ""}(
112
+ when: c => c.Type.Is<${type}>(),
113
+ where: cc => cc.Path.EndsWith(${path.map((p) => `"${p}"`).join(", ")}),
114
+ component: () => ${component ? "..." : "B.Text()"}
115
+ );`;
116
+ }
117
+ function renderPropertySample([type, property]) {
118
+ return String.raw`builder.Conventions.AddPropertyComponent${component ? `<${component}>` : ""}(
119
+ when: c => c.Type.Is<${type}>() && c.Property.Name == nameof(${type}.${property}),
120
+ where: cc => cc.Path.EndsWith(${path.map((p) => `"${p}"`).join(", ")}),
121
+ component: () => ${component ? "..." : "B.Text()"}
122
+ );`;
123
+ }
124
+ function renderMethodSample([type, method]) {
125
+ return String.raw`builder.Conventions.AddMethodComponent${component ? `<${component}>` : ""}(
126
+ when: c => c.Type.Is<${type}>() && c.Method.Name == nameof(${type}.${method}),
127
+ where: cc => cc.Path.EndsWith(${path.map((p) => `"${p}"`).join(", ")}),
128
+ component: () => ${component ? "..." : "B.DataTable()"}
129
+ );`;
130
+ }
131
+ function renderParameterSample([type, method, parameter]) {
132
+ return String.raw`builder.Conventions.AddParameterComponent${component ? `<${component}>` : ""}(
133
+ when: c => c.Type.Is<${type}>() && c.Method.Name == nameof(${type}.${method}) && c.Parameter.Name == "${parameter}",
134
+ where: cc => cc.Path.EndsWith(${path.map((p) => `"${p}"`).join(", ")}),
135
+ component: () => ${component ? "..." : "B.InputText()"}
136
+ );`;
137
+ }
138
+ async function copyToClipboard() {
139
+ try {
140
+ await navigator.clipboard.writeText(code.value);
141
+ copied.value = true;
142
+ setTimeout(() => copied.value = false, 1e3);
143
+ } catch {
144
+ console.log("clipboard copy failed");
145
+ }
146
+ }
147
+ function highlightCSharp(src) {
148
+ if (!src) return "";
149
+ let s = src.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/=/g, "&equals;");
150
+ const kw = ["nameof"];
151
+ const kwRe = new RegExp(`\\b(${kw.join("|")})\\b`, "g");
152
+ s = s.replace(kwRe, "<span class='c--code-keyword'>$1</span>");
153
+ s = s.replace(/\/\/.*$/gm, (m) => `<span class='c--code-comment'>${m}</span>`);
154
+ s = s.replace(/"([^"]*)"/g, `<span class='c--code-string'>"$1"</span>`);
155
+ s = s.replace(
156
+ /(\w+)\s*(&lt;[^&]+&gt;)?\s*\(/g,
157
+ (_, name, generic) => `<span class='c--code-method'>${name}</span>` + (generic ? `<span class='c--code-type'>${generic}</span>` : "") + "("
158
+ );
159
+ s = s.replace(/((\w|&lt;|&gt;)+)\s*\(/g, "<span class='c--code-method'>$1</span>(");
160
+ s = s.replace(/(\.|\(|\)|&amp;|&lt;|&gt;|&equals;)/g, "<span class='c--code-symbol'>$1</span>");
161
+ return s;
162
+ }
163
+ function highlightJson(src) {
164
+ if (!src) return "";
165
+ let s = src.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/=/g, "&equals;");
166
+ s = s.replace(/"([^"]*)"/g, `<span class='c--code-string'>"$1"</span>`);
167
+ s = s.replace(/(\{|\}|\[|\]|&equals;)/g, "<span class='c--code-symbol'>$1</span>");
168
+ return s;
169
+ }
170
+ </script>
171
+
172
+ <style>
173
+ code:not(:has(pre)){@apply rounded p-1 text-xs bg-zinc-50 text-orange-700 dark:bg-zinc-950 dark:text-orange-400}pre{@apply block rounded-lg overflow-auto max-h-[20em] bg-zinc-950 p-4 text-xs text-sky-300}pre .c--code-comment{@apply text-green-800}pre .c--code-string{@apply text-orange-400}pre .c--code-keyword{@apply text-purple-400}pre .c--code-symbol{@apply text-gray-100}pre .c--code-type{@apply text-blue-400}pre .c--code-method{@apply text-yellow-100}
174
+ </style>
@@ -0,0 +1,21 @@
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
+ 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,18 +1,13 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
1
7
  declare const _default: typeof __VLS_export;
2
8
  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;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
18
13
  };
@@ -5,10 +5,3 @@
5
5
  </div>
6
6
  </div>
7
7
  </template>
8
-
9
- <script setup>
10
- defineProps({
11
- schema: { type: null, default: null },
12
- data: { type: null, default: null }
13
- });
14
- </script>
@@ -1,18 +1,13 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
1
7
  declare const _default: typeof __VLS_export;
2
8
  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;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
18
13
  };
@@ -1,11 +1,13 @@
1
1
  declare const _default: typeof __VLS_export;
2
2
  export default _default;
3
- declare const __VLS_export: import("vue").DefineComponent<{}, {
4
- $props: Partial<typeof __VLS_props>;
5
- schema: any;
6
- data: any;
7
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
8
- declare const __VLS_props: {
9
- readonly schema: any;
10
- readonly data: any;
11
- };
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ 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 { asCurrency } = 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(() => asCurrency(data));
26
21
  const tooltip = computed(() => display.value.shortened ? `${asCurrency(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>;
@@ -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,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>;