Skip to content

Commit

Permalink
fix: review
Browse files Browse the repository at this point in the history
  • Loading branch information
dauriamarco committed Nov 1, 2023
1 parent 5c1a43e commit aeccf4e
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3181,7 +3181,7 @@ declare namespace LocalJSX {
/**
* Internal event that emits when the input element is loaded.
*/
"onInput-loaded"?: (event: SbbCheckboxCustomEvent<void>) => void;
"onSbb-checkbox-loaded"?: (event: SbbCheckboxCustomEvent<void>) => void;
"onState-change"?: (event: SbbCheckboxCustomEvent<CheckboxStateChange>) => void;
/**
* Whether the checkbox is required.
Expand Down Expand Up @@ -4183,7 +4183,7 @@ declare namespace LocalJSX {
/**
* Internal event that emits when the input element is loaded.
*/
"onInput-loaded"?: (event: SbbRadioButtonCustomEvent<void>) => void;
"onSbb-radio-button-loaded"?: (event: SbbRadioButtonCustomEvent<void>) => void;
/**
* Internal event that emits whenever the state of the radio option in relation to the parent selection panel changes.
*/
Expand Down
8 changes: 4 additions & 4 deletions src/components/sbb-checkbox/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ If you don't want the label to appear next to the checkbox, you can use `aria-la

## Events

| Event | Description | Type |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------- |
| `didChange` | <span style="color:red">**[DEPRECATED]**</span> only used for React. Will probably be removed once React 19 is available.<br/><br/> | `CustomEvent<any>` |
| `input-loaded` | Internal event that emits when the input element is loaded. | `CustomEvent<void>` |
| Event | Description | Type |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------- |
| `didChange` | <span style="color:red">**[DEPRECATED]**</span> only used for React. Will probably be removed once React 19 is available.<br/><br/> | `CustomEvent<any>` |
| `sbb-checkbox-loaded` | Internal event that emits when the input element is loaded. | `CustomEvent<void>` |


## Slots
Expand Down
2 changes: 1 addition & 1 deletion src/components/sbb-checkbox/sbb-checkbox.events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
*/
export default {
didChange: 'didChange',
inputLoaded: 'input-loaded',
sbbCheckboxLoaded: 'sbb-checkbox-loaded',
stateChange: 'state-change',
};
6 changes: 3 additions & 3 deletions src/components/sbb-checkbox/sbb-checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ export class SbbCheckbox implements ComponentInterface {
*/
@Event({
bubbles: true,
eventName: 'input-loaded',
eventName: 'sbb-checkbox-loaded',
})
public inputLoaded: EventEmitter<void>;
public sbbCheckboxLoaded: EventEmitter<void>;

@Watch('checked')
public handleCheckedChange(currentValue: boolean, previousValue: boolean): void {
Expand Down Expand Up @@ -177,7 +177,7 @@ export class SbbCheckbox implements ComponentInterface {
!this._element.closest('sbb-selection-panel [slot="content"]');
this._handlerRepository.connect();
this._setupInitialStateAndAttributeObserver();
this.inputLoaded.emit();
this._isSelectionPanelInput && this.sbbCheckboxLoaded.emit();
}

public componentDidLoad(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export class SbbRadioButtonGroup implements ComponentInterface {
}

private _updateRadios(initValue?: string): void {
this.value = initValue || this._radioButtons.find((radio) => radio.checked)?.value;
this.value = initValue ?? this._radioButtons.find((radio) => radio.checked)?.value;

for (const radio of this._radioButtons) {
radio.checked = radio.value === this.value;
Expand Down
8 changes: 4 additions & 4 deletions src/components/sbb-radio-button/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ The component has two different sizes, which can be changed using the `size` pro

## Events

| Event | Description | Type |
| -------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| `input-loaded` | Internal event that emits when the input element is loaded. | `CustomEvent<void>` |
| `state-change` | Internal event that emits whenever the state of the radio option in relation to the parent selection panel changes. | `CustomEvent<RadioButtonStateChangeChecked \| RadioButtonStateChangeDisabled>` |
| Event | Description | Type |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| `sbb-radio-button-loaded` | Internal event that emits when the input element is loaded. | `CustomEvent<void>` |
| `state-change` | Internal event that emits whenever the state of the radio option in relation to the parent selection panel changes. | `CustomEvent<RadioButtonStateChangeChecked \| RadioButtonStateChangeDisabled>` |


## Methods
Expand Down
2 changes: 1 addition & 1 deletion src/components/sbb-radio-button/sbb-radio-button.events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* See stencil.config.ts in the root directory.
*/
export default {
inputLoaded: 'input-loaded',
sbbRadioButtonLoaded: 'sbb-radio-button-loaded',
stateChange: 'state-change',
};
6 changes: 3 additions & 3 deletions src/components/sbb-radio-button/sbb-radio-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ export class SbbRadioButton implements ComponentInterface {
*/
@Event({
bubbles: true,
eventName: 'input-loaded',
eventName: 'sbb-radio-button-loaded',
})
public inputLoaded: EventEmitter<void>;
public sbbRadioButtonLoaded: EventEmitter<void>;

@Watch('checked')
public handleCheckedChange(currentValue: boolean, previousValue: boolean): void {
Expand Down Expand Up @@ -178,7 +178,7 @@ export class SbbRadioButton implements ComponentInterface {
!!this._selectionPanelElement &&
!this._element.closest('sbb-selection-panel [slot="content"]');
this._setupInitialStateAndAttributeObserver();
this.inputLoaded.emit();
this._isSelectionPanelInput && this.sbbRadioButtonLoaded.emit();
}

public componentDidLoad(): void {
Expand Down

0 comments on commit aeccf4e

Please sign in to comment.