@innertia-solutions/innertia-nuxt 0.1.74 → 0.1.76

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.
@@ -79,6 +79,26 @@ onMounted(() => {
79
79
  initHsSelect()
80
80
  })
81
81
 
82
+ /**
83
+ * Si las options llegan o cambian después del mount (query async), HSSelect ya
84
+ * construyó su dropdown con las viejas (vacío) y no se entera. Se destruye y se
85
+ * vuelve a inicializar con las nuevas, conservando el valor seleccionado.
86
+ */
87
+ watch(
88
+ () => (props.options ?? []).map((o: any) => `${o.value}::${o.label}::${o.disabled ? 1 : 0}`).join('|'),
89
+ async () => {
90
+ const el = selectRef.value
91
+ const HSSelect = (window as any).HSSelect
92
+ if (!el || !HSSelect) return
93
+ try {
94
+ HSSelect.getInstance?.(el)?.destroy?.()
95
+ } catch (e) {
96
+ console.warn('[FormsSelect] HSSelect destroy falló:', e)
97
+ }
98
+ await initHsSelect()
99
+ },
100
+ )
101
+
82
102
  const handleChange = (e: Event) => {
83
103
  const val = (e.target as HTMLSelectElement).value
84
104
  emit('update:modelValue', val || null)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@innertia-solutions/innertia-nuxt",
3
- "version": "0.1.74",
3
+ "version": "0.1.76",
4
4
  "description": "Innertia Solutions — Nuxt layer unificada: core, auth, multitenancy, theme y app contexts",
5
5
  "keywords": [
6
6
  "nuxt",
@@ -29,8 +29,10 @@ export const useOrganizationStore = defineStore('organization', {
29
29
  {
30
30
  key: 'innertia_org_by_ctx',
31
31
  pick: ['currentByContext'],
32
- storage: piniaPluginPersistedstate.cookies,
33
- cookieOptions: { maxAge: 60 * 60 * 24 * 30, sameSite: 'lax' },
32
+ // pinia-plugin-persistedstate v4: `cookies(...)` es una fábrica que recibe las
33
+ // opciones. Pasarla sin llamar (API v3 + `cookieOptions`) deja un storage inválido
34
+ // y la sede elegida nunca se guarda: cada recarga vuelve al selector de sede.
35
+ storage: piniaPluginPersistedstate.cookies({ maxAge: 60 * 60 * 24 * 30, sameSite: 'lax' }),
34
36
  },
35
37
  ],
36
38