@catarina-ds/angular 0.1.0 → 0.1.2

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/index.d.ts CHANGED
@@ -1,29 +1,13 @@
1
1
  import * as i0 from '@angular/core';
2
- import { OnDestroy, EventEmitter, ElementRef, QueryList, OnInit, TemplateRef, AfterViewInit, Renderer2, InjectionToken } from '@angular/core';
3
- import { SafeHtml } from '@angular/platform-browser';
2
+ import { TemplateRef, Type, EventEmitter, ElementRef, QueryList, OnInit, OnDestroy, AfterContentInit, AfterViewChecked, AfterViewInit, Renderer2 } from '@angular/core';
4
3
  import * as rxjs from 'rxjs';
5
- import { Subscription } from 'rxjs';
4
+ import { Subscription, Subject } from 'rxjs';
6
5
  import { NgControl, ControlValueAccessor } from '@angular/forms';
7
6
 
8
- declare class Icon implements OnDestroy {
9
- private sanitizer;
10
- private platformId;
11
- private iconProvider;
12
- private abortController?;
13
- svgContent: i0.WritableSignal<SafeHtml>;
14
- isLoading: i0.WritableSignal<boolean>;
15
- isVisible: i0.WritableSignal<boolean>;
16
- size: string;
17
- color: string;
18
- ngOnDestroy(): void;
19
- set name(iconName: string);
20
- set src(path: string);
21
- private loadSvg;
22
- private isValidSvg;
23
- private processSvg;
24
- private processSvgWithRegex;
7
+ type IconContent = TemplateRef<unknown> | Type<unknown>;
8
+ declare class Icon {
25
9
  static ɵfac: i0.ɵɵFactoryDeclaration<Icon, never>;
26
- static ɵcmp: i0.ɵɵComponentDeclaration<Icon, "cat-icon", never, { "size": { "alias": "size"; "required": false; }; "color": { "alias": "color"; "required": false; }; "name": { "alias": "name"; "required": false; }; "src": { "alias": "src"; "required": false; }; }, {}, never, never, true, never>;
10
+ static ɵcmp: i0.ɵɵComponentDeclaration<Icon, "cat-icon", never, {}, {}, never, ["*"], true, never>;
27
11
  }
28
12
 
29
13
  declare class Button {
@@ -31,13 +15,14 @@ declare class Button {
31
15
  size: 'sm' | 'md' | 'lg';
32
16
  disabled: boolean;
33
17
  type: 'button' | 'submit' | 'reset';
34
- iconLeft?: string;
35
- iconCenter?: string;
36
- iconRight?: string;
18
+ iconLeft?: IconContent;
19
+ iconCenter?: IconContent;
20
+ iconRight?: IconContent;
37
21
  customClass: string;
38
22
  clicked: EventEmitter<MouseEvent>;
39
23
  get buttonClasses(): string;
40
24
  get iconSize(): string;
25
+ isTemplateRef(content: IconContent): content is TemplateRef<unknown>;
41
26
  get dataCustomClass(): string;
42
27
  handleClick(event: MouseEvent): void;
43
28
  static ɵfac: i0.ɵɵFactoryDeclaration<Button, never>;
@@ -65,9 +50,9 @@ declare class Accordion {
65
50
  customClass: string;
66
51
  buttonVariant: 'primary' | 'secondary' | 'contrast' | 'outline' | 'ghost';
67
52
  buttonSize: 'sm' | 'md' | 'lg';
68
- iconLeft: boolean;
69
- iconCenter: boolean;
70
- iconRight: boolean;
53
+ iconLeft: IconContent | boolean;
54
+ iconCenter: IconContent | boolean;
55
+ iconRight: IconContent | boolean;
71
56
  scrolleable: boolean;
72
57
  variant: 'surface' | 'outlined' | 'elevated';
73
58
  updateAccordionGroupStatusOutput: EventEmitter<string>;
@@ -111,10 +96,11 @@ declare class CatInput implements OnInit {
111
96
 
112
97
  declare class ColorInput implements ControlValueAccessor {
113
98
  value: string;
114
- icon?: boolean;
99
+ icon: IconContent | boolean;
115
100
  size: string;
116
101
  private onChange;
117
102
  onTouched: () => void;
103
+ isTemplateRef(content: IconContent): content is TemplateRef<unknown>;
118
104
  onInput(event: Event): void;
119
105
  writeValue(value: any): void;
120
106
  registerOnChange(fn: any): void;
@@ -157,7 +143,8 @@ declare class Dialog implements OnInit, OnDestroy {
157
143
  private viewContainerRef;
158
144
  private overlayRef?;
159
145
  variant: 'surface' | 'outlined' | 'elevated';
160
- size: 'sm' | 'md' | 'lg';
146
+ width: string;
147
+ height: string;
161
148
  customClass: string;
162
149
  closs: EventEmitter<boolean>;
163
150
  dialogTemplate: TemplateRef<any>;
@@ -168,7 +155,7 @@ declare class Dialog implements OnInit, OnDestroy {
168
155
  ngOnInit(): void;
169
156
  ngOnDestroy(): void;
170
157
  static ɵfac: i0.ɵɵFactoryDeclaration<Dialog, never>;
171
- static ɵcmp: i0.ɵɵComponentDeclaration<Dialog, "cat-dialog", never, { "variant": { "alias": "variant"; "required": false; }; "size": { "alias": "size"; "required": false; }; "customClass": { "alias": "customClass"; "required": false; }; }, { "closs": "closs"; }, never, ["*"], true, never>;
158
+ static ɵcmp: i0.ɵɵComponentDeclaration<Dialog, "cat-dialog", never, { "variant": { "alias": "variant"; "required": false; }; "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "customClass": { "alias": "customClass"; "required": false; }; }, { "closs": "closs"; }, never, ["*"], true, never>;
172
159
  }
173
160
 
174
161
  declare class Drawer implements OnInit, OnDestroy {
@@ -190,26 +177,46 @@ declare class Drawer implements OnInit, OnDestroy {
190
177
  static ɵcmp: i0.ɵɵComponentDeclaration<Drawer, "cat-drawer", never, { "side": { "alias": "side"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "customClass": { "alias": "customClass"; "required": false; }; }, { "closs": "closs"; }, never, ["*"], true, never>;
191
178
  }
192
179
 
193
- declare class Menu implements AfterViewInit, OnDestroy {
194
- menuContainer: ElementRef<HTMLDivElement>;
195
- menuContent: ElementRef<HTMLDivElement>;
196
- dropdown?: ElementRef<HTMLDivElement>;
197
- private platformId;
198
- private resizeObserver?;
199
- private mutationObserver?;
200
- showMoreButton: i0.WritableSignal<boolean>;
201
- isDropdownOpen: i0.WritableSignal<boolean>;
202
- overflowItems: i0.WritableSignal<HTMLElement[]>;
203
- ngAfterViewInit(): void;
204
- ngOnDestroy(): void;
205
- private setupObservers;
206
- private handleOutsideClick;
207
- private checkOverflow;
208
- private updateDropdownContent;
209
- private restoreOverflowItems;
210
- toggleDropdown(): void;
180
+ interface MenuDropdownItem {
181
+ label: any;
182
+ element: HTMLElement;
183
+ }
184
+ declare class MenuDropdown {
185
+ items: MenuDropdownItem[];
186
+ panelContainer: ElementRef<HTMLElement>;
187
+ activeIndex: number;
188
+ get isSingle(): boolean;
189
+ isTemplateRef(value: any): value is TemplateRef<unknown>;
190
+ setActive(index: number): void;
191
+ showActivePanel(): void;
192
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuDropdown, never>;
193
+ static ɵcmp: i0.ɵɵComponentDeclaration<MenuDropdown, "cat-menu-dropdown", never, { "items": { "alias": "items"; "required": false; }; }, {}, never, never, true, never>;
194
+ }
195
+
196
+ declare class MenuPanel {
197
+ elementRef: ElementRef<HTMLElement>;
198
+ label: any;
199
+ constructor(elementRef: ElementRef<HTMLElement>);
200
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuPanel, never>;
201
+ static ɵcmp: i0.ɵɵComponentDeclaration<MenuPanel, "cat-menu-panel", never, { "label": { "alias": "label"; "required": false; }; }, {}, never, ["*"], true, never>;
202
+ }
203
+
204
+ declare class Menu implements AfterContentInit, AfterViewChecked {
205
+ panels: QueryList<MenuPanel>;
206
+ panelsHost: ElementRef<HTMLElement>;
207
+ dropdownRef?: MenuDropdown;
208
+ private cdr;
209
+ isDropdownActive: boolean;
210
+ isPanelOpen: boolean;
211
+ private pendingPanelMove;
212
+ ngAfterContentInit(): void;
213
+ ngAfterViewChecked(): void;
214
+ toggleContent(): void;
215
+ togglePanel(): void;
216
+ private executePanelMove;
217
+ private restorePanels;
211
218
  static ɵfac: i0.ɵɵFactoryDeclaration<Menu, never>;
212
- static ɵcmp: i0.ɵɵComponentDeclaration<Menu, "cat-menu", never, {}, {}, never, ["*"], true, never>;
219
+ static ɵcmp: i0.ɵɵComponentDeclaration<Menu, "cat-menu", never, {}, {}, ["panels"], [":not(cat-menu-panel)", "cat-menu-panel"], true, never>;
213
220
  }
214
221
 
215
222
  declare class Drag implements AfterViewInit {
@@ -244,15 +251,40 @@ declare class Theming {
244
251
  static ɵprov: i0.ɵɵInjectableDeclaration<Theming>;
245
252
  }
246
253
 
247
- interface IconProvider {
248
- getPath(name: string): string;
254
+ declare class DynamicBackgroundService {
255
+ readonly setImages$: Subject<string[]>;
256
+ readonly setBackgroundImage$: Subject<number>;
257
+ static ɵfac: i0.ɵɵFactoryDeclaration<DynamicBackgroundService, never>;
258
+ static ɵprov: i0.ɵɵInjectableDeclaration<DynamicBackgroundService>;
249
259
  }
250
- declare const ICON_PROVIDER: InjectionToken<IconProvider>;
251
260
 
252
- declare const ICON_BASE_PATH = "safirial-icons";
253
- declare const iconList: readonly ["academic-cap", "adjustments-horizontal", "adjustments-vertical", "archive-box", "archive-box-arrow-down", "archive-box-x-mark", "arrow-down", "arrow-down-circle", "arrow-down-left", "arrow-down-on-square", "arrow-down-on-square-stack", "arrow-down-right", "arrow-down-tray", "arrow-left", "arrow-left-circle", "arrow-left-end-on-rectangle", "arrow-left-start-on-rectangle", "arrow-long-down", "arrow-long-left", "arrow-long-right", "arrow-long-up", "arrow-path", "arrow-path-rounded-square", "arrow-right", "arrow-right-circle", "arrow-right-end-on-rectangle", "arrow-right-start-on-rectangle", "arrow-top-right-on-square", "arrow-trending-down", "arrow-trending-up", "arrow-turn-down-left", "arrow-turn-down-right", "arrow-turn-left-down", "arrow-turn-left-up", "arrow-turn-right-down", "arrow-turn-right-up", "arrow-turn-up-left", "arrow-turn-up-right", "arrow-up", "arrow-up-circle", "arrow-up-left", "arrow-up-on-square", "arrow-up-on-square-stack", "arrow-up-right", "arrow-up-tray", "arrow-uturn-down", "arrow-uturn-left", "arrow-uturn-right", "arrow-uturn-up", "arrows-pointing-in", "arrows-pointing-out", "arrows-right-left", "arrows-up-down", "at-symbol", "backspace", "backward", "banknotes", "bars-2", "bars-3", "bars-3-bottom-left", "bars-3-bottom-right", "bars-3-center-left", "bars-4", "bars-arrow-down", "bars-arrow-up", "battery-0", "battery-100", "battery-50", "beaker", "bell", "bell-alert", "bell-slash", "bell-snooze", "bold", "bolt", "bolt-slash", "book-open", "bookmark", "bookmark-slash", "bookmark-square", "briefcase", "bug-ant", "building-library", "building-office", "building-office-2", "building-storefront", "cake", "calculator", "calendar", "calendar-date-range", "calendar-days", "camera", "chart-bar", "chart-bar-square", "chart-pie", "chat-bubble-bottom-center", "chat-bubble-bottom-center-text", "chat-bubble-left", "chat-bubble-left-ellipsis", "chat-bubble-left-right", "chat-bubble-oval-left", "chat-bubble-oval-left-ellipsis", "check", "check-badge", "check-circle", "chevron-double-down", "chevron-double-left", "chevron-double-right", "chevron-double-up", "chevron-down", "chevron-left", "chevron-right", "chevron-up", "chevron-up-down", "circle-stack", "clipboard", "clipboard-document", "clipboard-document-check", "clipboard-document-list", "clock", "cloud", "cloud-arrow-down", "cloud-arrow-up", "code-bracket", "code-bracket-square", "cog", "cog-6-tooth", "cog-8-tooth", "command-line", "computer-desktop", "cpu-chip", "credit-card", "cube", "cube-transparent", "currency-bangladeshi", "currency-dollar", "currency-euro", "currency-pound", "currency-rupee", "currency-yen", "cursor-arrow-rays", "cursor-arrow-ripple", "device-phone-mobile", "device-tablet", "divide", "document", "document-arrow-down", "document-arrow-up", "document-chart-bar", "document-check", "document-currency-bangladeshi", "document-currency-dollar", "document-currency-euro", "document-currency-pound", "document-currency-rupee", "document-currency-yen", "document-duplicate", "document-magnifying-glass", "document-minus", "document-plus", "document-text", "ellipsis-horizontal", "ellipsis-horizontal-circle", "ellipsis-vertical", "email", "envelope", "envelope-open", "equals", "exclamation-circle", "exclamation-triangle", "eye", "eye-dropper", "eye-slash", "face-frown", "face-smile", "film", "finger-print", "fire", "flag", "folder", "folder-arrow-down", "folder-minus", "folder-open", "folder-plus", "forward", "funnel", "gif", "gift", "gift-top", "github", "globe-alt", "globe-americas", "globe-asia-australia", "globe-europe-africa", "h1", "h2", "h3", "hand-raised", "hand-thumb-down", "hand-thumb-up", "hashtag", "heart", "home", "home-modern", "identification", "inbox", "inbox-arrow-down", "inbox-stack", "information-circle", "italic", "key", "language", "lifebuoy", "light-bulb", "link", "link-slash", "linkedin", "list-bullet", "lock-closed", "lock-open", "magnifying-glass", "magnifying-glass-circle", "magnifying-glass-minus", "magnifying-glass-plus", "map", "map-pin", "megaphone", "microphone", "minus", "minus-circle", "moon", "musical-note", "newspaper", "no-symbol", "numbered-list", "paint-brush", "palette", "paper-airplane", "paper-clip", "pause", "pause-circle", "pencil", "pencil-square", "percent-badge", "phone", "phone-arrow-down-left", "phone-arrow-up-right", "phone-x-mark", "photo", "play", "play-circle", "play-pause", "plus", "plus-circle", "power", "presentation-chart-bar", "presentation-chart-line", "printer", "puzzle-piece", "qr-code", "question-mark-circle", "queue-list", "radio", "receipt-percent", "receipt-refund", "rectangle-group", "rectangle-stack", "rocket-launch", "rss", "scale", "scissors", "server", "server-stack", "share", "shield-check", "shield-exclamation", "shopping-bag", "shopping-cart", "signal", "signal-slash", "slash", "sparkles", "speaker-wave", "speaker-x-mark", "square-2-stack", "square-3-stack-3d", "squares-2x2", "squares-plus", "star", "stop", "stop-circle", "strikethrough", "sun", "swatch", "table-cells", "tag", "ticket", "trash", "trophy", "truck", "tv", "underline", "user", "user-circle", "user-group", "user-minus", "user-plus", "users", "variable", "video-camera", "video-camera-slash", "view-columns", "viewfinder-circle", "wallet", "wifi", "window", "wrench", "wrench-screwdriver", "x-circle", "x-mark"];
254
- type IconName = typeof iconList[number];
255
- declare function getIconPath(name: IconName): string;
261
+ declare class DynamicBackground implements AfterViewInit, OnDestroy {
262
+ private el;
263
+ private renderer;
264
+ private bgService;
265
+ showControls: i0.InputSignal<boolean>;
266
+ images: i0.InputSignal<string[] | undefined>;
267
+ /** Label shown in the navigation controls next to the image counter. */
268
+ controlsLabel: i0.InputSignal<string>;
269
+ /** Slideshow interval in milliseconds. 0 = disabled. */
270
+ slideshowInterval: i0.InputSignal<number>;
271
+ private backgroundElement?;
272
+ private resolvedImages;
273
+ private imageIndex;
274
+ private slideshowTimer?;
275
+ private subscriptions;
276
+ constructor(el: ElementRef, renderer: Renderer2, bgService: DynamicBackgroundService);
277
+ ngAfterViewInit(): void;
278
+ ngOnDestroy(): void;
279
+ private applyBackground;
280
+ private startSlideshow;
281
+ private stopSlideshow;
282
+ changeImageIndex(increment: boolean): void;
283
+ get currentIndex(): number;
284
+ get totalImages(): number;
285
+ static ɵfac: i0.ɵɵFactoryDeclaration<DynamicBackground, [null, null, { optional: true; }]>;
286
+ static ɵcmp: i0.ɵɵComponentDeclaration<DynamicBackground, "cat-dynamic-background", never, { "showControls": { "alias": "showControls"; "required": false; "isSignal": true; }; "images": { "alias": "images"; "required": false; "isSignal": true; }; "controlsLabel": { "alias": "controlsLabel"; "required": false; "isSignal": true; }; "slideshowInterval": { "alias": "slideshowInterval"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
287
+ }
256
288
 
257
- export { Accordion, AccordionGroup, Button, Card, CatInput, ColorInput, Dialog, Drag, Drawer, ICON_BASE_PATH, ICON_PROVIDER, Icon, Menu, SelectInput, Theming, getIconPath, iconList };
258
- export type { IconName, IconProvider };
289
+ export { Accordion, AccordionGroup, Button, Card, CatInput, ColorInput, Dialog, Drag, Drawer, DynamicBackground, DynamicBackgroundService, Icon, Menu, MenuDropdown, MenuPanel, SelectInput, Theming };
290
+ export type { IconContent, MenuDropdownItem };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@catarina-ds/angular",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "keywords": [
5
5
  "angular",
6
6
  "design-system",