-
Notifications
You must be signed in to change notification settings - Fork 279
feat(ui5-user-settings): add UserSettingsAppearanceView components #12739
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
Conversation
|
🧹 Preview deployment cleaned up: https://pr-12739--ui5-webcomponents.netlify.app |
LilyanaOviPe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
| * Fired when a theme is selected. | ||
| * @public | ||
| */ | ||
| @event("theme-selected") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discussed we can check with the core team about the naming of this event
| * @public | ||
| */ | ||
| @property() | ||
| selectedItemKey = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its better to remove this property and use the selected property of the appearance items.
Check for reference UserSettingsDialog and UserSettingsItem - the same logic applies there
| @slot({ | ||
| type: HTMLElement, | ||
| }) | ||
| additionalContent?: Array<HTMLElement>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe only content (again check with the core team)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I set it to additionalContent, because it is not the default slot while content might lead to users thinking it is the default slot.
| this._getAllItems().forEach(item => { | ||
| item.selected = item.itemKey === this.selectedItemKey; | ||
| }); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THis might be removed when selected of the items is utilizaed
| return allItems; | ||
| } | ||
|
|
||
| _handleItemSelected = (e: CustomEvent) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
give a type of the custom event. In that way the item will have type and no casting will be needed. Check again settings item:
e: CustomEvent
| * @public | ||
| */ | ||
| @property() | ||
| itemKey = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when you remove the selected item key maybe this will be remove as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used to determine the theme
|
please update the demo samples: packages/website/docs/_samples/fiori/UserSettingsDialog/Basic/sample.html and packages/website/docs/_samples/patterns/UXCIntegration/Basic/sample.html |
Thanks for the reminder. |
|
🎉 This PR is included in version v2.18.0-rc.1 🎉 The release is available on v2.18.0-rc.1 Your semantic-release bot 📦🚀 |
The change introduces three new components - UserSettingsAppearanceView, UserSettingsAppearanceViewItem, and UserSettingsAppearanceViewGroup - designed to simplify building theme/appearance selection within the
UserSettingsDialog. They follow the latest design guidelines and provide a ready-to-use appearance settings view that can be easily integrated or extended.Overview
The
UserSettingsAppearanceViewcomponents provide a prebuilt theme selection interface for theUserSettingsDialog, simplifying implementation and delivering a structured, predefined layout for presenting theme options with visual indicators and grouping capabilities.Structure
UserSettingsAppearanceView(ui5-user-settings-appearance-view) is an extension ofUserSettingsViewthat offers a ready-to-use, fixed appearance selection design aligned with the latest UI patterns, ensuring a consistent user experience for theme management.UserSettingsAppearanceViewItem(ui5-user-settings-appearance-view-item) extendsListItemCustomto represent individual theme options with avatar icons, text labels, and selection states.UserSettingsAppearanceViewGroup(ui5-user-settings-appearance-view-group) extendsListItemGroupto organize related themes under descriptive headers.API
UserSettingsAppearanceView
Extends:
UserSettingsViewProps
Slots
Events
selection-change - Fired when a theme item is selected
detail.item: UserSettingsAppearanceViewItem - The selected appearance view item
cancelable: true - Event can be prevented with preventDefault()
UserSettingsAppearanceViewItem
Extends:
ListItemCustomProps
UserSettingsAppearanceViewGroup
Extends:
ListItemGroupProps
Slots
items!: Array - Appearance items within the group (default slot)
Test Pages
fiori/test/pages/UserSettingsDialog.html