@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
package/README.md
CHANGED
|
@@ -50,10 +50,13 @@ export class EmailComponent {
|
|
|
50
50
|
Reactive Forms handles programmatic writes, touched/disabled state, reset and the configured
|
|
51
51
|
`updateOn` strategy.
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
`cosm-textarea` provides the same `ControlValueAccessor` integration for multiline messages. Its
|
|
54
|
+
`(valueChange)` output re-emits the original `CustomEvent`; use `$event.detail.value` when handling
|
|
55
|
+
the proposal directly.
|
|
56
|
+
|
|
57
|
+
For independent decorative icon colors, use CSS classes or Angular style bindings with
|
|
58
|
+
`--cosm-text-field-start-icon-color` and `--cosm-text-field-end-icon-color`. They do not recolor
|
|
59
|
+
affixes or actions.
|
|
57
60
|
|
|
58
61
|
## License
|
|
59
62
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BadgeSize, BadgeTone, BadgeVariant, CosmBadge } from '@joralvmel/cosmos-elements/badge';
|
|
2
|
+
import type { IconDefinition } from '@joralvmel/cosmos-icons';
|
|
3
|
+
import '@joralvmel/cosmos-elements/badge';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Angular proxy of `<cosm-badge>`.
|
|
7
|
+
*
|
|
8
|
+
* ```html
|
|
9
|
+
* <cosm-badge tone="success">Ready</cosm-badge>
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export declare class CosmBadgeComponent {
|
|
13
|
+
readonly element: CosmBadge;
|
|
14
|
+
set variant(value: BadgeVariant);
|
|
15
|
+
set tone(value: BadgeTone);
|
|
16
|
+
set size(value: BadgeSize);
|
|
17
|
+
set startIcon(value: IconDefinition | undefined);
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CosmBadgeComponent, never>;
|
|
19
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CosmBadgeComponent, "cosm-badge", never, { "variant": { "alias": "variant"; "required": false; }; "tone": { "alias": "tone"; "required": false; }; "size": { "alias": "size"; "required": false; }; "startIcon": { "alias": "startIcon"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, ElementRef, Input, inject } from '@angular/core';
|
|
2
|
+
import '@joralvmel/cosmos-elements/badge';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Angular proxy of `<cosm-badge>`.
|
|
6
|
+
*
|
|
7
|
+
* ```html
|
|
8
|
+
* <cosm-badge tone="success">Ready</cosm-badge>
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export class CosmBadgeComponent {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.element = inject(ElementRef).nativeElement;
|
|
14
|
+
}
|
|
15
|
+
set variant(value) {
|
|
16
|
+
this.element.variant = value;
|
|
17
|
+
}
|
|
18
|
+
set tone(value) {
|
|
19
|
+
this.element.tone = value;
|
|
20
|
+
}
|
|
21
|
+
set size(value) {
|
|
22
|
+
this.element.size = value;
|
|
23
|
+
}
|
|
24
|
+
set startIcon(value) {
|
|
25
|
+
this.element.startIcon = value;
|
|
26
|
+
}
|
|
27
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: CosmBadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
28
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.3.0", type: CosmBadgeComponent, isStandalone: true, selector: "cosm-badge", inputs: { variant: "variant", tone: "tone", size: "size", startIcon: "startIcon" }, ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
29
|
+
}
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: CosmBadgeComponent, decorators: [{
|
|
31
|
+
type: Component,
|
|
32
|
+
args: [{
|
|
33
|
+
selector: 'cosm-badge',
|
|
34
|
+
template: '<ng-content />',
|
|
35
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
36
|
+
}]
|
|
37
|
+
}], propDecorators: { variant: [{
|
|
38
|
+
type: Input
|
|
39
|
+
}], tone: [{
|
|
40
|
+
type: Input
|
|
41
|
+
}], size: [{
|
|
42
|
+
type: Input
|
|
43
|
+
}], startIcon: [{
|
|
44
|
+
type: Input
|
|
45
|
+
}] } });
|
|
46
|
+
//# sourceMappingURL=badge.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.component.js","sourceRoot":"","sources":["../../src/components/badge.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAQ9F,OAAO,kCAAkC,CAAC;;AAE1C;;;;;;GAMG;AAMH,MAAM,OAAO,kBAAkB;IAL/B;QAMW,YAAO,GAAc,MAAM,CAAwB,UAAU,CAAC,CAAC,aAAa,CAAC;KAiBvF;IAfC,IAAa,OAAO,CAAC,KAAmB;QACtC,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;IAC/B,CAAC;IAED,IAAa,IAAI,CAAC,KAAgB;QAChC,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC;IAC5B,CAAC;IAED,IAAa,IAAI,CAAC,KAAgB;QAChC,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC;IAC5B,CAAC;IAED,IAAa,SAAS,CAAC,KAAiC;QACtD,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC;IACjC,CAAC;8GAjBU,kBAAkB;kGAAlB,kBAAkB,0JAHnB,gBAAgB;;2FAGf,kBAAkB;kBAL9B,SAAS;mBAAC;oBACT,QAAQ,EAAE,YAAY;oBACtB,QAAQ,EAAE,gBAAgB;oBAC1B,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;;sBAIE,KAAK;;sBAIL,KAAK;;sBAIL,KAAK;;sBAIL,KAAK"}
|
|
@@ -39,10 +39,10 @@ export class CosmButtonComponent {
|
|
|
39
39
|
set label(value) {
|
|
40
40
|
this.element.label = value;
|
|
41
41
|
}
|
|
42
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
43
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "22.
|
|
42
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: CosmButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
43
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "22.3.0", type: CosmButtonComponent, isStandalone: true, selector: "cosm-button", inputs: { variant: "variant", tone: "tone", size: "size", disabled: ["disabled", "disabled", booleanAttribute], loading: ["loading", "loading", booleanAttribute], fullWidth: ["fullWidth", "fullWidth", booleanAttribute], type: "type", label: "label" }, outputs: { press: "press" }, host: { listeners: { "cosm-press": "press.emit($event)" } }, ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
44
44
|
}
|
|
45
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: CosmButtonComponent, decorators: [{
|
|
46
46
|
type: Component,
|
|
47
47
|
args: [{
|
|
48
48
|
selector: 'cosm-button',
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import type { CalendarChangeDetail, ContractProps, calendarContract } from '@joralvmel/cosmos-core';
|
|
3
|
+
import type { CosmCalendar } from '@joralvmel/cosmos-elements/calendar';
|
|
4
|
+
import '@joralvmel/cosmos-elements/calendar';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
type Props = ContractProps<typeof calendarContract, 'angular'>;
|
|
7
|
+
/**
|
|
8
|
+
* Angular proxy of `<cosm-calendar>`.
|
|
9
|
+
*
|
|
10
|
+
* ```html
|
|
11
|
+
* <cosm-calendar [value]="selectedDate" (valueChange)="selectedDate = $event.detail.value" />
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare class CosmCalendarComponent {
|
|
15
|
+
/** The underlying custom element. */
|
|
16
|
+
readonly element: CosmCalendar;
|
|
17
|
+
set value(value: Props['value']);
|
|
18
|
+
set defaultValue(value: Props['defaultValue']);
|
|
19
|
+
set min(value: Props['min']);
|
|
20
|
+
set max(value: Props['max']);
|
|
21
|
+
set locale(value: Props['locale']);
|
|
22
|
+
set disabled(value: boolean);
|
|
23
|
+
readonly valueChange: EventEmitter<CustomEvent<CalendarChangeDetail>>;
|
|
24
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CosmCalendarComponent, never>;
|
|
25
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CosmCalendarComponent, "cosm-calendar", never, { "value": { "alias": "value"; "required": false; }; "defaultValue": { "alias": "defaultValue"; "required": false; }; "min": { "alias": "min"; "required": false; }; "max": { "alias": "max"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "valueChange": "valueChange"; }, never, ["*"], true, never>;
|
|
26
|
+
static ngAcceptInputType_disabled: unknown;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { booleanAttribute, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, inject, Output, } from '@angular/core';
|
|
2
|
+
import '@joralvmel/cosmos-elements/calendar';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Angular proxy of `<cosm-calendar>`.
|
|
6
|
+
*
|
|
7
|
+
* ```html
|
|
8
|
+
* <cosm-calendar [value]="selectedDate" (valueChange)="selectedDate = $event.detail.value" />
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export class CosmCalendarComponent {
|
|
12
|
+
constructor() {
|
|
13
|
+
/** The underlying custom element. */
|
|
14
|
+
this.element = inject(ElementRef).nativeElement;
|
|
15
|
+
this.valueChange = new EventEmitter();
|
|
16
|
+
}
|
|
17
|
+
set value(value) {
|
|
18
|
+
this.element.valueControlled = value !== undefined;
|
|
19
|
+
this.element.value = value;
|
|
20
|
+
}
|
|
21
|
+
set defaultValue(value) {
|
|
22
|
+
this.element.defaultValue = value;
|
|
23
|
+
}
|
|
24
|
+
set min(value) {
|
|
25
|
+
this.element.min = value;
|
|
26
|
+
}
|
|
27
|
+
set max(value) {
|
|
28
|
+
this.element.max = value;
|
|
29
|
+
}
|
|
30
|
+
set locale(value) {
|
|
31
|
+
this.element.locale = value;
|
|
32
|
+
}
|
|
33
|
+
set disabled(value) {
|
|
34
|
+
this.element.disabled = value;
|
|
35
|
+
}
|
|
36
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: CosmCalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
37
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "22.3.0", type: CosmCalendarComponent, isStandalone: true, selector: "cosm-calendar", inputs: { value: "value", defaultValue: "defaultValue", min: "min", max: "max", locale: "locale", disabled: ["disabled", "disabled", booleanAttribute] }, outputs: { valueChange: "valueChange" }, host: { listeners: { "cosm-change": "valueChange.emit($event)" } }, ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
38
|
+
}
|
|
39
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: CosmCalendarComponent, decorators: [{
|
|
40
|
+
type: Component,
|
|
41
|
+
args: [{
|
|
42
|
+
selector: 'cosm-calendar',
|
|
43
|
+
template: '<ng-content />',
|
|
44
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
45
|
+
host: {
|
|
46
|
+
'(cosm-change)': 'valueChange.emit($event)',
|
|
47
|
+
},
|
|
48
|
+
}]
|
|
49
|
+
}], propDecorators: { value: [{
|
|
50
|
+
type: Input
|
|
51
|
+
}], defaultValue: [{
|
|
52
|
+
type: Input
|
|
53
|
+
}], min: [{
|
|
54
|
+
type: Input
|
|
55
|
+
}], max: [{
|
|
56
|
+
type: Input
|
|
57
|
+
}], locale: [{
|
|
58
|
+
type: Input
|
|
59
|
+
}], disabled: [{
|
|
60
|
+
type: Input,
|
|
61
|
+
args: [{ transform: booleanAttribute }]
|
|
62
|
+
}], valueChange: [{
|
|
63
|
+
type: Output
|
|
64
|
+
}] } });
|
|
65
|
+
//# sourceMappingURL=calendar.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.component.js","sourceRoot":"","sources":["../../src/components/calendar.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;AAGvB,OAAO,qCAAqC,CAAC;;AAI7C;;;;;;GAMG;AASH,MAAM,OAAO,qBAAqB;IARlC;QASE,qCAAqC;QAC5B,YAAO,GAAiB,MAAM,CAA2B,UAAU,CAAC,CAAC,aAAa,CAAC;QAsBzE,gBAAW,GAAG,IAAI,YAAY,EAAqC,CAAC;KACxF;IArBC,IAAa,KAAK,CAAC,KAAqB;QACtC,IAAI,CAAC,OAAO,CAAC,eAAe,GAAG,KAAK,KAAK,SAAS,CAAC;QACnD,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IAC7B,CAAC;IACD,IAAa,YAAY,CAAC,KAA4B;QACpD,IAAI,CAAC,OAAO,CAAC,YAAY,GAAG,KAAK,CAAC;IACpC,CAAC;IACD,IAAa,GAAG,CAAC,KAAmB;QAClC,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC;IAC3B,CAAC;IACD,IAAa,GAAG,CAAC,KAAmB;QAClC,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC;IAC3B,CAAC;IACD,IAAa,MAAM,CAAC,KAAsB;QACxC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC;IAC9B,CAAC;IACD,IAA4C,QAAQ,CAAC,KAAc;QACjE,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAC;IAChC,CAAC;8GAtBU,qBAAqB;kGAArB,qBAAqB,sLAoBZ,gBAAgB,0IA1B1B,gBAAgB;;2FAMf,qBAAqB;kBARjC,SAAS;mBAAC;oBACT,QAAQ,EAAE,eAAe;oBACzB,QAAQ,EAAE,gBAAgB;oBAC1B,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,IAAI,EAAE;wBACJ,eAAe,EAAE,0BAA0B;qBAC5C;iBACF;;sBAKE,KAAK;;sBAIL,KAAK;;sBAGL,KAAK;;sBAGL,KAAK;;sBAGL,KAAK;;sBAGL,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;;sBAIrC,MAAM"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { type ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import type { CheckboxCheckedChangeDetail, checkboxContract } from '@joralvmel/cosmos-core';
|
|
4
|
+
import type { CosmCheckbox } from '@joralvmel/cosmos-elements/checkbox';
|
|
5
|
+
import '@joralvmel/cosmos-elements/checkbox';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
type Props = import('@joralvmel/cosmos-core').ContractProps<typeof checkboxContract, 'angular'>;
|
|
8
|
+
/**
|
|
9
|
+
* Angular proxy of `<cosm-checkbox>`. The output forwards the original DOM `CustomEvent`; Forms
|
|
10
|
+
* integrates through `ControlValueAccessor` with a boolean value.
|
|
11
|
+
*
|
|
12
|
+
* ```html
|
|
13
|
+
* <cosm-checkbox label="Accept terms" formControlName="accepted" />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare class CosmCheckboxComponent implements ControlValueAccessor {
|
|
17
|
+
#private;
|
|
18
|
+
/** The underlying custom element. */
|
|
19
|
+
readonly element: CosmCheckbox;
|
|
20
|
+
set label(value: Props['label']);
|
|
21
|
+
set labelHidden(value: boolean);
|
|
22
|
+
/** A direct checked input is controlled; Angular Forms writes use `writeValue`. */
|
|
23
|
+
set checked(value: Props['checked']);
|
|
24
|
+
set defaultChecked(value: boolean);
|
|
25
|
+
set indeterminate(value: boolean);
|
|
26
|
+
set size(value: Props['size']);
|
|
27
|
+
set disabled(value: boolean);
|
|
28
|
+
set required(value: boolean);
|
|
29
|
+
set invalid(value: boolean);
|
|
30
|
+
set helperText(value: Props['helperText']);
|
|
31
|
+
set errorText(value: Props['errorText']);
|
|
32
|
+
set name(value: Props['name']);
|
|
33
|
+
set value(value: Props['value']);
|
|
34
|
+
readonly checkedChange: EventEmitter<CustomEvent<CheckboxCheckedChangeDetail>>;
|
|
35
|
+
/** Re-emits the original event and feeds its proposal into Angular Forms. */
|
|
36
|
+
handleChange(event: CustomEvent<CheckboxCheckedChangeDetail>): void;
|
|
37
|
+
/** Marks the control touched when it loses focus. */
|
|
38
|
+
markTouched(): void;
|
|
39
|
+
writeValue(value: boolean | null | undefined): void;
|
|
40
|
+
registerOnChange(fn: (value: boolean) => void): void;
|
|
41
|
+
registerOnTouched(fn: () => void): void;
|
|
42
|
+
setDisabledState(isDisabled: boolean): void;
|
|
43
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CosmCheckboxComponent, never>;
|
|
44
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CosmCheckboxComponent, "cosm-checkbox", never, { "label": { "alias": "label"; "required": true; }; "labelHidden": { "alias": "labelHidden"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "defaultChecked": { "alias": "defaultChecked"; "required": false; }; "indeterminate": { "alias": "indeterminate"; "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; }; "value": { "alias": "value"; "required": false; }; }, { "checkedChange": "checkedChange"; }, never, ["*"], true, never>;
|
|
45
|
+
static ngAcceptInputType_labelHidden: unknown;
|
|
46
|
+
static ngAcceptInputType_defaultChecked: unknown;
|
|
47
|
+
static ngAcceptInputType_indeterminate: unknown;
|
|
48
|
+
static ngAcceptInputType_disabled: unknown;
|
|
49
|
+
static ngAcceptInputType_required: unknown;
|
|
50
|
+
static ngAcceptInputType_invalid: unknown;
|
|
51
|
+
}
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,152 @@
|
|
|
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/checkbox';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Angular proxy of `<cosm-checkbox>`. The output forwards the original DOM `CustomEvent`; Forms
|
|
7
|
+
* integrates through `ControlValueAccessor` with a boolean value.
|
|
8
|
+
*
|
|
9
|
+
* ```html
|
|
10
|
+
* <cosm-checkbox label="Accept terms" formControlName="accepted" />
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export class CosmCheckboxComponent {
|
|
14
|
+
constructor() {
|
|
15
|
+
/** The underlying custom element. */
|
|
16
|
+
this.element = inject(ElementRef).nativeElement;
|
|
17
|
+
this.#onChange = () => { };
|
|
18
|
+
this.#onTouched = () => { };
|
|
19
|
+
this.checkedChange = new EventEmitter();
|
|
20
|
+
}
|
|
21
|
+
#onChange;
|
|
22
|
+
#onTouched;
|
|
23
|
+
set label(value) {
|
|
24
|
+
this.element.label = value;
|
|
25
|
+
}
|
|
26
|
+
set labelHidden(value) {
|
|
27
|
+
this.element.labelHidden = value;
|
|
28
|
+
}
|
|
29
|
+
/** A direct checked input is controlled; Angular Forms writes use `writeValue`. */
|
|
30
|
+
set checked(value) {
|
|
31
|
+
if (value !== undefined)
|
|
32
|
+
this.element.checked = value;
|
|
33
|
+
this.element.checkedControlled = true;
|
|
34
|
+
}
|
|
35
|
+
set defaultChecked(value) {
|
|
36
|
+
this.element.defaultChecked = value;
|
|
37
|
+
}
|
|
38
|
+
set indeterminate(value) {
|
|
39
|
+
this.element.indeterminate = value;
|
|
40
|
+
}
|
|
41
|
+
set size(value) {
|
|
42
|
+
if (value !== undefined)
|
|
43
|
+
this.element.size = value;
|
|
44
|
+
}
|
|
45
|
+
set disabled(value) {
|
|
46
|
+
this.element.disabled = value;
|
|
47
|
+
}
|
|
48
|
+
set required(value) {
|
|
49
|
+
this.element.required = value;
|
|
50
|
+
}
|
|
51
|
+
set invalid(value) {
|
|
52
|
+
this.element.invalid = value;
|
|
53
|
+
}
|
|
54
|
+
set helperText(value) {
|
|
55
|
+
this.element.helperText = value ?? '';
|
|
56
|
+
}
|
|
57
|
+
set errorText(value) {
|
|
58
|
+
this.element.errorText = value ?? '';
|
|
59
|
+
}
|
|
60
|
+
set name(value) {
|
|
61
|
+
this.element.name = value;
|
|
62
|
+
}
|
|
63
|
+
set value(value) {
|
|
64
|
+
if (value !== undefined)
|
|
65
|
+
this.element.value = value;
|
|
66
|
+
}
|
|
67
|
+
/** Re-emits the original event and feeds its proposal into Angular Forms. */
|
|
68
|
+
handleChange(event) {
|
|
69
|
+
this.checkedChange.emit(event);
|
|
70
|
+
this.#onChange(event.detail.checked);
|
|
71
|
+
}
|
|
72
|
+
/** Marks the control touched when it loses focus. */
|
|
73
|
+
markTouched() {
|
|
74
|
+
this.#onTouched();
|
|
75
|
+
}
|
|
76
|
+
writeValue(value) {
|
|
77
|
+
this.element.checked = value === true;
|
|
78
|
+
this.element.checkedControlled = false;
|
|
79
|
+
}
|
|
80
|
+
registerOnChange(fn) {
|
|
81
|
+
this.#onChange = fn;
|
|
82
|
+
}
|
|
83
|
+
registerOnTouched(fn) {
|
|
84
|
+
this.#onTouched = fn;
|
|
85
|
+
}
|
|
86
|
+
setDisabledState(isDisabled) {
|
|
87
|
+
this.element.disabled = isDisabled;
|
|
88
|
+
}
|
|
89
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: CosmCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
90
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "22.3.0", type: CosmCheckboxComponent, isStandalone: true, selector: "cosm-checkbox", inputs: { label: "label", labelHidden: ["labelHidden", "labelHidden", booleanAttribute], checked: "checked", defaultChecked: ["defaultChecked", "defaultChecked", booleanAttribute], indeterminate: ["indeterminate", "indeterminate", booleanAttribute], size: "size", disabled: ["disabled", "disabled", booleanAttribute], required: ["required", "required", booleanAttribute], invalid: ["invalid", "invalid", booleanAttribute], helperText: "helperText", errorText: "errorText", name: "name", value: "value" }, outputs: { checkedChange: "checkedChange" }, host: { listeners: { "cosm-checked-change": "handleChange($event)", "focusout": "markTouched()" } }, providers: [
|
|
91
|
+
{
|
|
92
|
+
provide: NG_VALUE_ACCESSOR,
|
|
93
|
+
useExisting: forwardRef(() => CosmCheckboxComponent),
|
|
94
|
+
multi: true,
|
|
95
|
+
},
|
|
96
|
+
], ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
97
|
+
}
|
|
98
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: CosmCheckboxComponent, decorators: [{
|
|
99
|
+
type: Component,
|
|
100
|
+
args: [{
|
|
101
|
+
selector: 'cosm-checkbox',
|
|
102
|
+
template: '<ng-content />',
|
|
103
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
104
|
+
providers: [
|
|
105
|
+
{
|
|
106
|
+
provide: NG_VALUE_ACCESSOR,
|
|
107
|
+
useExisting: forwardRef(() => CosmCheckboxComponent),
|
|
108
|
+
multi: true,
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
host: {
|
|
112
|
+
'(cosm-checked-change)': 'handleChange($event)',
|
|
113
|
+
'(focusout)': 'markTouched()',
|
|
114
|
+
},
|
|
115
|
+
}]
|
|
116
|
+
}], propDecorators: { label: [{
|
|
117
|
+
type: Input,
|
|
118
|
+
args: [{ required: true }]
|
|
119
|
+
}], labelHidden: [{
|
|
120
|
+
type: Input,
|
|
121
|
+
args: [{ transform: booleanAttribute }]
|
|
122
|
+
}], checked: [{
|
|
123
|
+
type: Input
|
|
124
|
+
}], defaultChecked: [{
|
|
125
|
+
type: Input,
|
|
126
|
+
args: [{ transform: booleanAttribute }]
|
|
127
|
+
}], indeterminate: [{
|
|
128
|
+
type: Input,
|
|
129
|
+
args: [{ transform: booleanAttribute }]
|
|
130
|
+
}], size: [{
|
|
131
|
+
type: Input
|
|
132
|
+
}], disabled: [{
|
|
133
|
+
type: Input,
|
|
134
|
+
args: [{ transform: booleanAttribute }]
|
|
135
|
+
}], required: [{
|
|
136
|
+
type: Input,
|
|
137
|
+
args: [{ transform: booleanAttribute }]
|
|
138
|
+
}], invalid: [{
|
|
139
|
+
type: Input,
|
|
140
|
+
args: [{ transform: booleanAttribute }]
|
|
141
|
+
}], helperText: [{
|
|
142
|
+
type: Input
|
|
143
|
+
}], errorText: [{
|
|
144
|
+
type: Input
|
|
145
|
+
}], name: [{
|
|
146
|
+
type: Input
|
|
147
|
+
}], value: [{
|
|
148
|
+
type: Input
|
|
149
|
+
}], checkedChange: [{
|
|
150
|
+
type: Output
|
|
151
|
+
}] } });
|
|
152
|
+
//# sourceMappingURL=checkbox.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.component.js","sourceRoot":"","sources":["../../src/components/checkbox.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,SAAS,EACT,UAAU,EACV,YAAY,EACZ,UAAU,EACV,KAAK,EACL,MAAM,EACN,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAA6B,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAG9E,OAAO,qCAAqC,CAAC;;AAI7C;;;;;;;GAOG;AAiBH,MAAM,OAAO,qBAAqB;IAhBlC;QAiBE,qCAAqC;QAC5B,YAAO,GAAiB,MAAM,CAA2B,UAAU,CAAC,CAAC,aAAa,CAAC;QAE5F,cAAS,GAA6B,GAAG,EAAE,GAAE,CAAC,CAAC;QAC/C,eAAU,GAAe,GAAG,EAAE,GAAE,CAAC,CAAC;QA4Cf,kBAAa,GAAG,IAAI,YAAY,EAA4C,CAAC;KA6BjG;IA1EC,SAAS,CAAsC;IAC/C,UAAU,CAAwB;IAElC,IAA+B,KAAK,CAAC,KAAqB;QACxD,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IAC7B,CAAC;IACD,IAA4C,WAAW,CAAC,KAAc;QACpE,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG,KAAK,CAAC;IACnC,CAAC;IACD,mFAAmF;IACnF,IAAa,OAAO,CAAC,KAAuB;QAC1C,IAAI,KAAK,KAAK,SAAS;YAAE,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;QACtD,IAAI,CAAC,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IACxC,CAAC;IACD,IAA4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E,SAAS,EAAE,gBAAgB,EAAE;;sBAIrC,KAAK;;sBAIL,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;;sBAGrC,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;;sBAGrC,KAAK;;sBAGL,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;;sBAGrC,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;;sBAGrC,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;;sBAGrC,KAAK;;sBAGL,KAAK;;sBAGL,KAAK;;sBAGL,KAAK;;sBAIL,MAAM"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import type { ContractProps, DialogOpenChangeDetail, dialogContract } from '@joralvmel/cosmos-core';
|
|
3
|
+
import type { CosmDialog } from '@joralvmel/cosmos-elements/dialog';
|
|
4
|
+
import '@joralvmel/cosmos-elements/dialog';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
type Props = ContractProps<typeof dialogContract, 'angular'>;
|
|
7
|
+
/**
|
|
8
|
+
* Angular proxy of `<cosm-dialog>`. Inputs are forwarded to the element; `(openChange)` re-emits
|
|
9
|
+
* the original cancelable DOM `CustomEvent`.
|
|
10
|
+
*
|
|
11
|
+
* ```html
|
|
12
|
+
* <cosm-dialog [open]="isOpen" (openChange)="onOpenChange($event)">
|
|
13
|
+
* <h2 slot="title">Dialog title</h2>
|
|
14
|
+
* <p>Consumer-owned dialog content and semantics.</p>
|
|
15
|
+
* </cosm-dialog>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare class CosmDialogComponent {
|
|
19
|
+
/** The underlying custom element and imperative `requestOpen()` / `requestClose()` handle. */
|
|
20
|
+
readonly element: CosmDialog;
|
|
21
|
+
set open(value: boolean | undefined);
|
|
22
|
+
set defaultOpen(value: boolean);
|
|
23
|
+
set presentation(value: Props['presentation']);
|
|
24
|
+
set size(value: Props['size']);
|
|
25
|
+
set responsiveFullscreen(value: boolean);
|
|
26
|
+
set closeLabel(value: Props['closeLabel']);
|
|
27
|
+
set closeOnEscape(value: boolean);
|
|
28
|
+
set closeOnBackdropPress(value: boolean);
|
|
29
|
+
set initialFocusTarget(value: HTMLElement | null | undefined);
|
|
30
|
+
set returnFocusTarget(value: HTMLElement | null | undefined);
|
|
31
|
+
readonly openChange: EventEmitter<CustomEvent<DialogOpenChangeDetail>>;
|
|
32
|
+
/** Proposes an open action while preserving the element's controlled-state behavior. */
|
|
33
|
+
requestOpen(): void;
|
|
34
|
+
/** Proposes a close action while preserving the element's controlled-state behavior. */
|
|
35
|
+
requestClose(): void;
|
|
36
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CosmDialogComponent, never>;
|
|
37
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CosmDialogComponent, "cosm-dialog", never, { "open": { "alias": "open"; "required": false; }; "defaultOpen": { "alias": "defaultOpen"; "required": false; }; "presentation": { "alias": "presentation"; "required": false; }; "size": { "alias": "size"; "required": false; }; "responsiveFullscreen": { "alias": "responsiveFullscreen"; "required": false; }; "closeLabel": { "alias": "closeLabel"; "required": false; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; }; "closeOnBackdropPress": { "alias": "closeOnBackdropPress"; "required": false; }; "initialFocusTarget": { "alias": "initialFocusTarget"; "required": false; }; "returnFocusTarget": { "alias": "returnFocusTarget"; "required": false; }; }, { "openChange": "openChange"; }, never, ["*"], true, never>;
|
|
38
|
+
static ngAcceptInputType_open: unknown;
|
|
39
|
+
static ngAcceptInputType_defaultOpen: unknown;
|
|
40
|
+
static ngAcceptInputType_responsiveFullscreen: unknown;
|
|
41
|
+
static ngAcceptInputType_closeOnEscape: unknown;
|
|
42
|
+
static ngAcceptInputType_closeOnBackdropPress: unknown;
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { booleanAttribute, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, inject, Output, } from '@angular/core';
|
|
2
|
+
import '@joralvmel/cosmos-elements/dialog';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
function optionalBooleanAttribute(value) {
|
|
5
|
+
return value === undefined ? undefined : booleanAttribute(value);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Angular proxy of `<cosm-dialog>`. Inputs are forwarded to the element; `(openChange)` re-emits
|
|
9
|
+
* the original cancelable DOM `CustomEvent`.
|
|
10
|
+
*
|
|
11
|
+
* ```html
|
|
12
|
+
* <cosm-dialog [open]="isOpen" (openChange)="onOpenChange($event)">
|
|
13
|
+
* <h2 slot="title">Dialog title</h2>
|
|
14
|
+
* <p>Consumer-owned dialog content and semantics.</p>
|
|
15
|
+
* </cosm-dialog>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export class CosmDialogComponent {
|
|
19
|
+
constructor() {
|
|
20
|
+
/** The underlying custom element and imperative `requestOpen()` / `requestClose()` handle. */
|
|
21
|
+
this.element = inject(ElementRef).nativeElement;
|
|
22
|
+
this.openChange = new EventEmitter();
|
|
23
|
+
}
|
|
24
|
+
set open(value) {
|
|
25
|
+
this.element.open = value;
|
|
26
|
+
}
|
|
27
|
+
set defaultOpen(value) {
|
|
28
|
+
this.element.defaultOpen = value;
|
|
29
|
+
}
|
|
30
|
+
set presentation(value) {
|
|
31
|
+
if (value !== undefined)
|
|
32
|
+
this.element.presentation = value;
|
|
33
|
+
}
|
|
34
|
+
set size(value) {
|
|
35
|
+
if (value !== undefined)
|
|
36
|
+
this.element.size = value;
|
|
37
|
+
}
|
|
38
|
+
set responsiveFullscreen(value) {
|
|
39
|
+
this.element.responsiveFullscreen = value;
|
|
40
|
+
}
|
|
41
|
+
set closeLabel(value) {
|
|
42
|
+
if (value !== undefined)
|
|
43
|
+
this.element.closeLabel = value;
|
|
44
|
+
}
|
|
45
|
+
set closeOnEscape(value) {
|
|
46
|
+
this.element.closeOnEscape = value;
|
|
47
|
+
}
|
|
48
|
+
set closeOnBackdropPress(value) {
|
|
49
|
+
this.element.closeOnBackdropPress = value;
|
|
50
|
+
}
|
|
51
|
+
set initialFocusTarget(value) {
|
|
52
|
+
if (value !== undefined)
|
|
53
|
+
this.element.initialFocusTarget = value;
|
|
54
|
+
}
|
|
55
|
+
set returnFocusTarget(value) {
|
|
56
|
+
if (value !== undefined)
|
|
57
|
+
this.element.returnFocusTarget = value;
|
|
58
|
+
}
|
|
59
|
+
/** Proposes an open action while preserving the element's controlled-state behavior. */
|
|
60
|
+
requestOpen() {
|
|
61
|
+
this.element.requestOpen();
|
|
62
|
+
}
|
|
63
|
+
/** Proposes a close action while preserving the element's controlled-state behavior. */
|
|
64
|
+
requestClose() {
|
|
65
|
+
this.element.requestClose();
|
|
66
|
+
}
|
|
67
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: CosmDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
68
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "22.3.0", type: CosmDialogComponent, isStandalone: true, selector: "cosm-dialog", inputs: { open: ["open", "open", optionalBooleanAttribute], defaultOpen: ["defaultOpen", "defaultOpen", booleanAttribute], presentation: "presentation", size: "size", responsiveFullscreen: ["responsiveFullscreen", "responsiveFullscreen", booleanAttribute], closeLabel: "closeLabel", closeOnEscape: ["closeOnEscape", "closeOnEscape", booleanAttribute], closeOnBackdropPress: ["closeOnBackdropPress", "closeOnBackdropPress", booleanAttribute], initialFocusTarget: "initialFocusTarget", returnFocusTarget: "returnFocusTarget" }, outputs: { openChange: "openChange" }, host: { listeners: { "cosm-open-change": "openChange.emit($any($event))" } }, ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
69
|
+
}
|
|
70
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: CosmDialogComponent, decorators: [{
|
|
71
|
+
type: Component,
|
|
72
|
+
args: [{
|
|
73
|
+
selector: 'cosm-dialog',
|
|
74
|
+
template: '<ng-content />',
|
|
75
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
76
|
+
host: { '(cosm-open-change)': 'openChange.emit($any($event))' },
|
|
77
|
+
}]
|
|
78
|
+
}], propDecorators: { open: [{
|
|
79
|
+
type: Input,
|
|
80
|
+
args: [{ transform: optionalBooleanAttribute }]
|
|
81
|
+
}], defaultOpen: [{
|
|
82
|
+
type: Input,
|
|
83
|
+
args: [{ transform: booleanAttribute }]
|
|
84
|
+
}], presentation: [{
|
|
85
|
+
type: Input
|
|
86
|
+
}], size: [{
|
|
87
|
+
type: Input
|
|
88
|
+
}], responsiveFullscreen: [{
|
|
89
|
+
type: Input,
|
|
90
|
+
args: [{ transform: booleanAttribute }]
|
|
91
|
+
}], closeLabel: [{
|
|
92
|
+
type: Input
|
|
93
|
+
}], closeOnEscape: [{
|
|
94
|
+
type: Input,
|
|
95
|
+
args: [{ transform: booleanAttribute }]
|
|
96
|
+
}], closeOnBackdropPress: [{
|
|
97
|
+
type: Input,
|
|
98
|
+
args: [{ transform: booleanAttribute }]
|
|
99
|
+
}], initialFocusTarget: [{
|
|
100
|
+
type: Input
|
|
101
|
+
}], returnFocusTarget: [{
|
|
102
|
+
type: Input
|
|
103
|
+
}], openChange: [{
|
|
104
|
+
type: Output
|
|
105
|
+
}] } });
|
|
106
|
+
//# sourceMappingURL=dialog.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.component.js","sourceRoot":"","sources":["../../src/components/dialog.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;AAG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efined ? undefined : booleanAttribute(value);
|
|
42
42
|
}
|
|
43
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
44
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "22.
|
|
43
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: CosmIconButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
44
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "22.3.0", type: CosmIconButtonComponent, isStandalone: true, selector: "cosm-icon-button", inputs: { label: "label", mode: "mode", variant: "variant", tone: "tone", size: "size", type: "type", disabled: ["disabled", "disabled", booleanAttribute], defaultPressed: ["defaultPressed", "defaultPressed", booleanAttribute], pressed: "pressed" }, outputs: { press: "press", pressedChange: "pressedChange" }, host: { listeners: { "cosm-press": "press.emit($event)", "cosm-pressed-change": "pressedChange.emit($event)" } }, ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
45
45
|
}
|
|
46
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: CosmIconButtonComponent, decorators: [{
|
|
47
47
|
type: Component,
|
|
48
48
|
args: [{
|
|
49
49
|
selector: 'cosm-icon-button',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CosmIcon, CosmIconSize } from '@joralvmel/cosmos-elements/icon';
|
|
1
|
+
import type { CosmIcon, CosmIconSize, CosmIconVariant } from '@joralvmel/cosmos-elements/icon';
|
|
2
2
|
import type { IconDefinition } from '@joralvmel/cosmos-icons';
|
|
3
3
|
import '@joralvmel/cosmos-elements/icon';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
@@ -6,19 +6,17 @@ import * as i0 from "@angular/core";
|
|
|
6
6
|
* Angular proxy of `<cosm-icon>`.
|
|
7
7
|
*
|
|
8
8
|
* ```html
|
|
9
|
-
* <cosm-icon [icon]="house" size="md"
|
|
9
|
+
* <cosm-icon [icon]="house" size="md" label="Home" />
|
|
10
|
+
* <cosm-icon [icon]="heart" variant="filled" />
|
|
10
11
|
* ```
|
|
11
12
|
*/
|
|
12
13
|
export declare class CosmIconComponent {
|
|
13
14
|
readonly element: CosmIcon;
|
|
14
15
|
set icon(value: IconDefinition);
|
|
15
16
|
set size(value: CosmIconSize);
|
|
16
|
-
set
|
|
17
|
-
set
|
|
18
|
-
set strokeWidth(value: number);
|
|
17
|
+
set variant(value: CosmIconVariant);
|
|
18
|
+
set color(value: string);
|
|
19
19
|
set label(value: string | undefined);
|
|
20
|
-
set decorative(value: boolean);
|
|
21
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<CosmIconComponent, never>;
|
|
22
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CosmIconComponent, "cosm-icon", never, { "icon": { "alias": "icon"; "required": true; }; "size": { "alias": "size"; "required": false; }; "
|
|
23
|
-
static ngAcceptInputType_decorative: unknown;
|
|
21
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CosmIconComponent, "cosm-icon", never, { "icon": { "alias": "icon"; "required": true; }; "size": { "alias": "size"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "color": { "alias": "color"; "required": false; }; "label": { "alias": "label"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
24
22
|
}
|