Skip to content

Commit e63ccc2

Browse files
authored
Merge branch 'master' into rivanova/fix-12245-master
2 parents ff7cbb3 + 6423d29 commit e63ccc2

File tree

4 files changed

+47
-105
lines changed

4 files changed

+47
-105
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"@scheme": "../../common/schema/binding.schema.json",
3+
"changes": [
4+
{
5+
"name": "disabled",
6+
"remove": "true",
7+
"owner": {
8+
"selector": "igx-radio-group",
9+
"type": "component"
10+
}
11+
},
12+
{
13+
"name": "labelPosition",
14+
"remove": "true",
15+
"owner": {
16+
"selector": "igx-radio-group",
17+
"type": "component"
18+
}
19+
}
20+
]
21+
}

projects/igniteui-angular/migrations/update-15_0_0/index.spec.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,28 @@ describe(`Update to ${version}`, () => {
147147
`@include igniteui.elevations($material-elevations);`
148148
);
149149
});
150+
151+
it('should remove the disabled property from the igx-radio-group', async () => {
152+
appTree.create(
153+
'/testSrc/appPrefix/component/test.component.html', `
154+
<igx-radio-group disabled="true"></igx-radio-group>`);
155+
const tree = await schematicRunner.runSchematicAsync(migrationName, {}, appTree)
156+
.toPromise();
157+
158+
expect(tree.readContent('/testSrc/appPrefix/component/test.component.html'))
159+
.toEqual(`
160+
<igx-radio-group></igx-radio-group>`);
161+
});
162+
163+
it('should remove the labelPosition property from the igx-radio-group', async () => {
164+
appTree.create(
165+
'/testSrc/appPrefix/component/test.component.html', `
166+
<igx-radio-group labelPosition="before"></igx-radio-group>`);
167+
const tree = await schematicRunner.runSchematicAsync(migrationName, {}, appTree)
168+
.toPromise();
169+
170+
expect(tree.readContent('/testSrc/appPrefix/component/test.component.html'))
171+
.toEqual(`
172+
<igx-radio-group></igx-radio-group>`);
173+
});
150174
});

