@nexdom/uimed-vue 2.0.0-beta.9 → 2.0.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 (220) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +7 -0
  2. package/dist/components/app-bar/app-bar.js +5 -0
  3. package/dist/components/app-bar/app-bar.vue_vue_type_script_setup_true_lang.js +286 -0
  4. package/dist/components/app-bar/types.d.ts +96 -0
  5. package/dist/components/button/button.js +5 -0
  6. package/dist/components/button/button.vue.d.ts +31 -0
  7. package/dist/components/button/button.vue_vue_type_script_setup_true_lang.js +97 -0
  8. package/dist/components/button/types.d.ts +65 -0
  9. package/dist/components/data-sets/data-set/data-set.js +5 -0
  10. package/dist/components/data-sets/data-set/data-set.vue.d.ts +47 -0
  11. package/dist/components/data-sets/data-set/data-set.vue_vue_type_script_setup_true_lang.js +157 -0
  12. package/dist/components/data-sets/data-set/types.d.ts +93 -0
  13. package/dist/components/data-sets/data-set-bar.js +5 -0
  14. package/dist/components/data-sets/data-set-bar.vue_vue_type_script_setup_true_lang.js +99 -0
  15. package/dist/components/data-sets/data-set-item/data-set-item.js +5 -0
  16. package/dist/components/data-sets/data-set-item/data-set-item.vue.d.ts +35 -0
  17. package/dist/components/data-sets/data-set-item/data-set-item.vue_vue_type_script_setup_true_lang.js +57 -0
  18. package/dist/components/data-sets/data-set-item/types.d.ts +42 -0
  19. package/dist/components/details/details.js +5 -0
  20. package/dist/components/details/details.vue.d.ts +28 -0
  21. package/dist/components/details/details.vue_vue_type_script_setup_true_lang.js +56 -0
  22. package/dist/components/details/types.d.ts +29 -0
  23. package/dist/components/dialogs/dialog/dialog-host-key.js +10 -0
  24. package/dist/components/dialogs/dialog/dialog.js +5 -0
  25. package/dist/components/dialogs/dialog/dialog.vue.d.ts +36 -0
  26. package/dist/components/dialogs/dialog/dialog.vue_vue_type_script_setup_true_lang.js +112 -0
  27. package/dist/components/dialogs/dialog/types.d.ts +47 -0
  28. package/dist/components/dialogs/dialog-host.js +5 -0
  29. package/dist/components/dialogs/dialog-host.vue_vue_type_script_setup_true_lang.js +81 -0
  30. package/dist/components/dialogs/toast.js +5 -0
  31. package/dist/components/dialogs/toast.vue_vue_type_script_setup_true_lang.js +35 -0
  32. package/dist/components/footer/footer.js +5 -0
  33. package/dist/components/footer/footer.vue_vue_type_script_setup_true_lang.js +31 -0
  34. package/dist/components/footer/types.d.ts +16 -0
  35. package/dist/components/form/form.js +5 -0
  36. package/dist/components/form/form.vue.d.ts +32 -0
  37. package/dist/components/form/form.vue_vue_type_script_setup_true_lang.js +37 -0
  38. package/dist/components/form/types.d.ts +15 -0
  39. package/dist/components/grid/column/column.js +5 -0
  40. package/dist/components/grid/column/column.vue.d.ts +33 -0
  41. package/dist/components/grid/column/column.vue_vue_type_script_setup_true_lang.js +45 -0
  42. package/dist/components/grid/column/types.d.ts +27 -0
  43. package/dist/components/grid/container/container.js +5 -0
  44. package/dist/components/grid/container/container.vue.d.ts +27 -0
  45. package/dist/components/grid/container/container.vue_vue_type_script_setup_true_lang.js +33 -0
  46. package/dist/components/grid/container/types.d.ts +17 -0
  47. package/dist/components/grid/row/row.js +5 -0
  48. package/dist/components/grid/row/row.vue.d.ts +29 -0
  49. package/dist/components/grid/row/row.vue_vue_type_script_setup_true_lang.js +61 -0
  50. package/dist/components/grid/row/types.d.ts +63 -0
  51. package/dist/components/icon-button/icon-button.js +5 -0
  52. package/dist/components/icon-button/icon-button.vue.d.ts +23 -0
  53. package/dist/components/icon-button/icon-button.vue_vue_type_script_setup_true_lang.js +51 -0
  54. package/dist/components/icon-button/types.d.ts +32 -0
  55. package/dist/components/img/img.js +5 -0
  56. package/dist/components/img/img.vue.d.ts +23 -0
  57. package/dist/components/img/img.vue_vue_type_script_setup_true_lang.js +61 -0
  58. package/dist/components/img/types.d.ts +43 -0
  59. package/dist/components/inputs/autocomplete-field/autocomplete-field.js +5 -0
  60. package/dist/components/inputs/autocomplete-field/autocomplete-field.vue.d.ts +33 -0
  61. package/dist/components/inputs/autocomplete-field/autocomplete-field.vue_vue_type_script_setup_true_lang.js +161 -0
  62. package/dist/components/inputs/autocomplete-field/types.d.ts +84 -0
  63. package/dist/components/inputs/checkbox/checkbox.js +5 -0
  64. package/dist/components/inputs/checkbox/checkbox.vue.d.ts +33 -0
  65. package/dist/components/inputs/checkbox/checkbox.vue_vue_type_script_setup_true_lang.js +71 -0
  66. package/dist/components/inputs/checkbox/types.d.ts +35 -0
  67. package/dist/components/inputs/date-time-field/date-time-field.js +5 -0
  68. package/dist/components/inputs/date-time-field/date-time-field.vue.d.ts +32 -0
  69. package/dist/components/inputs/date-time-field/date-time-field.vue_vue_type_script_setup_true_lang.js +205 -0
  70. package/dist/components/inputs/date-time-field/types.d.ts +84 -0
  71. package/dist/components/inputs/field-loader.js +5 -0
  72. package/dist/components/inputs/field-loader.vue_vue_type_script_setup_true_lang.js +30 -0
  73. package/dist/components/inputs/mask-field/mask-field.js +5 -0
  74. package/dist/components/inputs/mask-field/mask-field.vue.d.ts +32 -0
  75. package/dist/components/inputs/mask-field/mask-field.vue_vue_type_script_setup_true_lang.js +120 -0
  76. package/dist/components/inputs/mask-field/types.d.ts +118 -0
  77. package/dist/components/inputs/text-field/text-field.js +5 -0
  78. package/dist/components/inputs/text-field/text-field.vue.d.ts +30 -0
  79. package/dist/components/inputs/text-field/text-field.vue_vue_type_script_setup_true_lang.js +119 -0
  80. package/dist/components/inputs/text-field/types.d.ts +70 -0
  81. package/dist/components/link/link.js +5 -0
  82. package/dist/components/link/link.vue.d.ts +27 -0
  83. package/dist/components/link/link.vue_vue_type_script_setup_true_lang.js +32 -0
  84. package/dist/components/link/types.d.ts +18 -0
  85. package/dist/components/main/main.js +5 -0
  86. package/dist/components/main/main.vue.d.ts +33 -0
  87. package/dist/components/main/main.vue_vue_type_script_setup_true_lang.js +104 -0
  88. package/dist/components/main/types.d.ts +75 -0
  89. package/dist/components/navigation-menu/navigation-menu.js +5 -0
  90. package/dist/components/navigation-menu/navigation-menu.vue_vue_type_script_setup_true_lang.js +207 -0
  91. package/dist/components/navigation-menu/types.d.ts +62 -0
  92. package/dist/components/page-transition/page-transition.js +5 -0
  93. package/dist/components/page-transition/page-transition.vue.d.ts +40 -0
  94. package/dist/components/page-transition/page-transition.vue_vue_type_script_setup_true_lang.js +27 -0
  95. package/dist/components/page-transition/types.d.ts +18 -0
  96. package/dist/components/sections/section/section.js +5 -0
  97. package/dist/components/sections/section/section.vue.d.ts +28 -0
  98. package/dist/components/sections/section/section.vue_vue_type_script_setup_true_lang.js +108 -0
  99. package/dist/components/sections/section/types.d.ts +80 -0
  100. package/dist/components/sections/section-content/section-content.js +5 -0
  101. package/dist/components/sections/section-content/section-content.vue.d.ts +27 -0
  102. package/dist/components/sections/section-content/section-content.vue_vue_type_script_setup_true_lang.js +16 -0
  103. package/dist/components/skeleton-loader/skeleton-loader.js +5 -0
  104. package/dist/components/skeleton-loader/skeleton-loader.vue_vue_type_script_setup_true_lang.js +65 -0
  105. package/dist/components/table/table.js +5 -0
  106. package/dist/components/table/table.vue.d.ts +19 -0
  107. package/dist/components/table/table.vue_vue_type_script_setup_true_lang.js +84 -0
  108. package/dist/components/table/types.d.ts +51 -0
  109. package/dist/components.d.ts +23 -896
  110. package/dist/components.js +23 -1381
  111. package/dist/composables/alignment/alignment.js +41 -0
  112. package/dist/composables/alignment/types.d.ts +12 -0
  113. package/dist/composables/button/button.js +54 -0
  114. package/dist/composables/colors/constants.js +27 -0
  115. package/dist/composables/colors/types.d.ts +4 -0
  116. package/dist/composables/colors/use-vuetify-background-color.js +16 -0
  117. package/dist/composables/colors/use-vuetify-color.js +11 -0
  118. package/dist/composables/colors/use-vuetify-text-color.js +12 -0
  119. package/dist/composables/data-set/data-set.js +128 -0
  120. package/dist/composables/dialogs/types.d.ts +88 -0
  121. package/dist/composables/dialogs/use-confirm.d.ts +21 -0
  122. package/dist/composables/dialogs/use-confirm.js +55 -0
  123. package/dist/composables/dialogs/use-decorative-timer.js +25 -0
  124. package/dist/composables/dialogs/use-dialog-focus.js +64 -0
  125. package/dist/composables/dialogs/use-dialog-loading.js +13 -0
  126. package/dist/composables/dialogs/use-dialog.d.ts +36 -0
  127. package/dist/{use-dialog-Ck2_ZW7T.js → composables/dialogs/use-dialog.js} +2 -53
  128. package/dist/composables/dialogs/use-run-or-toast.d.ts +27 -0
  129. package/dist/composables/dialogs/use-run-or-toast.js +65 -0
  130. package/dist/composables/dialogs/use-toast.d.ts +25 -0
  131. package/dist/composables/dialogs/use-toast.js +39 -0
  132. package/dist/composables/dimensions/dimensions.js +18 -0
  133. package/dist/composables/inputs/autocomplete-field.js +39 -0
  134. package/dist/composables/inputs/date-time-field.js +109 -0
  135. package/dist/composables/inputs/fields.js +28 -0
  136. package/dist/composables/inputs/mask-field.js +133 -0
  137. package/dist/composables/inputs/rules.js +16 -0
  138. package/dist/composables/inputs/text-field.js +81 -0
  139. package/dist/composables/navigation/types.d.ts +54 -0
  140. package/dist/composables/navigation/use-navigation-rail.js +163 -0
  141. package/dist/composables/navigation/use-navigation-search-shortcut.js +96 -0
  142. package/dist/composables/navigation/use-route-props.js +21 -0
  143. package/dist/composables/navigation/use-unsaved-changes.d.ts +35 -0
  144. package/dist/composables/navigation/use-unsaved-changes.js +88 -0
  145. package/dist/composables/section/section.js +34 -0
  146. package/dist/composables.d.ts +6 -193
  147. package/dist/composables.js +6 -117
  148. package/dist/consts/icons.d.ts +67 -0
  149. package/dist/consts/icons.js +69 -0
  150. package/dist/consts/locale.js +12 -0
  151. package/dist/consts/types.d.ts +12 -0
  152. package/dist/index.d.ts +1 -13
  153. package/dist/index.js +39 -14
  154. package/dist/plugins.d.ts +15 -4
  155. package/dist/plugins.js +54 -3
  156. package/dist/styles/fonts/UnimedSlab-Regular.woff2 +0 -0
  157. package/dist/styles/fonts/fonts.css +5 -0
  158. package/dist/styles/settings.scss +155 -0
  159. package/dist/unit-test.js +11 -7
  160. package/package.json +11 -11
  161. package/skills/uimed-vue/SKILL.md +113 -0
  162. package/skills/uimed-vue/references/api/components/autocomplete-field.md +45 -0
  163. package/skills/uimed-vue/references/api/components/button.md +48 -0
  164. package/skills/uimed-vue/references/api/components/checkbox.md +36 -0
  165. package/skills/uimed-vue/references/api/components/data-sets/data-set-item.md +61 -0
  166. package/skills/uimed-vue/references/api/components/data-sets/data-set.md +67 -0
  167. package/skills/uimed-vue/references/api/components/date-time-field.md +44 -0
  168. package/skills/uimed-vue/references/api/components/details.md +33 -0
  169. package/skills/uimed-vue/references/api/components/dialog.md +70 -0
  170. package/skills/uimed-vue/references/api/components/form.md +43 -0
  171. package/skills/uimed-vue/references/api/components/grid/column.md +41 -0
  172. package/skills/uimed-vue/references/api/components/grid/container.md +32 -0
  173. package/skills/uimed-vue/references/api/components/grid/row.md +37 -0
  174. package/skills/uimed-vue/references/api/components/icon-button.md +37 -0
  175. package/skills/uimed-vue/references/api/components/img.md +34 -0
  176. package/skills/uimed-vue/references/api/components/link.md +31 -0
  177. package/skills/uimed-vue/references/api/components/main.md +174 -0
  178. package/skills/uimed-vue/references/api/components/mask-field.md +60 -0
  179. package/skills/uimed-vue/references/api/components/page-transition.md +37 -0
  180. package/skills/uimed-vue/references/api/components/sections/section-content.md +23 -0
  181. package/skills/uimed-vue/references/api/components/sections/section.md +61 -0
  182. package/skills/uimed-vue/references/api/components/table.md +35 -0
  183. package/skills/uimed-vue/references/api/components/text-field.md +42 -0
  184. package/skills/uimed-vue/references/api/composables/use-confirm.md +96 -0
  185. package/skills/uimed-vue/references/api/composables/use-dialog.md +95 -0
  186. package/skills/uimed-vue/references/api/composables/use-run-or-toast.md +58 -0
  187. package/skills/uimed-vue/references/api/composables/use-toast.md +48 -0
  188. package/skills/uimed-vue/references/api/composables/use-unsaved-changes.md +106 -0
  189. package/skills/uimed-vue/references/api/index.md +1 -0
  190. package/skills/uimed-vue/references/guide/components/autocomplete-field.md +256 -0
  191. package/skills/uimed-vue/references/guide/components/button.md +155 -0
  192. package/skills/uimed-vue/references/guide/components/checkbox.md +113 -0
  193. package/skills/uimed-vue/references/guide/components/data-set.md +370 -0
  194. package/skills/uimed-vue/references/guide/components/date-time-field.md +202 -0
  195. package/skills/uimed-vue/references/guide/components/details.md +76 -0
  196. package/skills/uimed-vue/references/guide/components/dialog.md +269 -0
  197. package/skills/uimed-vue/references/guide/components/form.md +96 -0
  198. package/skills/uimed-vue/references/guide/components/icon-button.md +76 -0
  199. package/skills/uimed-vue/references/guide/components/img.md +128 -0
  200. package/skills/uimed-vue/references/guide/components/layout.md +323 -0
  201. package/skills/uimed-vue/references/guide/components/link.md +47 -0
  202. package/skills/uimed-vue/references/guide/components/main.md +435 -0
  203. package/skills/uimed-vue/references/guide/components/mask-field.md +256 -0
  204. package/skills/uimed-vue/references/guide/components/page-transition.md +111 -0
  205. package/skills/uimed-vue/references/guide/components/section.md +232 -0
  206. package/skills/uimed-vue/references/guide/components/table.md +102 -0
  207. package/skills/uimed-vue/references/guide/components/text-field.md +172 -0
  208. package/skills/uimed-vue/references/guide/composables/use-confirm.md +123 -0
  209. package/skills/uimed-vue/references/guide/composables/use-dialog.md +102 -0
  210. package/skills/uimed-vue/references/guide/composables/use-run-or-toast.md +55 -0
  211. package/skills/uimed-vue/references/guide/composables/use-toast.md +57 -0
  212. package/skills/uimed-vue/references/guide/composables/use-unsaved-changes.md +129 -0
  213. package/skills/uimed-vue/references/guide/getting-started.md +135 -0
  214. package/skills/uimed-vue/references/guide/icons.md +71 -0
  215. package/skills/uimed-vue/references/guide/index.md +51 -0
  216. package/skills/uimed-vue/references/guide/migration-v1-to-v2.md +191 -0
  217. package/skills/uimed-vue/references/guide/unit-testing.md +85 -0
  218. package/AGENTS.md +0 -233
  219. package/CLAUDE.md +0 -1
  220. package/dist/types-HPMP8IrV.d.ts +0 -49
