@magmonium/one 0.4.70 → 0.4.72

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.
Files changed (37) hide show
  1. package/fesm2022/{magmonium-one-base-dropdown-DMgBZ3oa.mjs → magmonium-one-base-dropdown-DlggqKkE.mjs} +5 -5
  2. package/fesm2022/{magmonium-one-base-dropdown-DMgBZ3oa.mjs.map → magmonium-one-base-dropdown-DlggqKkE.mjs.map} +1 -1
  3. package/fesm2022/{magmonium-one-button-CKHBcCoO.mjs → magmonium-one-button-DO7FTwuF.mjs} +8 -2
  4. package/fesm2022/magmonium-one-button-DO7FTwuF.mjs.map +1 -0
  5. package/fesm2022/{magmonium-one-checkbox-CmPgvVHJ.mjs → magmonium-one-checkbox-DHg1sBWl.mjs} +3 -3
  6. package/fesm2022/{magmonium-one-checkbox-CmPgvVHJ.mjs.map → magmonium-one-checkbox-DHg1sBWl.mjs.map} +1 -1
  7. package/fesm2022/{magmonium-one-group-sz1ufuBT.mjs → magmonium-one-group-BsqCB8D2.mjs} +3 -3
  8. package/fesm2022/{magmonium-one-group-sz1ufuBT.mjs.map → magmonium-one-group-BsqCB8D2.mjs.map} +1 -1
  9. package/fesm2022/{magmonium-one-header-CkW_6y7m.mjs → magmonium-one-header-CgOV_m7w.mjs} +2 -2
  10. package/fesm2022/{magmonium-one-header-CkW_6y7m.mjs.map → magmonium-one-header-CgOV_m7w.mjs.map} +1 -1
  11. package/fesm2022/{magmonium-one-image-editor-BYNN15tt.mjs → magmonium-one-image-editor-NsUm59Ul.mjs} +4 -4
  12. package/fesm2022/{magmonium-one-image-editor-BYNN15tt.mjs.map → magmonium-one-image-editor-NsUm59Ul.mjs.map} +1 -1
  13. package/fesm2022/{magmonium-one-label-23DjRQdd.mjs → magmonium-one-label-BII6szn8.mjs} +21 -10
  14. package/fesm2022/magmonium-one-label-BII6szn8.mjs.map +1 -0
  15. package/fesm2022/{magmonium-one-menu-Nj_Aj1fs.mjs → magmonium-one-menu-CsoiLhVg.mjs} +2 -2
  16. package/fesm2022/{magmonium-one-menu-Nj_Aj1fs.mjs.map → magmonium-one-menu-CsoiLhVg.mjs.map} +1 -1
  17. package/fesm2022/{magmonium-one-multi-range-DYIv7jB7.mjs → magmonium-one-multi-range-BQ0f5IFY.mjs} +2 -2
  18. package/fesm2022/{magmonium-one-multi-range-DYIv7jB7.mjs.map → magmonium-one-multi-range-BQ0f5IFY.mjs.map} +1 -1
  19. package/fesm2022/{magmonium-one-otp-BOOJnnc2.mjs → magmonium-one-otp-Zo1X0_r5.mjs} +3 -3
  20. package/fesm2022/{magmonium-one-otp-BOOJnnc2.mjs.map → magmonium-one-otp-Zo1X0_r5.mjs.map} +1 -1
  21. package/fesm2022/{magmonium-one-password-CbivFrxS.mjs → magmonium-one-password-B8DtitsZ.mjs} +4 -4
  22. package/fesm2022/{magmonium-one-password-CbivFrxS.mjs.map → magmonium-one-password-B8DtitsZ.mjs.map} +1 -1
  23. package/fesm2022/{magmonium-one-radio-BjsRiF80.mjs → magmonium-one-radio-CldvuwLN.mjs} +2 -2
  24. package/fesm2022/{magmonium-one-radio-BjsRiF80.mjs.map → magmonium-one-radio-CldvuwLN.mjs.map} +1 -1
  25. package/fesm2022/{magmonium-one-range-M_HBccdt.mjs → magmonium-one-range-pxmV4Ytp.mjs} +2 -2
  26. package/fesm2022/{magmonium-one-range-M_HBccdt.mjs.map → magmonium-one-range-pxmV4Ytp.mjs.map} +1 -1
  27. package/fesm2022/{magmonium-one-text-CuKE9S8T.mjs → magmonium-one-text-Bst55TOO.mjs} +3 -3
  28. package/fesm2022/{magmonium-one-text-CuKE9S8T.mjs.map → magmonium-one-text-Bst55TOO.mjs.map} +1 -1
  29. package/fesm2022/{magmonium-one-text-output-M8sEPhFz.mjs → magmonium-one-text-output-E6pe3IOL.mjs} +2 -2
  30. package/fesm2022/magmonium-one-text-output-E6pe3IOL.mjs.map +1 -0
  31. package/fesm2022/magmonium-one.mjs +30 -37
  32. package/fesm2022/magmonium-one.mjs.map +1 -1
  33. package/package.json +1 -1
  34. package/types/magmonium-one.d.ts +63 -21
  35. package/fesm2022/magmonium-one-button-CKHBcCoO.mjs.map +0 -1
  36. package/fesm2022/magmonium-one-label-23DjRQdd.mjs.map +0 -1
  37. package/fesm2022/magmonium-one-text-output-M8sEPhFz.mjs.map +0 -1
@@ -1,12 +1,12 @@
1
1
  import { c as TranslatePipe, l as TranslateService } from "./magmonium-one-size-converter-BqkALIWA.mjs";
2
2
  import { t as SelectorDirective } from "./magmonium-one-selector-CeqlecBa.mjs";
3
- import { t as LabelComponent } from "./magmonium-one-label-23DjRQdd.mjs";
4
- import { t as ButtonComponent } from "./magmonium-one-button-CKHBcCoO.mjs";
3
+ import { t as LabelComponent } from "./magmonium-one-label-BII6szn8.mjs";
4
+ import { t as ButtonComponent } from "./magmonium-one-button-DO7FTwuF.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-M8sEPhFz.mjs";
9
- import { t as TextInputComponent } from "./magmonium-one-text-CuKE9S8T.mjs";
8
+ import { t as TextOutputComponent } from "./magmonium-one-text-output-E6pe3IOL.mjs";
9
+ import { t as TextInputComponent } from "./magmonium-one-text-Bst55TOO.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-DMgBZ3oa.mjs.map
606
+ //# sourceMappingURL=magmonium-one-base-dropdown-DlggqKkE.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"magmonium-one-base-dropdown-DMgBZ3oa.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,CA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,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,GAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,eAAA;EAAA,CAAA;EAAA,SAAA,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,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-DlggqKkE.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,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AA,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,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"}
@@ -187,6 +187,9 @@ var ReactiveElementComponent = class extends ConfigComponent {
187
187
  el.className = classNames.join(" ");
188
188
  }
189
189
  };
190
+ function enumValue(value, values) {
191
+ return typeof value === "string" && Object.values(values).includes(value) ? value : void 0;
192
+ }
190
193
  function deriveButtonClass(button) {
191
194
  if (!button) return "";
192
195
  const classList = [];
@@ -207,6 +210,9 @@ function isButtonName(name, button) {
207
210
  if (!button) return false;
208
211
  return button.name === name || button.label === name;
209
212
  }
213
+ function actionName(button, names) {
214
+ return enumValue(button?.name, names);
215
+ }
210
216
  function deriveGroupClass(group) {
211
217
  if (!group) return "";
212
218
  const classList = [];
@@ -1278,6 +1284,6 @@ i0.ɵɵngDeclareClassMetadata({
1278
1284
  }]
1279
1285
  }
1280
1286
  });
1281
- export { isButtonName as a, formatBadgeCount as c, deriveGroupClass as i, shouldShowBadge as l, SECTION_FORM_CONTEXT as n, ReactiveElementComponent as o, ImgComponent as r, BadgeComponent as s, ButtonComponent as t };
1287
+ export { actionName as a, ReactiveElementComponent as c, shouldShowBadge as d, deriveGroupClass as i, BadgeComponent as l, SECTION_FORM_CONTEXT as n, isButtonName as o, ImgComponent as r, enumValue as s, ButtonComponent as t, formatBadgeCount as u };
1282
1288
 
