valtech-components 2.0.773 → 2.0.774
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.
- package/esm2022/lib/components/atoms/pattern/motifs.mjs +41 -26
- package/esm2022/lib/components/atoms/pattern/pattern.component.mjs +48 -15
- package/esm2022/lib/components/atoms/pattern/types.mjs +1 -1
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +88 -40
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/atoms/pattern/motifs.d.ts +6 -0
- package/lib/components/atoms/pattern/pattern.component.d.ts +13 -1
- package/lib/components/atoms/pattern/types.d.ts +17 -3
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -45,6 +45,12 @@ export interface PatternTile {
|
|
|
45
45
|
bg: string;
|
|
46
46
|
fg: string;
|
|
47
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Genera UN tile con motif/bg/fg respetando densidades + contraste.
|
|
50
|
+
* Caller pasa rng (Math.random o seeded) — útil para reshuffle individual de
|
|
51
|
+
* tiles en `val-pattern` sin regenerar la grid completa.
|
|
52
|
+
*/
|
|
53
|
+
export declare function generateRandomTile(palette: string[], chevronDensity?: number, rng?: () => number): PatternTile;
|
|
48
54
|
/** Genera matriz de tiles aplicando densidades + reglas de contraste. */
|
|
49
55
|
export declare function generatePatternTiles(cfg: PatternGenConfig): PatternTile[];
|
|
50
56
|
/**
|
|
@@ -39,15 +39,27 @@ export declare class PatternComponent implements OnDestroy {
|
|
|
39
39
|
private readonly chevronDensity;
|
|
40
40
|
private readonly preserveAspect;
|
|
41
41
|
private readonly animated;
|
|
42
|
+
/** ms entre updates individuales de tiles (modo animated). Default 1200ms. */
|
|
42
43
|
private readonly reshuffleInterval;
|
|
44
|
+
/** Cuántos tiles cambiar por tick (default 1 → cambio sutil). */
|
|
45
|
+
private readonly tilesPerTick;
|
|
43
46
|
private timer?;
|
|
44
47
|
/** Object-first input. Cambios disparan re-render por signals. */
|
|
45
48
|
set props(value: PatternMetadata | undefined);
|
|
46
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* Tiles signal — mutable. Se regenera completa cuando cambia seed/cols/rows/
|
|
51
|
+
* palette/density. En modo animated, tiles individuales se sobrescriben sin
|
|
52
|
+
* tocar el resto (efecto staggered).
|
|
53
|
+
*/
|
|
47
54
|
private readonly tiles;
|
|
48
55
|
/** SVG completo como string sanitized para `[innerHTML]`. */
|
|
49
56
|
readonly svgHtml: import("@angular/core").Signal<SafeHtml>;
|
|
50
57
|
constructor();
|
|
58
|
+
/**
|
|
59
|
+
* Reemplaza `count` tiles random del grid actual con tiles nuevos generados.
|
|
60
|
+
* Usado por el modo animated para staggered reshuffle.
|
|
61
|
+
*/
|
|
62
|
+
private mutateRandomTiles;
|
|
51
63
|
ngOnDestroy(): void;
|
|
52
64
|
private resolvePalette;
|
|
53
65
|
private randomSeed;
|
|
@@ -7,10 +7,15 @@ import { PatternPaletteKey } from './motifs';
|
|
|
7
7
|
* <val-pattern [props]="{ palette: 'purple', cols: 12, rows: 4, seed: 42 }" />
|
|
8
8
|
* ```
|
|
9
9
|
*
|
|
10
|
-
* @example Animated (
|
|
10
|
+
* @example Animated staggered (1 tile cada 1.2s, sutil):
|
|
11
11
|
* ```html
|
|
12
12
|
* <val-pattern [props]="{ palette: 'ink', cols: 16, rows: 8, animated: true }" />
|
|
13
13
|
* ```
|
|
14
|
+
*
|
|
15
|
+
* @example Animated más activo (2 tiles cada 800ms):
|
|
16
|
+
* ```html
|
|
17
|
+
* <val-pattern [props]="{ animated: true, reshuffleInterval: 800, tilesPerTick: 2 }" />
|
|
18
|
+
* ```
|
|
14
19
|
*/
|
|
15
20
|
export interface PatternMetadata {
|
|
16
21
|
/**
|
|
@@ -33,12 +38,21 @@ export interface PatternMetadata {
|
|
|
33
38
|
*/
|
|
34
39
|
chevronDensity?: number;
|
|
35
40
|
/**
|
|
36
|
-
* Si `true`, el patrón
|
|
41
|
+
* Si `true`, el patrón hace **staggered reshuffle**: cada `reshuffleInterval`
|
|
42
|
+
* ms se reemplazan `tilesPerTick` tiles random — NO la grid entera.
|
|
37
43
|
* Default: `false`.
|
|
38
44
|
*/
|
|
39
45
|
animated?: boolean;
|
|
40
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* ms entre updates individuales de tiles (modo animated).
|
|
48
|
+
* Default: `1200` (~1 tile cada 1.2s con `tilesPerTick: 1`).
|
|
49
|
+
*/
|
|
41
50
|
reshuffleInterval?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Cuántos tiles cambiar por tick (modo animated). Default: `1` (cambio sutil).
|
|
53
|
+
* Subir a 2-4 para efecto más vivo.
|
|
54
|
+
*/
|
|
55
|
+
tilesPerTick?: number;
|
|
42
56
|
/**
|
|
43
57
|
* `slice` (default) — el patrón cubre todo el contenedor manteniendo aspect,
|
|
44
58
|
* cropeando si necesario. `meet` — fit completo sin crop, deja espacio.
|
package/lib/version.d.ts
CHANGED