@nexdom/uimed-vue 2.0.0-beta.6 → 2.0.0-beta.61

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 (164) hide show
  1. package/AGENTS.md +131 -17
  2. package/README.md +1 -1
  3. package/dist/_virtual/_rolldown/runtime.js +7 -0
  4. package/dist/components/app-bar/app-bar.js +5 -0
  5. package/dist/components/app-bar/app-bar.vue_vue_type_script_setup_true_lang.js +286 -0
  6. package/dist/components/app-bar/types.d.ts +96 -0
  7. package/dist/components/button/button.js +5 -0
  8. package/dist/components/button/button.vue.d.ts +31 -0
  9. package/dist/components/button/button.vue_vue_type_script_setup_true_lang.js +97 -0
  10. package/dist/components/button/types.d.ts +65 -0
  11. package/dist/components/data-sets/data-set/data-set.js +5 -0
  12. package/dist/components/data-sets/data-set/data-set.vue.d.ts +47 -0
  13. package/dist/components/data-sets/data-set/data-set.vue_vue_type_script_setup_true_lang.js +157 -0
  14. package/dist/components/data-sets/data-set/types.d.ts +93 -0
  15. package/dist/components/data-sets/data-set-bar.js +5 -0
  16. package/dist/components/data-sets/data-set-bar.vue_vue_type_script_setup_true_lang.js +99 -0
  17. package/dist/components/data-sets/data-set-item/data-set-item.js +5 -0
  18. package/dist/components/data-sets/data-set-item/data-set-item.vue.d.ts +35 -0
  19. package/dist/components/data-sets/data-set-item/data-set-item.vue_vue_type_script_setup_true_lang.js +57 -0
  20. package/dist/components/data-sets/data-set-item/types.d.ts +42 -0
  21. package/dist/components/details/details.js +5 -0
  22. package/dist/components/details/details.vue.d.ts +28 -0
  23. package/dist/components/details/details.vue_vue_type_script_setup_true_lang.js +56 -0
  24. package/dist/components/details/types.d.ts +29 -0
  25. package/dist/components/dialogs/dialog/dialog-host-key.js +10 -0
  26. package/dist/components/dialogs/dialog/dialog.js +5 -0
  27. package/dist/components/dialogs/dialog/dialog.vue.d.ts +36 -0
  28. package/dist/components/dialogs/dialog/dialog.vue_vue_type_script_setup_true_lang.js +112 -0
  29. package/dist/components/dialogs/dialog/types.d.ts +47 -0
  30. package/dist/components/dialogs/dialog-host.js +5 -0
  31. package/dist/components/dialogs/dialog-host.vue_vue_type_script_setup_true_lang.js +81 -0
  32. package/dist/components/dialogs/toast.js +5 -0
  33. package/dist/components/dialogs/toast.vue_vue_type_script_setup_true_lang.js +35 -0
  34. package/dist/components/footer/footer.js +5 -0
  35. package/dist/components/footer/footer.vue_vue_type_script_setup_true_lang.js +31 -0
  36. package/dist/components/footer/types.d.ts +16 -0
  37. package/dist/components/form/form.js +5 -0
  38. package/dist/components/form/form.vue.d.ts +32 -0
  39. package/dist/components/form/form.vue_vue_type_script_setup_true_lang.js +37 -0
  40. package/dist/components/form/types.d.ts +15 -0
  41. package/dist/components/grid/column/column.js +5 -0
  42. package/dist/components/grid/column/column.vue.d.ts +33 -0
  43. package/dist/components/grid/column/column.vue_vue_type_script_setup_true_lang.js +45 -0
  44. package/dist/components/grid/column/types.d.ts +27 -0
  45. package/dist/components/grid/container/container.js +5 -0
  46. package/dist/components/grid/container/container.vue.d.ts +27 -0
  47. package/dist/components/grid/container/container.vue_vue_type_script_setup_true_lang.js +33 -0
  48. package/dist/components/grid/container/types.d.ts +17 -0
  49. package/dist/components/grid/row/row.js +5 -0
  50. package/dist/components/grid/row/row.vue.d.ts +29 -0
  51. package/dist/components/grid/row/row.vue_vue_type_script_setup_true_lang.js +61 -0
  52. package/dist/components/grid/row/types.d.ts +63 -0
  53. package/dist/components/icon-button/icon-button.js +5 -0
  54. package/dist/components/icon-button/icon-button.vue.d.ts +23 -0
  55. package/dist/components/icon-button/icon-button.vue_vue_type_script_setup_true_lang.js +51 -0
  56. package/dist/components/icon-button/types.d.ts +32 -0
  57. package/dist/components/img/img.js +5 -0
  58. package/dist/components/img/img.vue.d.ts +23 -0
  59. package/dist/components/img/img.vue_vue_type_script_setup_true_lang.js +61 -0
  60. package/dist/components/img/types.d.ts +43 -0
  61. package/dist/components/inputs/autocomplete-field/autocomplete-field.js +5 -0
  62. package/dist/components/inputs/autocomplete-field/autocomplete-field.vue.d.ts +33 -0
  63. package/dist/components/inputs/autocomplete-field/autocomplete-field.vue_vue_type_script_setup_true_lang.js +161 -0
  64. package/dist/components/inputs/autocomplete-field/types.d.ts +84 -0
  65. package/dist/components/inputs/checkbox/checkbox.js +5 -0
  66. package/dist/components/inputs/checkbox/checkbox.vue.d.ts +33 -0
  67. package/dist/components/inputs/checkbox/checkbox.vue_vue_type_script_setup_true_lang.js +71 -0
  68. package/dist/components/inputs/checkbox/types.d.ts +35 -0
  69. package/dist/components/inputs/date-time-field/date-time-field.js +5 -0
  70. package/dist/components/inputs/date-time-field/date-time-field.vue.d.ts +32 -0
  71. package/dist/components/inputs/date-time-field/date-time-field.vue_vue_type_script_setup_true_lang.js +205 -0
  72. package/dist/components/inputs/date-time-field/types.d.ts +84 -0
  73. package/dist/components/inputs/field-loader.js +5 -0
  74. package/dist/components/inputs/field-loader.vue_vue_type_script_setup_true_lang.js +30 -0
  75. package/dist/components/inputs/mask-field/mask-field.js +5 -0
  76. package/dist/components/inputs/mask-field/mask-field.vue.d.ts +32 -0
  77. package/dist/components/inputs/mask-field/mask-field.vue_vue_type_script_setup_true_lang.js +120 -0
  78. package/dist/components/inputs/mask-field/types.d.ts +118 -0
  79. package/dist/components/inputs/text-field/text-field.js +5 -0
  80. package/dist/components/inputs/text-field/text-field.vue.d.ts +30 -0
  81. package/dist/components/inputs/text-field/text-field.vue_vue_type_script_setup_true_lang.js +119 -0
  82. package/dist/components/inputs/text-field/types.d.ts +70 -0
  83. package/dist/components/link/link.js +5 -0
  84. package/dist/components/link/link.vue.d.ts +27 -0
  85. package/dist/components/link/link.vue_vue_type_script_setup_true_lang.js +32 -0
  86. package/dist/components/link/types.d.ts +18 -0
  87. package/dist/components/main/main.js +5 -0
  88. package/dist/components/main/main.vue.d.ts +33 -0
  89. package/dist/components/main/main.vue_vue_type_script_setup_true_lang.js +102 -0
  90. package/dist/components/main/types.d.ts +75 -0
  91. package/dist/components/navigation-menu/navigation-menu.js +5 -0
  92. package/dist/components/navigation-menu/navigation-menu.vue_vue_type_script_setup_true_lang.js +145 -0
  93. package/dist/components/navigation-menu/types.d.ts +62 -0
  94. package/dist/components/page-transition/page-transition.js +5 -0
  95. package/dist/components/page-transition/page-transition.vue.d.ts +40 -0
  96. package/dist/components/page-transition/page-transition.vue_vue_type_script_setup_true_lang.js +27 -0
  97. package/dist/components/page-transition/types.d.ts +18 -0
  98. package/dist/components/sections/section/section.js +5 -0
  99. package/dist/components/sections/section/section.vue.d.ts +28 -0
  100. package/dist/components/sections/section/section.vue_vue_type_script_setup_true_lang.js +108 -0
  101. package/dist/components/sections/section/types.d.ts +80 -0
  102. package/dist/components/sections/section-content/section-content.js +5 -0
  103. package/dist/components/sections/section-content/section-content.vue.d.ts +27 -0
  104. package/dist/components/sections/section-content/section-content.vue_vue_type_script_setup_true_lang.js +16 -0
  105. package/dist/components/skeleton-loader/skeleton-loader.js +5 -0
  106. package/dist/components/skeleton-loader/skeleton-loader.vue_vue_type_script_setup_true_lang.js +65 -0
  107. package/dist/components/table/table.js +5 -0
  108. package/dist/components/table/table.vue.d.ts +19 -0
  109. package/dist/components/table/table.vue_vue_type_script_setup_true_lang.js +84 -0
  110. package/dist/components/table/types.d.ts +51 -0
  111. package/dist/components.d.ts +23 -828
  112. package/dist/components.js +23 -1112
  113. package/dist/composables/alignment/alignment.js +41 -0
  114. package/dist/composables/alignment/types.d.ts +12 -0
  115. package/dist/composables/button/button.js +54 -0
  116. package/dist/composables/colors/constants.js +27 -0
  117. package/dist/composables/colors/types.d.ts +4 -0
  118. package/dist/composables/colors/use-vuetify-background-color.js +16 -0
  119. package/dist/composables/colors/use-vuetify-color.js +11 -0
  120. package/dist/composables/colors/use-vuetify-text-color.js +12 -0
  121. package/dist/composables/data-set/data-set.js +128 -0
  122. package/dist/composables/dialogs/types.d.ts +88 -0
  123. package/dist/composables/dialogs/use-confirm.d.ts +21 -0
  124. package/dist/composables/dialogs/use-confirm.js +55 -0
  125. package/dist/composables/dialogs/use-decorative-timer.js +25 -0
  126. package/dist/composables/dialogs/use-dialog-focus.js +64 -0
  127. package/dist/composables/dialogs/use-dialog-loading.js +13 -0
  128. package/dist/composables/dialogs/use-dialog.d.ts +36 -0
  129. package/dist/composables/dialogs/use-dialog.js +73 -0
  130. package/dist/composables/dialogs/use-run-or-toast.d.ts +27 -0
  131. package/dist/composables/dialogs/use-run-or-toast.js +65 -0
  132. package/dist/composables/dialogs/use-toast.d.ts +25 -0
  133. package/dist/composables/dialogs/use-toast.js +39 -0
  134. package/dist/composables/dimensions/dimensions.js +18 -0
  135. package/dist/composables/inputs/autocomplete-field.js +39 -0
  136. package/dist/composables/inputs/date-time-field.js +109 -0
  137. package/dist/composables/inputs/fields.js +28 -0
  138. package/dist/composables/inputs/mask-field.js +133 -0
  139. package/dist/composables/inputs/rules.js +16 -0
  140. package/dist/composables/inputs/text-field.js +81 -0
  141. package/dist/composables/navigation/types.d.ts +54 -0
  142. package/dist/composables/navigation/use-navigation-search-shortcut.js +97 -0
  143. package/dist/composables/navigation/use-route-props.js +21 -0
  144. package/dist/composables/navigation/use-unsaved-changes.d.ts +35 -0
  145. package/dist/composables/navigation/use-unsaved-changes.js +88 -0
  146. package/dist/composables/section/section.js +34 -0
  147. package/dist/composables.d.ts +6 -67
  148. package/dist/composables.js +6 -65
  149. package/dist/consts/icons.d.ts +67 -0
  150. package/dist/consts/icons.js +69 -0
  151. package/dist/consts/locale.js +12 -0
  152. package/dist/consts/types.d.ts +12 -0
  153. package/dist/index.d.ts +3 -16
  154. package/dist/index.js +38 -14
  155. package/dist/plugins.d.ts +17 -7
  156. package/dist/plugins.js +54 -3
  157. package/dist/styles/fonts/UnimedSlab-Regular.woff2 +0 -0
  158. package/dist/styles/fonts/fonts.css +5 -0
  159. package/dist/styles/settings.scss +155 -0
  160. package/dist/unit-test.d.ts +2 -3
  161. package/dist/unit-test.js +11 -7
  162. package/package.json +14 -12
  163. package/dist/types-BPXXtbmW.d.ts +0 -5
  164. package/dist/use-toast-CACuYhK_.js +0 -53
