Skip to content

Commit ce89057

Browse files
authored
refactor(angular): radio component is auto generated (#28533)
1 parent 5aafd68 commit ce89057

File tree

5 files changed

+35
-61
lines changed

5 files changed

+35
-61
lines changed

core/stencil.config.ts

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ const getAngularOutputTargets = () => {
5858
'ion-textarea',
5959
'ion-searchbar',
6060
'ion-datetime',
61-
'ion-radio',
6261
'ion-segment',
6362
'ion-checkbox',
6463
'ion-toggle',

packages/angular/standalone/src/directives/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ export * from './datetime';
33
export * from './icon';
44
export * from './input';
55
export * from './radio-group';
6-
export * from './radio';
76
export * from './range';
87
export * from './searchbar';
98
export * from './segment';

packages/angular/standalone/src/directives/proxies.ts

+35
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import { defineCustomElement as defineIonNavLink } from '@ionic/core/components/
5353
import { defineCustomElement as defineIonNote } from '@ionic/core/components/ion-note.js';
5454
import { defineCustomElement as defineIonPicker } from '@ionic/core/components/ion-picker.js';
5555
import { defineCustomElement as defineIonProgressBar } from '@ionic/core/components/ion-progress-bar.js';
56+
import { defineCustomElement as defineIonRadio } from '@ionic/core/components/ion-radio.js';
5657
import { defineCustomElement as defineIonRefresher } from '@ionic/core/components/ion-refresher.js';
5758
import { defineCustomElement as defineIonRefresherContent } from '@ionic/core/components/ion-refresher-content.js';
5859
import { defineCustomElement as defineIonReorder } from '@ionic/core/components/ion-reorder.js';
@@ -1494,6 +1495,40 @@ export class IonProgressBar {
14941495
export declare interface IonProgressBar extends Components.IonProgressBar {}
14951496

14961497

1498+
@ProxyCmp({
1499+
defineCustomElementFn: defineIonRadio,
1500+
inputs: ['alignment', 'color', 'disabled', 'justify', 'labelPlacement', 'legacy', 'mode', 'name', 'value']
1501+
})
1502+
@Component({
1503+
selector: 'ion-radio',
1504+
changeDetection: ChangeDetectionStrategy.OnPush,
1505+
template: '<ng-content></ng-content>',
1506+
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
1507+
inputs: ['alignment', 'color', 'disabled', 'justify', 'labelPlacement', 'legacy', 'mode', 'name', 'value'],
1508+
standalone: true
1509+
})
1510+
export class IonRadio {
1511+
protected el: HTMLElement;
1512+
constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
1513+
c.detach();
1514+
this.el = r.nativeElement;
1515+
proxyOutputs(this, this.el, ['ionFocus', 'ionBlur']);
1516+
}
1517+
}
1518+
1519+
1520+
export declare interface IonRadio extends Components.IonRadio {
1521+
/**
1522+
* Emitted when the radio button has focus.
1523+
*/
1524+
ionFocus: EventEmitter<CustomEvent<void>>;
1525+
/**
1526+
* Emitted when the radio button loses focus.
1527+
*/
1528+
ionBlur: EventEmitter<CustomEvent<void>>;
1529+
}
1530+
1531+
14971532
@ProxyCmp({
14981533
defineCustomElementFn: defineIonRefresher,
14991534
inputs: ['closeDuration', 'disabled', 'pullFactor', 'pullMax', 'pullMin', 'snapbackDuration'],

packages/angular/standalone/src/directives/radio.ts

-58
This file was deleted.

packages/angular/standalone/src/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export {
3434
IonInput,
3535
IonIcon,
3636
IonRadioGroup,
37-
IonRadio,
3837
IonRange,
3938
IonSearchbar,
4039
IonSegment,

0 commit comments

Comments
 (0)