1283
- //# sourceMappingURL=magmonium-one-button-CKHBcCoO.mjs.map
1289
+ //# sourceMappingURL=magmonium-one-button-DO7FTwuF.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"magmonium-one-button-DO7FTwuF.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/badge/lib/badge.ts","../../../../libs/one/src/lib/shared/ui/badge/ui/badge.ts","../../../../libs/one/src/lib/shared/lib/components/reactive-element.ts","../../../../libs/one/src/lib/shared/functions/object/enum-value.ts","../../../../libs/one/src/lib/shared/ui/button/lib/function/button.ts","../../../../libs/one/src/lib/shared/ui/button/lib/function/group.ts","../../../../libs/one/src/lib/shared/ui/img/img.ts","../../../../libs/one/src/lib/shared/ui/form/lib/section-form-context.token.ts","../../../../libs/one/src/lib/shared/ui/button/ui/button.ts","../../../../libs/one/src/lib/shared/ui/button/ui/button.html"],"sourcesContent":["import { Badge } from '../type/badge';\n\nexport const getBadgeClasses = (config: Badge | undefined): string => {\n if (!config) return 'badge';\n\n const classes = ['badge'];\n\n if (config.variant) {\n classes.push(`badge--${config.variant}`);\n }\n\n if (config.position && config.position !== 'static') {\n classes.push(`badge--${config.position}`);\n }\n\n if (config.animation && config.animation !== 'none') {\n classes.push(`badge--${config.animation}`);\n }\n\n return classes.join(' ');\n};\n\nexport const formatBadgeCount = (\n count: number | undefined,\n maxCount = 99\n): string => {\n if (count === undefined || count <= 0) return '';\n if (count > maxCount) return `${maxCount}+`;\n return count.toString();\n};\n\nexport const shouldShowBadge = (count: number | undefined): boolean =>\n count !== undefined && count > 0;\n\nexport const formatCount = formatBadgeCount;\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n model,\n} from '@angular/core';\nimport { ConfigComponent } from '../../../lib/components/config-component';\nimport { Badge } from '../type';\nimport { getBadgeClasses } from '../lib';\nimport { IconComponent } from '../../icon/ui/icon';\n\n@Component({\n selector: 'm-badge',\n imports: [IconComponent],\n template: `\n <span [class]=\"classes()\">\n @if (iconConfig(); as icon) {\n <m-icon [config]=\"icon\" />\n }\n <ng-content />\n @if (config()?.ping) {\n <span class=\"badge__ping\"></span>\n }\n </span>\n `,\n styleUrls: ['./badge.sass'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BadgeComponent extends ConfigComponent<Badge> {\n override readonly subFolder = 'badges';\n override config = model<Partial<Badge>>();\n\n protected readonly classes = computed(() => getBadgeClasses(this.config()));\n\n protected readonly iconConfig = computed(() => {\n const iconName = this.config()?.icon;\n if (!iconName) return undefined;\n const variant = this.config()?.variant;\n\n let color = '';\n if (variant === 'saas') {\n color = 'mm';\n } else if (variant === 'minimal') {\n color = 'textSecondary';\n } else {\n color = this.pallet()?.contrastColor || '';\n }\n\n return {\n name: iconName,\n color,\n };\n });\n}\n","import { effect, ElementRef, signal } from '@angular/core';\nimport { ConfigComponent } from './config-component';\nimport { Config } from '../../type/config/config-type';\n\n/**\n * Base class that provides reactive classList functionality for components with viewChild elements.\n * Extends ConfigComponent to inherit config management and color service functionality.\n */\nexport abstract class ReactiveElementComponent<\n T extends Config,\n> extends ConfigComponent<T> {\n /**\n * Abstract property that child classes must implement to specify which element to observe.\n * Should return the viewChild ElementRef that contains the DOM element to observe.\n */\n protected abstract element(): ElementRef | undefined;\n\n /**\n * Reactive signal containing the current classList of the observed element.\n * Updates automatically when the DOM element's classes change.\n */\n protected readonly classList = signal<string[]>([]);\n\n /**\n * MutationObserver instance for observing class changes.\n * Automatically managed by the component lifecycle.\n */\n private observer: MutationObserver | null = null;\n\n constructor() {\n super();\n\n // Set up reactive classList observation\n effect(() => {\n const el = this.element()?.nativeElement;\n\n // Cleanup previous observer\n if (this.observer) {\n this.observer.disconnect();\n this.observer = null;\n }\n\n if (!el) {\n this.classList.set([]);\n return;\n }\n\n // Set initial classList\n this.classList.set(Array.from(el.classList));\n\n // Set up MutationObserver for reactivity\n this.observer = new MutationObserver(() => {\n this.classList.set(Array.from(el.classList));\n });\n\n this.observer.observe(el, {\n attributes: true,\n attributeFilter: ['class'],\n });\n });\n }\n\n /**\n * Check if the element has a specific CSS class.\n * @param className - The class name to check for\n * @returns True if the element has the class, false otherwise\n */\n protected hasClass(className: string): boolean {\n return this.classList().includes(className);\n }\n\n /**\n * Toggle a CSS class on the element.\n * @param className - The class name to toggle\n * @param force - Optional boolean to force add (true) or remove (false)\n */\n protected toggleClass(className: string, force?: boolean): void {\n const el = this.element()?.nativeElement;\n if (!el) return;\n\n if (force !== undefined) {\n el.classList.toggle(className, force);\n } else {\n el.classList.toggle(className);\n }\n }\n\n /**\n * Add one or more CSS classes to the element.\n * @param classNames - The class names to add\n */\n protected addClass(...classNames: string[]): void {\n const el = this.element()?.nativeElement;\n if (!el) return;\n\n el.classList.add(...classNames);\n }\n\n /**\n * Remove one or more CSS classes from the element.\n * @param classNames - The class names to remove\n */\n protected removeClass(...classNames: string[]): void {\n const el = this.element()?.nativeElement;\n if (!el) return;\n\n el.classList.remove(...classNames);\n }\n\n /**\n * Replace one CSS class with another.\n * @param oldClass - The class to remove\n * @param newClass - The class to add\n */\n protected replaceClass(oldClass: string, newClass: string): void {\n const el = this.element()?.nativeElement;\n if (!el) return;\n\n el.classList.replace(oldClass, newClass);\n }\n\n /**\n * Set the complete classList, replacing all existing classes.\n * @param classNames - The new class names to set\n */\n protected setClassList(classNames: string[]): void {\n const el = this.element()?.nativeElement;\n if (!el) return;\n\n el.className = classNames.join(' ');\n }\n}\n","/**\n * `value` as a member of `values` — a string enum's object — or `undefined`\n * when the enum does not hold it.\n *\n * The reader a generated Screen narrows a plain string through wherever it\n * lands on a value its SortEnum or action enum types: a typed-in literal, a\n * constant, an input, another Control's payload. A call and not an `as` cast,\n * for the reason the Field readers are one — the read lands in a template,\n * whose parser has no TS type assertion (NG5002) — and checked rather than\n * asserted, so a string the enum never held arrives as `undefined` instead of\n * as a lie (m-one-ui ADR 0203).\n */\nexport function enumValue<T extends string>(\n value: unknown,\n values: Record<string, T>\n): T | undefined {\n return typeof value === 'string' &&\n (Object.values(values) as string[]).includes(value)\n ? (value as T)\n : undefined;\n}\n","import { enumValue } from '../../../../functions/object/enum-value';\nimport { Button } from '../../type/button';\n\nexport function deriveButtonClass(button?: Button): string {\n if (!button) {\n return '';\n }\n const classList: string[] = [];\n if (button.icon || button.imgSrc) {\n if (!button.label || button.iconOnly) {\n classList.push('only-icon');\n }\n classList.push(button.isRightIcon ? 'with-right-icon' : 'with-left-icon');\n }\n if (button.variant === 'primary') {\n classList.push('primary');\n }\n if (button.variant === 'ghost') {\n classList.push('ghost');\n }\n if (button.variant === 'tab') {\n classList.push('tab');\n }\n if (button.fullWidth) {\n classList.push('full-width');\n }\n if (button.stacked) {\n classList.push('stacked');\n }\n if (button.badge) {\n classList.push('has-badge');\n }\n if (button.nonClickable) {\n classList.push('read-only');\n }\n return classList.join(' ');\n}\n\nexport function isButtonName(name: string, button?: Button): boolean {\n if (!button) {\n return false;\n }\n return button.name === name || button.label === name;\n}\n\n/**\n * The pressed Button's name, read as the enum a generated Screen keeps its\n * action bar's names in — or `undefined` for a press no name of it answers.\n *\n * The reader a SectionAction's `clicked` is written through wherever the value\n * lands on an enum-typed StateProperty or ScreenVariable. A call and not an\n * `as` cast, for the reason the Field readers are one: the read lands in a\n * template, whose parser has no TS type assertion (NG5002). Checked against\n * the enum's values rather than asserted, so a Button merged in from an asset\n * the enum never saw arrives as `undefined` instead of as a lie\n * (m-one-ui ADR 0203).\n */\nexport function actionName<Name extends string>(\n button: Button | undefined,\n names: Record<string, Name>\n): Name | undefined {\n return enumValue(button?.name, names);\n}\n","import { ButtonGroup } from '../../type/button';\n\nexport function deriveGroupClass(group?: Partial<ButtonGroup>): string {\n if (!group) {\n return '';\n }\n const classList: string[] = [];\n classList.push(group?.vertical ? 'vertical' : 'horizontal');\n\n // Handle center for backward compatibility\n if (group?.center) {\n classList.push('center');\n }\n\n // Handle new align property (takes precedence over center)\n if (group?.align) {\n classList.push(`align-${group.align}`);\n }\n\n if (group?.primary) {\n classList.push('is-primary');\n }\n\n return classList.join(' ');\n}\n","import {\n Component,\n ChangeDetectionStrategy,\n inject,\n input,\n signal,\n effect,\n computed,\n} from '@angular/core';\nimport { NgOptimizedImage, IMAGE_LOADER, ImageLoaderConfig } from '@angular/common';\nimport { HttpService } from '../../services/http';\n\n@Component({\n selector: 'm-img',\n\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgOptimizedImage],\n host: {\n // The box is the container's: 100% wide and tall unless a caller names\n // width/height figures, which land as inline px on this element.\n '[style.width.px]': 'boxWidth()',\n '[style.height.px]': 'boxHeight()',\n },\n providers: [\n {\n provide: IMAGE_LOADER,\n useValue: (config: ImageLoaderConfig) => {\n const src = config.src;\n if (src.includes('iiif.archive.org')) {\n const match = src.match(/(\\/full\\/)([^/]+)(\\/0\\/)/);\n if (match && config.width) {\n return src.replace(/(\\/full\\/)[^/]+(\\/0\\/)/, `$1${config.width},$2`);\n }\n }\n return src;\n },\n },\n ],\n template: `\n <div\n class=\"m-img\"\n [class.m-img--loaded]=\"status() === 'loaded'\"\n [class.m-img--error]=\"showFallback()\"\n [class.m-img--fill]=\"fill()\"\n [class.m-img--priority]=\"priority()\"\n [class.m-img--sized]=\"isSized()\"\n >\n @if (showFallback()) {\n <div class=\"m-img__fallback\" role=\"img\" [attr.aria-label]=\"alt()\">\n <svg viewBox=\"0 0 320 240\" fill=\"none\" preserveAspectRatio=\"xMidYMid slice\">\n <circle cx=\"112\" cy=\"92\" r=\"22\" fill=\"currentColor\" />\n <path d=\"M40 200l72-72 56 56 40-40 72 72z\" fill=\"currentColor\" />\n </svg>\n </div>\n } @else if (isDataUri()) {\n <img\n class=\"m-img__img\"\n [src]=\"effectiveSrc()!\"\n [alt]=\"alt()\"\n (load)=\"onLoad()\"\n (error)=\"onError()\"\n [width]=\"widthAttr()\"\n [height]=\"heightAttr()\"\n referrerpolicy=\"no-referrer\"\n />\n } @else {\n <img\n class=\"m-img__img\"\n [ngSrc]=\"effectiveSrc()!\"\n [alt]=\"alt()\"\n [priority]=\"priority()\"\n (load)=\"onLoad()\"\n (error)=\"onError()\"\n [fill]=\"fill()\"\n [width]=\"widthAttr()\"\n [height]=\"heightAttr()\"\n [ngSrcset]=\"autoNgSrcset()!\"\n [sizes]=\"sizes() || undefined\"\n decoding=\"async\"\n referrerpolicy=\"no-referrer\"\n />\n }\n @if (status() === 'loading' && !priority()) {\n <div class=\"m-img__skeleton\"></div>\n }\n </div>\n `,\n styleUrl: './img.sass',\n})\nexport class ImgComponent {\n readonly #httpService = inject(HttpService);\n\n readonly src = input<string | null | undefined>();\n readonly data = input<string | null | undefined>();\n readonly dataType = input<string>('image/jpeg');\n readonly alt = input.required<string>();\n readonly priority = input<boolean>(false);\n readonly fill = input<boolean>(true);\n // Unset rather than defaulted: `1200 × 1800` is the reservation\n // NgOptimizedImage needs, and a picture drawn 1200px wide because nobody\n // named a width is not the same thing. `attrWidth`/`attrHeight` carry that\n // default onto the tag; these two say whether anyone actually asked.\n readonly width = input<number | undefined>(undefined);\n readonly height = input<number | undefined>(undefined);\n readonly remote = input<string | undefined>();\n readonly ngSrcset = input<string | undefined>();\n readonly sizes = input<string | undefined>();\n\n readonly attrWidth = computed(() => this.width() ?? 1200);\n readonly attrHeight = computed(() => this.height() ?? 1800);\n\n // On the tag only when the picture is not filling its box — a filling\n // picture is sized by its box, the others carry the reservation figures.\n readonly widthAttr = computed(() => (this.fill() ? undefined : this.attrWidth()));\n readonly heightAttr = computed(() => (this.fill() ? undefined : this.attrHeight()));\n\n // Null unless the picture is drawn at a size it was told: a filling picture\n // takes its size from the box around it, and an unnamed figure leaves the\n // stylesheet's `width: 100%` in charge.\n readonly boxWidth = computed(() =>\n this.fill() ? null : (this.width() ?? null)\n );\n readonly boxHeight = computed(() =>\n this.fill() ? null : (this.height() ?? null)\n );\n\n // Both figures named means a box of exactly that shape, which the picture\n // has to cover rather than letter-box inside.\n readonly isSized = computed(\n () => this.boxWidth() !== null && this.boxHeight() !== null\n );\n\n readonly autoNgSrcset = computed(() => {\n const custom = this.ngSrcset();\n if (custom !== undefined) return custom;\n\n const src = this.effectiveSrc();\n if (src && src.includes('iiif.archive.org')) {\n return this.fill() ? '480w, 768w, 960w, 1200w, 1920w, 2048w' : '1x, 2x';\n }\n\n return undefined;\n });\n\n // --- State ---\n // One signal rather than a loaded/error pair: the three states are\n // exclusive, and two booleans could say both or neither.\n readonly status = signal<'loading' | 'loaded' | 'error'>('loading');\n\n readonly effectiveSrc = computed(() => {\n const d = this.data();\n if (d) return `data:${this.dataType()};base64,${d}`;\n const src = this.src();\n const remote = this.remote();\n if (\n src &&\n remote &&\n !src.startsWith('http') &&\n !src.startsWith('data:') &&\n !src.startsWith('blob:')\n ) {\n return this.#httpService.buildWcAssetUrl(remote, src);\n }\n return src;\n });\n\n // The one stand-in this component draws, for every case that has no picture\n // to show: a load that failed, a url nobody set, and design mode, where a\n // picture is placed on the canvas long before it points anywhere.\n readonly showFallback = computed(\n () => this.status() === 'error' || !this.effectiveSrc()\n );\n\n readonly isDataUri = computed(() => {\n const s = this.effectiveSrc();\n return !!s && (s.startsWith('data:') || s.startsWith('blob:'));\n });\n\n constructor() {\n effect(() => {\n // A source change starts the wait over.\n const source = this.effectiveSrc();\n this.status.set(source ? 'loading' : 'error');\n });\n }\n\n onLoad() {\n this.status.set('loaded');\n }\n\n onError() {\n this.status.set('error');\n }\n}\n","import { InjectionToken, Signal } from '@angular/core';\nimport { FieldTree } from '@angular/forms/signals';\nimport { FieldPatterns } from './field-patterns';\n\n/**\n * Published by `<m-section-form>` for projected `<m-section-form-item>`s.\n * Each item looks up `form()[name]` and binds `FormField` so its value writes\n * to that key — not via a `name` input on the inner TextInputComponent.\n *\n * The form context carries form state and field registration for projected\n * items. Sizing is inherited through the section/form host CSS variables.\n *\n * Projected Buttons read it when their `isSubmit` flag is true. That Button\n * locks on `blocked` and fires `submit` on click rather than relying on a\n * native `type=\"submit\"` — content projection can put it inside an app\n * wrapper, where the native path no longer reaches the `<form>` ancestor.\n */\nexport interface SectionFormContext {\n readonly form: Signal<FieldTree<Record<string, unknown>> | null>;\n /**\n * Announces a key, and whether the Field on that key is required. The flag is\n * what turns `required` written on a tag into a validator on the FieldTree —\n * without it the attribute only reaches the native input, which a `novalidate`\n * form ignores, so nothing would ever be invalid (ADR 0010).\n *\n * `value` is the Field's own value, written on its tag: what the key starts\n * on when the form's `data` holds nothing for it.\n */\n readonly registerField: (\n name: string,\n required?: boolean,\n patterns?: FieldPatterns,\n value?: unknown\n ) => void;\n /**\n * An item has mounted its control. Content projection gives the form no\n * render hook of its own, so this is what tells it the DOM is finally\n * complete enough to pick the field that takes the caret.\n */\n readonly fieldMounted: () => void;\n /**\n * An item has started loading its control's chunk. Every control arrives\n * through a dynamic import, and the chunks resolve in whatever order the\n * loader finishes them — so a `password` below an `otp` can put its input in\n * the DOM first. The form waits for the count to fall back to zero before it\n * reads document order for the caret.\n */\n readonly fieldPending: () => void;\n /** That load ended — mounted, superseded, or failed. Always paired with `fieldPending`. */\n readonly fieldSettled: () => void;\n /** Drops a destroyed item's rules, so a removed Field stops blocking. */\n readonly releaseField: (name: string) => void;\n /** Invalid or disabled — every submit control is locked while true. */\n readonly blocked: Signal<boolean>;\n /** Emits the form's `submit` output with the whole merged data. No-op while blocked. */\n readonly submit: () => void;\n /**\n * Bumped every time the form writes values the User did not type — a `data`\n * restamp, a `reset()` after submit. A projected item observing its own\n * field's value signal cannot tell those moves from a keystroke, so the\n * form says so: a move under an unchanged version is the User's, and the\n * only move a Field's `dataChange` announces (libs/one ADR 0032).\n */\n readonly dataVersion: Signal<number>;\n}\n\nexport const SECTION_FORM_CONTEXT = new InjectionToken<SectionFormContext>(\n 'SECTION_FORM_CONTEXT'\n);\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n forwardRef,\n inject,\n input,\n model,\n output,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { IconComponent } from '../../icon';\nimport { BadgeComponent } from '../../badge';\nimport { ReactiveElementComponent } from '../../../lib/components/reactive-element';\nimport { TranslatePipe } from '../../../pipe/translate';\nimport { Button } from '../type/button';\nimport { deriveButtonClass } from '../lib';\nimport { formatBadgeCount } from '../../badge';\nimport {\n toAttrBool,\n toAttrNumber,\n} from '../../../functions/config/attribute-value';\nimport { MRefDirective } from '../../../directives/m-ref/m-ref';\nimport { NAV_STORE_REF } from '../../../config/tokens';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { ImgComponent } from '../../img/img';\n\nimport { resolvePallet } from '../../../lib/theme';\nimport { ThemeColor } from '@magmonium/cli';\nimport { SECTION_FORM_CONTEXT } from '../../form/lib/section-form-context.token';\n\n@Component({\n selector: 'm-button,m-one-button',\n templateUrl: './button.html',\n imports: [\n forwardRef(() => TranslatePipe),\n forwardRef(() => IconComponent),\n forwardRef(() => BadgeComponent),\n RouterModule,\n MRefDirective,\n forwardRef(() => NgTemplateOutlet),\n forwardRef(() => ImgComponent),\n ],\n styleUrls: ['./button.sass'],\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ButtonComponent extends ReactiveElementComponent<Button> {\n override config = model<Partial<Button>>();\n color = input<string | keyof ThemeColor | undefined>();\n labelClass = input<string | undefined>();\n fullWidth = input<boolean | string | undefined>();\n // NavRef — a NavId. The store reads the NavKind off that node to decide\n // route vs panel, so the Button never picks a link kind (ADR 0014).\n nav = input<string | undefined>();\n navParams = input<Record<string, string | number> | undefined>();\n href = input<string | undefined>();\n disabled = input<boolean | undefined>();\n variant = input<'primary' | 'ghost' | 'secondary' | 'tab' | undefined>();\n override name = input<string | undefined>();\n override baseUrl = input<string | undefined>();\n override one = input<boolean | undefined>();\n override remote = input<string | undefined>();\n override subFolder = 'buttons';\n // The rest of what a `buttons/<name>.yml` carries, so a one-off Button needs\n // no file (ADR 0010). `badge` is absent on purpose — it is an object, and an\n // object literal in markup is a lint error, so a badged Button still names\n // an asset or takes a bound config.\n label = input<string | undefined>();\n noTranslate = input<boolean | string | undefined>();\n // A Record, so it never rides as a literal attribute (ADR 0010) — it arrives\n // bound, from the page member holding every dynamic message value.\n params = input<Record<string, string> | undefined>();\n // When true, render a non-native element (div) instead of a <button>.\n // Use this when consumers explicitly need to avoid native <button> tags.\n noNative = input<boolean | string | undefined>();\n icon = input<string | undefined>();\n isRightIcon = input<boolean | string | undefined>();\n iconOnly = input<boolean | string | undefined>();\n stacked = input<boolean | string | undefined>();\n imgSrc = input<string | undefined>();\n nonClickable = input<boolean | string | undefined>();\n inverted = input<boolean | string | undefined>();\n isSubmit = input<boolean | string | undefined>();\n tabindex = input<number | string | undefined>();\n readonly clicked = output<Button | undefined>();\n button = viewChild<ElementRef>('button');\n protected element = this.button;\n protected readonly className = computed(() =>\n deriveButtonClass(this.config())\n );\n private readonly navRef = inject(NAV_STORE_REF, { optional: true });\n\n // Present only for a Button projected into an `m-section-form`. Absent\n // everywhere else, so every Button outside one behaves exactly as before.\n private readonly sectionForm = inject(SECTION_FORM_CONTEXT, {\n optional: true,\n });\n\n // Only an explicitly marked Button inside a Section Form submits it. A\n // navigating Button is excluded: its click already goes somewhere, and\n // submitting on the way out would save a form the User was leaving.\n // A form on a visual editor's Canvas is a picture of a form, and its empty\n // fields make it invalid from the first render — a submit that locked on\n // that would show the designer a greyed-out Button they never configured.\n protected readonly isFormSubmit = computed(() => {\n if (!this.sectionForm || this.isDesignMode) return false;\n const config = this.config();\n if (config?.nav || config?.href) return false;\n return config?.isSubmit === true;\n });\n\n // The form's own lock, on top of whatever the config already disables: an\n // invalid or disabled form has nothing to submit, so its submit control says\n // so rather than swallowing the click.\n protected readonly isDisabled = computed(\n () =>\n this.config()?.disabled === true ||\n (this.isFormSubmit() && !!this.sectionForm?.blocked())\n );\n // A NavRef pointing at a Murl node reads as selected when it is the open\n // panel. Compared by NavId — there is no link string left to normalise.\n private readonly isMurlActive = computed(() => {\n const nav = this.config()?.nav;\n if (!nav) return false;\n if (!this.navRef?.murl()?.length) return false;\n return this.navRef.id() === nav;\n });\n private readonly isPrimary = computed(() =>\n this.variant() === 'primary' ||\n this.config()?.variant === 'primary' ||\n this.hasClass('primary')\n );\n private readonly colorInput = computed(() =>\n this.color() || this.config()?.color || 'mm'\n );\n private readonly buttonColor = computed(() => {\n const color = this.colorInput();\n const isPrimary = this.isPrimary();\n if (isPrimary && color === 'inverseText') {\n return resolvePallet('mm', this.themeStore.color()).color;\n }\n const pallet = resolvePallet(color, this.themeStore.color());\n return isPrimary ? pallet.contrastColor : pallet.color;\n });\n\n constructor() {\n super();\n effect(() => {\n const isPrimary = this.isPrimary();\n const colorInput = this.colorInput();\n const el = this.elementRef.nativeElement;\n if (isPrimary && colorInput === 'inverseText') {\n el.style.setProperty('--m-button-color-contrast', this.buttonColor());\n el.style.setProperty('--m-one-button-color-contrast', this.buttonColor());\n }\n });\n }\n\n protected readonly buttonIcon = computed(() => {\n const name = this.config()?.icon;\n if (!name) {\n return undefined;\n }\n return {\n name: this.config()?.icon,\n color: this.buttonColor(),\n baseUrl: this.baseUrl(),\n remote: this.remote() ?? this.config()?.remote,\n };\n });\n private overrideProperty = computed<Partial<Button>>(() => {\n const button = {} as Partial<Button>;\n // The rest of what a `buttons/<name>.yml` carries, so a one-off Button\n // needs no file (ADR 0010). An omitted attribute is skipped rather than\n // written as undefined — writing it would blank whatever the asset set.\n const put = (key: keyof Button, value: unknown): void => {\n if (value !== undefined) (button as Record<string, unknown>)[key] = value;\n };\n put('label', this.label());\n put('icon', this.icon());\n put('imgSrc', this.imgSrc());\n put('tabindex', toAttrNumber(this.tabindex()));\n put('noTranslate', toAttrBool(this.noTranslate()));\n put('params', this.params());\n put('isRightIcon', toAttrBool(this.isRightIcon()));\n put('iconOnly', toAttrBool(this.iconOnly()));\n put('stacked', toAttrBool(this.stacked()));\n put('nonClickable', toAttrBool(this.nonClickable()));\n put('inverted', toAttrBool(this.inverted()));\n put('isSubmit', toAttrBool(this.isSubmit()));\n\n if (this.color()) {\n button['color'] = this.color();\n }\n if (this.labelClass()) {\n button['labelClass'] = this.labelClass();\n }\n if (typeof this.fullWidth() !== 'undefined') {\n button['fullWidth'] = toAttrBool(this.fullWidth());\n }\n if (this.nav()) {\n button['nav'] = this.nav();\n }\n if (this.navParams()) {\n button['navParams'] = this.navParams();\n }\n if (this.href()) {\n button['href'] = this.href();\n }\n if (typeof this.disabled() !== 'undefined') {\n button['disabled'] = this.disabled();\n }\n if (this.variant()) {\n button['variant'] = this.variant();\n }\n\n // Force primary and clear ghost if the color is 'inverse' or 'inverseText', unless explicitly ghost or secondary\n const finalColor = button.color || this.config()?.color;\n const isExplicitGhost =\n button.variant === 'ghost' || this.config()?.variant === 'ghost';\n const isExplicitSecondary =\n button.variant === 'secondary' ||\n (this.config()?.variant as string) === 'secondary';\n if (\n (finalColor === 'inverse' || finalColor === 'inverseText') &&\n !isExplicitGhost &&\n !isExplicitSecondary\n ) {\n button['color'] = 'inverseText';\n button['variant'] = 'primary';\n } else if (finalColor === 'inverse') {\n button['color'] = 'inverseText';\n }\n\n if (this.config()?.nav || this.nav()) {\n button['variant'] = this.isMurlActive() ? undefined : 'ghost';\n }\n\n return button;\n });\n\n protected override resolveComponentOverrides(): Partial<Button> {\n return this.overrideProperty();\n }\n\n public onClick() {\n if (this.isFormSubmit()) {\n // Called rather than left to a native `type=\"submit\"`: the `<form>` is\n // only an ancestor while nothing re-projects this Button out of it.\n this.sectionForm?.submit();\n }\n this.clicked.emit(this.config());\n }\n\n protected readonly formatBadgeCount = (count: number, max = 99): string =>\n formatBadgeCount(count, max);\n\n}\n","@if (config(); as config) {\n <!-- One branch for every in-app target: `mRef` names a NavId and the store\n reads the NavKind off that node to decide route vs panel (ADR 0014). -->\n @if (config.nav) {\n @if (!noNative()) {\n <button\n type=\"button\"\n class=\"{{ className() }}\"\n [attr.data-testid]=\"config.name + '-btn'\"\n [attr.tabindex]=\"config.tabindex\"\n [disabled]=\"config.disabled\"\n [mRef]=\"config.nav\"\n [mRefParams]=\"config.navParams\"\n [attr.aria-label]=\"config.noTranslate ? config.label : (config.label | translate: config.params)\"\n mRefLinkActive=\"tab\"\n (keydown.enter)=\"onClick()\"\n (click)=\"onClick()\"\n #button\n >\n <ng-container *ngTemplateOutlet=\"buttonContent; context: { button: config }\"></ng-container>\n </button>\n } @else {\n <div\n role=\"button\"\n [attr.tabindex]=\"config.tabindex ?? 0\"\n class=\"non-native {{ className() }}\"\n [attr.data-testid]=\"config.name + '-btn'\"\n [attr.aria-label]=\"config.noTranslate ? config.label : (config.label | translate: config.params)\"\n [attr.aria-disabled]=\"config.disabled ? 'true' : 'false'\"\n (keydown.enter)=\"onClick()\"\n (click)=\"onClick()\"\n #button\n >\n <ng-container *ngTemplateOutlet=\"buttonContent; context: { button: config }\"></ng-container>\n </div>\n }\n } @else if (config.href) {\n <a\n class=\"{{ className() }}\"\n [attr.data-testid]=\"config.name + '-btn'\"\n [attr.tabindex]=\"config.tabindex\"\n [href]=\"config.href\"\n [attr.aria-label]=\"config.noTranslate ? config.label : (config.label | translate: config.params)\"\n (click)=\"onClick()\"\n #button\n >\n <ng-container *ngTemplateOutlet=\"buttonContent; context: { button: config }\"></ng-container>\n </a>\n } @else {\n @if (!noNative()) {\n <button\n type=\"button\"\n class=\"{{ className() }}\"\n [attr.data-testid]=\"config.name + '-btn'\"\n [attr.tabindex]=\"config.tabindex\"\n [disabled]=\"isDisabled()\"\n [attr.aria-label]=\"config.noTranslate ? config.label : (config.label | translate: config.params)\"\n (keydown.enter)=\"onClick()\"\n (click)=\"onClick()\"\n #button\n >\n <ng-container *ngTemplateOutlet=\"buttonContent; context: { button: config }\"></ng-container>\n </button>\n } @else {\n <div\n role=\"button\"\n [attr.tabindex]=\"config.tabindex ?? 0\"\n class=\"non-native {{ className() }}\"\n [attr.data-testid]=\"config.name + '-btn'\"\n [attr.aria-label]=\"config.noTranslate ? config.label : (config.label | translate: config.params)\"\n [attr.aria-disabled]=\"isDisabled() ? 'true' : 'false'\"\n (keydown.enter)=\"onClick()\"\n (click)=\"onClick()\"\n #button\n >\n <ng-container *ngTemplateOutlet=\"buttonContent; context: { button: config }\"></ng-container>\n </div>\n }\n }\n}\n\n<ng-template #buttonContent let-button=\"button\">\n @if (button.imgSrc) {\n <div class=\"button-icon button-icon--img\">\n <m-img [src]=\"button.imgSrc\" [remote]=\"button.remote\" [alt]=\"button.label || button.name || ''\" />\n @if (button.badge && button.badge.count) {\n <m-badge\n [config]=\"{ variant: button.badge.variant ?? 'danger', position: 'absolute' }\"\n >{{ formatBadgeCount(button.badge.count) }}</m-badge\n >\n }\n </div>\n } @else if (buttonIcon(); as icon) {\n <div class=\"button-icon\">\n @if (isFromOne()) {\n <m-one-icon [config]=\"icon\" />\n } @else {\n <m-icon [config]=\"icon\" />\n }\n @if (button.badge && button.badge.count) {\n <m-badge\n [config]=\"{ variant: button.badge.variant ?? 'danger', position: 'absolute' }\"\n >{{ formatBadgeCount(button.badge.count) }}</m-badge\n >\n }\n </div>\n }\n @if (button.label && !button.iconOnly) {\n <span class=\"button-label {{ button.labelClass || '' }}\">\n {{ button.noTranslate ? button.label : (button.label | translate: button.params) }}\n </span>\n }\n @if (!buttonIcon() && button.badge && button.badge.count) {\n <m-badge [config]=\"{ variant: button.badge.variant ?? 'danger', position: 'static' }\">{{\n formatBadgeCount(button.badge.count)\n }}</m-badge>\n }\n</ng-template>\n"],"mappings":";;;;;;;;;;AAEA,MAAa,mBAAmB,WAAqC;CACnE,IAAI,CAAC,QAAQ,OAAO;CAEpB,MAAM,UAAU,CAAC,OAAO;CAExB,IAAI,OAAO,SACT,QAAQ,KAAK,UAAU,OAAO,SAAS;CAGzC,IAAI,OAAO,YAAY,OAAO,aAAa,UACzC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AAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,UAAQ,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
- import { t as LabelComponent } from "./magmonium-one-label-23DjRQdd.mjs";
2
+ import { t as LabelComponent } from "./magmonium-one-label-BII6szn8.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-M8sEPhFz.mjs";
4
+ import { t as TextOutputComponent } from "./magmonium-one-text-output-E6pe3IOL.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";
@@ -363,4 +363,4 @@ i0.ɵɵngDeclareClassMetadata({
363
363
  });