@@ -0,0 +1,31 @@
1
+ import { ButtonProps } from "./types.js";
2
+ //#region src/components/button/button.vue.d.ts
3
+ /**
4
+ * Button component to be used throughout the application.
5
+ *
6
+ * @example
7
+ * ```vue
8
+ * <template>
9
+ * <u-button color="danger" @click="onClick">
10
+ * Confirmar
11
+ * </u-button>
12
+ * </template>
13
+ * ```
14
+ *
15
+ * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/button | Button Guide}
16
+ */
17
+ declare const _default: typeof __VLS_export;
18
+ declare const __VLS_export: __VLS_WithSlots<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<ButtonProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {} & {
19
+ click: (event: MouseEvent) => any;
20
+ }, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<ButtonProps> & Readonly<{
21
+ onClick?: ((event: MouseEvent) => any) | undefined;
22
+ }>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, {
23
+ default?: (props: {}) => any;
24
+ }>;
25
+ type __VLS_WithSlots<T, S> = T & {
26
+ new (): {
27
+ $slots: S;
28
+ };
29
+ };
30
+ //#endregion
31
+ export { _default as default };
@@ -0,0 +1,97 @@
1
+ import useRouteProps from "../../composables/navigation/use-route-props.js";
2
+ import { useFullWidth } from "../../composables/dimensions/dimensions.js";
3
+ import { useButtonColor, useButtonForm, useButtonRoute, useButtonType, useButtonVariant } from "../../composables/button/button.js";
4
+ import { computed, createBlock, createVNode, defineComponent, mergeProps, openBlock, renderSlot, unref, withCtx } from "vue";
5
+ import { VBtn, VProgressCircular } from "vuetify/components";
6
+ var button_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
7
+ inheritAttrs: false,
8
+ __name: "button",
9
+ props: {
10
+ variant: {
11
+ type: String,
12
+ required: false
13
+ },
14
+ type: {
15
+ type: String,
16
+ required: false
17
+ },
18
+ color: {
19
+ type: String,
20
+ required: false
21
+ },
22
+ disabled: {
23
+ type: Boolean,
24
+ required: false
25
+ },
26
+ loading: {
27
+ type: Boolean,
28
+ required: false
29
+ },
30
+ fullWidth: {
31
+ type: Boolean,
32
+ required: false
33
+ },
34
+ form: {
35
+ type: String,
36
+ required: false
37
+ },
38
+ route: {
39
+ type: null,
40
+ required: false
41
+ },
42
+ dataTestid: {
43
+ type: String,
44
+ required: false
45
+ }
46
+ },
47
+ emits: ["click"],
48
+ setup(__props, { emit: __emit }) {
49
+ const props = __props;
50
+ const emit = __emit;
51
+ const variant = useButtonVariant(() => props.variant);
52
+ const color = useButtonColor(() => props.color, () => props.variant);
53
+ const widthClass = useFullWidth(() => props.fullWidth);
54
+ const isDisabled = computed(() => props.disabled || props.loading);
55
+ const route = useButtonRoute(() => props.route, isDisabled);
56
+ const routeProps = useRouteProps(route);
57
+ const type = useButtonType(() => props.type, () => props.route, isDisabled);
58
+ const form = useButtonForm(() => props.form, () => props.route);
59
+ function onClick(event) {
60
+ emit("click", event);
61
+ }
62
+ return (_ctx, _cache) => {
63
+ return openBlock(), createBlock(unref(VBtn), mergeProps({
64
+ disabled: isDisabled.value,
65
+ loading: props.loading,
66
+ "data-testid": props.dataTestid,
67
+ variant: unref(variant),
68
+ color: unref(color),
69
+ type: unref(type),
70
+ form: unref(form),
71
+ class: unref(widthClass)
72
+ }, unref(routeProps), {
73
+ active: false,
74
+ onClick
75
+ }), {
76
+ loader: withCtx(() => [createVNode(unref(VProgressCircular), {
77
+ indeterminate: "",
78
+ width: "2",
79
+ "aria-hidden": "true"
80
+ })]),
81
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
82
+ _: 3
83
+ }, 16, [
84
+ "disabled",
85
+ "loading",
86
+ "data-testid",
87
+ "variant",
88
+ "color",
89
+ "type",
90
+ "form",
91
+ "class"
92
+ ]);
93
+ };
94
+ }
95
+ });
96
+ //#endregion
97
+ export { button_vue_vue_type_script_setup_true_lang_default as default };
@@ -0,0 +1,65 @@
1
+ import { ColorVariant } from "../../composables/colors/types.js";
2
+ import { RouteLocationRaw } from "vue-router";
3
+ //#region src/components/button/types.d.ts
4
+ export type ButtonVariant = "primary" | "secondary" | "ghost";
5
+ /**
6
+ * Props exposed by the {@link Button} component.
7
+ */
8
+ export type ButtonProps = {
9
+ /**
10
+ * Applies a distinct style variation to the button.
11
+ * One of `primary`, `secondary`, or `ghost`.
12
+ * @default "primary"
13
+ */
14
+ variant?: ButtonVariant;
15
+ /**
16
+ * Applies a distinct behavior to the button.
17
+ * One of `button` or `submit`. Ignored when `route` is set.
18
+ * @default "button"
19
+ */
20
+ type?: "submit" | "button";
21
+ /**
22
+ * Applies a color to the button.
23
+ * One of `primary`, `secondary`, `positive`, `informative`, `caution`, or `danger`.
24
+ * @default "primary"
25
+ */
26
+ color?: ColorVariant;
27
+ /**
28
+ * Removes the ability to click or target the button.
29
+ * @default false
30
+ */
31
+ disabled?: boolean;
32
+ /**
33
+ * Displays a loading indicator on the button and disables it while active, as `disabled` does:
34
+ * it can't be clicked or focused, `click` isn't emitted and its form isn't submitted, including
35
+ * by pressing `Enter` in one of the form's fields when it's the form's first submit button. It
36
+ * looks disabled, with the indicator, and loses focus if focused when loading starts, as any
37
+ * disabled button does. The button keeps its text as accessible name and is marked as busy, and
38
+ * assistive technologies ignore the indicator.
39
+ * @default false
40
+ */
41
+ loading?: boolean;
42
+ /**
43
+ * Stretches the button to the whole width of its parent, e.g. the only action of a form on a
44
+ * small screen.
45
+ * @default false
46
+ */
47
+ fullWidth?: boolean;
48
+ /**
49
+ * Associated [form](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/form) id.
50
+ * Ignored when `route` is set.
51
+ */
52
+ form?: string;
53
+ /**
54
+ * Where the button goes when clicked, rendering it as a link with the button's look. A route
55
+ * inside the app (`"/patients"`, `{ name: "patient", params: { id } }`) navigates through the
56
+ * app's router; a URL starting with `http` navigates through the browser, in the same tab. While
57
+ * `disabled` or `loading`, the button doesn't navigate and is rendered as a disabled button.
58
+ */
59
+ route?: RouteLocationRaw;
60
+ /**
61
+ * Component id to use on automated tests.
62
+ */
63
+ dataTestid?: string;
64
+ };
65
+ //#endregion
@@ -0,0 +1,5 @@
1
+ import data_set_vue_vue_type_script_setup_true_lang_default from "./data-set.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/components/data-sets/data-set/data-set.vue
3
+ var data_set_default = data_set_vue_vue_type_script_setup_true_lang_default;
4
+ //#endregion
5
+ export { data_set_default as default };
@@ -0,0 +1,47 @@
1
+ import { DataSetProps, DataSetSlots } from "./types.js";
2
+ //#region src/components/data-sets/data-set/data-set.vue.d.ts
3
+ /**
4
+ * Data set component to list records as a responsive grid of cards, with
5
+ * client-side pagination, and an optional bar above the records with actions
6
+ * about the list and a search field. Each record of the current page is
7
+ * rendered by the default slot, usually with `UDataSetItem`.
8
+ *
9
+ * @example
10
+ * ```vue
11
+ * <template>
12
+ * <u-data-set
13
+ * :items="patients"
14
+ * :columns="4"
15
+ * :actions="[{ label: 'Novo paciente', onClick: create }]"
16
+ * searchable
17
+ * >
18
+ * <template #default="{ item }">
19
+ * <u-data-set-item :title="item.name" :subtitle="item.plan" />
20
+ * </template>
21
+ * </u-data-set>
22
+ * </template>
23
+ * ```
24
+ *
25
+ * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/data-set | DataSet Guide}
26
+ */
27
+ declare const _default: typeof __VLS_export;
28
+ declare const __VLS_export: <T extends object>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
29
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<(DataSetProps<T> & {
30
+ page?: number;
31
+ search?: string;
32
+ }) & {
33
+ "onUpdate:page"?: ((value: number) => any) | undefined;
34
+ "onUpdate:search"?: ((value: string) => any) | undefined;
35
+ }> & (typeof globalThis extends {
36
+ __VLS_PROPS_FALLBACK: infer P;
37
+ } ? P : {});
38
+ expose: (exposed: {}) => void;
39
+ attrs: any;
40
+ slots: DataSetSlots<T>;
41
+ emit: ((event: "update:page", value: number) => void) & ((event: "update:search", value: string) => void);
42
+ }>) => import("vue").VNode & {
43
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
44
+ };
45
+ type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
46
+ //#endregion
47
+ export { _default as default };
@@ -0,0 +1,157 @@
1
+ import skeleton_loader_default from "../../skeleton-loader/skeleton-loader.js";
2
+ import row_default from "../../grid/row/row.js";
3
+ import column_default from "../../grid/column/column.js";
4
+ import { getDataSetTotalVisible, useDataSetBarCols, useDataSetColumnCols, useDataSetFilterKeys, useDataSetFittingColumns, useDataSetSearchPageReset, useDataSetWidth } from "../../../composables/data-set/data-set.js";
5
+ import data_set_bar_default from "../data-set-bar.js";
6
+ import { Fragment, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, mergeModels, openBlock, renderList, renderSlot, unref, useModel, useSlots, useTemplateRef, withCtx } from "vue";
7
+ import { VDataIterator, VEmptyState, VPagination } from "vuetify/components";
8
+ var data_set_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
9
+ inheritAttrs: false,
10
+ __name: "data-set",
11
+ props: /*@__PURE__*/ mergeModels({
12
+ items: {
13
+ type: Array,
14
+ required: false
15
+ },
16
+ columns: {
17
+ type: Number,
18
+ required: false,
19
+ default: 3
20
+ },
21
+ itemsPerPage: {
22
+ type: Number,
23
+ required: false,
24
+ default: 10
25
+ },
26
+ actions: {
27
+ type: Array,
28
+ required: false
29
+ },
30
+ searchable: {
31
+ type: Boolean,
32
+ required: false
33
+ },
34
+ searchKeys: {
35
+ type: Array,
36
+ required: false
37
+ },
38
+ noDataText: {
39
+ type: String,
40
+ required: false,
41
+ default: "Nenhum registro encontrado."
42
+ },
43
+ loading: {
44
+ type: Boolean,
45
+ required: false
46
+ },
47
+ dataTestid: {
48
+ type: String,
49
+ required: false
50
+ }
51
+ }, {
52
+ "page": {
53
+ type: Number,
54
+ default: 1
55
+ },
56
+ "pageModifiers": {},
57
+ "search": {
58
+ type: String,
59
+ default: ""
60
+ },
61
+ "searchModifiers": {}
62
+ }),
63
+ emits: ["update:page", "update:search"],
64
+ setup(__props) {
65
+ const props = __props;
66
+ useSlots();
67
+ const page = useModel(__props, "page");
68
+ const search = useModel(__props, "search");
69
+ const iterator = useTemplateRef("iterator");
70
+ const width = useDataSetWidth(() => iterator.value?.$el);
71
+ const fittingColumns = useDataSetFittingColumns(() => props.columns, width);
72
+ const columnCols = useDataSetColumnCols(fittingColumns);
73
+ const barColumnCols = useDataSetBarCols(width);
74
+ const filterKeys = useDataSetFilterKeys(() => props.searchKeys);
75
+ useDataSetSearchPageReset(search, page);
76
+ return (_ctx, _cache) => {
77
+ return openBlock(), createBlock(skeleton_loader_default, {
78
+ loading: props.loading,
79
+ type: "card",
80
+ "full-width": ""
81
+ }, {
82
+ default: withCtx(() => [createCommentVNode(" The bar and the records take a line each of the same row, so the grid spaces them as it\n spaces its lines. The bar stays out of the iterator's header, where nothing would space\n it from the records "), createVNode(row_default, { "data-testid": props.dataTestid }, {
83
+ default: withCtx(() => [props.actions?.length || props.searchable ? (openBlock(), createBlock(column_default, { key: 0 }, {
84
+ default: withCtx(() => [createVNode(data_set_bar_default, {
85
+ modelValue: search.value,
86
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => search.value = $event),
87
+ actions: props.actions,
88
+ searchable: props.searchable,
89
+ cols: unref(barColumnCols)
90
+ }, null, 8, [
91
+ "modelValue",
92
+ "actions",
93
+ "searchable",
94
+ "cols"
95
+ ])]),
96
+ _: 1
97
+ })) : createCommentVNode("v-if", true), createVNode(column_default, null, {
98
+ default: withCtx(() => [createVNode(unref(VDataIterator), {
99
+ ref_key: "iterator",
100
+ ref: iterator,
101
+ page: page.value,
102
+ "onUpdate:page": _cache[2] || (_cache[2] = ($event) => page.value = $event),
103
+ items: props.items,
104
+ "items-per-page": props.itemsPerPage,
105
+ search: search.value,
106
+ "filter-keys": unref(filterKeys)
107
+ }, {
108
+ default: withCtx(({ items: pageItems }) => [createCommentVNode(" Stretched, so the items of the same line (e.g. full-height cards) share its height "), createVNode(row_default, {
109
+ list: "",
110
+ "align-y": "stretch"
111
+ }, {
112
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(pageItems, (pageItem, index) => {
113
+ return openBlock(), createBlock(column_default, {
114
+ key: index,
115
+ cols: unref(columnCols),
116
+ "list-item": ""
117
+ }, {
118
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", {
119
+ item: pageItem.raw,
120
+ index
121
+ })]),
122
+ _: 2
123
+ }, 1032, ["cols"]);
124
+ }), 128))]),
125
+ _: 2
126
+ }, 1024)]),
127
+ "no-data": withCtx(() => [createVNode(unref(VEmptyState), { text: props.noDataText }, null, 8, ["text"])]),
128
+ footer: withCtx(({ pageCount }) => [pageCount > 1 ? (openBlock(), createBlock(unref(VPagination), {
129
+ key: 0,
130
+ modelValue: page.value,
131
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => page.value = $event),
132
+ length: pageCount,
133
+ "total-visible": unref(getDataSetTotalVisible)(pageCount)
134
+ }, null, 8, [
135
+ "modelValue",
136
+ "length",
137
+ "total-visible"
138
+ ])) : createCommentVNode("v-if", true)]),
139
+ _: 3
140
+ }, 8, [
141
+ "page",
142
+ "items",
143
+ "items-per-page",
144
+ "search",
145
+ "filter-keys"
146
+ ])]),
147
+ _: 3
148
+ })]),
149
+ _: 3
150
+ }, 8, ["data-testid"])]),
151
+ _: 3
152
+ }, 8, ["loading"]);
153
+ };
154
+ }
155
+ });
156
+ //#endregion
157
+ export { data_set_vue_vue_type_script_setup_true_lang_default as default };
@@ -0,0 +1,93 @@
1
+ import { SectionAction } from "../../sections/section/types.js";
2
+ //#region src/components/data-sets/data-set/types.d.ts
3
+ /**
4
+ * Number of records shown side by side on each row of a {@link DataSet}.
5
+ */
6
+ export type DataSetColumns = 1 | 2 | 3 | 4 | 6;
7
+ /**
8
+ * Props exposed by the {@link DataSet} component.
9
+ */
10
+ export type DataSetProps<T extends object> = {
11
+ /**
12
+ * Records to be listed. Each record of the current page is passed, as is,
13
+ * to the default slot.
14
+ * @default []
15
+ */
16
+ items?: T[];
17
+ /**
18
+ * Maximum number of records shown side by side on each row of the grid.
19
+ * One of `1`, `2`, `3`, `4` or `6`.
20
+ *
21
+ * It's reduced to the largest of these values that keeps each record's card
22
+ * at least 240px wide within the data set's own width, so narrow
23
+ * containers, like dialogs or side panels, show fewer records per row, down
24
+ * to a single one. On extra small screens, each record always takes the
25
+ * full width.
26
+ * @default 3
27
+ */
28
+ columns?: DataSetColumns;
29
+ /**
30
+ * Maximum number of records shown per page. Page controls are only shown
31
+ * when there's more than one page.
32
+ * @default 10
33
+ */
34
+ itemsPerPage?: number;
35
+ /**
36
+ * List of actions about the whole list, such as creating a record, displayed
37
+ * as buttons at the start of the bar above the records, before the search
38
+ * field. Same shape as `USection`'s actions, but an action without `variant`
39
+ * is `secondary`, not `primary`, so it doesn't compete with the actions of the
40
+ * records; an action that sets `variant` keeps it.
41
+ *
42
+ * With the search field, the actions take the first half of the bar,
43
+ * wrapping within it, or a line of their own when the data set isn't wide
44
+ * enough for two records side by side. On extra small screens, each action
45
+ * takes a line of its own and the full width. When undefined or empty, and
46
+ * `searchable` is false, no bar is rendered.
47
+ */
48
+ actions?: SectionAction[];
49
+ /**
50
+ * Shows a search field at the end of the bar above the records, bound to
51
+ * `v-model:search`. It's 240px wide, the same as a card's minimum width. On
52
+ * extra small screens, it takes a line of its own and the full width.
53
+ * @default false
54
+ */
55
+ searchable?: boolean;
56
+ /**
57
+ * Record properties considered by the search. When undefined or empty,
58
+ * every property of the record is considered.
59
+ */
60
+ searchKeys?: Array<Extract<keyof T, string>>;
61
+ /**
62
+ * Message shown when there are no records to list, either because `items`
63
+ * is empty or because no record matches the search.
64
+ * @default "Nenhum registro encontrado."
65
+ */
66
+ noDataText?: string;
67
+ /**
68
+ * Shows a skeleton loader in place of the records while data is being
69
+ * loaded.
70
+ * @default false
71
+ */
72
+ loading?: boolean;
73
+ /**
74
+ * Component id to use on automated tests.
75
+ */
76
+ dataTestid?: string;
77
+ };
78
+ /**
79
+ * Slots exposed by the {@link DataSet} component.
80
+ */
81
+ export type DataSetSlots<T extends object> = {
82
+ /**
83
+ * Renders each record of the current page in its own grid column, usually
84
+ * with `UDataSetItem`.
85
+ * @param props.item The original record, from `items`.
86
+ * @param props.index Position of the record inside the current page.
87
+ */
88
+ default?: (props: {
89
+ item: T;
90
+ index: number;
91
+ }) => unknown;
92
+ };
93
+ //#endregion
@@ -0,0 +1,5 @@
1
+ import data_set_bar_vue_vue_type_script_setup_true_lang_default from "./data-set-bar.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/components/data-sets/data-set-bar.vue
3
+ var data_set_bar_default = data_set_bar_vue_vue_type_script_setup_true_lang_default;
4
+ //#endregion
5
+ export { data_set_bar_default as default };
@@ -0,0 +1,99 @@
1
+ import text_field_default from "../inputs/text-field/text-field.js";
2
+ import button_default from "../button/button.js";
3
+ import row_default from "../grid/row/row.js";
4
+ import column_default from "../grid/column/column.js";
5
+ import { Fragment, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, mergeModels, mergeProps, openBlock, renderList, toDisplayString, unref, useModel, withCtx } from "vue";
6
+ import { VDefaultsProvider } from "vuetify/components";
7
+ var data_set_bar_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
8
+ inheritAttrs: false,
9
+ __name: "data-set-bar",
10
+ props: /*@__PURE__*/ mergeModels({
11
+ actions: {
12
+ type: Array,
13
+ required: false
14
+ },
15
+ searchable: {
16
+ type: Boolean,
17
+ required: false
18
+ },
19
+ cols: {
20
+ type: String,
21
+ required: true
22
+ }
23
+ }, {
24
+ "modelValue": {
25
+ type: String,
26
+ default: ""
27
+ },
28
+ "modelModifiers": {}
29
+ }),
30
+ emits: ["update:modelValue"],
31
+ setup(__props) {
32
+ const props = __props;
33
+ const search = useModel(__props, "modelValue");
34
+ const searchFieldDefaults = { VTextField: {
35
+ hideDetails: "auto",
36
+ minWidth: 240
37
+ } };
38
+ return (_ctx, _cache) => {
39
+ return openBlock(), createBlock(row_default, { "align-y": "end" }, {
40
+ default: withCtx(() => [
41
+ createCommentVNode(" The search field leaves room above its text for the floating label, so its text, icon and\n underline sit below its middle. Centered on it, the actions would look higher than the\n field, so they line up with its underline instead "),
42
+ createCommentVNode(" No column grows to push the search field to the end of the line, so the actions and the\n search field share it in two columns, and the search field is aligned to the end of its\n own "),
43
+ props.actions?.length ? (openBlock(), createBlock(column_default, {
44
+ key: 0,
45
+ cols: props.searchable ? props.cols : "12"
46
+ }, {
47
+ default: withCtx(() => [createVNode(row_default, null, {
48
+ default: withCtx(() => [
49
+ createCommentVNode(" Each action takes the full width of its column, which only stretches it below sm "),
50
+ createCommentVNode(" The list's actions are secondary unless they set a variant, so they don't compete with\n the actions of the records and of the sections "),
51
+ (openBlock(true), createElementBlock(Fragment, null, renderList(props.actions, ({ label, onClick, variant = "secondary", ...action }, index) => {
52
+ return openBlock(), createBlock(column_default, {
53
+ key: index,
54
+ cols: "auto"
55
+ }, {
56
+ default: withCtx(() => [createVNode(button_default, mergeProps({
57
+ "full-width": "",
58
+ variant
59
+ }, { ref_for: true }, action, { onClick }), {
60
+ default: withCtx(() => [createTextVNode(toDisplayString(label), 1)]),
61
+ _: 2
62
+ }, 1040, ["variant", "onClick"])]),
63
+ _: 2
64
+ }, 1024);
65
+ }), 128))
66
+ ]),
67
+ _: 1
68
+ })]),
69
+ _: 1
70
+ }, 8, ["cols"])) : createCommentVNode("v-if", true),
71
+ props.searchable ? (openBlock(), createBlock(column_default, {
72
+ key: 1,
73
+ cols: props.actions?.length ? props.cols : "12"
74
+ }, {
75
+ default: withCtx(() => [createVNode(row_default, { "align-x": "end" }, {
76
+ default: withCtx(() => [createVNode(column_default, { cols: "auto" }, {
77
+ default: withCtx(() => [createCommentVNode(" Hides the empty messages area, which would misalign the field with the actions, and\n keeps the field from shrinking to its label, which is all a column of its own width\n would leave it "), createVNode(unref(VDefaultsProvider), { defaults: searchFieldDefaults }, {
78
+ default: withCtx(() => [createVNode(text_field_default, {
79
+ modelValue: search.value,
80
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => search.value = $event),
81
+ type: "search",
82
+ label: "Pesquisar"
83
+ }, null, 8, ["modelValue"])]),
84
+ _: 1
85
+ })]),
86
+ _: 1
87
+ })]),
88
+ _: 1
89
+ })]),
90
+ _: 1
91
+ }, 8, ["cols"])) : createCommentVNode("v-if", true)
92
+ ]),
93
+ _: 1
94
+ });
95
+ };
96
+ }
97
+ });
98
+ //#endregion
99
+ export { data_set_bar_vue_vue_type_script_setup_true_lang_default as default };
@@ -0,0 +1,5 @@
1
+ import data_set_item_vue_vue_type_script_setup_true_lang_default from "./data-set-item.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/components/data-sets/data-set-item/data-set-item.vue
3
+ var data_set_item_default = data_set_item_vue_vue_type_script_setup_true_lang_default;
4
+ //#endregion
5
+ export { data_set_item_default as default };
@@ -0,0 +1,35 @@
1
+ import { DataSetItemProps, DataSetItemSlots } from "./types.js";
2
+ //#region src/components/data-sets/data-set-item/data-set-item.vue.d.ts
3
+ /**
4
+ * Card of a single record listed by a {@link DataSet}, built on `USection`.
5
+ * It fills the height of its grid column, so the cards of a row line up. Its
6
+ * details, like a vertical `UTable`, go in the default slot.
7
+ *
8
+ * @example
9
+ * ```vue
10
+ * <template>
11
+ * <u-data-set :items="patients">
12
+ * <template #default="{ item }">
13
+ * <u-data-set-item
14
+ * :title="item.name"
15
+ * subtitle="Beneficiário"
16
+ * :actions="[{ label: 'Editar', variant: 'secondary', onClick: () => edit(item) }]"
17
+ * >
18
+ * <u-table :headers="['Plano', 'Idade']" :items="[[item.plan, item.age]]" vertical />
19
+ * </u-data-set-item>
20
+ * </template>
21
+ * </u-data-set>
22
+ * </template>
23
+ * ```
24
+ *
25
+ * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/data-set | DataSet Guide}
26
+ */
27
+ declare const _default: typeof __VLS_export;
28
+ declare const __VLS_export: __VLS_WithSlots<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<DataSetItemProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<DataSetItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, DataSetItemSlots>;
29
+ type __VLS_WithSlots<T, S> = T & {
30
+ new (): {
31
+ $slots: S;
32
+ };
33
+ };
34
+ //#endregion
35
+ export { _default as default };