@mouseless/baked 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/dist/module.d.mts +1 -1
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +34 -23
  4. package/dist/runtime/components/AwaitLoading.d.ts +14 -0
  5. package/dist/runtime/components/AwaitLoading.js +27 -0
  6. package/dist/runtime/components/Bake.d.vue.ts +25 -11
  7. package/dist/runtime/components/Bake.vue +87 -16
  8. package/dist/runtime/components/Bake.vue.d.ts +25 -11
  9. package/dist/runtime/components/Button.d.vue.ts +27 -0
  10. package/dist/runtime/components/Button.vue +26 -0
  11. package/dist/runtime/components/Button.vue.d.ts +27 -0
  12. package/dist/runtime/components/CardLink.d.vue.ts +11 -9
  13. package/dist/runtime/components/CardLink.vue +1 -2
  14. package/dist/runtime/components/CardLink.vue.d.ts +11 -9
  15. package/dist/runtime/components/Composite.d.vue.ts +13 -0
  16. package/dist/runtime/components/Composite.vue +17 -0
  17. package/dist/runtime/components/Composite.vue.d.ts +13 -0
  18. package/dist/runtime/components/Conditional.d.vue.ts +23 -0
  19. package/dist/runtime/components/Conditional.vue +31 -0
  20. package/dist/runtime/components/Conditional.vue.d.ts +23 -0
  21. package/dist/runtime/components/Contents.d.vue.ts +40 -0
  22. package/dist/runtime/components/Contents.vue +25 -0
  23. package/dist/runtime/components/Contents.vue.d.ts +40 -0
  24. package/dist/runtime/components/DataPanel.d.vue.ts +13 -11
  25. package/dist/runtime/components/DataPanel.vue +35 -36
  26. package/dist/runtime/components/DataPanel.vue.d.ts +13 -11
  27. package/dist/runtime/components/DataTable.d.vue.ts +19 -9
  28. package/dist/runtime/components/DataTable.vue +69 -55
  29. package/dist/runtime/components/DataTable.vue.d.ts +19 -9
  30. package/dist/runtime/components/DefaultLayout.d.vue.ts +11 -9
  31. package/dist/runtime/components/DefaultLayout.vue +1 -2
  32. package/dist/runtime/components/DefaultLayout.vue.d.ts +11 -9
  33. package/dist/runtime/components/DeferredTabContent.d.vue.ts +26 -8
  34. package/dist/runtime/components/DeferredTabContent.vue +4 -3
  35. package/dist/runtime/components/DeferredTabContent.vue.d.ts +26 -8
  36. package/dist/runtime/components/Dialog.d.vue.ts +17 -0
  37. package/dist/runtime/components/Dialog.vue +57 -0
  38. package/dist/runtime/components/Dialog.vue.d.ts +17 -0
  39. package/dist/runtime/components/Error.vue +6 -0
  40. package/dist/runtime/components/ErrorPage.d.vue.ts +20 -8
  41. package/dist/runtime/components/ErrorPage.vue.d.ts +20 -8
  42. package/dist/runtime/components/Fieldset.d.vue.ts +21 -0
  43. package/dist/runtime/components/Fieldset.vue +38 -0
  44. package/dist/runtime/components/Fieldset.vue.d.ts +21 -0
  45. package/dist/runtime/components/Filter.d.vue.ts +23 -9
  46. package/dist/runtime/components/Filter.vue +5 -7
  47. package/dist/runtime/components/Filter.vue.d.ts +23 -9
  48. package/dist/runtime/components/FormPage.d.vue.ts +17 -0
  49. package/dist/runtime/components/FormPage.vue +48 -0
  50. package/dist/runtime/components/FormPage.vue.d.ts +17 -0
  51. package/dist/runtime/components/Header.d.vue.ts +19 -9
  52. package/dist/runtime/components/Header.vue +27 -29
  53. package/dist/runtime/components/Header.vue.d.ts +19 -9
  54. package/dist/runtime/components/Icon.d.vue.ts +11 -9
  55. package/dist/runtime/components/Icon.vue +1 -2
  56. package/dist/runtime/components/Icon.vue.d.ts +11 -9
  57. package/dist/runtime/components/Input.d.vue.ts +25 -0
  58. package/dist/runtime/components/Input.vue +78 -0
  59. package/dist/runtime/components/Input.vue.d.ts +25 -0
  60. package/dist/runtime/components/InputNumber.d.vue.ts +25 -0
  61. package/dist/runtime/components/InputNumber.vue +35 -0
  62. package/dist/runtime/components/InputNumber.vue.d.ts +25 -0
  63. package/dist/runtime/components/InputText.d.vue.ts +25 -0
  64. package/dist/runtime/components/InputText.vue +31 -0
  65. package/dist/runtime/components/InputText.vue.d.ts +25 -0
  66. package/dist/runtime/components/Inputs.d.vue.ts +29 -0
  67. package/dist/runtime/components/Inputs.vue +50 -0
  68. package/dist/runtime/components/Inputs.vue.d.ts +29 -0
  69. package/dist/runtime/components/LanguageSwitcher.d.vue.ts +1 -9
  70. package/dist/runtime/components/LanguageSwitcher.vue +0 -4
  71. package/dist/runtime/components/LanguageSwitcher.vue.d.ts +1 -9
  72. package/dist/runtime/components/Layout.vue +9 -5
  73. package/dist/runtime/components/Logo.d.vue.ts +11 -7
  74. package/dist/runtime/components/Logo.vue.d.ts +11 -7
  75. package/dist/runtime/components/MenuPage.d.vue.ts +11 -9
  76. package/dist/runtime/components/MenuPage.vue +28 -29
  77. package/dist/runtime/components/MenuPage.vue.d.ts +11 -9
  78. package/dist/runtime/components/Message.d.vue.ts +19 -9
  79. package/dist/runtime/components/Message.vue +10 -14
  80. package/dist/runtime/components/Message.vue.d.ts +19 -9
  81. package/dist/runtime/components/MissingComponent.d.vue.ts +21 -0
  82. package/dist/runtime/components/MissingComponent.vue +174 -0
  83. package/dist/runtime/components/MissingComponent.vue.d.ts +21 -0
  84. package/dist/runtime/components/ModalLayout.d.vue.ts +10 -15
  85. package/dist/runtime/components/ModalLayout.vue +0 -7
  86. package/dist/runtime/components/ModalLayout.vue.d.ts +10 -15
  87. package/dist/runtime/components/Money.d.vue.ts +11 -9
  88. package/dist/runtime/components/Money.vue +10 -15
  89. package/dist/runtime/components/Money.vue.d.ts +11 -9
  90. package/dist/runtime/components/NavLink.d.vue.ts +19 -9
  91. package/dist/runtime/components/NavLink.vue +34 -20
  92. package/dist/runtime/components/NavLink.vue.d.ts +19 -9
  93. package/dist/runtime/components/Number.d.vue.ts +11 -9
  94. package/dist/runtime/components/Number.vue +10 -15
  95. package/dist/runtime/components/Number.vue.d.ts +11 -9
  96. package/dist/runtime/components/Page.vue +7 -4
  97. package/dist/runtime/components/PageTitle.d.vue.ts +15 -9
  98. package/dist/runtime/components/PageTitle.vue +39 -8
  99. package/dist/runtime/components/PageTitle.vue.d.ts +15 -9
  100. package/dist/runtime/components/PersistentPopover.vue +1 -1
  101. package/dist/runtime/components/ProvideParentContext.d.vue.ts +28 -0
  102. package/dist/runtime/components/ProvideParentContext.vue +14 -0
  103. package/dist/runtime/components/ProvideParentContext.vue.d.ts +28 -0
  104. package/dist/runtime/components/Rate.d.vue.ts +11 -9
  105. package/dist/runtime/components/Rate.vue +6 -11
  106. package/dist/runtime/components/Rate.vue.d.ts +11 -9
  107. package/dist/runtime/components/Select.d.vue.ts +31 -9
  108. package/dist/runtime/components/Select.vue +30 -49
  109. package/dist/runtime/components/Select.vue.d.ts +31 -9
  110. package/dist/runtime/components/SelectButton.d.vue.ts +31 -9
  111. package/dist/runtime/components/SelectButton.vue +21 -36
  112. package/dist/runtime/components/SelectButton.vue.d.ts +31 -9
  113. package/dist/runtime/components/SideMenu.d.vue.ts +19 -9
  114. package/dist/runtime/components/SideMenu.vue.d.ts +19 -9
  115. package/dist/runtime/components/SideMenuItem.d.vue.ts +19 -9
  116. package/dist/runtime/components/SideMenuItem.vue.d.ts +19 -9
  117. package/dist/runtime/components/SimpleForm.d.vue.ts +17 -0
  118. package/dist/runtime/components/SimpleForm.vue +108 -0
  119. package/dist/runtime/components/SimpleForm.vue.d.ts +17 -0
  120. package/dist/runtime/components/SimplePage.d.vue.ts +13 -0
  121. package/dist/runtime/components/SimplePage.vue +19 -0
  122. package/dist/runtime/components/SimplePage.vue.d.ts +13 -0
  123. package/dist/runtime/components/TabbedPage.d.vue.ts +13 -0
  124. package/dist/runtime/components/{ReportPage.vue → TabbedPage.vue} +47 -65
  125. package/dist/runtime/components/TabbedPage.vue.d.ts +13 -0
  126. package/dist/runtime/components/Text.d.vue.ts +19 -9
  127. package/dist/runtime/components/Text.vue +9 -13
  128. package/dist/runtime/components/Text.vue.d.ts +19 -9
  129. package/dist/runtime/composables/useActionExecuter.d.ts +7 -0
  130. package/dist/runtime/composables/useActionExecuter.js +108 -0
  131. package/dist/runtime/composables/useConstraintEvaluator.d.ts +7 -0
  132. package/dist/runtime/composables/useConstraintEvaluator.js +58 -0
  133. package/dist/runtime/composables/useContext.d.ts +13 -8
  134. package/dist/runtime/composables/useContext.js +42 -18
  135. package/dist/runtime/composables/useDataFetcher.d.ts +6 -6
  136. package/dist/runtime/composables/useDataFetcher.js +66 -40
  137. package/dist/runtime/composables/useEvents.d.ts +7 -0
  138. package/dist/runtime/composables/useEvents.js +33 -0
  139. package/dist/runtime/composables/useFormat.d.ts +0 -1
  140. package/dist/runtime/composables/useFormat.js +0 -13
  141. package/dist/runtime/composables/useLoginRedirect.d.ts +1 -1
  142. package/dist/runtime/composables/useLoginRedirect.js +2 -2
  143. package/dist/runtime/composables/useNuxtError.d.ts +1 -1
  144. package/dist/runtime/composables/useNuxtError.js +2 -2
  145. package/dist/runtime/composables/useNuxtRoute.d.ts +1 -1
  146. package/dist/runtime/composables/useNuxtRoute.js +3 -3
  147. package/dist/runtime/composables/usePathBuilder.d.ts +3 -0
  148. package/dist/runtime/composables/usePathBuilder.js +18 -0
  149. package/dist/runtime/composables/useReactionHandler.d.ts +6 -0
  150. package/dist/runtime/composables/useReactionHandler.js +104 -0
  151. package/dist/runtime/composables/useRedirect.d.ts +3 -0
  152. package/dist/runtime/composables/useRedirect.js +17 -0
  153. package/dist/runtime/composables/useToken.js +2 -2
  154. package/dist/runtime/plugins/auth.js +16 -3
  155. package/dist/runtime/plugins/baked.js +23 -0
  156. package/dist/runtime/plugins/fetch.js +2 -2
  157. package/package.json +18 -18
  158. package/dist/runtime/components/None.d.vue.ts +0 -11
  159. package/dist/runtime/components/None.vue +0 -25
  160. package/dist/runtime/components/None.vue.d.ts +0 -11
  161. package/dist/runtime/components/Parameters.d.vue.ts +0 -11
  162. package/dist/runtime/components/Parameters.vue +0 -61
  163. package/dist/runtime/components/Parameters.vue.d.ts +0 -11
  164. package/dist/runtime/components/QueryParameters.d.vue.ts +0 -11
  165. package/dist/runtime/components/QueryParameters.vue +0 -109
  166. package/dist/runtime/components/QueryParameters.vue.d.ts +0 -11
  167. package/dist/runtime/components/ReportPage.d.vue.ts +0 -11
  168. package/dist/runtime/components/ReportPage.vue.d.ts +0 -11
  169. package/dist/runtime/composables/useConditional.d.ts +0 -3
  170. package/dist/runtime/composables/useConditional.js +0 -15
  171. package/dist/runtime/composables/useQuery.d.ts +0 -3
  172. package/dist/runtime/composables/useQuery.js +0 -13
