ads-nuxt 0.6.3 → 0.6.4
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.
|
@@ -147,7 +147,7 @@ const props = withDefaults(
|
|
|
147
147
|
panelWidthClass?: string;
|
|
148
148
|
/**
|
|
149
149
|
* Ação de cadastrar no rodapé da lista, com ícone de adicionar. `{query}` vira a busca atual,
|
|
150
|
-
* ex.: "Cadastrar {query}". Sem valor, com busca vazia ou com
|
|
150
|
+
* ex.: "Cadastrar {query}". Sem valor, com busca vazia ou com resultados na lista filtrada, a ação não aparece.
|
|
151
151
|
*/
|
|
152
152
|
addLabel?: string;
|
|
153
153
|
}>(),
|
|
@@ -125,7 +125,7 @@ const props = withDefaults(
|
|
|
125
125
|
widthClass?: string;
|
|
126
126
|
/**
|
|
127
127
|
* Ação de cadastrar no rodapé, com ícone de adicionar. `{query}` vira a busca atual.
|
|
128
|
-
* Sem valor, com busca vazia ou com
|
|
128
|
+
* Sem valor, com busca vazia ou com resultados na lista filtrada, a ação não aparece.
|
|
129
129
|
*/
|
|
130
130
|
addLabel?: string;
|
|
131
131
|
}>(),
|
|
@@ -148,27 +148,20 @@ const emit = defineEmits<{
|
|
|
148
148
|
add: [query: string];
|
|
149
149
|
}>();
|
|
150
150
|
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
const label = option.label.trim().toLocaleLowerCase("pt-BR");
|
|
155
|
-
const value = String(option.value).trim().toLocaleLowerCase("pt-BR");
|
|
156
|
-
return label === key || value === key;
|
|
157
|
-
});
|
|
158
|
-
};
|
|
151
|
+
const groups = computed(() => groupFilterOptions(props.options, query.value));
|
|
152
|
+
/** Correspondência exata da busca vem primeiro. */
|
|
153
|
+
const rows = computed(() => [...groups.value.exact, ...groups.value.matches]);
|
|
159
154
|
|
|
160
|
-
/**
|
|
155
|
+
/**
|
|
156
|
+
* Ação de cadastrar: `{query}` recebe a busca.
|
|
157
|
+
* Só aparece com busca preenchida e sem resultados na lista filtrada.
|
|
158
|
+
*/
|
|
161
159
|
const addText = computed(() => {
|
|
162
160
|
if (!props.addLabel) return "";
|
|
163
161
|
const typed = query.value.trim();
|
|
164
|
-
if (
|
|
165
|
-
if (typed && queryMatchesOption(typed)) return "";
|
|
162
|
+
if (!typed || !groups.value.empty) return "";
|
|
166
163
|
return props.addLabel.replaceAll("{query}", typed).replace(/\s+/g, " ").trim();
|
|
167
164
|
});
|
|
168
|
-
|
|
169
|
-
const groups = computed(() => groupFilterOptions(props.options, query.value));
|
|
170
|
-
/** Correspondência exata da busca vem primeiro. */
|
|
171
|
-
const rows = computed(() => [...groups.value.exact, ...groups.value.matches]);
|
|
172
165
|
const enabledOptions = computed(() => props.options.filter((option) => !option.disabled));
|
|
173
166
|
|
|
174
167
|
const selectedList = computed(() =>
|