@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.
- package/README.md +60 -0
- package/package.json +43 -0
- package/src/accordion.component.ts +97 -0
- package/src/activity-group.component.ts +61 -0
- package/src/alert.component.ts +75 -0
- package/src/autocomplete.component.ts +196 -0
- package/src/avatar.component.ts +59 -0
- package/src/backdrop.component.ts +51 -0
- package/src/badge.component.ts +67 -0
- package/src/breadcrumb.component.ts +77 -0
- package/src/button.component.ts +74 -0
- package/src/card.component.ts +72 -0
- package/src/carousel.component.ts +96 -0
- package/src/chat-input.component.ts +116 -0
- package/src/checkbox.component.ts +121 -0
- package/src/code-block.component.ts +67 -0
- package/src/collapsible.component.ts +72 -0
- package/src/date-picker.component.ts +159 -0
- package/src/dialog.component.ts +67 -0
- package/src/drawer.component.ts +67 -0
- package/src/fab.component.ts +70 -0
- package/src/file-upload.component.ts +77 -0
- package/src/index.ts +99 -0
- package/src/listbox.component.ts +121 -0
- package/src/menu.component.ts +99 -0
- package/src/message-bubble.component.ts +67 -0
- package/src/message-group.component.ts +77 -0
- package/src/message-part.component.ts +47 -0
- package/src/pagination.component.ts +67 -0
- package/src/popover.component.ts +77 -0
- package/src/profile-menu.component.ts +87 -0
- package/src/progress.component.ts +60 -0
- package/src/radio-group.component.ts +138 -0
- package/src/scrollbar.component.ts +59 -0
- package/src/search-bar.component.ts +127 -0
- package/src/select.component.ts +181 -0
- package/src/sidebar.component.ts +91 -0
- package/src/skeleton.component.ts +57 -0
- package/src/slider.component.ts +134 -0
- package/src/speed-dial.component.ts +100 -0
- package/src/spinner.component.ts +53 -0
- package/src/split-button.component.ts +97 -0
- package/src/stepper.component.ts +83 -0
- package/src/switch.component.ts +123 -0
- package/src/table.component.ts +219 -0
- package/src/tabs.component.ts +82 -0
- package/src/text-input.component.ts +158 -0
- package/src/text.component.ts +73 -0
- package/src/thinking.component.ts +57 -0
- package/src/toast.component.ts +72 -0
- package/src/toggle-group.component.ts +123 -0
- package/src/tooltip.component.ts +61 -0
- package/src/types.ts +334 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
// Auto-generated by scripts/generate-angular.mjs — DO NOT EDIT
|
|
2
|
+
// Angular wrapper for <cx-table>
|
|
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 { EmptyStateConfig, FooterRow, KeyboardDetail, PageDetail, PaginationConfig, SortDetail, SortState, TableColumn, TableExpandDetail, TableRow, TableSelectDetail } from './types.js';
|
|
18
|
+
|
|
19
|
+
@Component({
|
|
20
|
+
selector: 'cx-table[collet]',
|
|
21
|
+
standalone: true,
|
|
22
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
23
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
24
|
+
template: `
|
|
25
|
+
<cx-table
|
|
26
|
+
[attr.id]="id"
|
|
27
|
+
[attr.caption]="caption"
|
|
28
|
+
[columns]="_serialize_columns()"
|
|
29
|
+
[rows]="_serialize_rows()"
|
|
30
|
+
[attr.variant]="variant"
|
|
31
|
+
[attr.size]="size"
|
|
32
|
+
[attr.selectable]="selectable"
|
|
33
|
+
[selected]="_serialize_selected()"
|
|
34
|
+
[sorts]="_serialize_sorts()"
|
|
35
|
+
[pagination]="_serialize_pagination()"
|
|
36
|
+
[attr.hoverable]="hoverable || null"
|
|
37
|
+
[attr.sticky-header]="stickyHeader || null"
|
|
38
|
+
[footer]="_serialize_footer()"
|
|
39
|
+
[empty-state]="_serialize_emptyState()"
|
|
40
|
+
[column-order]="_serialize_columnOrder()"
|
|
41
|
+
[attr.disabled]="disabled || null"
|
|
42
|
+
[attr.loading]="loading"
|
|
43
|
+
[attr.error]="error"
|
|
44
|
+
#el
|
|
45
|
+
><ng-content /></cx-table>
|
|
46
|
+
`,
|
|
47
|
+
})
|
|
48
|
+
export class CxTable implements AfterViewInit, OnChanges {
|
|
49
|
+
@ViewChild('el', { static: true }) el!: ElementRef<HTMLElement>;
|
|
50
|
+
|
|
51
|
+
@Input() id?: string = undefined;
|
|
52
|
+
@Input() caption!: string;
|
|
53
|
+
@Input() columns?: TableColumn[] | string = undefined;
|
|
54
|
+
@Input() rows?: TableRow[] | string = undefined;
|
|
55
|
+
@Input() variant?: 'plain' | 'striped' | 'bordered' = undefined;
|
|
56
|
+
@Input() size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = undefined;
|
|
57
|
+
@Input() selectable?: string = undefined;
|
|
58
|
+
@Input() selected?: string[] | string = undefined;
|
|
59
|
+
@Input() sorts?: SortState[] | string = undefined;
|
|
60
|
+
@Input() pagination?: PaginationConfig | string = undefined;
|
|
61
|
+
@Input() hoverable?: boolean = undefined;
|
|
62
|
+
@Input() stickyHeader?: boolean = undefined;
|
|
63
|
+
@Input() footer?: FooterRow[] | string = undefined;
|
|
64
|
+
@Input() emptyState?: EmptyStateConfig | string = undefined;
|
|
65
|
+
@Input() columnOrder?: string[] | string = undefined;
|
|
66
|
+
@Input() disabled?: boolean = undefined;
|
|
67
|
+
@Input() loading?: number = undefined;
|
|
68
|
+
@Input() error?: string = undefined;
|
|
69
|
+
|
|
70
|
+
@Output() cxSort = new EventEmitter<CustomEvent<SortDetail>>();
|
|
71
|
+
@Output() cxSelect = new EventEmitter<CustomEvent<TableSelectDetail>>();
|
|
72
|
+
@Output() cxExpand = new EventEmitter<CustomEvent<TableExpandDetail>>();
|
|
73
|
+
@Output() cxPage = new EventEmitter<CustomEvent<PageDetail>>();
|
|
74
|
+
@Output() cxKeydown = new EventEmitter<CustomEvent<KeyboardDetail>>();
|
|
75
|
+
@Output() cxKeyup = new EventEmitter<CustomEvent<KeyboardDetail>>();
|
|
76
|
+
|
|
77
|
+
constructor(private c: ChangeDetectorRef) {
|
|
78
|
+
c.detach();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
ngAfterViewInit(): void {
|
|
82
|
+
this.el.nativeElement.addEventListener('cx-sort', (e: Event) => {
|
|
83
|
+
this.cxSort.emit(e as CustomEvent);
|
|
84
|
+
});
|
|
85
|
+
this.el.nativeElement.addEventListener('cx-select', (e: Event) => {
|
|
86
|
+
this.cxSelect.emit(e as CustomEvent);
|
|
87
|
+
});
|
|
88
|
+
this.el.nativeElement.addEventListener('cx-expand', (e: Event) => {
|
|
89
|
+
this.cxExpand.emit(e as CustomEvent);
|
|
90
|
+
});
|
|
91
|
+
this.el.nativeElement.addEventListener('cx-page', (e: Event) => {
|
|
92
|
+
this.cxPage.emit(e as CustomEvent);
|
|
93
|
+
});
|
|
94
|
+
this.el.nativeElement.addEventListener('cx-keydown', (e: Event) => {
|
|
95
|
+
this.cxKeydown.emit(e as CustomEvent);
|
|
96
|
+
});
|
|
97
|
+
this.el.nativeElement.addEventListener('cx-keyup', (e: Event) => {
|
|
98
|
+
this.cxKeyup.emit(e as CustomEvent);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
103
|
+
if (changes['columns'] && this.el) {
|
|
104
|
+
const val = this.columns;
|
|
105
|
+
if (val != null) {
|
|
106
|
+
this.el.nativeElement.setAttribute('columns', typeof val === 'object' ? JSON.stringify(val) : String(val));
|
|
107
|
+
} else {
|
|
108
|
+
this.el.nativeElement.removeAttribute('columns');
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (changes['rows'] && this.el) {
|
|
112
|
+
const val = this.rows;
|
|
113
|
+
if (val != null) {
|
|
114
|
+
this.el.nativeElement.setAttribute('rows', typeof val === 'object' ? JSON.stringify(val) : String(val));
|
|
115
|
+
} else {
|
|
116
|
+
this.el.nativeElement.removeAttribute('rows');
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (changes['selected'] && this.el) {
|
|
120
|
+
const val = this.selected;
|
|
121
|
+
if (val != null) {
|
|
122
|
+
this.el.nativeElement.setAttribute('selected', typeof val === 'object' ? JSON.stringify(val) : String(val));
|
|
123
|
+
} else {
|
|
124
|
+
this.el.nativeElement.removeAttribute('selected');
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (changes['sorts'] && this.el) {
|
|
128
|
+
const val = this.sorts;
|
|
129
|
+
if (val != null) {
|
|
130
|
+
this.el.nativeElement.setAttribute('sorts', typeof val === 'object' ? JSON.stringify(val) : String(val));
|
|
131
|
+
} else {
|
|
132
|
+
this.el.nativeElement.removeAttribute('sorts');
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (changes['pagination'] && this.el) {
|
|
136
|
+
const val = this.pagination;
|
|
137
|
+
if (val != null) {
|
|
138
|
+
this.el.nativeElement.setAttribute('pagination', typeof val === 'object' ? JSON.stringify(val) : String(val));
|
|
139
|
+
} else {
|
|
140
|
+
this.el.nativeElement.removeAttribute('pagination');
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (changes['footer'] && this.el) {
|
|
144
|
+
const val = this.footer;
|
|
145
|
+
if (val != null) {
|
|
146
|
+
this.el.nativeElement.setAttribute('footer', typeof val === 'object' ? JSON.stringify(val) : String(val));
|
|
147
|
+
} else {
|
|
148
|
+
this.el.nativeElement.removeAttribute('footer');
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (changes['emptyState'] && this.el) {
|
|
152
|
+
const val = this.emptyState;
|
|
153
|
+
if (val != null) {
|
|
154
|
+
this.el.nativeElement.setAttribute('empty-state', typeof val === 'object' ? JSON.stringify(val) : String(val));
|
|
155
|
+
} else {
|
|
156
|
+
this.el.nativeElement.removeAttribute('empty-state');
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (changes['columnOrder'] && this.el) {
|
|
160
|
+
const val = this.columnOrder;
|
|
161
|
+
if (val != null) {
|
|
162
|
+
this.el.nativeElement.setAttribute('column-order', typeof val === 'object' ? JSON.stringify(val) : String(val));
|
|
163
|
+
} else {
|
|
164
|
+
this.el.nativeElement.removeAttribute('column-order');
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
_serialize_columns(): string | null {
|
|
170
|
+
const val = this.columns;
|
|
171
|
+
if (val == null) return null;
|
|
172
|
+
return typeof val === 'object' ? JSON.stringify(val) : String(val);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
_serialize_rows(): string | null {
|
|
176
|
+
const val = this.rows;
|
|
177
|
+
if (val == null) return null;
|
|
178
|
+
return typeof val === 'object' ? JSON.stringify(val) : String(val);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
_serialize_selected(): string | null {
|
|
182
|
+
const val = this.selected;
|
|
183
|
+
if (val == null) return null;
|
|
184
|
+
return typeof val === 'object' ? JSON.stringify(val) : String(val);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
_serialize_sorts(): string | null {
|
|
188
|
+
const val = this.sorts;
|
|
189
|
+
if (val == null) return null;
|
|
190
|
+
return typeof val === 'object' ? JSON.stringify(val) : String(val);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
_serialize_pagination(): string | null {
|
|
194
|
+
const val = this.pagination;
|
|
195
|
+
if (val == null) return null;
|
|
196
|
+
return typeof val === 'object' ? JSON.stringify(val) : String(val);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
_serialize_footer(): string | null {
|
|
200
|
+
const val = this.footer;
|
|
201
|
+
if (val == null) return null;
|
|
202
|
+
return typeof val === 'object' ? JSON.stringify(val) : String(val);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
_serialize_emptyState(): string | null {
|
|
206
|
+
const val = this.emptyState;
|
|
207
|
+
if (val == null) return null;
|
|
208
|
+
return typeof val === 'object' ? JSON.stringify(val) : String(val);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
_serialize_columnOrder(): string | null {
|
|
212
|
+
const val = this.columnOrder;
|
|
213
|
+
if (val == null) return null;
|
|
214
|
+
return typeof val === 'object' ? JSON.stringify(val) : String(val);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// Auto-generated by scripts/generate-angular.mjs — DO NOT EDIT
|
|
2
|
+
// Angular wrapper for <cx-tabs>
|
|
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 { SelectDetail, TabItem } from './types.js';
|
|
18
|
+
|
|
19
|
+
@Component({
|
|
20
|
+
selector: 'cx-tabs[collet]',
|
|
21
|
+
standalone: true,
|
|
22
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
23
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
24
|
+
template: `
|
|
25
|
+
<cx-tabs
|
|
26
|
+
[attr.id]="id"
|
|
27
|
+
[attr.label]="label"
|
|
28
|
+
[items]="_serialize_items()"
|
|
29
|
+
[attr.default-tab]="defaultTab"
|
|
30
|
+
[attr.variant]="variant"
|
|
31
|
+
[attr.orientation]="orientation"
|
|
32
|
+
[attr.width]="width"
|
|
33
|
+
[attr.size]="size"
|
|
34
|
+
#el
|
|
35
|
+
><ng-content /></cx-tabs>
|
|
36
|
+
`,
|
|
37
|
+
})
|
|
38
|
+
export class CxTabs implements AfterViewInit, OnChanges {
|
|
39
|
+
@ViewChild('el', { static: true }) el!: ElementRef<HTMLElement>;
|
|
40
|
+
|
|
41
|
+
@Input() id?: string = undefined;
|
|
42
|
+
@Input() label?: string = undefined;
|
|
43
|
+
@Input() items?: TabItem[] | string = undefined;
|
|
44
|
+
@Input() defaultTab?: string = undefined;
|
|
45
|
+
@Input() variant?: 'underline' | 'enclosed' | 'pill' = undefined;
|
|
46
|
+
@Input() orientation?: 'horizontal' | 'vertical' = undefined;
|
|
47
|
+
@Input() width?: 'auto' | 'full' = undefined;
|
|
48
|
+
@Input() size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = undefined;
|
|
49
|
+
|
|
50
|
+
@Output() cxChange = new EventEmitter<CustomEvent<SelectDetail>>();
|
|
51
|
+
|
|
52
|
+
constructor(private c: ChangeDetectorRef) {
|
|
53
|
+
c.detach();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
ngAfterViewInit(): void {
|
|
57
|
+
this.el.nativeElement.addEventListener('cx-change', (e: Event) => {
|
|
58
|
+
this.cxChange.emit(e as CustomEvent);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
63
|
+
if (changes['items'] && this.el) {
|
|
64
|
+
const val = this.items;
|
|
65
|
+
if (val != null) {
|
|
66
|
+
this.el.nativeElement.setAttribute('items', typeof val === 'object' ? JSON.stringify(val) : String(val));
|
|
67
|
+
} else {
|
|
68
|
+
this.el.nativeElement.removeAttribute('items');
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
_serialize_items(): string | null {
|
|
74
|
+
const val = this.items;
|
|
75
|
+
if (val == null) return null;
|
|
76
|
+
return typeof val === 'object' ? JSON.stringify(val) : String(val);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** Focuses the active tab. */
|
|
80
|
+
focus(): void { (this.el.nativeElement as any).focus(); }
|
|
81
|
+
|
|
82
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
// Auto-generated by scripts/generate-angular.mjs — DO NOT EDIT
|
|
2
|
+
// Angular wrapper for <cx-text-input>
|
|
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
|
+
forwardRef,
|
|
15
|
+
} from '@angular/core';
|
|
16
|
+
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
17
|
+
import type { FocusDetail, InputDetail, KeyboardDetail } from './types.js';
|
|
18
|
+
|
|
19
|
+
@Component({
|
|
20
|
+
selector: 'cx-text-input[collet]',
|
|
21
|
+
standalone: true,
|
|
22
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
23
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
24
|
+
providers: [{
|
|
25
|
+
provide: NG_VALUE_ACCESSOR,
|
|
26
|
+
useExisting: forwardRef(() => CxTextInput),
|
|
27
|
+
multi: true,
|
|
28
|
+
}],
|
|
29
|
+
template: `
|
|
30
|
+
<cx-text-input
|
|
31
|
+
[attr.id]="id"
|
|
32
|
+
[attr.label]="label"
|
|
33
|
+
[attr.variant]="variant"
|
|
34
|
+
[attr.shape]="shape"
|
|
35
|
+
[attr.size]="size"
|
|
36
|
+
[attr.kind]="kind"
|
|
37
|
+
[attr.placeholder]="placeholder"
|
|
38
|
+
[attr.value]="value"
|
|
39
|
+
[attr.helper-text]="helperText"
|
|
40
|
+
[attr.error]="error"
|
|
41
|
+
[attr.disabled]="disabled || null"
|
|
42
|
+
[attr.readonly]="readonly || null"
|
|
43
|
+
[attr.required]="required || null"
|
|
44
|
+
[attr.clearable]="clearable || null"
|
|
45
|
+
[attr.prefix-icon]="prefixIcon"
|
|
46
|
+
[attr.suffix-icon]="suffixIcon"
|
|
47
|
+
[attr.password-toggle]="passwordToggle || null"
|
|
48
|
+
[attr.password-visible]="passwordVisible || null"
|
|
49
|
+
[attr.name]="name"
|
|
50
|
+
[attr.min-length]="minLength"
|
|
51
|
+
[attr.max-length]="maxLength"
|
|
52
|
+
[attr.pattern]="pattern"
|
|
53
|
+
[attr.autocomplete]="autocomplete"
|
|
54
|
+
[attr.rows]="rows"
|
|
55
|
+
[attr.auto-grow]="autoGrow || null"
|
|
56
|
+
#el
|
|
57
|
+
><ng-content /></cx-text-input>
|
|
58
|
+
`,
|
|
59
|
+
})
|
|
60
|
+
export class CxTextInput implements AfterViewInit, ControlValueAccessor {
|
|
61
|
+
@ViewChild('el', { static: true }) el!: ElementRef<HTMLElement>;
|
|
62
|
+
|
|
63
|
+
@Input() id?: string = undefined;
|
|
64
|
+
@Input() label?: string = undefined;
|
|
65
|
+
@Input() variant?: 'outline' | 'filled' | 'ghost' = undefined;
|
|
66
|
+
@Input() shape?: 'sharp' | 'rounded' | 'pill' = undefined;
|
|
67
|
+
@Input() size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = undefined;
|
|
68
|
+
/** Input type. Use 'multiline' for textarea behavior with optional rows and autoGrow. */
|
|
69
|
+
@Input() kind?: 'text' | 'email' | 'password' | 'search' | 'multiline' = undefined;
|
|
70
|
+
@Input() placeholder?: string = undefined;
|
|
71
|
+
/** Controlled value. Set via onInput callback. */
|
|
72
|
+
@Input() value?: string = undefined;
|
|
73
|
+
@Input() helperText?: string = undefined;
|
|
74
|
+
@Input() error?: string = undefined;
|
|
75
|
+
@Input() disabled?: boolean = undefined;
|
|
76
|
+
@Input() readonly?: boolean = undefined;
|
|
77
|
+
@Input() required?: boolean = undefined;
|
|
78
|
+
@Input() clearable?: boolean = undefined;
|
|
79
|
+
@Input() prefixIcon?: string = undefined;
|
|
80
|
+
@Input() suffixIcon?: string = undefined;
|
|
81
|
+
@Input() passwordToggle?: boolean = undefined;
|
|
82
|
+
@Input() passwordVisible?: boolean = undefined;
|
|
83
|
+
@Input() name?: string = undefined;
|
|
84
|
+
@Input() minLength?: number = undefined;
|
|
85
|
+
@Input() maxLength?: number = undefined;
|
|
86
|
+
@Input() pattern?: string = undefined;
|
|
87
|
+
@Input() autocomplete?: string = undefined;
|
|
88
|
+
@Input() rows?: number = undefined;
|
|
89
|
+
@Input() autoGrow?: boolean = undefined;
|
|
90
|
+
|
|
91
|
+
@Output() cxInput = new EventEmitter<CustomEvent<InputDetail>>();
|
|
92
|
+
@Output() cxChange = new EventEmitter<CustomEvent<InputDetail>>();
|
|
93
|
+
@Output() cxFocus = new EventEmitter<CustomEvent<FocusDetail>>();
|
|
94
|
+
@Output() cxBlur = new EventEmitter<CustomEvent<FocusDetail>>();
|
|
95
|
+
@Output() cxKeydown = new EventEmitter<CustomEvent<KeyboardDetail>>();
|
|
96
|
+
@Output() cxKeyup = new EventEmitter<CustomEvent<KeyboardDetail>>();
|
|
97
|
+
|
|
98
|
+
constructor(private c: ChangeDetectorRef) {
|
|
99
|
+
c.detach();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
ngAfterViewInit(): void {
|
|
103
|
+
this.el.nativeElement.addEventListener('cx-input', (e: Event) => {
|
|
104
|
+
this.cxInput.emit(e as CustomEvent);
|
|
105
|
+
});
|
|
106
|
+
this.el.nativeElement.addEventListener('cx-change', (e: Event) => {
|
|
107
|
+
this.cxChange.emit(e as CustomEvent);
|
|
108
|
+
});
|
|
109
|
+
this.el.nativeElement.addEventListener('cx-focus', (e: Event) => {
|
|
110
|
+
this.cxFocus.emit(e as CustomEvent);
|
|
111
|
+
});
|
|
112
|
+
this.el.nativeElement.addEventListener('cx-blur', (e: Event) => {
|
|
113
|
+
this.cxBlur.emit(e as CustomEvent);
|
|
114
|
+
});
|
|
115
|
+
this.el.nativeElement.addEventListener('cx-keydown', (e: Event) => {
|
|
116
|
+
this.cxKeydown.emit(e as CustomEvent);
|
|
117
|
+
});
|
|
118
|
+
this.el.nativeElement.addEventListener('cx-keyup', (e: Event) => {
|
|
119
|
+
this.cxKeyup.emit(e as CustomEvent);
|
|
120
|
+
});
|
|
121
|
+
// CVA: sync CE value changes back to Angular forms
|
|
122
|
+
this.el.nativeElement.addEventListener('cx-change', (e: Event) => {
|
|
123
|
+
this._onChange((e as CustomEvent).detail?.value);
|
|
124
|
+
});
|
|
125
|
+
this.el.nativeElement.addEventListener('focusout', () => {
|
|
126
|
+
this._onTouched();
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
/** Focuses the inner input or textarea. */
|
|
133
|
+
focus(): void { (this.el.nativeElement as any).focus(); }
|
|
134
|
+
|
|
135
|
+
/** Blurs the inner input or textarea. */
|
|
136
|
+
blur(): void { (this.el.nativeElement as any).blur(); }
|
|
137
|
+
|
|
138
|
+
/** Selects all text in the input. */
|
|
139
|
+
select(): void { (this.el.nativeElement as any).select(); }
|
|
140
|
+
|
|
141
|
+
// ── ControlValueAccessor ──
|
|
142
|
+
private _onChange: (value: any) => void = () => {};
|
|
143
|
+
private _onTouched: () => void = () => {};
|
|
144
|
+
|
|
145
|
+
writeValue(value: any): void {
|
|
146
|
+
if (this.el) (this.el.nativeElement as any).value = value ?? '';
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
registerOnChange(fn: (value: any) => void): void { this._onChange = fn; }
|
|
150
|
+
registerOnTouched(fn: () => void): void { this._onTouched = fn; }
|
|
151
|
+
|
|
152
|
+
setDisabledState(isDisabled: boolean): void {
|
|
153
|
+
if (this.el) {
|
|
154
|
+
if (isDisabled) this.el.nativeElement.setAttribute('disabled', '');
|
|
155
|
+
else this.el.nativeElement.removeAttribute('disabled');
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Auto-generated by scripts/generate-angular.mjs — DO NOT EDIT
|
|
2
|
+
// Angular wrapper for <cx-text>
|
|
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-text[collet]',
|
|
18
|
+
standalone: true,
|
|
19
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
20
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21
|
+
template: `
|
|
22
|
+
<cx-text
|
|
23
|
+
[attr.id]="id"
|
|
24
|
+
[attr.role]="role"
|
|
25
|
+
[attr.align]="align"
|
|
26
|
+
[attr.color]="color"
|
|
27
|
+
[attr.muted]="muted || null"
|
|
28
|
+
[attr.strong]="strong || null"
|
|
29
|
+
[attr.italic]="italic || null"
|
|
30
|
+
[attr.underline]="underline || null"
|
|
31
|
+
[attr.underline-strong]="underlineStrong || null"
|
|
32
|
+
[attr.truncate]="truncate || null"
|
|
33
|
+
[attr.line-clamp]="lineClamp"
|
|
34
|
+
[attr.balance]="balance || null"
|
|
35
|
+
[attr.prose]="prose || null"
|
|
36
|
+
[attr.element-as]="elementAs"
|
|
37
|
+
#el
|
|
38
|
+
><ng-content /></cx-text>
|
|
39
|
+
`,
|
|
40
|
+
})
|
|
41
|
+
export class CxText implements AfterViewInit {
|
|
42
|
+
@ViewChild('el', { static: true }) el!: ElementRef<HTMLElement>;
|
|
43
|
+
|
|
44
|
+
@Input() id?: string = undefined;
|
|
45
|
+
@Input() role?: 'display' | 'h1' | 'h2' | 'h3' | 'label-lg' | 'label-md' | 'label-sm' | 'body-lg' | 'body-md' | 'body-sm' | 'overline' | 'caption' | 'code' = undefined;
|
|
46
|
+
@Input() align?: 'start' | 'center' | 'end' = undefined;
|
|
47
|
+
@Input() color?: 'primary' | 'inverse' | 'muted' = undefined;
|
|
48
|
+
@Input() muted?: boolean = undefined;
|
|
49
|
+
@Input() strong?: boolean = undefined;
|
|
50
|
+
@Input() italic?: boolean = undefined;
|
|
51
|
+
@Input() underline?: boolean = undefined;
|
|
52
|
+
@Input() underlineStrong?: boolean = undefined;
|
|
53
|
+
@Input() truncate?: boolean = undefined;
|
|
54
|
+
@Input() lineClamp?: number = undefined;
|
|
55
|
+
@Input() balance?: boolean = undefined;
|
|
56
|
+
@Input() prose?: boolean = undefined;
|
|
57
|
+
@Input() elementAs?: string = undefined;
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
constructor(private c: ChangeDetectorRef) {
|
|
62
|
+
c.detach();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
ngAfterViewInit(): void {
|
|
66
|
+
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Auto-generated by scripts/generate-angular.mjs — DO NOT EDIT
|
|
2
|
+
// Angular wrapper for <cx-thinking>
|
|
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-thinking[collet]',
|
|
18
|
+
standalone: true,
|
|
19
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
20
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21
|
+
template: `
|
|
22
|
+
<cx-thinking
|
|
23
|
+
[attr.id]="id"
|
|
24
|
+
[attr.variant]="variant"
|
|
25
|
+
[attr.shape]="shape"
|
|
26
|
+
[attr.label]="label"
|
|
27
|
+
[attr.size]="size"
|
|
28
|
+
[attr.speed]="speed"
|
|
29
|
+
#el
|
|
30
|
+
><ng-content /></cx-thinking>
|
|
31
|
+
`,
|
|
32
|
+
})
|
|
33
|
+
export class CxThinking implements AfterViewInit {
|
|
34
|
+
@ViewChild('el', { static: true }) el!: ElementRef<HTMLElement>;
|
|
35
|
+
|
|
36
|
+
@Input() id?: string = undefined;
|
|
37
|
+
@Input() variant?: 'ghost' | 'filled' = undefined;
|
|
38
|
+
@Input() shape?: 'sharp' | 'rounded' | 'pill' = undefined;
|
|
39
|
+
@Input() label?: string = undefined;
|
|
40
|
+
@Input() size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = undefined;
|
|
41
|
+
@Input() speed?: string = undefined;
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
constructor(private c: ChangeDetectorRef) {
|
|
46
|
+
c.detach();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
ngAfterViewInit(): void {
|
|
50
|
+
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// Auto-generated by scripts/generate-angular.mjs — DO NOT EDIT
|
|
2
|
+
// Angular wrapper for <cx-toast>
|
|
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
|
+
import type { DismissDetail } from './types.js';
|
|
16
|
+
|
|
17
|
+
@Component({
|
|
18
|
+
selector: 'cx-toast[collet]',
|
|
19
|
+
standalone: true,
|
|
20
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
21
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
22
|
+
template: `
|
|
23
|
+
<cx-toast
|
|
24
|
+
[attr.id]="id"
|
|
25
|
+
[attr.title]="title"
|
|
26
|
+
[attr.description]="description"
|
|
27
|
+
[attr.variant]="variant"
|
|
28
|
+
[attr.intent]="intent"
|
|
29
|
+
[attr.size]="size"
|
|
30
|
+
[attr.show-icon]="showIcon || null"
|
|
31
|
+
[attr.icon]="icon"
|
|
32
|
+
[attr.dismissible]="dismissible || null"
|
|
33
|
+
[attr.dismiss-label]="dismissLabel"
|
|
34
|
+
[attr.duration]="duration"
|
|
35
|
+
#el
|
|
36
|
+
><ng-content />
|
|
37
|
+
<ng-content select="[slot=action]" /></cx-toast>
|
|
38
|
+
`,
|
|
39
|
+
})
|
|
40
|
+
export class CxToast implements AfterViewInit {
|
|
41
|
+
@ViewChild('el', { static: true }) el!: ElementRef<HTMLElement>;
|
|
42
|
+
|
|
43
|
+
@Input() id?: string = undefined;
|
|
44
|
+
@Input() title?: string = undefined;
|
|
45
|
+
@Input() description?: string = undefined;
|
|
46
|
+
@Input() variant?: 'subtle' | 'filled' | 'outline' = undefined;
|
|
47
|
+
@Input() intent?: 'neutral' | 'primary' | 'info' | 'success' | 'warning' | 'danger' = undefined;
|
|
48
|
+
@Input() size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = undefined;
|
|
49
|
+
@Input() showIcon?: boolean = undefined;
|
|
50
|
+
@Input() icon?: string = undefined;
|
|
51
|
+
@Input() dismissible?: boolean = undefined;
|
|
52
|
+
@Input() dismissLabel?: string = undefined;
|
|
53
|
+
@Input() duration?: number = undefined;
|
|
54
|
+
|
|
55
|
+
@Output() cxDismiss = new EventEmitter<CustomEvent<DismissDetail>>();
|
|
56
|
+
|
|
57
|
+
constructor(private c: ChangeDetectorRef) {
|
|
58
|
+
c.detach();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
ngAfterViewInit(): void {
|
|
62
|
+
this.el.nativeElement.addEventListener('cx-dismiss', (e: Event) => {
|
|
63
|
+
this.cxDismiss.emit(e as CustomEvent);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
/** Dismisses the toast with exit animation. */
|
|
70
|
+
dismiss(): void { (this.el.nativeElement as any).dismiss(); }
|
|
71
|
+
|
|
72
|
+
}
|