@magmonium/one 0.4.64 → 0.4.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,8 +5,8 @@ import { t as ButtonComponent } from "./magmonium-one-button-BvX-kWgh.mjs";
5
5
  import { t as assetOptions } from "./magmonium-one-options-asset-BNd1hbLw.mjs";
6
6
  import "./magmonium-one-directives-DM6J1Hvs.mjs";
7
7
  import { t as BaseInputComponent } from "./magmonium-one-base-input-B92NOmxz.mjs";
8
- import { t as TextOutputComponent } from "./magmonium-one-text-output-nJBGhbwG.mjs";
9
- import { t as TextInputComponent } from "./magmonium-one-text-DT9ia02A.mjs";
8
+ import { t as TextOutputComponent } from "./magmonium-one-text-output-9QMznoe1.mjs";
9
+ import { t as TextInputComponent } from "./magmonium-one-text-DLKgk_bm.mjs";
10
10
  import * as i0 from "@angular/core";
11
11
  import { ChangeDetectionStrategy, Component, Directive, ElementRef, computed, effect, inject, input, inputBinding, linkedSignal, model, output, outputBinding, signal, viewChild } from "@angular/core";
12
12
  var DropdownBoxComponent = class DropdownBoxComponent {
@@ -603,4 +603,4 @@ i0.ɵɵngDeclareClassMetadata({
603
603
  });
604
604
  export { DROPDOWN_IMPORTS as n, DROPDOWN_TEMPLATE as r, BaseDropdownComponent as t };
605
605
 
606
- //# sourceMappingURL=magmonium-one-base-dropdown-DgfWj1wC.mjs.map
606
+ //# sourceMappingURL=magmonium-one-base-dropdown-BT3zFQ6c.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"magmonium-one-base-dropdown-DgfWj1wC.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/ui/dropdown/dropdown-box.ts","../../../../libs/one/src/lib/shared/ui/input/ui/dropdown/base-dropdown.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n effect,\n ElementRef,\n inject,\n input,\n output,\n} from '@angular/core';\nimport { TranslatePipe } from '../../../../pipe/translate';\nimport { DropdownOption, DropdownValue } from '../../model/input';\n\n@Component({\n selector: 'm-dropdown-box',\n imports: [TranslatePipe],\n template: `\n <ul class=\"dropdown-box\" role=\"listbox\">\n @for (option of options(); track option.value; let i = $index) {\n @let selectedState = isSelected(option.value);\n <li\n class=\"dropdown-box__option\"\n [class.dropdown-box__option--selected]=\"selectedState\"\n [class.dropdown-box__option--disabled]=\"option.disabled\"\n [class.dropdown-box__option--active]=\"i === activeIndex()\"\n [style.--m-dropdown-option-depth]=\"option.depth\"\n role=\"option\"\n [attr.aria-selected]=\"selectedState\"\n [attr.data-value]=\"option.value\"\n (click)=\"selectOption(option)\"\n (keydown.enter)=\"selectOption(option)\"\n tabindex=\"0\"\n >\n <!-- A group header is a row, never a choice: no box to tick. -->\n @if (multiple() && !option.disabled) {\n <input\n type=\"checkbox\"\n class=\"dropdown-box__checkbox\"\n [checked]=\"selectedState\"\n tabindex=\"-1\"\n (click)=\"$event.preventDefault()\"\n />\n }\n @if (option.noTranslate) {\n {{ option.label }}\n } @else {\n {{ option.label | translate }}\n }\n </li>\n } @empty {\n <li class=\"dropdown-box__empty\">\n {{ 'no-results-found' | translate }}\n </li>\n }\n </ul>\n `,\n styleUrl: './dropdown-box.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DropdownBoxComponent {\n readonly options = input<DropdownOption<DropdownValue>[]>([]);\n /** The values ticked, as a list whichever Field drew the panel. */\n readonly selected = input<readonly DropdownValue[]>([]);\n readonly multiple = input<boolean>(false);\n readonly activeIndex = input<number>(-1);\n readonly action = output<DropdownOption<DropdownValue>>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n // Keep the keyboard-active option in view as ↑/↓ walk a scrolled list.\n constructor() {\n effect(() => {\n const index = this.activeIndex();\n if (index < 0) return;\n this.host.nativeElement\n .querySelectorAll('.dropdown-box__option')\n [index]?.scrollIntoView?.({ block: 'nearest' });\n });\n }\n\n protected readonly isSelected = (value: DropdownValue): boolean =>\n this.selected().includes(value);\n\n // Only emit a selection event for enabled options.\n protected readonly selectOption = (\n option: DropdownOption<DropdownValue>\n ): void => {\n if (option.disabled) return;\n this.action.emit(option);\n };\n}\n","import {\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n inputBinding,\n linkedSignal,\n model,\n outputBinding,\n Signal,\n signal,\n viewChild,\n} from '@angular/core';\nimport { ValidationError, WithOptionalFieldTree } from '@angular/forms/signals';\nimport { LabelComponent } from '../label';\nimport { TextOutputComponent } from '../../../text-output';\nimport { BaseInputComponent } from '../../lib/base-input';\nimport { Button } from '../../../button/type/button';\nimport { ButtonComponent } from '../../../button/ui/button';\nimport { TranslateService } from '../../../../services';\nimport { SelectorConfig, SelectorDirective } from '../../../../directives';\nimport { Direction } from '../../../../directives/selector/selector-type';\nimport { DropdownBoxComponent } from './dropdown-box';\nimport {\n DropdownInput,\n DropdownOption,\n DropdownValue,\n TextInput,\n} from '../../model/input';\nimport { TextInputComponent } from '../text/text';\nimport { assetOptions } from '../../lib/options-asset';\n\n/** The trigger both option Fields draw: a searchable text input and a chevron. */\nexport const DROPDOWN_TEMPLATE = `\n @if (config(); as dropdown) {\n @if (dropdown.label) {\n <m-label\n [for]=\"dropdown.name ?? ''\"\n [placeholder]=\"dropdown.label\"\n [params]=\"dropdown.params\"\n [required]=\"required()\"\n [disabled]=\"disabled()\"\n />\n }\n <div\n class=\"trigger-wrap\"\n #wrapper\n [mSelector]=\"selectorConfig()\"\n [disabled]=\"disabled() || readonly() || !!config()?.readonly\"\n (opened)=\"onOpened()\"\n (closed)=\"onClosed()\"\n (focusin)=\"isFocused.set(true)\"\n (focusout)=\"isFocused.set(false)\"\n >\n <m-text-input\n [config]=\"triggerInputConfig()\"\n [value]=\"displayValue()\"\n [disabled]=\"disabled()\"\n [invalid]=\"invalid()\"\n [hideErrors]=\"true\"\n [(touched)]=\"touched\"\n [focused]=\"focused()\"\n (valueChange)=\"onInput($event)\"\n (click)=\"preventToggleWhenOpen($event)\"\n (keydown.space)=\"$event.stopPropagation()\"\n (keydown.enter)=\"onEnter($event)\"\n (keydown.arrowdown)=\"onArrow($event, 1)\"\n (keydown.arrowup)=\"onArrow($event, -1)\"\n (keydown.tab)=\"$event.stopPropagation()\"\n />\n <m-button [disabled]=\"disabled()\" [config]=\"chevron()\" />\n </div>\n @if (showErrors()) {\n @for (error of errors(); track $index) {\n <m-text-output\n variant=\"footer\"\n color=\"error\"\n [label]=\"error.message\"\n />\n }\n }\n }\n`;\n\nexport const DROPDOWN_IMPORTS = [\n LabelComponent,\n TextOutputComponent,\n TextInputComponent,\n ButtonComponent,\n SelectorDirective,\n];\n\n/**\n * Everything a Dropdown and a Multiselect share: the options, the search, the\n * keyboard walk and the panel. What differs is only what the Field holds — one\n * value or a list — so a subclass says which values are selected and what a\n * pick does to them.\n */\n@Directive()\nexport abstract class BaseDropdownComponent extends BaseInputComponent<DropdownInput> {\n public override config = input<Partial<DropdownInput> | undefined>();\n public override required = input<boolean>(false);\n public override disabled = input<boolean>(false);\n public override invalid = input<boolean>(false);\n public override touched = model<boolean>(false);\n public override focused = input<boolean>(false);\n public override errors = input<readonly WithOptionalFieldTree<ValidationError>[]>(\n []\n );\n public override showErrors = computed(() => this.touched() && this.invalid());\n\n readonly options = input<\n DropdownOption<DropdownValue>[] | Signal<DropdownOption<DropdownValue>[]>\n >();\n readonly dir = input<Direction>();\n readonly toggle = model(false);\n readonly searchTerm = signal('');\n readonly isFocused = signal(false);\n readonly chevron = computed(\n () =>\n <Button>{\n icon: this.toggle() ? 'chevron-up' : 'chevron-down',\n one: true,\n variant: 'ghost',\n // In-Field control, never the form's submit — without this the Button\n // reads as the submit control and greys out while the form is invalid.\n type: 'button',\n // Chevron tracks the trigger's border like the text input's own icon:\n // red while the Field shows errors, focus tint while focused, border at rest.\n color: this.showErrors()\n ? 'error'\n : this.isFocused()\n ? 'focus'\n : 'border',\n // The trigger input is the Field's tab stop; the chevron only repeats\n // what clicking that input already does, so Tab walks past it.\n tabindex: -1,\n }\n );\n\n /** The values the Field holds now, as a list whichever kind it is. */\n protected abstract readonly selectedValues: Signal<readonly DropdownValue[]>;\n /** Whether the panel ticks rows and stays open across picks. */\n protected abstract readonly multiple: boolean;\n /** What picking `option` does to the Field's value. */\n protected abstract selectOption(option: DropdownOption<DropdownValue>): void;\n\n protected readonly triggerInputConfig = computed(() => {\n const dropdown = this.config() as DropdownInput | undefined;\n return <Partial<TextInput>>{\n name: dropdown?.name,\n icon: dropdown?.icon,\n one: dropdown?.one,\n placeholder: this.placeholderText(),\n readonly: this.readonly() || !!dropdown?.readonly,\n };\n });\n\n protected readonly dropdownOptions = computed(\n (): DropdownOption<DropdownValue>[] => {\n const runtimeOptions = this.options();\n const source =\n runtimeOptions ?? (this.config() as DropdownInput | undefined)?.options;\n if (typeof source === 'function') return source();\n if (source?.length) return source;\n return this.assetOptions();\n }\n );\n\n private readonly translateService = inject(TranslateService);\n\n protected readonly assetOptions = assetOptions(\n () => (this.config() as DropdownInput | undefined)?.optionsAsset\n );\n\n /** An option's text: authored as it stands, a key translated. */\n private readonly optionLabel = (\n option?: DropdownOption<DropdownValue>\n ): string => {\n if (!option?.label) return '';\n return option.noTranslate\n ? option.label\n : this.translateService.translate(option.label);\n };\n\n protected readonly filteredOptions = computed(\n (): DropdownOption<DropdownValue>[] => {\n const search = this.searchTerm().toLowerCase();\n if (!search) return this.dropdownOptions();\n return this.dropdownOptions().filter((o) => {\n const label = this.optionLabel(o).toLowerCase();\n return (\n label.includes(search) ||\n String(o.value).toLowerCase().includes(search)\n );\n });\n }\n );\n\n /** The option ↑/↓ point at while the panel is open; -1 is none. Reset as the search narrows the list. */\n protected readonly activeIndex = linkedSignal<\n DropdownOption<DropdownValue>[],\n number\n >({\n source: this.filteredOptions,\n computation: (options) =>\n this.searchTerm() ? this.nextEnabled(options, -1, 1) : -1,\n });\n\n /** The enabled option `step` rows past `from`, wrapping; `from` itself when none. */\n private readonly nextEnabled = (\n options: DropdownOption<DropdownValue>[],\n from: number,\n step: 1 | -1\n ): number => {\n for (let i = 1; i <= options.length; i++) {\n const index =\n (((from + step * i) % options.length) + options.length) %\n options.length;\n if (!options[index].disabled) return index;\n }\n return from;\n };\n\n /** One pick reads as its option's label, several as a count. */\n private readonly selectionLabel = computed((): string => {\n const values = this.selectedValues();\n if (values.length === 0) return '';\n if (values.length === 1) {\n return this.optionLabel(\n this.dropdownOptions().find((o) => o.value === values[0])\n );\n }\n const translation = this.translateService.translate(\n `selected?count=${values.length}`\n );\n return translation.includes('selected')\n ? `${values.length} Selected`\n : translation;\n });\n\n protected readonly displayValue = computed((): string =>\n this.toggle() ? this.searchTerm() : this.selectionLabel()\n );\n\n protected readonly placeholderText = computed((): string => {\n if (this.toggle()) {\n const label = this.selectionLabel();\n if (label) return label;\n }\n const placeholder = (this.config() as DropdownInput | undefined)\n ?.placeholder;\n return placeholder ? this.translateService.translate(placeholder) : '';\n });\n\n private readonly wrapperRef =\n viewChild<ElementRef<HTMLDivElement>>('wrapper');\n\n protected readonly selectorConfig = computed<\n SelectorConfig<DropdownBoxComponent>\n >(() => ({\n component: DropdownBoxComponent,\n base: 'm-dropdown-input',\n matchTriggerWidth: true,\n toggle: true,\n dir: this.dir(),\n bindings: [\n inputBinding('options', this.filteredOptions),\n inputBinding('selected', this.selectedValues),\n inputBinding('multiple', () => this.multiple),\n inputBinding('activeIndex', this.activeIndex),\n outputBinding<DropdownOption<DropdownValue>>('action', (option) =>\n this.selectOption(option)\n ),\n ],\n }));\n\n /** Shuts the panel after a pick, the way a click on the trigger would. */\n protected readonly closePanel = (): void => {\n this.toggle.set(false);\n this.searchTerm.set('');\n setTimeout(() => this.wrapperRef()?.nativeElement.click(), 0);\n };\n\n protected readonly onOpened = (): void => {\n this.toggle.set(true);\n this.searchTerm.set('');\n const current = this.selectedValues()[0];\n this.activeIndex.set(\n this.filteredOptions().findIndex((o) => o.value === current)\n );\n };\n\n // Focus stays in the trigger input (it is the search box), so ↑/↓ move the\n // active option rather than DOM focus. Closed, ArrowDown bubbles on to\n // SelectorDirective, which opens the panel.\n protected readonly onArrow = (event: Event, step: 1 | -1): void => {\n if (!this.toggle()) return;\n event.preventDefault();\n this.activeIndex.update((index) =>\n this.nextEnabled(this.filteredOptions(), index, step)\n );\n };\n\n // Enter never reaches SelectorDirective (it would toggle the panel); open,\n // it picks the active option.\n protected readonly onEnter = (event: Event): void => {\n event.stopPropagation();\n if (!this.toggle()) return;\n event.preventDefault();\n const option = this.filteredOptions()[this.activeIndex()];\n if (option && !option.disabled) this.selectOption(option);\n };\n\n protected readonly onClosed = (): void => {\n this.toggle.set(false);\n this.searchTerm.set('');\n };\n\n protected readonly onInput = (value: string): void => {\n this.searchTerm.set(value);\n };\n\n protected readonly preventToggleWhenOpen = (event: Event): void => {\n if (this.toggle() || this.readonly() || this.config()?.readonly) {\n event.stopPropagation();\n }\n };\n}\n"],"mappings":";;;;;;;;;;;AA0DA,IAAa,uBAAb,MAAa,qBAAoB;CACtB,UAAU,MAAuC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAEpD,WAAW,MAAgC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAC9C,WAAW,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,cAAc,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,SAAS,OAAM;CAEP,OAAO,OAAgC,UAAU;CAGlE,cAAA;EACE,aAAY;GACV,MAAM,QAAQ,KAAK,YAAW;GAC9B,IAAI,QAAQ,GAAG;GACf,KAAK,KAAK,cACP,iBAAiB,uBAAuB,CAAC,CACzC,MAAM,EAAE,iBAAiB,EAAE,OAAO,UAAS,CAAE;EAClD,CAAC;CACH;CAEmB,cAAc,UAC/B,KAAK,SAAQ,CAAE,CAAC,SAAS,KAAK;CAGb,gBACjB,WACQ;EACR,IAAI,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A;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,KAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,GAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,cAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,WAAS,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"magmonium-one-base-dropdown-BT3zFQ6c.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/ui/dropdown/dropdown-box.ts","../../../../libs/one/src/lib/shared/ui/input/ui/dropdown/base-dropdown.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n effect,\n ElementRef,\n inject,\n input,\n output,\n} from '@angular/core';\nimport { TranslatePipe } from '../../../../pipe/translate';\nimport { DropdownOption, DropdownValue } from '../../model/input';\n\n@Component({\n selector: 'm-dropdown-box',\n imports: [TranslatePipe],\n template: `\n <ul class=\"dropdown-box\" role=\"listbox\">\n @for (option of options(); track option.value; let i = $index) {\n @let selectedState = isSelected(option.value);\n <li\n class=\"dropdown-box__option\"\n [class.dropdown-box__option--selected]=\"selectedState\"\n [class.dropdown-box__option--disabled]=\"option.disabled\"\n [class.dropdown-box__option--active]=\"i === activeIndex()\"\n [style.--m-dropdown-option-depth]=\"option.depth\"\n role=\"option\"\n [attr.aria-selected]=\"selectedState\"\n [attr.data-value]=\"option.value\"\n (click)=\"selectOption(option)\"\n (keydown.enter)=\"selectOption(option)\"\n tabindex=\"0\"\n >\n <!-- A group header is a row, never a choice: no box to tick. -->\n @if (multiple() && !option.disabled) {\n <input\n type=\"checkbox\"\n class=\"dropdown-box__checkbox\"\n [checked]=\"selectedState\"\n tabindex=\"-1\"\n (click)=\"$event.preventDefault()\"\n />\n }\n @if (option.noTranslate) {\n {{ option.label }}\n } @else {\n {{ option.label | translate }}\n }\n </li>\n } @empty {\n <li class=\"dropdown-box__empty\">\n {{ 'no-results-found' | translate }}\n </li>\n }\n </ul>\n `,\n styleUrl: './dropdown-box.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DropdownBoxComponent {\n readonly options = input<DropdownOption<DropdownValue>[]>([]);\n /** The values ticked, as a list whichever Field drew the panel. */\n readonly selected = input<readonly DropdownValue[]>([]);\n readonly multiple = input<boolean>(false);\n readonly activeIndex = input<number>(-1);\n readonly action = output<DropdownOption<DropdownValue>>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n // Keep the keyboard-active option in view as ↑/↓ walk a scrolled list.\n constructor() {\n effect(() => {\n const index = this.activeIndex();\n if (index < 0) return;\n this.host.nativeElement\n .querySelectorAll('.dropdown-box__option')\n [index]?.scrollIntoView?.({ block: 'nearest' });\n });\n }\n\n protected readonly isSelected = (value: DropdownValue): boolean =>\n this.selected().includes(value);\n\n // Only emit a selection event for enabled options.\n protected readonly selectOption = (\n option: DropdownOption<DropdownValue>\n ): void => {\n if (option.disabled) return;\n this.action.emit(option);\n };\n}\n","import {\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n inputBinding,\n linkedSignal,\n model,\n outputBinding,\n Signal,\n signal,\n viewChild,\n} from '@angular/core';\nimport { ValidationError, WithOptionalFieldTree } from '@angular/forms/signals';\nimport { LabelComponent } from '../label';\nimport { TextOutputComponent } from '../../../text-output';\nimport { BaseInputComponent } from '../../lib/base-input';\nimport { Button } from '../../../button/type/button';\nimport { ButtonComponent } from '../../../button/ui/button';\nimport { TranslateService } from '../../../../services';\nimport { SelectorConfig, SelectorDirective } from '../../../../directives';\nimport { Direction } from '../../../../directives/selector/selector-type';\nimport { DropdownBoxComponent } from './dropdown-box';\nimport {\n DropdownInput,\n DropdownOption,\n DropdownValue,\n TextInput,\n} from '../../model/input';\nimport { TextInputComponent } from '../text/text';\nimport { assetOptions } from '../../lib/options-asset';\n\n/** The trigger both option Fields draw: a searchable text input and a chevron. */\nexport const DROPDOWN_TEMPLATE = `\n @if (config(); as dropdown) {\n @if (dropdown.label) {\n <m-label\n [for]=\"dropdown.name ?? ''\"\n [placeholder]=\"dropdown.label\"\n [params]=\"dropdown.params\"\n [required]=\"required()\"\n [disabled]=\"disabled()\"\n />\n }\n <div\n class=\"trigger-wrap\"\n #wrapper\n [mSelector]=\"selectorConfig()\"\n [disabled]=\"disabled() || readonly() || !!config()?.readonly\"\n (opened)=\"onOpened()\"\n (closed)=\"onClosed()\"\n (focusin)=\"isFocused.set(true)\"\n (focusout)=\"isFocused.set(false)\"\n >\n <m-text-input\n [config]=\"triggerInputConfig()\"\n [value]=\"displayValue()\"\n [disabled]=\"disabled()\"\n [invalid]=\"invalid()\"\n [hideErrors]=\"true\"\n [(touched)]=\"touched\"\n [focused]=\"focused()\"\n (valueChange)=\"onInput($event)\"\n (click)=\"preventToggleWhenOpen($event)\"\n (keydown.space)=\"$event.stopPropagation()\"\n (keydown.enter)=\"onEnter($event)\"\n (keydown.arrowdown)=\"onArrow($event, 1)\"\n (keydown.arrowup)=\"onArrow($event, -1)\"\n (keydown.tab)=\"$event.stopPropagation()\"\n />\n <m-button [disabled]=\"disabled()\" [config]=\"chevron()\" />\n </div>\n @if (showErrors()) {\n @for (error of errors(); track $index) {\n <m-text-output\n variant=\"footer\"\n color=\"error\"\n [label]=\"error.message\"\n />\n }\n }\n }\n`;\n\nexport const DROPDOWN_IMPORTS = [\n LabelComponent,\n TextOutputComponent,\n TextInputComponent,\n ButtonComponent,\n SelectorDirective,\n];\n\n/**\n * Everything a Dropdown and a Multiselect share: the options, the search, the\n * keyboard walk and the panel. What differs is only what the Field holds — one\n * value or a list — so a subclass says which values are selected and what a\n * pick does to them.\n */\n@Directive()\nexport abstract class BaseDropdownComponent extends BaseInputComponent<DropdownInput> {\n public override config = input<Partial<DropdownInput> | undefined>();\n public override required = input<boolean>(false);\n public override disabled = input<boolean>(false);\n public override invalid = input<boolean>(false);\n public override touched = model<boolean>(false);\n public override focused = input<boolean>(false);\n public override errors = input<readonly WithOptionalFieldTree<ValidationError>[]>(\n []\n );\n public override showErrors = computed(() => this.touched() && this.invalid());\n\n readonly options = input<\n DropdownOption<DropdownValue>[] | Signal<DropdownOption<DropdownValue>[]>\n >();\n readonly dir = input<Direction>();\n readonly toggle = model(false);\n readonly searchTerm = signal('');\n readonly isFocused = signal(false);\n readonly chevron = computed(\n () =>\n <Button>{\n icon: this.toggle() ? 'chevron-up' : 'chevron-down',\n one: true,\n variant: 'ghost',\n // In-Field control, never the form's submit — without this the Button\n // reads as the submit control and greys out while the form is invalid.\n type: 'button',\n // Chevron tracks the trigger's border like the text input's own icon:\n // red while the Field shows errors, focus tint while focused, border at rest.\n color: this.showErrors()\n ? 'error'\n : this.isFocused()\n ? 'focus'\n : 'border',\n // The trigger input is the Field's tab stop; the chevron only repeats\n // what clicking that input already does, so Tab walks past it.\n tabindex: -1,\n }\n );\n\n /** The values the Field holds now, as a list whichever kind it is. */\n protected abstract readonly selectedValues: Signal<readonly DropdownValue[]>;\n /** Whether the panel ticks rows and stays open across picks. */\n protected abstract readonly multiple: boolean;\n /** What picking `option` does to the Field's value. */\n protected abstract selectOption(option: DropdownOption<DropdownValue>): void;\n\n protected readonly triggerInputConfig = computed(() => {\n const dropdown = this.config() as DropdownInput | undefined;\n return <Partial<TextInput>>{\n name: dropdown?.name,\n icon: dropdown?.icon,\n one: dropdown?.one,\n placeholder: this.placeholderText(),\n readonly: this.readonly() || !!dropdown?.readonly,\n };\n });\n\n protected readonly dropdownOptions = computed(\n (): DropdownOption<DropdownValue>[] => {\n const runtimeOptions = this.options();\n const source =\n runtimeOptions ?? (this.config() as DropdownInput | undefined)?.options;\n if (typeof source === 'function') return source();\n if (source?.length) return source;\n return this.assetOptions();\n }\n );\n\n private readonly translateService = inject(TranslateService);\n\n protected readonly assetOptions = assetOptions(\n () => (this.config() as DropdownInput | undefined)?.optionsAsset\n );\n\n /** An option's text: authored as it stands, a key translated. */\n private readonly optionLabel = (\n option?: DropdownOption<DropdownValue>\n ): string => {\n if (!option?.label) return '';\n return option.noTranslate\n ? option.label\n : this.translateService.translate(option.label);\n };\n\n protected readonly filteredOptions = computed(\n (): DropdownOption<DropdownValue>[] => {\n const search = this.searchTerm().toLowerCase();\n if (!search) return this.dropdownOptions();\n return this.dropdownOptions().filter((o) => {\n const label = this.optionLabel(o).toLowerCase();\n return (\n label.includes(search) ||\n String(o.value).toLowerCase().includes(search)\n );\n });\n }\n );\n\n /** The option ↑/↓ point at while the panel is open; -1 is none. Reset as the search narrows the list. */\n protected readonly activeIndex = linkedSignal<\n DropdownOption<DropdownValue>[],\n number\n >({\n source: this.filteredOptions,\n computation: (options) =>\n this.searchTerm() ? this.nextEnabled(options, -1, 1) : -1,\n });\n\n /** The enabled option `step` rows past `from`, wrapping; `from` itself when none. */\n private readonly nextEnabled = (\n options: DropdownOption<DropdownValue>[],\n from: number,\n step: 1 | -1\n ): number => {\n for (let i = 1; i <= options.length; i++) {\n const index =\n (((from + step * i) % options.length) + options.length) %\n options.length;\n if (!options[index].disabled) return index;\n }\n return from;\n };\n\n /** One pick reads as its option's label, several as a count. */\n private readonly selectionLabel = computed((): string => {\n const values = this.selectedValues();\n if (values.length === 0) return '';\n if (values.length === 1) {\n return this.optionLabel(\n this.dropdownOptions().find((o) => o.value === values[0])\n );\n }\n const translation = this.translateService.translate(\n `selected?count=${values.length}`\n );\n return translation.includes('selected')\n ? `${values.length} Selected`\n : translation;\n });\n\n protected readonly displayValue = computed((): string =>\n this.toggle() ? this.searchTerm() : this.selectionLabel()\n );\n\n protected readonly placeholderText = computed((): string => {\n if (this.toggle()) {\n const label = this.selectionLabel();\n if (label) return label;\n }\n const placeholder = (this.config() as DropdownInput | undefined)\n ?.placeholder;\n return placeholder ? this.translateService.translate(placeholder) : '';\n });\n\n private readonly wrapperRef =\n viewChild<ElementRef<HTMLDivElement>>('wrapper');\n\n protected readonly selectorConfig = computed<\n SelectorConfig<DropdownBoxComponent>\n >(() => ({\n component: DropdownBoxComponent,\n base: 'm-dropdown-input',\n matchTriggerWidth: true,\n toggle: true,\n dir: this.dir(),\n bindings: [\n inputBinding('options', this.filteredOptions),\n inputBinding('selected', this.selectedValues),\n inputBinding('multiple', () => this.multiple),\n inputBinding('activeIndex', this.activeIndex),\n outputBinding<DropdownOption<DropdownValue>>('action', (option) =>\n this.selectOption(option)\n ),\n ],\n }));\n\n /** Shuts the panel after a pick, the way a click on the trigger would. */\n protected readonly closePanel = (): void => {\n this.toggle.set(false);\n this.searchTerm.set('');\n setTimeout(() => this.wrapperRef()?.nativeElement.click(), 0);\n };\n\n protected readonly onOpened = (): void => {\n this.toggle.set(true);\n this.searchTerm.set('');\n const current = this.selectedValues()[0];\n this.activeIndex.set(\n this.filteredOptions().findIndex((o) => o.value === current)\n );\n };\n\n // Focus stays in the trigger input (it is the search box), so ↑/↓ move the\n // active option rather than DOM focus. Closed, ArrowDown bubbles on to\n // SelectorDirective, which opens the panel.\n protected readonly onArrow = (event: Event, step: 1 | -1): void => {\n if (!this.toggle()) return;\n event.preventDefault();\n this.activeIndex.update((index) =>\n this.nextEnabled(this.filteredOptions(), index, step)\n );\n };\n\n // Enter never reaches SelectorDirective (it would toggle the panel); open,\n // it picks the active option.\n protected readonly onEnter = (event: Event): void => {\n event.stopPropagation();\n if (!this.toggle()) return;\n event.preventDefault();\n const option = this.filteredOptions()[this.activeIndex()];\n if (option && !option.disabled) this.selectOption(option);\n };\n\n protected readonly onClosed = (): void => {\n this.toggle.set(false);\n this.searchTerm.set('');\n };\n\n protected readonly onInput = (value: string): void => {\n this.searchTerm.set(value);\n };\n\n protected readonly preventToggleWhenOpen = (event: Event): void => {\n if (this.toggle() || this.readonly() || this.config()?.readonly) {\n event.stopPropagation();\n }\n };\n}\n"],"mappings":";;;;;;;;;;;AA0DA,IAAa,uBAAb,MAAa,qBAAoB;CACtB,UAAU,MAAuC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAEpD,WAAW,MAAgC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAC9C,WAAW,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,cAAc,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,SAAS,OAAM;CAEP,OAAO,OAAgC,UAAU;CAGlE,cAAA;EACE,aAAY;GACV,MAAM,QAAQ,KAAK,YAAW;GAC9B,IAAI,QAAQ,GAAG;GACf,KAAK,KAAK,cACP,iBAAiB,uBAAuB,CAAC,CACzC,MAAM,EAAE,iBAAiB,EAAE,OAAO,UAAS,CAAE;EAClD,CAAC;CACH;CAEmB,cAAc,UAC/B,KAAK,SAAQ,CAAE,CAAC,SAAS,KAAK;CAGb,gBACjB,WACQ;EACR,IAAI,OAAO,UAAU;EACrB,KAAK,OAAO,KAAK,MAAM;CACzB;CA9BW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAoB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAApB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAoB,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,SAAA;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,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,GAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,cAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,WAAS,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./magmonium-one-rolldown-runtime-DpJrqANO.mjs";
2
2
  import { t as LabelComponent } from "./magmonium-one-label-BJcQs0Nd.mjs";
3
3
  import { t as toAttrBool } from "./magmonium-one-attribute-value-CPh-lJPV.mjs";
4
- import { t as TextOutputComponent } from "./magmonium-one-text-output-nJBGhbwG.mjs";
4
+ import { t as TextOutputComponent } from "./magmonium-one-text-output-9QMznoe1.mjs";
5
5
  import { t as BaseCheckboxInputComponent } from "./magmonium-one-base-checkbox-LdM6dqF_.mjs";
6
6
  import * as i0 from "@angular/core";
7
7
  import { ChangeDetectionStrategy, Component, InjectionToken, computed, input, model } from "@angular/core";
@@ -204,7 +204,8 @@ var CheckboxInputComponent = class CheckboxInputComponent extends BaseCheckboxIn
204
204
  "fontWeight",
205
205
  "label",
206
206
  "noTranslate",
207
- "params"
207
+ "params",
208
+ "truncate"
208
209
  ],
