@alexochihua/exos-library-components 2.25.11 → 2.25.12

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.
@@ -53139,6 +53139,7 @@ const ESelectvue_type_script_setup_true_lang_js_hoisted_11 = {
53139
53139
  const messageRule = (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.ref)(false);
53140
53140
  const isSelectFocused = (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.ref)(false);
53141
53141
  const showPosition = (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.ref)(true);
53142
+ const wasDropdownOpenBeforeEmpty = (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.ref)(false);
53142
53143
  const MAX_LEN = {
53143
53144
  time: 8,
53144
53145
  timens: 5
@@ -53848,12 +53849,38 @@ const ESelectvue_type_script_setup_true_lang_js_hoisted_11 = {
53848
53849
  });
53849
53850
  });
53850
53851
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.watch)(() => props.options, newVal => {
53851
- if (newVal && newVal.length > 0) {
53852
- if (props.suggestion && tempValueInput.value && props.keepFilterText) {
53853
- // Si hay texto de filtro y keepFilterText está activo, aplicamos el filtro
53854
- filterOptionsSuggest(tempValueInput.value);
53855
- } else {
53856
- setOptions();
53852
+ // Si no hay opciones, limpiar y cerrar (solo en modo suggestion)
53853
+ if (!newVal || newVal.length === 0) {
53854
+ if (props.suggestion) {
53855
+ // Guardar el estado del dropdown antes de cerrarlo
53856
+ wasDropdownOpenBeforeEmpty.value = isSelectOpened.value;
53857
+ auxSuggestions.value = [];
53858
+ isSelectOpened.value = false;
53859
+ }
53860
+ return;
53861
+ }
53862
+
53863
+ // Si hay opciones, procesar según el modo
53864
+ const hasTextInInput = props.suggestion && tempValueInput.value && typeof tempValueInput.value === 'string' && tempValueInput.value.trim() !== '';
53865
+ if (hasTextInInput) {
53866
+ // En modo suggestion con texto, aplicar filtro
53867
+ filterOptionsSuggest(tempValueInput.value);
53868
+
53869
+ // Abrir dropdown automáticamente
53870
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.nextTick)(() => {
53871
+ isSelectOpened.value = true;
53872
+ });
53873
+ } else {
53874
+ // Sin texto o modo normal, usar opciones normales
53875
+ setOptions();
53876
+
53877
+ // En modo suggestion, si el dropdown estaba abierto antes de vaciar las opciones,
53878
+ // restaurarlo cuando se vuelven a llenar
53879
+ if (props.suggestion && wasDropdownOpenBeforeEmpty.value) {
53880
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.nextTick)(() => {
53881
+ isSelectOpened.value = true;
53882
+ wasDropdownOpenBeforeEmpty.value = false; // Resetear el flag
53883
+ });
53857
53884
  }
53858
53885
  }
53859
53886
  });
@@ -53157,6 +53157,7 @@ const ESelectvue_type_script_setup_true_lang_js_hoisted_11 = {
53157
53157
  const messageRule = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(false);
53158
53158
  const isSelectFocused = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(false);
53159
53159
  const showPosition = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(true);
53160
+ const wasDropdownOpenBeforeEmpty = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(false);
53160
53161
  const MAX_LEN = {
53161
53162
  time: 8,
53162
53163
  timens: 5
@@ -53866,12 +53867,38 @@ const ESelectvue_type_script_setup_true_lang_js_hoisted_11 = {
53866
53867
  });
53867
53868
  });
53868
53869
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.options, newVal => {
53869
- if (newVal && newVal.length > 0) {
53870
- if (props.suggestion && tempValueInput.value && props.keepFilterText) {
53871
- // Si hay texto de filtro y keepFilterText está activo, aplicamos el filtro
53872
- filterOptionsSuggest(tempValueInput.value);
53873
- } else {
53874
- setOptions();
53870
+ // Si no hay opciones, limpiar y cerrar (solo en modo suggestion)
53871
+ if (!newVal || newVal.length === 0) {
53872
+ if (props.suggestion) {
53873
+ // Guardar el estado del dropdown antes de cerrarlo
53874
+ wasDropdownOpenBeforeEmpty.value = isSelectOpened.value;
53875
+ auxSuggestions.value = [];
53876
+ isSelectOpened.value = false;
53877
+ }
53878
+ return;
53879
+ }
53880
+
53881
+ // Si hay opciones, procesar según el modo
53882
+ const hasTextInInput = props.suggestion && tempValueInput.value && typeof tempValueInput.value === 'string' && tempValueInput.value.trim() !== '';
53883
+ if (hasTextInInput) {
53884
+ // En modo suggestion con texto, aplicar filtro
53885
+ filterOptionsSuggest(tempValueInput.value);
53886
+
53887
+ // Abrir dropdown automáticamente
53888
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
53889
+ isSelectOpened.value = true;
53890
+ });
53891
+ } else {
53892
+ // Sin texto o modo normal, usar opciones normales
53893
+ setOptions();
53894
+
53895
+ // En modo suggestion, si el dropdown estaba abierto antes de vaciar las opciones,
53896
+ // restaurarlo cuando se vuelven a llenar
53897
+ if (props.suggestion && wasDropdownOpenBeforeEmpty.value) {
53898
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
53899
+ isSelectOpened.value = true;
53900
+ wasDropdownOpenBeforeEmpty.value = false; // Resetear el flag
53901
+ });
53875
53902
  }
53876
53903
  }
53877
53904
  });