364
364
  export { checkbox_exports as n, PLACED_CHECKBOX as r, CheckboxInputComponent as t };
365
365
 
366
- //# sourceMappingURL=magmonium-one-checkbox-CmPgvVHJ.mjs.map
366
+ //# sourceMappingURL=magmonium-one-checkbox-DHg1sBWl.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"magmonium-one-checkbox-CmPgvVHJ.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,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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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
+ {"version":3,"file":"magmonium-one-checkbox-DHg1sBWl.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,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,C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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"}
@@ -2,8 +2,8 @@ import { i as resolveSize, t as coerceSize } from "./magmonium-one-size-converte
2
2
  import { r as deriveContrastColor } from "./magmonium-one-color-utl-BA51l-Rw.mjs";
3
3
  import { o as injectParentSize, s as provideSizeContext } from "./magmonium-one-icon-CH-g8CUR.mjs";
4
4
  import { r as ConfigComponent } from "./magmonium-one-attribute-value-CPh-lJPV.mjs";
5
- import { i as deriveGroupClass, t as ButtonComponent } from "./magmonium-one-button-CKHBcCoO.mjs";
6
- import { t as ContextMenuComponent } from "./magmonium-one-menu-Nj_Aj1fs.mjs";
5
+ import { i as deriveGroupClass, t as ButtonComponent } from "./magmonium-one-button-DO7FTwuF.mjs";
6
+ import { t as ContextMenuComponent } from "./magmonium-one-menu-CsoiLhVg.mjs";
7
7
  import * as i0 from "@angular/core";