209
210
  outputs: ["configChange", "clicked"]
210
211
  }],
@@ -362,4 +363,4 @@ i0.ɵɵngDeclareClassMetadata({
362
363
  });
363
364
  export { checkbox_exports as n, PLACED_CHECKBOX as r, CheckboxInputComponent as t };
364
365
 
365
- //# sourceMappingURL=magmonium-one-checkbox-CTRdyVrI.mjs.map
366
+ //# sourceMappingURL=magmonium-one-checkbox-D4ZJV6AC.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"magmonium-one-checkbox-CTRdyVrI.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/lib/placed-checkbox.token.ts","../../../../libs/one/src/lib/shared/ui/input/ui/checkbox/checkbox.ts"],"sourcesContent":["import { InjectionToken, Signal } from '@angular/core';\nimport { DropdownOption } from '../model/input';\n\n/**\n * An `m-checkbox` placed between a SectionFormItem's tags as one option of its\n * CheckboxGroup (libs/one ADR 0039). Provided by the checkbox itself so the\n * item can collect its children without importing the checkbox chunk it only\n * lazy-loads. `undefined` until the checkbox names a `value`.\n */\nexport type PlacedCheckbox = {\n readonly option: Signal<DropdownOption | undefined>;\n};\n\nexport const PLACED_CHECKBOX = new InjectionToken<PlacedCheckbox>(\n 'PLACED_CHECKBOX'\n);\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n model,\n ModelSignal,\n} from '@angular/core';\nimport { BaseCheckboxInputComponent } from './base-checkbox';\nimport { LabelComponent } from '../label';\nimport { TextOutputComponent } from '../../../text-output';\nimport { ValidationError, WithOptionalFieldTree } from '@angular/forms/signals';\nimport { DropdownOption, Input } from '../../model/input';\nimport {\n PLACED_CHECKBOX,\n PlacedCheckbox,\n} from '../../lib/placed-checkbox.token';\nimport { toAttrBool } from '../../../../functions/config/attribute-value';\n\n@Component({\n selector: 'm-checkbox',\n template: `\n @if (config(); as checkbox) {\n <div class=\"checkbox\">\n <input\n [checked]=\"checked()\"\n #inputElement\n [class.error]=\"showErrors()\"\n [disabled]=\"disabled()\"\n (change)=\"onChange($event)\"\n type=\"checkbox\"\n [id]=\"checkbox.name\"\n />\n @if (labelText(); as text) {\n <m-label\n [for]=\"checkbox.name\"\n [placeholder]=\"text\"\n [params]=\"checkbox.params\"\n [noTranslate]=\"isNoTranslate()\"\n [required]=\"required()\"\n [disabled]=\"disabled()\"\n />\n }\n </div>\n @if (showErrors()) {\n @for (error of errors(); track $index) {\n <m-text-output\n variant=\"footer\"\n color=\"error\"\n [label]=\"error.message\"\n />\n }\n }\n }\n `,\n imports: [LabelComponent, TextOutputComponent],\n styleUrl: './checkbox.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n { provide: PLACED_CHECKBOX, useExisting: CheckboxInputComponent },\n ],\n})\nexport class CheckboxInputComponent\n extends BaseCheckboxInputComponent\n implements PlacedCheckbox\n{\n public override value = undefined;\n public override checked = model<boolean>(false) as ModelSignal<boolean>;\n public override config = input<Partial<Input> | undefined>();\n public override required = input<boolean>(false);\n public override disabled = input<boolean>(false);\n public override invalid = input<boolean>(false);\n public override touched = model<boolean>(false);\n public override focused = input<boolean>(false);\n public override errors = input<readonly WithOptionalFieldTree<ValidationError>[]>(\n []\n );\n public override showErrors = computed(() => this.touched() && this.invalid());\n\n // What a checkbox placed inside a CheckboxGroup's SectionFormItem says about\n // the option it stands for, written on its own tag (ADR 0010, ADR 0039).\n // `value` is the attribute because it is the option's value; the member is\n // named apart because FormCheckboxControl pins `value` itself to undefined —\n // a checkbox control's value is `checked`.\n /* eslint-disable @angular-eslint/no-input-rename */\n public readonly optionValue = input<string | undefined>(undefined, {\n alias: 'value',\n });\n /* eslint-enable @angular-eslint/no-input-rename */\n public readonly label = input<string | undefined>();\n public readonly noTranslate = input<boolean | string | undefined>();\n\n protected readonly labelText = computed(\n () => this.label() ?? this.config()?.label\n );\n protected readonly isNoTranslate = computed(\n () => toAttrBool(this.noTranslate()) === true\n );\n\n public readonly option = computed((): DropdownOption | undefined => {\n const value = this.optionValue();\n if (!value) return undefined;\n return {\n value,\n label: this.label() ?? value,\n disabled: this.disabled() || undefined,\n noTranslate: this.isNoTranslate() || undefined,\n };\n });\n\n protected onChange(event: Event): void {\n const target = event.target as HTMLInputElement;\n this.setValue(target?.checked ?? false);\n }\n}\n"],"mappings":";;;;;;;AAaA,MAAa,kBAAkB,IAAI,eACjC,iBAAiB;;ACgDnB,IAAa,yBAAb,MAAa,+BACH,2BAA0B;CAGlB,QAAQ;CACR,UAAU,MAAe,KAAK;CAC9B,SAAS,MAAmC,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,SAAA,CAAA,+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AAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,aAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,SAAA;GAAA,SAAA;GAAA,SAAA;EAAA;EAAA,WAJtB,CACT;GAAE,SAAS;GAAiB,aAAa;EAAsB,CAChE;EAAA,iBAAA;EAAA,UAAA;EAAA,UAvCS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCT,UAAA;EAAA,QAAA,CAAA,oljBAAA;EAAA,cAAA,CAAA;GAAA,MAAA;GAAA,MACS;GAAc,UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;GAAA;EAAA,GAAA;GAAA,MAAA;GAAA,MAAE;GAAmB,UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;GAAA;GAAA,SAAA,CAAA,gBAAA,SAAA;EAAA,CAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAOlC,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAsB,YAAA,CAAA;EA3ClC,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAY,UACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCT,SACQ,CAAC,gBAAgB,mBAAmB;GAAC,iBAE7B,wBAAwB;GAAM,WACpC,CACT;IAAE,SAAS;IAAiB,aAAW;GAAwB,CAChE;GAAA,QAAA,CAAA,oljBAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"magmonium-one-checkbox-D4ZJV6AC.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/lib/placed-checkbox.token.ts","../../../../libs/one/src/lib/shared/ui/input/ui/checkbox/checkbox.ts"],"sourcesContent":["import { InjectionToken, Signal } from '@angular/core';\nimport { DropdownOption } from '../model/input';\n\n/**\n * An `m-checkbox` placed between a SectionFormItem's tags as one option of its\n * CheckboxGroup (libs/one ADR 0039). Provided by the checkbox itself so the\n * item can collect its children without importing the checkbox chunk it only\n * lazy-loads. `undefined` until the checkbox names a `value`.\n */\nexport type PlacedCheckbox = {\n readonly option: Signal<DropdownOption | undefined>;\n};\n\nexport const PLACED_CHECKBOX = new InjectionToken<PlacedCheckbox>(\n 'PLACED_CHECKBOX'\n);\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n model,\n ModelSignal,\n} from '@angular/core';\nimport { BaseCheckboxInputComponent } from './base-checkbox';\nimport { LabelComponent } from '../label';\nimport { TextOutputComponent } from '../../../text-output';\nimport { ValidationError, WithOptionalFieldTree } from '@angular/forms/signals';\nimport { DropdownOption, Input } from '../../model/input';\nimport {\n PLACED_CHECKBOX,\n PlacedCheckbox,\n} from '../../lib/placed-checkbox.token';\nimport { toAttrBool } from '../../../../functions/config/attribute-value';\n\n@Component({\n selector: 'm-checkbox',\n template: `\n @if (config(); as checkbox) {\n <div class=\"checkbox\">\n <input\n [checked]=\"checked()\"\n #inputElement\n [class.error]=\"showErrors()\"\n [disabled]=\"disabled()\"\n (change)=\"onChange($event)\"\n type=\"checkbox\"\n [id]=\"checkbox.name\"\n />\n @if (labelText(); as text) {\n <m-label\n [for]=\"checkbox.name\"\n [placeholder]=\"text\"\n [params]=\"checkbox.params\"\n [noTranslate]=\"isNoTranslate()\"\n [required]=\"required()\"\n [disabled]=\"disabled()\"\n />\n }\n </div>\n @if (showErrors()) {\n @for (error of errors(); track $index) {\n <m-text-output\n variant=\"footer\"\n color=\"error\"\n [label]=\"error.message\"\n />\n }\n }\n }\n `,\n imports: [LabelComponent, TextOutputComponent],\n styleUrl: './checkbox.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n { provide: PLACED_CHECKBOX, useExisting: CheckboxInputComponent },\n ],\n})\nexport class CheckboxInputComponent\n extends BaseCheckboxInputComponent\n implements PlacedCheckbox\n{\n public override value = undefined;\n public override checked = model<boolean>(false) as ModelSignal<boolean>;\n public override config = input<Partial<Input> | undefined>();\n public override required = input<boolean>(false);\n public override disabled = input<boolean>(false);\n public override invalid = input<boolean>(false);\n public override touched = model<boolean>(false);\n public override focused = input<boolean>(false);\n public override errors = input<readonly WithOptionalFieldTree<ValidationError>[]>(\n []\n );\n public override showErrors = computed(() => this.touched() && this.invalid());\n\n // What a checkbox placed inside a CheckboxGroup's SectionFormItem says about\n // the option it stands for, written on its own tag (ADR 0010, ADR 0039).\n // `value` is the attribute because it is the option's value; the member is\n // named apart because FormCheckboxControl pins `value` itself to undefined —\n // a checkbox control's value is `checked`.\n /* eslint-disable @angular-eslint/no-input-rename */\n public readonly optionValue = input<string | undefined>(undefined, {\n alias: 'value',\n });\n /* eslint-enable @angular-eslint/no-input-rename */\n public readonly label = input<string | undefined>();\n public readonly noTranslate = input<boolean | string | undefined>();\n\n protected readonly labelText = computed(\n () => this.label() ?? this.config()?.label\n );\n protected readonly isNoTranslate = computed(\n () => toAttrBool(this.noTranslate()) === true\n );\n\n public readonly option = computed((): DropdownOption | undefined => {\n const value = this.optionValue();\n if (!value) return undefined;\n return {\n value,\n label: this.label() ?? value,\n disabled: this.disabled() || undefined,\n noTranslate: this.isNoTranslate() || undefined,\n };\n });\n\n protected onChange(event: Event): void {\n const target = event.target as HTMLInputElement;\n this.setValue(target?.checked ?? false);\n }\n}\n"],"mappings":";;;;;;;AAaA,MAAa,kBAAkB,IAAI,eACjC,iBAAiB;;ACgDnB,IAAa,yBAAb,MAAa,+BACH,2BAA0B;CAGlB,QAAQ;CACR,UAAU,MAAe,KAAK;CAC9B,SAAS,MAAmC,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAC5C,WAAW,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CA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A,mBAAA;GAAA;GAAA,aAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,SAAA;GAAA,SAAA;GAAA,SAAA;EAAA;EAAA,WAJtB,CACT;GAAE,SAAS;GAAiB,aAAa;EAAsB,CAChE;EAAA,iBAAA;EAAA,UAAA;EAAA,UAvCS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCT,UAAA;EAAA,QAAA,CAAA,oljBAAA;EAAA,cAAA,CAAA;GAAA,MAAA;GAAA,MACS;GAAc,UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;GAAA;EAAA,GAAA;GAAA,MAAA;GAAA,MAAE;GAAmB,UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;GAAA;GAAA,SAAA,CAAA,gBAAA,SAAA;EAAA,CAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAOlC,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAsB,YAAA,CAAA;EA3ClC,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAY,UACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCT,SACQ,CAAC,gBAAgB,mBAAmB;GAAC,iBAE7B,wBAAwB;GAAM,WACpC,CACT;IAAE,SAAS;IAAiB,aAAW;GAAwB,CAChE;GAAA,QAAA,CAAA,oljBAAA;EAAA,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { U as IS_DESIGN_MODE } from "./magmonium-one-size-converter-BqkALIWA.mjs";
2
2
  import { t as LabelComponent } from "./magmonium-one-label-BJcQs0Nd.mjs";
