diff --git a/src/tedi/components/buttons/button-group/button-group.component.html b/src/tedi/components/buttons/button-group/button-group.component.html index 43d28706c..c8527567e 100644 --- a/src/tedi/components/buttons/button-group/button-group.component.html +++ b/src/tedi/components/buttons/button-group/button-group.component.html @@ -27,7 +27,7 @@ [class.tedi-dropdown-item--selected]="item.selected()" (itemSelect)="onDropdownItemSelect(item)" > - + @if (item.iconLeft()) { } - {{ + {{ item.label() - }} + }} @if (item.iconRight()) { } - + } diff --git a/src/tedi/components/buttons/button-group/button-group.component.ts b/src/tedi/components/buttons/button-group/button-group.component.ts index 6ec2bb84e..b4b59110a 100644 --- a/src/tedi/components/buttons/button-group/button-group.component.ts +++ b/src/tedi/components/buttons/button-group/button-group.component.ts @@ -26,8 +26,8 @@ import { DropdownComponent } from "../../overlay/dropdown/dropdown.component"; import { DropdownTriggerDirective } from "../../overlay/dropdown/dropdown-trigger/dropdown-trigger.directive"; import { DropdownContentComponent } from "../../overlay/dropdown/dropdown-content/dropdown-content.component"; import { DropdownItemComponent } from "../../overlay/dropdown/dropdown-item/dropdown-item.component"; -import { DropdownItemValueComponent } from "../../overlay/dropdown/dropdown-item-value/dropdown-item-value.component"; -import { DropdownItemValueLabelComponent } from "../../overlay/dropdown/dropdown-item-value/dropdown-item-value-label.component"; +import { OptionContentComponent } from "../../helpers/option-content/option-content.component"; +import { OptionContentLabelComponent } from "../../helpers/option-content/option-content-label.component"; import { TediTranslationService } from "../../../services/translation/translation.service"; export type ButtonGroupDropdownLabelMode = "selected" | "static"; @@ -42,8 +42,8 @@ export type ButtonGroupDropdownLabelMode = "selected" | "static"; DropdownTriggerDirective, DropdownContentComponent, DropdownItemComponent, - DropdownItemValueComponent, - DropdownItemValueLabelComponent, + OptionContentComponent, + OptionContentLabelComponent, ], templateUrl: "./button-group.component.html", styleUrl: "./button-group.component.scss", diff --git a/src/tedi/components/content/table/table-columns-menu/table-columns-menu.component.html b/src/tedi/components/content/table/table-columns-menu/table-columns-menu.component.html index 1b4377414..600ccc359 100644 --- a/src/tedi/components/content/table/table-columns-menu/table-columns-menu.component.html +++ b/src/tedi/components/content/table/table-columns-menu/table-columns-menu.component.html @@ -14,15 +14,15 @@ [closeOnSelect]="false" (itemSelect)="handleToggle(column)" > - - + {{ resolveHeader(column) }} - - + + } diff --git a/src/tedi/components/content/table/table-columns-menu/table-columns-menu.component.ts b/src/tedi/components/content/table/table-columns-menu/table-columns-menu.component.ts index 0aed764ea..d52899542 100644 --- a/src/tedi/components/content/table/table-columns-menu/table-columns-menu.component.ts +++ b/src/tedi/components/content/table/table-columns-menu/table-columns-menu.component.ts @@ -13,8 +13,8 @@ import { DropdownComponent } from "../../../overlay/dropdown/dropdown.component" import { DropdownContentComponent } from "../../../overlay/dropdown/dropdown-content/dropdown-content.component"; import { DropdownItemComponent } from "../../../overlay/dropdown/dropdown-item/dropdown-item.component"; import { DropdownTriggerDirective } from "../../../overlay/dropdown/dropdown-trigger/dropdown-trigger.directive"; -import { DropdownItemValueComponent } from "../../../overlay/dropdown/dropdown-item-value/dropdown-item-value.component"; -import { DropdownItemValueLabelComponent } from "../../../overlay/dropdown/dropdown-item-value/dropdown-item-value-label.component"; +import { OptionContentComponent } from "../../../helpers/option-content/option-content.component"; +import { OptionContentLabelComponent } from "../../../helpers/option-content/option-content-label.component"; import { TediTranslationService } from "../../../../services/translation/translation.service"; import { TEDI_TABLE_CONTEXT } from "../table.context"; import type { TediTableContextValue } from "../table.types"; @@ -29,8 +29,8 @@ import type { TediTableContextValue } from "../table.types"; DropdownContentComponent, DropdownItemComponent, DropdownTriggerDirective, - DropdownItemValueComponent, - DropdownItemValueLabelComponent, + OptionContentComponent, + OptionContentLabelComponent, ], templateUrl: "./table-columns-menu.component.html", styleUrl: "./table-columns-menu.component.scss", diff --git a/src/tedi/components/filter/filter.component.html b/src/tedi/components/filter/filter.component.html index 32331cd97..9f6939409 100644 --- a/src/tedi/components/filter/filter.component.html +++ b/src/tedi/components/filter/filter.component.html @@ -78,14 +78,14 @@ [id]="getOptionId(i)" (click)="!option.disabled && selectOption(option.value)" > - - {{ + {{ option.label - }} - + }} + } @@ -126,15 +126,15 @@ (keydown.space)="$event.preventDefault(); toggleSelectAll()" tabindex="0" > - - {{ + {{ resolvedSelectAllLabel() - }} - + }} + } @@ -169,15 +169,15 @@ [id]="getOptionId(i)" (click)="!option.disabled && toggleOption(option.value)" > - - {{ + {{ option.label - }} - + }} + } diff --git a/src/tedi/components/filter/filter.component.scss b/src/tedi/components/filter/filter.component.scss index 7185f74e7..0d1f33e5b 100644 --- a/src/tedi/components/filter/filter.component.scss +++ b/src/tedi/components/filter/filter.component.scss @@ -207,8 +207,8 @@ color: var(--dropdown-item-active-text); background: var(--dropdown-item-active-background); - .tedi-dropdown-item-value__label, - .tedi-dropdown-item-value__meta { + .tedi-option-content__label, + .tedi-option-content__meta { color: inherit; } diff --git a/src/tedi/components/filter/filter.component.spec.ts b/src/tedi/components/filter/filter.component.spec.ts index 5a0fa648e..72390cb79 100644 --- a/src/tedi/components/filter/filter.component.spec.ts +++ b/src/tedi/components/filter/filter.component.spec.ts @@ -423,67 +423,63 @@ describe("FilterComponent", () => { fixture.detectChanges(); }); - it("should render dropdown-item-value for each option", () => { + it("should render option-content for each option", () => { const items = fixture.debugElement.queryAll( - By.css(".tedi-filter-dropdown__options tedi-dropdown-item-value"), + By.css(".tedi-filter-dropdown__options tedi-option-content"), ); expect(items.length).toBe(TEST_OPTIONS.length); }); - it("should render dropdown-item-value with checkbox type", () => { + it("should render option-content with checkbox type", () => { const items = fixture.debugElement.queryAll( - By.css(".tedi-filter-dropdown__options tedi-dropdown-item-value"), + By.css(".tedi-filter-dropdown__options tedi-option-content"), ); items.forEach((item) => { expect(item.componentInstance.type()).toBe("checkbox"); }); }); - it("should render dropdown-item-value-label for each option", () => { + it("should render option-content-label for each option", () => { const labels = fixture.debugElement.queryAll( - By.css(".tedi-filter-dropdown__options tedi-dropdown-item-value-label"), + By.css(".tedi-filter-dropdown__options tedi-option-content-label"), ); expect(labels.length).toBe(TEST_OPTIONS.length); expect(labels[0].nativeElement.textContent.trim()).toBe("Option A"); }); - it("should pass selected state to dropdown-item-value", () => { + it("should pass selected state to option-content", () => { fixture.componentRef.setInput("value", ["a"]); fixture.detectChanges(); const items = fixture.debugElement.queryAll( - By.css(".tedi-filter-dropdown__options tedi-dropdown-item-value"), + By.css(".tedi-filter-dropdown__options tedi-option-content"), ); expect(items[0].componentInstance.selected()).toBe(true); expect(items[1].componentInstance.selected()).toBe(false); }); - it("should pass disabled state to dropdown-item-value", () => { + it("should pass disabled state to option-content", () => { const items = fixture.debugElement.queryAll( - By.css(".tedi-filter-dropdown__options tedi-dropdown-item-value"), + By.css(".tedi-filter-dropdown__options tedi-option-content"), ); expect(items[3].componentInstance.disabled()).toBe(true); expect(items[0].componentInstance.disabled()).toBe(false); }); - it("should render select-all with dropdown-item-value checkbox type", () => { + it("should render select-all with option-content checkbox type", () => { const selectAll = fixture.debugElement.query( - By.css( - ".tedi-filter-dropdown__item--select-all tedi-dropdown-item-value", - ), + By.css(".tedi-filter-dropdown__item--select-all tedi-option-content"), ); expect(selectAll).toBeTruthy(); expect(selectAll.componentInstance.type()).toBe("checkbox"); }); - it("should pass indeterminate state to select-all dropdown-item-value", () => { + it("should pass indeterminate state to select-all option-content", () => { fixture.componentRef.setInput("value", ["a"]); fixture.detectChanges(); const selectAll = fixture.debugElement.query( - By.css( - ".tedi-filter-dropdown__item--select-all tedi-dropdown-item-value", - ), + By.css(".tedi-filter-dropdown__item--select-all tedi-option-content"), ); expect(selectAll.componentInstance.indeterminate()).toBe(true); expect(selectAll.componentInstance.selected()).toBe(false); @@ -494,9 +490,7 @@ describe("FilterComponent", () => { fixture.detectChanges(); const selectAll = fixture.debugElement.query( - By.css( - ".tedi-filter-dropdown__item--select-all tedi-dropdown-item-value", - ), + By.css(".tedi-filter-dropdown__item--select-all tedi-option-content"), ); expect(selectAll.componentInstance.selected()).toBe(true); expect(selectAll.componentInstance.indeterminate()).toBe(false); @@ -853,7 +847,7 @@ describe("FilterComponent", () => { expect(options.nativeElement.getAttribute("tabindex")).toBe("0"); }); - it("should not have tabbable checkbox inputs inside dropdown-item-value", () => { + it("should not have tabbable checkbox inputs inside option-content", () => { const checkboxes = fixture.debugElement.queryAll( By.css(".tedi-filter-dropdown__options input[type='checkbox']"), ); @@ -1257,9 +1251,9 @@ describe("FilterComponent", () => { expect(badge).toBeNull(); }); - it("should render default type dropdown-item-value", () => { + it("should render default type option-content", () => { const items = fixture.debugElement.queryAll( - By.css(".tedi-filter-dropdown__options tedi-dropdown-item-value"), + By.css(".tedi-filter-dropdown__options tedi-option-content"), ); expect(items.length).toBe(TEST_OPTIONS.length); items.forEach((item) => { @@ -1493,7 +1487,7 @@ describe("FilterComponent", () => { it("should not render multiselect checkboxes", () => { const checkboxes = hostFixture.debugElement.queryAll( - By.css("tedi-dropdown-item-value"), + By.css("tedi-option-content"), ); expect(checkboxes.length).toBe(0); }); diff --git a/src/tedi/components/filter/filter.component.ts b/src/tedi/components/filter/filter.component.ts index c1bf2939f..e82544164 100644 --- a/src/tedi/components/filter/filter.component.ts +++ b/src/tedi/components/filter/filter.component.ts @@ -24,8 +24,8 @@ import { SeparatorComponent } from "../helpers/separator/separator.component"; import { DropdownComponent } from "../overlay/dropdown/dropdown.component"; import { DropdownTriggerDirective } from "../overlay/dropdown/dropdown-trigger/dropdown-trigger.directive"; import { DropdownContentComponent } from "../overlay/dropdown/dropdown-content/dropdown-content.component"; -import { DropdownItemValueComponent } from "../overlay/dropdown/dropdown-item-value/dropdown-item-value.component"; -import { DropdownItemValueLabelComponent } from "../overlay/dropdown/dropdown-item-value/dropdown-item-value-label.component"; +import { OptionContentComponent } from "../helpers/option-content/option-content.component"; +import { OptionContentLabelComponent } from "../helpers/option-content/option-content-label.component"; import { FormFieldComponent } from "../form/form-field/form-field.component"; import { TextFieldComponent } from "../form/text-field/text-field.component"; import { FilterContentDirective } from "./filter-content.directive"; @@ -53,8 +53,8 @@ export interface FilterOption { DropdownComponent, DropdownTriggerDirective, DropdownContentComponent, - DropdownItemValueComponent, - DropdownItemValueLabelComponent, + OptionContentComponent, + OptionContentLabelComponent, FormFieldComponent, TextFieldComponent, FilterContentDirective, diff --git a/src/tedi/components/form/input-group/input-group.stories.ts b/src/tedi/components/form/input-group/input-group.stories.ts index 2717a046a..ce72b8f64 100644 --- a/src/tedi/components/form/input-group/input-group.stories.ts +++ b/src/tedi/components/form/input-group/input-group.stories.ts @@ -24,9 +24,9 @@ import { DropdownComponent } from "../../overlay/dropdown/dropdown.component"; import { DropdownTriggerDirective } from "../../overlay/dropdown/dropdown-trigger/dropdown-trigger.directive"; import { DropdownContentComponent } from "../../overlay/dropdown/dropdown-content/dropdown-content.component"; import { DropdownItemComponent } from "../../overlay/dropdown/dropdown-item/dropdown-item.component"; -import { DropdownItemValueComponent } from "../../overlay/dropdown/dropdown-item-value/dropdown-item-value.component"; -import { DropdownItemValueLabelComponent } from "../../overlay/dropdown/dropdown-item-value/dropdown-item-value-label.component"; -import { DropdownItemValueMetaComponent } from "../../overlay/dropdown/dropdown-item-value/dropdown-item-value-meta.component"; +import { OptionContentComponent } from "../../helpers/option-content/option-content.component"; +import { OptionContentLabelComponent } from "../../helpers/option-content/option-content-label.component"; +import { OptionContentMetaComponent } from "../../helpers/option-content/option-content-meta.component"; import { SelectOptionTemplateDirective } from "../select/select-templates.directive"; /** @@ -69,9 +69,9 @@ const meta: Meta = { DropdownTriggerDirective, DropdownContentComponent, DropdownItemComponent, - DropdownItemValueComponent, - DropdownItemValueLabelComponent, - DropdownItemValueMetaComponent, + OptionContentComponent, + OptionContentLabelComponent, + OptionContentMetaComponent, SelectOptionTemplateDirective, ], }), @@ -212,10 +212,10 @@ export const StartDynamic: Story = { ellipsis="end" > - - {{ item.name }} - {{ item.number }} - + + {{ item.name }} + {{ item.number }} + @@ -498,10 +498,10 @@ export const AllControls: StoryObj = { ellipsis="end" > - - {{ item.name }} - {{ item.number }} - + + {{ item.name }} + {{ item.number }} + EUR diff --git a/src/tedi/components/form/search/search.stories.ts b/src/tedi/components/form/search/search.stories.ts index 0a59a0fa4..028f2e459 100644 --- a/src/tedi/components/form/search/search.stories.ts +++ b/src/tedi/components/form/search/search.stories.ts @@ -19,9 +19,9 @@ import { ColComponent } from "../../helpers/grid/col/col.component"; import { RowComponent } from "../../helpers/grid/row/row.component"; import { TextComponent } from "../../base/text/text.component"; import { ButtonComponent } from "../../buttons/button/button.component"; -import { DropdownItemValueComponent } from "../../overlay/dropdown/dropdown-item-value/dropdown-item-value.component"; -import { DropdownItemValueLabelComponent } from "../../overlay/dropdown/dropdown-item-value/dropdown-item-value-label.component"; -import { DropdownItemValueMetaComponent } from "../../overlay/dropdown/dropdown-item-value/dropdown-item-value-meta.component"; +import { OptionContentComponent } from "../../helpers/option-content/option-content.component"; +import { OptionContentLabelComponent } from "../../helpers/option-content/option-content-label.component"; +import { OptionContentMetaComponent } from "../../helpers/option-content/option-content-meta.component"; const SIZES = ["small", "default", "large"] as const; const PSEUDO_STATE = ["Default", "Hover", "Active", "Focus"]; @@ -129,9 +129,9 @@ export default { SearchFooterActionsComponent, SeparatorComponent, ButtonComponent, - DropdownItemValueComponent, - DropdownItemValueLabelComponent, - DropdownItemValueMetaComponent, + OptionContentComponent, + OptionContentLabelComponent, + OptionContentMetaComponent, ], }), ], @@ -610,10 +610,10 @@ export const AutocompleteCustomRow: Story = { (valueChange)="value.set($event)" > - - {{ item.name }} - {{ item.code }} - + + {{ item.name }} + {{ item.code }} + `, @@ -626,10 +626,10 @@ export const AutocompleteCustomRow: Story = { code: ` - - {{ item.name }} - {{ item.code }} - + + {{ item.name }} + {{ item.code }} + `, }, diff --git a/src/tedi/components/form/select/select.component.html b/src/tedi/components/form/select/select.component.html index 5a7cdeb84..692f562fe 100644 --- a/src/tedi/components/form/select/select.component.html +++ b/src/tedi/components/form/select/select.component.html @@ -273,15 +273,15 @@ [class.tedi-dropdown-item--active]="activeIndex() === 0" (click)="onVirtualSelectAllClick()" > - - {{ + {{ "select.select-all" | tediTranslate - }} - + }} + } } @else { - - {{ + {{ option.label - }} - + }} + } @@ -362,15 +362,15 @@ class="tedi-dropdown-item" [cdkOption]="SpecialOptionControls.SELECT_ALL" > - - {{ + {{ "select.select-all" | tediTranslate - }} - + }} + } @@ -381,15 +381,15 @@ class="tedi-dropdown-item tedi-select__group-name tedi-select__group-name--selectable" [cdkOption]="SpecialOptionControls.SELECT_GROUP + group.label" > - - {{ + {{ group.label - }} - + }} + } @else { } diff --git a/src/tedi/components/form/select/select.component.ts b/src/tedi/components/form/select/select.component.ts index 3669691d8..6e2247148 100644 --- a/src/tedi/components/form/select/select.component.ts +++ b/src/tedi/components/form/select/select.component.ts @@ -45,8 +45,8 @@ import { LabelComponent } from "../../content/label/label.component"; import { LabelRowComponent } from "../label-row/label-row.component"; import { TagComponent, TagEllipsis } from "../../tags/tag/tag.component"; import { EllipsisComponent, EllipsisPosition } from "../../helpers/ellipsis"; -import { DropdownItemValueComponent } from "../../overlay/dropdown/dropdown-item-value/dropdown-item-value.component"; -import { DropdownItemValueLabelComponent } from "../../overlay/dropdown/dropdown-item-value/dropdown-item-value-label.component"; +import { OptionContentComponent } from "../../helpers/option-content/option-content.component"; +import { OptionContentLabelComponent } from "../../helpers/option-content/option-content-label.component"; import { SelectOptionTemplateDirective, SelectValueTemplateDirective, @@ -100,8 +100,8 @@ export enum SpecialOptionControls { TextComponent, TagComponent, TediTranslationPipe, - DropdownItemValueComponent, - DropdownItemValueLabelComponent, + OptionContentComponent, + OptionContentLabelComponent, EllipsisComponent, ], templateUrl: "./select.component.html", diff --git a/src/tedi/components/form/select/select.stories.ts b/src/tedi/components/form/select/select.stories.ts index e5ab705ee..46b957c3c 100644 --- a/src/tedi/components/form/select/select.stories.ts +++ b/src/tedi/components/form/select/select.stories.ts @@ -18,9 +18,9 @@ import { TextGroupLabelComponent, TextGroupValueComponent, } from "../../content/text-group"; -import { DropdownItemValueComponent } from "../../overlay/dropdown/dropdown-item-value/dropdown-item-value.component"; -import { DropdownItemValueLabelComponent } from "../../overlay/dropdown/dropdown-item-value/dropdown-item-value-label.component"; -import { DropdownItemValueMetaComponent } from "../../overlay/dropdown/dropdown-item-value/dropdown-item-value-meta.component"; +import { OptionContentComponent } from "../../helpers/option-content/option-content.component"; +import { OptionContentLabelComponent } from "../../helpers/option-content/option-content-label.component"; +import { OptionContentMetaComponent } from "../../helpers/option-content/option-content-meta.component"; import { VerticalSpacingDirective } from "../../../directives/vertical-spacing/vertical-spacing.directive"; import { Component, signal } from "@angular/core"; import { AlertComponent } from "../../notifications/alert/alert.component"; @@ -77,9 +77,9 @@ const meta: Meta = { TextGroupComponent, TextGroupLabelComponent, TextGroupValueComponent, - DropdownItemValueComponent, - DropdownItemValueLabelComponent, - DropdownItemValueMetaComponent, + OptionContentComponent, + OptionContentLabelComponent, + OptionContentMetaComponent, IconComponent, ButtonComponent, VerticalSpacingDirective, @@ -905,10 +905,10 @@ export const Examples: Story = { [clearable]="false" > - - {{ item.title }} - {{ item.description }} - + + {{ item.title }} + {{ item.description }} + - - {{ item.name }} - {{ item.slots }} vaba aega - + + {{ item.name }} + {{ item.slots }} vaba aega + - - {{ item.title }} - + + {{ item.title }} + - - {{ item.title }} - {{ item.description }} - + + {{ item.title }} + {{ item.description }} + @@ -1007,9 +1007,9 @@ export const Examples: Story = { SelectComponent, SelectOptionTemplateDirective, ReactiveFormsModule, - DropdownItemValueComponent, - DropdownItemValueLabelComponent, - DropdownItemValueMetaComponent, + OptionContentComponent, + OptionContentLabelComponent, + OptionContentMetaComponent, VerticalSpacingDirective, AlertComponent, TextComponent, @@ -1031,14 +1031,14 @@ export const Examples: Story = { formControlName="location" > - - {{ + + {{ item.name - }} - {{ item.slots }} kohta + {{ item.slots }} kohta - + @@ -1052,18 +1052,18 @@ export const Examples: Story = { formControlName="access" > - - {{ + {{ item.title - }} - {{ + }} + {{ item.description - }} - + }} + @@ -1079,18 +1079,18 @@ export const Examples: Story = { formControlName="permissions" > - - {{ + {{ item.title - }} - {{ + }} + {{ item.description - }} - + }} + @@ -1194,9 +1194,9 @@ interface PermissionOption { imports: [ SelectComponent, SelectOptionTemplateDirective, - DropdownItemValueComponent, - DropdownItemValueLabelComponent, - DropdownItemValueMetaComponent, + OptionContentComponent, + OptionContentLabelComponent, + OptionContentMetaComponent, ], template: ` - - {{ + {{ item.title - }} - {{ + }} + {{ item.description - }} - + }} + `, @@ -1396,7 +1396,7 @@ export const VirtualScroll: Story = { story: "Renders a select with **5000 options** in single, searchable and multiselect modes, with " + "`virtualScroll` enabled so only the rows in view exist in the DOM. Each option uses a full " + - "`tedi-dropdown-item-value` template (icon + label + meta, plus a radio/checkbox indicator) " + + "`tedi-option-content` template (icon + label + meta, plus a radio/checkbox indicator) " + "to mirror real-world usage.", }, }, @@ -1418,11 +1418,11 @@ export const VirtualScroll: Story = { [virtualScroll]="true" > - + - {{ item.label }} - {{ item.description }} - + {{ item.label }} + {{ item.description }} + - + - {{ item.label }} - {{ item.description }} - + {{ item.label }} + {{ item.description }} + - + - {{ item.label }} - {{ item.description }} - + {{ item.label }} + {{ item.description }} + diff --git a/src/tedi/components/helpers/index.ts b/src/tedi/components/helpers/index.ts index a1e619de7..95d54a1a5 100644 --- a/src/tedi/components/helpers/index.ts +++ b/src/tedi/components/helpers/index.ts @@ -1,6 +1,7 @@ export * from "./attachment"; export * from "./ellipsis"; export * from "./grid"; +export * from "./option-content"; export * from "./scroll-fade"; export * from "./separator/separator.component"; export * from "./timeline"; diff --git a/src/tedi/components/helpers/option-content/index.ts b/src/tedi/components/helpers/option-content/index.ts new file mode 100644 index 000000000..9ce4e9d92 --- /dev/null +++ b/src/tedi/components/helpers/option-content/index.ts @@ -0,0 +1,3 @@ +export * from "./option-content.component"; +export * from "./option-content-label.component"; +export * from "./option-content-meta.component"; diff --git a/src/tedi/components/overlay/dropdown/dropdown-item-value/dropdown-item-value-label.component.ts b/src/tedi/components/helpers/option-content/option-content-label.component.ts similarity index 73% rename from src/tedi/components/overlay/dropdown/dropdown-item-value/dropdown-item-value-label.component.ts rename to src/tedi/components/helpers/option-content/option-content-label.component.ts index e77141aa1..17d40eec5 100644 --- a/src/tedi/components/overlay/dropdown/dropdown-item-value/dropdown-item-value-label.component.ts +++ b/src/tedi/components/helpers/option-content/option-content-label.component.ts @@ -6,17 +6,17 @@ import { } from "@angular/core"; @Component({ - selector: "tedi-dropdown-item-value-label", + selector: "tedi-option-content-label", template: ``, standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { - class: "tedi-dropdown-item-value__label", - "[class.tedi-dropdown-item-value__label--no-clip]": "!clipContent()", + class: "tedi-option-content__label", + "[class.tedi-option-content__label--no-clip]": "!clipContent()", }, }) -export class DropdownItemValueLabelComponent { +export class OptionContentLabelComponent { /** * Whether the label clips overflowing content for text ellipsis. Set `false` * when the label holds content with decorations that intentionally sit diff --git a/src/tedi/components/overlay/dropdown/dropdown-item-value/dropdown-item-value-meta.component.ts b/src/tedi/components/helpers/option-content/option-content-meta.component.ts similarity index 66% rename from src/tedi/components/overlay/dropdown/dropdown-item-value/dropdown-item-value-meta.component.ts rename to src/tedi/components/helpers/option-content/option-content-meta.component.ts index 7b9b28d3f..0fb7eb59a 100644 --- a/src/tedi/components/overlay/dropdown/dropdown-item-value/dropdown-item-value-meta.component.ts +++ b/src/tedi/components/helpers/option-content/option-content-meta.component.ts @@ -5,13 +5,13 @@ import { } from "@angular/core"; @Component({ - selector: "tedi-dropdown-item-value-meta", + selector: "tedi-option-content-meta", template: ``, standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { - class: "tedi-dropdown-item-value__meta", + class: "tedi-option-content__meta", }, }) -export class DropdownItemValueMetaComponent {} +export class OptionContentMetaComponent {} diff --git a/src/tedi/components/overlay/dropdown/dropdown-item-value/dropdown-item-value.component.html b/src/tedi/components/helpers/option-content/option-content.component.html similarity index 67% rename from src/tedi/components/overlay/dropdown/dropdown-item-value/dropdown-item-value.component.html rename to src/tedi/components/helpers/option-content/option-content.component.html index 2310d77db..165604651 100644 --- a/src/tedi/components/overlay/dropdown/dropdown-item-value/dropdown-item-value.component.html +++ b/src/tedi/components/helpers/option-content/option-content.component.html @@ -2,7 +2,7 @@ } -
- - +
+ +
diff --git a/src/tedi/components/overlay/dropdown/dropdown-item-value/dropdown-item-value.component.scss b/src/tedi/components/helpers/option-content/option-content.component.scss similarity index 90% rename from src/tedi/components/overlay/dropdown/dropdown-item-value/dropdown-item-value.component.scss rename to src/tedi/components/helpers/option-content/option-content.component.scss index c237f7241..c03a4db65 100644 --- a/src/tedi/components/overlay/dropdown/dropdown-item-value/dropdown-item-value.component.scss +++ b/src/tedi/components/helpers/option-content/option-content.component.scss @@ -1,4 +1,4 @@ -.tedi-dropdown-item-value { +.tedi-option-content { display: flex; gap: var(--dropdown-item-inner-spacing); align-items: center; @@ -9,7 +9,7 @@ align-items: flex-start; >input[tedi-checkbox][type="checkbox"], - >input.tedi-dropdown-item-value__radio, + >input.tedi-option-content__radio, >.tedi-icon { margin-top: calc((var(--body-regular-line-height) - var(--form-checkbox-radio-size-responsive)) / 2); } @@ -121,16 +121,16 @@ li[tedi-dropdown-item], &[aria-selected="true"], &.tedi-dropdown-item--selected { - .tedi-dropdown-item-value__label, - .tedi-dropdown-item-value__meta { + .tedi-option-content__label, + .tedi-option-content__meta { color: inherit; } } &:hover:not(.tedi-dropdown-item--disabled, [aria-disabled="true"]) { - .tedi-dropdown-item-value__label, - .tedi-dropdown-item-value__meta { + .tedi-option-content__label, + .tedi-option-content__meta { color: inherit; } } @@ -138,13 +138,13 @@ li[tedi-dropdown-item], &[aria-disabled="true"], &.tedi-dropdown-item--disabled { - .tedi-dropdown-item-value__label, - .tedi-dropdown-item-value__meta { + .tedi-option-content__label, + .tedi-option-content__meta { color: inherit; } } - &:has(.tedi-dropdown-item-value--checkbox, .tedi-dropdown-item-value--radio) { + &:has(.tedi-option-content--checkbox, .tedi-option-content--radio) { &[aria-selected="true"], &.tedi-dropdown-item--selected { @@ -159,7 +159,7 @@ li[tedi-dropdown-item], } &:hover:not(.tedi-dropdown-item--disabled, [aria-disabled="true"]) { - .tedi-dropdown-item-value__radio { + .tedi-option-content__radio { background-color: var(--form-checkbox-radio-default-background-hover); border-color: var(--form-checkbox-radio-default-border-hover); border-width: var(--tedi-borders-02); diff --git a/src/tedi/components/overlay/dropdown/dropdown-item-value/dropdown-item-value.component.spec.ts b/src/tedi/components/helpers/option-content/option-content.component.spec.ts similarity index 72% rename from src/tedi/components/overlay/dropdown/dropdown-item-value/dropdown-item-value.component.spec.ts rename to src/tedi/components/helpers/option-content/option-content.component.spec.ts index 18e68fd36..d7c60b2a2 100644 --- a/src/tedi/components/overlay/dropdown/dropdown-item-value/dropdown-item-value.component.spec.ts +++ b/src/tedi/components/helpers/option-content/option-content.component.spec.ts @@ -1,16 +1,16 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; import { By } from "@angular/platform-browser"; -import { DropdownItemValueComponent } from "./dropdown-item-value.component"; +import { OptionContentComponent } from "./option-content.component"; -describe("DropdownItemValueComponent", () => { - let fixture: ComponentFixture; +describe("OptionContentComponent", () => { + let fixture: ComponentFixture; beforeEach(() => { TestBed.configureTestingModule({ - imports: [DropdownItemValueComponent], + imports: [OptionContentComponent], }); - fixture = TestBed.createComponent(DropdownItemValueComponent); + fixture = TestBed.createComponent(OptionContentComponent); fixture.detectChanges(); }); @@ -23,7 +23,7 @@ describe("DropdownItemValueComponent", () => { fixture.detectChanges(); const input = fixture.debugElement.query( - By.css(".tedi-dropdown-item-value__checkbox"), + By.css(".tedi-option-content__checkbox"), ).nativeElement as HTMLInputElement; expect(input.getAttribute("aria-hidden")).toBe("true"); @@ -35,7 +35,7 @@ describe("DropdownItemValueComponent", () => { fixture.detectChanges(); const input = fixture.debugElement.query( - By.css(".tedi-dropdown-item-value__radio"), + By.css(".tedi-option-content__radio"), ).nativeElement as HTMLInputElement; expect(input.getAttribute("aria-hidden")).toBe("true"); diff --git a/src/tedi/components/overlay/dropdown/dropdown-item-value/dropdown-item-value.component.ts b/src/tedi/components/helpers/option-content/option-content.component.ts similarity index 60% rename from src/tedi/components/overlay/dropdown/dropdown-item-value/dropdown-item-value.component.ts rename to src/tedi/components/helpers/option-content/option-content.component.ts index 3b11efb64..24df637aa 100644 --- a/src/tedi/components/overlay/dropdown/dropdown-item-value/dropdown-item-value.component.ts +++ b/src/tedi/components/helpers/option-content/option-content.component.ts @@ -4,42 +4,42 @@ import { input, ViewEncapsulation, } from "@angular/core"; -import { CheckboxComponent } from "../../../form/checkbox/checkbox.component"; +import { CheckboxComponent } from "../../form/checkbox/checkbox.component"; -export type DropdownItemValueType = "default" | "checkbox" | "radio"; -export type DropdownItemValueLayout = "horizontal" | "vertical"; +export type OptionContentType = "default" | "checkbox" | "radio"; +export type OptionContentLayout = "horizontal" | "vertical"; @Component({ - selector: "tedi-dropdown-item-value", - templateUrl: "./dropdown-item-value.component.html", - styleUrl: "./dropdown-item-value.component.scss", + selector: "tedi-option-content", + templateUrl: "./option-content.component.html", + styleUrl: "./option-content.component.scss", standalone: true, imports: [CheckboxComponent], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { - class: "tedi-dropdown-item-value", - "[class.tedi-dropdown-item-value--vertical]": "layout() === 'vertical'", - "[class.tedi-dropdown-item-value--horizontal]": "layout() === 'horizontal'", - "[class.tedi-dropdown-item-value--checkbox]": "type() === 'checkbox'", - "[class.tedi-dropdown-item-value--radio]": "type() === 'radio'", + class: "tedi-option-content", + "[class.tedi-option-content--vertical]": "layout() === 'vertical'", + "[class.tedi-option-content--horizontal]": "layout() === 'horizontal'", + "[class.tedi-option-content--checkbox]": "type() === 'checkbox'", + "[class.tedi-option-content--radio]": "type() === 'radio'", }, }) -export class DropdownItemValueComponent { +export class OptionContentComponent { /** - * Type of item value - controls selection indicator + * Type of option content - controls selection indicator * - 'default': No selection indicator * - 'checkbox': Shows checkbox (for multiselect) * - 'radio': Shows radio button (for single select listbox) * @default 'default' */ - readonly type = input("default"); + readonly type = input("default"); /** * Layout: 'horizontal' (side-by-side) or 'vertical' (stacked) * @default 'horizontal' */ - readonly layout = input("horizontal"); + readonly layout = input("horizontal"); /** * Whether the item is selected (controls checkbox/radio state) diff --git a/src/tedi/components/helpers/option-content/option-content.stories.ts b/src/tedi/components/helpers/option-content/option-content.stories.ts new file mode 100644 index 000000000..f2c53bbe6 --- /dev/null +++ b/src/tedi/components/helpers/option-content/option-content.stories.ts @@ -0,0 +1,319 @@ +import { type Meta, type StoryObj, moduleMetadata } from "@storybook/angular"; +import { OptionContentComponent } from "./option-content.component"; +import { OptionContentLabelComponent } from "./option-content-label.component"; +import { OptionContentMetaComponent } from "./option-content-meta.component"; +import { IconComponent } from "../../base"; +import { VerticalSpacingDirective } from "../../../directives/vertical-spacing/vertical-spacing.directive"; + +/** + * The OptionContent component provides a reusable structure for rendering option content + * in both Select and Dropdown components. It supports built-in checkbox/radio indicators + * and flexible layouts for label and meta text. + * + * ## Usage + * + * Use this component inside dropdown items or select options to render structured content + * with optional selection indicators. + * + * ### Basic usage + * ```html + * + * Option 1 + * + * ``` + * + * ### With meta text + * ```html + * + * Tallinn + * 3 timeslots + * + * ``` + * + * ### With checkbox (multiselect) + * ```html + * + * Option 1 + * + * ``` + */ + +export default { + title: "TEDI-Ready/Components/Helpers/OptionContent", + component: OptionContentComponent, + decorators: [ + moduleMetadata({ + imports: [ + OptionContentComponent, + OptionContentLabelComponent, + OptionContentMetaComponent, + IconComponent, + VerticalSpacingDirective, + ], + }), + ], + argTypes: { + type: { + control: "radio", + options: ["default", "checkbox", "radio"], + description: "Type of selection indicator", + table: { + type: { summary: "OptionContentType" }, + defaultValue: { summary: "default" }, + }, + }, + layout: { + control: "radio", + options: ["horizontal", "vertical"], + description: "Layout of label and meta content", + table: { + type: { summary: "OptionContentLayout" }, + defaultValue: { summary: "horizontal" }, + }, + }, + selected: { + control: "boolean", + description: + "Whether the item is selected (controls checkbox/radio state)", + table: { + type: { summary: "boolean" }, + defaultValue: { summary: "false" }, + }, + }, + disabled: { + control: "boolean", + description: "Whether the item is disabled", + table: { + type: { summary: "boolean" }, + defaultValue: { summary: "false" }, + }, + }, + clipContent: { + control: "boolean", + description: + "`tedi-option-content-label` input. Whether the label clips overflowing content for text ellipsis. Set `false` when the label holds decorations that sit outside the line box (e.g. status indicator), so they are not cut off.", + table: { + type: { summary: "boolean" }, + defaultValue: { summary: "true" }, + }, + }, + }, + args: { + type: "default", + layout: "horizontal", + selected: false, + disabled: false, + clipContent: true, + }, +} as Meta; + +type Story = StoryObj; + +export const Default: Story = { + parameters: { chromatic: { disableSnapshot: true } }, + render: (args) => ({ + props: args, + template: ` + + Option 1 + + `, + }), +}; + +export const WithMeta: Story = { + parameters: { chromatic: { disableSnapshot: true } }, + name: "With Meta (Horizontal)", + render: () => ({ + template: ` + + Tallinn + 3 timeslots available + + `, + }), +}; + +export const Vertical: Story = { + parameters: { chromatic: { disableSnapshot: true } }, + name: "Vertical Layout", + render: () => ({ + template: ` + + Access to health data + Doctors will be able to see your health data + + `, + }), +}; + +export const WithCheckbox: Story = { + name: "With Checkbox", + render: () => ({ + props: { + selected: false, + }, + template: ` +
+ + Unchecked option + + + Checked option + + + Disabled option + + + Disabled checked option + +
+ `, + }), +}; + +export const WithRadio: Story = { + name: "With Radio", + render: () => ({ + template: ` +
+ + Unselected option + + + Selected option + + + Disabled option + + + Disabled selected option + +
+ `, + }), +}; + +export const WithIcon: Story = { + parameters: { chromatic: { disableSnapshot: true } }, + name: "With Leading Icon", + render: () => ({ + template: ` +
+ + + Desktop + + + + Phone + + + + Tablet + +
+ `, + }), +}; + +export const WithIconAndMeta: Story = { + name: "With Icon and Meta", + render: () => ({ + template: ` +
+ + + Tallinn + 3 timeslots + + + + Tartu + 5 timeslots + +
+ `, + }), +}; + +export const CheckboxWithMeta: Story = { + name: "Checkbox with Meta (Vertical)", + render: () => ({ + template: ` +
+ + Access to health data + Doctors will be able to see your health data + + + Access to medications + Doctors will be able to see your medications + +
+ `, + }), +}; + +export const AllVariants: Story = { + name: "All Variants", + render: () => ({ + template: ` +
+
+ Default (Label only) + + Option 1 + +
+ +
+ Horizontal (Label + Meta) + + Tallinn + 3 timeslots available + +
+ +
+ Vertical (Label + Description) + + Access to health data + Doctors will be able to see your health data + +
+ +
+ With Checkbox (Multiselect) + + Selected option + +
+ +
+ With Radio (Single select) + + Selected option + +
+ +
+ With Leading Icon + + + Desktop + +
+ +
+ Full Example (Checkbox + Icon + Vertical) + + + Admin permissions + Full access to all features and settings + +
+
+ `, + }), +}; diff --git a/src/tedi/components/overlay/dropdown/dropdown-item-value/dropdown-item-value.stories.ts b/src/tedi/components/overlay/dropdown/dropdown-item-value/dropdown-item-value.stories.ts deleted file mode 100644 index 51517cfd0..000000000 --- a/src/tedi/components/overlay/dropdown/dropdown-item-value/dropdown-item-value.stories.ts +++ /dev/null @@ -1,319 +0,0 @@ -import { type Meta, type StoryObj, moduleMetadata } from "@storybook/angular"; -import { DropdownItemValueComponent } from "./dropdown-item-value.component"; -import { DropdownItemValueLabelComponent } from "./dropdown-item-value-label.component"; -import { DropdownItemValueMetaComponent } from "./dropdown-item-value-meta.component"; -import { IconComponent } from "../../../base"; -import { VerticalSpacingDirective } from "../../../../directives/vertical-spacing/vertical-spacing.directive"; - -/** - * The DropdownItemValue component provides a reusable structure for rendering option content - * in both Select and Dropdown components. It supports built-in checkbox/radio indicators - * and flexible layouts for label and meta text. - * - * ## Usage - * - * Use this component inside dropdown items or select options to render structured content - * with optional selection indicators. - * - * ### Basic usage - * ```html - * - * Option 1 - * - * ``` - * - * ### With meta text - * ```html - * - * Tallinn - * 3 timeslots - * - * ``` - * - * ### With checkbox (multiselect) - * ```html - * - * Option 1 - * - * ``` - */ - -export default { - title: "TEDI-Ready/Components/Overlay/DropdownItemValue", - component: DropdownItemValueComponent, - decorators: [ - moduleMetadata({ - imports: [ - DropdownItemValueComponent, - DropdownItemValueLabelComponent, - DropdownItemValueMetaComponent, - IconComponent, - VerticalSpacingDirective, - ], - }), - ], - argTypes: { - type: { - control: "radio", - options: ["default", "checkbox", "radio"], - description: "Type of selection indicator", - table: { - type: { summary: "DropdownItemValueType" }, - defaultValue: { summary: "default" }, - }, - }, - layout: { - control: "radio", - options: ["horizontal", "vertical"], - description: "Layout of label and meta content", - table: { - type: { summary: "DropdownItemValueLayout" }, - defaultValue: { summary: "horizontal" }, - }, - }, - selected: { - control: "boolean", - description: - "Whether the item is selected (controls checkbox/radio state)", - table: { - type: { summary: "boolean" }, - defaultValue: { summary: "false" }, - }, - }, - disabled: { - control: "boolean", - description: "Whether the item is disabled", - table: { - type: { summary: "boolean" }, - defaultValue: { summary: "false" }, - }, - }, - clipContent: { - control: "boolean", - description: - "`tedi-dropdown-item-value-label` input. Whether the label clips overflowing content for text ellipsis. Set `false` when the label holds decorations that sit outside the line box (e.g. status indicator), so they are not cut off.", - table: { - type: { summary: "boolean" }, - defaultValue: { summary: "true" }, - }, - }, - }, - args: { - type: "default", - layout: "horizontal", - selected: false, - disabled: false, - clipContent: true, - }, -} as Meta; - -type Story = StoryObj; - -export const Default: Story = { - parameters: { chromatic: { disableSnapshot: true } }, - render: (args) => ({ - props: args, - template: ` - - Option 1 - - `, - }), -}; - -export const WithMeta: Story = { - parameters: { chromatic: { disableSnapshot: true } }, - name: "With Meta (Horizontal)", - render: () => ({ - template: ` - - Tallinn - 3 timeslots available - - `, - }), -}; - -export const Vertical: Story = { - parameters: { chromatic: { disableSnapshot: true } }, - name: "Vertical Layout", - render: () => ({ - template: ` - - Access to health data - Doctors will be able to see your health data - - `, - }), -}; - -export const WithCheckbox: Story = { - name: "With Checkbox", - render: () => ({ - props: { - selected: false, - }, - template: ` -
- - Unchecked option - - - Checked option - - - Disabled option - - - Disabled checked option - -
- `, - }), -}; - -export const WithRadio: Story = { - name: "With Radio", - render: () => ({ - template: ` -
- - Unselected option - - - Selected option - - - Disabled option - - - Disabled selected option - -
- `, - }), -}; - -export const WithIcon: Story = { - parameters: { chromatic: { disableSnapshot: true } }, - name: "With Leading Icon", - render: () => ({ - template: ` -
- - - Desktop - - - - Phone - - - - Tablet - -
- `, - }), -}; - -export const WithIconAndMeta: Story = { - name: "With Icon and Meta", - render: () => ({ - template: ` -
- - - Tallinn - 3 timeslots - - - - Tartu - 5 timeslots - -
- `, - }), -}; - -export const CheckboxWithMeta: Story = { - name: "Checkbox with Meta (Vertical)", - render: () => ({ - template: ` -
- - Access to health data - Doctors will be able to see your health data - - - Access to medications - Doctors will be able to see your medications - -
- `, - }), -}; - -export const AllVariants: Story = { - name: "All Variants", - render: () => ({ - template: ` -
-
- Default (Label only) - - Option 1 - -
- -
- Horizontal (Label + Meta) - - Tallinn - 3 timeslots available - -
- -
- Vertical (Label + Description) - - Access to health data - Doctors will be able to see your health data - -
- -
- With Checkbox (Multiselect) - - Selected option - -
- -
- With Radio (Single select) - - Selected option - -
- -
- With Leading Icon - - - Desktop - -
- -
- Full Example (Checkbox + Icon + Vertical) - - - Admin permissions - Full access to all features and settings - -
-
- `, - }), -}; diff --git a/src/tedi/components/overlay/dropdown/dropdown-item-value/index.ts b/src/tedi/components/overlay/dropdown/dropdown-item-value/index.ts deleted file mode 100644 index d0f3889c3..000000000 --- a/src/tedi/components/overlay/dropdown/dropdown-item-value/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./dropdown-item-value.component"; -export * from "./dropdown-item-value-label.component"; -export * from "./dropdown-item-value-meta.component"; diff --git a/src/tedi/components/overlay/dropdown/dropdown-item/dropdown-item.component.html b/src/tedi/components/overlay/dropdown/dropdown-item/dropdown-item.component.html index cc82ca6c7..4819f6a39 100644 --- a/src/tedi/components/overlay/dropdown/dropdown-item/dropdown-item.component.html +++ b/src/tedi/components/overlay/dropdown/dropdown-item/dropdown-item.component.html @@ -1,9 +1,9 @@ - + -@if (!customItemValue()) { - - +@if (!customOptionContent()) { + + - - + + } diff --git a/src/tedi/components/overlay/dropdown/dropdown-item/dropdown-item.component.ts b/src/tedi/components/overlay/dropdown/dropdown-item/dropdown-item.component.ts index 0b0478528..1c388be07 100644 --- a/src/tedi/components/overlay/dropdown/dropdown-item/dropdown-item.component.ts +++ b/src/tedi/components/overlay/dropdown/dropdown-item/dropdown-item.component.ts @@ -18,15 +18,15 @@ import { DropdownApi, DropdownContentApi, } from "../dropdown.tokens"; -import { DropdownItemValueComponent } from "../dropdown-item-value/dropdown-item-value.component"; -import { DropdownItemValueLabelComponent } from "../dropdown-item-value/dropdown-item-value-label.component"; +import { OptionContentComponent } from "../../../helpers/option-content/option-content.component"; +import { OptionContentLabelComponent } from "../../../helpers/option-content/option-content-label.component"; const INTERACTIVE_CONTENT_SELECTOR = "a[href], button"; @Component({ selector: "li[tedi-dropdown-item]", standalone: true, - imports: [DropdownItemValueComponent, DropdownItemValueLabelComponent], + imports: [OptionContentComponent, OptionContentLabelComponent], templateUrl: "./dropdown-item.component.html", styleUrl: "./dropdown-item.component.scss", encapsulation: ViewEncapsulation.None, @@ -87,8 +87,8 @@ export class DropdownItemComponent { readonly dropdown = inject(DROPDOWN_API); readonly dropdownContent = inject(DROPDOWN_CONTENT_API); - /** Check if custom dropdown-item-value is provided */ - readonly customItemValue = contentChild(DropdownItemValueComponent); + /** Check if custom option content is provided */ + readonly customOptionContent = contentChild(OptionContentComponent); private readonly renderer = inject(Renderer2); private readonly destroyRef = inject(DestroyRef); diff --git a/src/tedi/components/overlay/dropdown/dropdown.stories.ts b/src/tedi/components/overlay/dropdown/dropdown.stories.ts index 6816abacb..57cbb6ac0 100644 --- a/src/tedi/components/overlay/dropdown/dropdown.stories.ts +++ b/src/tedi/components/overlay/dropdown/dropdown.stories.ts @@ -10,9 +10,9 @@ import { DropdownRole, } from "./dropdown-content/dropdown-content.component"; import { DropdownItemComponent } from "./dropdown-item/dropdown-item.component"; -import { DropdownItemValueComponent } from "./dropdown-item-value/dropdown-item-value.component"; -import { DropdownItemValueLabelComponent } from "./dropdown-item-value/dropdown-item-value-label.component"; -import { DropdownItemValueMetaComponent } from "./dropdown-item-value/dropdown-item-value-meta.component"; +import { OptionContentComponent } from "../../helpers/option-content/option-content.component"; +import { OptionContentLabelComponent } from "../../helpers/option-content/option-content-label.component"; +import { OptionContentMetaComponent } from "../../helpers/option-content/option-content-meta.component"; import { ButtonComponent } from "../../buttons/button/button.component"; import { IconComponent } from "../../base"; import { expect, userEvent, waitFor, within } from "storybook/test"; @@ -59,9 +59,9 @@ export default { DropdownTriggerDirective, DropdownContentComponent, DropdownItemComponent, - DropdownItemValueComponent, - DropdownItemValueLabelComponent, - DropdownItemValueMetaComponent, + OptionContentComponent, + OptionContentLabelComponent, + OptionContentMetaComponent, ButtonComponent, IconComponent, DemoWrappingButtonComponent, @@ -237,22 +237,22 @@ export const WithMeta: Story = {
  • - - Tallinn - 3 timeslots - + + Tallinn + 3 timeslots +
  • - - Tartu - 5 timeslots - + + Tartu + 5 timeslots +
  • - - Pärnu - 2 timeslots - + + Pärnu + 2 timeslots +
  • @@ -278,22 +278,22 @@ export const WithIcons: Story = {
  • - + - Edit - + Edit +
  • - + - Duplicate - + Duplicate +
  • - + - Delete - + Delete +
  • @@ -319,22 +319,22 @@ export const VerticalLayout: Story = {
  • - - Access to health data - Doctors will be able to see your health data - + + Access to health data + Doctors will be able to see your health data +
  • - - Access to medications - Doctors will be able to see your medications - + + Access to medications + Doctors will be able to see your medications +
  • - - Access to all - Doctors will be able to see all your information - + + Access to all + Doctors will be able to see all your information +
  • @@ -426,13 +426,13 @@ export const KeepOpenOnSelect: Story = { [closeOnSelect]="false" (itemSelect)="toggleFilter(filters, filter.id)" > - - {{ filter.label }} - + {{ filter.label }} + } @@ -487,22 +487,22 @@ export const OpenWithIconsForVisualTest: Story = {
  • - + - Edit - + Edit +
  • - + - Duplicate - + Duplicate +
  • - + - Delete - + Delete +
  • @@ -539,22 +539,22 @@ export const OpenListboxMetaForVisualTest: Story = {
  • - - Tallinn - 3 timeslots - + + Tallinn + 3 timeslots +
  • - - Tartu - 5 timeslots - + + Tartu + 5 timeslots +
  • - - Pärnu - 2 timeslots - + + Pärnu + 2 timeslots +
  • diff --git a/src/tedi/components/overlay/dropdown/index.ts b/src/tedi/components/overlay/dropdown/index.ts index e821f7e86..c3d82c484 100644 --- a/src/tedi/components/overlay/dropdown/index.ts +++ b/src/tedi/components/overlay/dropdown/index.ts @@ -1,6 +1,5 @@ export * from "./dropdown.tokens"; export * from "./dropdown-content/dropdown-content.component"; export * from "./dropdown-item/dropdown-item.component"; -export * from "./dropdown-item-value"; export * from "./dropdown-trigger/dropdown-trigger.directive"; export * from "./dropdown.component"; diff --git a/src/tedi/components/overlay/popover/popover.stories.ts b/src/tedi/components/overlay/popover/popover.stories.ts index fa7f49645..8b46d6e68 100644 --- a/src/tedi/components/overlay/popover/popover.stories.ts +++ b/src/tedi/components/overlay/popover/popover.stories.ts @@ -15,8 +15,8 @@ import { ToggleComponent } from "../../form/toggle/toggle.component"; import { SeparatorComponent } from "../../helpers/separator/separator.component"; import { EmptyStateComponent } from "../../content/empty-state/empty-state.component"; import { LabelComponent } from "../../content/label/label.component"; -import { DropdownItemValueComponent } from "../dropdown/dropdown-item-value/dropdown-item-value.component"; -import { DropdownItemValueLabelComponent } from "../dropdown/dropdown-item-value/dropdown-item-value-label.component"; +import { OptionContentComponent } from "../../helpers/option-content/option-content.component"; +import { OptionContentLabelComponent } from "../../helpers/option-content/option-content-label.component"; import { SearchComponent } from "../../form/search/search.component"; import { expect, userEvent, waitFor, within } from "storybook/test"; @@ -104,8 +104,8 @@ export default { EmptyStateComponent, LabelComponent, SearchComponent, - DropdownItemValueComponent, - DropdownItemValueLabelComponent, + OptionContentComponent, + OptionContentLabelComponent, ], }), ], @@ -522,29 +522,29 @@ export const WithProminentBorder: Story = {
    - - Minu profiil - + + Minu profiil +
    - - Esindatavad - + + Esindatavad +
    - - Kontaktid - + + Kontaktid +
    - + - Logi välja - + Logi välja +