projects/igniteui-angular/src/lib/directives/radio/radio-group.directive.spec.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ describe('IgxRadioGroupDirective', () => {
4343
const allButtonsWithGroupName = radioInstance.radioButtons.filter((btn) => btn.name === radioInstance.name);
4444
expect(allButtonsWithGroupName.length).toEqual(radioInstance.radioButtons.length);
4545

46-
const allButtonsWithGroupLabelPos = radioInstance.radioButtons.filter((btn) => btn.labelPosition === radioInstance.labelPosition);
47-
expect(allButtonsWithGroupLabelPos.length).toEqual(radioInstance.radioButtons.length);
48-
4946
const buttonWithGroupValue = radioInstance.radioButtons.find((btn) => btn.value === radioInstance.value);
5047
expect(buttonWithGroupValue).toBeDefined();
5148
expect(buttonWithGroupValue).toEqual(radioInstance.selected);
@@ -73,20 +70,6 @@ describe('IgxRadioGroupDirective', () => {
7370

7471
const allRequiredButtons = radioInstance.radioButtons.filter((btn) => btn.required);
7572
expect(allRequiredButtons.length).toEqual(radioInstance.radioButtons.length);
76-
77-
// labelPosition
78-
radioInstance.labelPosition = 'after';
79-
fixture.detectChanges();
80-
81-
const allAfterButtons = radioInstance.radioButtons.filter((btn) => btn.labelPosition === 'after');
82-
expect(allAfterButtons.length).toEqual(radioInstance.radioButtons.length);
83-
84-
// disabled
85-
radioInstance.disabled = true;
86-
fixture.detectChanges();
87-
88-
const allDisabledButtons = radioInstance.radioButtons.filter((btn) => btn.disabled);
89-
expect(allDisabledButtons.length).toEqual(radioInstance.radioButtons.length);
9073
}));
9174

9275
it('Set value should change selected property and emit change event.', fakeAsync(() => {
@@ -244,7 +227,7 @@ class RadioGroupSimpleComponent {
244227
}
245228

246229
@Component({
247-
template: `<igx-radio-group #radioGroup name="radioGroup" value="Baz" required="true" labelPosition="before">
230+
template: `<igx-radio-group #radioGroup name="radioGroup" value="Baz" required="true">
248231
<igx-radio *ngFor="let item of ['Foo', 'Bar', 'Baz']" value="{{item}}">
249232
{{item}}
250233
</igx-radio>

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

Lines changed: 1 addition & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
66
import { noop, Subject } from 'rxjs';
77
import { startWith, takeUntil } from 'rxjs/operators';
88
import { mkenum } from '../../core/utils';
9-
import { IChangeRadioEventArgs, IgxRadioComponent, RadioLabelPosition } from '../../radio/radio.component';
9+
import { IChangeRadioEventArgs, IgxRadioComponent } from '../../radio/radio.component';
1010
import { IgxRippleModule } from '../ripple/ripple.directive';
1111

1212
/**
@@ -50,7 +50,6 @@ let nextId = 0;
5050
})
5151
export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAccessor, OnDestroy {
5252
private static ngAcceptInputType_required: boolean | '';
53-
private static ngAcceptInputType_disabled: boolean | '';
5453
/**
5554
* Returns reference to the child radio buttons.
5655
*
@@ -119,49 +118,6 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
119118
this._setRadioButtonsRequired();
120119
}
121120

122-
/**
123-
* @deprecated in version 12.2.0
124-
*
125-
* An input property that allows you to disable the radio group. By default it's false.
126-
*
127-
* @example
128-
* ```html
129-
* <igx-radio-group disabled></igx-radio-group>
130-
* ```
131-
*/
132-
@Input()
133-
public get disabled(): boolean {
134-
return this._disabled;
135-
}
136-
public set disabled(value: boolean) {
137-
this._disabled = (value as any) === '' || value;
138-
this.setDisabledState(value);
139-
}
140-
141-
/**
142-
* @deprecated in version 12.2.0
143-
*
144-
* Sets/gets the position of the `label` in the child radio buttons.
145-
*
146-
* @remarks
147-
* If not set, `labelPosition` will have value `"after"`.
148-
*
149-
* @example
150-
* ```html
151-
* <igx-radio-group labelPosition = "before"></igx-radio-group>
152-
* ```
153-
*/
154-
@Input()
155-
public get labelPosition(): RadioLabelPosition | string {
156-
return this._labelPosition;
157-
}
158-
public set labelPosition(newValue: RadioLabelPosition | string) {
159-
if (this._labelPosition !== newValue) {
160-
this._labelPosition = newValue === RadioLabelPosition.BEFORE ? RadioLabelPosition.BEFORE : RadioLabelPosition.AFTER;
161-
this._setRadioButtonLabelPosition();
162-
}
163-
}
164-
165121
/**
166122
* Sets/gets the selected child radio button.
167123
*
@@ -271,16 +227,6 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
271227
* @internal
272228
*/
273229
private _isInitialized = false;
274-
/**
275-
* @hidden
276-
* @internal
277-
*/
278-
private _labelPosition: RadioLabelPosition | string = 'after';
279-
/**
280-
* @hidden
281-
* @internal
282-
*/
283-
private _disabled = false;
284230
/**
285231
* @hidden
286232
* @internal
@@ -338,18 +284,6 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
338284
this._onChangeCallback = fn;
339285
}
340286

341-
/**
342-
* @hidden
343-
* @internal
344-
*/
345-
public setDisabledState(isDisabled: boolean) {
346-
if (this.radioButtons) {
347-
this.radioButtons.forEach((button) => {
348-
button.setDisabledState(isDisabled);
349-
});
350-
}
351-
}
352-
353287
/**
354288
* Registers a function called when the control is touched.
355289
*
@@ -383,14 +317,6 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
383317
this.radioButtons.forEach((button) => {
384318
Object.assign(button, props);
385319

386-
if(button.disabled === undefined) {
387-
button.disabled = this._disabled;
388-
}
389-
390-
if(button.labelPosition === undefined) {
391-
button.labelPosition = this._labelPosition;
392-
}
393-
394320
if (button.value === this._value) {
395321
button.checked = true;
396322
this._selected = button;
@@ -468,18 +394,6 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
468394
}
469395
}
470396

471-
/**
472-
* @hidden
473-
* @internal
474-
*/
475-
private _setRadioButtonLabelPosition() {
476-
if (this.radioButtons) {
477-
this.radioButtons.forEach((button) => {
478-
button.labelPosition = this._labelPosition;
479-
});
480-
}
481-
}
482-
483397
/**
484398
* @hidden
485399
* @internal

0 commit comments

Comments
 (0)