@magmonium/one 0.4.40 → 0.4.42
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.
- package/assets/fields/app_color.json +5 -0
- package/assets/fields/logo_glyph_paste.json +7 -0
- package/assets/fields/logo_glyph_upload.json +12 -0
- package/assets/forms/logo_glyph_input.json +13 -0
- package/assets/i18n/ar.json +8 -0
- package/assets/i18n/de.json +8 -0
- package/assets/i18n/en.json +8 -0
- package/assets/i18n/es.json +8 -0
- package/assets/i18n/fr.json +8 -0
- package/assets/i18n/hi.json +8 -0
- package/assets/i18n/it.json +8 -0
- package/assets/i18n/ja.json +8 -0
- package/assets/i18n/ko.json +8 -0
- package/assets/i18n/nl.json +8 -0
- package/assets/i18n/pl.json +8 -0
- package/assets/i18n/pt.json +8 -0
- package/assets/i18n/ru.json +8 -0
- package/assets/i18n/tr.json +8 -0
- package/assets/i18n/zh.json +8 -0
- package/assets/index.json +1 -1
- package/fesm2022/{magmonium-one-base-dropdown-DU4B4w7c.mjs → magmonium-one-base-dropdown-CcZ0lBQv.mjs} +3 -3
- package/fesm2022/{magmonium-one-base-dropdown-DU4B4w7c.mjs.map → magmonium-one-base-dropdown-CcZ0lBQv.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-button-BWB3ZKIj.mjs → magmonium-one-button-BZQOf-Pm.mjs} +6 -4
- package/fesm2022/{magmonium-one-button-BWB3ZKIj.mjs.map → magmonium-one-button-BZQOf-Pm.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-group-m41SX_fL.mjs → magmonium-one-group-Dl2bp-y-.mjs} +4 -4
- package/fesm2022/{magmonium-one-group-m41SX_fL.mjs.map → magmonium-one-group-Dl2bp-y-.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-header-D8CB9CBJ.mjs → magmonium-one-header-DhK9NuZW.mjs} +5 -4
- package/fesm2022/{magmonium-one-header-D8CB9CBJ.mjs.map → magmonium-one-header-DhK9NuZW.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-icon-BTPHGpEN.mjs → magmonium-one-icon-BgbtOdMv.mjs} +229 -6
- package/fesm2022/magmonium-one-icon-BgbtOdMv.mjs.map +1 -0
- package/fesm2022/{magmonium-one-image-editor-Dn0ACfH0.mjs → magmonium-one-image-editor-oGxg59hV.mjs} +3 -3
- package/fesm2022/{magmonium-one-image-editor-Dn0ACfH0.mjs.map → magmonium-one-image-editor-oGxg59hV.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-menu-EIfPlZ4E.mjs → magmonium-one-menu-bI7lVUYI.mjs} +5 -4
- package/fesm2022/{magmonium-one-menu-EIfPlZ4E.mjs.map → magmonium-one-menu-bI7lVUYI.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-password-BjqYmT1s.mjs → magmonium-one-password-BIs_YxJ5.mjs} +2 -2
- package/fesm2022/{magmonium-one-password-BjqYmT1s.mjs.map → magmonium-one-password-BIs_YxJ5.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-text-BL-1lWST.mjs → magmonium-one-text-BvXdAX0i.mjs} +4 -3
- package/fesm2022/{magmonium-one-text-BL-1lWST.mjs.map → magmonium-one-text-BvXdAX0i.mjs.map} +1 -1
- package/fesm2022/magmonium-one.mjs +627 -144
- package/fesm2022/magmonium-one.mjs.map +1 -1
- package/package.json +1 -1
- package/types/magmonium-one.d.ts +283 -31
- package/fesm2022/magmonium-one-icon-BTPHGpEN.mjs.map +0 -1
package/fesm2022/{magmonium-one-button-BWB3ZKIj.mjs.map → magmonium-one-button-BZQOf-Pm.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"magmonium-one-button-BWB3ZKIj.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/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","import { 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","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,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,OAC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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,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
|
+
{"version":3,"file":"magmonium-one-button-BZQOf-Pm.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/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","import { 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","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,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,U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AAA;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,9 +1,9 @@
|
|
|
1
1
|
import { i as resolveSize, t as coerceSize } from "./magmonium-one-size-converter-C5fG_dgw.mjs";
|
|
2
2
|
import { r as deriveContrastColor } from "./magmonium-one-color-utl-D86GGpz5.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { f as injectParentSize, p as provideSizeContext } from "./magmonium-one-icon-BgbtOdMv.mjs";
|
|
4
4
|
import { r as ConfigComponent } from "./magmonium-one-attribute-value-DCTXt4Sr.mjs";
|
|
5
|
-
import { i as deriveGroupClass, t as ButtonComponent } from "./magmonium-one-button-
|
|
6
|
-
import { t as ContextMenuComponent } from "./magmonium-one-menu-
|
|
5
|
+
import { i as deriveGroupClass, t as ButtonComponent } from "./magmonium-one-button-BZQOf-Pm.mjs";
|
|
6
|
+
import { t as ContextMenuComponent } from "./magmonium-one-menu-bI7lVUYI.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-
|
|
428
|
+
//# sourceMappingURL=magmonium-one-group-Dl2bp-y-.mjs.map
|
package/fesm2022/{magmonium-one-group-m41SX_fL.mjs.map → magmonium-one-group-Dl2bp-y-.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"magmonium-one-group-m41SX_fL.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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A,8hSAAA;EAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"magmonium-one-group-Dl2bp-y-.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,QAAQ,MAAiB,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACzB,UAAU,MAAiB,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC3B,WAAW,MAA4B,GAAA,YA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AA;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,6 +1,6 @@
|
|
|
1
1
|
import { i as resolveSize, l as TranslateService } from "./magmonium-one-size-converter-C5fG_dgw.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { t as ButtonComponent } from "./magmonium-one-button-
|
|
2
|
+
import { d as SIZE_CONTEXT, r as IconComponent } from "./magmonium-one-icon-BgbtOdMv.mjs";
|
|
3
|
+
import { t as ButtonComponent } from "./magmonium-one-button-BZQOf-Pm.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 {
|
|
@@ -215,7 +215,8 @@ var HeaderComponent = class HeaderComponent {
|
|
|
215
215
|
"size",
|
|
216
216
|
"one",
|
|
217
217
|
"baseUrl",
|
|
218
|
-
"remote"
|
|
218
|
+
"remote",
|
|
219
|
+
"shadow"
|
|
219
220
|
],
|
|
220
221
|
outputs: ["configChange"]
|
|
221
222
|
}],
|
|
@@ -377,4 +378,4 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
377
378
|
});
|
|
378
379
|
export { HeaderComponent as t };
|
|
379
380
|
|
|
380
|
-
//# sourceMappingURL=magmonium-one-header-
|
|
381
|
+
//# sourceMappingURL=magmonium-one-header-DhK9NuZW.mjs.map
|
package/fesm2022/{magmonium-one-header-D8CB9CBJ.mjs.map → magmonium-one-header-DhK9NuZW.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"magmonium-one-header-
|
|
1
|
+
{"version":3,"file":"magmonium-one-header-DhK9NuZW.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';\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>{{ text() }}</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>{{ text() }}</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>{{ text() }}</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>{{ text() }}</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>{{ text() }}</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>{{ text() }}</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 protected readonly text = computed(() =>\n this.noTranslate()\n ? (this.label() ?? '')\n : this.translateService.translate(this.label(), this.params())\n );\n}\n"],"mappings":";;;;;AAkGA,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,MA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