3
3
  import { t as BaseTextInputComponent } from "./magmonium-one-base-text-ChjG3GNw.mjs";
4
- import { t as TextOutputComponent } from "./magmonium-one-text-output-nJBGhbwG.mjs";
4
+ import { t as TextOutputComponent } from "./magmonium-one-text-output-9QMznoe1.mjs";
5
5
  import * as i0 from "@angular/core";
6
6
  import { ChangeDetectionStrategy, Component, afterRenderEffect, computed, effect, inject, signal, untracked, viewChildren } from "@angular/core";
7
7
  import { CommonModule } from "@angular/common";
@@ -184,7 +184,8 @@ var OtpInputComponent = class OtpInputComponent extends BaseTextInputComponent {
184
184
  "fontWeight",
185
185
  "label",
186
186
  "noTranslate",
187
- "params"
187
+ "params",
188
+ "truncate"
188
189
  ],
189
190
  outputs: ["configChange", "clicked"]
190
191
  },
@@ -258,4 +259,4 @@ i0.ɵɵngDeclareClassMetadata({
258
259
  });
259
260
  export { OtpInputComponent };
260
261
 
261
- //# sourceMappingURL=magmonium-one-otp-AFrgpHdp.mjs.map
262
+ //# sourceMappingURL=magmonium-one-otp-CS1Z0KKQ.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"magmonium-one-otp-AFrgpHdp.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/ui/text/otp.ts"],"sourcesContent":["import {\n afterRenderEffect,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n signal,\n untracked,\n viewChildren,\n} from '@angular/core';\nimport { LabelComponent } from '../label';\nimport { TextOutputComponent } from '../../../text-output';\nimport { BaseTextInputComponent } from './base-text';\nimport { CommonModule } from '@angular/common';\nimport { OtpInput } from '../../model/input';\nimport { IS_DESIGN_MODE } from '../../../../config/tokens';\n\n@Component({\n selector: 'm-otp-input',\n template: `\n @if (otpConfig(); as otp) {\n <m-label\n [for]=\"otp.name\"\n [placeholder]=\"otp.label\"\n [params]=\"otp.params\"\n [required]=\"required()\"\n [disabled]=\"isDisabled()\"\n />\n <div class=\"otp-container\">\n @for (item of otpArray(); track $index) {\n <input\n [id]=\"$index === 0 ? (otp.name ?? '') : ''\"\n #otpInput\n type=\"text\"\n maxlength=\"1\"\n [class.error]=\"showErrors()\"\n [disabled]=\"isDisabled()\"\n [value]=\"otpValues()[$index] || ''\"\n (input)=\"onInput($event, $index)\"\n (keydown)=\"onKeyDown($event, $index)\"\n (paste)=\"onPaste($event)\"\n />\n }\n </div>\n @if (showErrors()) {\n @for (error of errors(); track $index) {\n <m-text-output\n variant=\"footer\"\n color=\"error\"\n [label]=\"error.message\"\n />\n }\n }\n }\n `,\n styleUrl: './otp.sass',\n imports: [LabelComponent, TextOutputComponent, CommonModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class OtpInputComponent extends BaseTextInputComponent<OtpInput> {\n otpValues = signal<string[]>([]);\n otpInputs = viewChildren<ElementRef<HTMLInputElement>>('otpInput');\n protected readonly otpConfig = computed(() => this.config() as OtpInput);\n otpArray = computed(() => {\n const length = this.otpConfig()?.length || 6;\n return Array(length).fill(0);\n });\n\n // Inert on the Canvas — other inputs stay idle because they never autofocus;\n // OTP used to steal focus and look live while composing (DesignMode).\n private readonly isDesignMode = !!inject(IS_DESIGN_MODE, { optional: true });\n protected readonly isDisabled = computed(\n () => this.isDesignMode || this.disabled()\n );\n\n // BaseText answers `focused` by focusing its `#inputElement`, and an OTP has\n // none — it has a row of boxes. Without this the caret never lands on an OTP\n // field, so the form that opens on one (login's verification step) reads as\n // dead until the User clicks it.\n private hasAutofocused = false;\n\n constructor() {\n super();\n effect(() => {\n const length = this.otpConfig()?.length || 6;\n this.otpValues.set(Array(length).fill(''));\n });\n\n afterRenderEffect(() => {\n const inputs = this.otpInputs();\n if (!this.focused() || !inputs.length || this.hasAutofocused) return;\n this.hasAutofocused = true;\n untracked(() => this.focusInput(0));\n });\n }\n\n onInput = (event: Event, index: number): void => {\n if (this.isDisabled()) return;\n const input = event.target as HTMLInputElement;\n let value = input.value;\n\n value = value.replace(/[^a-zA-Z0-9]/g, '');\n\n if (value.length > 1) {\n value = value.slice(-1);\n }\n\n input.value = value.toUpperCase();\n\n const newValues = [...this.otpValues()];\n newValues[index] = value.toUpperCase();\n this.otpValues.set(newValues);\n\n const length = this.otpConfig()?.length || 6;\n if (value && index < length - 1) {\n this.focusInput(index + 1);\n }\n this.updateValue();\n };\n\n onKeyDown = (event: KeyboardEvent, index: number): void => {\n if (this.isDisabled()) return;\n const input = event.target as HTMLInputElement;\n const length = this.otpConfig()?.length || 6;\n\n const isAlphaNumeric = /^[a-zA-Z0-9]$/.test(event.key);\n const isControlKey = [\n 'Backspace',\n 'Delete',\n 'ArrowLeft',\n 'ArrowRight',\n 'Tab',\n ].includes(event.key);\n\n if (!isAlphaNumeric && !isControlKey) {\n event.preventDefault();\n return;\n }\n\n if (event.key === 'Backspace') {\n if (!input.value && index > 0) {\n this.focusInput(index - 1);\n }\n }\n if (event.key === 'ArrowLeft' && index > 0) {\n event.preventDefault();\n this.focusInput(index - 1);\n }\n if (event.key === 'ArrowRight' && index < length - 1) {\n event.preventDefault();\n this.focusInput(index + 1);\n }\n };\n\n onPaste = (event: ClipboardEvent): void => {\n if (this.isDisabled()) return;\n event.preventDefault();\n event.stopPropagation();\n\n const length = this.otpConfig()?.length || 6;\n const pastedData = event.clipboardData?.getData('text') || '';\n\n const alphanumeric = pastedData\n .replace(/[^a-zA-Z0-9]/g, '')\n .slice(0, length);\n\n if (alphanumeric.length > 0) {\n const newValues = Array(length).fill('');\n alphanumeric.split('').forEach((char, index) => {\n if (index < length) {\n newValues[index] = char.toUpperCase();\n }\n });\n\n this.otpValues.set(newValues);\n this.updateValue();\n\n const focusIndex = Math.min(alphanumeric.length, length - 1);\n setTimeout(() => this.focusInput(focusIndex), 0);\n }\n };\n\n private focusInput(index: number): void {\n if (this.isDisabled()) return;\n const inputs = this.otpInputs();\n if (inputs[index]) {\n inputs[index].nativeElement.focus();\n }\n }\n\n private updateValue(): void {\n const otpValue = this.otpValues().join('');\n this.setValue(otpValue);\n }\n}\n"],"mappings":";;;;;;;AA6DA,IAAa,oBAAb,MAAa,0BAA0B,uBAAgC;CACrE,YAAY,OAAiB,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CACh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AAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAiB,YAAA,CAAA;EA1C7B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAa,UACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCT,SAEQ;IAAC;IAAgB;IAAqB;GAAY;GAAC,iBAC3C,wBAAwB;GAAM,QAAA,CAAA,+qEAAA;EAAA,CAAA;CAIQ,CAAA;CAAA,sBAAA,CAAA;CAAA,gBAAA,EAAA,WAAA,CAAA;EAAA,MAAA,GAAA;EAAA,MAAA,CAAA,YAAU,EAAA,UAAA,KAAA,CAAA;CAAA,CAAA,EAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"magmonium-one-otp-CS1Z0KKQ.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/ui/text/otp.ts"],"sourcesContent":["import {\n afterRenderEffect,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n signal,\n untracked,\n viewChildren,\n} from '@angular/core';\nimport { LabelComponent } from '../label';\nimport { TextOutputComponent } from '../../../text-output';\nimport { BaseTextInputComponent } from './base-text';\nimport { CommonModule } from '@angular/common';\nimport { OtpInput } from '../../model/input';\nimport { IS_DESIGN_MODE } from '../../../../config/tokens';\n\n@Component({\n selector: 'm-otp-input',\n template: `\n @if (otpConfig(); as otp) {\n <m-label\n [for]=\"otp.name\"\n [placeholder]=\"otp.label\"\n [params]=\"otp.params\"\n [required]=\"required()\"\n [disabled]=\"isDisabled()\"\n />\n <div class=\"otp-container\">\n @for (item of otpArray(); track $index) {\n <input\n [id]=\"$index === 0 ? (otp.name ?? '') : ''\"\n #otpInput\n type=\"text\"\n maxlength=\"1\"\n [class.error]=\"showErrors()\"\n [disabled]=\"isDisabled()\"\n [value]=\"otpValues()[$index] || ''\"\n (input)=\"onInput($event, $index)\"\n (keydown)=\"onKeyDown($event, $index)\"\n (paste)=\"onPaste($event)\"\n />\n }\n </div>\n @if (showErrors()) {\n @for (error of errors(); track $index) {\n <m-text-output\n variant=\"footer\"\n color=\"error\"\n [label]=\"error.message\"\n />\n }\n }\n }\n `,\n styleUrl: './otp.sass',\n imports: [LabelComponent, TextOutputComponent, CommonModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class OtpInputComponent extends BaseTextInputComponent<OtpInput> {\n otpValues = signal<string[]>([]);\n otpInputs = viewChildren<ElementRef<HTMLInputElement>>('otpInput');\n protected readonly otpConfig = computed(() => this.config() as OtpInput);\n otpArray = computed(() => {\n const length = this.otpConfig()?.length || 6;\n return Array(length).fill(0);\n });\n\n // Inert on the Canvas — other inputs stay idle because they never autofocus;\n // OTP used to steal focus and look live while composing (DesignMode).\n private readonly isDesignMode = !!inject(IS_DESIGN_MODE, { optional: true });\n protected readonly isDisabled = computed(\n () => this.isDesignMode || this.disabled()\n );\n\n // BaseText answers `focused` by focusing its `#inputElement`, and an OTP has\n // none — it has a row of boxes. Without this the caret never lands on an OTP\n // field, so the form that opens on one (login's verification step) reads as\n // dead until the User clicks it.\n private hasAutofocused = false;\n\n constructor() {\n super();\n effect(() => {\n const length = this.otpConfig()?.length || 6;\n this.otpValues.set(Array(length).fill(''));\n });\n\n afterRenderEffect(() => {\n const inputs = this.otpInputs();\n if (!this.focused() || !inputs.length || this.hasAutofocused) return;\n this.hasAutofocused = true;\n untracked(() => this.focusInput(0));\n });\n }\n\n onInput = (event: Event, index: number): void => {\n if (this.isDisabled()) return;\n const input = event.target as HTMLInputElement;\n let value = input.value;\n\n value = value.replace(/[^a-zA-Z0-9]/g, '');\n\n if (value.length > 1) {\n value = value.slice(-1);\n }\n\n input.value = value.toUpperCase();\n\n const newValues = [...this.otpValues()];\n newValues[index] = value.toUpperCase();\n this.otpValues.set(newValues);\n\n const length = this.otpConfig()?.length || 6;\n if (value && index < length - 1) {\n this.focusInput(index + 1);\n }\n this.updateValue();\n };\n\n onKeyDown = (event: KeyboardEvent, index: number): void => {\n if (this.isDisabled()) return;\n const input = event.target as HTMLInputElement;\n const length = this.otpConfig()?.length || 6;\n\n const isAlphaNumeric = /^[a-zA-Z0-9]$/.test(event.key);\n const isControlKey = [\n 'Backspace',\n 'Delete',\n 'ArrowLeft',\n 'ArrowRight',\n 'Tab',\n ].includes(event.key);\n\n if (!isAlphaNumeric && !isControlKey) {\n event.preventDefault();\n return;\n }\n\n if (event.key === 'Backspace') {\n if (!input.value && index > 0) {\n this.focusInput(index - 1);\n }\n }\n if (event.key === 'ArrowLeft' && index > 0) {\n event.preventDefault();\n this.focusInput(index - 1);\n }\n if (event.key === 'ArrowRight' && index < length - 1) {\n event.preventDefault();\n this.focusInput(index + 1);\n }\n };\n\n onPaste = (event: ClipboardEvent): void => {\n if (this.isDisabled()) return;\n event.preventDefault();\n event.stopPropagation();\n\n const length = this.otpConfig()?.length || 6;\n const pastedData = event.clipboardData?.getData('text') || '';\n\n const alphanumeric = pastedData\n .replace(/[^a-zA-Z0-9]/g, '')\n .slice(0, length);\n\n if (alphanumeric.length > 0) {\n const newValues = Array(length).fill('');\n alphanumeric.split('').forEach((char, index) => {\n if (index < length) {\n newValues[index] = char.toUpperCase();\n }\n });\n\n this.otpValues.set(newValues);\n this.updateValue();\n\n const focusIndex = Math.min(alphanumeric.length, length - 1);\n setTimeout(() => this.focusInput(focusIndex), 0);\n }\n };\n\n private focusInput(index: number): void {\n if (this.isDisabled()) return;\n const inputs = this.otpInputs();\n if (inputs[index]) {\n inputs[index].nativeElement.focus();\n }\n }\n\n private updateValue(): void {\n const otpValue = this.otpValues().join('');\n this.setValue(otpValue);\n }\n}\n"],"mappings":";;;;;;;AA6DA,IAAa,oBAAb,MAAa,0BAA0B,uBAAgC;CACrE,YAAY,OAAiB,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,YAAY,aAA2C,YAAW,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAC/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1C7B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAa,UACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCT,SAEQ;IAAC;IAAgB;IAAqB;GAAY;GAAC,iBAC3C,wBAAwB;GAAM,QAAA,CAAA,+qEAAA;EAAA,CAAA;CAIQ,CAAA;CAAA,sBAAA,CAAA;CAAA,gBAAA,EAAA,WAAA,CAAA;EAAA,MAAA,GAAA;EAAA,MAAA,CAAA,YAAU,EAAA,UAAA,KAAA,CAAA;CAAA,CAAA,EAAA;AAAA,CAAA"}
@@ -2,7 +2,7 @@ import { c as TranslatePipe } from "./magmonium-one-size-converter-BqkALIWA.mjs"
2
2
  import { t as LabelComponent } from "./magmonium-one-label-BJcQs0Nd.mjs";
