diff --git a/src/app/shared/forms/planet-tag-input-dialog.component.html b/src/app/shared/forms/planet-tag-input-dialog.component.html index b26ea2446b..5c7957d719 100644 --- a/src/app/shared/forms/planet-tag-input-dialog.component.html +++ b/src/app/shared/forms/planet-tag-input-dialog.component.html @@ -18,7 +18,10 @@ None - {{tag.name}} + + {{ tag.name }} + ({{ tag.count || 0 }}) + @@ -26,26 +29,26 @@ - -

- - - {{tag.name + ' (' + (tag.count || 0) + ')'}} - - - - -

+ + + + {{ tag.name }} + ({{ tag.count || 0 }}) + + + + + - - subdirectory_arrow_right -

- - {{subTag.name + ' (' + (subTag.count || 0) + ')'}} - - -

+ + subdirectory_arrow_right + + {{ tag.name }} + ({{ tag.count || 0 }}) + + +
@@ -54,21 +57,21 @@ All - - {{ (tag.name + ' (' + (tag.count || 0) + ')') | slice:0:30 }}{{ (tag.name.length + tag.count.toString().length > 30) ? '...' : '' }} + + {{ tag.name }} + ({{ tag.count || 0 }}) - + subdirectory_arrow_right - {{ truncateTagName(subTag) }} + {{ tag.name }} + ({{ tag.count || 0 }}) diff --git a/src/app/shared/forms/planet-tag-input-dialog.component.ts b/src/app/shared/forms/planet-tag-input-dialog.component.ts index 8c549c019e..041ad8bd21 100644 --- a/src/app/shared/forms/planet-tag-input-dialog.component.ts +++ b/src/app/shared/forms/planet-tag-input-dialog.component.ts @@ -14,28 +14,7 @@ import { DialogsPromptComponent } from '../../shared/dialogs/dialogs-prompt.comp @Component({ 'templateUrl': 'planet-tag-input-dialog.component.html', - 'styles': [ ` - :host { - display: block; - overflow: hidden; - } - :host mat-dialog-content { - overflow-y: auto; - max-height: calc(100vh - 100px); - } - :host .mat-list-option span { - font-weight: inherit; - } - :host p[matLine] *, :host .mat-nav-list .mat-list-item * { - margin-right: 0.25rem; - } - :host p[matLine] *:last-child, :host .mat-nav-list .mat-list-item *:last-child { - margin-right: 0; - } - :host mat-dialog-actions { - padding: 0; - } - ` ] + 'styleUrls': [ 'planet-tag-input-dialog.scss' ] }) export class PlanetTagInputDialogComponent { @@ -285,12 +264,6 @@ export class PlanetTagInputDialogComponent { return checkValue(this.selected.entries()); } - truncateTagName(subTag: { name: string; count?: number }, maxLength: number): string { - if (this.deviceType === this.deviceTypes.DESKTOP) { maxLength = 50; } else { maxLength = 25; } - const truncatedName = subTag.name.length > maxLength ? subTag.name.slice(0, maxLength) + '...' : subTag.name; - return `${truncatedName} (${subTag.count || 0})`; - } - } @Component({ diff --git a/src/app/shared/forms/planet-tag-input-dialog.scss b/src/app/shared/forms/planet-tag-input-dialog.scss new file mode 100644 index 0000000000..05942a7880 --- /dev/null +++ b/src/app/shared/forms/planet-tag-input-dialog.scss @@ -0,0 +1,77 @@ +:host { + display: block; + overflow: hidden; +} + +:host mat-dialog-content { + overflow-y: auto; + max-height: calc(100vh - 156px); + box-sizing: border-box; + padding-bottom: 16px; +} + +:host .mat-list-option span { + font-weight: inherit; +} + +:host p[matLine] *, :host .mat-nav-list .mat-list-item * { + margin-right: 0.25rem; +} + +:host p[matLine] *:last-child, :host .mat-nav-list .mat-list-item *:last-child { + margin-right: 0; +} + +:host .mat-nav-list { + margin-bottom: 16px; +} + +.mat-list-item:last-of-type { + margin-bottom: 8px; +} + +:host mat-dialog-actions { + display: flex; + justify-content: flex-end; + gap: 4px; + padding: 16px; + box-sizing: border-box; + flex-wrap: wrap; + background-color: #fff; + position: sticky; + bottom: 0; + border-top: 1px solid #e0e0e0; +} + +:host mat-dialog-actions button { + margin: 0; + padding: 4px; +} + +.icon-spacing, +.checkbox-spacing { + margin-right: 4px; +} + +.button-spacing { + margin-right: 4px; + margin-left: 8px; +} + +.truncated-name { + display: inline-block; + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + word-wrap: break-word; + overflow-wrap: anywhere; +} + +.count { + white-space: nowrap; +} + +.mat-action-list .count { + margin-left: 2px; +}