@vasakgroup/vue-libvasak 0.5.0 → 0.6.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.
@@ -34,6 +34,6 @@ export type { ContextoDelMenu, FocoAlAbrir } from "./dropdown/tipos";
34
34
  export { CLAVE_DEL_MENU, usarElMenu } from "./dropdown/tipos";
35
35
  export type { SidebarCategory, SidebarItem } from "./sidebar/tipos";
36
36
  export type { AccionDePestana, ElementoDePestana } from "./tabs/tipos";
37
- export type { ContextoDeLaBarra, OrientacionDeLaBarra, PosicionDeLaBarra, } from "./window/tipos";
38
- export { CLAVE_DE_LA_BARRA, esPosicion, orientacionDe, POSICIONES, usarLaBarra } from "./window/tipos";
37
+ export type { ContextoDeLaBarra, ControlDeVentana, OrientacionDeLaBarra, PosicionDeLaBarra, } from "./window/tipos";
38
+ export { CLAVE_DE_LA_BARRA, esPosicion, LOS_TRES_CONTROLES, orientacionDe, POSICIONES, usarLaBarra, } from "./window/tipos";
39
39
  export { posicionDe, usarLaPosicionDeLaBarra } from "./window/preferencia";
@@ -1,4 +1,4 @@
1
- import { type PosicionDeLaBarra } from './tipos';
1
+ import { type ControlDeVentana, type PosicionDeLaBarra } from './tipos';
2
2
  type __VLS_Props = {
3
3
  /** Sin esto toma la del marco que la envuelve. */
4
4
  position?: PosicionDeLaBarra | null;
@@ -7,10 +7,15 @@ type __VLS_Props = {
7
7
  minimizeLabel?: string;
8
8
  maximizeLabel?: string;
9
9
  closeLabel?: string;
10
- /** Para una ventana sin botones propios: un diálogo, un asistente. */
11
- hideControls?: boolean;
10
+ /**
11
+ * Cuáles de los tres botones de ventana lleva.
12
+ *
13
+ * Vacío en un cuadro de diálogo y en el instalador; sólo `close` en el
14
+ * mini-reproductor. Ver `WindowControls`.
15
+ */
16
+ controls?: ControlDeVentana[];
12
17
  };
13
- declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_7: {};
18
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_7: {}, __VLS_14: {};
14
19
  type __VLS_Slots = {} & {
15
20
  identidad?: (props: typeof __VLS_1) => any;
16
21
  } & {
@@ -19,14 +24,24 @@ type __VLS_Slots = {} & {
19
24
  default?: (props: typeof __VLS_5) => any;
20
25
  } & {
21
26
  acciones?: (props: typeof __VLS_7) => any;
27
+ } & {
28
+ centro?: (props: typeof __VLS_14) => any;
22
29
  };
23
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
30
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
31
+ close: () => any;
32
+ minimize: () => any;
33
+ maximize: () => any;
34
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
35
+ onClose?: (() => any) | undefined;
36
+ onMinimize?: (() => any) | undefined;
37
+ onMaximize?: (() => any) | undefined;
38
+ }>, {
24
39
  title: string;
40
+ controls: ControlDeVentana[];
25
41
  minimizeLabel: string;
26
42
  maximizeLabel: string;
27
43
  closeLabel: string;
28
44
  position: PosicionDeLaBarra | null;
29
- hideControls: boolean;
30
45
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
31
46
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
32
47
  declare const _default: typeof __VLS_export;
@@ -1,9 +1,21 @@
1
+ import { type ControlDeVentana } from './tipos';
1
2
  type __VLS_Props = {
3
+ /** Cuáles de los tres se dibujan, y en este orden. */
4
+ controls?: ControlDeVentana[];
2
5
  minimizeLabel?: string;
3
6
  maximizeLabel?: string;
4
7
  closeLabel?: string;
5
8
  };
6
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ close: () => any;
11
+ minimize: () => any;
12
+ maximize: () => any;
13
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
14
+ onClose?: (() => any) | undefined;
15
+ onMinimize?: (() => any) | undefined;
16
+ onMaximize?: (() => any) | undefined;
17
+ }>, {
18
+ controls: ControlDeVentana[];
7
19
  minimizeLabel: string;
8
20
  maximizeLabel: string;
9
21
  closeLabel: string;
@@ -1,4 +1,4 @@
1
- import { type PosicionDeLaBarra } from './tipos';
1
+ import { type ControlDeVentana, type PosicionDeLaBarra } from './tipos';
2
2
  type __VLS_Props = {
3
3
  /** Fija la barra a un lado, ignorando la preferencia del escritorio. */
4
4
  position?: PosicionDeLaBarra | null;
@@ -6,29 +6,43 @@ type __VLS_Props = {
6
6
  minimizeLabel?: string;
7
7
  maximizeLabel?: string;
8
8
  closeLabel?: string;
9
- hideControls?: boolean;
9
+ /**
10
+ * Cuáles de los tres botones de ventana lleva. Vacío en un cuadro de
11
+ * diálogo y en el instalador; sólo `close` en el mini-reproductor.
12
+ */
13
+ controls?: ControlDeVentana[];
10
14
  /** Para una ventana que dibuja su propia barra o no lleva ninguna. */
11
15
  hideBar?: boolean;
12
16
  };
13
- declare var __VLS_8: {}, __VLS_11: {}, __VLS_14: {}, __VLS_16: {}, __VLS_18: {};
17
+ declare var __VLS_8: {}, __VLS_11: {}, __VLS_14: {}, __VLS_17: {}, __VLS_19: {}, __VLS_21: {};
14
18
  type __VLS_Slots = {} & {
15
19
  identidad?: (props: typeof __VLS_8) => any;
16
20
  } & {
17
21
  titulo?: (props: typeof __VLS_11) => any;
18
22
  } & {
19
- acciones?: (props: typeof __VLS_14) => any;
23
+ centro?: (props: typeof __VLS_14) => any;
20
24
  } & {
21
- barra?: (props: typeof __VLS_16) => any;
25
+ acciones?: (props: typeof __VLS_17) => any;
22
26
  } & {
23
- default?: (props: typeof __VLS_18) => any;
27
+ barra?: (props: typeof __VLS_19) => any;
28
+ } & {
29
+ default?: (props: typeof __VLS_21) => any;
24
30
  };
25
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
31
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
32
+ close: () => any;
33
+ minimize: () => any;
34
+ maximize: () => any;
35
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
36
+ onClose?: (() => any) | undefined;
37
+ onMinimize?: (() => any) | undefined;
38
+ onMaximize?: (() => any) | undefined;
39
+ }>, {
26
40
  title: string;
41
+ controls: ControlDeVentana[];
27
42
  minimizeLabel: string;
28
43
  maximizeLabel: string;
29
44
  closeLabel: string;
30
45
  position: PosicionDeLaBarra | null;
31
- hideControls: boolean;
32
46
  hideBar: boolean;
33
47
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
34
48
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Los manejadores que hay que pasarle al componente de abajo, y sólo ésos.
3
+ *
4
+ * `WindowControls` decide qué hace cada botón mirando si alguien escucha el
5
+ * evento: sin oyente cierra la ventana, con oyente emite y no la toca. Eso sólo
6
+ * funciona si la cadena de arriba —`WindowFrame` → `AppBar` → `WindowControls`—
7
+ * reenvía los eventos que de verdad le llegaron y no los tres siempre.
8
+ *
9
+ * Escribir `@close="emit('close')"` fijo en el marco hace que el botón vea un
10
+ * oyente puesto aunque la aplicación no haya escuchado nada, y entonces ninguna
11
+ * ventana se cierra nunca: el clic emite hacia arriba y se pierde. Pasó, y no da
12
+ * ningún error.
13
+ *
14
+ * Se mira el `vnode` y no `useAttrs()` porque un evento declarado en `emits` no
15
+ * aparece en los atributos: Vue lo saca de ahí justamente por estar declarado.
16
+ *
17
+ * Se llama desde la plantilla (`v-on="reenviarSiEscuchan([...])"`) para que se
18
+ * evalúe en cada dibujado: el `vnode` se reemplaza y un `computed` sin
19
+ * dependencias reactivas se quedaría con los oyentes del primero.
20
+ */
21
+ export declare function reenviarSiEscuchan(eventos: string[]): Record<string, () => void>;
@@ -46,3 +46,7 @@ export declare function esPosicion(valor: unknown): valor is PosicionDeLaBarra;
46
46
  * marco se dibujaba de costado. Lo encontró una prueba de `aria-orientation`.
47
47
  */
48
48
  export declare function usarLaBarra(): ContextoDeLaBarra;
49
+ /** Los tres botones de la ventana, por nombre. */
50
+ export type ControlDeVentana = 'minimize' | 'maximize' | 'close';
51
+ /** Los tres, que es lo que lleva una ventana normal. */
52
+ export declare const LOS_TRES_CONTROLES: ControlDeVentana[];