@nexdom/uimed-vue 2.2.1 → 2.3.1

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.
@@ -23,8 +23,8 @@ declare const __VLS_export: import("vue", { with: { "resolution-mode": "import"
23
23
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
24
24
  }>, {
25
25
  variant: TextFieldVariant;
26
- clearable: boolean;
27
26
  type: TextFieldType;
27
+ clearable: boolean;
28
28
  }, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>;
29
29
  //#endregion
30
30
  export { _default as default };
@@ -4,10 +4,10 @@ import { useNavigationSearchShortcut } from "../../composables/navigation/use-na
4
4
  import skeleton_loader_default from "../skeleton-loader/skeleton-loader.js";
5
5
  import text_field_default from "../inputs/text-field/text-field.js";
6
6
  import { isParentItem, useNavigationRail } from "../../composables/navigation/use-navigation-rail.js";
7
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, isRef, mergeModels, mergeProps, openBlock, ref, renderList, unref, useModel, useTemplateRef, vShow, withCtx, withDirectives, withKeys } from "vue";
8
- import { VDivider, VList, VListGroup, VListItem, VNavigationDrawer } from "vuetify/components";
7
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, isRef, mergeModels, mergeProps, openBlock, ref, renderList, unref, useModel, useTemplateRef, vShow, watch, withCtx, withDirectives, withKeys } from "vue";
8
+ import { VDefaultsProvider, VDivider, VList, VListGroup, VListItem, VNavigationDrawer } from "vuetify/components";
9
9
  //#region src/components/navigation-menu/navigation-menu.vue?vue&type=script&setup=true&lang.ts
10
- const _hoisted_1 = { class: "px-4 pt-2" };
10
+ const _hoisted_1 = { class: "px-4 pb-4" };
11
11
  var navigation_menu_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
12
12
  inheritAttrs: false,
13
13
  __name: "navigation-menu",
@@ -36,6 +36,7 @@ var navigation_menu_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
36
36
  const props = __props;
37
37
  const open = useModel(__props, "modelValue");
38
38
  const search = ref("");
39
+ const searchFieldDefaults = { VTextField: { hideDetails: "auto" } };
39
40
  const field = useTemplateRef("searchField");
40
41
  const { mobile, collapsed, drawerOpen, menuOpen, opened, isActiveGroup, dismiss, isRestoringFocus, onFocusin, onFocusout, onMouseenter, onMouseleave } = useNavigationRail({
41
42
  open,
@@ -54,6 +55,12 @@ var navigation_menu_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
54
55
  }
55
56
  const searchDataTestid = computed(() => `${props.dataTestid}-search`);
56
57
  const query = computed(() => search.value.toLowerCase());
58
+ /** Groups open before the search started, which open again when it's cleared */
59
+ let groupsBeforeSearch = opened.value;
60
+ watch(query, (text, previous) => {
61
+ if (!previous) groupsBeforeSearch = opened.value;
62
+ opened.value = text ? filteredItems.value.filter(isParentItem).map(({ description }) => description) : groupsBeforeSearch;
63
+ });
57
64
  function filterItems() {
58
65
  return (props.items ?? []).reduce((filtered, item) => {
59
66
  if (matches(item)) filtered.push(item);
@@ -90,20 +97,23 @@ var navigation_menu_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
90
97
  onKeydown: withKeys(unref(dismiss), ["esc"])
91
98
  }, {
92
99
  prepend: withCtx(() => [
93
- withDirectives(createElementVNode("div", _hoisted_1, [createVNode(text_field_default, {
94
- ref: "searchField",
95
- modelValue: search.value,
96
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => search.value = $event),
97
- type: "search",
98
- placeholder: `Buscar (${unref(shortcutLabel)})`,
99
- "data-testid": searchDataTestid.value,
100
- disabled: props.loading
101
- }, null, 8, [
102
- "modelValue",
103
- "placeholder",
104
- "data-testid",
105
- "disabled"
106
- ])], 512), [[vShow, !unref(collapsed)]]),
100
+ withDirectives(createElementVNode("div", _hoisted_1, [createCommentVNode(" Hides the empty messages area, which made the expanded rail's search taller than the\n collapsed one's search item and pushed the items down when the rail expanded "), createVNode(unref(VDefaultsProvider), { defaults: searchFieldDefaults }, {
101
+ default: withCtx(() => [createVNode(text_field_default, {
102
+ ref: "searchField",
103
+ modelValue: search.value,
104
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => search.value = $event),
105
+ type: "search",
106
+ placeholder: `Buscar (${unref(shortcutLabel)})`,
107
+ "data-testid": searchDataTestid.value,
108
+ disabled: props.loading
109
+ }, null, 8, [
110
+ "modelValue",
111
+ "placeholder",
112
+ "data-testid",
113
+ "disabled"
114
+ ])]),
115
+ _: 1
116
+ })], 512), [[vShow, !unref(collapsed)]]),
107
117
  createCommentVNode(" Vuetify's list is focusable and passes the focus on to its first item: out of the tab\n order, the item gets the focus straight from the page, which then gets it back on `Esc` "),
108
118
  withDirectives(createVNode(unref(VList), {
109
119
  nav: "",
@@ -75,7 +75,7 @@
75
75
  "padding-y": (
76
76
  responsive: false,
77
77
  ),
78
- "padding-top": (
78
+ "padding-bottom": (
79
79
  responsive: false,
80
80
  ),
81
81
  "text-align": (
@@ -115,8 +115,8 @@
115
115
  "negative-margin-left": false,
116
116
  "negative-margin-start": false,
117
117
  "negative-margin-end": false,
118
+ "padding-top": false,
118
119
  "padding-right": false,
119
- "padding-bottom": false,
120
120
  "padding-left": false,
121
121
  "padding-start": false,
122
122
  "padding-end": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexdom/uimed-vue",
3
- "version": "2.2.1",
3
+ "version": "2.3.1",
4
4
  "description": "A ui framework for NEXDOM applications.",
5
5
  "keywords": [
6
6
  "lib",
@@ -220,7 +220,7 @@ Em telas pequenas, o menu fica oculto e é aberto sobre o conteúdo pelo botão
220
220
 
221
221
  Os itens e grupos do primeiro nível do menu exibem um ícone antes da sua descrição, informado pelo nome na propriedade obrigatória `icon`. Os nomes disponíveis estão em [Ícones](../icons.md). Os itens dentro de um grupo não aceitam ícones, para que o menu siga o mesmo padrão visual em todas as aplicações.
222
222
 
223
- O menu também conta com um campo de busca que filtra itens e grupos em tempo real, no formato _case-insensitive_.
223
+ O menu também conta com um campo de busca que filtra itens e grupos em tempo real, no formato _case-insensitive_. Enquanto há texto na busca, os grupos com resultados ficam abertos, mostrando os itens encontrados. Um grupo ainda pode ser fechado pelo seu cabeçalho, até o texto mudar de novo. Ao limpar a busca, ficam abertos os grupos que estavam abertos antes dela.
224
224
 
225
225
  O atalho `Ctrl + K` (`⌘ + K` no macOS), indicado no próprio campo de busca, expande o menu (ou o abre, em telas pequenas) e coloca o foco na busca, com o texto já digitado selecionado. Com o menu expandido ou aberto, o atalho apenas leva o foco de volta à busca. Levar o foco ao item "Buscar" do menu recolhido tem o mesmo efeito. Ele funciona mesmo com o foco em um campo de formulário, mas é ignorado com o foco dentro de diálogos, confirmações, menus suspensos e editores de texto rico, ou no botão de um menu suspenso aberto.
226
226