@joralvmel/cosmos-angular 0.3.0 → 0.4.0
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 +7 -4
- package/dist/components/badge.component.d.ts +20 -0
- package/dist/components/badge.component.js +46 -0
- package/dist/components/badge.component.js.map +1 -0
- package/dist/components/button.component.js +3 -3
- package/dist/components/calendar.component.d.ts +28 -0
- package/dist/components/calendar.component.js +65 -0
- package/dist/components/calendar.component.js.map +1 -0
- package/dist/components/checkbox.component.d.ts +52 -0
- package/dist/components/checkbox.component.js +152 -0
- package/dist/components/checkbox.component.js.map +1 -0
- package/dist/components/dialog.component.d.ts +44 -0
- package/dist/components/dialog.component.js +106 -0
- package/dist/components/dialog.component.js.map +1 -0
- package/dist/components/icon-button.component.js +3 -3
- package/dist/components/icon.component.d.ts +6 -8
- package/dist/components/icon.component.js +12 -22
- package/dist/components/icon.component.js.map +1 -1
- package/dist/components/listbox.component.js +3 -3
- package/dist/components/pagination.component.d.ts +36 -0
- package/dist/components/pagination.component.js +129 -0
- package/dist/components/pagination.component.js.map +1 -0
- package/dist/components/popover.component.d.ts +1 -10
- package/dist/components/popover.component.js +3 -32
- package/dist/components/popover.component.js.map +1 -1
- package/dist/components/radio-group.component.d.ts +49 -0
- package/dist/components/radio-group.component.js +146 -0
- package/dist/components/radio-group.component.js.map +1 -0
- package/dist/components/select.component.d.ts +49 -0
- package/dist/components/select.component.js +147 -0
- package/dist/components/select.component.js.map +1 -0
- package/dist/components/switch.component.d.ts +47 -0
- package/dist/components/switch.component.js +135 -0
- package/dist/components/switch.component.js.map +1 -0
- package/dist/components/text-field.component.d.ts +3 -4
- package/dist/components/text-field.component.js +9 -14
- package/dist/components/text-field.component.js.map +1 -1
- package/dist/components/textarea.component.d.ts +54 -0
- package/dist/components/textarea.component.js +168 -0
- package/dist/components/textarea.component.js.map +1 -0
- package/dist/index.d.ts +20 -2
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -1
- package/llms.md +350 -20
- package/package.json +10 -10
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChangeDetectionStrategy, Component, ElementRef, Input, inject } from '@angular/core';
|
|
2
2
|
import '@joralvmel/cosmos-elements/icon';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
/**
|
|
5
5
|
* Angular proxy of `<cosm-icon>`.
|
|
6
6
|
*
|
|
7
7
|
* ```html
|
|
8
|
-
* <cosm-icon [icon]="house" size="md"
|
|
8
|
+
* <cosm-icon [icon]="house" size="md" label="Home" />
|
|
9
|
+
* <cosm-icon [icon]="heart" variant="filled" />
|
|
9
10
|
* ```
|
|
10
11
|
*/
|
|
11
12
|
export class CosmIconComponent {
|
|
@@ -18,25 +19,19 @@ export class CosmIconComponent {
|
|
|
18
19
|
set size(value) {
|
|
19
20
|
this.element.size = value;
|
|
20
21
|
}
|
|
21
|
-
set
|
|
22
|
-
this.element.
|
|
22
|
+
set variant(value) {
|
|
23
|
+
this.element.variant = value;
|
|
23
24
|
}
|
|
24
|
-
set
|
|
25
|
-
this.element.
|
|
26
|
-
}
|
|
27
|
-
set strokeWidth(value) {
|
|
28
|
-
this.element.strokeWidth = value;
|
|
25
|
+
set color(value) {
|
|
26
|
+
this.element.color = value;
|
|
29
27
|
}
|
|
30
28
|
set label(value) {
|
|
31
29
|
this.element.label = value;
|
|
32
30
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.6", ngImport: i0, type: CosmIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
37
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "22.2.6", type: CosmIconComponent, isStandalone: true, selector: "cosm-icon", inputs: { icon: "icon", size: "size", stroke: "stroke", fill: "fill", strokeWidth: "strokeWidth", label: "label", decorative: ["decorative", "decorative", booleanAttribute] }, ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
31
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: CosmIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
32
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.3.0", type: CosmIconComponent, isStandalone: true, selector: "cosm-icon", inputs: { icon: "icon", size: "size", variant: "variant", color: "color", label: "label" }, ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
38
33
|
}
|
|
39
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: CosmIconComponent, decorators: [{
|
|
40
35
|
type: Component,
|
|
41
36
|
args: [{
|
|
42
37
|
selector: 'cosm-icon',
|
|
@@ -48,16 +43,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.6", ngImpor
|
|
|
48
43
|
args: [{ required: true }]
|
|
49
44
|
}], size: [{
|
|
50
45
|
type: Input
|
|
51
|
-
}],
|
|
46
|
+
}], variant: [{
|
|
52
47
|
type: Input
|
|
53
|
-
}],
|
|
54
|
-
type: Input
|
|
55
|
-
}], strokeWidth: [{
|
|
48
|
+
}], color: [{
|
|
56
49
|
type: Input
|
|
57
50
|
}], label: [{
|
|
58
51
|
type: Input
|
|
59
|
-
}], decorative: [{
|
|
60
|
-
type: Input,
|
|
61
|
-
args: [{ transform: booleanAttribute }]
|
|
62
52
|
}] } });
|
|
63
53
|
//# sourceMappingURL=icon.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.component.js","sourceRoot":"","sources":["../../src/components/icon.component.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"icon.component.js","sourceRoot":"","sources":["../../src/components/icon.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAG9F,OAAO,iCAAiC,CAAC;;AAEzC;;;;;;;GAOG;AAMH,MAAM,OAAO,iBAAiB;IAL9B;QAMW,YAAO,GAAa,MAAM,CAAuB,UAAU,CAAC,CAAC,aAAa,CAAC;KAqBrF;IAnBC,IAA+B,IAAI,CAAC,KAAqB;QACvD,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC;IAC5B,CAAC;IAED,IAAa,IAAI,CAAC,KAAmB;QACnC,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC;IAC5B,CAAC;IAED,IAAa,OAAO,CAAC,KAAsB;QACzC,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;IAC/B,CAAC;IAED,IAAa,KAAK,CAAC,KAAa;QAC9B,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IAC7B,CAAC;IAED,IAAa,KAAK,CAAC,KAAyB;QAC1C,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IAC7B,CAAC;8GArBU,iBAAiB;kGAAjB,iBAAiB,iKAHlB,gBAAgB;;2FAGf,iBAAiB;kBAL7B,SAAS;mBAAC;oBACT,QAAQ,EAAE,WAAW;oBACrB,QAAQ,EAAE,gBAAgB;oBAC1B,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;;sBAIE,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBAIxB,KAAK;;sBAIL,KAAK;;sBAIL,KAAK;;sBAIL,KAAK"}
|
|
@@ -54,10 +54,10 @@ export class CosmListboxComponent {
|
|
|
54
54
|
set locale(value) {
|
|
55
55
|
this.element.locale = value;
|
|
56
56
|
}
|
|
57
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
58
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "22.
|
|
57
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: CosmListboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
58
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "22.3.0", type: CosmListboxComponent, isStandalone: true, selector: "cosm-listbox", inputs: { label: "label", labelHidden: ["labelHidden", "labelHidden", booleanAttribute], items: "items", selectionMode: "selectionMode", selectedValues: "selectedValues", defaultSelectedValues: "defaultSelectedValues", variant: "variant", size: "size", disabled: ["disabled", "disabled", booleanAttribute], readOnly: ["readOnly", "readOnly", booleanAttribute], locale: "locale" }, outputs: { selectionChange: "selectionChange" }, host: { listeners: { "cosm-selection-change": "selectionChange.emit($event)" } }, ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
59
59
|
}
|
|
60
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: CosmListboxComponent, decorators: [{
|
|
61
61
|
type: Component,
|
|
62
62
|
args: [{
|
|
63
63
|
selector: 'cosm-listbox',
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import type { ContractProps, PaginationChangeDetail, paginationContract } from '@joralvmel/cosmos-core';
|
|
3
|
+
import type { CosmPagination } from '@joralvmel/cosmos-elements/pagination';
|
|
4
|
+
import '@joralvmel/cosmos-elements/pagination';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
type Props = ContractProps<typeof paginationContract, 'angular'>;
|
|
7
|
+
/**
|
|
8
|
+
* Pagination proxy: `<cosm-pagination label="Results" [totalPages]="10" (pageChange)="navigate($event.detail.page)" />`.
|
|
9
|
+
*/
|
|
10
|
+
export declare class CosmPaginationComponent {
|
|
11
|
+
readonly element: CosmPagination;
|
|
12
|
+
set totalPages(value: number);
|
|
13
|
+
set page(value: Props['page']);
|
|
14
|
+
set defaultPage(value: number);
|
|
15
|
+
set label(value: string);
|
|
16
|
+
set previousLabel(value: string);
|
|
17
|
+
set nextLabel(value: string);
|
|
18
|
+
set firstLabel(value: string);
|
|
19
|
+
set lastLabel(value: string);
|
|
20
|
+
set pageLabel(value: string);
|
|
21
|
+
set summaryLabel(value: string);
|
|
22
|
+
set locale(value: Props['locale']);
|
|
23
|
+
set direction(value: NonNullable<Props['direction']>);
|
|
24
|
+
set presentation(value: NonNullable<Props['presentation']>);
|
|
25
|
+
set variant(value: NonNullable<Props['variant']>);
|
|
26
|
+
set size(value: NonNullable<Props['size']>);
|
|
27
|
+
set showFirstLast(value: boolean);
|
|
28
|
+
set disabled(value: boolean);
|
|
29
|
+
readonly pageChange: EventEmitter<CustomEvent<PaginationChangeDetail>>;
|
|
30
|
+
handleChange(event: Event): void;
|
|
31
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CosmPaginationComponent, never>;
|
|
32
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CosmPaginationComponent, "cosm-pagination", never, { "totalPages": { "alias": "totalPages"; "required": true; }; "page": { "alias": "page"; "required": false; }; "defaultPage": { "alias": "defaultPage"; "required": false; }; "label": { "alias": "label"; "required": true; }; "previousLabel": { "alias": "previousLabel"; "required": false; }; "nextLabel": { "alias": "nextLabel"; "required": false; }; "firstLabel": { "alias": "firstLabel"; "required": false; }; "lastLabel": { "alias": "lastLabel"; "required": false; }; "pageLabel": { "alias": "pageLabel"; "required": false; }; "summaryLabel": { "alias": "summaryLabel"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "presentation": { "alias": "presentation"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "size": { "alias": "size"; "required": false; }; "showFirstLast": { "alias": "showFirstLast"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "pageChange": "pageChange"; }, never, ["*"], true, never>;
|
|
33
|
+
static ngAcceptInputType_showFirstLast: unknown;
|
|
34
|
+
static ngAcceptInputType_disabled: unknown;
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { booleanAttribute, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, inject, Output, } from '@angular/core';
|
|
2
|
+
import '@joralvmel/cosmos-elements/pagination';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Pagination proxy: `<cosm-pagination label="Results" [totalPages]="10" (pageChange)="navigate($event.detail.page)" />`.
|
|
6
|
+
*/
|
|
7
|
+
export class CosmPaginationComponent {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.element = inject(ElementRef).nativeElement;
|
|
10
|
+
this.pageChange = new EventEmitter();
|
|
11
|
+
}
|
|
12
|
+
set totalPages(value) {
|
|
13
|
+
this.element.totalPages = value;
|
|
14
|
+
}
|
|
15
|
+
set page(value) {
|
|
16
|
+
this.element.page = value;
|
|
17
|
+
}
|
|
18
|
+
set defaultPage(value) {
|
|
19
|
+
this.element.defaultPage = value;
|
|
20
|
+
}
|
|
21
|
+
set label(value) {
|
|
22
|
+
this.element.label = value;
|
|
23
|
+
}
|
|
24
|
+
set previousLabel(value) {
|
|
25
|
+
this.element.previousLabel = value;
|
|
26
|
+
}
|
|
27
|
+
set nextLabel(value) {
|
|
28
|
+
this.element.nextLabel = value;
|
|
29
|
+
}
|
|
30
|
+
set firstLabel(value) {
|
|
31
|
+
this.element.firstLabel = value;
|
|
32
|
+
}
|
|
33
|
+
set lastLabel(value) {
|
|
34
|
+
this.element.lastLabel = value;
|
|
35
|
+
}
|
|
36
|
+
set pageLabel(value) {
|
|
37
|
+
this.element.pageLabel = value;
|
|
38
|
+
}
|
|
39
|
+
set summaryLabel(value) {
|
|
40
|
+
this.element.summaryLabel = value;
|
|
41
|
+
}
|
|
42
|
+
set locale(value) {
|
|
43
|
+
this.element.locale = value;
|
|
44
|
+
}
|
|
45
|
+
set direction(value) {
|
|
46
|
+
this.element.direction = value;
|
|
47
|
+
}
|
|
48
|
+
set presentation(value) {
|
|
49
|
+
this.element.presentation = value;
|
|
50
|
+
}
|
|
51
|
+
set variant(value) {
|
|
52
|
+
this.element.variant = value;
|
|
53
|
+
}
|
|
54
|
+
set size(value) {
|
|
55
|
+
this.element.size = value;
|
|
56
|
+
}
|
|
57
|
+
set showFirstLast(value) {
|
|
58
|
+
this.element.showFirstLast = value;
|
|
59
|
+
}
|
|
60
|
+
set disabled(value) {
|
|
61
|
+
this.element.disabled = value;
|
|
62
|
+
}
|
|
63
|
+
handleChange(event) {
|
|
64
|
+
if (!(event instanceof CustomEvent))
|
|
65
|
+
throw new TypeError('Expected a pagination CustomEvent.');
|
|
66
|
+
const detail = event.detail;
|
|
67
|
+
if (typeof detail !== 'object' ||
|
|
68
|
+
detail === null ||
|
|
69
|
+
!('page' in detail) ||
|
|
70
|
+
typeof detail.page !== 'number' ||
|
|
71
|
+
!Number.isSafeInteger(detail.page) ||
|
|
72
|
+
detail.page < 1) {
|
|
73
|
+
throw new TypeError('Expected a pagination change with a positive integer page.');
|
|
74
|
+
}
|
|
75
|
+
this.pageChange.emit(event);
|
|
76
|
+
}
|
|
77
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: CosmPaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
78
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "22.3.0", type: CosmPaginationComponent, isStandalone: true, selector: "cosm-pagination", inputs: { totalPages: "totalPages", page: "page", defaultPage: "defaultPage", label: "label", previousLabel: "previousLabel", nextLabel: "nextLabel", firstLabel: "firstLabel", lastLabel: "lastLabel", pageLabel: "pageLabel", summaryLabel: "summaryLabel", locale: "locale", direction: "direction", presentation: "presentation", variant: "variant", size: "size", showFirstLast: ["showFirstLast", "showFirstLast", booleanAttribute], disabled: ["disabled", "disabled", booleanAttribute] }, outputs: { pageChange: "pageChange" }, host: { listeners: { "cosm-change": "handleChange($event)" } }, ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
79
|
+
}
|
|
80
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: CosmPaginationComponent, decorators: [{
|
|
81
|
+
type: Component,
|
|
82
|
+
args: [{
|
|
83
|
+
selector: 'cosm-pagination',
|
|
84
|
+
template: '<ng-content />',
|
|
85
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
86
|
+
host: { '(cosm-change)': 'handleChange($event)' },
|
|
87
|
+
}]
|
|
88
|
+
}], propDecorators: { totalPages: [{
|
|
89
|
+
type: Input,
|
|
90
|
+
args: [{ required: true }]
|
|
91
|
+
}], page: [{
|
|
92
|
+
type: Input
|
|
93
|
+
}], defaultPage: [{
|
|
94
|
+
type: Input
|
|
95
|
+
}], label: [{
|
|
96
|
+
type: Input,
|
|
97
|
+
args: [{ required: true }]
|
|
98
|
+
}], previousLabel: [{
|
|
99
|
+
type: Input
|
|
100
|
+
}], nextLabel: [{
|
|
101
|
+
type: Input
|
|
102
|
+
}], firstLabel: [{
|
|
103
|
+
type: Input
|
|
104
|
+
}], lastLabel: [{
|
|
105
|
+
type: Input
|
|
106
|
+
}], pageLabel: [{
|
|
107
|
+
type: Input
|
|
108
|
+
}], summaryLabel: [{
|
|
109
|
+
type: Input
|
|
110
|
+
}], locale: [{
|
|
111
|
+
type: Input
|
|
112
|
+
}], direction: [{
|
|
113
|
+
type: Input
|
|
114
|
+
}], presentation: [{
|
|
115
|
+
type: Input
|
|
116
|
+
}], variant: [{
|
|
117
|
+
type: Input
|
|
118
|
+
}], size: [{
|
|
119
|
+
type: Input
|
|
120
|
+
}], showFirstLast: [{
|
|
121
|
+
type: Input,
|
|
122
|
+
args: [{ transform: booleanAttribute }]
|
|
123
|
+
}], disabled: [{
|
|
124
|
+
type: Input,
|
|
125
|
+
args: [{ transform: booleanAttribute }]
|
|
126
|
+
}], pageChange: [{
|
|
127
|
+
type: Output
|
|
128
|
+
}] } });
|
|
129
|
+
//# sourceMappingURL=pagination.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.component.js","sourceRoot":"","sources":["../../src/components/pagination.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,SAAS,EACT,UAAU,EACV,YAAY,EACZ,KAAK,EACL,MAAM,EACN,MAAM,GACP,MAAM,eAAe,CAAC;AAOvB,OAAO,uCAAuC,CAAC;;AAI/C;;GAEG;AAOH,MAAM,OAAO,uBAAuB;IANpC;QAOW,YAAO,GAAmB,MAAM,CAA6B,UAAU,CAAC,CAAC,aAAa,CAAC;QAsD7E,eAAU,GAAG,IAAI,YAAY,EAAuC,CAAC;KAiBzF;IArEC,IAA+B,UAAU,CAAC,KAAa;QACrD,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,KAAK,CAAC;IAClC,CAAC;IACD,IAAa,IAAI,CAAC,KAAoB;QACpC,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC;IAC5B,CAAC;IACD,IAAa,WAAW,CAAC,KAAa;QACpC,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG,KAAK,CAAC;IACnC,CAAC;IACD,IAA+B,KAAK,CAAC,KAAa;QAChD,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IAC7B,CAAC;IACD,IAAa,aAAa,CAAC,KAAa;QACtC,IAAI,CAAC,OAAO,CAAC,aAAa,GAAG,KAAK,CAAC;IACrC,CAA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
|
|
|
23
23
|
set triggerMode(value: Props['triggerMode']);
|
|
24
24
|
set closable(value: boolean);
|
|
25
25
|
set closeLabel(value: string);
|
|
26
|
-
set gap(value: number);
|
|
27
26
|
set arrow(value: boolean);
|
|
28
27
|
set closeOnEscape(value: boolean);
|
|
29
28
|
set closeOnOutsidePress(value: boolean);
|
|
30
|
-
set initialFocus(value: boolean);
|
|
31
|
-
set restoreFocus(value: boolean);
|
|
32
29
|
set side(value: Props['side']);
|
|
33
30
|
set align(value: Props['align']);
|
|
34
|
-
set flip(value: boolean);
|
|
35
|
-
set shift(value: boolean);
|
|
36
31
|
readonly openChange: EventEmitter<CustomEvent<PopoverOpenChangeDetail>>;
|
|
37
32
|
/** Proposes an action close only while the panel is open. */
|
|
38
33
|
requestClose(): void;
|
|
39
34
|
static ɵfac: i0.ɵɵFactoryDeclaration<CosmPopoverComponent, never>;
|
|
40
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CosmPopoverComponent, "cosm-popover", never, { "open": { "alias": "open"; "required": false; }; "defaultOpen": { "alias": "defaultOpen"; "required": false; }; "triggerMode": { "alias": "triggerMode"; "required": false; }; "closable": { "alias": "closable"; "required": false; }; "closeLabel": { "alias": "closeLabel"; "required": false; }; "
|
|
35
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CosmPopoverComponent, "cosm-popover", never, { "open": { "alias": "open"; "required": false; }; "defaultOpen": { "alias": "defaultOpen"; "required": false; }; "triggerMode": { "alias": "triggerMode"; "required": false; }; "closable": { "alias": "closable"; "required": false; }; "closeLabel": { "alias": "closeLabel"; "required": false; }; "arrow": { "alias": "arrow"; "required": false; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; }; "closeOnOutsidePress": { "alias": "closeOnOutsidePress"; "required": false; }; "side": { "alias": "side"; "required": false; }; "align": { "alias": "align"; "required": false; }; }, { "openChange": "openChange"; }, never, ["*"], true, never>;
|
|
41
36
|
static ngAcceptInputType_open: unknown;
|
|
42
37
|
static ngAcceptInputType_defaultOpen: unknown;
|
|
43
38
|
static ngAcceptInputType_closable: unknown;
|
|
44
39
|
static ngAcceptInputType_arrow: unknown;
|
|
45
40
|
static ngAcceptInputType_closeOnEscape: unknown;
|
|
46
41
|
static ngAcceptInputType_closeOnOutsidePress: unknown;
|
|
47
|
-
static ngAcceptInputType_initialFocus: unknown;
|
|
48
|
-
static ngAcceptInputType_restoreFocus: unknown;
|
|
49
|
-
static ngAcceptInputType_flip: unknown;
|
|
50
|
-
static ngAcceptInputType_shift: unknown;
|
|
51
42
|
}
|
|
52
43
|
export {};
|
|
@@ -37,9 +37,6 @@ export class CosmPopoverComponent {
|
|
|
37
37
|
set closeLabel(value) {
|
|
38
38
|
this.element.closeLabel = value;
|
|
39
39
|
}
|
|
40
|
-
set gap(value) {
|
|
41
|
-
this.element.gap = value;
|
|
42
|
-
}
|
|
43
40
|
set arrow(value) {
|
|
44
41
|
this.element.arrow = value;
|
|
45
42
|
}
|
|
@@ -49,12 +46,6 @@ export class CosmPopoverComponent {
|
|
|
49
46
|
set closeOnOutsidePress(value) {
|
|
50
47
|
this.element.closeOnOutsidePress = value;
|
|
51
48
|
}
|
|
52
|
-
set initialFocus(value) {
|
|
53
|
-
this.element.initialFocus = value;
|
|
54
|
-
}
|
|
55
|
-
set restoreFocus(value) {
|
|
56
|
-
this.element.restoreFocus = value;
|
|
57
|
-
}
|
|
58
49
|
set side(value) {
|
|
59
50
|
if (value !== undefined)
|
|
60
51
|
this.element.side = value;
|
|
@@ -63,20 +54,14 @@ export class CosmPopoverComponent {
|
|
|
63
54
|
if (value !== undefined)
|
|
64
55
|
this.element.align = value;
|
|
65
56
|
}
|
|
66
|
-
set flip(value) {
|
|
67
|
-
this.element.flip = value;
|
|
68
|
-
}
|
|
69
|
-
set shift(value) {
|
|
70
|
-
this.element.shift = value;
|
|
71
|
-
}
|
|
72
57
|
/** Proposes an action close only while the panel is open. */
|
|
73
58
|
requestClose() {
|
|
74
59
|
this.element.requestClose();
|
|
75
60
|
}
|
|
76
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
77
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "22.
|
|
61
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: CosmPopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
62
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "22.3.0", type: CosmPopoverComponent, isStandalone: true, selector: "cosm-popover", inputs: { open: ["open", "open", optionalBooleanAttribute], defaultOpen: ["defaultOpen", "defaultOpen", booleanAttribute], triggerMode: "triggerMode", closable: ["closable", "closable", booleanAttribute], closeLabel: "closeLabel", arrow: ["arrow", "arrow", booleanAttribute], closeOnEscape: ["closeOnEscape", "closeOnEscape", booleanAttribute], closeOnOutsidePress: ["closeOnOutsidePress", "closeOnOutsidePress", booleanAttribute], side: "side", align: "align" }, outputs: { openChange: "openChange" }, host: { listeners: { "cosm-open-change": "openChange.emit($event)" } }, ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
78
63
|
}
|
|
79
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: CosmPopoverComponent, decorators: [{
|
|
80
65
|
type: Component,
|
|
81
66
|
args: [{
|
|
82
67
|
selector: 'cosm-popover',
|
|
@@ -97,8 +82,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.6", ngImpor
|
|
|
97
82
|
args: [{ transform: booleanAttribute }]
|
|
98
83
|
}], closeLabel: [{
|
|
99
84
|
type: Input
|
|
100
|
-
}], gap: [{
|
|
101
|
-
type: Input
|
|
102
85
|
}], arrow: [{
|
|
103
86
|
type: Input,
|
|
104
87
|
args: [{ transform: booleanAttribute }]
|
|
@@ -108,22 +91,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.6", ngImpor
|
|
|
108
91
|
}], closeOnOutsidePress: [{
|
|
109
92
|
type: Input,
|
|
110
93
|
args: [{ transform: booleanAttribute }]
|
|
111
|
-
}], initialFocus: [{
|
|
112
|
-
type: Input,
|
|
113
|
-
args: [{ transform: booleanAttribute }]
|
|
114
|
-
}], restoreFocus: [{
|
|
115
|
-
type: Input,
|
|
116
|
-
args: [{ transform: booleanAttribute }]
|
|
117
94
|
}], side: [{
|
|
118
95
|
type: Input
|
|
119
96
|
}], align: [{
|
|
120
97
|
type: Input
|
|
121
|
-
}], flip: [{
|
|
122
|
-
type: Input,
|
|
123
|
-
args: [{ transform: booleanAttribute }]
|
|
124
|
-
}], shift: [{
|
|
125
|
-
type: Input,
|
|
126
|
-
args: [{ transform: booleanAttribute }]
|
|
127
98
|
}], openChange: [{
|
|
128
99
|
type: Output
|
|
129
100
|
}] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.component.js","sourceRoot":"","sources":["../../src/components/popover.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,SAAS,EACT,UAAU,EACV,YAAY,EACZ,KAAK,EACL,MAAM,EACN,MAAM,GACP,MAAM,eAAe,CAAC;AAOvB,OAAO,oCAAoC,CAAC;;AAI5C,SAAS,wBAAwB,CAAC,KAAc;IAC9C,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;AACnE,CAAC;AAED;;;;;;;;;;GAUG;AAOH,MAAM,OAAO,oBAAoB;IANjC;QAOE,4EAA4E;QACnE,YAAO,GAAgB,MAAM,CAA0B,UAAU,CAAC,CAAC,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"popover.component.js","sourceRoot":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@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { type ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import type { ContractProps, RadioGroupChangeDetail, RadioGroupReferences, radioGroupContract } from '@joralvmel/cosmos-core';
|
|
4
|
+
import type { CosmRadioGroup } from '@joralvmel/cosmos-elements/radio-group';
|
|
5
|
+
import '@joralvmel/cosmos-elements/radio-group';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
type Props = ContractProps<typeof radioGroupContract, 'angular', RadioGroupReferences>;
|
|
8
|
+
/**
|
|
9
|
+
* Angular proxy of `<cosm-radio-group>`. DOM outputs forward the original `CustomEvent`; Forms
|
|
10
|
+
* integrates through `ControlValueAccessor` with a string-or-null value.
|
|
11
|
+
*
|
|
12
|
+
* ```html
|
|
13
|
+
* <cosm-radio-group
|
|
14
|
+
* label="Contact method"
|
|
15
|
+
* [options]="contactMethods"
|
|
16
|
+
* formControlName="contactMethod"
|
|
17
|
+
* />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare class CosmRadioGroupComponent implements ControlValueAccessor {
|
|
21
|
+
#private;
|
|
22
|
+
readonly element: CosmRadioGroup;
|
|
23
|
+
set label(value: Props['label']);
|
|
24
|
+
set options(value: Props['options']);
|
|
25
|
+
/** A direct value input is controlled; Angular Forms writes use `writeValue` instead. */
|
|
26
|
+
set value(value: Props['value']);
|
|
27
|
+
set defaultValue(value: Props['defaultValue']);
|
|
28
|
+
set orientation(value: Props['orientation']);
|
|
29
|
+
set size(value: Props['size']);
|
|
30
|
+
set disabled(value: boolean);
|
|
31
|
+
set required(value: boolean);
|
|
32
|
+
set invalid(value: boolean);
|
|
33
|
+
set helperText(value: Props['helperText']);
|
|
34
|
+
set errorText(value: Props['errorText']);
|
|
35
|
+
set name(value: Props['name']);
|
|
36
|
+
readonly valueChange: EventEmitter<CustomEvent<RadioGroupChangeDetail>>;
|
|
37
|
+
handleChange(event: CustomEvent<RadioGroupChangeDetail>): void;
|
|
38
|
+
markTouched(): void;
|
|
39
|
+
writeValue(value: string | null | undefined): void;
|
|
40
|
+
registerOnChange(fn: (value: string | null) => void): void;
|
|
41
|
+
registerOnTouched(fn: () => void): void;
|
|
42
|
+
setDisabledState(isDisabled: boolean): void;
|
|
43
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CosmRadioGroupComponent, never>;
|
|
44
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CosmRadioGroupComponent, "cosm-radio-group", never, { "label": { "alias": "label"; "required": true; }; "options": { "alias": "options"; "required": true; }; "value": { "alias": "value"; "required": false; }; "defaultValue": { "alias": "defaultValue"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; "size": { "alias": "size"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "required": { "alias": "required"; "required": false; }; "invalid": { "alias": "invalid"; "required": false; }; "helperText": { "alias": "helperText"; "required": false; }; "errorText": { "alias": "errorText"; "required": false; }; "name": { "alias": "name"; "required": false; }; }, { "valueChange": "valueChange"; }, never, ["*"], true, never>;
|
|
45
|
+
static ngAcceptInputType_disabled: unknown;
|
|
46
|
+
static ngAcceptInputType_required: unknown;
|
|
47
|
+
static ngAcceptInputType_invalid: unknown;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { booleanAttribute, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, forwardRef, Input, inject, Output, } from '@angular/core';
|
|
2
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
3
|
+
import '@joralvmel/cosmos-elements/radio-group';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Angular proxy of `<cosm-radio-group>`. DOM outputs forward the original `CustomEvent`; Forms
|
|
7
|
+
* integrates through `ControlValueAccessor` with a string-or-null value.
|
|
8
|
+
*
|
|
9
|
+
* ```html
|
|
10
|
+
* <cosm-radio-group
|
|
11
|
+
* label="Contact method"
|
|
12
|
+
* [options]="contactMethods"
|
|
13
|
+
* formControlName="contactMethod"
|
|
14
|
+
* />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export class CosmRadioGroupComponent {
|
|
18
|
+
constructor() {
|
|
19
|
+
this.element = inject(ElementRef).nativeElement;
|
|
20
|
+
this.#onChange = () => { };
|
|
21
|
+
this.#onTouched = () => { };
|
|
22
|
+
this.valueChange = new EventEmitter();
|
|
23
|
+
}
|
|
24
|
+
#onChange;
|
|
25
|
+
#onTouched;
|
|
26
|
+
set label(value) {
|
|
27
|
+
this.element.label = value;
|
|
28
|
+
}
|
|
29
|
+
set options(value) {
|
|
30
|
+
this.element.options = value;
|
|
31
|
+
}
|
|
32
|
+
/** A direct value input is controlled; Angular Forms writes use `writeValue` instead. */
|
|
33
|
+
set value(value) {
|
|
34
|
+
this.element.valueControlled = value !== undefined;
|
|
35
|
+
if (value !== undefined)
|
|
36
|
+
this.element.value = value;
|
|
37
|
+
}
|
|
38
|
+
set defaultValue(value) {
|
|
39
|
+
if (value !== undefined)
|
|
40
|
+
this.element.defaultValue = value;
|
|
41
|
+
}
|
|
42
|
+
set orientation(value) {
|
|
43
|
+
if (value !== undefined)
|
|
44
|
+
this.element.orientation = value;
|
|
45
|
+
}
|
|
46
|
+
set size(value) {
|
|
47
|
+
this.element.size = value ?? 'md';
|
|
48
|
+
}
|
|
49
|
+
set disabled(value) {
|
|
50
|
+
this.element.disabled = value;
|
|
51
|
+
}
|
|
52
|
+
set required(value) {
|
|
53
|
+
this.element.required = value;
|
|
54
|
+
}
|
|
55
|
+
set invalid(value) {
|
|
56
|
+
this.element.invalid = value;
|
|
57
|
+
}
|
|
58
|
+
set helperText(value) {
|
|
59
|
+
this.element.helperText = value ?? '';
|
|
60
|
+
}
|
|
61
|
+
set errorText(value) {
|
|
62
|
+
this.element.errorText = value ?? '';
|
|
63
|
+
}
|
|
64
|
+
set name(value) {
|
|
65
|
+
this.element.name = value;
|
|
66
|
+
}
|
|
67
|
+
handleChange(event) {
|
|
68
|
+
this.valueChange.emit(event);
|
|
69
|
+
this.#onChange(event.detail.value);
|
|
70
|
+
}
|
|
71
|
+
markTouched() {
|
|
72
|
+
this.#onTouched();
|
|
73
|
+
}
|
|
74
|
+
writeValue(value) {
|
|
75
|
+
this.element.value = value ?? null;
|
|
76
|
+
this.element.valueControlled = false;
|
|
77
|
+
}
|
|
78
|
+
registerOnChange(fn) {
|
|
79
|
+
this.#onChange = fn;
|
|
80
|
+
}
|
|
81
|
+
registerOnTouched(fn) {
|
|
82
|
+
this.#onTouched = fn;
|
|
83
|
+
}
|
|
84
|
+
setDisabledState(isDisabled) {
|
|
85
|
+
this.element.disabled = isDisabled;
|
|
86
|
+
}
|
|
87
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: CosmRadioGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
88
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "22.3.0", type: CosmRadioGroupComponent, isStandalone: true, selector: "cosm-radio-group", inputs: { label: "label", options: "options", value: "value", defaultValue: "defaultValue", orientation: "orientation", size: "size", disabled: ["disabled", "disabled", booleanAttribute], required: ["required", "required", booleanAttribute], invalid: ["invalid", "invalid", booleanAttribute], helperText: "helperText", errorText: "errorText", name: "name" }, outputs: { valueChange: "valueChange" }, host: { listeners: { "cosm-change": "handleChange($event)", "focusout": "markTouched()" } }, providers: [
|
|
89
|
+
{
|
|
90
|
+
provide: NG_VALUE_ACCESSOR,
|
|
91
|
+
useExisting: forwardRef(() => CosmRadioGroupComponent),
|
|
92
|
+
multi: true,
|
|
93
|
+
},
|
|
94
|
+
], ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
95
|
+
}
|
|
96
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: CosmRadioGroupComponent, decorators: [{
|
|
97
|
+
type: Component,
|
|
98
|
+
args: [{
|
|
99
|
+
selector: 'cosm-radio-group',
|
|
100
|
+
template: '<ng-content />',
|
|
101
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
102
|
+
providers: [
|
|
103
|
+
{
|
|
104
|
+
provide: NG_VALUE_ACCESSOR,
|
|
105
|
+
useExisting: forwardRef(() => CosmRadioGroupComponent),
|
|
106
|
+
multi: true,
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
host: {
|
|
110
|
+
'(cosm-change)': 'handleChange($event)',
|
|
111
|
+
'(focusout)': 'markTouched()',
|
|
112
|
+
},
|
|
113
|
+
}]
|
|
114
|
+
}], propDecorators: { label: [{
|
|
115
|
+
type: Input,
|
|
116
|
+
args: [{ required: true }]
|
|
117
|
+
}], options: [{
|
|
118
|
+
type: Input,
|
|
119
|
+
args: [{ required: true }]
|
|
120
|
+
}], value: [{
|
|
121
|
+
type: Input
|
|
122
|
+
}], defaultValue: [{
|
|
123
|
+
type: Input
|
|
124
|
+
}], orientation: [{
|
|
125
|
+
type: Input
|
|
126
|
+
}], size: [{
|
|
127
|
+
type: Input
|
|
128
|
+
}], disabled: [{
|
|
129
|
+
type: Input,
|
|
130
|
+
args: [{ transform: booleanAttribute }]
|
|
131
|
+
}], required: [{
|
|
132
|
+
type: Input,
|
|
133
|
+
args: [{ transform: booleanAttribute }]
|
|
134
|
+
}], invalid: [{
|
|
135
|
+
type: Input,
|
|
136
|
+
args: [{ transform: booleanAttribute }]
|
|
137
|
+
}], helperText: [{
|
|
138
|
+
type: Input
|
|
139
|
+
}], errorText: [{
|
|
140
|
+
type: Input
|
|
141
|
+
}], name: [{
|
|
142
|
+
type: Input
|
|
143
|
+
}], valueChange: [{
|
|
144
|
+
type: Output
|
|
145
|
+
}] } });
|
|
146
|
+
//# sourceMappingURL=radio-group.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group.component.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