Skip to content

Commit fef6806

Browse files
committed
refactor(radio-group): revert event rename
1 parent a257fde commit fef6806

File tree

9 files changed

+8
-22
lines changed

9 files changed

+8
-22
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ ng update igniteui-angular --migrate-only --from=20.1.0 --to=21.0.0 --migrate-im
3737

3838
**Type Renames (to avoid conflicts):**
3939
- `Direction``IgxCarouselDirection` (in carousel)
40-
- `IChangeCheckboxEventArgs``IChangeRadioEventArgs` (in radio)
4140

4241
**Benefits:**
4342
- Better tree-shaking - unused components won't be bundled
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export { LabelPosition, IChangeCheckboxEventArgs } from "igniteui-angular/directives";
1+
export { LabelPosition, type IChangeCheckboxEventArgs } from "igniteui-angular/directives";
22
export * from "./checkbox.component";

projects/igniteui-angular/directives/src/public_api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export * from './directives/layout/layout.directive';
2525
export * from './directives/mask/mask.directive';
2626
// Note: Radio-group directive moved to radio entry point in v21.0.0
2727
// Users should now import from 'igniteui-angular/radio' instead
28-
// export { IgxRadioGroupDirective, IChangeRadioEventArgs } from 'igniteui-angular/radio';
28+
// export { IgxRadioGroupDirective } from 'igniteui-angular/radio';
2929
export * from './directives/ripple/ripple.directive';
3030
export * from './directives/scroll-inertia/scroll_inertia.directive';
3131
export * from './directives/size/ig-size.directive';

projects/igniteui-angular/migrations/update-21_0_0/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ The following directives have been moved to new entry points:
3232
The following types have been renamed to avoid conflicts:
3333

3434
- `Direction``IgxCarouselDirection` (carousel)
35-
- `IChangeCheckboxEventArgs``IChangeRadioEventArgs` (radio)
3635

3736
### Example
3837

projects/igniteui-angular/migrations/update-21_0_0/changes/classes.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
{
55
"name": "Direction",
66
"replaceWith": "IgxCarouselDirection"
7-
},
8-
{
9-
"name": "IChangeCheckboxEventArgs",
10-
"replaceWith": "IChangeRadioEventArgs"
117
}
128
]
139
}

projects/igniteui-angular/migrations/update-21_0_0/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@ const ENTRY_POINT_MAP = new Map<string, string>([
349349
['IgxRadioComponent', 'radio'],
350350
['IgxRadioModule', 'radio'],
351351
['IgxRadioGroupDirective', 'radio'], // Breaking change - moved from directives
352-
['IChangeRadioEventArgs', 'radio'], // Renamed from IChangeCheckboxEventArgs
353352

354353
// Select
355354
['IgxSelectComponent', 'select'],
@@ -446,7 +445,6 @@ const ENTRY_POINT_MAP = new Map<string, string>([
446445
// Type renames (old name -> new name and entry point)
447446
const TYPE_RENAMES = new Map<string, { newName: string, entryPoint: string }>([
448447
['Direction', { newName: 'IgxCarouselDirection', entryPoint: 'carousel' }],
449-
['IChangeCheckboxEventArgs', { newName: 'IChangeRadioEventArgs', entryPoint: 'radio' }],
450448
]);
451449

452450
function migrateImportDeclaration(node: ts.ImportDeclaration, sourceFile: ts.SourceFile): { start: number, end: number, replacement: string } | null {
@@ -645,7 +643,6 @@ export default (options: MigrationOptions = {}): Rule => async (host: Tree, cont
645643
context.logger.info(' - IgxRadioGroupDirective moved to igniteui-angular/radio');
646644
context.logger.info('Type renames:');
647645
context.logger.info(' - Direction → IgxCarouselDirection');
648-
context.logger.info(' - IChangeCheckboxEventArgs → IChangeRadioEventArgs');
649646
} else {
650647
context.logger.info('Skipping import migration. You can continue using the main entry point.');
651648
context.logger.info('Note: The library now supports granular entry points for better tree-shaking.');

projects/igniteui-angular/radio/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export class RadioSampleComponent {
8888
| `@Input()` disableRipple | boolean | Specifies the whether the ripple effect should be disabled for the radio button. |
8989
| `@Input()` labelPosition | string `|` enum RadioLabelPosition | Specifies the position of the text label relative to the radio button element. Possible values are "before" and "after". |
9090
| `@Input("aria-labelledby")` ariaLabelledBy | string | Specify an external element by id to be used as label for the radio button. |
91-
| `@Output()` change | EventEmitter<IChangeRadioEventArgs> | Emitted when the radio button checked value changes. |
91+
| `@Output()` change | EventEmitter<IChangeCheckboxEventArgs> | Emitted when the radio button checked value changes. |
9292

9393
### Methods
9494

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
export type { IChangeCheckboxEventArgs } from "igniteui-angular/directives";
12
export * from './radio/public_api';

projects/igniteui-angular/radio/src/radio/radio-group/radio-group.directive.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,7 @@ import { ControlValueAccessor, NgControl, Validators } from '@angular/forms';
1919
import { fromEvent, noop, Subject, takeUntil } from 'rxjs';
2020
import { IgxRadioComponent } from '../radio.component';
2121
import { ɵIgxDirectionality } from 'igniteui-angular/core';
22-
import { IBaseEventArgs } from 'igniteui-angular/core';
23-
24-
export interface IChangeRadioEventArgs extends IBaseEventArgs {
25-
checked: boolean;
26-
value?: any;
27-
}
28-
22+
import { IChangeCheckboxEventArgs } from 'igniteui-angular/directives';
2923
/**
3024
* Determines the Radio Group alignment
3125
*/
@@ -196,7 +190,7 @@ export class IgxRadioGroupDirective implements ControlValueAccessor, OnDestroy,
196190
* ```
197191
*/
198192
// eslint-disable-next-line @angular-eslint/no-output-native
199-
@Output() public readonly change: EventEmitter<IChangeRadioEventArgs> = new EventEmitter<IChangeRadioEventArgs>();
193+
@Output() public readonly change: EventEmitter<IChangeCheckboxEventArgs> = new EventEmitter<IChangeCheckboxEventArgs>();
200194

201195
/**
202196
* The css class applied to the component.
@@ -559,7 +553,7 @@ export class IgxRadioGroupDirective implements ControlValueAccessor, OnDestroy,
559553
takeUntil(button.destroy$),
560554
takeUntil(this.destroy$),
561555
takeUntil(this.queryChange$)
562-
).subscribe((ev: IChangeRadioEventArgs) => this._selectedRadioButtonChanged(ev));
556+
).subscribe((ev: IChangeCheckboxEventArgs) => this._selectedRadioButtonChanged(ev));
563557

564558
button.blurRadio
565559
.pipe(takeUntil(this.destroy$))
@@ -574,7 +568,7 @@ export class IgxRadioGroupDirective implements ControlValueAccessor, OnDestroy,
574568
* @hidden
575569
* @internal
576570
*/
577-
private _selectedRadioButtonChanged(args: IChangeRadioEventArgs) {
571+
private _selectedRadioButtonChanged(args: IChangeCheckboxEventArgs) {
578572
this._radioButtons().forEach((button) => {
579573
button.checked = button.id === args.owner.id;
580574
if (button.checked && button.ngControl) {

0 commit comments

Comments
 (0)