@magmonium/one 0.4.99 → 0.4.100

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 (20) hide show
  1. package/fesm2022/{magmonium-one-base-dropdown-CmUfiOAb.mjs → magmonium-one-base-dropdown-xhoyZ8I5.mjs} +2 -2
  2. package/fesm2022/{magmonium-one-base-dropdown-CmUfiOAb.mjs.map → magmonium-one-base-dropdown-xhoyZ8I5.mjs.map} +1 -1
  3. package/fesm2022/{magmonium-one-button-C5dk4R_m.mjs → magmonium-one-button-BPIU6Ww0.mjs} +29 -3
  4. package/fesm2022/magmonium-one-button-BPIU6Ww0.mjs.map +1 -0
  5. package/fesm2022/{magmonium-one-group-bRamdzPO.mjs → magmonium-one-group-mOaqnb5q.mjs} +12 -5
  6. package/fesm2022/magmonium-one-group-mOaqnb5q.mjs.map +1 -0
  7. package/fesm2022/{magmonium-one-header-BZzD8uTJ.mjs → magmonium-one-header-Cz3oggF7.mjs} +3 -2
  8. package/fesm2022/{magmonium-one-header-BZzD8uTJ.mjs.map → magmonium-one-header-Cz3oggF7.mjs.map} +1 -1
  9. package/fesm2022/{magmonium-one-image-editor-BV0x-SA3.mjs → magmonium-one-image-editor-D40RzxsY.mjs} +4 -3
  10. package/fesm2022/{magmonium-one-image-editor-BV0x-SA3.mjs.map → magmonium-one-image-editor-D40RzxsY.mjs.map} +1 -1
  11. package/fesm2022/{magmonium-one-menu-CJjjxFfu.mjs → magmonium-one-menu-eSnsKCez.mjs} +3 -2
  12. package/fesm2022/{magmonium-one-menu-CJjjxFfu.mjs.map → magmonium-one-menu-eSnsKCez.mjs.map} +1 -1
  13. package/fesm2022/{magmonium-one-password-BKdXAZ_p.mjs → magmonium-one-password-CSNZtS__.mjs} +3 -2
  14. package/fesm2022/{magmonium-one-password-BKdXAZ_p.mjs.map → magmonium-one-password-CSNZtS__.mjs.map} +1 -1
  15. package/fesm2022/magmonium-one.mjs +77 -12
  16. package/fesm2022/magmonium-one.mjs.map +1 -1
  17. package/package.json +1 -1
  18. package/types/magmonium-one.d.ts +26 -0
  19. package/fesm2022/magmonium-one-button-C5dk4R_m.mjs.map +0 -1
  20. package/fesm2022/magmonium-one-group-bRamdzPO.mjs.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magmonium/one",
3
- "version": "0.4.99",
3
+ "version": "0.4.100",
4
4
  "description": "Magmonium One — Angular design-system primitives for mm Apps",
5
5
  "author": "magmonium",
6
6
  "license": "MIT",