@@ -1,1381 +1,23 @@
1
- import { a as messages, n as owners, r as requests, s as useVuetifyColor } from "./use-dialog-Ck2_ZW7T.js";
2
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, isRef, mergeModels, mergeProps, normalizeClass, onMounted, onUnmounted, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toValue, unref, useId, useModel, useTemplateRef, watch, withCtx, withModifiers } from "vue";
3
- import { VApp, VAppBar, VAppBarNavIcon, VAppBarTitle, VAutocomplete, VAvatar, VBadge, VBtn, VCard, VCardActions, VCardItem, VCardText, VCardTitle, VCheckboxBtn, VCol, VCombobox, VContainer, VDialog, VDivider, VExpansionPanel, VExpansionPanelText, VExpansionPanelTitle, VExpansionPanels, VForm, VIcon, VIconBtn, VImg, VList, VListGroup, VListItem, VListItemAction, VListSubheader, VMain, VMenu, VNavigationDrawer, VRow, VSkeletonLoader, VSnackbarQueue, VTable, VTextField } from "vuetify/components";
4
- import { formatDateTime, isEmail, isEmpty, isPhone, isUrl, toPeriodInterval } from "@nexdom/shared/utils";
5
- //#region src/composables/navigation/use-route-props.ts
6
- function useRouteProps(route) {
7
- return computed(() => routeToProps(route));
8
- }
9
- function routeToProps(route) {
10
- const location = toValue(route);
11
- return isExternalRoute(location) ? { href: location } : { to: location };
12
- }
13
- function isExternalRoute(route) {
14
- return typeof route === "string" && route.startsWith("http");
15
- }
16
- //#endregion
17
- //#region src/components/app-bar/app-bar.vue?vue&type=script&setup=true&lang.ts
18
- const _hoisted_1$2 = { class: "opacity-60" };
19
- //#endregion
20
- //#region src/components/app-bar/app-bar.vue
21
- var app_bar_default = /* @__PURE__ */ defineComponent({
22
- inheritAttrs: false,
23
- __name: "app-bar",
24
- props: /*@__PURE__*/ mergeModels({
25
- dataTestid: {
26
- type: String,
27
- required: false
28
- },
29
- title: {
30
- type: String,
31
- required: false
32
- },
33
- help: {
34
- type: null,
35
- required: false
36
- },
37
- user: {
38
- type: Object,
39
- required: false
40
- },
41
- notifications: {
42
- type: Array,
43
- required: false
44
- },
45
- navigation: {
46
- type: Boolean,
47
- required: false
48
- },
49
- logo: {
50
- type: String,
51
- required: false
52
- }
53
- }, {
54
- "notificationsOpen": {
55
- type: Boolean,
56
- default: false
57
- },
58
- "notificationsOpenModifiers": {},
59
- "navigationOpen": { type: Boolean },
60
- "navigationOpenModifiers": {}
61
- }),
62
- emits: ["update:notificationsOpen", "update:navigationOpen"],
63
- setup(__props) {
64
- const props = __props;
65
- const notificationsOpen = useModel(__props, "notificationsOpen");
66
- const navigationOpen = useModel(__props, "navigationOpen");
67
- const helpBtnDataTestid = computed(() => `${props.dataTestid}-help`);
68
- const notificationsBtnDataTestid = computed(() => `${props.dataTestid}-notifications`);
69
- const navigationBtnDataTestid = computed(() => `${props.dataTestid}-navigation`);
70
- const notificationsMenuDataTestid = computed(() => `${props.dataTestid}-notifications-menu`);
71
- const userBtnDataTestid = computed(() => `${props.dataTestid}-user`);
72
- const userMenuDataTestid = computed(() => `${props.dataTestid}-user-menu`);
73
- const showHelp = computed(() => !!props.help);
74
- const routeProps = useRouteProps(() => props.help);
75
- const showNotifications = computed(() => !!props.notifications);
76
- const unreadCount = computed(() => props.notifications.filter((notification) => !notification.read).length);
77
- const hasUnreadNotifications = computed(() => unreadCount.value > 0);
78
- const showUser = computed(() => !!props.user);
79
- const userAvatarProps = computed(() => props.user.img ? { image: props.user.img } : { icon: "mdi-account-outline" });
80
- function isParentOption(option) {
81
- return "items" in option;
82
- }
83
- function formatNotificationDate(date) {
84
- const interval = toPeriodInterval(date);
85
- if (wasThisMonth(interval)) {
86
- if (wasToday(interval)) return formatDateTime(date, "HH:mm");
87
- else if (wasYesterday(interval)) return "Ontem";
88
- }
89
- return formatDateTime(date, "DD/MM/YYYY");
90
- }
91
- function wasThisMonth(interval) {
92
- return interval.months === 0 && interval.years === 0;
93
- }
94
- function wasToday(interval) {
95
- return interval.days === 0;
96
- }
97
- function wasYesterday(interval) {
98
- return interval.days === 1;
99
- }
100
- return (_ctx, _cache) => {
101
- return openBlock(), createBlock(unref(VAppBar), { "data-testid": props.dataTestid }, {
102
- append: withCtx(() => [
103
- showHelp.value ? (openBlock(), createBlock(unref(VBtn), mergeProps({ key: 0 }, unref(routeProps), {
104
- "data-testid": helpBtnDataTestid.value,
105
- icon: "mdi-help-circle-outline"
106
- }), null, 16, ["data-testid"])) : createCommentVNode("v-if", true),
107
- showNotifications.value ? (openBlock(), createBlock(unref(VMenu), {
108
- key: 1,
109
- modelValue: notificationsOpen.value,
110
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => notificationsOpen.value = $event),
111
- "close-on-content-click": false
112
- }, {
113
- activator: withCtx(({ props }) => [createVNode(unref(VBtn), mergeProps(props, {
114
- "data-testid": notificationsBtnDataTestid.value,
115
- icon: ""
116
- }), {
117
- default: withCtx(() => [createVNode(unref(VBadge), {
118
- "model-value": hasUnreadNotifications.value,
119
- content: unreadCount.value,
120
- color: "error"
121
- }, {
122
- default: withCtx(() => [createVNode(unref(VIcon), { icon: "mdi-bell-outline" })]),
123
- _: 1
124
- }, 8, ["model-value", "content"])]),
125
- _: 1
126
- }, 16, ["data-testid"])]),
127
- default: withCtx(() => [createVNode(unref(VCard), { "data-testid": notificationsMenuDataTestid.value }, {
128
- default: withCtx(() => [props.notifications?.length ? (openBlock(), createBlock(unref(VList), { key: 0 }, {
129
- default: withCtx(() => [createVNode(unref(VListSubheader), null, {
130
- default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode("Notificações", -1)])]),
131
- _: 1
132
- }), (openBlock(true), createElementBlock(Fragment, null, renderList(props.notifications, (notification, index) => {
133
- return openBlock(), createBlock(unref(VListItem), {
134
- key: index,
135
- active: !notification.read,
136
- title: notification.title,
137
- subtitle: notification.subtitle,
138
- "active-class": "text-primary"
139
- }, createSlots({ _: 2 }, [notification.date ? {
140
- name: "append",
141
- fn: withCtx(() => [createVNode(unref(VListItemAction), { end: "" }, {
142
- default: withCtx(() => [createElementVNode("small", _hoisted_1$2, toDisplayString(formatNotificationDate(notification.date)), 1)]),
143
- _: 2
144
- }, 1024)]),
145
- key: "0"
146
- } : void 0]), 1032, [
147
- "active",
148
- "title",
149
- "subtitle"
150
- ]);
151
- }), 128))]),
152
- _: 1
153
- })) : (openBlock(), createBlock(unref(VCardText), { key: 1 }, {
154
- default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode("Nenhuma notificação", -1)])]),
155
- _: 1
156
- }))]),
157
- _: 1
158
- }, 8, ["data-testid"])]),
159
- _: 1
160
- }, 8, ["modelValue"])) : createCommentVNode("v-if", true),
161
- showUser.value ? (openBlock(), createBlock(unref(VMenu), {
162
- key: 2,
163
- "close-on-content-click": false
164
- }, {
165
- activator: withCtx(({ props }) => [createVNode(unref(VBtn), mergeProps(props, {
166
- "data-testid": userBtnDataTestid.value,
167
- icon: ""
168
- }), {
169
- default: withCtx(() => [createVNode(unref(VAvatar), mergeProps(userAvatarProps.value, { color: "primary" }), null, 16)]),
170
- _: 1
171
- }, 16, ["data-testid"])]),
172
- default: withCtx(() => [createVNode(unref(VCard), {
173
- title: __props.user?.title,
174
- subtitle: __props.user?.subtitle,
175
- "data-testid": userMenuDataTestid.value
176
- }, {
177
- prepend: withCtx(() => [createVNode(unref(VAvatar), mergeProps(userAvatarProps.value, { color: "primary" }), null, 16)]),
178
- default: withCtx(() => [createVNode(unref(VDivider)), createVNode(unref(VList), { nav: "" }, {
179
- default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(props.user?.options, (option, index) => {
180
- return openBlock(), createElementBlock(Fragment, { key: index }, [index > 0 ? (openBlock(), createBlock(unref(VDivider), {
181
- key: 0,
182
- class: "mt-1"
183
- })) : createCommentVNode("v-if", true), isParentOption(option) ? (openBlock(), createBlock(unref(VListGroup), { key: 1 }, {
184
- activator: withCtx(({ props }) => [createVNode(unref(VListItem), mergeProps({ ref_for: true }, props, { title: option.description }), null, 16, ["title"])]),
185
- default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(option.items, (childOption, index) => {
186
- return openBlock(), createBlock(unref(VListItem), mergeProps({ key: index }, { ref_for: true }, unref(routeToProps)(childOption.route), {
187
- title: childOption.description,
188
- onClick: childOption.action
189
- }), null, 16, ["title", "onClick"]);
190
- }), 128))]),
191
- _: 2
192
- }, 1024)) : (openBlock(), createBlock(unref(VListItem), mergeProps({
193
- key: 2,
194
- title: option.description
195
- }, { ref_for: true }, unref(routeToProps)(option.route), { onClick: option.action }), null, 16, ["title", "onClick"]))], 64);
196
- }), 128))]),
197
- _: 1
198
- })]),
199
- _: 1
200
- }, 8, [
201
- "title",
202
- "subtitle",
203
- "data-testid"
204
- ])]),
205
- _: 1
206
- })) : createCommentVNode("v-if", true)
207
- ]),
208
- default: withCtx(() => [
209
- __props.navigation ? (openBlock(), createBlock(unref(VAppBarNavIcon), {
210
- key: 0,
211
- "data-testid": navigationBtnDataTestid.value,
212
- onClick: _cache[0] || (_cache[0] = ($event) => navigationOpen.value = !navigationOpen.value)
213
- }, null, 8, ["data-testid"])) : createCommentVNode("v-if", true),
214
- __props.logo ? (openBlock(), createBlock(unref(VImg), {
215
- key: 1,
216
- src: props.logo,
217
- height: "100%",
218
- width: "fit-content",
219
- class: "py-2 ml-5 mr-n3",
220
- cover: ""
221
- }, null, 8, ["src"])) : createCommentVNode("v-if", true),
222
- props.title ? (openBlock(), createBlock(unref(VAppBarTitle), { key: 2 }, {
223
- default: withCtx(() => [createTextVNode(toDisplayString(props.title), 1)]),
224
- _: 1
225
- })) : createCommentVNode("v-if", true)
226
- ]),
227
- _: 1
228
- }, 8, ["data-testid"]);
229
- };
230
- }
231
- });
232
- //#endregion
233
- //#region src/composables/inputs/rules.ts
234
- function required(value) {
235
- return !isEmpty(value) || "Campo obrigatório";
236
- }
237
- function phone(value) {
238
- return isEmpty(value) || isPhone(value) || "Número inválido";
239
- }
240
- function email(value) {
241
- return isEmpty(value) || isEmail(value) || "E-mail inválido";
242
- }
243
- function url(value) {
244
- return isEmpty(value) || isUrl(value) || "URL inválida";
245
- }
246
- //#endregion
247
- //#region src/composables/inputs/fields.ts
248
- const textFieldVariantToVuetifyVariant = {
249
- primary: "underlined",
250
- secondary: "outlined"
251
- };
252
- function useTextFieldVariant(variant) {
253
- return computed(() => {
254
- const variantValue = toValue(variant);
255
- return textFieldVariantToVuetifyVariant[variantValue];
256
- });
257
- }
258
- function createRequiredRule(required, isPresent) {
259
- return (value) => {
260
- if (!required) return true;
261
- return isPresent(value) || "Campo obrigatório";
262
- };
263
- }
264
- function useRules(options) {
265
- return computed(() => {
266
- const rules = [];
267
- if (options.required) rules.push(required);
268
- return rules;
269
- });
270
- }
271
- //#endregion
272
- //#region src/composables/inputs/text-field.ts
273
- const textFieldTypeToVuetifyType = {
274
- text: "text",
275
- phone: "tel",
276
- email: "email",
277
- url: "url",
278
- password: "password",
279
- search: "text"
280
- };
281
- const textFieldTypeToVuetifyRule = {
282
- phone,
283
- email,
284
- url
285
- };
286
- function useTextFieldType(type) {
287
- return computed(() => {
288
- const typeValue = toValue(type);
289
- return textFieldTypeToVuetifyType[typeValue];
290
- });
291
- }
292
- function useTextFieldRules(props) {
293
- const defaultRules = useRules(props);
294
- return computed(() => {
295
- const rules = [...defaultRules.value];
296
- const typeRule = associatedRuleType(props.type) ? textFieldTypeToVuetifyRule[props.type] : void 0;
297
- if (typeRule) rules.push(typeRule);
298
- return rules;
299
- });
300
- }
301
- function associatedRuleType(type) {
302
- return type in textFieldTypeToVuetifyRule;
303
- }
304
- //#endregion
305
- //#region src/components/inputs/text-field/text-field.vue
306
- var text_field_default = /* @__PURE__ */ defineComponent({
307
- inheritAttrs: false,
308
- __name: "text-field",
309
- props: /*@__PURE__*/ mergeModels({
310
- variant: {
311
- type: String,
312
- required: false,
313
- default: "primary"
314
- },
315
- type: {
316
- type: String,
317
- required: false,
318
- default: "text"
319
- },
320
- disabled: {
321
- type: Boolean,
322
- required: false
323
- },
324
- loading: {
325
- type: Boolean,
326
- required: false
327
- },
328
- clearable: {
329
- type: Boolean,
330
- required: false,
331
- default: void 0
332
- },
333
- readonly: {
334
- type: Boolean,
335
- required: false
336
- },
337
- required: {
338
- type: Boolean,
339
- required: false
340
- },
341
- label: {
342
- type: String,
343
- required: false
344
- },
345
- placeholder: {
346
- type: String,
347
- required: false
348
- },
349
- hint: {
350
- type: String,
351
- required: false
352
- },
353
- dataTestid: {
354
- type: String,
355
- required: false
356
- }
357
- }, {
358
- "modelValue": {
359
- type: String,
360
- default: ""
361
- },
362
- "modelModifiers": {}
363
- }),
364
- emits: ["update:modelValue"],
365
- setup(__props) {
366
- const modelValue = useModel(__props, "modelValue");
367
- const props = __props;
368
- const vuetifyVariant = useTextFieldVariant(() => props.variant);
369
- const vuetifyType = useTextFieldType(() => props.type);
370
- const rules = useTextFieldRules(props);
371
- const isSearchField = computed(() => props.type === "search");
372
- const computedClearable = computed(() => props.clearable ?? isSearchField.value);
373
- const appendIcon = computed(() => isSearchField.value ? "mdi-magnify" : void 0);
374
- function clear() {
375
- modelValue.value = "";
376
- }
377
- return (_ctx, _cache) => {
378
- return openBlock(), createBlock(unref(VTextField), {
379
- modelValue: modelValue.value,
380
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
381
- variant: unref(vuetifyVariant),
382
- type: unref(vuetifyType),
383
- "append-inner-icon": appendIcon.value,
384
- rules: unref(rules),
385
- "data-testid": props.dataTestid,
386
- disabled: props.disabled,
387
- loading: props.loading,
388
- readonly: props.readonly,
389
- label: props.label,
390
- placeholder: props.placeholder,
391
- hint: props.hint,
392
- clearable: computedClearable.value,
393
- "onClick:clear": clear
394
- }, null, 8, [
395
- "modelValue",
396
- "variant",
397
- "type",
398
- "append-inner-icon",
399
- "rules",
400
- "data-testid",
401
- "disabled",
402
- "loading",
403
- "readonly",
404
- "label",
405
- "placeholder",
406
- "hint",
407
- "clearable"
408
- ]);
409
- };
410
- }
411
- });
412
- //#endregion
413
- //#region src/components/navigation-menu/navigation-menu.vue?vue&type=script&setup=true&lang.ts
414
- const _hoisted_1$1 = { class: "px-4 pt-2" };
415
- //#endregion
416
- //#region src/components/navigation-menu/navigation-menu.vue
417
- var navigation_menu_default = /* @__PURE__ */ defineComponent({
418
- inheritAttrs: false,
419
- __name: "navigation-menu",
420
- props: /*@__PURE__*/ mergeModels({
421
- dataTestid: {
422
- type: String,
423
- required: false
424
- },
425
- items: {
426
- type: Array,
427
- required: false
428
- }
429
- }, {
430
- "modelValue": {
431
- type: Boolean,
432
- default: false
433
- },
434
- "modelModifiers": {}
435
- }),
436
- emits: ["update:modelValue"],
437
- setup(__props) {
438
- const props = __props;
439
- const open = useModel(__props, "modelValue");
440
- const search = ref("");
441
- const filteredItems = computed(() => filterItems());
442
- const searchDataTestid = computed(() => `${props.dataTestid}-search`);
443
- const query = computed(() => search.value.toLowerCase());
444
- function filterItems() {
445
- return (props.items ?? []).reduce((filtered, item) => {
446
- if (matches(item)) filtered.push(item);
447
- else if (isParentItem(item)) {
448
- const matchingChildren = item.items.filter((child) => matches(child));
449
- if (matchingChildren.length) filtered.push({
450
- ...item,
451
- items: matchingChildren
452
- });
453
- }
454
- return filtered;
455
- }, []);
456
- }
457
- function matches(item) {
458
- return item.description.toLowerCase().includes(query.value);
459
- }
460
- function isParentItem(item) {
461
- return "items" in item;
462
- }
463
- return (_ctx, _cache) => {
464
- return openBlock(), createBlock(unref(VNavigationDrawer), {
465
- modelValue: open.value,
466
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => open.value = $event),
467
- "data-testid": props.dataTestid,
468
- absolute: "",
469
- temporary: ""
470
- }, {
471
- prepend: withCtx(() => [createElementVNode("div", _hoisted_1$1, [createVNode(text_field_default, {
472
- modelValue: search.value,
473
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => search.value = $event),
474
- type: "search",
475
- label: "Buscar",
476
- "data-testid": searchDataTestid.value
477
- }, null, 8, ["modelValue", "data-testid"])])]),
478
- default: withCtx(() => [createVNode(unref(VDivider)), createVNode(unref(VList), { nav: "" }, {
479
- default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(filteredItems.value, (item, index) => {
480
- return openBlock(), createElementBlock(Fragment, { key: index }, [isParentItem(item) ? (openBlock(), createBlock(unref(VListGroup), { key: 0 }, {
481
- activator: withCtx(({ props: activatorProps }) => [createVNode(unref(VListItem), mergeProps({ ref_for: true }, activatorProps, { title: item.description }), null, 16, ["title"])]),
482
- default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(item.items, (childItem, childIndex) => {
483
- return openBlock(), createBlock(unref(VListItem), mergeProps({ key: childIndex }, { ref_for: true }, unref(routeToProps)(childItem.route), {
484
- title: childItem.description,
485
- onClick: childItem.action
486
- }), null, 16, ["title", "onClick"]);
487
- }), 128))]),
488
- _: 2
489
- }, 1024)) : (openBlock(), createBlock(unref(VListItem), mergeProps({
490
- key: 1,
491
- title: item.description
492
- }, { ref_for: true }, unref(routeToProps)(item.route), { onClick: item.action }), null, 16, ["title", "onClick"]))], 64);
493
- }), 128))]),
494
- _: 1
495
- })]),
496
- _: 1
497
- }, 8, ["modelValue", "data-testid"]);
498
- };
499
- }
500
- });
501
- //#endregion
502
- //#region src/components/grid/container/container.vue
503
- var container_default = /* @__PURE__ */ defineComponent({
504
- inheritAttrs: false,
505
- __name: "container",
506
- props: { dataTestid: {
507
- type: String,
508
- required: false
509
- } },
510
- setup(__props) {
511
- const props = __props;
512
- return (_ctx, _cache) => {
513
- return openBlock(), createBlock(unref(VContainer), {
514
- "data-testid": props.dataTestid,
515
- fluid: ""
516
- }, {
517
- default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
518
- _: 3
519
- }, 8, ["data-testid"]);
520
- };
521
- }
522
- });
523
- //#endregion
524
- //#region src/components/dialogs/toast.vue
525
- var toast_default = /* @__PURE__ */ defineComponent({
526
- inheritAttrs: false,
527
- __name: "toast",
528
- setup(__props) {
529
- return (_ctx, _cache) => {
530
- return openBlock(), createBlock(unref(VSnackbarQueue), {
531
- modelValue: unref(messages),
532
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(messages) ? messages.value = $event : null),
533
- "display-strategy": "overflow",
534
- location: "top end",
535
- "total-visible": "3",
536
- collapsed: "",
537
- closable: "",
538
- timer: ""
539
- }, {
540
- actions: withCtx(({ props }) => [createVNode(unref(VIconBtn), mergeProps(props, {
541
- "aria-label": "Fechar",
542
- icon: "$close",
543
- size: "small",
544
- variant: "text"
545
- }), null, 16)]),
546
- _: 1
547
- }, 8, ["modelValue"]);
548
- };
549
- }
550
- });
551
- //#endregion
552
- //#region src/composables/button/button.ts
553
- const buttonVariantToVuetifyVariant = {
554
- primary: "elevated",
555
- secondary: "flat",
556
- ghost: "outlined"
557
- };
558
- function useButtonVariant(variant) {
559
- return computed(() => {
560
- const variantValue = toValue(variant);
561
- return variantValue ? buttonVariantToVuetifyVariant[variantValue] : buttonVariantToVuetifyVariant.primary;
562
- });
563
- }
564
- function useButtonType(type) {
565
- return computed(() => {
566
- return toValue(type) ?? "button";
567
- });
568
- }
569
- function useButtonForm(form) {
570
- return computed(() => toValue(form));
571
- }
572
- //#endregion
573
- //#region src/components/button/button.vue
574
- var button_default = /* @__PURE__ */ defineComponent({
575
- inheritAttrs: false,
576
- __name: "button",
577
- props: {
578
- variant: {
579
- type: String,
580
- required: false
581
- },
582
- type: {
583
- type: String,
584
- required: false
585
- },
586
- color: {
587
- type: String,
588
- required: false
589
- },
590
- disabled: {
591
- type: Boolean,
592
- required: false
593
- },
594
- loading: {
595
- type: Boolean,
596
- required: false
597
- },
598
- form: {
599
- type: String,
600
- required: false
601
- },
602
- dataTestid: {
603
- type: String,
604
- required: false
605
- }
606
- },
607
- emits: ["click"],
608
- setup(__props, { emit: __emit }) {
609
- const props = __props;
610
- const emit = __emit;
611
- const variant = useButtonVariant(() => props.variant);
612
- const color = useVuetifyColor(() => props.color);
613
- const type = useButtonType(() => props.type);
614
- const form = useButtonForm(() => props.form);
615
- function onClick(event) {
616
- emit("click", event);
617
- }
618
- return (_ctx, _cache) => {
619
- return openBlock(), createBlock(unref(VBtn), {
620
- disabled: props.disabled,
621
- loading: props.loading,
622
- "data-testid": props.dataTestid,
623
- variant: unref(variant),
624
- color: unref(color),
625
- type: unref(type),
626
- form: unref(form),
627
- onClick
628
- }, {
629
- default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
630
- _: 3
631
- }, 8, [
632
- "disabled",
633
- "loading",
634
- "data-testid",
635
- "variant",
636
- "color",
637
- "type",
638
- "form"
639
- ]);
640
- };
641
- }
642
- });
643
- //#endregion
644
- //#region src/components/dialogs/dialog.vue
645
- var dialog_default = /* @__PURE__ */ defineComponent({
646
- inheritAttrs: false,
647
- __name: "dialog",
648
- setup(__props) {
649
- const owner = Symbol("dialog");
650
- const titleId = useId();
651
- const messageId = useId();
652
- const actions = useTemplateRef("actions");
653
- const isOwner = computed(() => owners.value[0] === owner);
654
- const next = computed(() => isOwner.value ? requests.value[0] : void 0);
655
- /** Dialog on display, kept until its leave transition ends. */
656
- const request = shallowRef();
657
- const isOpen = ref(false);
658
- const selected = shallowRef();
659
- const isRunning = computed(() => selected.value !== void 0);
660
- /** Element focused before the dialog opened, which gets the focus back when it closes. */
661
- let origin = null;
662
- onMounted(() => owners.value.push(owner));
663
- onUnmounted(() => owners.value = owners.value.filter((item) => item !== owner));
664
- watch(next, show);
665
- function show() {
666
- if (request.value) return;
667
- origin = document.activeElement;
668
- request.value = next.value;
669
- isOpen.value = next.value !== void 0;
670
- }
671
- function showNext() {
672
- request.value = void 0;
673
- show();
674
- }
675
- async function select(current, action) {
676
- if (isRunning.value) return;
677
- requests.value.shift();
678
- selected.value = action;
679
- await current.select(action?.value);
680
- selected.value = void 0;
681
- isOpen.value = false;
682
- if (origin instanceof HTMLElement || origin instanceof SVGElement) origin.focus();
683
- }
684
- function dismiss() {
685
- if (request.value) select(request.value);
686
- }
687
- function focusFirstAction() {
688
- actions.value?.$el.querySelector("button").focus();
689
- }
690
- return (_ctx, _cache) => {
691
- return openBlock(), createBlock(unref(VDialog), {
692
- "model-value": isOpen.value,
693
- persistent: isRunning.value,
694
- role: request.value?.role,
695
- "aria-labelledby": request.value?.title ? unref(titleId) : unref(messageId),
696
- "aria-describedby": unref(messageId),
697
- "max-width": "560",
698
- "onUpdate:modelValue": dismiss,
699
- onAfterEnter: focusFirstAction,
700
- onAfterLeave: showNext
701
- }, {
702
- default: withCtx(() => [createCommentVNode("\n MD3 dialogs have a 24px padding, 16px between title and message, 24px between message and\n actions, and 8px between the end-aligned actions. Inside a dialog, the card parts already\n have 24px sides, 16px below the title, 24px below the message, and end-aligned actions 8px\n apart, but no prop sets the remaining paddings, hence the spacing classes.\n "), request.value ? (openBlock(), createBlock(unref(VCard), { key: 0 }, {
703
- default: withCtx(() => [
704
- request.value.title ? (openBlock(), createBlock(unref(VCardItem), {
705
- key: 0,
706
- class: "pt-6"
707
- }, {
708
- default: withCtx(() => [createCommentVNode(" Titles wrap instead of being truncated, since they're part of the message "), createVNode(unref(VCardTitle), {
709
- id: unref(titleId),
710
- class: "text-wrap"
711
- }, {
712
- default: withCtx(() => [createTextVNode(toDisplayString(request.value.title), 1)]),
713
- _: 1
714
- }, 8, ["id"])]),
715
- _: 1
716
- })) : createCommentVNode("v-if", true),
717
- createCommentVNode(" Below a title, the card already removes the message's top padding "),
718
- createVNode(unref(VCardText), {
719
- id: unref(messageId),
720
- class: normalizeClass({ "pt-6": !request.value.title })
721
- }, {
722
- default: withCtx(() => [createTextVNode(toDisplayString(request.value.message), 1)]),
723
- _: 1
724
- }, 8, ["id", "class"]),
725
- request.value.actions.length > 0 ? (openBlock(), createBlock(unref(VCardActions), {
726
- key: 1,
727
- ref_key: "actions",
728
- ref: actions,
729
- class: "px-6 pt-0 pb-6"
730
- }, {
731
- default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(request.value.actions, (action, index) => {
732
- return openBlock(), createBlock(button_default, {
733
- key: index,
734
- variant: action.variant,
735
- color: action.color,
736
- loading: selected.value === action,
737
- disabled: isRunning.value && selected.value !== action,
738
- onClick: ($event) => select(request.value, action)
739
- }, {
740
- default: withCtx(() => [createTextVNode(toDisplayString(action.text), 1)]),
741
- _: 2
742
- }, 1032, [
743
- "variant",
744
- "color",
745
- "loading",
746
- "disabled",
747
- "onClick"
748
- ]);
749
- }), 128))]),
750
- _: 1
751
- }, 512)) : createCommentVNode("v-if", true)
752
- ]),
753
- _: 1
754
- })) : createCommentVNode("v-if", true)]),
755
- _: 1
756
- }, 8, [
757
- "model-value",
758
- "persistent",
759
- "role",
760
- "aria-labelledby",
761
- "aria-describedby"
762
- ]);
763
- };
764
- }
765
- });
766
- //#endregion
767
- //#region src/components/main/main.vue
768
- var main_default = /* @__PURE__ */ defineComponent({
769
- inheritAttrs: false,
770
- __name: "main",
771
- props: /*@__PURE__*/ mergeModels({
772
- dataTestid: {
773
- type: String,
774
- required: false
775
- },
776
- logo: {
777
- type: String,
778
- required: false
779
- },
780
- appBar: {
781
- type: Object,
782
- required: false
783
- },
784
- navigationMenu: {
785
- type: Object,
786
- required: false
787
- }
788
- }, {
789
- "notificationsOpen": {
790
- type: Boolean,
791
- default: false
792
- },
793
- "notificationsOpenModifiers": {}
794
- }),
795
- emits: ["update:notificationsOpen"],
796
- setup(__props) {
797
- const props = __props;
798
- const appBarProps = computed(() => props.appBar ? {
799
- ...props.appBar,
800
- logo: props.logo,
801
- navigation: props.navigationMenu !== void 0
802
- } : void 0);
803
- const notificationsOpen = useModel(__props, "notificationsOpen");
804
- const navigationMenuOpen = ref(false);
805
- return (_ctx, _cache) => {
806
- return openBlock(), createBlock(unref(VApp), { "data-testid": props.dataTestid }, {
807
- default: withCtx(() => [
808
- appBarProps.value ? (openBlock(), createBlock(app_bar_default, mergeProps({ key: 0 }, appBarProps.value, {
809
- "notifications-open": notificationsOpen.value,
810
- "onUpdate:notificationsOpen": _cache[0] || (_cache[0] = ($event) => notificationsOpen.value = $event),
811
- "navigation-open": navigationMenuOpen.value,
812
- "onUpdate:navigationOpen": _cache[1] || (_cache[1] = ($event) => navigationMenuOpen.value = $event)
813
- }), null, 16, ["notifications-open", "navigation-open"])) : createCommentVNode("v-if", true),
814
- props.navigationMenu ? (openBlock(), createBlock(navigation_menu_default, mergeProps({ key: 1 }, props.navigationMenu, {
815
- modelValue: navigationMenuOpen.value,
816
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => navigationMenuOpen.value = $event)
817
- }), null, 16, ["modelValue"])) : createCommentVNode("v-if", true),
818
- createVNode(unref(VMain), null, {
819
- default: withCtx(() => [createVNode(container_default, null, {
820
- default: withCtx(() => [
821
- renderSlot(_ctx.$slots, "default"),
822
- createVNode(toast_default),
823
- createVNode(dialog_default)
824
- ]),
825
- _: 3
826
- })]),
827
- _: 3
828
- })
829
- ]),
830
- _: 3
831
- }, 8, ["data-testid"]);
832
- };
833
- }
834
- });
835
- //#endregion
836
- //#region src/composables/inputs/autocomplete-field.ts
837
- function createAutocompleteRequiredRule(options) {
838
- return createRequiredRule(options.required, (value) => {
839
- if (options.multiple) return (Array.isArray(value) ? value : []).length > 0;
840
- return !isEmpty(String(value ?? ""));
841
- });
842
- }
843
- function useAutocompleteRules(options) {
844
- return computed(() => {
845
- const opts = toValue(options);
846
- const rules = [];
847
- if (opts.required) rules.push(createAutocompleteRequiredRule(opts));
848
- return rules;
849
- });
850
- }
851
- //#endregion
852
- //#region src/components/inputs/autocomplete-field/autocomplete-field.vue
853
- var autocomplete_field_default = /* @__PURE__ */ defineComponent({
854
- inheritAttrs: false,
855
- __name: "autocomplete-field",
856
- props: /*@__PURE__*/ mergeModels({
857
- variant: {
858
- type: String,
859
- required: false,
860
- default: "primary"
861
- },
862
- disabled: {
863
- type: Boolean,
864
- required: false
865
- },
866
- loading: {
867
- type: Boolean,
868
- required: false
869
- },
870
- clearable: {
871
- type: Boolean,
872
- required: false
873
- },
874
- readonly: {
875
- type: Boolean,
876
- required: false
877
- },
878
- required: {
879
- type: Boolean,
880
- required: false
881
- },
882
- label: {
883
- type: String,
884
- required: false
885
- },
886
- placeholder: {
887
- type: String,
888
- required: false
889
- },
890
- hint: {
891
- type: String,
892
- required: false
893
- },
894
- dataTestid: {
895
- type: String,
896
- required: false
897
- },
898
- strict: {
899
- type: Boolean,
900
- required: false
901
- },
902
- multiple: {
903
- type: null,
904
- required: false
905
- },
906
- items: {
907
- type: Array,
908
- required: false,
909
- default: () => []
910
- }
911
- }, {
912
- "modelValue": { type: null },
913
- "modelModifiers": {}
914
- }),
915
- emits: ["update:modelValue"],
916
- setup(__props) {
917
- const modelValue = useModel(__props, "modelValue");
918
- const props = __props;
919
- const vuetifyVariant = useTextFieldVariant(() => props.variant);
920
- const isMultiple = computed(() => props.multiple ?? false);
921
- const rules = useAutocompleteRules(() => ({
922
- required: props.required,
923
- multiple: isMultiple.value
924
- }));
925
- const vuetifyComponent = computed(() => props.strict ? VAutocomplete : VCombobox);
926
- const normalizedItems = computed(() => {
927
- return props.items.map((item) => {
928
- if (typeof item === "string") return {
929
- label: item,
930
- value: item
931
- };
932
- return item;
933
- });
934
- });
935
- return (_ctx, _cache) => {
936
- return openBlock(), createBlock(resolveDynamicComponent(vuetifyComponent.value), {
937
- modelValue: modelValue.value,
938
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
939
- variant: unref(vuetifyVariant),
940
- items: normalizedItems.value,
941
- "data-testid": props.dataTestid,
942
- disabled: props.disabled,
943
- loading: props.loading,
944
- readonly: props.readonly,
945
- label: props.label,
946
- placeholder: props.placeholder,
947
- hint: props.hint,
948
- clearable: props.clearable,
949
- multiple: isMultiple.value,
950
- "item-title": "label",
951
- rules: unref(rules),
952
- chips: ""
953
- }, null, 8, [
954
- "modelValue",
955
- "variant",
956
- "items",
957
- "data-testid",
958
- "disabled",
959
- "loading",
960
- "readonly",
961
- "label",
962
- "placeholder",
963
- "hint",
964
- "clearable",
965
- "multiple",
966
- "rules"
967
- ]);
968
- };
969
- }
970
- });
971
- //#endregion
972
- //#region src/components/inputs/checkbox/checkbox.vue
973
- var checkbox_default = /* @__PURE__ */ defineComponent({
974
- inheritAttrs: false,
975
- __name: "checkbox",
976
- props: /*@__PURE__*/ mergeModels({
977
- label: {
978
- type: String,
979
- required: false
980
- },
981
- disabled: {
982
- type: Boolean,
983
- required: false
984
- },
985
- readonly: {
986
- type: Boolean,
987
- required: false
988
- },
989
- trueValue: {
990
- type: Boolean,
991
- required: false,
992
- skipCheck: true,
993
- default: true
994
- },
995
- falseValue: {
996
- type: Boolean,
997
- required: false,
998
- skipCheck: true,
999
- default: false
1000
- },
1001
- dataTestid: {
1002
- type: String,
1003
- required: false
1004
- }
1005
- }, {
1006
- "modelValue": {
1007
- type: null,
1008
- default: (props) => props.falseValue
1009
- },
1010
- "modelModifiers": {}
1011
- }),
1012
- emits: ["update:modelValue"],
1013
- setup(__props) {
1014
- const props = __props;
1015
- const modelValue = useModel(__props, "modelValue");
1016
- return (_ctx, _cache) => {
1017
- return openBlock(), createBlock(unref(VCheckboxBtn), {
1018
- modelValue: modelValue.value,
1019
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
1020
- "true-value": props.trueValue,
1021
- "false-value": props.falseValue,
1022
- "data-testid": props.dataTestid,
1023
- disabled: props.disabled,
1024
- readonly: props.readonly,
1025
- label: props.label,
1026
- class: "flex-0-1",
1027
- "hide-details": ""
1028
- }, null, 8, [
1029
- "modelValue",
1030
- "true-value",
1031
- "false-value",
1032
- "data-testid",
1033
- "disabled",
1034
- "readonly",
1035
- "label"
1036
- ]);
1037
- };
1038
- }
1039
- });
1040
- //#endregion
1041
- //#region src/components/grid/row/row.vue
1042
- var row_default = /* @__PURE__ */ defineComponent({
1043
- inheritAttrs: false,
1044
- __name: "row",
1045
- props: { dataTestid: {
1046
- type: String,
1047
- required: false
1048
- } },
1049
- setup(__props) {
1050
- const props = __props;
1051
- return (_ctx, _cache) => {
1052
- return openBlock(), createBlock(unref(VRow), { "data-testid": props.dataTestid }, {
1053
- default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
1054
- _: 3
1055
- }, 8, ["data-testid"]);
1056
- };
1057
- }
1058
- });
1059
- //#endregion
1060
- //#region src/components/grid/column/column.vue
1061
- var column_default = /* @__PURE__ */ defineComponent({
1062
- inheritAttrs: false,
1063
- __name: "column",
1064
- props: {
1065
- cols: {
1066
- type: String,
1067
- required: false,
1068
- default: "12"
1069
- },
1070
- dataTestid: {
1071
- type: String,
1072
- required: false
1073
- }
1074
- },
1075
- setup(__props) {
1076
- const props = __props;
1077
- return (_ctx, _cache) => {
1078
- return openBlock(), createBlock(unref(VCol), {
1079
- cols: "12",
1080
- sm: props.cols,
1081
- "data-testid": props.dataTestid
1082
- }, {
1083
- default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
1084
- _: 3
1085
- }, 8, ["sm", "data-testid"]);
1086
- };
1087
- }
1088
- });
1089
- //#endregion
1090
- //#region src/components/form/form.vue
1091
- var form_default = /* @__PURE__ */ defineComponent({
1092
- inheritAttrs: false,
1093
- __name: "form",
1094
- props: {
1095
- id: {
1096
- type: String,
1097
- required: false
1098
- },
1099
- dataTestid: {
1100
- type: String,
1101
- required: false
1102
- }
1103
- },
1104
- emits: ["submit"],
1105
- setup(__props, { emit: __emit }) {
1106
- const props = __props;
1107
- const emit = __emit;
1108
- async function onSubmit(event) {
1109
- const { valid } = await event;
1110
- if (valid) emit("submit", event);
1111
- }
1112
- return (_ctx, _cache) => {
1113
- return openBlock(), createBlock(unref(VForm), {
1114
- id: props.id,
1115
- "data-testid": props.dataTestid,
1116
- onSubmit: withModifiers(onSubmit, ["prevent"])
1117
- }, {
1118
- default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
1119
- _: 3
1120
- }, 8, ["id", "data-testid"]);
1121
- };
1122
- }
1123
- });
1124
- //#endregion
1125
- //#region src/components/sections/section-content/section-content.vue
1126
- var section_content_default = /* @__PURE__ */ defineComponent({
1127
- inheritAttrs: false,
1128
- __name: "section-content",
1129
- setup(__props) {
1130
- return (_ctx, _cache) => {
1131
- return openBlock(), createBlock(unref(VCardText), null, {
1132
- default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
1133
- _: 3
1134
- });
1135
- };
1136
- }
1137
- });
1138
- //#endregion
1139
- //#region src/composables/section/section.ts
1140
- const sectionVariantToVuetifyVariant = {
1141
- primary: "elevated",
1142
- secondary: "outlined"
1143
- };
1144
- function useSectionVariant(variant) {
1145
- return computed(() => {
1146
- const variantValue = toValue(variant);
1147
- return variantValue ? sectionVariantToVuetifyVariant[variantValue] : sectionVariantToVuetifyVariant.primary;
1148
- });
1149
- }
1150
- //#endregion
1151
- //#region src/components/sections/section/section.vue
1152
- var section_default = /* @__PURE__ */ defineComponent({
1153
- inheritAttrs: false,
1154
- __name: "section",
1155
- props: {
1156
- variant: {
1157
- type: String,
1158
- required: false
1159
- },
1160
- title: {
1161
- type: String,
1162
- required: false
1163
- },
1164
- subtitle: {
1165
- type: String,
1166
- required: false
1167
- },
1168
- actions: {
1169
- type: Array,
1170
- required: false
1171
- },
1172
- fullWidth: {
1173
- type: Boolean,
1174
- required: false
1175
- },
1176
- fullHeight: {
1177
- type: Boolean,
1178
- required: false
1179
- },
1180
- loading: {
1181
- type: Boolean,
1182
- required: false
1183
- },
1184
- dataTestid: {
1185
- type: String,
1186
- required: false
1187
- }
1188
- },
1189
- setup(__props) {
1190
- const props = __props;
1191
- const variant = useSectionVariant(() => props.variant);
1192
- const title = computed(() => props.title || void 0);
1193
- const subtitle = computed(() => props.subtitle || void 0);
1194
- const width = computed(() => props.fullWidth ? "100%" : void 0);
1195
- const height = computed(() => props.fullHeight ? "100%" : void 0);
1196
- const showActions = computed(() => !!props.actions?.length);
1197
- const skeletonType = computed(() => showActions.value ? "image, actions" : "image");
1198
- return (_ctx, _cache) => {
1199
- return openBlock(), createBlock(unref(VSkeletonLoader), {
1200
- loading: props.loading,
1201
- type: skeletonType.value,
1202
- width: width.value,
1203
- height: height.value
1204
- }, {
1205
- default: withCtx(() => [createVNode(unref(VCard), {
1206
- title: title.value,
1207
- subtitle: subtitle.value,
1208
- variant: unref(variant),
1209
- width: width.value,
1210
- height: height.value,
1211
- "data-testid": props.dataTestid,
1212
- class: "d-flex flex-column"
1213
- }, {
1214
- default: withCtx(() => [renderSlot(_ctx.$slots, "default"), showActions.value ? (openBlock(), createBlock(unref(VCardActions), {
1215
- key: 0,
1216
- class: "mt-auto justify-end"
1217
- }, {
1218
- default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(props.actions, ({ label, onClick, ...action }, index) => {
1219
- return openBlock(), createBlock(button_default, mergeProps({ key: index }, { ref_for: true }, action, { onClick }), {
1220
- default: withCtx(() => [createTextVNode(toDisplayString(label), 1)]),
1221
- _: 2
1222
- }, 1040, ["onClick"]);
1223
- }), 128))]),
1224
- _: 1
1225
- })) : createCommentVNode("v-if", true)]),
1226
- _: 3
1227
- }, 8, [
1228
- "title",
1229
- "subtitle",
1230
- "variant",
1231
- "width",
1232
- "height",
1233
- "data-testid"
1234
- ])]),
1235
- _: 3
1236
- }, 8, [
1237
- "loading",
1238
- "type",
1239
- "width",
1240
- "height"
1241
- ]);
1242
- };
1243
- }
1244
- });
1245
- //#endregion
1246
- //#region src/components/table/table.vue?vue&type=script&setup=true&lang.ts
1247
- const _hoisted_1 = { scope: "row" };
1248
- const _hoisted_2 = { key: 0 };
1249
- //#endregion
1250
- //#region src/components/table/table.vue
1251
- var table_default = /* @__PURE__ */ defineComponent({
1252
- inheritAttrs: false,
1253
- __name: "table",
1254
- props: {
1255
- headers: {
1256
- type: Array,
1257
- required: false
1258
- },
1259
- items: {
1260
- type: Array,
1261
- required: false
1262
- },
1263
- vertical: {
1264
- type: Boolean,
1265
- required: false
1266
- },
1267
- loading: {
1268
- type: Boolean,
1269
- required: false
1270
- },
1271
- dataTestid: {
1272
- type: String,
1273
- required: false
1274
- }
1275
- },
1276
- setup(__props) {
1277
- const props = __props;
1278
- const hasHeaders = computed(() => !!props.headers?.length);
1279
- const itemRows = computed(() => props.items ?? []);
1280
- const type = computed(() => {
1281
- if (hasHeaders.value && !props.vertical) return "table-thead, table-tbody";
1282
- return "table-tbody";
1283
- });
1284
- function getVerticalTableTestId(index) {
1285
- if (!props.dataTestid) return void 0;
1286
- if (itemRows.value.length === 1) return props.dataTestid;
1287
- return `${props.dataTestid}-${index}`;
1288
- }
1289
- return (_ctx, _cache) => {
1290
- return openBlock(), createBlock(unref(VSkeletonLoader), {
1291
- loading: props.loading,
1292
- type: type.value
1293
- }, {
1294
- default: withCtx(() => [props.vertical ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(itemRows.value, (item, itemIndex) => {
1295
- return openBlock(), createBlock(unref(VTable), {
1296
- key: itemIndex,
1297
- "data-testid": getVerticalTableTestId(itemIndex)
1298
- }, {
1299
- default: withCtx(() => [createElementVNode("tbody", null, [hasHeaders.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(props.headers, (header, headerIndex) => {
1300
- return openBlock(), createElementBlock("tr", { key: headerIndex }, [createElementVNode("th", _hoisted_1, toDisplayString(header), 1), createElementVNode("td", null, toDisplayString(item[headerIndex]), 1)]);
1301
- }), 128)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(item, (cell, cellIndex) => {
1302
- return openBlock(), createElementBlock("tr", { key: cellIndex }, [createElementVNode("td", null, toDisplayString(cell), 1)]);
1303
- }), 128))])]),
1304
- _: 2
1305
- }, 1032, ["data-testid"]);
1306
- }), 128)) : (openBlock(), createBlock(unref(VTable), {
1307
- key: 1,
1308
- "data-testid": props.dataTestid
1309
- }, {
1310
- default: withCtx(() => [hasHeaders.value && !props.vertical ? (openBlock(), createElementBlock("thead", _hoisted_2, [createElementVNode("tr", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(props.headers, (header, index) => {
1311
- return openBlock(), createElementBlock("th", {
1312
- key: index,
1313
- scope: "col"
1314
- }, toDisplayString(header), 1);
1315
- }), 128))])])) : createCommentVNode("v-if", true), createElementVNode("tbody", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(itemRows.value, (row, rowIndex) => {
1316
- return openBlock(), createElementBlock("tr", { key: rowIndex }, [(openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, cellIndex) => {
1317
- return openBlock(), createElementBlock("td", { key: cellIndex }, toDisplayString(cell), 1);
1318
- }), 128))]);
1319
- }), 128))])]),
1320
- _: 1
1321
- }, 8, ["data-testid"]))]),
1322
- _: 1
1323
- }, 8, ["loading", "type"]);
1324
- };
1325
- }
1326
- });
1327
- //#endregion
1328
- //#region src/components/details/details.vue
1329
- var details_default = /* @__PURE__ */ defineComponent({
1330
- inheritAttrs: false,
1331
- __name: "details",
1332
- props: {
1333
- variant: {
1334
- type: String,
1335
- required: false
1336
- },
1337
- title: {
1338
- type: String,
1339
- required: false
1340
- },
1341
- loading: {
1342
- type: Boolean,
1343
- required: false
1344
- },
1345
- dataTestid: {
1346
- type: String,
1347
- required: false
1348
- }
1349
- },
1350
- setup(__props) {
1351
- const props = __props;
1352
- const outlined = computed(() => props.variant === "secondary");
1353
- return (_ctx, _cache) => {
1354
- return openBlock(), createBlock(unref(VSkeletonLoader), {
1355
- loading: props.loading,
1356
- type: "heading",
1357
- width: "100%"
1358
- }, {
1359
- default: withCtx(() => [createVNode(unref(VExpansionPanels), {
1360
- flat: outlined.value,
1361
- "data-testid": props.dataTestid
1362
- }, {
1363
- default: withCtx(() => [createVNode(unref(VExpansionPanel), { class: normalizeClass({ border: outlined.value }) }, {
1364
- default: withCtx(() => [createVNode(unref(VExpansionPanelTitle), null, {
1365
- default: withCtx(() => [createTextVNode(toDisplayString(props.title), 1)]),
1366
- _: 1
1367
- }), createVNode(unref(VExpansionPanelText), null, {
1368
- default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
1369
- _: 3
1370
- })]),
1371
- _: 3
1372
- }, 8, ["class"])]),
1373
- _: 3
1374
- }, 8, ["flat", "data-testid"])]),
1375
- _: 3
1376
- }, 8, ["loading"]);
1377
- };
1378
- }
1379
- });
1380
- //#endregion
1381
- export { autocomplete_field_default as UAutocompleteField, button_default as UButton, checkbox_default as UCheckbox, column_default as UColumn, container_default as UContainer, details_default as UDetails, form_default as UForm, main_default as UMain, row_default as URow, section_default as USection, section_content_default as USectionContent, table_default as UTable, text_field_default as UTextField };
1
+ import text_field_default from "./components/inputs/text-field/text-field.js";
2
+ import container_default from "./components/grid/container/container.js";
3
+ import button_default from "./components/button/button.js";
4
+ import dialog_default from "./components/dialogs/dialog/dialog.js";
5
+ import main_default from "./components/main/main.js";
6
+ import icon_button_default from "./components/icon-button/icon-button.js";
7
+ import autocomplete_field_default from "./components/inputs/autocomplete-field/autocomplete-field.js";
8
+ import checkbox_default from "./components/inputs/checkbox/checkbox.js";
9
+ import date_time_field_default from "./components/inputs/date-time-field/date-time-field.js";
10
+ import mask_field_default from "./components/inputs/mask-field/mask-field.js";
11
+ import row_default from "./components/grid/row/row.js";
12
+ import column_default from "./components/grid/column/column.js";
13
+ import form_default from "./components/form/form.js";
14
+ import section_content_default from "./components/sections/section-content/section-content.js";
15
+ import section_default from "./components/sections/section/section.js";
16
+ import table_default from "./components/table/table.js";
17
+ import details_default from "./components/details/details.js";
18
+ import img_default from "./components/img/img.js";
19
+ import link_default from "./components/link/link.js";
20
+ import data_set_default from "./components/data-sets/data-set/data-set.js";
21
+ import data_set_item_default from "./components/data-sets/data-set-item/data-set-item.js";
22
+ import page_transition_default from "./components/page-transition/page-transition.js";
23
+ export { autocomplete_field_default as UAutocompleteField, button_default as UButton, checkbox_default as UCheckbox, column_default as UColumn, container_default as UContainer, data_set_default as UDataSet, data_set_item_default as UDataSetItem, date_time_field_default as UDateTimeField, details_default as UDetails, dialog_default as UDialog, form_default as UForm, icon_button_default as UIconButton, img_default as UImg, link_default as ULink, main_default as UMain, mask_field_default as UMaskField, page_transition_default as UPageTransition, row_default as URow, section_default as USection, section_content_default as USectionContent, table_default as UTable, text_field_default as UTextField };