3
3
  import { t as ButtonComponent } from "./magmonium-one-button-BvX-kWgh.mjs";
4
4
  import { t as BaseTextInputComponent } from "./magmonium-one-base-text-ChjG3GNw.mjs";
5
- import { t as TextOutputComponent } from "./magmonium-one-text-output-nJBGhbwG.mjs";
5
+ import { t as TextOutputComponent } from "./magmonium-one-text-output-9QMznoe1.mjs";
6
6
  import * as i0 from "@angular/core";
7
7
  import { ChangeDetectionStrategy, Component, computed, signal } from "@angular/core";
8
8
  var PasswordInputComponent = class PasswordInputComponent extends BaseTextInputComponent {
@@ -103,7 +103,8 @@ var PasswordInputComponent = class PasswordInputComponent extends BaseTextInputC
103
103
  "fontWeight",
104
104
  "label",
105
105
  "noTranslate",
106
- "params"
106
+ "params",
107
+ "truncate"
107
108
  ],
108
109
  outputs: ["configChange", "clicked"]
109
110
  },
@@ -214,4 +215,4 @@ i0.ɵɵngDeclareClassMetadata({
214
215
  });
215
216
  export { PasswordInputComponent };
216
217
 
217
- //# sourceMappingURL=magmonium-one-password-C7W01COQ.mjs.map
218
+ //# sourceMappingURL=magmonium-one-password-zW1YmyBs.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"magmonium-one-password-C7W01COQ.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/ui/text/password.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n signal,\n} from '@angular/core';\nimport { LabelComponent } from '../label';\nimport { TextOutputComponent } from '../../../text-output';\nimport { BaseTextInputComponent } from './base-text';\nimport { ButtonComponent } from '../../../button/ui/button';\nimport { TranslatePipe } from '../../../../pipe';\n\n@Component({\n selector: 'm-password-input',\n template: `\n @if (config(); as text) {\n <m-label\n [for]=\"text.name\"\n [placeholder]=\"text.label\"\n [params]=\"text.params\"\n [required]=\"required()\"\n [disabled]=\"disabled()\"\n />\n <div class=\"input-wrapper\">\n <input\n [id]=\"text.name ?? ''\"\n [attr.data-testid]=\"text.testid ?? (text.name ? text.name + '-input' : null)\"\n [value]=\"value()\"\n #inputElement\n [class.error]=\"showErrors()\"\n [disabled]=\"disabled()\"\n [placeholder]=\"(text.placeholder ?? '') | translate: text.params\"\n (input)=\"onInput($event)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false); touched.set(true)\"\n [type]=\"type()\"\n />\n <m-one-button\n type=\"button\"\n [disabled]=\"disabled()\"\n [name]=\"button()\"\n [color]=\"iconColor()\"\n (clicked)=\"toggleType()\"\n />\n </div>\n @if (showErrors()) {\n @for (error of errors(); track $index) {\n <m-text-output\n variant=\"footer\"\n color=\"error\"\n [label]=\"error.message\"\n />\n }\n }\n }\n `,\n imports: [LabelComponent, TextOutputComponent, ButtonComponent, TranslatePipe],\n styleUrl: './password.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PasswordInputComponent extends BaseTextInputComponent {\n isPassword = signal<boolean>(true);\n type = computed(() => (this.isPassword() ? 'password' : 'text'));\n button = computed(() => (!this.isPassword() ? 'eye' : 'eye_close'));\n\n protected toggleType() {\n this.isPassword.update((now) => !now);\n }\n\n protected onInput(event: Event): void {\n const target = event.target as HTMLInputElement;\n this.setValue(target?.value ?? '');\n }\n}\n"],"mappings":";;;;;;;AA4DA,IAAa,yBA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;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA,CAAA,gBAAA,SAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAa,MAAA;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAIlE,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAsB,YAAA,CAAA;EAhDlC,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAkB,UAClB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCT,SACQ;IAAC;IAAgB;IAAqB;IAAiB;GAAa;GAAC,iBAE7D,wBAAwB;GAAM,QAAA,CAAA,s8HAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"magmonium-one-password-zW1YmyBs.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/ui/text/password.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n signal,\n} from '@angular/core';\nimport { LabelComponent } from '../label';\nimport { TextOutputComponent } from '../../../text-output';\nimport { BaseTextInputComponent } from './base-text';\nimport { ButtonComponent } from '../../../button/ui/button';\nimport { TranslatePipe } from '../../../../pipe';\n\n@Component({\n selector: 'm-password-input',\n template: `\n @if (config(); as text) {\n <m-label\n [for]=\"text.name\"\n [placeholder]=\"text.label\"\n [params]=\"text.params\"\n [required]=\"required()\"\n [disabled]=\"disabled()\"\n />\n <div class=\"input-wrapper\">\n <input\n [id]=\"text.name ?? ''\"\n [attr.data-testid]=\"text.testid ?? (text.name ? text.name + '-input' : null)\"\n [value]=\"value()\"\n #inputElement\n [class.error]=\"showErrors()\"\n [disabled]=\"disabled()\"\n [placeholder]=\"(text.placeholder ?? '') | translate: text.params\"\n (input)=\"onInput($event)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false); touched.set(true)\"\n [type]=\"type()\"\n />\n <m-one-button\n type=\"button\"\n [disabled]=\"disabled()\"\n [name]=\"button()\"\n [color]=\"iconColor()\"\n (clicked)=\"toggleType()\"\n />\n </div>\n @if (showErrors()) {\n @for (error of errors(); track $index) {\n <m-text-output\n variant=\"footer\"\n color=\"error\"\n [label]=\"error.message\"\n />\n }\n }\n }\n `,\n imports: [LabelComponent, TextOutputComponent, ButtonComponent, TranslatePipe],\n styleUrl: './password.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PasswordInputComponent extends BaseTextInputComponent {\n isPassword = signal<boolean>(true);\n type = computed(() => (this.isPassword() ? 'password' : 'text'));\n button = computed(() => (!this.isPassword() ? 'eye' : 'eye_close'));\n\n protected toggleType() {\n this.isPassword.update((now) => !now);\n }\n\n protected onInput(event: Event): void {\n const target = event.target as HTMLInputElement;\n this.setValue(target?.value ?? '');\n }\n}\n"],"mappings":";;;;;;;AA4DA,IAAa,yBAAb,MAAa,+BAA+B,uBAAsB;CAChE,aAAa,OAAgB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAClC,OAAO,eAAgB,KAAK,WAAU,IAAK,aAAa,QAAQ,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAChE,SAAS,eAAgB,CAAC,KAAK,WAAU,IAAK,QAAQ,aAAa,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAEzD,aAAU;EAClB,KAAK,WAAW,QAAQ,QAAQ,CAAC,GAAG;CACtC;CAEU,QAAQ,OAAY;EAC5B,MAAM,SAAS,MAAM;EACrB,KAAK,SAAS,QAAQ,SAAS,EAAE;CACnC;CAZW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAsB,MAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAtB,OAAA,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CH-g8CUR.mjs";
5
5
  import { t as InputType } from "./magmonium-one-input-DqHPorA1.mjs";