8
8
  import { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, effect, forwardRef, input, output } from "@angular/core";
9
9
  import { forkJoin, map, of } from "rxjs";
@@ -425,4 +425,4 @@ i0.ɵɵngDeclareClassMetadata({
425
425
  });
426
426
  export { mergeUniqueWith as i, mergeUnique as n, mergeUniqueBy as r, ButtonGroupComponent as t };
427
427
 
428
- //# sourceMappingURL=magmonium-one-group-sz1ufuBT.mjs.map
428
+ //# sourceMappingURL=magmonium-one-group-BsqCB8D2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"magmonium-one-group-sz1ufuBT.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/lib/utils/array.ts","../../../../libs/one/src/lib/shared/ui/button/ui/group/group.ts"],"sourcesContent":["/**\n * Merges multiple arrays and removes duplicates\n * @param arrays - Arrays to merge\n * @returns Merged array with unique values\n */\nexport function mergeUnique<T>(...arrays: T[][]): T[] {\n return [...new Set(arrays.flat())];\n}\n\n/**\n * Merges arrays of objects and removes duplicates by key\n * @param arrays - Arrays to merge\n * @param key - Property to use for uniqueness check\n * @returns Merged array with unique objects\n */\nexport function mergeUniqueBy<T, K extends keyof T>(\n arrays: T[][],\n key: K\n): T[] {\n const map = new Map<T[K], T>();\n\n arrays.flat().forEach((item) => {\n if (!map.has(item[key])) {\n map.set(item[key], item);\n }\n });\n\n return Array.from(map.values());\n}\n\n/**\n * Merges arrays with custom comparator\n */\nexport function mergeUniqueWith<T>(\n arrays: T[][],\n compareFn: (item: T) => unknown\n): T[] {\n const map = new Map<unknown, T>();\n\n arrays.flat().forEach((item) => {\n const key = compareFn(item);\n if (!map.has(key)) {\n map.set(key, item);\n }\n });\n\n return Array.from(map.values());\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n forwardRef,\n input,\n output,\n ViewEncapsulation,\n} from '@angular/core';\nimport { Button, ButtonGroup } from '../../type/button';\nimport { ButtonComponent } from '../button';\nimport { ConfigComponent } from '../../../../lib/components/config-component';\nimport { mergeUnique } from '../../../../lib/utils/array';\nimport { ContextMenuComponent, MenuItem } from '../../../menu';\nimport { rxResource } from '@angular/core/rxjs-interop';\nimport { forkJoin, map, of } from 'rxjs';\nimport { deriveContrastColor } from '../../../../functions/color/operations';\n\nimport { deriveGroupClass } from '../../lib';\nimport {\n injectParentSize,\n provideSizeContext,\n} from '../../../../config/size-context.token';\nimport { Size } from '../../../../enum/scaling/size';\nimport {\n coerceSize,\n resolveSize,\n} from '../../../../functions/size/size-converter';\n\n@Component({\n selector: 'm-button-group, m-one-button-group',\n template: `\n @if (config(); as group) {\n <div\n class=\"button-group {{ classList() }}\"\n [class.is-context]=\"group.isContext\"\n >\n @if (group.isContext) {\n @if (primaryButton(); as primary) {\n <m-button\n [variant]=\"isPrimaryVisible() ? 'primary' : undefined\"\n [disabled]=\"isDisabled(primary.name)\"\n [color]=\"group.color\"\n [config]=\"primary\"\n [name]=\"primary.name\"\n [one]=\"isFromOne()\"\n [remote]=\"remote() ?? group.remote\"\n (clicked)=\"clicked.emit($event)\"\n />\n }\n @if (secondaryActions(); as actions) {\n <m-context-menu\n [config]=\"{\n icon: {\n name: config()?.contextMenuIcon ?? 'ellipsis-vertical',\n color: contextMenuIconColor(),\n },\n options: actions,\n }\"\n [inverted]=\"group.inverted\"\n [remote]=\"remote() ?? group.remote\"\n (action)=\"handleMenuAction($event)\"\n />\n }\n } @else {\n @for (button of mergedButtons(); track $index) {\n <m-button\n [variant]=\"isPrimary(button.name) ? 'primary' : undefined\"\n [disabled]=\"isDisabled(button.name)\"\n [color]=\"group.color\"\n [config]=\"button\"\n [name]=\"button.name\"\n [one]=\"isFromOne()\"\n [remote]=\"remote() ?? group.remote\"\n (clicked)=\"clicked.emit($event)\"\n />\n }\n }\n </div>\n }\n `,\n imports: [forwardRef(() => ButtonComponent), ContextMenuComponent],\n styleUrls: ['./group.sass'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n // The one non-Section that may declare a Size, because a cluster of\n // actions routinely needs to differ from the region holding it (ADR 0008).\n '[style.font-size]': 'sizeLength()',\n },\n providers: [\n provideSizeContext(ButtonGroupComponent),\n ],\n})\nexport class ButtonGroupComponent extends ConfigComponent<ButtonGroup> {\n // to overwrite specific button config\n buttons = input<Record<string, Partial<Button>>>();\n\n // to add names\n names = input<string[]>();\n exclude = input<string[]>();\n vertical = input<boolean | undefined>();\n\n size = input<Size | undefined>();\n\n private readonly parentSize = injectParentSize();\n\n readonly resolvedSize = computed<Size>(() =>\n coerceSize(this.size(), this.config()?.size, this.parentSize?.size())\n );\n protected readonly sizeLength = computed(() =>\n resolveSize(this.resolvedSize())\n );\n\n override subFolder = 'button_groups';\n readonly clicked = output<Button | undefined>();\n\n protected readonly classList = computed(() => {\n const base = deriveGroupClass(this.config());\n if (this.isPrimaryVisible()) {\n return base.includes('is-primary') ? base : `${base} is-primary`.trim();\n }\n return base.replace('is-primary', '').trim();\n });\n\n protected readonly isPrimaryVisible = computed(() => {\n const primary = this.primaryButton();\n if (!primary) return false;\n return !!(this.isPrimary(primary.name) || primary.variant === 'primary');\n });\n\n protected readonly contextMenuIconColor = computed(() => {\n if (!this.isPrimaryVisible()) {\n return undefined;\n }\n const oppColor = this.pallet()?.oppositeColor;\n if (oppColor) {\n return deriveContrastColor(oppColor);\n }\n return 'white';\n });\n\n protected readonly mergedNames = computed(() => {\n const exclude = this.exclude() ?? [];\n const names = mergeUnique<string>(\n this.names() ?? [],\n this.config()?.names ?? []\n ).filter((name) => !exclude.includes(name));\n const buttonNames = new Set(this.mergedButtons().map((b) => b.name));\n return names.filter((name) => !buttonNames.has(name));\n });\n\n protected readonly buttonsResource = rxResource({\n params: () => {\n const config = this.config();\n if (!config?.isContext) return undefined;\n\n const namesFromAsset = config.names ?? [];\n const buttonNamesFromAsset = config.buttons?.map((b) => b.name) ?? [];\n const manualNames = this.names() ?? [];\n\n const allNames = mergeUnique<string>(\n manualNames,\n mergeUnique<string>(namesFromAsset, buttonNamesFromAsset as string[])\n );\n\n if (allNames.length === 0) return undefined;\n\n return { names: allNames, isOne: this.isFromOne() };\n },\n stream: ({ params }) => {\n if (!params) return of([]);\n return forkJoin(\n params.names.map((name) =>\n this.assetStore\n .resolve<Button>('buttons', name, params.isOne)\n .pipe(map((button) => ({ ...button, name })))\n )\n );\n },\n });\n\n protected readonly mergedButtons = computed(() => {\n const config = this.config();\n const buttonOverrides = this.buttons();\n const exclude = this.exclude() ?? [];\n\n // If isContext is true, we use the resolved buttons from the resource\n // Otherwise we use buttons from config, and also include names as partial buttons\n const yamlButtons = (\n config?.isContext\n ? (this.buttonsResource.value() ?? [])\n : [\n ...(config?.buttons ?? []),\n ...(config?.names?.map((name) => ({ name }) as Button) ?? []),\n ]\n ).map((b) => (typeof b === 'string' ? ({ name: b } as Button) : b));\n\n const merged = yamlButtons\n .filter((b) => !b.name || !exclude.includes(b.name))\n .map((button) => ({\n ...button,\n ...(button.name && buttonOverrides?.[button.name]\n ? buttonOverrides[button.name]\n : {}),\n }));\n\n if (!buttonOverrides) {\n return merged;\n }\n\n const yamlNames = new Set(yamlButtons.map((b) => b.name));\n const configNames = new Set(config?.names ?? []);\n const extra = Object.entries(buttonOverrides)\n .filter(\n ([name]) =>\n !yamlNames.has(name) &&\n !configNames.has(name) &&\n !exclude.includes(name)\n )\n .map(([name, override]) => ({ name, ...override }) as Button);\n\n return [...merged, ...extra];\n });\n\n protected readonly primaryButton = computed(() => {\n const buttons = this.mergedButtons();\n const primaryName = this.config()?.primary;\n if (!primaryName) return buttons[0];\n return buttons.find((b) => b.name === primaryName) ?? buttons[0];\n });\n\n protected readonly secondaryActions = computed<MenuItem[][] | undefined>(\n () => {\n const primary = this.primaryButton();\n const secondary = this.mergedButtons().filter((b) => b !== primary);\n\n if (secondary.length === 0) return undefined;\n\n const items: MenuItem[] = secondary.map((b) => ({\n id: b.name ?? '',\n label: b.label ?? b.name ?? '',\n icon: b.icon,\n nav: b.nav,\n link: b.href,\n disabled: b.disabled ? true : undefined,\n }));\n\n return [items];\n }\n );\n\n constructor() {\n super();\n effect(this.updateProperty);\n }\n\n isPrimary(name?: string): true | undefined {\n const config = this.config();\n if (!config?.primary || !name) {\n return undefined;\n }\n return name === config.primary ? true : undefined;\n }\n\n isDisabled(name?: string): boolean | undefined {\n if (!name) return undefined;\n const buttonOverride = this.buttons()?.[name];\n if (typeof buttonOverride?.disabled !== 'undefined') {\n return buttonOverride.disabled;\n }\n const config = this.config();\n if (!config?.disabled) return undefined;\n return config.disabled[name];\n }\n\n protected handleMenuAction(item: MenuItem) {\n const button = this.mergedButtons().find((b) => b.name === item.id);\n this.clicked.emit(button);\n }\n\n private readonly updateProperty = (): void => {\n const updatedConfig = <ButtonGroup>{};\n const vertical = this.vertical();\n if (typeof vertical !== 'undefined') {\n updatedConfig.vertical = vertical;\n }\n this.config.update((prev) => ({\n ...(prev ?? {}),\n ...updatedConfig,\n }));\n };\n\n}\n"],"mappings":";;;;;;;;;;AAKA,SAAgB,YAAe,GAAG,QAAa;CAC7C,OAAO,CAAC,GAAG,IAAI,IAAI,OAAO,KAAI,CAAE,CAAC;AACnC;AAQA,SAAgB,cACd,QACA,KAAM;CAEN,MAAM,sBAAM,IAAI,IAAG;CAEnB,OAAO,KAAI,CAAE,CAAC,SAAS,SAAQ;EAC7B,IAAI,CAAC,IAAI,IAAI,KAAK,IAAI,GACpB,IAAI,IAAI,KAAK,MAAM,IAAI;CAE3B,CAAC;CAED,OAAO,MAAM,KAAK,IAAI,OAAM,CAAE;AAChC;AAKA,SAAgB,gBACd,QACA,WAA+B;CAE/B,MAAM,sBAAM,IAAI,IAAG;CAEnB,OAAO,KAAI,CAAE,CAAC,SAAS,SAAQ;EAC7B,MAAM,MAAM,UAAU,IAAI;EAC1B,IAAI,CAAC,IAAI,IAAI,GAAG,GACd,IAAI,IAAI,KAAK,IAAI;CAErB,CAAC;CAED,OAAO,MAAM,KAAK,IAAI,OAAM,CAAE;AAChC;ACgDA,IAAa,uBAAb,MAAa,6BAA6B,gBAA4B;CAEpE,UAAU,MAAwC,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAGlD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AAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;GAAA;GAAA,SAAA,CAAA,gBAAA,SAAA;EAAA,GAAA;GAAA,MAAA;GAAA,MAAA,GAAA,iBAAG,oBAAoB;GAAA,UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;GAAA;GAAA,SAAA,CAAA,gBAAA,QAAA;EAAA,CAAA;EAAA,iBAAA,GAAA,wBAAA;EAAA,eAAA,GAAA,kBAAA;CAAA,CAAA;;AAatD,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAoB,YAAA,CAAA;EAjEhC,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAoC,UACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDT,SACQ,CAAC,iBAAiB,eAAe,GAAG,oBAAoB;GAAC,eAEnD,kBAAkB;GAAI,iBACpB,wBAAwB;GAAM,MACzC,EAGJ,qBAAqB,eACtB;GAAA,WACU,CACT,mBAAkB,oBAAA,CACnB;GAAA,QAAA,CAAA,8hSAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"magmonium-one-group-BsqCB8D2.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/lib/utils/array.ts","../../../../libs/one/src/lib/shared/ui/button/ui/group/group.ts"],"sourcesContent":["/**\n * Merges multiple arrays and removes duplicates\n * @param arrays - Arrays to merge\n * @returns Merged array with unique values\n */\nexport function mergeUnique<T>(...arrays: T[][]): T[] {\n return [...new Set(arrays.flat())];\n}\n\n/**\n * Merges arrays of objects and removes duplicates by key\n * @param arrays - Arrays to merge\n * @param key - Property to use for uniqueness check\n * @returns Merged array with unique objects\n */\nexport function mergeUniqueBy<T, K extends keyof T>(\n arrays: T[][],\n key: K\n): T[] {\n const map = new Map<T[K], T>();\n\n arrays.flat().forEach((item) => {\n if (!map.has(item[key])) {\n map.set(item[key], item);\n }\n });\n\n return Array.from(map.values());\n}\n\n/**\n * Merges arrays with custom comparator\n */\nexport function mergeUniqueWith<T>(\n arrays: T[][],\n compareFn: (item: T) => unknown\n): T[] {\n const map = new Map<unknown, T>();\n\n arrays.flat().forEach((item) => {\n const key = compareFn(item);\n if (!map.has(key)) {\n map.set(key, item);\n }\n });\n\n return Array.from(map.values());\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n forwardRef,\n input,\n output,\n ViewEncapsulation,\n} from '@angular/core';\nimport { Button, ButtonGroup } from '../../type/button';\nimport { ButtonComponent } from '../button';\nimport { ConfigComponent } from '../../../../lib/components/config-component';\nimport { mergeUnique } from '../../../../lib/utils/array';\nimport { ContextMenuComponent, MenuItem } from '../../../menu';\nimport { rxResource } from '@angular/core/rxjs-interop';\nimport { forkJoin, map, of } from 'rxjs';\nimport { deriveContrastColor } from '../../../../functions/color/operations';\n\nimport { deriveGroupClass } from '../../lib';\nimport {\n injectParentSize,\n provideSizeContext,\n} from '../../../../config/size-context.token';\nimport { Size } from '../../../../enum/scaling/size';\nimport {\n coerceSize,\n resolveSize,\n} from '../../../../functions/size/size-converter';\n\n@Component({\n selector: 'm-button-group, m-one-button-group',\n template: `\n @if (config(); as group) {\n <div\n class=\"button-group {{ classList() }}\"\n [class.is-context]=\"group.isContext\"\n >\n @if (group.isContext) {\n @if (primaryButton(); as primary) {\n <m-button\n [variant]=\"isPrimaryVisible() ? 'primary' : undefined\"\n [disabled]=\"isDisabled(primary.name)\"\n [color]=\"group.color\"\n [config]=\"primary\"\n [name]=\"primary.name\"\n [one]=\"isFromOne()\"\n [remote]=\"remote() ?? group.remote\"\n (clicked)=\"clicked.emit($event)\"\n />\n }\n @if (secondaryActions(); as actions) {\n <m-context-menu\n [config]=\"{\n icon: {\n name: config()?.contextMenuIcon ?? 'ellipsis-vertical',\n color: contextMenuIconColor(),\n },\n options: actions,\n }\"\n [inverted]=\"group.inverted\"\n [remote]=\"remote() ?? group.remote\"\n (action)=\"handleMenuAction($event)\"\n />\n }\n } @else {\n @for (button of mergedButtons(); track $index) {\n <m-button\n [variant]=\"isPrimary(button.name) ? 'primary' : undefined\"\n [disabled]=\"isDisabled(button.name)\"\n [color]=\"group.color\"\n [config]=\"button\"\n [name]=\"button.name\"\n [one]=\"isFromOne()\"\n [remote]=\"remote() ?? group.remote\"\n (clicked)=\"clicked.emit($event)\"\n />\n }\n }\n </div>\n }\n `,\n imports: [forwardRef(() => ButtonComponent), ContextMenuComponent],\n styleUrls: ['./group.sass'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n // The one non-Section that may declare a Size, because a cluster of\n // actions routinely needs to differ from the region holding it (ADR 0008).\n '[style.font-size]': 'sizeLength()',\n },\n providers: [\n provideSizeContext(ButtonGroupComponent),\n ],\n})\nexport class ButtonGroupComponent extends ConfigComponent<ButtonGroup> {\n // to overwrite specific button config\n buttons = input<Record<string, Partial<Button>>>();\n\n // to add names\n names = input<string[]>();\n exclude = input<string[]>();\n vertical = input<boolean | undefined>();\n\n size = input<Size | undefined>();\n\n private readonly parentSize = injectParentSize();\n\n readonly resolvedSize = computed<Size>(() =>\n coerceSize(this.size(), this.config()?.size, this.parentSize?.size())\n );\n protected readonly sizeLength = computed(() =>\n resolveSize(this.resolvedSize())\n );\n\n override subFolder = 'button_groups';\n readonly clicked = output<Button | undefined>();\n\n protected readonly classList = computed(() => {\n const base = deriveGroupClass(this.config());\n if (this.isPrimaryVisible()) {\n return base.includes('is-primary') ? base : `${base} is-primary`.trim();\n }\n return base.replace('is-primary', '').trim();\n });\n\n protected readonly isPrimaryVisible = computed(() => {\n const primary = this.primaryButton();\n if (!primary) return false;\n return !!(this.isPrimary(primary.name) || primary.variant === 'primary');\n });\n\n protected readonly contextMenuIconColor = computed(() => {\n if (!this.isPrimaryVisible()) {\n return undefined;\n }\n const oppColor = this.pallet()?.oppositeColor;\n if (oppColor) {\n return deriveContrastColor(oppColor);\n }\n return 'white';\n });\n\n protected readonly mergedNames = computed(() => {\n const exclude = this.exclude() ?? [];\n const names = mergeUnique<string>(\n this.names() ?? [],\n this.config()?.names ?? []\n ).filter((name) => !exclude.includes(name));\n const buttonNames = new Set(this.mergedButtons().map((b) => b.name));\n return names.filter((name) => !buttonNames.has(name));\n });\n\n protected readonly buttonsResource = rxResource({\n params: () => {\n const config = this.config();\n if (!config?.isContext) return undefined;\n\n const namesFromAsset = config.names ?? [];\n const buttonNamesFromAsset = config.buttons?.map((b) => b.name) ?? [];\n const manualNames = this.names() ?? [];\n\n const allNames = mergeUnique<string>(\n manualNames,\n mergeUnique<string>(namesFromAsset, buttonNamesFromAsset as string[])\n );\n\n if (allNames.length === 0) return undefined;\n\n return { names: allNames, isOne: this.isFromOne() };\n },\n stream: ({ params }) => {\n if (!params) return of([]);\n return forkJoin(\n params.names.map((name) =>\n this.assetStore\n .resolve<Button>('buttons', name, params.isOne)\n .pipe(map((button) => ({ ...button, name })))\n )\n );\n },\n });\n\n protected readonly mergedButtons = computed(() => {\n const config = this.config();\n const buttonOverrides = this.buttons();\n const exclude = this.exclude() ?? [];\n\n // If isContext is true, we use the resolved buttons from the resource\n // Otherwise we use buttons from config, and also include names as partial buttons\n const yamlButtons = (\n config?.isContext\n ? (this.buttonsResource.value() ?? [])\n : [\n ...(config?.buttons ?? []),\n ...(config?.names?.map((name) => ({ name }) as Button) ?? []),\n ]\n ).map((b) => (typeof b === 'string' ? ({ name: b } as Button) : b));\n\n const merged = yamlButtons\n .filter((b) => !b.name || !exclude.includes(b.name))\n .map((button) => ({\n ...button,\n ...(button.name && buttonOverrides?.[button.name]\n ? buttonOverrides[button.name]\n : {}),\n }));\n\n if (!buttonOverrides) {\n return merged;\n }\n\n const yamlNames = new Set(yamlButtons.map((b) => b.name));\n const configNames = new Set(config?.names ?? []);\n const extra = Object.entries(buttonOverrides)\n .filter(\n ([name]) =>\n !yamlNames.has(name) &&\n !configNames.has(name) &&\n !exclude.includes(name)\n )\n .map(([name, override]) => ({ name, ...override }) as Button);\n\n return [...merged, ...extra];\n });\n\n protected readonly primaryButton = computed(() => {\n const buttons = this.mergedButtons();\n const primaryName = this.config()?.primary;\n if (!primaryName) return buttons[0];\n return buttons.find((b) => b.name === primaryName) ?? buttons[0];\n });\n\n protected readonly secondaryActions = computed<MenuItem[][] | undefined>(\n () => {\n const primary = this.primaryButton();\n const secondary = this.mergedButtons().filter((b) => b !== primary);\n\n if (secondary.length === 0) return undefined;\n\n const items: MenuItem[] = secondary.map((b) => ({\n id: b.name ?? '',\n label: b.label ?? b.name ?? '',\n icon: b.icon,\n nav: b.nav,\n link: b.href,\n disabled: b.disabled ? true : undefined,\n }));\n\n return [items];\n }\n );\n\n constructor() {\n super();\n effect(this.updateProperty);\n }\n\n isPrimary(name?: string): true | undefined {\n const config = this.config();\n if (!config?.primary || !name) {\n return undefined;\n }\n return name === config.primary ? true : undefined;\n }\n\n isDisabled(name?: string): boolean | undefined {\n if (!name) return undefined;\n const buttonOverride = this.buttons()?.[name];\n if (typeof buttonOverride?.disabled !== 'undefined') {\n return buttonOverride.disabled;\n }\n const config = this.config();\n if (!config?.disabled) return undefined;\n return config.disabled[name];\n }\n\n protected handleMenuAction(item: MenuItem) {\n const button = this.mergedButtons().find((b) => b.name === item.id);\n this.clicked.emit(button);\n }\n\n private readonly updateProperty = (): void => {\n const updatedConfig = <ButtonGroup>{};\n const vertical = this.vertical();\n if (typeof vertical !== 'undefined') {\n updatedConfig.vertical = vertical;\n }\n this.config.update((prev) => ({\n ...(prev ?? {}),\n ...updatedConfig,\n }));\n };\n\n}\n"],"mappings":";;;;;;;;;;AAKA,SAAgB,YAAe,GAAG,QAAa;CAC7C,OAAO,CAAC,GAAG,IAAI,IAAI,OAAO,KAAI,CAAE,CAAC;AACnC;AAQA,SAAgB,cACd,QACA,KAAM;CAEN,MAAM,sBAAM,IAAI,IAAG;CAEnB,OAAO,KAAI,CAAE,CAAC,SAAS,SAAQ;EAC7B,IAAI,CAAC,IAAI,IAAI,KAAK,IA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"}
@@ -1,6 +1,6 @@
1
1
  import { f as escapeHtml, i as resolveSize, l as TranslateService, p as miniMarkInlineToHtml } from "./magmonium-one-size-converter-BqkALIWA.mjs";
