@nexdom/uimed-vue 2.0.0-beta.1 → 2.0.0-beta.3
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.
- package/AGENTS.md +12 -0
- package/README.md +1 -1
- package/dist/components.d.ts +88 -20
- package/dist/components.js +88 -6
- package/dist/plugins.d.ts +2 -2
- package/dist/plugins.js +2 -2
- package/package.json +3 -1
package/AGENTS.md
CHANGED
|
@@ -72,6 +72,18 @@ import { Root } from "@nexdom/uimed-vue/components";
|
|
|
72
72
|
|
|
73
73
|
Never write CSS, classes or any kind of styling. Always use component props.
|
|
74
74
|
|
|
75
|
+
The library doesn't export prop types. Derive them with `ComponentProps` from `vue-component-type-helpers`:
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
import type { ComponentProps } from "vue-component-type-helpers";
|
|
79
|
+
import { UMain, USection } from "@nexdom/uimed-vue/components";
|
|
80
|
+
|
|
81
|
+
type MainProps = ComponentProps<typeof UMain>;
|
|
82
|
+
type AppBar = NonNullable<MainProps["appBar"]>;
|
|
83
|
+
type NavigationMenu = NonNullable<MainProps["navigationMenu"]>;
|
|
84
|
+
type SectionAction = NonNullable<ComponentProps<typeof USection>["actions"]>[number];
|
|
85
|
+
```
|
|
86
|
+
|
|
75
87
|
Available entry points: `@nexdom/uimed-vue` (root), `@nexdom/uimed-vue/components`, `@nexdom/uimed-vue/composables`, `@nexdom/uimed-vue/plugins`, `@nexdom/uimed-vue/unit-test` (test helpers, e.g. `vueTestUtilsPluginUimed()` for mounting components with Vuetify in Vitest).
|
|
76
88
|
|
|
77
89
|
Full component/composable reference lives in the [docs](https://nexdom-healthtech.github.io/uimed-vue/).
|
package/README.md
CHANGED
package/dist/components.d.ts
CHANGED
|
@@ -171,8 +171,8 @@ type MainProps = {
|
|
|
171
171
|
*
|
|
172
172
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/main | Main Guide}
|
|
173
173
|
*/
|
|
174
|
-
declare const _default$4: typeof __VLS_export$
|
|
175
|
-
declare const __VLS_export$
|
|
174
|
+
declare const _default$4: typeof __VLS_export$9;
|
|
175
|
+
declare const __VLS_export$9: __VLS_WithSlots$7<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<MainProps & {
|
|
176
176
|
notificationsOpen?: boolean;
|
|
177
177
|
}, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {
|
|
178
178
|
"update:notificationsOpen": (value: boolean) => any;
|
|
@@ -248,8 +248,8 @@ type ButtonProps = {
|
|
|
248
248
|
*
|
|
249
249
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/button | Button Guide}
|
|
250
250
|
*/
|
|
251
|
-
declare const _default: typeof __VLS_export$
|
|
252
|
-
declare const __VLS_export$
|
|
251
|
+
declare const _default: typeof __VLS_export$8;
|
|
252
|
+
declare const __VLS_export$8: __VLS_WithSlots$6<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<ButtonProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {} & {
|
|
253
253
|
click: (event: MouseEvent) => any;
|
|
254
254
|
}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<ButtonProps> & Readonly<{
|
|
255
255
|
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
@@ -339,8 +339,8 @@ type TextFieldProps = {
|
|
|
339
339
|
*
|
|
340
340
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/text-field | TextField Guide}
|
|
341
341
|
*/
|
|
342
|
-
declare const _default$
|
|
343
|
-
declare const __VLS_export$
|
|
342
|
+
declare const _default$9: typeof __VLS_export$7;
|
|
343
|
+
declare const __VLS_export$7: import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<TextFieldProps & {
|
|
344
344
|
modelValue?: string;
|
|
345
345
|
}, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {
|
|
346
346
|
"update:modelValue": (value: string) => any;
|
|
@@ -349,8 +349,8 @@ declare const __VLS_export$6: import("vue", { with: { "resolution-mode": "import
|
|
|
349
349
|
}> & Readonly<{
|
|
350
350
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
351
351
|
}>, {
|
|
352
|
-
variant: TextFieldVariant;
|
|
353
352
|
type: TextFieldType;
|
|
353
|
+
variant: TextFieldVariant;
|
|
354
354
|
clearable: boolean;
|
|
355
355
|
}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>;
|
|
356
356
|
//#endregion
|
|
@@ -380,8 +380,8 @@ type ContainerProps = {
|
|
|
380
380
|
*
|
|
381
381
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/layout | Container Guide}
|
|
382
382
|
*/
|
|
383
|
-
declare const _default$2: typeof __VLS_export$
|
|
384
|
-
declare const __VLS_export$
|
|
383
|
+
declare const _default$2: typeof __VLS_export$6;
|
|
384
|
+
declare const __VLS_export$6: __VLS_WithSlots$5<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<ContainerProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<ContainerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, {
|
|
385
385
|
default?: (props: {}) => any;
|
|
386
386
|
}>;
|
|
387
387
|
type __VLS_WithSlots$5<T, S> = T & {
|
|
@@ -418,8 +418,8 @@ type RowProps = {
|
|
|
418
418
|
*
|
|
419
419
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/layout | Row Guide}
|
|
420
420
|
*/
|
|
421
|
-
declare const _default$5: typeof __VLS_export$
|
|
422
|
-
declare const __VLS_export$
|
|
421
|
+
declare const _default$5: typeof __VLS_export$5;
|
|
422
|
+
declare const __VLS_export$5: __VLS_WithSlots$4<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<RowProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<RowProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, {
|
|
423
423
|
default?: (props: {}) => any;
|
|
424
424
|
}>;
|
|
425
425
|
type __VLS_WithSlots$4<T, S> = T & {
|
|
@@ -467,8 +467,8 @@ type Cols = "auto" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10"
|
|
|
467
467
|
*
|
|
468
468
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/layout | Column Guide}
|
|
469
469
|
*/
|
|
470
|
-
declare const _default$1: typeof __VLS_export$
|
|
471
|
-
declare const __VLS_export$
|
|
470
|
+
declare const _default$1: typeof __VLS_export$4;
|
|
471
|
+
declare const __VLS_export$4: __VLS_WithSlots$3<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<ColumnProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<ColumnProps> & Readonly<{}>, {
|
|
472
472
|
cols: "12" | "auto" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11";
|
|
473
473
|
}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, {
|
|
474
474
|
default?: (props: {}) => any;
|
|
@@ -510,8 +510,8 @@ type FormProps = {
|
|
|
510
510
|
*
|
|
511
511
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/form | Form Guide}
|
|
512
512
|
*/
|
|
513
|
-
declare const _default$3: typeof __VLS_export$
|
|
514
|
-
declare const __VLS_export$
|
|
513
|
+
declare const _default$3: typeof __VLS_export$3;
|
|
514
|
+
declare const __VLS_export$3: __VLS_WithSlots$2<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<FormProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {} & {
|
|
515
515
|
submit: (event: SubmitEvent) => any;
|
|
516
516
|
}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<FormProps> & Readonly<{
|
|
517
517
|
onSubmit?: ((event: SubmitEvent) => any) | undefined;
|
|
@@ -540,8 +540,8 @@ type __VLS_WithSlots$2<T, S> = T & {
|
|
|
540
540
|
*
|
|
541
541
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/section | Section Guide}
|
|
542
542
|
*/
|
|
543
|
-
declare const _default$7: typeof __VLS_export$
|
|
544
|
-
declare const __VLS_export$
|
|
543
|
+
declare const _default$7: typeof __VLS_export$2;
|
|
544
|
+
declare const __VLS_export$2: __VLS_WithSlots$1<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<{}, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, true, {}, any>, {
|
|
545
545
|
default?: (props: {}) => any;
|
|
546
546
|
}>;
|
|
547
547
|
type __VLS_WithSlots$1<T, S> = T & {
|
|
@@ -626,8 +626,8 @@ interface SectionAction extends ButtonProps {
|
|
|
626
626
|
*
|
|
627
627
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/section | Section Guide}
|
|
628
628
|
*/
|
|
629
|
-
declare const _default$6: typeof __VLS_export;
|
|
630
|
-
declare const __VLS_export: __VLS_WithSlots<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<SectionProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<SectionProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, {
|
|
629
|
+
declare const _default$6: typeof __VLS_export$1;
|
|
630
|
+
declare const __VLS_export$1: __VLS_WithSlots<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<SectionProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<SectionProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, {
|
|
631
631
|
default?: (props: {}) => any;
|
|
632
632
|
}>;
|
|
633
633
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -636,4 +636,72 @@ type __VLS_WithSlots<T, S> = T & {
|
|
|
636
636
|
};
|
|
637
637
|
};
|
|
638
638
|
//#endregion
|
|
639
|
-
|
|
639
|
+
//#region src/components/table/types.d.ts
|
|
640
|
+
/**
|
|
641
|
+
* Props exposed by the {@link UTable} component.
|
|
642
|
+
*/
|
|
643
|
+
type TableProps = {
|
|
644
|
+
/**
|
|
645
|
+
* Optional column headers. When not provided or empty, no `<thead>` is
|
|
646
|
+
* rendered in horizontal mode. In vertical mode, headers (when non-empty)
|
|
647
|
+
* are used as labels for rows. When `vertical` is true and `headers` is
|
|
648
|
+
* `undefined`, the component falls back to horizontal mode (single table,
|
|
649
|
+
* plain rows). When `vertical` is true and `headers` is an empty array,
|
|
650
|
+
* vertical mode is still used, but rows are rendered without labels (a
|
|
651
|
+
* single `<td>` per row).
|
|
652
|
+
*/
|
|
653
|
+
headers?: string[];
|
|
654
|
+
/**
|
|
655
|
+
* Optional rows of data. Each entry is a list of string cell values.
|
|
656
|
+
* In horizontal mode, each item becomes one `<tr>` with cells as `<td>`.
|
|
657
|
+
* In vertical mode with headers, renders one `v-table` per item with one `<tr>`
|
|
658
|
+
* per header (th + td for that item's value). In vertical mode with an empty
|
|
659
|
+
* `headers` array, renders one `v-table` per item with one `<tr>` per cell
|
|
660
|
+
* value (a single `<td>`, no `<th>`). No padding or truncation applied —
|
|
661
|
+
* cells are rendered exactly as provided, even if rows have different lengths.
|
|
662
|
+
*/
|
|
663
|
+
items?: string[][];
|
|
664
|
+
/**
|
|
665
|
+
* Changes table layout when true. When enabled with a non-empty `headers`
|
|
666
|
+
* array, renders one `v-table` per item in `items`, with each table showing
|
|
667
|
+
* that item's values vertically (one row per header). When enabled with an
|
|
668
|
+
* empty `headers` array, still renders one `v-table` per item, but each row
|
|
669
|
+
* only has the item's value (no header label). When `headers` is
|
|
670
|
+
* `undefined`, falls back to horizontal layout (single table, plain rows)
|
|
671
|
+
* regardless of this prop.
|
|
672
|
+
* @default false
|
|
673
|
+
*/
|
|
674
|
+
vertical?: boolean;
|
|
675
|
+
/**
|
|
676
|
+
* Shows a skeleton loader in place of the table content while data is being
|
|
677
|
+
* loaded.
|
|
678
|
+
* @default false
|
|
679
|
+
*/
|
|
680
|
+
loading?: boolean;
|
|
681
|
+
/**
|
|
682
|
+
* Component id to use on automated tests. In vertical mode with multiple
|
|
683
|
+
* items, each table gets a suffixed id: `${dataTestid}-${index}`. With a
|
|
684
|
+
* single table (non-vertical or vertical with one item), the unsuffixed id
|
|
685
|
+
* is used. When undefined, no data-testid attribute is set.
|
|
686
|
+
*/
|
|
687
|
+
dataTestid?: string;
|
|
688
|
+
};
|
|
689
|
+
//#endregion
|
|
690
|
+
//#region src/components/table/table.vue.d.ts
|
|
691
|
+
/**
|
|
692
|
+
* Component to present data using tables. All content is data-driven via props
|
|
693
|
+
* — no slots. Supports both horizontal (default) and vertical layouts.
|
|
694
|
+
*
|
|
695
|
+
* @example
|
|
696
|
+
* ```vue
|
|
697
|
+
* <template>
|
|
698
|
+
* <u-table :headers="['Nome', 'Idade']" :items="[['Ana', '30'], ['Bruno', '25']]" />
|
|
699
|
+
* </template>
|
|
700
|
+
* ```
|
|
701
|
+
*
|
|
702
|
+
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/table | Table Guide}
|
|
703
|
+
*/
|
|
704
|
+
declare const _default$8: typeof __VLS_export;
|
|
705
|
+
declare const __VLS_export: import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<TableProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<TableProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>;
|
|
706
|
+
//#endregion
|
|
707
|
+
export { _default as UButton, _default$1 as UColumn, _default$2 as UContainer, _default$3 as UForm, _default$4 as UMain, _default$5 as URow, _default$6 as USection, _default$7 as USectionContent, _default$8 as UTable, _default$9 as UTextField };
|
package/dist/components.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as useVuetifyColor, t as messages } from "./use-toast-CACuYhK_.js";
|
|
2
2
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, isRef, mergeModels, mergeProps, openBlock, ref, renderList, renderSlot, toDisplayString, toValue, unref, useModel, withCtx, withModifiers } from "vue";
|
|
3
|
-
import { VApp, VAppBar, VAppBarNavIcon, VAppBarTitle, VAvatar, VBadge, VBtn, VCard, VCardActions, VCardText, VCol, VContainer, VDivider, VForm, VIcon, VIconBtn, VImg, VList, VListGroup, VListItem, VListItemAction, VListSubheader, VMain, VMenu, VNavigationDrawer, VRow, VSkeletonLoader, VSnackbarQueue, VTextField } from "vuetify/components";
|
|
3
|
+
import { VApp, VAppBar, VAppBarNavIcon, VAppBarTitle, VAvatar, VBadge, VBtn, VCard, VCardActions, VCardText, VCol, VContainer, VDivider, VForm, VIcon, VIconBtn, VImg, VList, VListGroup, VListItem, VListItemAction, VListSubheader, VMain, VMenu, VNavigationDrawer, VRow, VSkeletonLoader, VSnackbarQueue, VTable, VTextField } from "vuetify/components";
|
|
4
4
|
import { formatDateTime, isEmail, isEmpty, isPhone, isUrl, toPeriodInterval } from "@nexdom/shared/utils";
|
|
5
5
|
//#region src/composables/navigation/use-route-props.ts
|
|
6
6
|
function useRouteProps(route) {
|
|
@@ -15,7 +15,7 @@ function isExternalRoute(route) {
|
|
|
15
15
|
}
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/components/app-bar/app-bar.vue?vue&type=script&setup=true&lang.ts
|
|
18
|
-
const _hoisted_1$
|
|
18
|
+
const _hoisted_1$2 = { class: "opacity-60" };
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/components/app-bar/app-bar.vue
|
|
21
21
|
var app_bar_default = /* @__PURE__ */ defineComponent({
|
|
@@ -139,7 +139,7 @@ var app_bar_default = /* @__PURE__ */ defineComponent({
|
|
|
139
139
|
}, createSlots({ _: 2 }, [notification.date ? {
|
|
140
140
|
name: "append",
|
|
141
141
|
fn: withCtx(() => [createVNode(unref(VListItemAction), { end: "" }, {
|
|
142
|
-
default: withCtx(() => [createElementVNode("small", _hoisted_1$
|
|
142
|
+
default: withCtx(() => [createElementVNode("small", _hoisted_1$2, toDisplayString(formatNotificationDate(notification.date)), 1)]),
|
|
143
143
|
_: 2
|
|
144
144
|
}, 1024)]),
|
|
145
145
|
key: "0"
|
|
@@ -405,7 +405,7 @@ var text_field_default = /* @__PURE__ */ defineComponent({
|
|
|
405
405
|
});
|
|
406
406
|
//#endregion
|
|
407
407
|
//#region src/components/navigation-menu/navigation-menu.vue?vue&type=script&setup=true&lang.ts
|
|
408
|
-
const _hoisted_1 = { class: "px-4 pt-2" };
|
|
408
|
+
const _hoisted_1$1 = { class: "px-4 pt-2" };
|
|
409
409
|
//#endregion
|
|
410
410
|
//#region src/components/navigation-menu/navigation-menu.vue
|
|
411
411
|
var navigation_menu_default = /* @__PURE__ */ defineComponent({
|
|
@@ -462,7 +462,7 @@ var navigation_menu_default = /* @__PURE__ */ defineComponent({
|
|
|
462
462
|
absolute: "",
|
|
463
463
|
temporary: ""
|
|
464
464
|
}, {
|
|
465
|
-
prepend: withCtx(() => [createElementVNode("div", _hoisted_1, [createVNode(text_field_default, {
|
|
465
|
+
prepend: withCtx(() => [createElementVNode("div", _hoisted_1$1, [createVNode(text_field_default, {
|
|
466
466
|
modelValue: search.value,
|
|
467
467
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => search.value = $event),
|
|
468
468
|
type: "search",
|
|
@@ -905,4 +905,86 @@ var section_default = /* @__PURE__ */ defineComponent({
|
|
|
905
905
|
}
|
|
906
906
|
});
|
|
907
907
|
//#endregion
|
|
908
|
-
|
|
908
|
+
//#region src/components/table/table.vue?vue&type=script&setup=true&lang.ts
|
|
909
|
+
const _hoisted_1 = { scope: "row" };
|
|
910
|
+
const _hoisted_2 = { key: 0 };
|
|
911
|
+
//#endregion
|
|
912
|
+
//#region src/components/table/table.vue
|
|
913
|
+
var table_default = /* @__PURE__ */ defineComponent({
|
|
914
|
+
inheritAttrs: false,
|
|
915
|
+
__name: "table",
|
|
916
|
+
props: {
|
|
917
|
+
headers: {
|
|
918
|
+
type: Array,
|
|
919
|
+
required: false
|
|
920
|
+
},
|
|
921
|
+
items: {
|
|
922
|
+
type: Array,
|
|
923
|
+
required: false
|
|
924
|
+
},
|
|
925
|
+
vertical: {
|
|
926
|
+
type: Boolean,
|
|
927
|
+
required: false
|
|
928
|
+
},
|
|
929
|
+
loading: {
|
|
930
|
+
type: Boolean,
|
|
931
|
+
required: false
|
|
932
|
+
},
|
|
933
|
+
dataTestid: {
|
|
934
|
+
type: String,
|
|
935
|
+
required: false
|
|
936
|
+
}
|
|
937
|
+
},
|
|
938
|
+
setup(__props) {
|
|
939
|
+
const props = __props;
|
|
940
|
+
const hasHeaders = computed(() => !!props.headers?.length);
|
|
941
|
+
const itemRows = computed(() => props.items ?? []);
|
|
942
|
+
const type = computed(() => {
|
|
943
|
+
if (hasHeaders.value && !props.vertical) return "table-thead, table-tbody";
|
|
944
|
+
return "table-tbody";
|
|
945
|
+
});
|
|
946
|
+
function getVerticalTableTestId(index) {
|
|
947
|
+
if (!props.dataTestid) return void 0;
|
|
948
|
+
if (itemRows.value.length === 1) return props.dataTestid;
|
|
949
|
+
return `${props.dataTestid}-${index}`;
|
|
950
|
+
}
|
|
951
|
+
return (_ctx, _cache) => {
|
|
952
|
+
return openBlock(), createBlock(unref(VSkeletonLoader), {
|
|
953
|
+
loading: props.loading,
|
|
954
|
+
type: type.value
|
|
955
|
+
}, {
|
|
956
|
+
default: withCtx(() => [props.vertical ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(itemRows.value, (item, itemIndex) => {
|
|
957
|
+
return openBlock(), createBlock(unref(VTable), {
|
|
958
|
+
key: itemIndex,
|
|
959
|
+
"data-testid": getVerticalTableTestId(itemIndex)
|
|
960
|
+
}, {
|
|
961
|
+
default: withCtx(() => [createElementVNode("tbody", null, [hasHeaders.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(props.headers, (header, headerIndex) => {
|
|
962
|
+
return openBlock(), createElementBlock("tr", { key: headerIndex }, [createElementVNode("th", _hoisted_1, toDisplayString(header), 1), createElementVNode("td", null, toDisplayString(item[headerIndex]), 1)]);
|
|
963
|
+
}), 128)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(item, (cell, cellIndex) => {
|
|
964
|
+
return openBlock(), createElementBlock("tr", { key: cellIndex }, [createElementVNode("td", null, toDisplayString(cell), 1)]);
|
|
965
|
+
}), 128))])]),
|
|
966
|
+
_: 2
|
|
967
|
+
}, 1032, ["data-testid"]);
|
|
968
|
+
}), 128)) : (openBlock(), createBlock(unref(VTable), {
|
|
969
|
+
key: 1,
|
|
970
|
+
"data-testid": props.dataTestid
|
|
971
|
+
}, {
|
|
972
|
+
default: withCtx(() => [hasHeaders.value && !props.vertical ? (openBlock(), createElementBlock("thead", _hoisted_2, [createElementVNode("tr", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(props.headers, (header, index) => {
|
|
973
|
+
return openBlock(), createElementBlock("th", {
|
|
974
|
+
key: index,
|
|
975
|
+
scope: "col"
|
|
976
|
+
}, toDisplayString(header), 1);
|
|
977
|
+
}), 128))])])) : createCommentVNode("v-if", true), createElementVNode("tbody", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(itemRows.value, (row, rowIndex) => {
|
|
978
|
+
return openBlock(), createElementBlock("tr", { key: rowIndex }, [(openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, cellIndex) => {
|
|
979
|
+
return openBlock(), createElementBlock("td", { key: cellIndex }, toDisplayString(cell), 1);
|
|
980
|
+
}), 128))]);
|
|
981
|
+
}), 128))])]),
|
|
982
|
+
_: 1
|
|
983
|
+
}, 8, ["data-testid"]))]),
|
|
984
|
+
_: 1
|
|
985
|
+
}, 8, ["loading", "type"]);
|
|
986
|
+
};
|
|
987
|
+
}
|
|
988
|
+
});
|
|
989
|
+
//#endregion
|
|
990
|
+
export { button_default as UButton, column_default as UColumn, container_default as UContainer, 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 };
|
package/dist/plugins.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ import vitePluginVuetify from "vite-plugin-vuetify";
|
|
|
2
2
|
import { UserConfig } from "vite-plus";
|
|
3
3
|
//#region src/plugins.d.ts
|
|
4
4
|
/**
|
|
5
|
-
* Vite plugin for
|
|
5
|
+
* Vite plugin for UIMed.
|
|
6
6
|
*/
|
|
7
7
|
declare function vitePluginUimed(): ReturnType<typeof vitePluginVuetify>;
|
|
8
8
|
/**
|
|
9
|
-
* Vitest Server plugin for
|
|
9
|
+
* Vitest Server plugin for UIMed.
|
|
10
10
|
*/
|
|
11
11
|
declare function vitestServerPluginUimed(): NonNullable<NonNullable<UserConfig["test"]>["server"]>;
|
|
12
12
|
//#endregion
|
package/dist/plugins.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import vitePluginVuetify from "vite-plugin-vuetify";
|
|
2
2
|
//#region src/plugins.ts
|
|
3
3
|
/**
|
|
4
|
-
* Vite plugin for
|
|
4
|
+
* Vite plugin for UIMed.
|
|
5
5
|
*/
|
|
6
6
|
function vitePluginUimed() {
|
|
7
7
|
return vitePluginVuetify({ autoImport: false });
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* Vitest Server plugin for
|
|
10
|
+
* Vitest Server plugin for UIMed.
|
|
11
11
|
*/
|
|
12
12
|
function vitestServerPluginUimed() {
|
|
13
13
|
return { deps: { inline: ["vuetify"] } };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexdom/uimed-vue",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.3",
|
|
4
4
|
"description": "A ui framework for NEXDOM applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lib",
|
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
"vitepress": "2.0.0-alpha.19",
|
|
82
82
|
"vitepress-plugin-group-icons": "^1.7.6",
|
|
83
83
|
"vue": "^3.5.40",
|
|
84
|
+
"vue-component-type-helpers": "^3.3.11",
|
|
84
85
|
"vue-router": "^5.3.1",
|
|
85
86
|
"vue-tsc": "^3.3.9",
|
|
86
87
|
"vuetify": "^4.2.0"
|
|
@@ -93,6 +94,7 @@
|
|
|
93
94
|
"vite-plugin-vuetify": "^2.1.3",
|
|
94
95
|
"vite-plus": "^0.2.7",
|
|
95
96
|
"vue": "^3.5.40",
|
|
97
|
+
"vue-component-type-helpers": "^3.3.11",
|
|
96
98
|
"vue-router": "^5.3.1",
|
|
97
99
|
"vuetify": "^4.2.0"
|
|
98
100
|
},
|