6
6
  import { t as BaseTextInputComponent } from "./magmonium-one-base-text-ChjG3GNw.mjs";
7
- import { t as TextOutputComponent } from "./magmonium-one-text-output-nJBGhbwG.mjs";
7
+ import { t as TextOutputComponent } from "./magmonium-one-text-output-9QMznoe1.mjs";
8
8
  import * as i0 from "@angular/core";
9
9
  import { ChangeDetectionStrategy, Component, computed, input, model } from "@angular/core";
10
10
  var text_exports = /* @__PURE__ */ __exportAll({ TextInputComponent: () => TextInputComponent });
@@ -208,7 +208,8 @@ var TextInputComponent = class TextInputComponent extends BaseTextInputComponent
208
208
  "fontWeight",
209
209
  "label",
210
210
  "noTranslate",
211
- "params"
211
+ "params",
212
+ "truncate"
212
213
  ],
213
214
  outputs: ["configChange", "clicked"]
214
215
  },
@@ -406,4 +407,4 @@ i0.ɵɵngDeclareClassMetadata({
406
407
  });
407
408
  export { text_exports as n, TextInputComponent as t };
408
409
 
409
- //# sourceMappingURL=magmonium-one-text-DT9ia02A.mjs.map
410
+ //# sourceMappingURL=magmonium-one-text-DLKgk_bm.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"magmonium-one-text-DT9ia02A.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/ui/text/text.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n model,\n} from '@angular/core';\nimport { LabelComponent } from '../label';\nimport { TextOutputComponent } from '../../../text-output';\nimport { BaseTextInputComponent } from './base-text';\nimport { IconComponent } from '../../../icon';\nimport { TranslatePipe } from '../../../../pipe';\nimport { Input, InputType, NumberInput } from '../../model/input';\nimport { ValidationError, WithOptionalFieldTree } from '@angular/forms/signals';\n\n/**\n * What this one component draws: a line of text, or the same line typed\n * `number`. WrapperInputComponent has no case for a `number` Field, so it\n * lands here — and the figures a NumberInput carries have to be readable off\n * the config the template already holds.\n */\nexport type TextOrNumberInput = Omit<Input, 'type'> &\n Pick<NumberInput, 'min' | 'max' | 'step'> & {\n type: InputType.TEXT | InputType.NUMBER;\n };\n\n@Component({\n selector: 'm-text-input',\n template: `\n @if (config(); as text) {\n @if (text.label) {\n <m-label\n [for]=\"text.name ?? ''\"\n [placeholder]=\"text.label\"\n [params]=\"text.params\"\n [noTranslate]=\"text.noTranslate\"\n [required]=\"required()\"\n [disabled]=\"disabled()\"\n />\n }\n <div class=\"input-wrapper\">\n @if (text.icon) {\n <m-icon\n [name]=\"text.icon\"\n [color]=\"iconColor()\"\n [one]=\"text.one\"\n />\n }\n @if (text.prefix) {\n <span class=\"input-prefix\">{{ text.prefix }}</span>\n }\n <input\n [id]=\"text.name ?? ''\"\n [attr.data-testid]=\"text.testid ?? (text.name ? text.name + '-input' : null)\"\n [value]=\"value()\"\n #inputElement\n [class.error]=\"showErrors()\"\n [class.has-icon]=\"!!text.icon\"\n [class.has-prefix]=\"!!text.prefix\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly() || config()?.readonly\"\n [placeholder]=\"text.placeholder ?? '' | translate: text.params\"\n (input)=\"onInput($event)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false); touched.set(true)\"\n [type]=\"isNumber() ? 'number' : 'text'\"\n [attr.min]=\"isNumber() ? text.min ?? null : null\"\n [attr.max]=\"isNumber() ? text.max ?? null : null\"\n [attr.step]=\"isNumber() ? text.step ?? null : null\"\n />\n @if (config()?.status; as status) {\n <div class=\"input-indicator\" [class]=\"'input-indicator--' + status\">\n @if (status === 'checking') {\n <span class=\"spinner\"></span>\n } @else if (status === 'available') {\n <m-icon name=\"check\" color=\"success\" />\n }\n </div>\n }\n @if (text.suffix) {\n <span class=\"input-suffix\">{{ text.suffix }}</span>\n }\n </div>\n @if (showErrors() && !hideErrors()) {\n @for (error of errors(); track $index) {\n <m-text-output\n variant=\"footer\"\n color=\"error\"\n [label]=\"error.message\"\n />\n }\n }\n }\n `,\n imports: [LabelComponent, TextOutputComponent, IconComponent, TranslatePipe],\n styleUrl: './text.sass',\n host: {\n '[class]': \"config()?.variant ? 'm-input--' + config()?.variant : ''\",\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TextInputComponent extends BaseTextInputComponent<TextOrNumberInput> {\n public override value = model<string>('');\n public override config = input<Partial<TextOrNumberInput> | undefined>();\n public override required = input<boolean>(false);\n public override disabled = input<boolean>(false);\n public override invalid = input<boolean>(false);\n public override touched = model<boolean>(false);\n public override focused = input<boolean>(false);\n public override errors = input<readonly WithOptionalFieldTree<ValidationError>[]>(\n []\n );\n public override showErrors = computed(() => this.touched() && this.invalid());\n readonly hideErrors = input<boolean>(false);\n\n // A `number` Field draws this same component (WrapperInputComponent has no\n // case of its own for it), so the type it declares decides the element it\n // draws. What *leaves* the field is coerced a level up, in the wrapper: an\n // `<input>` reads its value as text whatever its type, and every other\n // component on this base is a string field.\n protected readonly isNumber = computed(() => {\n const config = this.config();\n return !!config && config.type === InputType.NUMBER;\n });\n\n protected onInput(event: Event): void {\n const target = event.target as HTMLInputElement;\n this.setValue(target?.value ?? '');\n }\n}\n"],"mappings":";;;;;;;;;;AAqGA,IAAa,qBAAb,MAAa,2BAA2B,uBAAyC;CAC/D,QAAQ,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACzB,SAAS,MAA+C,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CACxD,WAAW,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,WAAW,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,UAAU,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,UAAU,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,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A3E9B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAc,UACd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiET,SACQ;IAAC;IAAgB;IAAqB;IAAe;GAAa;GAAC,MAEtE,EACJ,WAAW,2DACZ;GAAA,iBACgB,wBAAwB;GAAM,QAAA,CAAA,k2MAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"magmonium-one-text-DLKgk_bm.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/ui/text/text.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n model,\n} from '@angular/core';\nimport { LabelComponent } from '../label';\nimport { TextOutputComponent } from '../../../text-output';\nimport { BaseTextInputComponent } from './base-text';\nimport { IconComponent } from '../../../icon';\nimport { TranslatePipe } from '../../../../pipe';\nimport { Input, InputType, NumberInput } from '../../model/input';\nimport { ValidationError, WithOptionalFieldTree } from '@angular/forms/signals';\n\n/**\n * What this one component draws: a line of text, or the same line typed\n * `number`. WrapperInputComponent has no case for a `number` Field, so it\n * lands here — and the figures a NumberInput carries have to be readable off\n * the config the template already holds.\n */\nexport type TextOrNumberInput = Omit<Input, 'type'> &\n Pick<NumberInput, 'min' | 'max' | 'step'> & {\n type: InputType.TEXT | InputType.NUMBER;\n };\n\n@Component({\n selector: 'm-text-input',\n template: `\n @if (config(); as text) {\n @if (text.label) {\n <m-label\n [for]=\"text.name ?? ''\"\n [placeholder]=\"text.label\"\n [params]=\"text.params\"\n [noTranslate]=\"text.noTranslate\"\n [required]=\"required()\"\n [disabled]=\"disabled()\"\n />\n }\n <div class=\"input-wrapper\">\n @if (text.icon) {\n <m-icon\n [name]=\"text.icon\"\n [color]=\"iconColor()\"\n [one]=\"text.one\"\n />\n }\n @if (text.prefix) {\n <span class=\"input-prefix\">{{ text.prefix }}</span>\n }\n <input\n [id]=\"text.name ?? ''\"\n [attr.data-testid]=\"text.testid ?? (text.name ? text.name + '-input' : null)\"\n [value]=\"value()\"\n #inputElement\n [class.error]=\"showErrors()\"\n [class.has-icon]=\"!!text.icon\"\n [class.has-prefix]=\"!!text.prefix\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly() || config()?.readonly\"\n [placeholder]=\"text.placeholder ?? '' | translate: text.params\"\n (input)=\"onInput($event)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false); touched.set(true)\"\n [type]=\"isNumber() ? 'number' : 'text'\"\n [attr.min]=\"isNumber() ? text.min ?? null : null\"\n [attr.max]=\"isNumber() ? text.max ?? null : null\"\n [attr.step]=\"isNumber() ? text.step ?? null : null\"\n />\n @if (config()?.status; as status) {\n <div class=\"input-indicator\" [class]=\"'input-indicator--' + status\">\n @if (status === 'checking') {\n <span class=\"spinner\"></span>\n } @else if (status === 'available') {\n <m-icon name=\"check\" color=\"success\" />\n }\n </div>\n }\n @if (text.suffix) {\n <span class=\"input-suffix\">{{ text.suffix }}</span>\n }\n </div>\n @if (showErrors() && !hideErrors()) {\n @for (error of errors(); track $index) {\n <m-text-output\n variant=\"footer\"\n color=\"error\"\n [label]=\"error.message\"\n />\n }\n }\n }\n `,\n imports: [LabelComponent, TextOutputComponent, IconComponent, TranslatePipe],\n styleUrl: './text.sass',\n host: {\n '[class]': \"config()?.variant ? 'm-input--' + config()?.variant : ''\",\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TextInputComponent extends BaseTextInputComponent<TextOrNumberInput> {\n public override value = model<string>('');\n public override config = input<Partial<TextOrNumberInput> | undefined>();\n public override required = input<boolean>(false);\n public override disabled = input<boolean>(false);\n public override invalid = input<boolean>(false);\n public override touched = model<boolean>(false);\n public override focused = input<boolean>(false);\n public override errors = input<readonly WithOptionalFieldTree<ValidationError>[]>(\n []\n );\n public override showErrors = computed(() => this.touched() && this.invalid());\n readonly hideErrors = input<boolean>(false);\n\n // A `number` Field draws this same component (WrapperInputComponent has no\n // case of its own for it), so the type it declares decides the element it\n // draws. What *leaves* the field is coerced a level up, in the wrapper: an\n // `<input>` reads its value as text whatever its type, and every other\n // component on this base is a string field.\n protected readonly isNumber = computed(() => {\n const config = this.config();\n return !!config && config.type === InputType.NUMBER;\n });\n\n protected onInput(event: Event): void {\n const target = event.target as HTMLInputElement;\n this.setValue(target?.value ?? '');\n }\n}\n"],"mappings":";;;;;;;;;;AAqGA,IAAa,qBAAb,MAAa,2BAA2B,uBAAyC;CAC/D,QAAQ,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACzB,SAAS,MAA+C,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CACxD,WAAW,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,WAAW,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,UAAU,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,UAAU,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,UAAU,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,SAAS,MACvB,CAAA,GACD,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CACe,aAAa,eAAe,KAAK,QAAO,KAAM,KAAK,QAAO,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CACpE,aAAa,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAOxB,WAAW,eAAc;EAC1C,MAAM,SAAS,KAAK,OAAM;EA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,EAAA,YAAA,EAAA,SAAA,2DAAA,EAAA;EAAA,iBAAA;EAAA,UAAA;EAAA,UAzEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiET,UAAA;EAAA,QAAA,CAAA,k2MAAA;EAAA,cAAA;GAAA;IAAA,MAAA;IAAA,MACS;IAAc,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAmB,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA,CAAA,gBAAA,SAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAa,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA,CAAA,cAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAa,MAAA;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAOhE,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAkB,YAAA,CAAA;EA3E9B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAc,UACd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiET,SACQ;IAAC;IAAgB;IAAqB;IAAe;GAAa;GAAC,MAEtE,EACJ,WAAW,2DACZ;GAAA,iBACgB,wBAAwB;GAAM,QAAA,CAAA,k2MAAA;EAAA,CAAA"}
@@ -14,6 +14,7 @@ var TextOutputComponent = class TextOutputComponent extends ConfigComponent {
14
14
  label = input(void 0, ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
15
15
  noTranslate = input(void 0, ...ngDevMode ? [{ debugName: "noTranslate" }] : /* istanbul ignore next */ []);
16
16
  params = input(void 0, ...ngDevMode ? [{ debugName: "params" }] : /* istanbul ignore next */ []);
17
+ truncate = input(void 0, ...ngDevMode ? [{ debugName: "truncate" }] : /* istanbul ignore next */ []);
17
18
  resolvedAlign = computed(() => this.align() ?? this.config()?.align ?? "left", ...ngDevMode ? [{ debugName: "resolvedAlign" }] : /* istanbul ignore next */ []);
18
19
  resolvedVariant = computed(() => this.variant() ?? this.config()?.variant, ...ngDevMode ? [{ debugName: "resolvedVariant" }] : /* istanbul ignore next */ []);
19
20
  resolvedFontWeight = computed(() => this.fontWeight() ?? this.config()?.fontWeight, ...ngDevMode ? [{ debugName: "resolvedFontWeight" }] : /* istanbul ignore next */ []);
@@ -118,6 +119,13 @@ var TextOutputComponent = class TextOutputComponent extends ConfigComponent {
118
119
  isSignal: true,
119
120
  isRequired: false,
120
121
  transformFunction: null
122
+ },
123
+ truncate: {
124
+ classPropertyName: "truncate",
125
+ publicName: "truncate",
126
+ isSignal: true,
127
+ isRequired: false,
128
+ transformFunction: null
121
129
  }
122
130
  },
123
131
  outputs: {
@@ -147,6 +155,7 @@ var TextOutputComponent = class TextOutputComponent extends ConfigComponent {
147
155
  "class.weight-semibold": "resolvedFontWeight() === \"semibold\"",
148
156
  "class.weight-bold": "resolvedFontWeight() === \"bold\"",
149
157
  "class.has-color": "!!(color() ?? config()?.color)",
158
+ "class.is-truncated": "!!truncate()",
150
159
  "attr.role": "isLink() ? \"link\" : null",
151
160
  "attr.tabindex": "isLink() ? 0 : null",
152
161
  "style.--m-text-output-color": "resolvedColorPallet().color",
@@ -165,7 +174,7 @@ var TextOutputComponent = class TextOutputComponent extends ConfigComponent {
165
174
  ></div>
166
175
  `,
167
176
  isInline: true,
168
- styles: ["@keyframes toggle-pulse{0%,to{transform:scale(1)}50%{transform:scale(1.02)}}@keyframes thumb-slide{0%{transform:translate(0) scale(1)}50%{transform:translate(.3em) scale(.9)}to{transform:translate(.6em) scale(1)}}:host(.is-design-mode){display:block;min-width:1em;min-height:1em}:host(.align-left) .m-text-output{text-align:left}:host(.align-center) .m-text-output{text-align:center}:host(.align-right) .m-text-output{text-align:right}:host{font-size:inherit}:host(.variant-lead){display:block;font-size:1.15em;font-weight:300}:host(.variant-lead) .m-text-output{line-height:1.6}:host(.variant-big){display:block;font-size:1.5em;font-weight:600}:host(.variant-big) .m-text-output{line-height:1.25}:host(.variant-bold){display:block;font-weight:700}:host(.variant-footer){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-footer) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-footer){font-size:calc(var(--m-text-output-body-font-size, 1em) * .75);display:block;margin-top:.25rem}m-flex.align-items-center.direction-row>:host(.variant-footer),m-flex.align-items-center.direction-row-reverse>:host(.variant-footer){margin-top:0}:host(.variant-footnote){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-footnote) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-footnote){font-size:calc(var(--m-text-output-body-font-size, 1em) * .6);display:block;margin-top:.25rem}:host(.variant-link){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-link) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-link){text-decoration:none;cursor:pointer;transition:color .2s ease-in-out,text-decoration .2s ease-in-out;outline:none}:host(.variant-link):focus{outline:2px solid var(--m-focus);outline-offset:2px}:host(.variant-link){display:inline;border-radius:.25rem}:host(.variant-link) .m-text-output{display:inline;text-decoration:underline;text-decoration-color:color-mix(in srgb,currentColor 35%,transparent);text-decoration-thickness:max(1px,.06em);text-underline-offset:.18em;transition:text-decoration-color .15s ease-in-out,text-decoration-thickness .15s ease-in-out}:host(.variant-link) .m-text-output:hover{text-decoration-color:currentColor;text-decoration-thickness:max(2px,.1em)}:host(.variant-link) .m-text-output>p{display:inline;margin:0}:host(.variant-link-small){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-link-small) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-link-small){text-decoration:none;cursor:pointer;transition:color .2s ease-in-out,text-decoration .2s ease-in-out;outline:none}:host(.variant-link-small):focus{outline:2px solid var(--m-focus);outline-offset:2px}:host(.variant-link-small){display:inline;border-radius:.25rem}:host(.variant-link-small) .m-text-output{display:inline;text-decoration:underline;text-decoration-color:color-mix(in srgb,currentColor 35%,transparent);text-decoration-thickness:max(1px,.06em);text-underline-offset:.18em;transition:text-decoration-color .15s ease-in-out,text-decoration-thickness .15s ease-in-out}:host(.variant-link-small) .m-text-output:hover{text-decoration-color:currentColor;text-decoration-thickness:max(2px,.1em)}:host(.variant-link-small) .m-text-output>p{display:inline;margin:0}:host(.weight-light){font-weight:300}:host(.weight-normal){font-weight:400}:host(.weight-medium){font-weight:500}:host(.weight-semibold){font-weight:600}:host(.weight-bold){font-weight:700}:host(.has-color) .m-text-output{-webkit-text-fill-color:currentColor}.m-text-output{color:var(--m-text-output-color, var(--m-text));font-size:inherit;line-height:1.5}.m-text-output>:first-child{margin-top:0}.m-text-output>:last-child{margin-bottom:0}.m-text-output p,.m-text-output ul,.m-text-output blockquote,.m-text-output h1,.m-text-output h2,.m-text-output h3,.m-text-output h4,.m-text-output h5,.m-text-output h6{margin:0 0 1rem}.m-text-output ul{padding-left:1.5rem;list-style-type:disc;list-style-position:outside}.m-text-output li{margin-bottom:.25rem}.m-text-output li:last-child{margin-bottom:0}.m-text-output a{color:var(--m-text-output-link-color, var(--m-mm));text-decoration:underline;text-decoration-color:color-mix(in srgb,currentColor 35%,transparent);text-decoration-thickness:max(1px,.06em);text-underline-offset:.18em;transition:text-decoration-color .15s ease-in-out,text-decoration-thickness .15s ease-in-out}.m-text-output a:hover{text-decoration-color:currentColor;text-decoration-thickness:max(2px,.1em)}.m-text-output blockquote{padding-left:1rem;border-left:1px solid var(--m-border);color:var(--m-text-output-color, var(--m-text-secondary))}\n"],
177
+ styles: ["@keyframes toggle-pulse{0%,to{transform:scale(1)}50%{transform:scale(1.02)}}@keyframes thumb-slide{0%{transform:translate(0) scale(1)}50%{transform:translate(.3em) scale(.9)}to{transform:translate(.6em) scale(1)}}:host(.is-design-mode){display:block;min-width:1em;min-height:1em}:host(.align-left) .m-text-output{text-align:left}:host(.align-center) .m-text-output{text-align:center}:host(.align-right) .m-text-output{text-align:right}:host{font-size:inherit}:host(.variant-lead){display:block;font-size:1.15em;font-weight:300}:host(.variant-lead) .m-text-output{line-height:1.6}:host(.variant-big){display:block;font-size:1.5em;font-weight:600}:host(.variant-big) .m-text-output{line-height:1.25}:host(.variant-bold){display:block;font-weight:700}:host(.variant-footer){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-footer) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-footer){font-size:calc(var(--m-text-output-body-font-size, 1em) * .75);display:block;margin-top:.25rem}m-flex.align-items-center.direction-row>:host(.variant-footer),m-flex.align-items-center.direction-row-reverse>:host(.variant-footer){margin-top:0}:host(.variant-footnote){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-footnote) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-footnote){font-size:calc(var(--m-text-output-body-font-size, 1em) * .6);display:block;margin-top:.25rem}:host(.variant-link){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-link) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-link){text-decoration:none;cursor:pointer;transition:color .2s ease-in-out,text-decoration .2s ease-in-out;outline:none}:host(.variant-link):focus{outline:2px solid var(--m-focus);outline-offset:2px}:host(.variant-link){display:inline;border-radius:.25rem}:host(.variant-link) .m-text-output{display:inline;text-decoration:underline;text-decoration-color:color-mix(in srgb,currentColor 35%,transparent);text-decoration-thickness:max(1px,.06em);text-underline-offset:.18em;transition:text-decoration-color .15s ease-in-out,text-decoration-thickness .15s ease-in-out}:host(.variant-link) .m-text-output:hover{text-decoration-color:currentColor;text-decoration-thickness:max(2px,.1em)}:host(.variant-link) .m-text-output>p{display:inline;margin:0}:host(.variant-link-small){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-link-small) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-link-small){text-decoration:none;cursor:pointer;transition:color .2s ease-in-out,text-decoration .2s ease-in-out;outline:none}:host(.variant-link-small):focus{outline:2px solid var(--m-focus);outline-offset:2px}:host(.variant-link-small){display:inline;border-radius:.25rem}:host(.variant-link-small) .m-text-output{display:inline;text-decoration:underline;text-decoration-color:color-mix(in srgb,currentColor 35%,transparent);text-decoration-thickness:max(1px,.06em);text-underline-offset:.18em;transition:text-decoration-color .15s ease-in-out,text-decoration-thickness .15s ease-in-out}:host(.variant-link-small) .m-text-output:hover{text-decoration-color:currentColor;text-decoration-thickness:max(2px,.1em)}:host(.variant-link-small) .m-text-output>p{display:inline;margin:0}:host(.is-truncated){display:block;min-width:0;max-width:100%;overflow:hidden}:host(.is-truncated) .m-text-output,:host(.is-truncated) .m-text-output>*{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;overflow-wrap:anywhere}:host(.weight-light){font-weight:300}:host(.weight-normal){font-weight:400}:host(.weight-medium){font-weight:500}:host(.weight-semibold){font-weight:600}:host(.weight-bold){font-weight:700}:host(.has-color) .m-text-output{-webkit-text-fill-color:currentColor}.m-text-output{color:var(--m-text-output-color, var(--m-text));font-size:inherit;line-height:1.5}.m-text-output>:first-child{margin-top:0}.m-text-output>:last-child{margin-bottom:0}.m-text-output p,.m-text-output ul,.m-text-output blockquote,.m-text-output h1,.m-text-output h2,.m-text-output h3,.m-text-output h4,.m-text-output h5,.m-text-output h6{margin:0 0 1rem}.m-text-output ul{padding-left:1.5rem;list-style-type:disc;list-style-position:outside}.m-text-output li{margin-bottom:.25rem}.m-text-output li:last-child{margin-bottom:0}.m-text-output a{color:var(--m-text-output-link-color, var(--m-mm));text-decoration:underline;text-decoration-color:color-mix(in srgb,currentColor 35%,transparent);text-decoration-thickness:max(1px,.06em);text-underline-offset:.18em;transition:text-decoration-color .15s ease-in-out,text-decoration-thickness .15s ease-in-out}.m-text-output a:hover{text-decoration-color:currentColor;text-decoration-thickness:max(2px,.1em)}.m-text-output blockquote{padding-left:1rem;border-left:1px solid var(--m-border);color:var(--m-text-output-color, var(--m-text-secondary))}\n"],
169
178
  changeDetection: i0.ChangeDetectionStrategy.OnPush
170
179
  });
171
180
  };
@@ -206,6 +215,7 @@ i0.ɵɵngDeclareClassMetadata({
206
215
  "[class.weight-semibold]": "resolvedFontWeight() === \"semibold\"",
207
216
  "[class.weight-bold]": "resolvedFontWeight() === \"bold\"",
208
217
  "[class.has-color]": "!!(color() ?? config()?.color)",
218
+ "[class.is-truncated]": "!!truncate()",
209
219
  "[attr.role]": "isLink() ? \"link\" : null",
210
220
  "[attr.tabindex]": "isLink() ? 0 : null",
211
221
  "(click)": "onClick()",
@@ -214,7 +224,7 @@ i0.ɵɵngDeclareClassMetadata({
214
224
  "[style.--m-text-output-color-contrast]": "resolvedColorPallet().contrastColor",
215
225
  "[style.--m-text-output-color-opposite]": "resolvedColorPallet().oppositeColor"
216
226
  },
217
- styles: ["@keyframes toggle-pulse{0%,to{transform:scale(1)}50%{transform:scale(1.02)}}@keyframes thumb-slide{0%{transform:translate(0) scale(1)}50%{transform:translate(.3em) scale(.9)}to{transform:translate(.6em) scale(1)}}:host(.is-design-mode){display:block;min-width:1em;min-height:1em}:host(.align-left) .m-text-output{text-align:left}:host(.align-center) .m-text-output{text-align:center}:host(.align-right) .m-text-output{text-align:right}:host{font-size:inherit}:host(.variant-lead){display:block;font-size:1.15em;font-weight:300}:host(.variant-lead) .m-text-output{line-height:1.6}:host(.variant-big){display:block;font-size:1.5em;font-weight:600}:host(.variant-big) .m-text-output{line-height:1.25}:host(.variant-bold){display:block;font-weight:700}:host(.variant-footer){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-footer) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-footer){font-size:calc(var(--m-text-output-body-font-size, 1em) * .75);display:block;margin-top:.25rem}m-flex.align-items-center.direction-row>:host(.variant-footer),m-flex.align-items-center.direction-row-reverse>:host(.variant-footer){margin-top:0}:host(.variant-footnote){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-footnote) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-footnote){font-size:calc(var(--m-text-output-body-font-size, 1em) * .6);display:block;margin-top:.25rem}:host(.variant-link){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-link) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-link){text-decoration:none;cursor:pointer;transition:color .2s ease-in-out,text-decoration .2s ease-in-out;outline:none}:host(.variant-link):focus{outline:2px solid var(--m-focus);outline-offset:2px}:host(.variant-link){display:inline;border-radius:.25rem}:host(.variant-link) .m-text-output{display:inline;text-decoration:underline;text-decoration-color:color-mix(in srgb,currentColor 35%,transparent);text-decoration-thickness:max(1px,.06em);text-underline-offset:.18em;transition:text-decoration-color .15s ease-in-out,text-decoration-thickness .15s ease-in-out}:host(.variant-link) .m-text-output:hover{text-decoration-color:currentColor;text-decoration-thickness:max(2px,.1em)}:host(.variant-link) .m-text-output>p{display:inline;margin:0}:host(.variant-link-small){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-link-small) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-link-small){text-decoration:none;cursor:pointer;transition:color .2s ease-in-out,text-decoration .2s ease-in-out;outline:none}:host(.variant-link-small):focus{outline:2px solid var(--m-focus);outline-offset:2px}:host(.variant-link-small){display:inline;border-radius:.25rem}:host(.variant-link-small) .m-text-output{display:inline;text-decoration:underline;text-decoration-color:color-mix(in srgb,currentColor 35%,transparent);text-decoration-thickness:max(1px,.06em);text-underline-offset:.18em;transition:text-decoration-color .15s ease-in-out,text-decoration-thickness .15s ease-in-out}:host(.variant-link-small) .m-text-output:hover{text-decoration-color:currentColor;text-decoration-thickness:max(2px,.1em)}:host(.variant-link-small) .m-text-output>p{display:inline;margin:0}:host(.weight-light){font-weight:300}:host(.weight-normal){font-weight:400}:host(.weight-medium){font-weight:500}:host(.weight-semibold){font-weight:600}:host(.weight-bold){font-weight:700}:host(.has-color) .m-text-output{-webkit-text-fill-color:currentColor}.m-text-output{color:var(--m-text-output-color, var(--m-text));font-size:inherit;line-height:1.5}.m-text-output>:first-child{margin-top:0}.m-text-output>:last-child{margin-bottom:0}.m-text-output p,.m-text-output ul,.m-text-output blockquote,.m-text-output h1,.m-text-output h2,.m-text-output h3,.m-text-output h4,.m-text-output h5,.m-text-output h6{margin:0 0 1rem}.m-text-output ul{padding-left:1.5rem;list-style-type:disc;list-style-position:outside}.m-text-output li{margin-bottom:.25rem}.m-text-output li:last-child{margin-bottom:0}.m-text-output a{color:var(--m-text-output-link-color, var(--m-mm));text-decoration:underline;text-decoration-color:color-mix(in srgb,currentColor 35%,transparent);text-decoration-thickness:max(1px,.06em);text-underline-offset:.18em;transition:text-decoration-color .15s ease-in-out,text-decoration-thickness .15s ease-in-out}.m-text-output a:hover{text-decoration-color:currentColor;text-decoration-thickness:max(2px,.1em)}.m-text-output blockquote{padding-left:1rem;border-left:1px solid var(--m-border);color:var(--m-text-output-color, var(--m-text-secondary))}\n"]
227
+ styles: ["@keyframes toggle-pulse{0%,to{transform:scale(1)}50%{transform:scale(1.02)}}@keyframes thumb-slide{0%{transform:translate(0) scale(1)}50%{transform:translate(.3em) scale(.9)}to{transform:translate(.6em) scale(1)}}:host(.is-design-mode){display:block;min-width:1em;min-height:1em}:host(.align-left) .m-text-output{text-align:left}:host(.align-center) .m-text-output{text-align:center}:host(.align-right) .m-text-output{text-align:right}:host{font-size:inherit}:host(.variant-lead){display:block;font-size:1.15em;font-weight:300}:host(.variant-lead) .m-text-output{line-height:1.6}:host(.variant-big){display:block;font-size:1.5em;font-weight:600}:host(.variant-big) .m-text-output{line-height:1.25}:host(.variant-bold){display:block;font-weight:700}:host(.variant-footer){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-footer) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-footer){font-size:calc(var(--m-text-output-body-font-size, 1em) * .75);display:block;margin-top:.25rem}m-flex.align-items-center.direction-row>:host(.variant-footer),m-flex.align-items-center.direction-row-reverse>:host(.variant-footer){margin-top:0}:host(.variant-footnote){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-footnote) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-footnote){font-size:calc(var(--m-text-output-body-font-size, 1em) * .6);display:block;margin-top:.25rem}:host(.variant-link){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-link) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-link){text-decoration:none;cursor:pointer;transition:color .2s ease-in-out,text-decoration .2s ease-in-out;outline:none}:host(.variant-link):focus{outline:2px solid var(--m-focus);outline-offset:2px}:host(.variant-link){display:inline;border-radius:.25rem}:host(.variant-link) .m-text-output{display:inline;text-decoration:underline;text-decoration-color:color-mix(in srgb,currentColor 35%,transparent);text-decoration-thickness:max(1px,.06em);text-underline-offset:.18em;transition:text-decoration-color .15s ease-in-out,text-decoration-thickness .15s ease-in-out}:host(.variant-link) .m-text-output:hover{text-decoration-color:currentColor;text-decoration-thickness:max(2px,.1em)}:host(.variant-link) .m-text-output>p{display:inline;margin:0}:host(.variant-link-small){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-link-small) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-link-small){text-decoration:none;cursor:pointer;transition:color .2s ease-in-out,text-decoration .2s ease-in-out;outline:none}:host(.variant-link-small):focus{outline:2px solid var(--m-focus);outline-offset:2px}:host(.variant-link-small){display:inline;border-radius:.25rem}:host(.variant-link-small) .m-text-output{display:inline;text-decoration:underline;text-decoration-color:color-mix(in srgb,currentColor 35%,transparent);text-decoration-thickness:max(1px,.06em);text-underline-offset:.18em;transition:text-decoration-color .15s ease-in-out,text-decoration-thickness .15s ease-in-out}:host(.variant-link-small) .m-text-output:hover{text-decoration-color:currentColor;text-decoration-thickness:max(2px,.1em)}:host(.variant-link-small) .m-text-output>p{display:inline;margin:0}:host(.is-truncated){display:block;min-width:0;max-width:100%;overflow:hidden}:host(.is-truncated) .m-text-output,:host(.is-truncated) .m-text-output>*{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;overflow-wrap:anywhere}:host(.weight-light){font-weight:300}:host(.weight-normal){font-weight:400}:host(.weight-medium){font-weight:500}:host(.weight-semibold){font-weight:600}:host(.weight-bold){font-weight:700}:host(.has-color) .m-text-output{-webkit-text-fill-color:currentColor}.m-text-output{color:var(--m-text-output-color, var(--m-text));font-size:inherit;line-height:1.5}.m-text-output>:first-child{margin-top:0}.m-text-output>:last-child{margin-bottom:0}.m-text-output p,.m-text-output ul,.m-text-output blockquote,.m-text-output h1,.m-text-output h2,.m-text-output h3,.m-text-output h4,.m-text-output h5,.m-text-output h6{margin:0 0 1rem}.m-text-output ul{padding-left:1.5rem;list-style-type:disc;list-style-position:outside}.m-text-output li{margin-bottom:.25rem}.m-text-output li:last-child{margin-bottom:0}.m-text-output a{color:var(--m-text-output-link-color, var(--m-mm));text-decoration:underline;text-decoration-color:color-mix(in srgb,currentColor 35%,transparent);text-decoration-thickness:max(1px,.06em);text-underline-offset:.18em;transition:text-decoration-color .15s ease-in-out,text-decoration-thickness .15s ease-in-out}.m-text-output a:hover{text-decoration-color:currentColor;text-decoration-thickness:max(2px,.1em)}.m-text-output blockquote{padding-left:1rem;border-left:1px solid var(--m-border);color:var(--m-text-output-color, var(--m-text-secondary))}\n"]
218
228
  }]
219
229
  }],
220
230
  propDecorators: {
@@ -285,6 +295,14 @@ i0.ɵɵngDeclareClassMetadata({
285
295
  required: false
286
296
  }]
287
297
  }],
298
+ truncate: [{
299
+ type: i0.Input,
300
+ args: [{
301
+ isSignal: true,
302
+ alias: "truncate",
303
+ required: false
304
+ }]
305
+ }],
288
306
  clicked: [{
289
307
  type: i0.Output,
290
308
  args: ["clicked"]
@@ -293,4 +311,4 @@ i0.ɵɵngDeclareClassMetadata({
293
311
  });
294
312
  export { TextOutputComponent as t };
295
313
 
296
- //# sourceMappingURL=magmonium-one-text-output-nJBGhbwG.mjs.map
314
+ //# sourceMappingURL=magmonium-one-text-output-9QMznoe1.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"magmonium-one-text-output-9QMznoe1.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/text-output/ui/text-output.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n model,\n output,\n} from '@angular/core';\nimport { TranslateService } from '../../../services/translate';\nimport { ConfigComponent } from '../../../lib/components/config-component';\nimport { Config } from '../../../type/config/config-type';\nimport { LAYOUT_ASSET_FOLDER } from '../../../enum';\nimport { toAttrBool } from '../../../functions/config/attribute-value';\nimport { resolvePallet } from '../../../lib/theme/lib/color-utl';\n\nexport type TextOutputAlign = 'left' | 'right' | 'center';\n\n// Variants are roles, not styles: each one says what the text is doing on the\n// page, and the Section it sits in decides how big that role renders. Every\n// size below is therefore an `em` multiple of the inherited Section font-size\n// — a `lead` in a compact Section stays proportionally a lead — which is the\n// one rule the plain (undefined) variant keeps by inheriting outright.\n//\n// - `lead` opening paragraph that introduces the block under it\n// - `big` one-line statement — a number, a verdict, a headline that is\n// not a SectionHeader\n// - `bold` emphasis at body size, for the line that must be read first\n// - `footer` annotation under the thing it describes — a field's validation\n// message, a caption, a disclaimer; 0.75 of body, body colour\n// - `footnote` aside the reader may skip — source, legal line, small print;\n// 0.6 of body, body colour\n// - `link` text that goes somewhere on click — an affordance rather than\n// a size, so it is the one role that stays inline, takes focus,\n// and emits `clicked`\n// - `link-small` the same affordance for a link that trails the content it\n// belongs to rather than carrying a line of its own — a \"see\n// all\", an \"edit\" beside a field; body size like `link`\nexport type TextOutputVariant =\n | 'lead'\n | 'big'\n | 'bold'\n | 'footer'\n | 'footnote'\n | 'link'\n | 'link-small';\n\n// Weight tokens of the type scale. Applied after the variant, so it overrides\n// the weight a role implies (`lead` light, `big` semibold, `bold` bold).\nexport type TextOutputFontWeight =\n | 'light'\n | 'normal'\n | 'medium'\n | 'semibold'\n | 'bold';\n\nexport interface TextOutputConfig extends Config {\n label?: string;\n noTranslate?: boolean;\n align?: TextOutputAlign;\n variant?: TextOutputVariant;\n color?: string;\n fontWeight?: TextOutputFontWeight;\n}\n\n@Component({\n selector: 'm-text-output',\n imports: [],\n template: `\n <div\n class=\"m-text-output\"\n [style.color]=\"resolvedColorPallet().color\"\n [innerHTML]=\"html()\"\n ></div>\n `,\n styleUrl: './text-output.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'm-text-output-host',\n '[class.is-design-mode]': 'isDesignMode',\n '[class.align-left]': 'resolvedAlign() === \"left\"',\n '[class.align-right]': 'resolvedAlign() === \"right\"',\n '[class.align-center]': 'resolvedAlign() === \"center\"',\n '[class.variant-lead]': 'resolvedVariant() === \"lead\"',\n '[class.variant-big]': 'resolvedVariant() === \"big\"',\n '[class.variant-bold]': 'resolvedVariant() === \"bold\"',\n '[class.variant-footer]': 'resolvedVariant() === \"footer\"',\n '[class.variant-footnote]': 'resolvedVariant() === \"footnote\"',\n '[class.variant-link]': 'resolvedVariant() === \"link\"',\n '[class.variant-link-small]': 'resolvedVariant() === \"link-small\"',\n '[class.weight-light]': 'resolvedFontWeight() === \"light\"',\n '[class.weight-normal]': 'resolvedFontWeight() === \"normal\"',\n '[class.weight-medium]': 'resolvedFontWeight() === \"medium\"',\n '[class.weight-semibold]': 'resolvedFontWeight() === \"semibold\"',\n '[class.weight-bold]': 'resolvedFontWeight() === \"bold\"',\n '[class.has-color]': '!!(color() ?? config()?.color)',\n '[class.is-truncated]': '!!truncate()',\n // Only a link is reachable and announced as one. Every other variant is a\n // size, and a focus stop on plain text is a tab stop that does nothing.\n '[attr.role]': 'isLink() ? \"link\" : null',\n '[attr.tabindex]': 'isLink() ? 0 : null',\n '(click)': 'onClick()',\n '(keydown.enter)': 'onClick()',\n '[style.--m-text-output-color]': 'resolvedColorPallet().color',\n '[style.--m-text-output-color-contrast]': 'resolvedColorPallet().contrastColor',\n '[style.--m-text-output-color-opposite]': 'resolvedColorPallet().oppositeColor',\n },\n})\nexport class TextOutputComponent extends ConfigComponent<TextOutputConfig> {\n override subFolder = LAYOUT_ASSET_FOLDER.text_output;\n override config = model<Partial<TextOutputConfig>>();\n private readonly translateService = inject(TranslateService);\n\n readonly align = input<TextOutputAlign | undefined>(undefined);\n readonly variant = input<TextOutputVariant | undefined>(undefined);\n // A theme colour key (`error`, `warning`, `success`, …) or a raw CSS colour,\n // resolved the same way an Icon's or a Logo's is so a token follows the\n // active theme instead of freezing one theme's hex into a template.\n readonly color = input<string | undefined>(undefined);\n readonly fontWeight = input<TextOutputFontWeight | undefined>(undefined);\n // `label` is the text itself, so a one-off TextOutput needs no asset behind\n // it (ADR 0010). MiniMark is a single string whatever it renders to, which\n // is what lets it ride on the tag at all.\n readonly label = input<string | undefined>(undefined);\n readonly noTranslate = input<boolean | string | undefined>(undefined);\n // Values for the message's `<name>` / `<$name>` placeholders. An input and\n // deliberately not a TextOutputConfig key: an asset is resolved by name and\n // shared across every Control that names it, and these differ per render\n // (ADR 0020). The query-string form (`min_length?len=6`) still works and\n // still loses to this on a shared placeholder, that being the precedence\n // TranslateService already had. Bind a named member — an object literal in a\n // template is refused by `no-inline-config` (ADR 0010).\n readonly params = input<Record<string, string> | undefined>(undefined);\n // One line, cut with an ellipsis at the box's edge rather than wrapping or\n // spilling into a neighbour. For text whose length says nothing about the\n // layout — a bound path drawn as `{store.a.b.c}` on the design Canvas.\n readonly truncate = input<boolean | undefined>(undefined);\n\n readonly resolvedAlign = computed<TextOutputAlign>(\n () => this.align() ?? this.config()?.align ?? 'left'\n );\n\n protected readonly resolvedVariant = computed<TextOutputVariant | undefined>(\n () => this.variant() ?? this.config()?.variant\n );\n\n protected readonly resolvedFontWeight = computed<\n TextOutputFontWeight | undefined\n >(() => this.fontWeight() ?? this.config()?.fontWeight);\n\n // Both link roles are the same affordance, so both take the focus stop, the\n // `role=\"link\"` and the `clicked` output; only their size differs.\n protected readonly isLink = computed(() => {\n const variant = this.resolvedVariant();\n return variant === 'link' || variant === 'link-small';\n });\n\n /**\n * Fired by a `link` variant and by nothing else. A text that is not a link\n * draws no affordance and takes no focus, so a click on it is a click on\n * prose — emitting there would be a control only a mouse could find.\n *\n * Where the link goes to a route instead, the caller attaches `routerLink`\n * and binds nothing here: one click means one thing.\n */\n readonly clicked = output<void>();\n\n protected onClick(): void {\n if (this.isLink()) this.clicked.emit();\n }\n\n protected readonly resolvedColorPallet = computed(() =>\n resolvePallet(\n this.color() ?? this.config()?.color ?? this.defaultColor,\n this.themeStore.color()\n )\n );\n\n protected override resolveComponentOverrides(): Partial<TextOutputConfig> {\n const overrides: Partial<TextOutputConfig> = {};\n const align = this.align();\n if (align !== undefined) overrides.align = align;\n const label = this.label();\n if (label !== undefined) overrides.label = label;\n const noTranslate = toAttrBool(this.noTranslate());\n if (noTranslate !== undefined) overrides.noTranslate = noTranslate;\n const variant = this.variant();\n if (variant !== undefined) overrides.variant = variant;\n const color = this.color();\n if (color !== undefined) overrides.color = color;\n const fontWeight = this.fontWeight();\n if (fontWeight !== undefined) overrides.fontWeight = fontWeight;\n return overrides;\n }\n\n protected readonly resolvedLabel = computed(() => this.config()?.label);\n protected readonly shouldTranslate = computed(\n () => !this.config()?.noTranslate\n );\n protected readonly html = computed(() => {\n const label = this.resolvedLabel();\n return this.shouldTranslate()\n ? this.translateService.translateToHtml(label, this.params())\n : this.translateService.toSafeHtml(label);\n });\n}\n"],"mappings":";;;;;AA4GA,IAAa,sBAAb,MAAa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