@nexdom/uimed-vue 2.0.0-beta.49 → 2.0.0-beta.50

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.
@@ -50,7 +50,8 @@ interface AppBarNotification {
50
50
  }
51
51
  interface AppBarUserProps {
52
52
  /**
53
- * Major identifier, like the user full name.
53
+ * Major identifier, like the user full name. Without an `img`, the
54
+ * avatar shows its initials (e.g. `"RP"` for `"Rafael Perini"`).
54
55
  */
55
56
  title?: string;
56
57
  /**
@@ -58,7 +59,8 @@ interface AppBarUserProps {
58
59
  */
59
60
  subtitle?: string;
60
61
  /**
61
- * URL leading to a user picture.
62
+ * URL leading to a user picture. When omitted, the avatar shows the initials
63
+ * of the `title`, or a generic icon when there's no title either.
62
64
  */
63
65
  img?: string;
64
66
  /**
@@ -587,8 +589,8 @@ declare const __VLS_export$16: import("vue", { with: { "resolution-mode": "impor
587
589
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
588
590
  }>, {
589
591
  variant: TextFieldVariant;
590
- type: TextFieldType;
591
592
  clearable: boolean;
593
+ type: TextFieldType;
592
594
  }, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>;
593
595
  //#endregion
594
596
  //#region src/components/inputs/checkbox/types.d.ts
@@ -3,7 +3,7 @@ import { useLocale, useMask } from "vuetify";
3
3
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, inject, isRef, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, onMounted, onScopeDispose, onUnmounted, openBlock, provide, readonly, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toValue, unref, useId, useModel, useSlots, useTemplateRef, watch, withCtx, withKeys, withModifiers } from "vue";
4
4
  import { pt } from "vuetify/locale";
5
5
  import { VApp, VAppBar, VAppBarNavIcon, VAppBarTitle, VAutocomplete, VAvatar, VBadge, VBtn, VCard, VCardActions, VCardText, VCheckboxBtn, VCol, VCombobox, VContainer, VDataIterator, VDatePicker, VDialog, VDivider, VEmptyState, VExpansionPanel, VExpansionPanelText, VExpansionPanelTitle, VExpansionPanels, VFooter, VForm, VIcon, VIconBtn, VImg, VList, VListGroup, VListItem, VListItemAction, VListSubheader, VLocaleProvider, VMain, VMenu, VNavigationDrawer, VPagination, VProgressCircular, VProgressLinear, VRow, VSkeletonLoader, VSnackbarQueue, VTable, VTextField, VTimePicker } from "vuetify/components";
6
- import { formatDateTime, isEmail, isEmpty, isPhone, isUrl } from "@nexdom/shared/utils";
6
+ import { formatDateTime, isEmail, isEmpty, isPhone, isUrl, toInitials } from "@nexdom/shared/utils";
7
7
  import { VHighlight } from "vuetify/labs/VHighlight";
8
8
  import { RouterLink } from "vue-router";
9
9
  //#region src/composables/navigation/use-route-props.ts
@@ -265,7 +265,12 @@ var app_bar_default = /* @__PURE__ */ defineComponent({
265
265
  if (loading) notificationsOpen.value = false;
266
266
  });
267
267
  const showUser = computed(() => !!props.user);
268
- const userAvatarProps = computed(() => props.user.img ? { image: props.user.img } : { icon: "mdi-account-outline" });
268
+ const userInitials = computed(() => toInitials(props.user.title ?? ""));
269
+ const userAvatarProps = computed(() => {
270
+ if (props.user.img) return { image: props.user.img };
271
+ if (userInitials.value) return { text: userInitials.value };
272
+ return { icon: "mdi-account-outline" };
273
+ });
269
274
  function isParentOption(option) {
270
275
  return "items" in option;
271
276
  }
@@ -356,7 +361,10 @@ var app_bar_default = /* @__PURE__ */ defineComponent({
356
361
  "aria-label": "Menu do usuário",
357
362
  icon: ""
358
363
  }), {
359
- default: withCtx(() => [createVNode(unref(VAvatar), mergeProps(userAvatarProps.value, { color: "primary" }), null, 16)]),
364
+ default: withCtx(() => [createCommentVNode(" Decorative: the button already has an accessible name "), createVNode(unref(VAvatar), mergeProps(userAvatarProps.value, {
365
+ color: "primary",
366
+ "aria-hidden": "true"
367
+ }), null, 16)]),
360
368
  _: 1
361
369
  }, 16, ["data-testid"])]),
362
370
  default: withCtx(() => [createVNode(unref(VCard), {
@@ -364,7 +372,10 @@ var app_bar_default = /* @__PURE__ */ defineComponent({
364
372
  subtitle: __props.user?.subtitle,
365
373
  "data-testid": userMenuDataTestid.value
366
374
  }, {
367
- prepend: withCtx(() => [createVNode(unref(VAvatar), mergeProps(userAvatarProps.value, { color: "primary" }), null, 16)]),
375
+ prepend: withCtx(() => [createCommentVNode(" Decorative: the user's name, when given, is already the card's title "), createVNode(unref(VAvatar), mergeProps(userAvatarProps.value, {
376
+ color: "primary",
377
+ "aria-hidden": "true"
378
+ }), null, 16)]),
368
379
  default: withCtx(() => [createVNode(unref(VDivider)), createVNode(unref(VList), {
369
380
  nav: "",
370
381
  role: "group"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexdom/uimed-vue",
3
- "version": "2.0.0-beta.49",
3
+ "version": "2.0.0-beta.50",
4
4
  "description": "A ui framework for NEXDOM applications.",
5
5
  "keywords": [
6
6
  "lib",