@@ -1,40 +1,39 @@
1
1
  <template>
2
- <div
3
- v-if="loading"
4
- class="min-w-40"
5
- >
6
- <Skeleton class="min-h-10" />
7
- </div>
8
- <FloatLabel
9
- v-else-if="data"
10
- variant="on"
11
- >
12
- <Select
13
- v-model="selected"
14
- v-bind="$attrs"
15
- :input-id="path"
16
- :options="data"
17
- :placeholder="label"
18
- :show-clear
19
- class="hide-placeholder"
20
- >
21
- <template #value="slotProps">
22
- <span>
23
- {{ getValueLabel(slotProps) }}
24
- </span>
25
- </template>
26
- <template #option="slotProps">
27
- <span>{{ getOptionLabel(slotProps) }}</span>
28
- </template>
29
- </Select>
30
- <label for="period">{{ l(label) }}</label>
31
- </FloatLabel>
2
+ <AwaitLoading>
3
+ <template #loading>
4
+ <div class="min-w-40">
5
+ <Skeleton class="min-h-10" />
6
+ </div>
7
+ </template>
8
+ <FloatLabel variant="on">
9
+ <Select
10
+ v-bind="$attrs"
11
+ v-model="selected"
12
+ :input-id="path"
13
+ :options="data"
14
+ :placeholder="l(label)"
15
+ :show-clear
16
+ class="hide-placeholder w-full"
17
+ >
18
+ <template #value="slotProps">
19
+ <span>
20
+ {{ getValueLabel(slotProps) }}
21
+ </span>
22
+ </template>
23
+ <template #option="slotProps">
24
+ <span>{{ getOptionLabel(slotProps) }}</span>
25
+ </template>
26
+ </Select>
27
+ <label :for="path">{{ l(label) }}</label>
28
+ </FloatLabel>
29
+ </AwaitLoading>
32
30
  </template>
