Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v10.2.0 #3740

Merged
merged 5 commits into from
Dec 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "Initial toggle fix"
This reverts commit 4ef6e78.
  • Loading branch information
RasmusKjeldgaard committed Dec 12, 2024
commit 442e4eaf43c2d741cdabe3d35d0efa91a8ae8b3c
6 changes: 1 addition & 5 deletions libs/designsystem/toggle/src/toggle.component.html
Original file line number Diff line number Diff line change
@@ -7,10 +7,6 @@
(blur)="_onInactive()"
(ionChange)="onCheckedChange($event.detail.checked)"
[attr.aria-label]="_ariaLabel"
[justify]="_justify"
[labelPlacement]="_labelPlacement"
>
<span class="default-content">
<ng-content></ng-content>
</span>
<ng-content></ng-content>
</ion-toggle>
15 changes: 0 additions & 15 deletions libs/designsystem/toggle/src/toggle.component.scss
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
@use 'sass:math';
@use 'sass:map';
@use '@kirbydesign/core/src/scss/interaction-state';
@use '@kirbydesign/core/src/scss/utils';

:host {
display: inline-flex;

&:has(ion-toggle.in-item.toggle-justify-space-between) {
width: 100%;
}

// @each $size, $properties in utils.$checkbox-sizes {
// &.#{$size} {
// $vertical-padding: map.get($properties, vertical-padding);

// ion-toggle:not(.in-item)::part(label) {
// padding-block: $vertical-padding;
// }
// }
// }
}

ion-toggle {
19 changes: 0 additions & 19 deletions libs/designsystem/toggle/src/toggle.component.ts
Original file line number Diff line number Diff line change
@@ -36,21 +36,6 @@ export class ToggleComponent implements ControlValueAccessor, OnInit {
) {}

ngOnInit(): void {
/**
* We cannot query ion-toggle for slotted content at this point as the slot has not been rendered.
* But we need to know if content is slotted to set justify and labelPlacement BEFORE ion-toggle is rendered.
* So it has to be done by querying an additional wrapper around the default content slot like this.
*/
this._hasSlottedContent = this.elementRef.nativeElement
.querySelector('.default-content')
.hasChildNodes();

const slot = this.elementRef.nativeElement.getAttribute('slot');
if (slot === 'end' && this._hasSlottedContent) {
this._justify = 'space-between';
this._labelPlacement = 'start';
}

this.inheritAriaAttributes();
}

@@ -75,10 +60,6 @@ export class ToggleComponent implements ControlValueAccessor, OnInit {

@Output() checkedChange = new EventEmitter<boolean>();

_justify: 'start' | 'end' | 'space-between' = 'start';
_labelPlacement: 'end' | 'fixed' | 'stacked' | 'start' = 'end';
_hasSlottedContent: boolean;

_pressed = false;

onCheckedChange(checked: boolean): void {