@@ -2892,6 +2892,7 @@ type Button = Config & {
2892
2892
  routerLink?: string | readonly (string | number)[];
2893
2893
  fullWidth?: boolean;
2894
2894
  iconOnly?: boolean;
2895
+ size?: Size | 'sm' | 'md' | 'lg';
2895
2896
  stacked?: boolean;
2896
2897
  badge?: ButtonBadge;
2897
2898
  imgSrc?: string;
@@ -2937,6 +2938,7 @@ export declare class ButtonComponent extends ReactiveElementComponent<Button> {
2937
2938
  icon: import("@angular/core").InputSignal<string | undefined>;
2938
2939
  isRightIcon: import("@angular/core").InputSignal<string | boolean | undefined>;
2939
2940
  iconOnly: import("@angular/core").InputSignal<string | boolean | undefined>;
2941
+ size: import("@angular/core").InputSignal<"sm" | "md" | "lg" | Size | undefined>;
2940
2942
  stacked: import("@angular/core").InputSignal<string | boolean | undefined>;
2941
2943
  imgSrc: import("@angular/core").InputSignal<string | undefined>;
2942
2944
  nonClickable: import("@angular/core").InputSignal<string | boolean | undefined>;
@@ -2948,6 +2950,8 @@ export declare class ButtonComponent extends ReactiveElementComponent<Button> {
2948
2950
  protected element: import("@angular/core").Signal<ElementRef<any> | undefined>;
2949
2951
  protected readonly className: import("@angular/core").Signal<string>;
2950
2952
  private readonly navRef;
2953
+ private readonly inGroup;
2954
+ protected readonly ownSizeLength: import("@angular/core").Signal<string | null>;
2951
2955
  protected readonly resolvesConfigAsset: boolean;
2952
2956
  readonly routerLinkRef: RouterLink | null;
2953
2957
  private readonly sectionForm;
@@ -3070,6 +3074,11 @@ export declare class ButtonComponent extends ReactiveElementComponent<Button> {
3070
3074
  "required": false;
3071
3075
  "isSignal": true;
3072
3076
  };
3077
+ "size": {
3078
+ "alias": "size";
3079
+ "required": false;
3080
+ "isSignal": true;
3081
+ };
3073
3082
  "stacked": {
3074
3083
  "alias": "stacked";
3075
3084
  "required": false;
@@ -3560,6 +3569,7 @@ export declare class ButtonGroupComponent extends ConfigComponent<ButtonGroup> {
3560
3569
  routerLink?: string | readonly (string | number)[];
3561
3570
  fullWidth?: boolean;
3562
3571
  iconOnly?: boolean;
3572
+ size?: Size | "sm" | "md" | "lg";
3563
3573
  stacked?: boolean;
3564
3574
  badge?: ButtonBadge;
3565
3575
  imgSrc?: string;
@@ -3741,6 +3751,16 @@ declare function deriveGroupClass(group?: Partial<ButtonGroup>): string;
3741
3751
  * was never written.
3742
3752
  */
3743
3753
  declare const ACTION_BUTTON_HOST: InjectionToken<true>;
3754
+ /**
3755
+ * Published by `<m-button-group>` and `<m-section-button-group>` — the one
3756
+ * ButtonGroup seat (ADR 0008) — for the Buttons inside them.
3757
+ *
3758
+ * A standalone iconOnly Button may declare a Size of its own; one inside a
3759
+ * group may not, the group's Size being the one its Buttons share. This flag
3760
+ * is how a Button tells the two apart: SIZE_CONTEXT cannot, because a Section
3761
+ * provides it too.
3762
+ */
3763
+ declare const BUTTON_GROUP_HOST: InjectionToken<true>;
3744
3764
  type GridAlignX = 'left' | 'center' | 'right';
3745
3765
  type GridAlignY = 'top' | 'center' | 'bottom';
3746
3766
  type ColVariant = 'noBorder' | 'withBorder';
@@ -6156,10 +6176,16 @@ export declare class SectionTableComponent<Id extends string = string> extends C
6156
6176
  * where it was written, never by a setting here.
6157
6177
  */
6158
6178
  export declare class SectionTableRowComponent {
6179
+ /**
6180
+ * A click that lands on one of these inside a cell is that control's own
6181
+ * action, not the row's: a cell's button or link must not also follow the row.
6182
+ */
6183
+ private static readonly OWN_CLICK;
6159
6184
  /** The Repeat item codegen gives a repeated row; absent for a static row. */
6160
6185
  readonly item: import("@angular/core").InputSignal<unknown>;
6161
6186
  /** The repeated row's item, or `undefined` for a static row. */
6162
6187
  readonly rowClick: import("@angular/core").OutputEmitterRef<unknown>;
6188
+ protected readonly onClick: (event: MouseEvent) => void;
6163
6189
  static ɵfac: i0.ɵɵFactoryDeclaration<SectionTableRowComponent, never>;
6164
6190
  static ɵcmp: i0.ɵɵComponentDeclaration<SectionTableRowComponent, "tr[m-section-table-row]", never, {
6165
6191
  "item": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"magmonium-one-button-C5dk4R_m.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/button/lib/action-host.token.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 { InjectionToken } from '@angular/core';\n\n/**\n * Published by `<m-action>` for the `<m-button>`s written inside it.\n *\n * A Button there is a description of a segment, never drawn itself: the bar\n * has no `ng-content`, reads each Button's resolved config off its instance and\n * draws its own `<button>` from it — which is what keeps the toggle, the\n * squeeze and the routed light working off one list. An `@if` around one\n * still takes it in and out of that list, because the bar's query follows the\n * Buttons that exist.\n *\n * The flag stops such a Button resolving a `buttons/<name>.yml` of its own:\n * the bar already resolves what an unlabelled Button is missing, and a named\n * segment that only ever rides on its tag would otherwise request a file that\n * was never written.\n */\nexport const ACTION_BUTTON_HOST = new InjectionToken<true>(\n 'ACTION_BUTTON_HOST'\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 { RouterLink, 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 { ACTION_BUTTON_HOST, 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 // Inside an `m-action` this Button is a segment the bar draws, never drawn\n // itself, so it leaves resolving a `buttons/<name>.yml` to the bar\n // (action-host.token.ts).\n protected override readonly resolvesConfigAsset = !inject(\n ACTION_BUTTON_HOST,\n { optional: true }\n );\n\n // A RouterLink written on this Button's own tag. Read by an `m-action` that\n // draws the Button as a link of its own: the tag is never in the DOM there,\n // so the directive on it can only say where the link goes, never follow it.\n readonly routerLinkRef = inject(RouterLink, { self: true, 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,QAAQ,KAAK,UAAU,OAAO,UAAU;CAG1C,IAAI,OAAO,aAAa,OAAO,cAAc,QAC3C,QAAQ,KAAK,UAAU,OAAO,WAAW;CAG3C,OAAO,QAAQ,KAAK,GAAG;AACzB;AAEA,MAAa,oBACX,OACA,WAAW,OACD;CACV,IAAI,UAAU,UAAa,SAAS,GAAG,OAAO;CAC9C,IAAI,QAAQ,UAAU,OAAO,GAAG,SAAQ;CACxC,OAAO,MAAM,SAAQ;AACvB;AAEA,MAAa,mBAAmB,UAC9B,UAAU,UAAa,QAAQ;ACJjC,IAAa,iBAAb,MAAa,uBAAuB,gBAAsB;CACtC,YAAY;CACrB,SAAS,MAAuB,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;C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A;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,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,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,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,SAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,UAAQ,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"magmonium-one-group-bRamdzPO.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) => ({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