33
31
 
34
32
  <script setup>
35
33
  import { ref, watch } from "vue";
36
34
  import { FloatLabel, Select, Skeleton } from "primevue";
37
35
  import { useContext, useUiStates, useLocalization } from "#imports";
36
+ import { AwaitLoading } from "#components";
38
37
  const context = useContext();
39
38
  const { localize: l } = useLocalization();
40
39
  const { value: { selectStates } } = useUiStates();
@@ -43,10 +42,8 @@ const { schema, data } = defineProps({
43
42
  data: { type: null, required: true }
44
43
  });
45
44
  const model = defineModel({ type: null, required: true });
46
- const { label, localizeLabel, optionLabel, optionValue, showClear, selectionPageContextKey, stateful } = schema;
47
- const loading = context.injectLoading();
45
+ const { label, localizeLabel, optionLabel, optionValue, showClear, stateful } = schema;
48
46
  const path = context.injectPath();
49
- const page = context.injectPage();
50
47
  const selected = ref();
51
48
  watch(
52
49
  [() => data, () => model.value],
@@ -75,23 +72,11 @@ function setModel(selected2) {
75
72
  selectStates[path] = selectedValue;
76
73
  }
77
74
  }
78
- function getValueOf(option) {
79
- return optionValue ? option?.[optionValue] : option;
80
- }
81
75
  function setSelected(value) {
82
76
  if (!data) {
83
77
  return;
84
78
  }
85
79
  selected.value = optionValue ? data.filter((o) => o[optionValue] === value)[0] : value;
86
- if (selectionPageContextKey) {
87
- for (const currentValue of data.map(getValueOf)) {
88
- setPageContext(currentValue, false);
89
- }
90
- const selectedValue = getValueOf(selected.value);
91
- if (selectedValue !== void 0) {
92
- setPageContext(selectedValue, true);
93
- }
94
- }
95
80
  if (stateful) {
96
81
  const selectedValue = optionValue ? selected.value?.[optionValue] : selected.value;
97
82
  if (model.value !== selectedValue) {
@@ -99,10 +84,6 @@ function setSelected(value) {
99
84
  }
100
85
  }
101
86
  }
102
- function setPageContext(key, value) {
103
- page[`${selectionPageContextKey}:${key}`] = value;
104
- page[`!${selectionPageContextKey}:${key}`] = !value;
105
- }
106
87
  </script>
107
88
 
108
89
  <style>
@@ -1,11 +1,33 @@
1
1
  declare const _default: typeof __VLS_export;
2
2
  export default _default;
3
- declare const __VLS_export: import("vue").DefineComponent<{}, {
4
- $props: Partial<typeof __VLS_props>;
5
- schema: any;
6
- data: any;
7
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
8
- declare const __VLS_props: {
9
- readonly schema: any;
10
- readonly data: any;
11
- };
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ schema: {
5
+ type: null;
6
+ required: true;
7
+ };
8
+ data: {
9
+ type: null;
10
+ required: true;
11
+ };
12
+ modelValue: {
13
+ type: import("vue").PropType<any>;
14
+ required: true;
15
+ };
16
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
+ "update:modelValue": (value: any) => any;
18
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
19
+ schema: {
20
+ type: null;
21
+ required: true;
22
+ };
23
+ data: {
24
+ type: null;
25
+ required: true;
26
+ };
27
+ modelValue: {
28
+ type: import("vue").PropType<any>;
29
+ required: true;
30
+ };
31
+ }>> & Readonly<{
32
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
33
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,11 +1,33 @@
1
1
  declare const _default: typeof __VLS_export;
2
2
  export default _default;
3
- declare const __VLS_export: import("vue").DefineComponent<{}, {
4
- $props: Partial<typeof __VLS_props>;
5
- schema: any;
6
- data: any;
7
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
8
- declare const __VLS_props: {
9
- readonly schema: any;
10
- readonly data: any;
11
- };
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ schema: {
5
+ type: null;
6
+ required: true;
7
+ };
8
+ data: {
9
+ type: null;
10
+ required: true;
11
+ };
12
+ modelValue: {
13
+ type: import("vue").PropType<any>;
14
+ required: true;
15
+ };
16
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
+ "update:modelValue": (value: any) => any;
18
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
19
+ schema: {
20
+ type: null;
21
+ required: true;
22
+ };
23
+ data: {
24
+ type: null;
25
+ required: true;
26
+ };
27
+ modelValue: {
28
+ type: import("vue").PropType<any>;
29
+ required: true;
30
+ };
31
+ }>> & Readonly<{
32
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
33
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,28 +1,31 @@
1
1
  <template>
2
- <div
3
- v-if="loading"
4
- class="min-w-60"
5
- >
6
- <Skeleton class="min-h-10" />
7
- </div>
8
- <SelectButton
9
- v-else-if="data"
10
- v-model="selected"
11
- :options="data"
12
- :allow-empty
13
- :data-key="optionValue"
14
- :pt="{ pcToggleButton: { root: { class: 'text-[length:inherit]' } } }"
15
- >
16
- <template #option="slotProps">
17
- <span>{{ getOptionLabel(slotProps) }}</span>
2
+ <AwaitLoading>
3
+ <template #loading>
4
+ <div class="min-w-60">
5
+ <Skeleton class="min-h-10" />
6
+ </div>
18
7
  </template>
19
- </SelectButton>
8
+ <SelectButton
9
+ v-if="data"
10
+ v-model="selected"
11
+ :options="data"
12
+ :allow-empty
13
+ :data-key="optionValue"
14
+ :option-label
15
+ :pt="{ pcToggleButton: { root: { class: 'text-[length:inherit]' } } }"
16
+ >
17
+ <template #option="slotProps">
18
+ <span>{{ getOptionLabel(slotProps) }}</span>
19
+ </template>
20
+ </SelectButton>
21
+ </AwaitLoading>
20
22
  </template>
21
23
 
22
24
  <script setup>
23
25
  import { ref, watch } from "vue";
24
26
  import { SelectButton, Skeleton } from "primevue";
25
27
  import { useContext, useLocalization, useUiStates } from "#imports";
28
+ import { AwaitLoading } from "#components";
26
29
  const context = useContext();
27
30
  const { localize: l } = useLocalization();
28
31
  const { value: { selectButtonStates } } = useUiStates();
@@ -31,10 +34,8 @@ const { schema, data } = defineProps({
31
34
  data: { type: null, required: true }
32
35
  });
33
36
  const model = defineModel({ type: null, required: true });
34
- const { allowEmpty = false, localizeLabel, optionLabel, optionValue, stateful, selectionPageContextKey } = schema;
35
- const loading = context.injectLoading();
37
+ const { allowEmpty = false, localizeLabel, optionLabel, optionValue, stateful } = schema;
36
38
  const path = context.injectPath();
37
- const page = context.injectPage();
38
39
  const selected = ref();
39
40
  watch(
40
41
  [() => data, () => model.value],
@@ -59,23 +60,11 @@ function setModel(selected2) {
59
60
  selectButtonStates[path] = selectedValue;
60
61
  }
61
62
  }
62
- function getValueOf(option) {
63
- return optionValue ? option?.[optionValue] : option;
64
- }
65
63
  function setSelected(value) {
66
64
  if (!data) {
67
65
  return;
68
66
  }
69
67
  selected.value = optionValue ? data.filter((o) => o[optionValue] === value)[0] : value;
70
- if (selectionPageContextKey) {
71
- for (const currentValue of data.map(getValueOf)) {
72
- setPageContext(currentValue, false);
73
- }
74
- const selectedValue = getValueOf(selected.value);
75
- if (selectedValue !== void 0) {
76
- setPageContext(selectedValue, true);
77
- }
78
- }
79
68
  if (stateful) {
80
69
  const selectedValue = optionValue ? selected.value?.[optionValue] : selected.value;
81
70
  if (model.value !== selectedValue) {
@@ -83,10 +72,6 @@ function setSelected(value) {
83
72
  }
84
73
  }
85
74
  }
86
- function setPageContext(key, value) {
87
- page[`${selectionPageContextKey}:${key}`] = value;
88
- page[`!${selectionPageContextKey}:${key}`] = !value;
89
- }
90
75
  </script>
91
76
 
92
77
  <style>
@@ -1,11 +1,33 @@
1
1
  declare const _default: typeof __VLS_export;
2
2
  export default _default;
3
- declare const __VLS_export: import("vue").DefineComponent<{}, {
4
- $props: Partial<typeof __VLS_props>;
5
- schema: any;
6
- data: any;
7
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
8
- declare const __VLS_props: {
9
- readonly schema: any;
10
- readonly data: any;
11
- };
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ schema: {
5
+ type: null;
6
+ required: true;
7
+ };
8
+ data: {
9
+ type: null;
10
+ required: true;
11
+ };
12
+ modelValue: {
13
+ type: import("vue").PropType<any>;
14
+ required: true;
15
+ };
16
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
+ "update:modelValue": (value: any) => any;
18
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
19
+ schema: {
20
+ type: null;
21
+ required: true;
22
+ };
23
+ data: {
24
+ type: null;
25
+ required: true;
26
+ };
27
+ modelValue: {
28
+ type: import("vue").PropType<any>;
29
+ required: true;
30
+ };
31
+ }>> & Readonly<{
32
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
33
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -4,17 +4,27 @@ 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
+ data: {
13
+ type: null;
14
+ required: true;
15
+ };
16
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
17
+ schema: {
18
+ type: null;
19
+ required: true;
20
+ };
21
+ data: {
22
+ type: null;
23
+ required: true;
24
+ };
25
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
12
26
  type __VLS_Slots = {
13
27
  footer?: ((props: {}) => any) | undefined;
14
28
  } & {
15
29
  footer?: ((props: {}) => any) | undefined;
16
30
  };
17
- declare const __VLS_props: {
18
- readonly schema: any;
19
- readonly data: any;
20
- };
@@ -4,17 +4,27 @@ 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
+ data: {
13
+ type: null;
14
+ required: true;
15
+ };
16
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
17
+ schema: {
18
+ type: null;
19
+ required: true;
20
+ };
21
+ data: {
22
+ type: null;
23
+ required: true;
24
+ };
25
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
12
26
  type __VLS_Slots = {
13
27
  footer?: ((props: {}) => any) | undefined;
14
28
  } & {
15
29
  footer?: ((props: {}) => any) | undefined;
16
30
  };
17
- declare const __VLS_props: {
18
- readonly schema: any;
19
- readonly data: any;
20
- };
@@ -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
- item: Record<string, any>;
6
- path: string;
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 item: Record<string, any>;
10
- readonly path: string;
11
- };
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ item: {
5
+ type: ObjectConstructor;
6
+ required: true;
7
+ };
8
+ path: {
9
+ type: StringConstructor;
10
+ required: true;
11
+ };
12
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
13
+ item: {
14
+ type: ObjectConstructor;
15
+ required: true;
16
+ };
17
+ path: {
18
+ type: StringConstructor;
19
+ required: true;
20
+ };
21
+ }>> & 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
- item: Record<string, any>;
6
- path: string;
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 item: Record<string, any>;
10
- readonly path: string;
11
- };
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ item: {
5
+ type: ObjectConstructor;
6
+ required: true;
7
+ };
8
+ path: {
9
+ type: StringConstructor;
10
+ required: true;
11
+ };
12
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
13
+ item: {
14
+ type: ObjectConstructor;
15
+ required: true;
16
+ };
17
+ path: {
18
+ type: StringConstructor;
19
+ required: true;
20
+ };
21
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,17 @@
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
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ submit: (...args: any[]) => void;
10
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
11
+ schema: {
12
+ type: null;
13
+ required: true;
14
+ };
15
+ }>> & Readonly<{
16
+ onSubmit?: ((...args: any[]) => any) | undefined;
17
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,108 @@
1
+ <template>
2
+ <template v-if="dialogOptions">
3
+ <Button
4
+ :schema="dialogOptions.open"
5
+ v-bind="$attrs"
6
+ @click="visible = true"
7
+ />
8
+ <Dialog
9
+ v-model:visible="visible"
10
+ :header="l(title)"
11
+ :style="{ width: 'min(700px, 90vw)' }"
12
+ :pt="{
13
+ header: !dialogOptions.message && inputs.length > 0 ? 'pb-0' : '',
14
+ content: 'flex flex-col gap-8'
15
+ }"
16
+ closable
17
+ modal
18
+ dismissable-mask
19
+ :draggable="false"
20
+ @after-hide="emitSubmit"
21
+ >
22
+ <div v-if="dialogOptions.message">
23
+ {{ l(dialogOptions.message) }}
24
+ </div>
25
+ <div
26
+ v-if="inputs.length > 0"
27
+ class="flex flex-col gap-4"
28
+ :class="{ 'pt-[--p-dialog-header-padding]': !dialogOptions.message }"
29
+ >
30
+ <Inputs
31
+ v-if="inputs"
32
+ :inputs
33
+ input-class="w-full"
34
+ @ready="onReady"
35
+ @changed="onChanged"
36
+ />
37
+ </div>
38
+ <template #footer>
39
+ <Button
40
+ :schema="dialogOptions.cancel"
41
+ @submit="() => visible = false"
42
+ />
43
+ <Button
44
+ :schema="submit"
45
+ :ready
46
+ @submit="execute"
47
+ />
48
+ </template>
49
+ </Dialog>
50
+ </template>
51
+ <template v-else>
52
+ <div
53
+ v-bind="$attrs"
54
+ class="flex flex-col gap-8"
55
+ >
56
+ <h1 class="font-bold text-xl truncate">
57
+ {{ l(title) }}
58
+ </h1>
59
+ <div class="flex flex-col gap-4">
60
+ <Inputs
61
+ v-if="inputs"
62
+ :inputs
63
+ input-class="w-full"
64
+ @ready="onReady"
65
+ @changed="onChanged"
66
+ />
67
+ </div>
68
+ <Button
69
+ :schema="submit"
70
+ :ready
71
+ @submit="$emit('submit', formData)"
72
+ />
73
+ </div>
74
+ </template>
75
+ </template>
76
+
77
+ <script setup>
78
+ import { ref } from "vue";
79
+ import { Dialog } from "primevue";
80
+ import { useLocalization } from "#imports";
81
+ import { Button, Inputs } from "#components";
82
+ const { localize: l } = useLocalization();
83
+ const { schema } = defineProps({
84
+ schema: { type: null, required: true }
85
+ });
86
+ const emit = defineEmits(["submit"]);
87
+ const { dialogOptions, inputs, submit, title } = schema;
88
+ const formData = ref({});
89
+ const ready = ref(inputs.length === 0);
90
+ const submitted = ref(false);
91
+ const visible = ref(false);
92
+ function onReady(value) {
93
+ ready.value = value;
94
+ }
95
+ function onChanged({ values }) {
96
+ formData.value = values;
97
+ }
98
+ function execute() {
99
+ submitted.value = true;
100
+ visible.value = false;
101
+ }
102
+ function emitSubmit() {
103
+ if (submitted.value) {
104
+ submitted.value = false;
105
+ emit("submit", formData.value);
106
+ }
107
+ }
108
+ </script>
@@ -0,0 +1,17 @@
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
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ submit: (...args: any[]) => void;
10
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
11
+ schema: {
12
+ type: null;
13
+ required: true;
14
+ };
15
+ }>> & Readonly<{
16
+ onSubmit?: ((...args: any[]) => any) | undefined;
17
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,13 @@
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
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
+ schema: {
10
+ type: null;
11
+ required: true;
12
+ };
13
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,19 @@
1
+ <template>
2
+ <div class="flex flex-col gap-8">
3
+ <Bake
4
+ name="title"
5
+ :descriptor="title"
6
+ />
7
+ <div class="flex justify-center">
8
+ <Contents :contents />
9
+ </div>
10
+ </div>
11
+ </template>
12
+
13
+ <script setup>
14
+ import { Contents } from "#components";
15
+ const { schema } = defineProps({
16
+ schema: { type: null, required: true }
17
+ });
18
+ const { title, contents } = schema;
19
+ </script>