@colletdev/angular 0.1.3

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.
Files changed (53) hide show
  1. package/README.md +60 -0
  2. package/package.json +43 -0
  3. package/src/accordion.component.ts +97 -0
  4. package/src/activity-group.component.ts +61 -0
  5. package/src/alert.component.ts +75 -0
  6. package/src/autocomplete.component.ts +196 -0
  7. package/src/avatar.component.ts +59 -0
  8. package/src/backdrop.component.ts +51 -0
  9. package/src/badge.component.ts +67 -0
  10. package/src/breadcrumb.component.ts +77 -0
  11. package/src/button.component.ts +74 -0
  12. package/src/card.component.ts +72 -0
  13. package/src/carousel.component.ts +96 -0
  14. package/src/chat-input.component.ts +116 -0
  15. package/src/checkbox.component.ts +121 -0
  16. package/src/code-block.component.ts +67 -0
  17. package/src/collapsible.component.ts +72 -0
  18. package/src/date-picker.component.ts +159 -0
  19. package/src/dialog.component.ts +67 -0
  20. package/src/drawer.component.ts +67 -0
  21. package/src/fab.component.ts +70 -0
  22. package/src/file-upload.component.ts +77 -0
  23. package/src/index.ts +99 -0
  24. package/src/listbox.component.ts +121 -0
  25. package/src/menu.component.ts +99 -0
  26. package/src/message-bubble.component.ts +67 -0
  27. package/src/message-group.component.ts +77 -0
  28. package/src/message-part.component.ts +47 -0
  29. package/src/pagination.component.ts +67 -0
  30. package/src/popover.component.ts +77 -0
  31. package/src/profile-menu.component.ts +87 -0
  32. package/src/progress.component.ts +60 -0
  33. package/src/radio-group.component.ts +138 -0
  34. package/src/scrollbar.component.ts +59 -0
  35. package/src/search-bar.component.ts +127 -0
  36. package/src/select.component.ts +181 -0
  37. package/src/sidebar.component.ts +91 -0
  38. package/src/skeleton.component.ts +57 -0
  39. package/src/slider.component.ts +134 -0
  40. package/src/speed-dial.component.ts +100 -0
  41. package/src/spinner.component.ts +53 -0
  42. package/src/split-button.component.ts +97 -0
  43. package/src/stepper.component.ts +83 -0
  44. package/src/switch.component.ts +123 -0
  45. package/src/table.component.ts +219 -0
  46. package/src/tabs.component.ts +82 -0
  47. package/src/text-input.component.ts +158 -0
  48. package/src/text.component.ts +73 -0
  49. package/src/thinking.component.ts +57 -0
  50. package/src/toast.component.ts +72 -0
  51. package/src/toggle-group.component.ts +123 -0
  52. package/src/tooltip.component.ts +61 -0
  53. package/src/types.ts +334 -0