2
2
  import { a as SIZE_CONTEXT, r as IconComponent } from "./magmonium-one-icon-CH-g8CUR.mjs";
3
- import { t as ButtonComponent } from "./magmonium-one-button-CKHBcCoO.mjs";
3
+ import { t as ButtonComponent } from "./magmonium-one-button-DO7FTwuF.mjs";
4
4
  import * as i0 from "@angular/core";
5
5
  import { ChangeDetectionStrategy, Component, computed, inject, input, output } from "@angular/core";
6
6
  var HeaderComponent = class HeaderComponent {
@@ -378,4 +378,4 @@ i0.ɵɵngDeclareClassMetadata({
378
378
  });
379
379
  export { HeaderComponent as t };
380
380
 
381
- //# sourceMappingURL=magmonium-one-header-CkW_6y7m.mjs.map
381
+ //# sourceMappingURL=magmonium-one-header-CgOV_m7w.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"magmonium-one-header-CkW_6y7m.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/header/ui/header.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n output,\n} from '@angular/core';\nimport { TranslateService } from '../../../services/translate';\nimport { HeaderLevel } from '../type/header';\nimport { ButtonComponent } from '../../button/ui/button';\nimport { IconComponent } from '../../icon';\nimport { Button } from '../../button/type/button';\nimport { SIZE_CONTEXT } from '../../../config/size-context.token';\nimport { resolveSize } from '../../../functions/size/size-converter';\nimport { escapeHtml, miniMarkInlineToHtml } from '../../../functions/text';\n\n@Component({\n selector: 'm-header',\n imports: [ButtonComponent, IconComponent],\n template: `\n @switch (level()) {\n @case (1) {\n <h1 class=\"header__heading\">\n @if (icon(); as iconName) {\n <m-icon class=\"header__icon\" [name]=\"iconName\" />\n }\n <span [innerHTML]=\"html()\"></span>\n <ng-content />\n @if (actionConfig(); as action) {\n <m-button class=\"header__action\" [config]=\"action\" [style.--m-button-size]=\"actionSize()\" (clicked)=\"actionClick.emit()\" />\n }\n </h1>\n }\n @case (2) {\n <h2 class=\"header__heading\">\n @if (icon(); as iconName) {\n <m-icon class=\"header__icon\" [name]=\"iconName\" />\n }\n <span [innerHTML]=\"html()\"></span>\n <ng-content />\n @if (actionConfig(); as action) {\n <m-button class=\"header__action\" [config]=\"action\" [style.--m-button-size]=\"actionSize()\" (clicked)=\"actionClick.emit()\" />\n }\n </h2>\n }\n @case (3) {\n <h3 class=\"header__heading\">\n @if (icon(); as iconName) {\n <m-icon class=\"header__icon\" [name]=\"iconName\" />\n }\n <span [innerHTML]=\"html()\"></span>\n <ng-content />\n @if (actionConfig(); as action) {\n <m-button class=\"header__action\" [config]=\"action\" [style.--m-button-size]=\"actionSize()\" (clicked)=\"actionClick.emit()\" />\n }\n </h3>\n }\n @case (4) {\n <h4 class=\"header__heading\">\n @if (icon(); as iconName) {\n <m-icon class=\"header__icon\" [name]=\"iconName\" />\n }\n <span [innerHTML]=\"html()\"></span>\n <ng-content />\n @if (actionConfig(); as action) {\n <m-button class=\"header__action\" [config]=\"action\" [style.--m-button-size]=\"actionSize()\" (clicked)=\"actionClick.emit()\" />\n }\n </h4>\n }\n @case (5) {\n <h5 class=\"header__heading\">\n @if (icon(); as iconName) {\n <m-icon class=\"header__icon\" [name]=\"iconName\" />\n }\n <span [innerHTML]=\"html()\"></span>\n <ng-content />\n @if (actionConfig(); as action) {\n <m-button class=\"header__action\" [config]=\"action\" [style.--m-button-size]=\"actionSize()\" (clicked)=\"actionClick.emit()\" />\n }\n </h5>\n }\n @case (6) {\n <h6 class=\"header__heading\">\n @if (icon(); as iconName) {\n <m-icon class=\"header__icon\" [name]=\"iconName\" />\n }\n <span [innerHTML]=\"html()\"></span>\n <ng-content />\n @if (actionConfig(); as action) {\n <m-button class=\"header__action\" [config]=\"action\" [style.--m-button-size]=\"actionSize()\" (clicked)=\"actionClick.emit()\" />\n }\n </h6>\n }\n }\n `,\n styleUrl: './header.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class HeaderComponent {\n readonly level = input<HeaderLevel>(3);\n readonly label = input<string | undefined>();\n // Drawn inside the heading rather than beside it. A glyph placed as the\n // heading's sibling has no line box of its own to centre against — it ends\n // up centred on whatever column it sits next to, which is how a Canvas\n // header's icon came to line up with the label slot's drop rect instead of\n // with the label. Inside, the two share one line box at every level.\n readonly icon = input<string | undefined>();\n readonly actionButton = input<string | undefined>();\n // The action Button's accessible name. It renders icon-only, so the label is\n // the only thing a screen reader has to go on — without it the button reads\n // as nothing at all.\n readonly actionLabel = input<string | undefined>();\n // The label is authored text rather than a translation key. Needed for text\n // carrying angle brackets above all: `translate` reads `<...>` as link\n // markup, so a heading naming a MessageVariable — `<$app>` — resolves to\n // nothing at all rather than to itself.\n readonly noTranslate = input<boolean>(false);\n // A message's [MessageVariable] values, the same record `m-text-output`\n // takes: a heading naming `<$count>` is a sentence with a datum in it, and\n // splicing that datum into the key instead would be parsed as a query\n // string (m-one-ui ADR 0066).\n readonly params = input<Record<string, string> | undefined>(undefined);\n readonly actionClick = output<void>();\n\n private readonly translateService = inject(TranslateService);\n private readonly sizeContext = inject(SIZE_CONTEXT, { optional: true });\n\n // The action Button sits inside the heading, whose font-size is the level's\n // own — 2.25rem at h1 — so `em` inheritance would scale the Button to the\n // heading rather than to the Section it belongs to. It reads the Size in\n // force instead, the way Icon does, and lands at the same size as every\n // other Button on that Section (ADR 0008).\n protected readonly actionSize = computed(() =>\n resolveSize(this.sizeContext?.size())\n );\n\n protected readonly actionConfig = computed<Button | undefined>(() => {\n const icon = this.actionButton();\n if (!icon) return undefined;\n return {\n icon,\n label: this.actionLabel(),\n iconOnly: true,\n variant: 'ghost',\n };\n });\n\n // A computed rather than the impure TranslatePipe repeated six times: one\n // lookup per label change instead of one per change-detection tick, and it\n // still repaints when the language or an in-memory translation moves.\n // A translation renders MiniMark's inline rules, so `Uninstall **<$app>**`\n // bolds the App's name the way `m-text-output` would. Authored text stays\n // literal: it names identifiers, and `__init__` must not turn bold.\n protected readonly html = computed(() =>\n this.noTranslate()\n ? escapeHtml(this.label() ?? '')\n : miniMarkInlineToHtml(\n this.translateService.translate(this.label(), this.params())\n )\n );\n}\n"],"mappings":";;;;;AAmGA,IAAa,kBAAb,MAAa,gBAAe;CACjB,QAAQ,MAAmB,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC7B,QAAQ,MAA2B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAMnC,OAAO,MAA2B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAClC,eAAe,MAA2B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CAI1C,cAAc,MAA2B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAKzC,cAAc,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAKnC,SAAS,MAA0C,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAC7D,cAAc,OAAM;CAEZ,mBAAmB,OAAO,gBAAgB;CAC1C,cAAc,OAAO,cAAc,EAAE,UAAU,KAAI,CAAE;CAOnD,aAAa,eAC9B,YAAY,KAAK,aAAa,KAAI,CAAE,GACrC,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAEkB,eAAe,eAAkC;EAClE,MAAM,OAAO,KAAK,aAAY;EAC9B,IAAI,CAAC,MAAM,OAAO;EAClB,OAAO;GACL;GACA,OAAO,KAAK,YAAW;GACvB,UAAU;GACV,SAAS;EACV;CACH,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CAQiB,OAAO,eACxB,KAAK,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UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;GAAA;GAAA,SAAA,CAAA,gBAAA,SAAA;EAAA,GAAA;GAAA,MAAA;GAAA,MAAE;GAAa,UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;GAAA;GAAA,SAAA,CAAA,cAAA;EAAA,CAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAgF7B,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAe,YAAA,CAAA;EAlF3B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAU,SACX,CAAC,iBAAiB,aAAa;GAAC,UAC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2ET,iBAEgB,wBAAwB;GAAM,QAAA,CAAA,m+CAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"magmonium-one-header-CgOV_m7w.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/header/ui/header.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n output,\n} from '@angular/core';\nimport { TranslateService } from '../../../services/translate';\nimport { HeaderLevel } from '../type/header';\nimport { ButtonComponent } from '../../button/ui/button';\nimport { IconComponent } from '../../icon';\nimport { Button } from '../../button/type/button';\nimport { SIZE_CONTEXT } from '../../../config/size-context.token';\nimport { resolveSize } from '../../../functions/size/size-converter';\nimport { escapeHtml, miniMarkInlineToHtml } from '../../../functions/text';\n\n@Component({\n selector: 'm-header',\n imports: [ButtonComponent, IconComponent],\n template: `\n @switch (level()) {\n @case (1) {\n <h1 class=\"header__heading\">\n @if (icon(); as iconName) {\n <m-icon class=\"header__icon\" [name]=\"iconName\" />\n }\n <span [innerHTML]=\"html()\"></span>\n <ng-content />\n @if (actionConfig(); as action) {\n <m-button class=\"header__action\" [config]=\"action\" [style.--m-button-size]=\"actionSize()\" (clicked)=\"actionClick.emit()\" />\n }\n </h1>\n }\n @case (2) {\n <h2 class=\"header__heading\">\n @if (icon(); as iconName) {\n <m-icon class=\"header__icon\" [name]=\"iconName\" />\n }\n <span [innerHTML]=\"html()\"></span>\n <ng-content />\n @if (actionConfig(); as action) {\n <m-button class=\"header__action\" [config]=\"action\" [style.--m-button-size]=\"actionSize()\" (clicked)=\"actionClick.emit()\" />\n }\n </h2>\n }\n @case (3) {\n <h3 class=\"header__heading\">\n @if (icon(); as iconName) {\n <m-icon class=\"header__icon\" [name]=\"iconName\" />\n }\n <span [innerHTML]=\"html()\"></span>\n <ng-content />\n @if (actionConfig(); as action) {\n <m-button class=\"header__action\" [config]=\"action\" [style.--m-button-size]=\"actionSize()\" (clicked)=\"actionClick.emit()\" />\n }\n </h3>\n }\n @case (4) {\n <h4 class=\"header__heading\">\n @if (icon(); as iconName) {\n <m-icon class=\"header__icon\" [name]=\"iconName\" />\n }\n <span [innerHTML]=\"html()\"></span>\n <ng-content />\n @if (actionConfig(); as action) {\n <m-button class=\"header__action\" [config]=\"action\" [style.--m-button-size]=\"actionSize()\" (clicked)=\"actionClick.emit()\" />\n }\n </h4>\n }\n @case (5) {\n <h5 class=\"header__heading\">\n @if (icon(); as iconName) {\n <m-icon class=\"header__icon\" [name]=\"iconName\" />\n }\n <span [innerHTML]=\"html()\"></span>\n <ng-content />\n @if (actionConfig(); as action) {\n <m-button class=\"header__action\" [config]=\"action\" [style.--m-button-size]=\"actionSize()\" (clicked)=\"actionClick.emit()\" />\n }\n </h5>\n }\n @case (6) {\n <h6 class=\"header__heading\">\n @if (icon(); as iconName) {\n <m-icon class=\"header__icon\" [name]=\"iconName\" />\n }\n <span [innerHTML]=\"html()\"></span>\n <ng-content />\n @if (actionConfig(); as action) {\n <m-button class=\"header__action\" [config]=\"action\" [style.--m-button-size]=\"actionSize()\" (clicked)=\"actionClick.emit()\" />\n }\n </h6>\n }\n }\n `,\n styleUrl: './header.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class HeaderComponent {\n readonly level = input<HeaderLevel>(3);\n readonly label = input<string | undefined>();\n // Drawn inside the heading rather than beside it. A glyph placed as the\n // heading's sibling has no line box of its own to centre against — it ends\n // up centred on whatever column it sits next to, which is how a Canvas\n // header's icon came to line up with the label slot's drop rect instead of\n // with the label. Inside, the two share one line box at every level.\n readonly icon = input<string | undefined>();\n readonly actionButton = input<string | undefined>();\n // The action Button's accessible name. It renders icon-only, so the label is\n // the only thing a screen reader has to go on — without it the button reads\n // as nothing at all.\n readonly actionLabel = input<string | undefined>();\n // The label is authored text rather than a translation key. Needed for text\n // carrying angle brackets above all: `translate` reads `<...>` as link\n // markup, so a heading naming a MessageVariable — `<$app>` — resolves to\n // nothing at all rather than to itself.\n readonly noTranslate = input<boolean>(false);\n // A message's [MessageVariable] values, the same record `m-text-output`\n // takes: a heading naming `<$count>` is a sentence with a datum in it, and\n // splicing that datum into the key instead would be parsed as a query\n // string (m-one-ui ADR 0066).\n readonly params = input<Record<string, string> | undefined>(undefined);\n readonly actionClick = output<void>();\n\n private readonly translateService = inject(TranslateService);\n private readonly sizeContext = inject(SIZE_CONTEXT, { optional: true });\n\n // The action Button sits inside the heading, whose font-size is the level's\n // own — 2.25rem at h1 — so `em` inheritance would scale the Button to the\n // heading rather than to the Section it belongs to. It reads the Size in\n // force instead, the way Icon does, and lands at the same size as every\n // other Button on that Section (ADR 0008).\n protected readonly actionSize = computed(() =>\n resolveSize(this.sizeContext?.size())\n );\n\n protected readonly actionConfig = computed<Button | undefined>(() => {\n const icon = this.actionButton();\n if (!icon) return undefined;\n return {\n icon,\n label: this.actionLabel(),\n iconOnly: true,\n variant: 'ghost',\n };\n });\n\n // A computed rather than the impure TranslatePipe repeated six times: one\n // lookup per label change instead of one per change-detection tick, and it\n // still repaints when the language or an in-memory translation moves.\n // A translation renders MiniMark's inline rules, so `Uninstall **<$app>**`\n // bolds the App's name the way `m-text-output` would. Authored text stays\n // literal: it names identifiers, and `__init__` must not turn bold.\n protected readonly html = computed(() =>\n this.noTranslate()\n ? escapeHtml(this.label() ?? '')\n : miniMarkInlineToHtml(\n this.translateService.translate(this.label(), this.params())\n )\n );\n}\n"],"mappings":";;;;;AAmGA,IAAa,kBAAb,MAAa,gBAAe;CACjB,QAAQ,MAAmB,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC7B,QAAQ,MAA2B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAMnC,OAAO,MAA2B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAClC,eAAe,MAA2B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CAI1C,cAAc,MAA2B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAKzC,cAAc,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAKnC,SAAS,MAA0C,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAC7D,cAAc,OAAM;CAEZ,mBAAmB,OAAO,gBAAgB;CAC1C,cAAc,OAAO,cAAc,EAAE,UAAU,KAAI,CAAE;CAOnD,aAAa,eAC9B,YAAY,KAAK,aAAa,KAAI,CAAE,GACrC,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAEkB,eAAe,eAAkC;EAClE,MAAM,OAAO,KAAK,aAAY;EAC9B,IAAI,CAAC,MAAM,OAAO;EACl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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2ET,UAAA;EAAA,QAAA,CAAA,m+CAAA;EAAA,cAAA,CAAA;GAAA,MAAA;GAAA,MA5ES;GAAe,UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;GAAA;GAAA,SAAA,CAAA,gBAAA,SAAA;EAAA,GAAA;GAAA,MAAA;GAAA,MAAE;GAAa,UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;GAAA;GAAA,SAAA,CAAA,cAAA;EAAA,CAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAgF7B,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAe,YAAA,CAAA;EAlF3B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAU,SACX,CAAC,iBAAiB,aAAa;GAAC,UAC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2ET,iBAEgB,wBAAwB;GAAM,QAAA,CAAA,m+CAAA;EAAA,CAAA"}
@@ -1,7 +1,7 @@
1
- import { t as ButtonComponent } from "./magmonium-one-button-CKHBcCoO.mjs";
1
+ import { t as ButtonComponent } from "./magmonium-one-button-DO7FTwuF.mjs";
2
2
  import { t as InputType } from "./magmonium-one-input-DqHPorA1.mjs";
3
- import { t as HeaderComponent } from "./magmonium-one-header-CkW_6y7m.mjs";
4
- import { t as RangeInputComponent } from "./magmonium-one-range-M_HBccdt.mjs";
3
+ import { t as HeaderComponent } from "./magmonium-one-header-CgOV_m7w.mjs";
4
+ import { t as RangeInputComponent } from "./magmonium-one-range-pxmV4Ytp.mjs";
5
5
  import { a as initialFraming, c as parseRatio, i as encodeFramed, l as renameForType, n as cropRect, r as drawFramed, s as outputSize, t as clampFraming } from "./magmonium-one-image-frame-BTSaUSAi.mjs";
6
6
  import { MODAL_REF } from "./magmonium-one.mjs";
7
7
  import * as i0 from "@angular/core";
@@ -435,4 +435,4 @@ i0.ɵɵngDeclareClassMetadata({
435
435
  });
436
436
  export { ImageEditorComponent };
437
437
 
438
- //# sourceMappingURL=magmonium-one-image-editor-BYNN15tt.mjs.map
438
+ //# sourceMappingURL=magmonium-one-image-editor-NsUm59Ul.mjs.map