@nexdom/uimed-vue 2.2.0 → 2.3.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.
@@ -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
- type: TextFieldType;
27
26
  clearable: boolean;
27
+ type: TextFieldType;
28
28
  }, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>;
29
29
  //#endregion
30
30
  export { _default as default };
@@ -4,7 +4,7 @@ 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";
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
8
  import { 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
10
  const _hoisted_1 = { class: "px-4 pt-2" };
@@ -54,6 +54,12 @@ var navigation_menu_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
54
54
  }
55
55
  const searchDataTestid = computed(() => `${props.dataTestid}-search`);
56
56
  const query = computed(() => search.value.toLowerCase());
57
+ /** Groups open before the search started, which open again when it's cleared */
58
+ let groupsBeforeSearch = opened.value;
59
+ watch(query, (text, previous) => {
60
+ if (!previous) groupsBeforeSearch = opened.value;
61
+ opened.value = text ? filteredItems.value.filter(isParentItem).map(({ description }) => description) : groupsBeforeSearch;
62
+ });
57
63
  function filterItems() {
58
64
  return (props.items ?? []).reduce((filtered, item) => {
59
65
  if (matches(item)) filtered.push(item);
@@ -158,7 +164,7 @@ var navigation_menu_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
158
164
  role: void 0,
159
165
  tag: "button",
160
166
  type: "button",
161
- class: "w-100 text-start"
167
+ class: "w-100 text-start v-treeview-item--activatable-group-activator"
162
168
  }), null, 16, [
163
169
  "title",
164
170
  "prepend-icon",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexdom/uimed-vue",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
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