-
Notifications
You must be signed in to change notification settings - Fork 76
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
feat(tree,tree-item): update indentation #10990
Merged
anveshmekala
merged 6 commits into
dev
from
anveshmekala/7096-tree-item-fix-indentation
Dec 12, 2024
+143
−417
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5a86ee3
feat(tree,tree-item): update indentation
anveshmekala b951c83
fix indent when lines are set to false
anveshmekala 57903c8
cleanup
anveshmekala f6b9bab
add padding-block
anveshmekala 3f476b9
tokenize
anveshmekala 5945edb
refactor
anveshmekala File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -354,18 +354,19 @@ export class TreeItem extends LitElement implements InteractiveComponent { | |
const showBlank = this.selectionMode === "none" && !this.hasChildren; | ||
const checkboxIsIndeterminate = this.hasChildren && this.indeterminate; | ||
|
||
const chevron = this.hasChildren ? ( | ||
<calcite-icon | ||
class={{ | ||
[CSS.chevron]: true, | ||
[CSS_UTILITY.rtl]: rtl, | ||
}} | ||
data-test-id="icon" | ||
icon={ICONS.chevronRight} | ||
onClick={this.iconClickHandler} | ||
scale={getIconScale(this.scale)} | ||
/> | ||
) : null; | ||
const chevron = | ||
this.hasChildren || this.selectionMode === "ancestors" ? ( | ||
<calcite-icon | ||
class={{ | ||
[CSS.chevron]: true, | ||
[CSS_UTILITY.rtl]: rtl, | ||
}} | ||
data-test-id="icon" | ||
icon={this.hasChildren ? ICONS.chevronRight : ICONS.blank} | ||
onClick={this.iconClickHandler} | ||
scale={getIconScale(this.scale)} | ||
/> | ||
) : null; | ||
const defaultSlotNode: JsxNode = <slot key="default-slot" />; | ||
|
||
const checkbox = | ||
|
@@ -382,7 +383,6 @@ export class TreeItem extends LitElement implements InteractiveComponent { | |
} | ||
scale={getIconScale(this.scale)} | ||
/> | ||
<label class={CSS.checkboxLabel}>{defaultSlotNode}</label> | ||
</div> | ||
) : null; | ||
const selectedIcon = showBulletPoint | ||
|
@@ -462,8 +462,13 @@ export class TreeItem extends LitElement implements InteractiveComponent { | |
> | ||
{chevron} | ||
{itemIndicator} | ||
{checkbox ? checkbox : null} | ||
{this.iconStart ? iconStartEl : null} | ||
{checkbox ? checkbox : defaultSlotNode} | ||
{checkbox ? ( | ||
<label class={CSS.checkboxLabel}>{defaultSlotNode}</label> | ||
) : ( | ||
defaultSlotNode | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No impact for AT users with VoiceOver. Adding @geospatialem for review. |
||
)} | ||
</div> | ||
<div class={CSS.actionsEnd} hidden={!hasEndActions} ref={this.actionSlotWrapper}> | ||
{slotNode} | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Shouldn't these values use calcite tokens?
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.
IIRC, it is recommended to leave them as
rem
orpx
for now and update them to tokens in a separate effort once tokenization is complete. Please correct me if wrong @alisonailea