@@ -0,0 +1,121 @@
1
+ // Auto-generated by scripts/generate-angular.mjs — DO NOT EDIT
2
+ // Angular wrapper for <cx-listbox>
3
+ import {
4
+ Component,
5
+ CUSTOM_ELEMENTS_SCHEMA,
6
+ ChangeDetectionStrategy,
7
+ ChangeDetectorRef,
8
+ ElementRef,
9
+ ViewChild,
10
+ Input,
11
+ Output,
12
+ EventEmitter,
13
+ OnChanges,
14
+ SimpleChanges,
15
+ AfterViewInit,
16
+ } from '@angular/core';
17
+ import type { FocusDetail, KeyboardDetail, OptionGroup, SelectOption } from './types.js';
18
+
19
+ @Component({
20
+ selector: 'cx-listbox[collet]',
21
+ standalone: true,
22
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
23
+ changeDetection: ChangeDetectionStrategy.OnPush,
24
+ template: `
25
+ <cx-listbox
26
+ [attr.id]="id"
27
+ [attr.label]="label"
28
+ [attr.shape]="shape"
29
+ [attr.size]="size"
30
+ [attr.selection-mode]="selectionMode"
31
+ [selected]="_serialize_selected()"
32
+ [items]="_serialize_items()"
33
+ [groups]="_serialize_groups()"
34
+ #el
35
+ ><ng-content /></cx-listbox>
36
+ `,
37
+ })
38
+ export class CxListbox implements AfterViewInit, OnChanges {
39
+ @ViewChild('el', { static: true }) el!: ElementRef<HTMLElement>;
40
+
41
+ @Input() id?: string = undefined;
42
+ @Input() label?: string = undefined;
43
+ @Input() shape?: 'sharp' | 'rounded' | 'pill' = undefined;
44
+ @Input() size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = undefined;
45
+ @Input() selectionMode?: string = undefined;
46
+ @Input() selected?: string[] | string = undefined;
47
+ @Input() items?: SelectOption[] | string = undefined;
48
+ @Input() groups?: OptionGroup[] | string = undefined;
49
+
50
+ @Output() cxFocus = new EventEmitter<CustomEvent<FocusDetail>>();
51
+ @Output() cxBlur = new EventEmitter<CustomEvent<FocusDetail>>();
52
+ @Output() cxKeydown = new EventEmitter<CustomEvent<KeyboardDetail>>();
53
+ @Output() cxKeyup = new EventEmitter<CustomEvent<KeyboardDetail>>();
54
+
55
+ constructor(private c: ChangeDetectorRef) {
56
+ c.detach();
57
+ }
58
+
59
+ ngAfterViewInit(): void {
60
+ this.el.nativeElement.addEventListener('cx-focus', (e: Event) => {
61
+ this.cxFocus.emit(e as CustomEvent);
62
+ });
63
+ this.el.nativeElement.addEventListener('cx-blur', (e: Event) => {
64
+ this.cxBlur.emit(e as CustomEvent);
65
+ });
66
+ this.el.nativeElement.addEventListener('cx-keydown', (e: Event) => {
67
+ this.cxKeydown.emit(e as CustomEvent);
68
+ });
69
+ this.el.nativeElement.addEventListener('cx-keyup', (e: Event) => {
70
+ this.cxKeyup.emit(e as CustomEvent);
71
+ });
72
+ }
73
+
74
+ ngOnChanges(changes: SimpleChanges): void {
75
+ if (changes['selected'] && this.el) {
76
+ const val = this.selected;
77
+ if (val != null) {
78
+ this.el.nativeElement.setAttribute('selected', typeof val === 'object' ? JSON.stringify(val) : String(val));
79
+ } else {
80
+ this.el.nativeElement.removeAttribute('selected');
81
+ }
82
+ }
83
+ if (changes['items'] && this.el) {
84
+ const val = this.items;
85
+ if (val != null) {
86
+ this.el.nativeElement.setAttribute('items', typeof val === 'object' ? JSON.stringify(val) : String(val));
87
+ } else {
88
+ this.el.nativeElement.removeAttribute('items');
89
+ }
90
+ }
91
+ if (changes['groups'] && this.el) {
92
+ const val = this.groups;
93
+ if (val != null) {
94
+ this.el.nativeElement.setAttribute('groups', typeof val === 'object' ? JSON.stringify(val) : String(val));
95
+ } else {
96
+ this.el.nativeElement.removeAttribute('groups');
97
+ }
98
+ }
99
+ }
100
+
101
+ _serialize_selected(): string | null {
102
+ const val = this.selected;
103
+ if (val == null) return null;
104
+ return typeof val === 'object' ? JSON.stringify(val) : String(val);
105
+ }
106
+
107
+ _serialize_items(): string | null {
108
+ const val = this.items;
109
+ if (val == null) return null;
110
+ return typeof val === 'object' ? JSON.stringify(val) : String(val);
111
+ }
112
+
113
+ _serialize_groups(): string | null {
114
+ const val = this.groups;
115
+ if (val == null) return null;
116
+ return typeof val === 'object' ? JSON.stringify(val) : String(val);
117
+ }
118
+
119
+
120
+
121
+ }
@@ -0,0 +1,99 @@
1
+ // Auto-generated by scripts/generate-angular.mjs — DO NOT EDIT
2
+ // Angular wrapper for <cx-menu>
3
+ import {
4
+ Component,
5
+ CUSTOM_ELEMENTS_SCHEMA,
6
+ ChangeDetectionStrategy,
7
+ ChangeDetectorRef,
8
+ ElementRef,
9
+ ViewChild,
10
+ Input,
11
+ Output,
12
+ EventEmitter,
13
+ OnChanges,
14
+ SimpleChanges,
15
+ AfterViewInit,
16
+ } from '@angular/core';
17
+ import type { KeyboardDetail, MenuActionDetail, MenuChangeDetail, MenuEntry } from './types.js';
18
+
19
+ @Component({
20
+ selector: 'cx-menu[collet]',
21
+ standalone: true,
22
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
23
+ changeDetection: ChangeDetectionStrategy.OnPush,
24
+ template: `
25
+ <cx-menu
26
+ [attr.id]="id"
27
+ [attr.trigger-label]="triggerLabel"
28
+ [entries]="_serialize_entries()"
29
+ [attr.variant]="variant"
30
+ [attr.shape]="shape"
31
+ [attr.width]="width"
32
+ [attr.size]="size"
33
+ [attr.icon]="icon"
34
+ [attr.disabled]="disabled || null"
35
+ #el
36
+ ><ng-content /></cx-menu>
37
+ `,
38
+ })
39
+ export class CxMenu implements AfterViewInit, OnChanges {
40
+ @ViewChild('el', { static: true }) el!: ElementRef<HTMLElement>;
41
+
42
+ @Input() id?: string = undefined;
43
+ @Input() triggerLabel!: string;
44
+ @Input() entries?: MenuEntry[] | string = undefined;
45
+ @Input() variant?: 'filled' | 'outline' | 'ghost' = undefined;
46
+ @Input() shape?: 'sharp' | 'rounded' | 'pill' = undefined;
47
+ @Input() width?: 'auto' | 'sm' | 'md' | 'lg' = undefined;
48
+ @Input() size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = undefined;
49
+ @Input() icon?: string = undefined;
50
+ @Input() disabled?: boolean = undefined;
51
+
52
+ @Output() cxAction = new EventEmitter<CustomEvent<MenuActionDetail>>();
53
+ @Output() cxChange = new EventEmitter<CustomEvent<MenuChangeDetail>>();
54
+ @Output() cxKeydown = new EventEmitter<CustomEvent<KeyboardDetail>>();
55
+ @Output() cxKeyup = new EventEmitter<CustomEvent<KeyboardDetail>>();
56
+
57
+ constructor(private c: ChangeDetectorRef) {
58
+ c.detach();
59
+ }
60
+
61
+ ngAfterViewInit(): void {
62
+ this.el.nativeElement.addEventListener('cx-action', (e: Event) => {
63
+ this.cxAction.emit(e as CustomEvent);
64
+ });
65
+ this.el.nativeElement.addEventListener('cx-change', (e: Event) => {
66
+ this.cxChange.emit(e as CustomEvent);
67
+ });
68
+ this.el.nativeElement.addEventListener('cx-keydown', (e: Event) => {
69
+ this.cxKeydown.emit(e as CustomEvent);
70
+ });
71
+ this.el.nativeElement.addEventListener('cx-keyup', (e: Event) => {
72
+ this.cxKeyup.emit(e as CustomEvent);
73
+ });
74
+ }
75
+
76
+ ngOnChanges(changes: SimpleChanges): void {
77
+ if (changes['entries'] && this.el) {
78
+ const val = this.entries;
79
+ if (val != null) {
80
+ this.el.nativeElement.setAttribute('entries', typeof val === 'object' ? JSON.stringify(val) : String(val));
81
+ } else {
82
+ this.el.nativeElement.removeAttribute('entries');
83
+ }
84
+ }
85
+ }
86
+
87
+ _serialize_entries(): string | null {
88
+ const val = this.entries;
89
+ if (val == null) return null;
90
+ return typeof val === 'object' ? JSON.stringify(val) : String(val);
91
+ }
92
+
93
+ /** Opens the menu dropdown. */
94
+ open(): void { (this.el.nativeElement as any).open(); }
95
+
96
+ /** Closes the menu dropdown. */
97
+ close(): void { (this.el.nativeElement as any).close(); }
98
+
99
+ }
@@ -0,0 +1,67 @@
1
+ // Auto-generated by scripts/generate-angular.mjs — DO NOT EDIT
2
+ // Angular wrapper for <cx-message-bubble>
3
+ import {
4
+ Component,
5
+ CUSTOM_ELEMENTS_SCHEMA,
6
+ ChangeDetectionStrategy,
7
+ ChangeDetectorRef,
8
+ ElementRef,
9
+ ViewChild,
10
+ Input,
11
+ Output,
12
+ EventEmitter,
13
+ AfterViewInit,
14
+ } from '@angular/core';
15
+
16
+ @Component({
17
+ selector: 'cx-message-bubble[collet]',
18
+ standalone: true,
19
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
20
+ changeDetection: ChangeDetectionStrategy.OnPush,
21
+ template: `
22
+ <cx-message-bubble
23
+ [attr.id]="id"
24
+ [attr.role]="role"
25
+ [attr.variant]="variant"
26
+ [attr.shape]="shape"
27
+ [attr.alignment]="alignment"
28
+ [attr.size]="size"
29
+ [attr.html-content]="htmlContent"
30
+ [attr.sender-name]="senderName"
31
+ [attr.timestamp]="timestamp"
32
+ [attr.border]="border"
33
+ [attr.animated]="animated || null"
34
+ #el
35
+ ><ng-content /></cx-message-bubble>
36
+ `,
37
+ })
38
+ export class CxMessageBubble implements AfterViewInit {
39
+ @ViewChild('el', { static: true }) el!: ElementRef<HTMLElement>;
40
+
41
+ @Input() id?: string = undefined;
42
+ @Input() role?: 'user' | 'assistant' = undefined;
43
+ @Input() variant?: 'filled' | 'ghost' = undefined;
44
+ @Input() shape?: 'sharp' | 'rounded' = undefined;
45
+ @Input() alignment?: 'auto' | 'start' | 'end' = undefined;
46
+ @Input() size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = undefined;
47
+ @Input() htmlContent?: string = undefined;
48
+ @Input() senderName?: string = undefined;
49
+ @Input() timestamp?: string = undefined;
50
+ @Input() border?: string = undefined;
51
+ @Input() animated?: boolean = undefined;
52
+
53
+
54
+
55
+ constructor(private c: ChangeDetectorRef) {
56
+ c.detach();
57
+ }
58
+
59
+ ngAfterViewInit(): void {
60
+
61
+ }
62
+
63
+
64
+
65
+
66
+
67
+ }
@@ -0,0 +1,77 @@
1
+ // Auto-generated by scripts/generate-angular.mjs — DO NOT EDIT
2
+ // Angular wrapper for <cx-message-group>
3
+ import {
4
+ Component,
5
+ CUSTOM_ELEMENTS_SCHEMA,
6
+ ChangeDetectionStrategy,
7
+ ChangeDetectorRef,
8
+ ElementRef,
9
+ ViewChild,
10
+ Input,
11
+ Output,
12
+ EventEmitter,
13
+ OnChanges,
14
+ SimpleChanges,
15
+ AfterViewInit,
16
+ } from '@angular/core';
17
+ import type { MessageGroupPart } from './types.js';
18
+
19
+ @Component({
20
+ selector: 'cx-message-group[collet]',
21
+ standalone: true,
22
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
23
+ changeDetection: ChangeDetectionStrategy.OnPush,
24
+ template: `
25
+ <cx-message-group
26
+ [attr.id]="id"
27
+ [attr.role]="role"
28
+ [attr.alignment]="alignment"
29
+ [attr.size]="size"
30
+ [attr.sender-name]="senderName"
31
+ [attr.animated]="animated || null"
32
+ [parts]="_serialize_parts()"
33
+ #el
34
+ ><ng-content /></cx-message-group>
35
+ `,
36
+ })
37
+ export class CxMessageGroup implements AfterViewInit, OnChanges {
38
+ @ViewChild('el', { static: true }) el!: ElementRef<HTMLElement>;
39
+
40
+ @Input() id?: string = undefined;
41
+ @Input() role?: 'user' | 'assistant' = undefined;
42
+ @Input() alignment?: 'auto' | 'start' | 'end' = undefined;
43
+ @Input() size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = undefined;
44
+ @Input() senderName?: string = undefined;
45
+ @Input() animated?: boolean = undefined;
46
+ @Input() parts?: MessageGroupPart[] | string = undefined;
47
+
48
+
49
+
50
+ constructor(private c: ChangeDetectorRef) {
51
+ c.detach();
52
+ }
53
+
54
+ ngAfterViewInit(): void {
55
+
56
+ }
57
+
58
+ ngOnChanges(changes: SimpleChanges): void {
59
+ if (changes['parts'] && this.el) {
60
+ const val = this.parts;
61
+ if (val != null) {
62
+ this.el.nativeElement.setAttribute('parts', typeof val === 'object' ? JSON.stringify(val) : String(val));
63
+ } else {
64
+ this.el.nativeElement.removeAttribute('parts');
65
+ }
66
+ }
67
+ }
68
+
69
+ _serialize_parts(): string | null {
70
+ const val = this.parts;
71
+ if (val == null) return null;
72
+ return typeof val === 'object' ? JSON.stringify(val) : String(val);
73
+ }
74
+
75
+
76
+
77
+ }
@@ -0,0 +1,47 @@
1
+ // Auto-generated by scripts/generate-angular.mjs — DO NOT EDIT
2
+ // Angular wrapper for <cx-message-part>
3
+ import {
4
+ Component,
5
+ CUSTOM_ELEMENTS_SCHEMA,
6
+ ChangeDetectionStrategy,
7
+ ChangeDetectorRef,
8
+ ElementRef,
9
+ ViewChild,
10
+ Input,
11
+ Output,
12
+ EventEmitter,
13
+ AfterViewInit,
14
+ } from '@angular/core';
15
+
16
+ @Component({
17
+ selector: 'cx-message-part[collet]',
18
+ standalone: true,
19
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
20
+ changeDetection: ChangeDetectionStrategy.OnPush,
21
+ template: `
22
+ <cx-message-part
23
+
24
+ #el
25
+ ><ng-content /></cx-message-part>
26
+ `,
27
+ })
28
+ export class CxMessagePart implements AfterViewInit {
29
+ @ViewChild('el', { static: true }) el!: ElementRef<HTMLElement>;
30
+
31
+
32
+
33
+
34
+
35
+ constructor(private c: ChangeDetectorRef) {
36
+ c.detach();
37
+ }
38
+
39
+ ngAfterViewInit(): void {
40
+
41
+ }
42
+
43
+
44
+
45
+
46
+
47
+ }
@@ -0,0 +1,67 @@
1
+ // Auto-generated by scripts/generate-angular.mjs — DO NOT EDIT
2
+ // Angular wrapper for <cx-pagination>
3
+ import {
4
+ Component,
5
+ CUSTOM_ELEMENTS_SCHEMA,
6
+ ChangeDetectionStrategy,
7
+ ChangeDetectorRef,
8
+ ElementRef,
9
+ ViewChild,
10
+ Input,
11
+ Output,
12
+ EventEmitter,
13
+ AfterViewInit,
14
+ } from '@angular/core';
15
+
16
+ @Component({
17
+ selector: 'cx-pagination[collet]',
18
+ standalone: true,
19
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
20
+ changeDetection: ChangeDetectionStrategy.OnPush,
21
+ template: `
22
+ <cx-pagination
23
+ [attr.id]="id"
24
+ [attr.current-page]="currentPage"
25
+ [attr.page-size]="pageSize"
26
+ [attr.total-items]="totalItems"
27
+ [attr.label]="label"
28
+ [attr.size]="size"
29
+ [attr.show-info]="showInfo || null"
30
+ [attr.show-prev-next]="showPrevNext || null"
31
+ [attr.prev-label]="prevLabel"
32
+ [attr.next-label]="nextLabel"
33
+ [attr.page-size-options]="pageSizeOptions"
34
+ #el
35
+ ><ng-content /></cx-pagination>
36
+ `,
37
+ })
38
+ export class CxPagination implements AfterViewInit {
39
+ @ViewChild('el', { static: true }) el!: ElementRef<HTMLElement>;
40
+
41
+ @Input() id?: string = undefined;
42
+ @Input() currentPage!: number;
43
+ @Input() pageSize!: number;
44
+ @Input() totalItems!: number;
45
+ @Input() label?: string = undefined;
46
+ @Input() size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = undefined;
47
+ @Input() showInfo?: boolean = undefined;
48
+ @Input() showPrevNext?: boolean = undefined;
49
+ @Input() prevLabel?: string = undefined;
50
+ @Input() nextLabel?: string = undefined;
51
+ @Input() pageSizeOptions?: string = undefined;
52
+
53
+
54
+
55
+ constructor(private c: ChangeDetectorRef) {
56
+ c.detach();
57
+ }
58
+
59
+ ngAfterViewInit(): void {
60
+
61
+ }
62
+
63
+
64
+
65
+
66
+
67
+ }
@@ -0,0 +1,77 @@
1
+ // Auto-generated by scripts/generate-angular.mjs — DO NOT EDIT
2
+ // Angular wrapper for <cx-popover>
3
+ import {
4
+ Component,
5
+ CUSTOM_ELEMENTS_SCHEMA,
6
+ ChangeDetectionStrategy,
7
+ ChangeDetectorRef,
8
+ ElementRef,
9
+ ViewChild,
10
+ Input,
11
+ Output,
12
+ EventEmitter,
13
+ AfterViewInit,
14
+ } from '@angular/core';
15
+
16
+ @Component({
17
+ selector: 'cx-popover[collet]',
18
+ standalone: true,
19
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
20
+ changeDetection: ChangeDetectionStrategy.OnPush,
21
+ template: `
22
+ <cx-popover
23
+ [attr.id]="id"
24
+ [attr.trigger-label]="triggerLabel"
25
+ [attr.title]="title"
26
+ [attr.description]="description"
27
+ [attr.width]="width"
28
+ [attr.placement]="placement"
29
+ [attr.align]="align"
30
+ [attr.arrow]="arrow || null"
31
+ [attr.close-button]="closeButton || null"
32
+ [attr.variant]="variant"
33
+ [attr.shape]="shape"
34
+ [attr.size]="size"
35
+ [attr.icon]="icon"
36
+ [attr.disabled]="disabled || null"
37
+ #el
38
+ ><ng-content /></cx-popover>
39
+ `,
40
+ })
41
+ export class CxPopover implements AfterViewInit {
42
+ @ViewChild('el', { static: true }) el!: ElementRef<HTMLElement>;
43
+
44
+ @Input() id?: string = undefined;
45
+ @Input() triggerLabel!: string;
46
+ @Input() title?: string = undefined;
47
+ @Input() description?: string = undefined;
48
+ @Input() width?: 'sm' | 'md' | 'lg' | 'xl' | 'auto' = undefined;
49
+ @Input() placement?: 'top' | 'bottom' = undefined;
50
+ @Input() align?: 'start' | 'center' | 'end' = undefined;
51
+ @Input() arrow?: boolean = undefined;
52
+ @Input() closeButton?: boolean = undefined;
53
+ @Input() variant?: 'outline' | 'filled' | 'ghost' = undefined;
54
+ @Input() shape?: 'sharp' | 'rounded' | 'pill' = undefined;
55
+ @Input() size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = undefined;
56
+ @Input() icon?: string = undefined;
57
+ @Input() disabled?: boolean = undefined;
58
+
59
+
60
+
61
+ constructor(private c: ChangeDetectorRef) {
62
+ c.detach();
63
+ }
64
+
65
+ ngAfterViewInit(): void {
66
+
67
+ }
68
+
69
+
70
+
71
+ /** Opens the popover panel. */
72
+ open(): void { (this.el.nativeElement as any).open(); }
73
+
74
+ /** Closes the popover panel. */
75
+ close(): void { (this.el.nativeElement as any).close(); }
76
+
77
+ }
@@ -0,0 +1,87 @@
1
+ // Auto-generated by scripts/generate-angular.mjs — DO NOT EDIT
2
+ // Angular wrapper for <cx-profile-menu>
3
+ import {
4
+ Component,
5
+ CUSTOM_ELEMENTS_SCHEMA,
6
+ ChangeDetectionStrategy,
7
+ ChangeDetectorRef,
8
+ ElementRef,
9
+ ViewChild,
10
+ Input,
11
+ Output,
12
+ EventEmitter,
13
+ OnChanges,
14
+ SimpleChanges,
15
+ AfterViewInit,
16
+ } from '@angular/core';
17
+ import type { MenuActionDetail, MenuEntry } from './types.js';
18
+
19
+ @Component({
20
+ selector: 'cx-profile-menu[collet]',
21
+ standalone: true,
22
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
23
+ changeDetection: ChangeDetectionStrategy.OnPush,
24
+ template: `
25
+ <cx-profile-menu
26
+ [attr.id]="id"
27
+ [attr.label]="label"
28
+ [attr.image]="image"
29
+ [attr.initials]="initials"
30
+ [attr.shape]="shape"
31
+ [attr.size]="size"
32
+ [attr.width]="width"
33
+ [entries]="_serialize_entries()"
34
+ [attr.disabled]="disabled || null"
35
+ #el
36
+ ><ng-content /></cx-profile-menu>
37
+ `,
38
+ })
39
+ export class CxProfileMenu implements AfterViewInit, OnChanges {
40
+ @ViewChild('el', { static: true }) el!: ElementRef<HTMLElement>;
41
+
42
+ @Input() id?: string = undefined;
43
+ @Input() label!: string;
44
+ @Input() image?: string = undefined;
45
+ @Input() initials?: string = undefined;
46
+ @Input() shape?: 'circle' | 'rounded' = undefined;
47
+ @Input() size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = undefined;
48
+ @Input() width?: 'auto' | 'sm' | 'md' | 'lg' = undefined;
49
+ @Input() entries?: MenuEntry[] | string = undefined;
50
+ @Input() disabled?: boolean = undefined;
51
+
52
+ @Output() cxAction = new EventEmitter<CustomEvent<MenuActionDetail>>();
53
+
54
+ constructor(private c: ChangeDetectorRef) {
55
+ c.detach();
56
+ }
57
+
58
+ ngAfterViewInit(): void {
59
+ this.el.nativeElement.addEventListener('cx-action', (e: Event) => {
60
+ this.cxAction.emit(e as CustomEvent);
61
+ });
62
+ }
63
+
64
+ ngOnChanges(changes: SimpleChanges): void {
65
+ if (changes['entries'] && this.el) {
66
+ const val = this.entries;
67
+ if (val != null) {
68
+ this.el.nativeElement.setAttribute('entries', typeof val === 'object' ? JSON.stringify(val) : String(val));
69
+ } else {
70
+ this.el.nativeElement.removeAttribute('entries');
71
+ }
72
+ }
73
+ }
74
+
75
+ _serialize_entries(): string | null {
76
+ const val = this.entries;
77
+ if (val == null) return null;
78
+ return typeof val === 'object' ? JSON.stringify(val) : String(val);
79
+ }
80
+
81
+ /** Opens the profile menu dropdown. */
82
+ open(): void { (this.el.nativeElement as any).open(); }
83
+
84
+ /** Closes the profile menu dropdown. */
85
+ close(): void { (this.el.nativeElement as any).close(); }
86
+
87
+ }
@@ -0,0 +1,60 @@
1
+ // Auto-generated by scripts/generate-angular.mjs — DO NOT EDIT
2
+ // Angular wrapper for <cx-progress>
3
+ import {
4
+ Component,
5
+ CUSTOM_ELEMENTS_SCHEMA,
6
+ ChangeDetectionStrategy,
7
+ ChangeDetectorRef,
8
+ ElementRef,
9
+ ViewChild,
10
+ Input,
11
+ Output,
12
+ EventEmitter,
13
+ AfterViewInit,
14
+ } from '@angular/core';
15
+
16
+ @Component({
17
+ selector: 'cx-progress[collet]',
18
+ standalone: true,
19
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
20
+ changeDetection: ChangeDetectionStrategy.OnPush,
21
+ template: `
22
+ <cx-progress
23
+ [attr.id]="id"
24
+ [attr.label]="label"
25
+ [attr.value]="value"
26
+ [attr.value-text]="valueText"
27
+ [attr.intent]="intent"
28
+ [attr.shape]="shape"
29
+ [attr.size]="size"
30
+ #el
31
+ ><ng-content /></cx-progress>
32
+ `,
33
+ })
34
+ export class CxProgress implements AfterViewInit {
35
+ @ViewChild('el', { static: true }) el!: ElementRef<HTMLElement>;
36
+
37
+ @Input() id?: string = undefined;
38
+ @Input() label?: string = undefined;
39
+ /** Percentage 0–100. No max prop — the component assumes max=100. */
40
+ @Input() value?: number = undefined;
41
+ @Input() valueText?: string = undefined;
42
+ @Input() intent?: 'neutral' | 'primary' | 'info' | 'success' | 'warning' | 'danger' = undefined;
43
+ @Input() shape?: 'rounded' | 'sharp' | 'pill' = undefined;
44
+ @Input() size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = undefined;
45
+
46
+
47
+
48
+ constructor(private c: ChangeDetectorRef) {
49
+ c.detach();
50
+ }
51
+
52
+ ngAfterViewInit(): void {
53
+
54
+ }
55
+
56
+
57
+
58
+
59
+
60
+ }