@magmonium/one 0.4.55 → 0.4.57
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/i18n/af.json +103 -47
- package/assets/i18n/am.json +111 -59
- package/assets/i18n/ar.json +84 -59
- package/assets/i18n/as.json +105 -50
- package/assets/i18n/az.json +106 -50
- package/assets/i18n/ba.json +94 -45
- package/assets/i18n/be.json +105 -49
- package/assets/i18n/bg.json +99 -43
- package/assets/i18n/bn.json +104 -54
- package/assets/i18n/br.json +91 -43
- package/assets/i18n/brx.json +97 -29
- package/assets/i18n/bs.json +100 -43
- package/assets/i18n/ca.json +103 -47
- package/assets/i18n/ceb.json +99 -40
- package/assets/i18n/cnr.json +83 -43
- package/assets/i18n/co.json +105 -47
- package/assets/i18n/cs.json +98 -43
- package/assets/i18n/cy.json +83 -48
- package/assets/i18n/da.json +89 -35
- package/assets/i18n/de.json +75 -53
- package/assets/i18n/doi.json +107 -45
- package/assets/i18n/el.json +93 -44
- package/assets/i18n/en.json +2 -1
- package/assets/i18n/eo.json +98 -44
- package/assets/i18n/es.json +59 -46
- package/assets/i18n/et.json +97 -42
- package/assets/i18n/eu.json +106 -48
- package/assets/i18n/fa.json +79 -43
- package/assets/i18n/fi.json +91 -37
- package/assets/i18n/fr.json +78 -53
- package/assets/i18n/fy.json +96 -43
- package/assets/i18n/ga.json +89 -45
- package/assets/i18n/gd.json +84 -47
- package/assets/i18n/gl.json +95 -45
- package/assets/i18n/gu.json +103 -52
- package/assets/i18n/ha.json +93 -45
- package/assets/i18n/haw.json +95 -45
- package/assets/i18n/he.json +84 -34
- package/assets/i18n/hi.json +84 -61
- package/assets/i18n/hmn.json +88 -38
- package/assets/i18n/hr.json +100 -43
- package/assets/i18n/hu.json +90 -45
- package/assets/i18n/hy.json +106 -51
- package/assets/i18n/id.json +77 -31
- package/assets/i18n/ie.json +78 -24
- package/assets/i18n/ig.json +88 -40
- package/assets/i18n/ilo.json +86 -29
- package/assets/i18n/is.json +89 -44
- package/assets/i18n/it.json +69 -48
- package/assets/i18n/iw.json +85 -38
- package/assets/i18n/ja.json +67 -48
- package/assets/i18n/jw.json +81 -34
- package/assets/i18n/ka.json +93 -43
- package/assets/i18n/kk.json +87 -42
- package/assets/i18n/km.json +85 -41
- package/assets/i18n/kn.json +105 -51
- package/assets/i18n/ko.json +68 -51
- package/assets/i18n/kok.json +104 -42
- package/assets/i18n/ks.json +94 -27
- package/assets/i18n/ku.json +84 -40
- package/assets/i18n/ky.json +84 -41
- package/assets/i18n/la.json +81 -37
- package/assets/i18n/lb.json +80 -39
- package/assets/i18n/lo.json +81 -39
- package/assets/i18n/lt.json +82 -43
- package/assets/i18n/lv.json +81 -42
- package/assets/i18n/ma.json +93 -28
- package/assets/i18n/mai.json +98 -35
- package/assets/i18n/me.json +67 -20
- package/assets/i18n/mg.json +82 -39
- package/assets/i18n/mi.json +86 -42
- package/assets/i18n/mk.json +81 -40
- package/assets/i18n/ml.json +98 -42
- package/assets/i18n/mn.json +81 -40
- package/assets/i18n/mni.json +92 -27
- package/assets/i18n/mr.json +100 -44
- package/assets/i18n/ms.json +77 -35
- package/assets/i18n/mt.json +79 -37
- package/assets/i18n/my.json +80 -39
- package/assets/i18n/ne.json +76 -35
- package/assets/i18n/nl.json +80 -47
- package/assets/i18n/no.json +71 -30
- package/assets/i18n/ny.json +100 -37
- package/assets/i18n/or.json +105 -49
- package/assets/i18n/pa.json +100 -45
- package/assets/i18n/pl.json +65 -45
- package/assets/i18n/ps.json +75 -33
- package/assets/i18n/pt.json +61 -44
- package/assets/i18n/rm.json +71 -26
- package/assets/i18n/ro.json +74 -34
- package/assets/i18n/ru.json +62 -45
- package/assets/i18n/sa.json +98 -36
- package/assets/i18n/sat.json +98 -37
- package/assets/i18n/sc.json +70 -25
- package/assets/i18n/sd.json +95 -31
- package/assets/i18n/si.json +72 -34
- package/assets/i18n/sk.json +71 -31
- package/assets/i18n/sl.json +70 -32
- package/assets/i18n/sm.json +71 -30
- package/assets/i18n/sn.json +66 -25
- package/assets/i18n/so.json +66 -26
- package/assets/i18n/sq.json +95 -39
- package/assets/i18n/sr.json +68 -29
- package/assets/i18n/st.json +68 -27
- package/assets/i18n/su.json +64 -24
- package/assets/i18n/sv.json +66 -25
- package/assets/i18n/sw.json +60 -20
- package/assets/i18n/ta.json +92 -42
- package/assets/i18n/te.json +95 -39
- package/assets/i18n/tg.json +69 -31
- package/assets/i18n/th.json +65 -27
- package/assets/i18n/tl.json +86 -26
- package/assets/i18n/tr.json +63 -46
- package/assets/i18n/uk.json +64 -26
- package/assets/i18n/ur.json +93 -33
- package/assets/i18n/uz.json +64 -25
- package/assets/i18n/vi.json +64 -26
- package/assets/i18n/xh.json +65 -25
- package/assets/i18n/yi.json +66 -28
- package/assets/i18n/yo.json +65 -26
- package/assets/i18n/zh.json +71 -37
- package/assets/i18n/zu.json +63 -25
- package/fesm2022/{magmonium-one-base-dropdown-Tf6PltuH.mjs → magmonium-one-base-dropdown-BgLka4oB.mjs} +5 -5
- package/fesm2022/{magmonium-one-base-dropdown-Tf6PltuH.mjs.map → magmonium-one-base-dropdown-BgLka4oB.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-checkbox-CbEdjmtz.mjs → magmonium-one-checkbox-CyVd_a7p.mjs} +2 -2
- package/fesm2022/{magmonium-one-checkbox-CbEdjmtz.mjs.map → magmonium-one-checkbox-CyVd_a7p.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-directives-C_i3gUFT.mjs → magmonium-one-directives-Dbe0pfCf.mjs} +2 -2
- package/fesm2022/magmonium-one-directives-Dbe0pfCf.mjs.map +1 -0
- package/fesm2022/{magmonium-one-file.service-Bo06pU3_.mjs → magmonium-one-file.service-D39FjShR.mjs} +2 -1
- package/fesm2022/magmonium-one-file.service-D39FjShR.mjs.map +1 -0
- package/fesm2022/{magmonium-one-group-C7alQqSj.mjs → magmonium-one-group-BPhM2IIa.mjs} +2 -2
- package/fesm2022/{magmonium-one-group-C7alQqSj.mjs.map → magmonium-one-group-BPhM2IIa.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-image-editor-DHlktZ6z.mjs → magmonium-one-image-editor-CKx7BRVF.mjs} +2 -2
- package/fesm2022/{magmonium-one-image-editor-DHlktZ6z.mjs.map → magmonium-one-image-editor-CKx7BRVF.mjs.map} +1 -1
- package/fesm2022/magmonium-one-input-DqHPorA1.mjs.map +1 -1
- package/fesm2022/{magmonium-one-label-B95NhEzQ.mjs → magmonium-one-label-B8WJHiU4.mjs} +12 -2
- package/fesm2022/magmonium-one-label-B8WJHiU4.mjs.map +1 -0
- package/fesm2022/{magmonium-one-menu-DmZJi88Y.mjs → magmonium-one-menu-CxswmD0O.mjs} +2 -2
- package/fesm2022/{magmonium-one-menu-DmZJi88Y.mjs.map → magmonium-one-menu-CxswmD0O.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-multi-range-BnWtK-O0.mjs → magmonium-one-multi-range-mv5rz3uW.mjs} +3 -3
- package/fesm2022/{magmonium-one-multi-range-BnWtK-O0.mjs.map → magmonium-one-multi-range-mv5rz3uW.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-otp-BOiv-9eT.mjs → magmonium-one-otp-BlP0t9w1.mjs} +2 -2
- package/fesm2022/{magmonium-one-otp-BOiv-9eT.mjs.map → magmonium-one-otp-BlP0t9w1.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-password-Bsv1wUIJ.mjs → magmonium-one-password-CTnJ9M7d.mjs} +2 -2
- package/fesm2022/{magmonium-one-password-Bsv1wUIJ.mjs.map → magmonium-one-password-CTnJ9M7d.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-radio-BsQv0Wof.mjs → magmonium-one-radio-BanML2y5.mjs} +2 -2
- package/fesm2022/{magmonium-one-radio-BsQv0Wof.mjs.map → magmonium-one-radio-BanML2y5.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-range-DPR659yG.mjs → magmonium-one-range-B_3WiQR7.mjs} +5 -3
- package/fesm2022/magmonium-one-range-B_3WiQR7.mjs.map +1 -0
- package/fesm2022/{magmonium-one-selector-CXZMCqmO.mjs → magmonium-one-selector-Do0PsJBx.mjs} +2 -2
- package/fesm2022/{magmonium-one-selector-CXZMCqmO.mjs.map → magmonium-one-selector-Do0PsJBx.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-text-Bo4XPBXB.mjs → magmonium-one-text-DDA0gCOd.mjs} +4 -2
- package/fesm2022/magmonium-one-text-DDA0gCOd.mjs.map +1 -0
- package/fesm2022/magmonium-one.mjs +422 -99
- package/fesm2022/magmonium-one.mjs.map +1 -1
- package/package.json +1 -1
- package/types/magmonium-one.d.ts +132 -3
- package/fesm2022/magmonium-one-directives-C_i3gUFT.mjs.map +0 -1
- package/fesm2022/magmonium-one-file.service-Bo06pU3_.mjs.map +0 -1
- package/fesm2022/magmonium-one-label-B95NhEzQ.mjs.map +0 -1
- package/fesm2022/magmonium-one-range-DPR659yG.mjs.map +0 -1
- package/fesm2022/magmonium-one-text-Bo4XPBXB.mjs.map +0 -1
|
@@ -3,7 +3,7 @@ import { r as deriveContrastColor } from "./magmonium-one-color-utl-Bd80JrEQ.mjs
|
|
|
3
3
|
import { o as injectParentSize, s as provideSizeContext } from "./magmonium-one-icon-dAR6gd-q.mjs";
|
|
4
4
|
import { r as ConfigComponent } from "./magmonium-one-attribute-value-BobQXKUK.mjs";
|
|
5
5
|
import { i as deriveGroupClass, t as ButtonComponent } from "./magmonium-one-button-B1KCA8KO.mjs";
|
|
6
|
-
import { t as ContextMenuComponent } from "./magmonium-one-menu-
|
|
6
|
+
import { t as ContextMenuComponent } from "./magmonium-one-menu-CxswmD0O.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-BPhM2IIa.mjs.map
|
package/fesm2022/{magmonium-one-group-C7alQqSj.mjs.map → magmonium-one-group-BPhM2IIa.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"magmonium-one-group-C7alQqSj.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,WA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AA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;GAAA;GAAA,SAAA,CAAA,gBAAA,SAAA;EAAA,GAAA;GAAA,MAAA;GAAA,MAAA,GAAA,iBAAG,oBAAoB;GAAA,UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;GAAA;GAAA,SAAA,CAAA,gBAAA,QAAA;EAAA,CAAA;EAAA,iBAAA,GAAA,wBAAA;EAAA,eAAA,GAAA,kBAAA;CAAA,CAAA;;AAatD,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAoB,YAAA,CAAA;EAjEhC,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAoC,UACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDT,SACQ,CAAC,iBAAiB,eAAe,GAAG,oBAAoB;GAAC,eAEnD,kBAAkB;GAAI,iBACpB,wBAAwB;GAAM,MACzC,EAGJ,qBAAqB,eACtB;GAAA,WACU,CACT,mBAAkB,oBAAA,CACnB;GAAA,QAAA,CAAA,8hSAAA;EAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"magmonium-one-group-BPhM2IIa.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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AAA,CACnB;GAAA,QAAA,CAAA,8hSAAA;EAAA,CAAA"}
|
package/fesm2022/{magmonium-one-image-editor-DHlktZ6z.mjs → magmonium-one-image-editor-CKx7BRVF.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as ButtonComponent } from "./magmonium-one-button-B1KCA8KO.mjs";
|
|
2
2
|
import { t as InputType } from "./magmonium-one-input-DqHPorA1.mjs";
|
|
3
3
|
import { t as HeaderComponent } from "./magmonium-one-header-CckG0DHr.mjs";
|
|
4
|
-
import { t as RangeInputComponent } from "./magmonium-one-range-
|
|
4
|
+
import { t as RangeInputComponent } from "./magmonium-one-range-B_3WiQR7.mjs";
|
|
5
5
|
import { a as initialFraming, c as parseRatio, i as encodeFramed, l as renameForType, n as cropRect, r as drawFramed, s as outputSize, t as clampFraming } from "./magmonium-one-image-frame-BTSaUSAi.mjs";
|
|
6
6
|
import { MODAL_REF } from "./magmonium-one.mjs";
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
@@ -435,4 +435,4 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
435
435
|
});
|
|
436
436
|
export { ImageEditorComponent };
|
|
437
437
|
|
|
438
|
-
//# sourceMappingURL=magmonium-one-image-editor-
|
|
438
|
+
//# sourceMappingURL=magmonium-one-image-editor-CKx7BRVF.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"magmonium-one-image-editor-DHlktZ6z.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/ui/file-upload-input/image-editor.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n effect,\n ElementRef,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { ButtonComponent } from '../../../button/ui/button';\nimport { HeaderComponent } from '../../../header';\nimport { RangeInputComponent } from '../range/range';\nimport { InputType, RangeInput } from '../../model/input';\nimport { MODAL_REF, ModalRef } from '../../../../config/modal-ref';\nimport {\n clampFraming,\n cropRect,\n drawFramed,\n encodeFramed,\n Framing,\n FrameSize,\n initialFraming,\n MAX_ZOOM,\n MIN_ZOOM,\n outputSize,\n parseRatio,\n renameForType,\n} from './image-frame';\n\n/**\n * What an ImageEditor closes with. The framed file on an apply, `unreadable`\n * when the picture never decoded, and neither for a dismissal — a flat object\n * rather than a union, so the web-component build (no `strict`) reads it too.\n */\nexport type ImageEditorResult = { file?: File; unreadable?: boolean };\n\ntype Point = { x: number; y: number };\n\nconst WHEEL_ZOOM_RATE = 0.0015;\n\nconst distance = (a: Point, b: Point): number =>\n Math.hypot(a.x - b.x, a.y - b.y);\n\n@Component({\n selector: 'm-image-editor',\n template: `\n <div class=\"image-editor\">\n <m-header\n [level]=\"3\"\n label=\"edit-image-size\"\n [params]=\"sizeParams()\"\n />\n <div\n #stage\n class=\"image-editor__stage\"\n [style.aspect-ratio]=\"aspect()\"\n [style.--m-image-editor-aspect]=\"aspect()\"\n [class.image-editor__stage--panning]=\"isPanning()\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n (wheel)=\"onWheel($event)\"\n >\n @if (sourceUrl(); as url) {\n <img\n class=\"image-editor__image\"\n [src]=\"url\"\n alt=\"\"\n draggable=\"false\"\n [style.width.px]=\"imageBox().width\"\n [style.height.px]=\"imageBox().height\"\n [style.transform]=\"imageBox().transform\"\n />\n }\n </div>\n <m-range\n [config]=\"zoomConfig()\"\n [value]=\"zoomPercent()\"\n (valueChange)=\"onZoom($event)\"\n />\n <!-- asset: buttons/okay.yml. No cancel beside it: the Modal's own close\n is the cancel, and it drops the image the same way. -->\n <m-one-button\n name=\"okay\"\n label=\"apply\"\n [disabled]=\"!source() || isApplying()\"\n (clicked)=\"apply()\"\n />\n </div>\n `,\n imports: [ButtonComponent, HeaderComponent, RangeInputComponent],\n styleUrl: './image-editor.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ImageEditorComponent {\n readonly file = input.required<File>();\n readonly ratio = input.required<string>();\n readonly width = input.required<number>();\n\n readonly #modalRef = inject<ModalRef<ImageEditorResult | undefined>>(MODAL_REF);\n private readonly stage = viewChild<ElementRef<HTMLDivElement>>('stage');\n\n protected readonly source = signal<ImageBitmap | undefined>(undefined);\n protected readonly sourceUrl = signal<string | undefined>(undefined);\n protected readonly isApplying = signal(false);\n private readonly framing = signal<Framing>({ cx: 0, cy: 0, zoom: MIN_ZOOM });\n private readonly stageWidth = signal(0);\n private readonly pointers = new Map<number, Point>();\n protected readonly isPanning = signal(false);\n #settled = false;\n\n protected readonly zoomConfig = computed<RangeInput>(() => ({\n name: 'zoom',\n label: 'zoom',\n type: InputType.RANGE,\n min: MIN_ZOOM * 100,\n max: MAX_ZOOM * 100,\n }));\n\n protected readonly aspect = computed(() => parseRatio(this.ratio()) ?? 1);\n\n private readonly output = computed<FrameSize | undefined>(() =>\n outputSize(this.ratio(), this.width())\n );\n\n protected readonly sizeParams = computed(() => {\n const size = this.output();\n return {\n width: String(size?.width ?? ''),\n height: String(size?.height ?? ''),\n };\n });\n\n private readonly imageSize = computed<FrameSize | undefined>(() => {\n const bitmap = this.source();\n return bitmap ? { width: bitmap.width, height: bitmap.height } : undefined;\n });\n\n protected readonly zoomPercent = computed(() =>\n String(Math.round(this.framing().zoom * 100))\n );\n\n /** The whole picture laid out so the box shows exactly the crop. */\n protected readonly imageBox = computed(() => {\n const image = this.imageSize();\n const stage = this.stageWidth();\n if (!image || !stage) return { width: 0, height: 0, transform: 'none' };\n const rect = cropRect(image, this.aspect(), this.framing());\n const scale = stage / rect.width;\n return {\n width: image.width * scale,\n height: image.height * scale,\n transform: `translate(${-rect.x * scale}px, ${-rect.y * scale}px)`,\n };\n });\n\n private readonly load = effect((onCleanup) => {\n const file = this.file();\n let cancelled = false;\n const url = URL.createObjectURL(file);\n this.sourceUrl.set(url);\n // EXIF orientation applied here, so the geometry below and the <img> the\n // stage draws agree on which way is up.\n createImageBitmap(file, { imageOrientation: 'from-image' })\n .then((bitmap) => {\n if (cancelled) {\n bitmap.close();\n return;\n }\n this.framing.set(\n initialFraming({ width: bitmap.width, height: bitmap.height })\n );\n this.source.set(bitmap);\n })\n .catch(() => {\n if (!cancelled) this.settle({ unreadable: true });\n });\n onCleanup(() => {\n cancelled = true;\n URL.revokeObjectURL(url);\n this.source()?.close();\n });\n });\n\n private readonly measure = effect((onCleanup) => {\n const stage = this.stage()?.nativeElement;\n if (!stage) return;\n this.stageWidth.set(stage.clientWidth);\n if (typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(([entry]) =>\n this.stageWidth.set(entry.contentRect.width)\n );\n observer.observe(stage);\n onCleanup(() => observer.disconnect());\n });\n\n // The Modal's own close affordance destroys the body without a word, and a\n // dismissal is a cancel: whoever opened the editor is still waiting.\n private readonly reportDismissal = inject(DestroyRef).onDestroy(() =>\n this.settle(undefined)\n );\n\n protected onPointerDown = (event: PointerEvent): void => {\n if (!this.source()) return;\n (event.currentTarget as HTMLElement).setPointerCapture?.(event.pointerId);\n this.pointers.set(event.pointerId, { x: event.clientX, y: event.clientY });\n this.isPanning.set(true);\n };\n\n protected onPointerMove = (event: PointerEvent): void => {\n const previous = this.pointers.get(event.pointerId);\n if (!previous) return;\n const next = { x: event.clientX, y: event.clientY };\n const others = [...this.pointers.entries()].filter(\n ([id]) => id !== event.pointerId\n );\n if (others.length === 1) {\n // Pinch: the gap between two fingers is the zoom.\n const anchor = others[0][1];\n const before = distance(previous, anchor);\n if (before > 0) this.zoomBy(distance(next, anchor) / before);\n } else if (others.length === 0) {\n this.panBy(next.x - previous.x, next.y - previous.y);\n }\n this.pointers.set(event.pointerId, next);\n };\n\n protected onPointerUp = (event: PointerEvent): void => {\n this.pointers.delete(event.pointerId);\n this.isPanning.set(this.pointers.size > 0);\n };\n\n protected onWheel = (event: WheelEvent): void => {\n if (!this.source()) return;\n event.preventDefault();\n this.zoomBy(Math.exp(-event.deltaY * WHEEL_ZOOM_RATE));\n };\n\n protected onZoom = (percent: string): void => {\n const zoom = Number(percent) / 100;\n if (!Number.isFinite(zoom)) return;\n this.updateFraming((framing) => ({ ...framing, zoom }));\n };\n\n protected apply = async (): Promise<void> => {\n const bitmap = this.source();\n const image = this.imageSize();\n const output = this.output();\n if (!bitmap || !image || !output || this.isApplying()) return;\n this.isApplying.set(true);\n try {\n const rect = cropRect(image, this.aspect(), this.framing());\n const blob = await encodeFramed(drawFramed(bitmap, rect, output));\n const original = this.file();\n this.settle({\n file: new File([blob], renameForType(original.name, blob.type), {\n type: blob.type,\n lastModified: Date.now(),\n }),\n });\n } catch {\n this.settle({ unreadable: true });\n }\n };\n\n /** Screen pixels dragged, moved into source pixels at the current scale. */\n private panBy = (dx: number, dy: number): void => {\n const image = this.imageSize();\n const stage = this.stageWidth();\n if (!image || !stage) return;\n const rect = cropRect(image, this.aspect(), this.framing());\n const perPixel = rect.width / stage;\n this.updateFraming((framing) => ({\n ...framing,\n cx: framing.cx - dx * perPixel,\n cy: framing.cy - dy * perPixel,\n }));\n };\n\n private zoomBy = (factor: number): void => {\n this.updateFraming((framing) => ({\n ...framing,\n zoom: framing.zoom * factor,\n }));\n };\n\n private updateFraming = (change: (framing: Framing) => Framing): void => {\n const image = this.imageSize();\n if (!image) return;\n this.framing.update((framing) =>\n clampFraming(image, this.aspect(), change(framing))\n );\n };\n\n private settle = (result: ImageEditorResult | undefined): void => {\n if (this.#settled) return;\n this.#settled = true;\n this.#modalRef.close(result);\n };\n}\n"],"mappings":";;;;;;;;AAyCA,MAAM,kBAAkB;AAExB,MAAM,YAAY,GAAU,MAC1B,KAAK,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AAsDjC,IAAa,uBAAb,MAAa,qBAAoB;CACtB,OAAO,MAAM,SAAgB,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC7B,QAAQ,MAAM,SAAkB,GAAA,YAAA,C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,0wBAAA;EAAA,CAAA;CAQgB,CAAA;CAAA,gBAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,SAAO,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"magmonium-one-image-editor-CKx7BRVF.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/ui/file-upload-input/image-editor.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n effect,\n ElementRef,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { ButtonComponent } from '../../../button/ui/button';\nimport { HeaderComponent } from '../../../header';\nimport { RangeInputComponent } from '../range/range';\nimport { InputType, RangeInput } from '../../model/input';\nimport { MODAL_REF, ModalRef } from '../../../../config/modal-ref';\nimport {\n clampFraming,\n cropRect,\n drawFramed,\n encodeFramed,\n Framing,\n FrameSize,\n initialFraming,\n MAX_ZOOM,\n MIN_ZOOM,\n outputSize,\n parseRatio,\n renameForType,\n} from './image-frame';\n\n/**\n * What an ImageEditor closes with. The framed file on an apply, `unreadable`\n * when the picture never decoded, and neither for a dismissal — a flat object\n * rather than a union, so the web-component build (no `strict`) reads it too.\n */\nexport type ImageEditorResult = { file?: File; unreadable?: boolean };\n\ntype Point = { x: number; y: number };\n\nconst WHEEL_ZOOM_RATE = 0.0015;\n\nconst distance = (a: Point, b: Point): number =>\n Math.hypot(a.x - b.x, a.y - b.y);\n\n@Component({\n selector: 'm-image-editor',\n template: `\n <div class=\"image-editor\">\n <m-header\n [level]=\"3\"\n label=\"edit-image-size\"\n [params]=\"sizeParams()\"\n />\n <div\n #stage\n class=\"image-editor__stage\"\n [style.aspect-ratio]=\"aspect()\"\n [style.--m-image-editor-aspect]=\"aspect()\"\n [class.image-editor__stage--panning]=\"isPanning()\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n (wheel)=\"onWheel($event)\"\n >\n @if (sourceUrl(); as url) {\n <img\n class=\"image-editor__image\"\n [src]=\"url\"\n alt=\"\"\n draggable=\"false\"\n [style.width.px]=\"imageBox().width\"\n [style.height.px]=\"imageBox().height\"\n [style.transform]=\"imageBox().transform\"\n />\n }\n </div>\n <m-range\n [config]=\"zoomConfig()\"\n [value]=\"zoomPercent()\"\n (valueChange)=\"onZoom($event)\"\n />\n <!-- asset: buttons/okay.yml. No cancel beside it: the Modal's own close\n is the cancel, and it drops the image the same way. -->\n <m-one-button\n name=\"okay\"\n label=\"apply\"\n [disabled]=\"!source() || isApplying()\"\n (clicked)=\"apply()\"\n />\n </div>\n `,\n imports: [ButtonComponent, HeaderComponent, RangeInputComponent],\n styleUrl: './image-editor.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ImageEditorComponent {\n readonly file = input.required<File>();\n readonly ratio = input.required<string>();\n readonly width = input.required<number>();\n\n readonly #modalRef = inject<ModalRef<ImageEditorResult | undefined>>(MODAL_REF);\n private readonly stage = viewChild<ElementRef<HTMLDivElement>>('stage');\n\n protected readonly source = signal<ImageBitmap | undefined>(undefined);\n protected readonly sourceUrl = signal<string | undefined>(undefined);\n protected readonly isApplying = signal(false);\n private readonly framing = signal<Framing>({ cx: 0, cy: 0, zoom: MIN_ZOOM });\n private readonly stageWidth = signal(0);\n private readonly pointers = new Map<number, Point>();\n protected readonly isPanning = signal(false);\n #settled = false;\n\n protected readonly zoomConfig = computed<RangeInput>(() => ({\n name: 'zoom',\n label: 'zoom',\n type: InputType.RANGE,\n min: MIN_ZOOM * 100,\n max: MAX_ZOOM * 100,\n }));\n\n protected readonly aspect = computed(() => parseRatio(this.ratio()) ?? 1);\n\n private readonly output = computed<FrameSize | undefined>(() =>\n outputSize(this.ratio(), this.width())\n );\n\n protected readonly sizeParams = computed(() => {\n const size = this.output();\n return {\n width: String(size?.width ?? ''),\n height: String(size?.height ?? ''),\n };\n });\n\n private readonly imageSize = computed<FrameSize | undefined>(() => {\n const bitmap = this.source();\n return bitmap ? { width: bitmap.width, height: bitmap.height } : undefined;\n });\n\n protected readonly zoomPercent = computed(() =>\n String(Math.round(this.framing().zoom * 100))\n );\n\n /** The whole picture laid out so the box shows exactly the crop. */\n protected readonly imageBox = computed(() => {\n const image = this.imageSize();\n const stage = this.stageWidth();\n if (!image || !stage) return { width: 0, height: 0, transform: 'none' };\n const rect = cropRect(image, this.aspect(), this.framing());\n const scale = stage / rect.width;\n return {\n width: image.width * scale,\n height: image.height * scale,\n transform: `translate(${-rect.x * scale}px, ${-rect.y * scale}px)`,\n };\n });\n\n private readonly load = effect((onCleanup) => {\n const file = this.file();\n let cancelled = false;\n const url = URL.createObjectURL(file);\n this.sourceUrl.set(url);\n // EXIF orientation applied here, so the geometry below and the <img> the\n // stage draws agree on which way is up.\n createImageBitmap(file, { imageOrientation: 'from-image' })\n .then((bitmap) => {\n if (cancelled) {\n bitmap.close();\n return;\n }\n this.framing.set(\n initialFraming({ width: bitmap.width, height: bitmap.height })\n );\n this.source.set(bitmap);\n })\n .catch(() => {\n if (!cancelled) this.settle({ unreadable: true });\n });\n onCleanup(() => {\n cancelled = true;\n URL.revokeObjectURL(url);\n this.source()?.close();\n });\n });\n\n private readonly measure = effect((onCleanup) => {\n const stage = this.stage()?.nativeElement;\n if (!stage) return;\n this.stageWidth.set(stage.clientWidth);\n if (typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(([entry]) =>\n this.stageWidth.set(entry.contentRect.width)\n );\n observer.observe(stage);\n onCleanup(() => observer.disconnect());\n });\n\n // The Modal's own close affordance destroys the body without a word, and a\n // dismissal is a cancel: whoever opened the editor is still waiting.\n private readonly reportDismissal = inject(DestroyRef).onDestroy(() =>\n this.settle(undefined)\n );\n\n protected onPointerDown = (event: PointerEvent): void => {\n if (!this.source()) return;\n (event.currentTarget as HTMLElement).setPointerCapture?.(event.pointerId);\n this.pointers.set(event.pointerId, { x: event.clientX, y: event.clientY });\n this.isPanning.set(true);\n };\n\n protected onPointerMove = (event: PointerEvent): void => {\n const previous = this.pointers.get(event.pointerId);\n if (!previous) return;\n const next = { x: event.clientX, y: event.clientY };\n const others = [...this.pointers.entries()].filter(\n ([id]) => id !== event.pointerId\n );\n if (others.length === 1) {\n // Pinch: the gap between two fingers is the zoom.\n const anchor = others[0][1];\n const before = distance(previous, anchor);\n if (before > 0) this.zoomBy(distance(next, anchor) / before);\n } else if (others.length === 0) {\n this.panBy(next.x - previous.x, next.y - previous.y);\n }\n this.pointers.set(event.pointerId, next);\n };\n\n protected onPointerUp = (event: PointerEvent): void => {\n this.pointers.delete(event.pointerId);\n this.isPanning.set(this.pointers.size > 0);\n };\n\n protected onWheel = (event: WheelEvent): void => {\n if (!this.source()) return;\n event.preventDefault();\n this.zoomBy(Math.exp(-event.deltaY * WHEEL_ZOOM_RATE));\n };\n\n protected onZoom = (percent: string): void => {\n const zoom = Number(percent) / 100;\n if (!Number.isFinite(zoom)) return;\n this.updateFraming((framing) => ({ ...framing, zoom }));\n };\n\n protected apply = async (): Promise<void> => {\n const bitmap = this.source();\n const image = this.imageSize();\n const output = this.output();\n if (!bitmap || !image || !output || this.isApplying()) return;\n this.isApplying.set(true);\n try {\n const rect = cropRect(image, this.aspect(), this.framing());\n const blob = await encodeFramed(drawFramed(bitmap, rect, output));\n const original = this.file();\n this.settle({\n file: new File([blob], renameForType(original.name, blob.type), {\n type: blob.type,\n lastModified: Date.now(),\n }),\n });\n } catch {\n this.settle({ unreadable: true });\n }\n };\n\n /** Screen pixels dragged, moved into source pixels at the current scale. */\n private panBy = (dx: number, dy: number): void => {\n const image = this.imageSize();\n const stage = this.stageWidth();\n if (!image || !stage) return;\n const rect = cropRect(image, this.aspect(), this.framing());\n const perPixel = rect.width / stage;\n this.updateFraming((framing) => ({\n ...framing,\n cx: framing.cx - dx * perPixel,\n cy: framing.cy - dy * perPixel,\n }));\n };\n\n private zoomBy = (factor: number): void => {\n this.updateFraming((framing) => ({\n ...framing,\n zoom: framing.zoom * factor,\n }));\n };\n\n private updateFraming = (change: (framing: Framing) => Framing): void => {\n const image = this.imageSize();\n if (!image) return;\n this.framing.update((framing) =>\n clampFraming(image, this.aspect(), change(framing))\n );\n };\n\n private settle = (result: ImageEditorResult | undefined): void => {\n if (this.#settled) return;\n this.#settled = true;\n this.#modalRef.close(result);\n };\n}\n"],"mappings":";;;;;;;;AAyCA,MAAM,kBAAkB;AAExB,MAAM,YAAY,GAAU,MAC1B,KAAK,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AAsDjC,IAAa,uBAAb,MAAa,qBAAoB;CACtB,OAAO,MAAM,SAAgB,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC7B,QAAQ,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,QAAQ,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAEhC,YAAY,OAAgD,SAAS;CAC7D,QAAQ,UAAsC,SAAQ,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAEpD,SAAS,OAAgC,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;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A;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,SAAO,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"magmonium-one-input-DqHPorA1.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/model/input.ts"],"sourcesContent":["import { Signal } from '@angular/core';\nimport { Config } from '../../../type/config/config-type';\n\nexport enum InputType {\n TEXT = 'text',\n PASSWORD = 'password',\n OTP = 'one-time-password',\n EMAIL = 'email',\n NUMBER = 'number',\n PHONE = 'phone',\n DATE = 'date',\n TIME = 'time',\n DATETIME = 'datetime',\n CHECKBOX = 'checkbox',\n CHECKBOX_GROUP = 'checkbox_group',\n RADIO = 'radio',\n RADIO_GROUP = 'radio_group',\n DROPDOWN = 'dropdown',\n MULTISELECT = 'multiselect',\n TEXTAREA = 'textarea',\n FILE = 'file',\n FOLDER = 'folder',\n RANGE = 'range',\n MULTI_RANGE = 'multi_range',\n TOGGLE = 'toggle',\n DATA_TOGGLE = 'data_toggle',\n TOGGLE_RADIO = 'toggle_radio',\n SEARCH = 'search',\n URL = 'url',\n COLOR = 'color',\n MONTH = 'month',\n WEEK = 'week',\n MONEY = 'money',\n AUTOFILL = 'autofill',\n SELECTABLE_CARD = 'selectable_card',\n RATING = 'rating',\n COMPONENT = 'component',\n}\n\n/**\n * One shape a typed value may take, inlined into a Field's compiled config by\n * `FieldCompiler` from `mag_assets/patterns/<name>.yml` (libs/one ADR 0017).\n * The name does not survive into the browser as a lookup — it rides along so a\n * failing rule can be named in a devtools inspection and so the editor can read\n * back what a Field points at.\n *\n * `expression` arrives anchored (`^(?:…)$`); the asset stores it unanchored.\n * `.test()` matches anywhere in a value, so an unanchored `[0-9]{4}` would pass\n * `abc1234xyz` — and under `any` semantics an unanchored `email` would pass a\n * whole sentence that merely contains an address.\n */\nexport type PatternRule = {\n name: string;\n /** Already wrapped `^(?:…)$` by the compiler — used verbatim. */\n expression: string;\n /** Narrowed to `i` at author time: `g` carries `lastIndex` between\n * `.test()` calls, and `m` reverses what the anchors just established. */\n flags?: string;\n /** i18n key shown when this rule is the only one a Field declares. */\n message: string;\n};\n\nexport type Input = Config & {\n type: InputType;\n label: string;\n required?: true;\n /**\n * Accepted shapes, any one of which passes (libs/one ADR 0017). Authored as\n * `patterns: [<name>, ...]` naming PatternAssets; what reaches the browser is\n * the resolved rules. Asset-only — a list cannot ride on the tag (ADR 0010).\n */\n patterns?: PatternRule[];\n /**\n * Shown when several `patterns` are declared and the value matches none.\n * Required in that case, because no one shape's own complaint is true when\n * the value could have taken another. Ignored for a single pattern, which\n * speaks for itself.\n */\n patternMessage?: string;\n icon?: string;\n one?: boolean;\n /**\n * The [MessageVariable] values this Field's `label`, `placeholder` and\n * validation messages are resolved with. One record for the Field rather\n * than one per text: they are the same sentence's slots, and a page holds\n * one record for every dynamic value it draws (m-one-ui ADR 0066).\n *\n * A Record, so it never rides as a literal attribute (ADR 0010) — a Field\n * with dynamic slots takes it bound, off the page member holding them.\n */\n params?: Record<string, string>;\n placeholder?: string;\n button?: string;\n buttonAction?: string;\n /**\n * Same rule grammar as `acl`, applied to the button beside the field rather\n * than to the field itself: unmatched leaves it disabled instead of hiding it.\n * A button that appears and disappears as the field's value changes reads as\n * the layout breaking; one that greys out reads as a step not reached yet.\n */\n buttonAcl?: string;\n disabled?: boolean;\n readonly?: boolean;\n maxWidth?: number;\n prefix?: string;\n suffix?: string;\n status?: \"idle\" | \"checking\" | \"available\" | \"taken\" | \"invalid\";\n /** Rule string like `.fieldName==targetValue` or custom resolver evaluated by FormGroup/WrapperInput */\n acl?: string;\n /** Explicit `data-testid` override. Defaults to `<name>-input` when unset. */\n testid?: string;\n};\n\nexport type TextInput = Input & {\n type: InputType.TEXT;\n};\n\n/**\n * A figure rather than text: the same `<input>` TextInputComponent draws, typed\n * `number` so the browser rejects letters and the field emits a number instead\n * of the digits typed into it. `min`/`max`/`step` ride onto the element — a\n * Field declaring `min: 1` means one is the smallest figure, not a hint.\n */\nexport type NumberInput = Input & {\n type: InputType.NUMBER;\n min?: number;\n max?: number;\n step?: number;\n};\n\nexport type PasswordInput = Input & {\n type: InputType.PASSWORD;\n};\n\nexport type OtpInput = Input & {\n type: InputType.OTP;\n length: number;\n};\n\nexport type ToggleInput = Input & {\n type: InputType.TOGGLE;\n};\n\nexport type ToggleRadioInput = Input & {\n type: InputType.TOGGLE_RADIO;\n options?: string[];\n configs?: RadioInput[];\n equalWidth?: boolean;\n vertical?: boolean;\n iconOnly?: boolean;\n};\n\nexport type RadioInput = Input & {\n type: InputType.RADIO;\n value: boolean;\n id: string;\n};\n\nexport type RadioGroupInput = Input & {\n type: InputType.RADIO_GROUP;\n options?: string[];\n configs?: RadioInput[];\n vertical?: boolean;\n};\n\n/**\n * Draws one checkbox per option and holds every option picked, in option\n * order. Its options never come from an asset (libs/one ADR 0039): they are\n * bound through the host's `options` input, or placed as `m-checkbox`\n * children of a SectionFormItem.\n */\nexport type CheckboxGroupInput = Input & {\n type: InputType.CHECKBOX_GROUP;\n vertical?: boolean;\n /** Name of a `mag_assets/options/<name>.yml` asset, read when no options are bound or placed. */\n optionsAsset?: string;\n};\n\nexport type DateInput = Input & {\n type: InputType.DATE;\n dateFormat?: string;\n minDate?: Date;\n maxDate?: Date;\n disabledDates?: Date[];\n};\n\nexport type TextareaInput = Input & {\n type: InputType.TEXTAREA;\n /**\n * Off for a field holding something the dictionary has no opinion about —\n * markdown, a code block, an id. Absent everywhere else, which leaves the\n * browser's own default.\n */\n spellcheck?: boolean;\n /**\n * Grows with what is typed instead of holding one height and scrolling.\n * `--m-textarea-input-height` is then the floor it starts at and\n * `--m-textarea-input-max-height` the ceiling it scrolls after. Opt-in: a\n * Field in a form row keeps its one height so the row beside it does not\n * move as somebody types.\n */\n autoGrow?: boolean;\n};\n\n/** What one option of a Dropdown or Multiselect holds. */\nexport type DropdownValue = string | number;\n\n/**\n * One choice. `V` narrows what `value` holds; it defaults to `string`, which is\n * what every OptionSet and option asset writes.\n */\nexport type DropdownOption<V extends DropdownValue = string> = {\n value: V;\n label: string;\n /** Icon name, used by the Fields that render an option as a card. */\n icon?: string;\n disabled?: boolean;\n /**\n * The row a Field starts on when it holds no value of its own. One per list;\n * the Field's own value outranks it (`presetDefaultOption`).\n */\n default?: boolean;\n /**\n * Authored text rather than an i18n key. A key is looked up by splitting on\n * `.`, so a path like `order.name` would resolve to the `order` key and\n * render that instead — the same reason a Button carries this flag.\n */\n noTranslate?: boolean;\n /**\n * How many headers the row sits beneath, drawn as one indent each — a\n * sub-section's header and its rows under the section that holds them.\n * Absent is flush, as every flat list already is.\n */\n depth?: number;\n};\n\n/**\n * A `dropdown` holds one value, a `multiselect` a list of them — two Fields\n * over the same options config, never one Field switched by a flag.\n */\nexport type DropdownInput = Input & {\n type: InputType.DROPDOWN | InputType.MULTISELECT;\n options?:\n | DropdownOption<DropdownValue>[]\n | Signal<DropdownOption<DropdownValue>[]>;\n /** Name of a `mag_assets/options/<name>.yml` asset to load options from at runtime. */\n optionsAsset?: string;\n};\n\nexport type ColorInput = Input & {\n type: InputType.COLOR;\n};\n\nexport type RangeInput = Input & {\n type: InputType.RANGE;\n min?: number;\n max?: number;\n step?: number;\n};\n\nexport type MultiRangeInput = Input & {\n type: InputType.MULTI_RANGE;\n min?: number;\n max?: number;\n step?: number;\n};\n\nexport type InputValue =\n | boolean\n | string\n | number\n | string[]\n | File\n | File[]\n | undefined;\n\nexport type InputState = {\n focused?: true;\n touched?: true;\n};\n\nexport type SelectableCardItem = {\n id: string;\n disabled?: boolean;\n inputs?: Record<string, unknown>;\n // What this card was mapped from. Carried for an inline card body, which\n // reads the row itself rather than the item wrapped around it — `inputs` is\n // the component seat's half of the same thing, and a template has no inputs\n // to fill.\n row?: unknown;\n};\n\n/**\n * What an inline card body reads. The same three facts a card component is\n * handed through `inputs` — the row, whether it is picked, whether it is\n * inert — plus the `@for` positions a template can use and a component seat\n * cannot see. `$implicit` is the item, so `let-item` alone reaches the row.\n */\nexport type SelectableCardContext = {\n $implicit: SelectableCardItem;\n item: SelectableCardItem;\n // The item's own `row`, lifted so a body reads what it was mapped from\n // without walking the wrapper.\n row: unknown;\n selected: boolean;\n disabled: boolean;\n index: number;\n first: boolean;\n last: boolean;\n};\n\nexport type SelectableCardInput = Input & {\n type: InputType.SELECTABLE_CARD;\n multiSelect?: boolean;\n isCheckboxVisible?: boolean;\n vertical?: boolean;\n variant?: string;\n /**\n * Static cards, named the same way a Dropdown names its choices so one\n * options asset serves both. Each option's `value` becomes the card's id and\n * its `label` the card's body — only used when no card component is bound.\n */\n options?: DropdownOption[] | Signal<DropdownOption[]>;\n optionsAsset?: string;\n};\n\nexport type RatingInput = Input & {\n type: InputType.RATING;\n /**\n * Fill of the selected stars: a theme colour key (`mm`, `success`, …) or a\n * raw CSS colour, resolved against the active theme. Unset keeps the gold.\n */\n color?: string;\n /** Draws the stars at twice their size; label and errors stay as they are. */\n enlarge?: boolean;\n};\n\nexport type SearchInput = Input & {\n type: InputType.SEARCH;\n searchLabel?: string;\n debounce?: number;\n};\n"],"mappings":"AAGA,IAAY;CAAZ,SAAY,WAAS;CACnB,UAAA,UAAA;CACA,UAAA,cAAA;CACA,UAAA,SAAA;CACA,UAAA,WAAA;CACA,UAAA,YAAA;CACA,UAAA,WAAA;CACA,UAAA,UAAA;CACA,UAAA,UAAA;CACA,UAAA,cAAA;CACA,UAAA,cAAA;CACA,UAAA,oBAAA;CACA,UAAA,WAAA;CACA,UAAA,iBAAA;CACA,UAAA,cAAA;CACA,UAAA,iBAAA;CACA,UAAA,cAAA;CACA,UAAA,UAAA;CACA,UAAA,YAAA;CACA,UAAA,WAAA;CACA,UAAA,iBAAA;CACA,UAAA,YAAA;CACA,UAAA,iBAAA;CACA,UAAA,kBAAA;CACA,UAAA,YAAA;CACA,UAAA,SAAA;CACA,UAAA,WAAA;CACA,UAAA,WAAA;CACA,UAAA,UAAA;CACA,UAAA,WAAA;CACA,UAAA,cAAA;CACA,UAAA,qBAAA;CACA,UAAA,YAAA;CACA,UAAA,eAAA;AACF,EAAA,CAlCY,cAAA,YAAS,CAAA,EAAA"}
|
|
1
|
+
{"version":3,"file":"magmonium-one-input-DqHPorA1.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/model/input.ts"],"sourcesContent":["import { Signal } from '@angular/core';\nimport { Config } from '../../../type/config/config-type';\n\nexport enum InputType {\n TEXT = 'text',\n PASSWORD = 'password',\n OTP = 'one-time-password',\n EMAIL = 'email',\n NUMBER = 'number',\n PHONE = 'phone',\n DATE = 'date',\n TIME = 'time',\n DATETIME = 'datetime',\n CHECKBOX = 'checkbox',\n CHECKBOX_GROUP = 'checkbox_group',\n RADIO = 'radio',\n RADIO_GROUP = 'radio_group',\n DROPDOWN = 'dropdown',\n MULTISELECT = 'multiselect',\n TEXTAREA = 'textarea',\n FILE = 'file',\n FOLDER = 'folder',\n RANGE = 'range',\n MULTI_RANGE = 'multi_range',\n TOGGLE = 'toggle',\n DATA_TOGGLE = 'data_toggle',\n TOGGLE_RADIO = 'toggle_radio',\n SEARCH = 'search',\n URL = 'url',\n COLOR = 'color',\n MONTH = 'month',\n WEEK = 'week',\n MONEY = 'money',\n AUTOFILL = 'autofill',\n SELECTABLE_CARD = 'selectable_card',\n RATING = 'rating',\n COMPONENT = 'component',\n}\n\n/**\n * One shape a typed value may take, inlined into a Field's compiled config by\n * `FieldCompiler` from `mag_assets/patterns/<name>.yml` (libs/one ADR 0017).\n * The name does not survive into the browser as a lookup — it rides along so a\n * failing rule can be named in a devtools inspection and so the editor can read\n * back what a Field points at.\n *\n * `expression` arrives anchored (`^(?:…)$`); the asset stores it unanchored.\n * `.test()` matches anywhere in a value, so an unanchored `[0-9]{4}` would pass\n * `abc1234xyz` — and under `any` semantics an unanchored `email` would pass a\n * whole sentence that merely contains an address.\n */\nexport type PatternRule = {\n name: string;\n /** Already wrapped `^(?:…)$` by the compiler — used verbatim. */\n expression: string;\n /** Narrowed to `i` at author time: `g` carries `lastIndex` between\n * `.test()` calls, and `m` reverses what the anchors just established. */\n flags?: string;\n /** i18n key shown when this rule is the only one a Field declares. */\n message: string;\n};\n\nexport type Input = Config & {\n type: InputType;\n label: string;\n /**\n * The label is authored text, not an i18n key: a control or option name the\n * dictionary has never heard of (`Look strength`, `Zoom`). `m-label` draws it\n * verbatim instead of resolving it. Set it where the words are ours to write\n * and no asset exists yet — a control name that reads as English is better\n * than a key that reads as nothing.\n */\n noTranslate?: boolean;\n required?: true;\n /**\n * Accepted shapes, any one of which passes (libs/one ADR 0017). Authored as\n * `patterns: [<name>, ...]` naming PatternAssets; what reaches the browser is\n * the resolved rules. Asset-only — a list cannot ride on the tag (ADR 0010).\n */\n patterns?: PatternRule[];\n /**\n * Shown when several `patterns` are declared and the value matches none.\n * Required in that case, because no one shape's own complaint is true when\n * the value could have taken another. Ignored for a single pattern, which\n * speaks for itself.\n */\n patternMessage?: string;\n icon?: string;\n one?: boolean;\n /**\n * The [MessageVariable] values this Field's `label`, `placeholder` and\n * validation messages are resolved with. One record for the Field rather\n * than one per text: they are the same sentence's slots, and a page holds\n * one record for every dynamic value it draws (m-one-ui ADR 0066).\n *\n * A Record, so it never rides as a literal attribute (ADR 0010) — a Field\n * with dynamic slots takes it bound, off the page member holding them.\n */\n params?: Record<string, string>;\n placeholder?: string;\n button?: string;\n buttonAction?: string;\n /**\n * Same rule grammar as `acl`, applied to the button beside the field rather\n * than to the field itself: unmatched leaves it disabled instead of hiding it.\n * A button that appears and disappears as the field's value changes reads as\n * the layout breaking; one that greys out reads as a step not reached yet.\n */\n buttonAcl?: string;\n disabled?: boolean;\n readonly?: boolean;\n maxWidth?: number;\n prefix?: string;\n suffix?: string;\n status?: \"idle\" | \"checking\" | \"available\" | \"taken\" | \"invalid\";\n /** Rule string like `.fieldName==targetValue` or custom resolver evaluated by FormGroup/WrapperInput */\n acl?: string;\n /** Explicit `data-testid` override. Defaults to `<name>-input` when unset. */\n testid?: string;\n};\n\nexport type TextInput = Input & {\n type: InputType.TEXT;\n};\n\n/**\n * A figure rather than text: the same `<input>` TextInputComponent draws, typed\n * `number` so the browser rejects letters and the field emits a number instead\n * of the digits typed into it. `min`/`max`/`step` ride onto the element — a\n * Field declaring `min: 1` means one is the smallest figure, not a hint.\n */\nexport type NumberInput = Input & {\n type: InputType.NUMBER;\n min?: number;\n max?: number;\n step?: number;\n};\n\nexport type PasswordInput = Input & {\n type: InputType.PASSWORD;\n};\n\nexport type OtpInput = Input & {\n type: InputType.OTP;\n length: number;\n};\n\nexport type ToggleInput = Input & {\n type: InputType.TOGGLE;\n};\n\nexport type ToggleRadioInput = Input & {\n type: InputType.TOGGLE_RADIO;\n options?: string[];\n configs?: RadioInput[];\n equalWidth?: boolean;\n vertical?: boolean;\n iconOnly?: boolean;\n};\n\nexport type RadioInput = Input & {\n type: InputType.RADIO;\n value: boolean;\n id: string;\n};\n\nexport type RadioGroupInput = Input & {\n type: InputType.RADIO_GROUP;\n options?: string[];\n configs?: RadioInput[];\n vertical?: boolean;\n};\n\n/**\n * Draws one checkbox per option and holds every option picked, in option\n * order. Its options never come from an asset (libs/one ADR 0039): they are\n * bound through the host's `options` input, or placed as `m-checkbox`\n * children of a SectionFormItem.\n */\nexport type CheckboxGroupInput = Input & {\n type: InputType.CHECKBOX_GROUP;\n vertical?: boolean;\n /** Name of a `mag_assets/options/<name>.yml` asset, read when no options are bound or placed. */\n optionsAsset?: string;\n};\n\nexport type DateInput = Input & {\n type: InputType.DATE;\n dateFormat?: string;\n minDate?: Date;\n maxDate?: Date;\n disabledDates?: Date[];\n};\n\nexport type TextareaInput = Input & {\n type: InputType.TEXTAREA;\n /**\n * Off for a field holding something the dictionary has no opinion about —\n * markdown, a code block, an id. Absent everywhere else, which leaves the\n * browser's own default.\n */\n spellcheck?: boolean;\n /**\n * Grows with what is typed instead of holding one height and scrolling.\n * `--m-textarea-input-height` is then the floor it starts at and\n * `--m-textarea-input-max-height` the ceiling it scrolls after. Opt-in: a\n * Field in a form row keeps its one height so the row beside it does not\n * move as somebody types.\n */\n autoGrow?: boolean;\n};\n\n/** What one option of a Dropdown or Multiselect holds. */\nexport type DropdownValue = string | number;\n\n/**\n * One choice. `V` narrows what `value` holds; it defaults to `string`, which is\n * what every OptionSet and option asset writes.\n */\nexport type DropdownOption<V extends DropdownValue = string> = {\n value: V;\n label: string;\n /** Icon name, used by the Fields that render an option as a card. */\n icon?: string;\n disabled?: boolean;\n /**\n * The row a Field starts on when it holds no value of its own. One per list;\n * the Field's own value outranks it (`presetDefaultOption`).\n */\n default?: boolean;\n /**\n * Authored text rather than an i18n key. A key is looked up by splitting on\n * `.`, so a path like `order.name` would resolve to the `order` key and\n * render that instead — the same reason a Button carries this flag.\n */\n noTranslate?: boolean;\n /**\n * How many headers the row sits beneath, drawn as one indent each — a\n * sub-section's header and its rows under the section that holds them.\n * Absent is flush, as every flat list already is.\n */\n depth?: number;\n};\n\n/**\n * A `dropdown` holds one value, a `multiselect` a list of them — two Fields\n * over the same options config, never one Field switched by a flag.\n */\nexport type DropdownInput = Input & {\n type: InputType.DROPDOWN | InputType.MULTISELECT;\n options?:\n | DropdownOption<DropdownValue>[]\n | Signal<DropdownOption<DropdownValue>[]>;\n /** Name of a `mag_assets/options/<name>.yml` asset to load options from at runtime. */\n optionsAsset?: string;\n};\n\nexport type ColorInput = Input & {\n type: InputType.COLOR;\n // Offers the theme's tones beside the free picker, a pick storing the\n // ThemeColor key so the value follows the theme.\n themeKeys?: boolean;\n};\n\nexport type RangeInput = Input & {\n type: InputType.RANGE;\n min?: number;\n max?: number;\n step?: number;\n};\n\nexport type MultiRangeInput = Input & {\n type: InputType.MULTI_RANGE;\n min?: number;\n max?: number;\n step?: number;\n};\n\nexport type InputValue =\n | boolean\n | string\n | number\n | string[]\n | File\n | File[]\n | undefined;\n\nexport type InputState = {\n focused?: true;\n touched?: true;\n};\n\nexport type SelectableCardItem = {\n id: string;\n disabled?: boolean;\n inputs?: Record<string, unknown>;\n // What this card was mapped from. Carried for an inline card body, which\n // reads the row itself rather than the item wrapped around it — `inputs` is\n // the component seat's half of the same thing, and a template has no inputs\n // to fill.\n row?: unknown;\n};\n\n/**\n * What an inline card body reads. The same three facts a card component is\n * handed through `inputs` — the row, whether it is picked, whether it is\n * inert — plus the `@for` positions a template can use and a component seat\n * cannot see. `$implicit` is the item, so `let-item` alone reaches the row.\n */\nexport type SelectableCardContext = {\n $implicit: SelectableCardItem;\n item: SelectableCardItem;\n // The item's own `row`, lifted so a body reads what it was mapped from\n // without walking the wrapper.\n row: unknown;\n selected: boolean;\n disabled: boolean;\n index: number;\n first: boolean;\n last: boolean;\n};\n\nexport type SelectableCardInput = Input & {\n type: InputType.SELECTABLE_CARD;\n multiSelect?: boolean;\n isCheckboxVisible?: boolean;\n vertical?: boolean;\n variant?: string;\n /**\n * Static cards, named the same way a Dropdown names its choices so one\n * options asset serves both. Each option's `value` becomes the card's id and\n * its `label` the card's body — only used when no card component is bound.\n */\n options?: DropdownOption[] | Signal<DropdownOption[]>;\n optionsAsset?: string;\n};\n\nexport type RatingInput = Input & {\n type: InputType.RATING;\n /**\n * Fill of the selected stars: a theme colour key (`mm`, `success`, …) or a\n * raw CSS colour, resolved against the active theme. Unset keeps the gold.\n */\n color?: string;\n /** Draws the stars at twice their size; label and errors stay as they are. */\n enlarge?: boolean;\n};\n\nexport type SearchInput = Input & {\n type: InputType.SEARCH;\n searchLabel?: string;\n debounce?: number;\n};\n"],"mappings":"AAGA,IAAY;CAAZ,SAAY,WAAS;CACnB,UAAA,UAAA;CACA,UAAA,cAAA;CACA,UAAA,SAAA;CACA,UAAA,WAAA;CACA,UAAA,YAAA;CACA,UAAA,WAAA;CACA,UAAA,UAAA;CACA,UAAA,UAAA;CACA,UAAA,cAAA;CACA,UAAA,cAAA;CACA,UAAA,oBAAA;CACA,UAAA,WAAA;CACA,UAAA,iBAAA;CACA,UAAA,cAAA;CACA,UAAA,iBAAA;CACA,UAAA,cAAA;CACA,UAAA,UAAA;CACA,UAAA,YAAA;CACA,UAAA,WAAA;CACA,UAAA,iBAAA;CACA,UAAA,YAAA;CACA,UAAA,iBAAA;CACA,UAAA,kBAAA;CACA,UAAA,YAAA;CACA,UAAA,SAAA;CACA,UAAA,WAAA;CACA,UAAA,WAAA;CACA,UAAA,UAAA;CACA,UAAA,WAAA;CACA,UAAA,cAAA;CACA,UAAA,qBAAA;CACA,UAAA,YAAA;CACA,UAAA,eAAA;AACF,EAAA,CAlCY,cAAA,YAAS,CAAA,EAAA"}
|
|
@@ -319,6 +319,16 @@ const nextSectionTableSort = (current, id, dataType) => current?.id === id ? {
|
|
|
319
319
|
dataType,
|
|
320
320
|
direction: "asc"
|
|
321
321
|
};
|
|
322
|
+
const defaultSectionTableSort = (columns) => {
|
|
323
|
+
const index = columns.findIndex((column) => column.defaultSort);
|
|
324
|
+
if (index < 0) return null;
|
|
325
|
+
const column = columns[index];
|
|
326
|
+
return {
|
|
327
|
+
id: sectionTableColumnId(column, index),
|
|
328
|
+
dataType: column.dataType,
|
|
329
|
+
direction: column.ascending ? "asc" : "desc"
|
|
330
|
+
};
|
|
331
|
+
};
|
|
322
332
|
const readPath = (row, path) => path.split(".").reduce((value, key) => value != null && typeof value === "object" ? value[key] : void 0, row);
|
|
323
333
|
const comparable = (value, dataType) => {
|
|
324
334
|
if (value == null || value === "") return void 0;
|
|
@@ -569,6 +579,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
569
579
|
}]
|
|
570
580
|
}
|
|
571
581
|
});
|
|
572
|
-
export {
|
|
582
|
+
export { sectionTableColumnId as a, sortSectionTableRows as c, PercentagePipe as d, MoneyPipe as f, nextSectionTableSort as i, AssetUrlPipe as l, SectionTableSortPipe as n, sectionTableColumnWidths as o, TimeAgoPipe as p, defaultSectionTableSort as r, sectionTableFrozenCount as s, LabelComponent as t, CompactNumberPipe as u };
|
|
573
583
|
|
|
574
|
-
//# sourceMappingURL=magmonium-one-label-
|
|
584
|
+
//# sourceMappingURL=magmonium-one-label-B8WJHiU4.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"magmonium-one-label-B8WJHiU4.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/pipe/time-ago.ts","../../../../libs/one/src/lib/shared/pipe/money.fn.ts","../../../../libs/one/src/lib/shared/pipe/money.ts","../../../../libs/one/src/lib/shared/pipe/percentage.ts","../../../../libs/one/src/lib/shared/pipe/compact-number.ts","../../../../libs/one/src/lib/shared/pipe/asset-url.ts","../../../../libs/one/src/lib/shared/ui/section/lib/functions/section-table.ts","../../../../libs/one/src/lib/shared/pipe/section-table-sort.ts","../../../../libs/one/src/lib/shared/ui/input/ui/label.ts"],"sourcesContent":["import { ChangeDetectorRef, inject, OnDestroy, Pipe, PipeTransform } from '@angular/core';\nimport { TranslateService } from '../services/translate';\nimport { interval, Subscription } from 'rxjs';\n\nconst SECONDS_IN_MINUTE = 60;\nconst SECONDS_IN_HOUR = 3600;\nconst SECONDS_IN_DAY = 86400;\nconst SECONDS_IN_MONTH = 2592000;\nconst SECONDS_IN_YEAR = 31536000;\n\n@Pipe({\n name: 'timeAgo',\n pure: false,\n})\nexport class TimeAgoPipe implements PipeTransform, OnDestroy {\n private readonly translateService = inject(TranslateService);\n private readonly cdr = inject(ChangeDetectorRef);\n private timerSubscription: Subscription | null = null;\n private lastValue: string | Date | undefined = undefined;\n\n transform(value: string | Date | undefined): string {\n if (!value) return '';\n\n if (value !== this.lastValue) {\n this.lastValue = value;\n this.setupTimer();\n }\n\n const date = typeof value === 'string' ? new Date(value) : value;\n const now = new Date();\n const seconds = Math.floor((now.getTime() - date.getTime()) / 1000);\n\n if (seconds < SECONDS_IN_MINUTE) {\n return this.translateService.translate('just-now');\n }\n\n let count: number;\n let unit: string;\n\n if (seconds < SECONDS_IN_HOUR) {\n count = Math.floor(seconds / SECONDS_IN_MINUTE);\n unit = count === 1 ? 'minute' : 'minutes';\n } else if (seconds < SECONDS_IN_DAY) {\n count = Math.floor(seconds / SECONDS_IN_HOUR);\n unit = count === 1 ? 'hour' : 'hours';\n } else if (seconds < SECONDS_IN_MONTH) {\n count = Math.floor(seconds / SECONDS_IN_DAY);\n unit = count === 1 ? 'day' : 'days';\n } else if (seconds < SECONDS_IN_YEAR) {\n count = Math.floor(seconds / SECONDS_IN_MONTH);\n unit = count === 1 ? 'month' : 'months';\n } else {\n count = Math.floor(seconds / SECONDS_IN_YEAR);\n unit = count === 1 ? 'year' : 'years';\n }\n\n return this.translateService.translate(\n `time-ago?count=${count}&unit=${unit}`\n );\n }\n\n private setupTimer(): void {\n this.clearTimer();\n // Update every 30 seconds to keep the display fresh without overloading change detection.\n this.timerSubscription = interval(30000).subscribe(() => {\n this.cdr.detectChanges();\n });\n }\n\n private clearTimer(): void {\n if (this.timerSubscription) {\n this.timerSubscription.unsubscribe();\n this.timerSubscription = null;\n }\n }\n\n ngOnDestroy(): void {\n this.clearTimer();\n }\n}\n","export type MoneySystem = 'IN' | 'INTL';\n\nexport interface MoneyResult {\n amount: string;\n labelKey: string;\n}\n\ninterface Threshold {\n min: number;\n labelKey: string;\n overflowAt: number;\n}\n\nconst IN_THRESHOLDS: Threshold[] = [\n { min: 1_00_00_000, labelKey: 'cr', overflowAt: Infinity },\n { min: 1_00_000, labelKey: 'l', overflowAt: 100 },\n { min: 1_000, labelKey: 'k', overflowAt: 100 },\n];\n\nconst INTL_THRESHOLDS: Threshold[] = [\n { min: 1_000_000_000_000, labelKey: 't', overflowAt: Infinity },\n { min: 1_000_000_000, labelKey: 'b', overflowAt: 1_000 },\n { min: 1_000_000, labelKey: 'm', overflowAt: 1_000 },\n { min: 1_000, labelKey: 'k', overflowAt: 1_000 },\n];\n\n/**\n * Formats a non-negative finite number into a compact denomination result.\n * @param value Must be a non-negative finite number. Negative values and NaN\n * should be handled by the caller before invoking this function.\n */\nexport const formatMoney = (\n value: number,\n system: MoneySystem\n): MoneyResult => {\n const thresholds = system === 'IN' ? IN_THRESHOLDS : INTL_THRESHOLDS;\n\n for (let i = 0; i < thresholds.length; i++) {\n const { min, labelKey, overflowAt } = thresholds[i];\n if (value >= min) {\n const rounded = parseFloat((value / min).toFixed(1));\n if (rounded >= overflowAt && i > 0) {\n const higher = thresholds[i - 1];\n return {\n amount: parseFloat((value / higher.min).toFixed(1)).toString(),\n labelKey: higher.labelKey,\n };\n }\n return { amount: rounded.toString(), labelKey };\n }\n }\n\n return { amount: parseFloat(value.toFixed(2)).toString(), labelKey: '' };\n};\n","import { inject, Pipe, PipeTransform } from '@angular/core';\nimport { TranslateService } from '../services/translate';\nimport { formatMoney, MoneySystem } from './money.fn';\n\n@Pipe({\n name: 'money',\n pure: false,\n})\nexport class MoneyPipe implements PipeTransform {\n private readonly translateService = inject(TranslateService);\n\n transform(\n value: number | undefined | null,\n system: MoneySystem = 'IN',\n symbol = '₹',\n forceSign = false\n ): string {\n if (value == null || isNaN(value)) return '';\n if (value === 0) return `${symbol}0`;\n\n const isNegative = value < 0;\n const absValue = Math.abs(value);\n const { amount, labelKey } = formatMoney(absValue, system);\n const label = labelKey\n ? ` ${this.translateService.translate(labelKey)}`\n : '';\n\n const sign = isNegative ? '-' : forceSign ? '+' : '';\n return `${sign}${symbol}${amount}${label}`;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n/**\n * Renders a number already expressed in percent units as a `%` reading —\n * `42` becomes `42.00%`, never `4200%`. A ratio is the caller's to multiply,\n * the way `MoneyPipe` takes an amount rather than a currency object.\n *\n * Two decimals by default: a percentage carries the fraction that separates\n * two near-equal readings, and a caller wanting the whole number asks for\n * `decimals: 0`.\n *\n * Pure, unlike the other three: it reads no language and no clock, so its\n * output depends on its arguments alone.\n */\n@Pipe({\n name: 'percentage',\n})\nexport class PercentagePipe implements PipeTransform {\n transform(\n value: number | undefined | null,\n decimals = 2,\n forceSign = false\n ): string {\n if (value == null || isNaN(value)) return '';\n\n const digits = Math.max(0, Math.trunc(decimals));\n const rendered = Math.abs(value).toFixed(digits);\n // A rounded-to-zero negative would otherwise print `-0%`.\n const isNegative = value < 0 && Number(rendered) !== 0;\n\n const sign = isNegative\n ? '-'\n : forceSign && Number(rendered) !== 0\n ? '+'\n : '';\n return `${sign}${rendered}%`;\n }\n}\n","import { inject, Pipe, PipeTransform } from '@angular/core';\nimport { TranslateService } from '../services/translate';\nimport { formatMoney, MoneySystem } from './money.fn';\n\n/**\n * Renders a large number as a compact denominated reading — `12500` becomes\n * `12.5 k`, `1250000` becomes `12.5 l` (or `1.3 m` on the `INTL` ladder).\n * `MoneyPipe` without the currency symbol: a count of views, rows or users is\n * no amount of money, but it climbs the same thresholds.\n *\n * Named `compactNumber` rather than `number` so it never collides with\n * Angular's own `DecimalPipe` in a template that imports both.\n *\n * Impure for `MoneyPipe`'s reason: the denomination label is a translation key\n * resolved in the active language.\n */\n@Pipe({\n name: 'compactNumber',\n pure: false,\n})\nexport class CompactNumberPipe implements PipeTransform {\n private readonly translateService = inject(TranslateService);\n\n transform(\n value: number | undefined | null,\n system: MoneySystem = 'IN',\n forceSign = false\n ): string {\n if (value == null || isNaN(value)) return '';\n if (value === 0) return '0';\n\n const { amount, labelKey } = formatMoney(Math.abs(value), system);\n // Below the first threshold a tiny value can still round to `0`.\n if (Number(amount) === 0) return '0';\n\n const label = labelKey\n ? ` ${this.translateService.translate(labelKey)}`\n : '';\n const sign = value < 0 ? '-' : forceSign ? '+' : '';\n return `${sign}${amount}${label}`;\n }\n}\n","import { inject, Pipe, PipeTransform } from '@angular/core';\nimport { HttpService } from '../services/http';\n\n@Pipe({\n name: 'assetUrl',\n})\nexport class AssetUrlPipe implements PipeTransform {\n private readonly http = inject(HttpService);\n\n transform(value: string | null | undefined): string {\n return this.http.getAssetUrl(value);\n }\n}\n","import {\n SectionTableColumn,\n SectionTableSort,\n} from '../../type/section-table';\n\n/** A column's id, falling back to its position (m-one-ui ADR 0148). */\nexport const sectionTableColumnId = (\n column: SectionTableColumn,\n index: number\n): string => column.id || String(index);\n\n/**\n * Each column's width as a CSS length: a `span` is its twelfth-share of the\n * table, and a column without one gets `undefined` so the `<table>` divides\n * what the spanned columns left.\n */\nexport const sectionTableColumnWidths = (\n columns: readonly SectionTableColumn[]\n): (string | undefined)[] =>\n columns.map(({ span }) => {\n if (span == null || !Number.isFinite(span)) return undefined;\n const clamped = Math.min(12, Math.max(1, Math.round(span)));\n return `${(clamped * 100) / 12}%`;\n });\n\n/**\n * How many leading columns are frozen: freezing a column freezes every column\n * before it, because a frozen column pinned past an unfrozen one would slide\n * over it.\n */\nexport const sectionTableFrozenCount = (\n columns: readonly SectionTableColumn[]\n): number => {\n let last = -1;\n columns.forEach((column, i) => {\n if (column.freeze) last = i;\n });\n return last + 1;\n};\n\n/** The next sort after a click on the column with `id`. */\nexport const nextSectionTableSort = (\n current: SectionTableSort | null,\n id: string,\n dataType: SectionTableSort['dataType']\n): SectionTableSort =>\n current?.id === id\n ? { id, dataType, direction: current.direction === 'asc' ? 'desc' : 'asc' }\n : { id, dataType, direction: 'asc' };\n\n/** The sort a table starts with: its first `defaultSort` column's, if any. */\nexport const defaultSectionTableSort = (\n columns: readonly SectionTableColumn[]\n): SectionTableSort | null => {\n const index = columns.findIndex((column) => column.defaultSort);\n if (index < 0) return null;\n const column = columns[index];\n return {\n id: sectionTableColumnId(column, index),\n dataType: column.dataType,\n direction: column.ascending ? 'asc' : 'desc',\n };\n};\n\nconst readPath =(row: unknown, path: string): unknown =>\n path\n .split('.')\n .reduce<unknown>(\n (value, key) =>\n value != null && typeof value === 'object'\n ? (value as Record<string, unknown>)[key]\n : undefined,\n row\n );\n\nconst comparable = (\n value: unknown,\n dataType: SectionTableSort['dataType']\n): number | string | undefined => {\n if (value == null || value === '') return undefined;\n if (dataType === 'number') {\n const n = typeof value === 'number' ? value : Number(value);\n return Number.isNaN(n) ? undefined : n;\n }\n if (dataType === 'date') {\n const t =\n value instanceof Date ? value.getTime() : new Date(String(value)).getTime();\n return Number.isNaN(t) ? undefined : t;\n }\n return String(value).toLocaleLowerCase();\n};\n\n/**\n * A copy of `rows` ordered by `sort`, the input untouched. Missing values sink\n * to the end in either direction — an empty cell is not the smallest value.\n */\nexport const sortSectionTableRows = <T>(\n rows: readonly T[] | null | undefined,\n sort: SectionTableSort | null | undefined\n): T[] => {\n const list = [...(rows ?? [])];\n if (!sort) return list;\n const sign = sort.direction === 'asc' ? 1 : -1;\n return list\n .map((row, i) => ({ row, i, key: comparable(readPath(row, sort.id), sort.dataType) }))\n .sort((a, b) => {\n if (a.key === undefined || b.key === undefined) {\n if (a.key === b.key) return a.i - b.i;\n return a.key === undefined ? 1 : -1;\n }\n const diff =\n typeof a.key === 'number' && typeof b.key === 'number'\n ? a.key - b.key\n : String(a.key).localeCompare(String(b.key));\n return diff === 0 ? a.i - b.i : diff * sign;\n })\n .map(({ row }) => row);\n};\n","import { Pipe, PipeTransform } from '@angular/core';\nimport type { SectionTableSort } from '../ui/section/type/section-table';\nimport { sortSectionTableRows } from '../ui/section/lib/functions/section-table';\n\n/**\n * A SectionTable's sort applied to a Repeat's collection:\n * `@for (row of (rows | sectionTableSort: table.sort()); …)`. The `@for` is the\n * Repeat's, not the table's, so the table reorders a collection it does not\n * own through this and nothing else (m-one-ui ADR 0148).\n *\n * Pure: a new order needs a new sort or a new collection, never a mutated one.\n */\n@Pipe({\n name: 'sectionTableSort',\n})\nexport class SectionTableSortPipe implements PipeTransform {\n transform<T>(\n rows: readonly T[] | null | undefined,\n sort: SectionTableSort | null | undefined\n ): T[] {\n return sortSectionTableRows(rows, sort);\n }\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { TranslatePipe } from '../../../pipe';\n\n@Component({\n selector: 'm-label',\n template: `\n <label\n [class.required]=\"required()\"\n [class.disabled]=\"disabled()\"\n [attr.for]=\"for() || null\"\n >\n @if (color()) {\n <span class=\"label__swatch\" [style.background]=\"color()\"></span>\n }\n @if (noTranslate()) {\n {{ placeholder() }}\n } @else {\n {{ placeholder() | translate: params() }}\n }\n </label>\n `,\n imports: [TranslatePipe],\n styleUrl: './label.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class LabelComponent {\n for = input<string>();\n placeholder = input<string>();\n // The label's [MessageVariable] values — a Field whose label is a sentence\n // with a datum in it (m-one-ui ADR 0066).\n params = input<Record<string, string> | undefined>();\n required = input<boolean>();\n disabled = input<boolean>();\n color = input<string>();\n // Authored text rather than an i18n key — an option label mapped from a row\n // the app holds, which the dictionary has never heard of.\n noTranslate = input<boolean>();\n}\n\n"],"mappings":";;;;AAIA,MAAM,oBAAoB;AAC1B,MAAM,kBAAkB;AACxB,MAAM,iBAAiB;AACvB,MAAM,mBAAmB;AACzB,MAAM,kBAAkB;AAMxB,IAAa,cAAb,MAAa,YAAW;CACL,mBAAmB,OAAO,gBAAgB;CAC1C,MAAM,OAAO,iBAAiB;CACvC,oBAAyC;CACzC,YAAuC;CAE/C,UAAU,OAAgC;EACxC,IAAI,CAAC,OAAO,OAAO;EAEnB,IAAI,UAAU,KAAK,WAAW;GAC5B,KAAK,YAAY;GACjB,KAAK,WAAU;EACjB;EAEA,MAAM,OAAO,OAAO,UAAU,WAAW,IAAI,KAAK,KAAK,IAAI;EAE3D,MAAM,UAAU,KAAK,wBAAO,IADZ,KACY,EAAA,CAAI,QAAO,IAAK,KAAK,QAAO,KAAM,GAAI;EAElE,IAAI,UAAU,mBACZ,OAAO,KAAK,iBAAiB,UAAU,UAAU;EAGnD,IAAI;EACJ,IAAI;EAEJ,IAAI,UAAU,iBAAiB;GAC7B,QAAQ,KAAK,MAAM,UAAU,iBAAiB;GAC9C,OAAO,UAAU,IAAI,WAAW;EAClC,OAAO,IAAI,UAAU,gBAAgB;GACnC,QAAQ,KAAK,MAAM,UAAU,eAAe;GAC5C,OAAO,UAAU,IAAI,SAAS;EAChC,OAAO,IAAI,UAAU,kBAAkB;GACrC,QAAQ,KAAK,MAAM,UAAU,cAAc;GAC3C,OAAO,UAAU,IAAI,QAAQ;EAC/B,OAAO,IAAI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A,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,UAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,aAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,UAAA;EAAA,UApBf;;;;;;;;;;;;;;;;EAeT,UAAA;EAAA,QAAA,CAAA,w8CAAA;EAAA,cAAA,CAAA;GAAA,MAAA;GAAA,MACS;GAAa,MAAA;EAAA,CAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAIZ,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAc,YAAA,CAAA;EAtB1B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAS,UACT;;;;;;;;;;;;;;;;GAeT,SACQ,CAAC,aAAa;GAAC,iBAEP,wBAAwB;GAAM,QAAA,CAAA,w8CAAA;EAAA,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Y as NAV_STORE_REF, b as HttpService, c as TranslatePipe, ot as Assets } from "./magmonium-one-size-converter-BOLtxL8d.mjs";
|
|
2
|
-
import { t as SelectorDirective } from "./magmonium-one-selector-
|
|
2
|
+
import { t as SelectorDirective } from "./magmonium-one-selector-Do0PsJBx.mjs";
|
|
3
3
|
import { r as IconComponent } from "./magmonium-one-icon-dAR6gd-q.mjs";
|
|
4
4
|
import { r as ConfigComponent } from "./magmonium-one-attribute-value-BobQXKUK.mjs";
|
|
5
5
|
import { t as ButtonComponent } from "./magmonium-one-button-B1KCA8KO.mjs";
|
|
@@ -885,4 +885,4 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
885
885
|
});
|
|
886
886
|
export { ContextMenuBoxComponent as n, MenuComponent as r, ContextMenuComponent as t };
|
|
887
887
|
|
|
888
|
-
//# sourceMappingURL=magmonium-one-menu-
|
|
888
|
+
//# sourceMappingURL=magmonium-one-menu-CxswmD0O.mjs.map
|
package/fesm2022/{magmonium-one-menu-DmZJi88Y.mjs.map → magmonium-one-menu-CxswmD0O.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"magmonium-one-menu-DmZJi88Y.mjs","names":["catchError"],"sources":["../../../../libs/one/src/lib/shared/ui/menu/ui/menu/menu.ts","../../../../libs/one/src/lib/shared/ui/menu/ui/menu/menu.html","../../../../libs/one/src/lib/shared/ui/menu/ui/context-menu-box/context-menu-box.ts","../../../../libs/one/src/lib/shared/ui/menu/ui/context-menu-box/context-menu-box.html","../../../../libs/one/src/lib/shared/ui/menu/ui/context-menu/context-menu.ts"],"sourcesContent":["import {\n afterRenderEffect,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n output,\n signal,\n untracked,\n} from '@angular/core';\nimport { rxResource } from '@angular/core/rxjs-interop';\nimport { of } from 'rxjs';\nimport { catchError } from 'rxjs/operators';\nimport { Assets } from '../../../../enum/assets/assets';\nimport { HttpService } from '../../../../services/http';\nimport { TranslatePipe } from '../../../../pipe/translate';\n\nimport { IconComponent } from '../../../icon';\nimport { MenuItem } from '../../type';\nimport { NAV_STORE_REF } from '../../../../config/tokens';\n\n@Component({\n selector: 'm-menu',\n\n imports: [TranslatePipe, IconComponent],\n templateUrl: './menu.html',\n styleUrl: './menu.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(keydown.arrowdown)': 'moveFocus($event, 1)',\n '(keydown.arrowup)': 'moveFocus($event, -1)',\n },\n})\nexport class MenuComponent {\n readonly #navRef = inject(NAV_STORE_REF, { optional: true });\n\n // --- Inputs ---\n config = input<MenuItem[][] | undefined>();\n file = input<string | undefined>();\n root = input<string | undefined>();\n url = input<string | undefined>();\n extra = input<MenuItem[] | undefined>();\n hide = input<string[] | undefined>();\n hideLink = input<boolean>(false);\n isAdmin = input<boolean>(false);\n /** Focus the first item once rendered — a popover menu opened from a trigger. */\n autoFocus = input<boolean>(false);\n readonly action = output<MenuItem>();\n\n visibilityRule = input<(key: string, data?: unknown) => boolean>();\n disableRule = input<(key: string, data?: unknown) => boolean>();\n extraData = input<unknown>();\n\n // --- Internals ---\n #httpService = inject(HttpService);\n #tree = signal<string[]>([]);\n #treeMap = signal<Record<string, MenuItem>>({});\n #host = inject<ElementRef<HTMLElement>>(ElementRef);\n // Whether the next settled render should focus the first item: `autoFocus`\n // decides the first one, a drill or back decides after (its rows replace\n // the focused one, which would drop focus to the body).\n #focusPending?: boolean;\n\n protected back = signal<MenuItem | undefined>(undefined);\n protected slideDirection = signal<'forward' | 'backward' | 'none'>('none');\n\n #asyncOptions = rxResource({\n params: computed(() => this.back()?.file ?? this.file()),\n stream: ({ params: file }) => {\n if (!file) {\n return of(undefined);\n }\n return this.#httpService\n .asset<MenuItem[][]>(['menus', file], Assets.JSON)\n .pipe(catchError(() => of(undefined)));\n },\n });\n\n protected options = computed<MenuItem[][]>(() => {\n const back = this.back();\n const async = this.#asyncOptions.value();\n const config = this.config();\n const hide = this.hide();\n const extra = this.extra();\n const isAdmin = this.isAdmin();\n const vRule = this.visibilityRule();\n const data = this.extraData();\n\n // Filtering recurses so a parent is judged by what survives under it: a row\n // whose every child was hidden would open an empty box, which reads as a\n // broken menu rather than an unavailable one. A `file` parent is exempt —\n // its options are fetched on drill and there is nothing here to count.\n const filterGroups = (groups: MenuItem[][]): MenuItem[][] =>\n groups\n .map((group) =>\n group.filter((item) => {\n if (!isAdmin && item.adminOnly) return false;\n if (hide?.length && hide.includes(item.id)) return false;\n if (vRule && !vRule(item.visibilityKey ?? item.id, data)) {\n return false;\n }\n if (item.options) return filterGroups(item.options).length > 0;\n return true;\n })\n )\n .filter((group) => group.length > 0);\n\n const source = back\n ? (back.options ?? async ?? [])\n : (async ?? config ?? []);\n\n const result = filterGroups(source);\n\n return extra?.length && !back ? [...result, extra] : result;\n });\n\n protected isLoading = computed(() => this.#asyncOptions.isLoading());\n\n constructor() {\n afterRenderEffect(() => {\n this.options();\n if (this.isLoading()) return;\n const pending = this.#focusPending ?? untracked(this.autoFocus);\n this.#focusPending = false;\n if (pending) {\n this.#host.nativeElement\n .querySelector<HTMLElement>('.menu-item:not(.is-disabled)')\n ?.focus();\n }\n });\n }\n\n // ↑/↓ walk the focusable rows (back row included), wrapping; Enter on a\n // row is its own `selectItem`.\n moveFocus(event: Event, step: 1 | -1): void {\n const rows = Array.from(\n this.#host.nativeElement.querySelectorAll<HTMLElement>(\n '.back-btn, .menu-item:not(.is-disabled)'\n )\n );\n if (!rows.length) return;\n event.preventDefault();\n const current = rows.indexOf(document.activeElement as HTMLElement);\n const next =\n current < 0\n ? step > 0\n ? 0\n : rows.length - 1\n : (current + step + rows.length) % rows.length;\n rows[next].focus();\n }\n\n // --- Handlers ---\n selectItem(item: MenuItem): void {\n const dRule = this.disableRule();\n if (item.disabled || (dRule && dRule(item.disableKey ?? item.id))) {\n return;\n }\n\n if (item.options || item.file) {\n this.slideDirection.set('forward');\n this.#treeMap.update((map) => ({ ...map, [item.id]: item }));\n this.#tree.update((t) => [...t, item.id]);\n this.back.set(item);\n this.#focusPending = this.#hasFocus();\n return;\n }\n\n // A row naming a Nav goes there itself — the NavKind on that node decides\n // whether it routes or opens a panel, the answer `[mRef]` gives (GLOSSARY.md\n // NavRef). Still emitted, so whatever holds the menu closes it.\n if (item.nav)\n this.#navRef?.setSelected(\n item.nav,\n undefined,\n item.keepPanel ? { keepPanel: true } : undefined\n );\n this.action.emit(item);\n }\n\n goBack(): void {\n this.slideDirection.set('backward');\n this.#focusPending = this.#hasFocus();\n const currentTree = this.#tree();\n if (currentTree.length <= 1) {\n this.#tree.set([]);\n this.back.set(undefined);\n return;\n }\n\n const newTree = currentTree.slice(0, -1);\n this.#tree.set(newTree);\n const parentId = newTree[newTree.length - 1];\n this.back.set(this.#treeMap()[parentId]);\n }\n\n #hasFocus(): boolean {\n return this.#host.nativeElement.contains(document.activeElement);\n }\n\n isSelected(item: MenuItem): boolean {\n // A NavRef knows what it points at, so selection is an id comparison —\n // no path normalising, and it works for panels as well as pages.\n if (item.nav) {\n return this.#navRef?.id() === item.nav;\n }\n\n const currentUrl = this.url();\n const rootPath = this.root();\n if (!currentUrl || !item.link) {\n return item.selected ?? false;\n }\n const fullLink = rootPath ? `${rootPath}/${item.link}` : item.link;\n return currentUrl === fullLink || currentUrl.startsWith(fullLink + '/');\n }\n\n isItemDisabled(item: MenuItem): boolean {\n const dRule = this.disableRule();\n return !!(\n item.disabled ||\n (dRule && dRule(item.disableKey ?? item.id, this.extraData()))\n );\n }\n}\n","<div class=\"menu-container\" [attr.data-slide]=\"slideDirection()\">\n @if (back()) {\n <div\n class=\"back-btn\"\n tabindex=\"0\"\n role=\"button\"\n (click)=\"goBack()\"\n (keydown.enter)=\"goBack()\"\n (keydown.space)=\"goBack()\"\n >\n <div class=\"back-icon\">\n <m-icon [name]=\"'chevron-left'\" color=\"currentColor\" />\n </div>\n <span class=\"back-text\">{{ back()!.label | translate }}</span>\n </div>\n }\n\n <div class=\"menu-content\">\n @if (isLoading()) {\n <div class=\"menu-loading\">\n <div class=\"spinner\"></div>\n </div>\n } @else {\n <div class=\"menu-groups\">\n @for (group of options(); track $index; let last = $last) {\n <div class=\"menu-group\" [class.has-separator]=\"!last\">\n @for (item of group; track item.id) {\n @if (!item.hidden) {\n <div\n class=\"menu-item\"\n [attr.data-testid]=\"item.id + '-btn'\"\n [class.is-selected]=\"isSelected(item)\"\n [class.is-disabled]=\"isItemDisabled(item)\"\n [attr.aria-disabled]=\"isItemDisabled(item) || null\"\n tabindex=\"0\"\n role=\"button\"\n (click)=\"selectItem(item)\"\n (keydown.enter)=\"selectItem(item)\"\n (keydown.space)=\"selectItem(item)\"\n >\n @if (item.icon) {\n <div class=\"item-icon\">\n <m-icon [name]=\"item.icon\" color=\"currentColor\" />\n </div>\n }\n <span class=\"item-text\">{{ item.label | translate }}</span>\n @if (item.options || item.file) {\n <div class=\"item-arrow\">\n <m-icon [name]=\"'chevron-right'\" color=\"currentColor\" />\n </div>\n }\n </div>\n }\n }\n </div>\n }\n </div>\n }\n </div>\n</div>\n","import {\n ChangeDetectionStrategy,\n Component,\n input,\n output,\n} from '@angular/core';\nimport { MenuComponent } from '../menu/menu';\nimport { MenuItem } from '../../type';\n\n@Component({\n selector: 'm-context-menu-box',\n imports: [MenuComponent],\n templateUrl: './context-menu-box.html',\n styleUrl: './context-menu-box.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ContextMenuBoxComponent {\n readonly options = input<MenuItem[][]>([]);\n readonly hide = input<string[] | undefined>();\n readonly file = input<string | undefined>();\n readonly width = input<string>('250px');\n readonly height = input<string>('auto');\n readonly isAdmin = input<boolean>(false);\n readonly action = output<MenuItem>();\n\n readonly visibilityRule = input<(key: string, data?: unknown) => boolean>();\n readonly disableRule = input<(key: string, data?: unknown) => boolean>();\n readonly extraData = input<unknown>();\n\n protected readonly emitAction = (item: MenuItem): void => {\n this.action.emit(item);\n };\n}\n","<div class=\"m-context-menu-box\" [style.width]=\"width()\" [style.max-height]=\"height()\">\n <m-menu\n [config]=\"options()\"\n [hide]=\"hide()\"\n [file]=\"file()\"\n [isAdmin]=\"isAdmin()\"\n [autoFocus]=\"true\"\n [visibilityRule]=\"visibilityRule()\"\n [disableRule]=\"disableRule()\"\n [extraData]=\"extraData()\"\n (action)=\"emitAction($event)\"\n />\n</div>\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n inputBinding,\n model,\n output,\n outputBinding,\n viewChild,\n} from '@angular/core';\nimport { ConfigComponent } from '../../../../lib/components/config-component';\nimport { SelectorDirective } from '../../../../directives/selector/selector';\nimport type { SelectorConfig } from '../../../../directives/selector/selector-type';\nimport { Icon } from '../../../icon';\nimport { ButtonComponent } from '../../../button/ui/button';\nimport { ContextMenu, MenuItem } from '../../type';\nimport { ContextMenuBoxComponent } from '../context-menu-box/context-menu-box';\n\n@Component({\n selector: 'm-context-menu, m-one-context-menu',\n imports: [ButtonComponent, SelectorDirective],\n template: `\n <m-one-button\n [config]=\"triggerButtonConfig()\"\n [mSelector]=\"selectorConfig()\"\n (opened)=\"toggle.set(true)\"\n (closed)=\"toggle.set(false)\"\n />\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ContextMenuComponent extends ConfigComponent<ContextMenu> {\n toggle = model<boolean>();\n override remote = input<string | undefined>();\n exclude = input<string[]>();\n readonly visibilityRule = input<(key: string, data?: unknown) => boolean>();\n readonly disableRule = input<(key: string, data?: unknown) => boolean>();\n readonly extraData = input<unknown>();\n readonly inverted = input<boolean | undefined>();\n // A bound list rides the tag, not the config bag: a YAML file cannot hold\n // rows a store computes. `MenuItem[]` is accepted because root groups are an\n // authoring shape — data is one flat group — and normalized on read.\n readonly options = input<MenuItem[] | MenuItem[][] | undefined>();\n readonly action = output<MenuItem>();\n protected override readonly subFolder = 'menu';\n private readonly selectorDir = viewChild(SelectorDirective);\n protected readonly contextMenuConfig = computed(\n () => (this.config() ?? {}) as ContextMenu\n );\n private readonly iconConfig = computed<Partial<Icon>>(() => {\n const toggle = this.toggle();\n const { closeIcon, icon } = this.contextMenuConfig();\n if (toggle) {\n return { name: 'x', ...closeIcon };\n }\n return { name: 'ellipsis-vertical', ...icon };\n });\n protected readonly triggerButtonConfig = computed(() => ({\n variant: 'ghost' as const,\n iconOnly: true as const,\n icon: this.iconConfig().name,\n label: 'actions',\n inverted: this.inverted() ?? this.contextMenuConfig().inverted,\n }));\n // `exclude` is not applied here: a menu nests, and a filter run once over the\n // root groups cannot reach an item a layer down, nor one a `file` parent has\n // not fetched yet. It is handed to the menu as `hide` instead, which the menu\n // re-applies at whatever depth is on screen.\n private readonly contextMenuOptions = computed<MenuItem[][]>(() => {\n const supplied = this.options();\n if (supplied) {\n // The input overrides the config bag the way `inverted` already does.\n return Array.isArray(supplied[0])\n ? (supplied as MenuItem[][])\n : [supplied as MenuItem[]];\n }\n return this.contextMenuConfig().options ?? [];\n });\n protected readonly selectorConfig = computed<\n SelectorConfig<ContextMenuBoxComponent> | undefined\n >(() => {\n // The overlay-bearing primitives' DesignMode rule (ADR 0003): a Canvas\n // owns the click — the ControlLayer selects, never the menu — so the\n // directive is handed nothing to open. An undefined config is the whole\n // suppression, the directive having no `base` to open on.\n if (this.isDesignMode) return undefined;\n return {\n component: ContextMenuBoxComponent,\n base: 'm-context-menu',\n width: this.contextMenuConfig().width ?? '250px',\n height: this.contextMenuConfig().height ?? 'auto',\n align: this.contextMenuConfig().align,\n toggle: true,\n bindings: [\n inputBinding('options', this.contextMenuOptions),\n inputBinding('hide', this.exclude),\n inputBinding('visibilityRule', this.visibilityRule),\n inputBinding('disableRule', this.disableRule),\n inputBinding('extraData', this.extraData),\n outputBinding('action', (event: MenuItem) => {\n this.action.emit(event);\n this.selectorDir()?.close();\n }),\n ],\n };\n });\n}\n"],"mappings":";;;;;;;;;;AAmCA,IAAa,gBAAb,MAAa,cAAa;CACf,UAAU,OAAO,eAAe,EAAE,UAAU,KAAI,CAAE;CAG3D,SAAS,MAAiC,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAC1C,OAAO,MAA2B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAClC,OAAO,MAA2B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAClC,MAAM,MAA2B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,MAAA,CAAA,+BAAA,CAAA,CAAA;CACjC,QAAQ,MAA+B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACvC,OAAO,MAA6B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACpC,WA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CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,QAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,iBAAiB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"magmonium-one-menu-CxswmD0O.mjs","names":["catchError"],"sources":["../../../../libs/one/src/lib/shared/ui/menu/ui/menu/menu.ts","../../../../libs/one/src/lib/shared/ui/menu/ui/menu/menu.html","../../../../libs/one/src/lib/shared/ui/menu/ui/context-menu-box/context-menu-box.ts","../../../../libs/one/src/lib/shared/ui/menu/ui/context-menu-box/context-menu-box.html","../../../../libs/one/src/lib/shared/ui/menu/ui/context-menu/context-menu.ts"],"sourcesContent":["import {\n afterRenderEffect,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n output,\n signal,\n untracked,\n} from '@angular/core';\nimport { rxResource } from '@angular/core/rxjs-interop';\nimport { of } from 'rxjs';\nimport { catchError } from 'rxjs/operators';\nimport { Assets } from '../../../../enum/assets/assets';\nimport { HttpService } from '../../../../services/http';\nimport { TranslatePipe } from '../../../../pipe/translate';\n\nimport { IconComponent } from '../../../icon';\nimport { MenuItem } from '../../type';\nimport { NAV_STORE_REF } from '../../../../config/tokens';\n\n@Component({\n selector: 'm-menu',\n\n imports: [TranslatePipe, IconComponent],\n templateUrl: './menu.html',\n styleUrl: './menu.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(keydown.arrowdown)': 'moveFocus($event, 1)',\n '(keydown.arrowup)': 'moveFocus($event, -1)',\n },\n})\nexport class MenuComponent {\n readonly #navRef = inject(NAV_STORE_REF, { optional: true });\n\n // --- Inputs ---\n config = input<MenuItem[][] | undefined>();\n file = input<string | undefined>();\n root = input<string | undefined>();\n url = input<string | undefined>();\n extra = input<MenuItem[] | undefined>();\n hide = input<string[] | undefined>();\n hideLink = input<boolean>(false);\n isAdmin = input<boolean>(false);\n /** Focus the first item once rendered — a popover menu opened from a trigger. */\n autoFocus = input<boolean>(false);\n readonly action = output<MenuItem>();\n\n visibilityRule = input<(key: string, data?: unknown) => boolean>();\n disableRule = input<(key: string, data?: unknown) => boolean>();\n extraData = input<unknown>();\n\n // --- Internals ---\n #httpService = inject(HttpService);\n #tree = signal<string[]>([]);\n #treeMap = signal<Record<string, MenuItem>>({});\n #host = inject<ElementRef<HTMLElement>>(ElementRef);\n // Whether the next settled render should focus the first item: `autoFocus`\n // decides the first one, a drill or back decides after (its rows replace\n // the focused one, which would drop focus to the body).\n #focusPending?: boolean;\n\n protected back = signal<MenuItem | undefined>(undefined);\n protected slideDirection = signal<'forward' | 'backward' | 'none'>('none');\n\n #asyncOptions = rxResource({\n params: computed(() => this.back()?.file ?? this.file()),\n stream: ({ params: file }) => {\n if (!file) {\n return of(undefined);\n }\n return this.#httpService\n .asset<MenuItem[][]>(['menus', file], Assets.JSON)\n .pipe(catchError(() => of(undefined)));\n },\n });\n\n protected options = computed<MenuItem[][]>(() => {\n const back = this.back();\n const async = this.#asyncOptions.value();\n const config = this.config();\n const hide = this.hide();\n const extra = this.extra();\n const isAdmin = this.isAdmin();\n const vRule = this.visibilityRule();\n const data = this.extraData();\n\n // Filtering recurses so a parent is judged by what survives under it: a row\n // whose every child was hidden would open an empty box, which reads as a\n // broken menu rather than an unavailable one. A `file` parent is exempt —\n // its options are fetched on drill and there is nothing here to count.\n const filterGroups = (groups: MenuItem[][]): MenuItem[][] =>\n groups\n .map((group) =>\n group.filter((item) => {\n if (!isAdmin && item.adminOnly) return false;\n if (hide?.length && hide.includes(item.id)) return false;\n if (vRule && !vRule(item.visibilityKey ?? item.id, data)) {\n return false;\n }\n if (item.options) return filterGroups(item.options).length > 0;\n return true;\n })\n )\n .filter((group) => group.length > 0);\n\n const source = back\n ? (back.options ?? async ?? [])\n : (async ?? config ?? []);\n\n const result = filterGroups(source);\n\n return extra?.length && !back ? [...result, extra] : result;\n });\n\n protected isLoading = computed(() => this.#asyncOptions.isLoading());\n\n constructor() {\n afterRenderEffect(() => {\n this.options();\n if (this.isLoading()) return;\n const pending = this.#focusPending ?? untracked(this.autoFocus);\n this.#focusPending = false;\n if (pending) {\n this.#host.nativeElement\n .querySelector<HTMLElement>('.menu-item:not(.is-disabled)')\n ?.focus();\n }\n });\n }\n\n // ↑/↓ walk the focusable rows (back row included), wrapping; Enter on a\n // row is its own `selectItem`.\n moveFocus(event: Event, step: 1 | -1): void {\n const rows = Array.from(\n this.#host.nativeElement.querySelectorAll<HTMLElement>(\n '.back-btn, .menu-item:not(.is-disabled)'\n )\n );\n if (!rows.length) return;\n event.preventDefault();\n const current = rows.indexOf(document.activeElement as HTMLElement);\n const next =\n current < 0\n ? step > 0\n ? 0\n : rows.length - 1\n : (current + step + rows.length) % rows.length;\n rows[next].focus();\n }\n\n // --- Handlers ---\n selectItem(item: MenuItem): void {\n const dRule = this.disableRule();\n if (item.disabled || (dRule && dRule(item.disableKey ?? item.id))) {\n return;\n }\n\n if (item.options || item.file) {\n this.slideDirection.set('forward');\n this.#treeMap.update((map) => ({ ...map, [item.id]: item }));\n this.#tree.update((t) => [...t, item.id]);\n this.back.set(item);\n this.#focusPending = this.#hasFocus();\n return;\n }\n\n // A row naming a Nav goes there itself — the NavKind on that node decides\n // whether it routes or opens a panel, the answer `[mRef]` gives (GLOSSARY.md\n // NavRef). Still emitted, so whatever holds the menu closes it.\n if (item.nav)\n this.#navRef?.setSelected(\n item.nav,\n undefined,\n item.keepPanel ? { keepPanel: true } : undefined\n );\n this.action.emit(item);\n }\n\n goBack(): void {\n this.slideDirection.set('backward');\n this.#focusPending = this.#hasFocus();\n const currentTree = this.#tree();\n if (currentTree.length <= 1) {\n this.#tree.set([]);\n this.back.set(undefined);\n return;\n }\n\n const newTree = currentTree.slice(0, -1);\n this.#tree.set(newTree);\n const parentId = newTree[newTree.length - 1];\n this.back.set(this.#treeMap()[parentId]);\n }\n\n #hasFocus(): boolean {\n return this.#host.nativeElement.contains(document.activeElement);\n }\n\n isSelected(item: MenuItem): boolean {\n // A NavRef knows what it points at, so selection is an id comparison —\n // no path normalising, and it works for panels as well as pages.\n if (item.nav) {\n return this.#navRef?.id() === item.nav;\n }\n\n const currentUrl = this.url();\n const rootPath = this.root();\n if (!currentUrl || !item.link) {\n return item.selected ?? false;\n }\n const fullLink = rootPath ? `${rootPath}/${item.link}` : item.link;\n return currentUrl === fullLink || currentUrl.startsWith(fullLink + '/');\n }\n\n isItemDisabled(item: MenuItem): boolean {\n const dRule = this.disableRule();\n return !!(\n item.disabled ||\n (dRule && dRule(item.disableKey ?? item.id, this.extraData()))\n );\n }\n}\n","<div class=\"menu-container\" [attr.data-slide]=\"slideDirection()\">\n @if (back()) {\n <div\n class=\"back-btn\"\n tabindex=\"0\"\n role=\"button\"\n (click)=\"goBack()\"\n (keydown.enter)=\"goBack()\"\n (keydown.space)=\"goBack()\"\n >\n <div class=\"back-icon\">\n <m-icon [name]=\"'chevron-left'\" color=\"currentColor\" />\n </div>\n <span class=\"back-text\">{{ back()!.label | translate }}</span>\n </div>\n }\n\n <div class=\"menu-content\">\n @if (isLoading()) {\n <div class=\"menu-loading\">\n <div class=\"spinner\"></div>\n </div>\n } @else {\n <div class=\"menu-groups\">\n @for (group of options(); track $index; let last = $last) {\n <div class=\"menu-group\" [class.has-separator]=\"!last\">\n @for (item of group; track item.id) {\n @if (!item.hidden) {\n <div\n class=\"menu-item\"\n [attr.data-testid]=\"item.id + '-btn'\"\n [class.is-selected]=\"isSelected(item)\"\n [class.is-disabled]=\"isItemDisabled(item)\"\n [attr.aria-disabled]=\"isItemDisabled(item) || null\"\n tabindex=\"0\"\n role=\"button\"\n (click)=\"selectItem(item)\"\n (keydown.enter)=\"selectItem(item)\"\n (keydown.space)=\"selectItem(item)\"\n >\n @if (item.icon) {\n <div class=\"item-icon\">\n <m-icon [name]=\"item.icon\" color=\"currentColor\" />\n </div>\n }\n <span class=\"item-text\">{{ item.label | translate }}</span>\n @if (item.options || item.file) {\n <div class=\"item-arrow\">\n <m-icon [name]=\"'chevron-right'\" color=\"currentColor\" />\n </div>\n }\n </div>\n }\n }\n </div>\n }\n </div>\n }\n </div>\n</div>\n","import {\n ChangeDetectionStrategy,\n Component,\n input,\n output,\n} from '@angular/core';\nimport { MenuComponent } from '../menu/menu';\nimport { MenuItem } from '../../type';\n\n@Component({\n selector: 'm-context-menu-box',\n imports: [MenuComponent],\n templateUrl: './context-menu-box.html',\n styleUrl: './context-menu-box.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ContextMenuBoxComponent {\n readonly options = input<MenuItem[][]>([]);\n readonly hide = input<string[] | undefined>();\n readonly file = input<string | undefined>();\n readonly width = input<string>('250px');\n readonly height = input<string>('auto');\n readonly isAdmin = input<boolean>(false);\n readonly action = output<MenuItem>();\n\n readonly visibilityRule = input<(key: string, data?: unknown) => boolean>();\n readonly disableRule = input<(key: string, data?: unknown) => boolean>();\n readonly extraData = input<unknown>();\n\n protected readonly emitAction = (item: MenuItem): void => {\n this.action.emit(item);\n };\n}\n","<div class=\"m-context-menu-box\" [style.width]=\"width()\" [style.max-height]=\"height()\">\n <m-menu\n [config]=\"options()\"\n [hide]=\"hide()\"\n [file]=\"file()\"\n [isAdmin]=\"isAdmin()\"\n [autoFocus]=\"true\"\n [visibilityRule]=\"visibilityRule()\"\n [disableRule]=\"disableRule()\"\n [extraData]=\"extraData()\"\n (action)=\"emitAction($event)\"\n />\n</div>\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n inputBinding,\n model,\n output,\n outputBinding,\n viewChild,\n} from '@angular/core';\nimport { ConfigComponent } from '../../../../lib/components/config-component';\nimport { SelectorDirective } from '../../../../directives/selector/selector';\nimport type { SelectorConfig } from '../../../../directives/selector/selector-type';\nimport { Icon } from '../../../icon';\nimport { ButtonComponent } from '../../../button/ui/button';\nimport { ContextMenu, MenuItem } from '../../type';\nimport { ContextMenuBoxComponent } from '../context-menu-box/context-menu-box';\n\n@Component({\n selector: 'm-context-menu, m-one-context-menu',\n imports: [ButtonComponent, SelectorDirective],\n template: `\n <m-one-button\n [config]=\"triggerButtonConfig()\"\n [mSelector]=\"selectorConfig()\"\n (opened)=\"toggle.set(true)\"\n (closed)=\"toggle.set(false)\"\n />\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ContextMenuComponent extends ConfigComponent<ContextMenu> {\n toggle = model<boolean>();\n override remote = input<string | undefined>();\n exclude = input<string[]>();\n readonly visibilityRule = input<(key: string, data?: unknown) => boolean>();\n readonly disableRule = input<(key: string, data?: unknown) => boolean>();\n readonly extraData = input<unknown>();\n readonly inverted = input<boolean | undefined>();\n // A bound list rides the tag, not the config bag: a YAML file cannot hold\n // rows a store computes. `MenuItem[]` is accepted because root groups are an\n // authoring shape — data is one flat group — and normalized on read.\n readonly options = input<MenuItem[] | MenuItem[][] | undefined>();\n readonly action = output<MenuItem>();\n protected override readonly subFolder = 'menu';\n private readonly selectorDir = viewChild(SelectorDirective);\n protected readonly contextMenuConfig = computed(\n () => (this.config() ?? {}) as ContextMenu\n );\n private readonly iconConfig = computed<Partial<Icon>>(() => {\n const toggle = this.toggle();\n const { closeIcon, icon } = this.contextMenuConfig();\n if (toggle) {\n return { name: 'x', ...closeIcon };\n }\n return { name: 'ellipsis-vertical', ...icon };\n });\n protected readonly triggerButtonConfig = computed(() => ({\n variant: 'ghost' as const,\n iconOnly: true as const,\n icon: this.iconConfig().name,\n label: 'actions',\n inverted: this.inverted() ?? this.contextMenuConfig().inverted,\n }));\n // `exclude` is not applied here: a menu nests, and a filter run once over the\n // root groups cannot reach an item a layer down, nor one a `file` parent has\n // not fetched yet. It is handed to the menu as `hide` instead, which the menu\n // re-applies at whatever depth is on screen.\n private readonly contextMenuOptions = computed<MenuItem[][]>(() => {\n const supplied = this.options();\n if (supplied) {\n // The input overrides the config bag the way `inverted` already does.\n return Array.isArray(supplied[0])\n ? (supplied as MenuItem[][])\n : [supplied as MenuItem[]];\n }\n return this.contextMenuConfig().options ?? [];\n });\n protected readonly selectorConfig = computed<\n SelectorConfig<ContextMenuBoxComponent> | undefined\n >(() => {\n // The overlay-bearing primitives' DesignMode rule (ADR 0003): a Canvas\n // owns the click — the ControlLayer selects, never the menu — so the\n // directive is handed nothing to open. An undefined config is the whole\n // suppression, the directive having no `base` to open on.\n if (this.isDesignMode) return undefined;\n return {\n component: ContextMenuBoxComponent,\n base: 'm-context-menu',\n width: this.contextMenuConfig().width ?? '250px',\n height: this.contextMenuConfig().height ?? 'auto',\n align: this.contextMenuConfig().align,\n toggle: true,\n bindings: [\n inputBinding('options', this.contextMenuOptions),\n inputBinding('hide', this.exclude),\n inputBinding('visibilityRule', this.visibilityRule),\n inputBinding('disableRule', this.disableRule),\n inputBinding('extraData', this.extraData),\n outputBinding('action', (event: MenuItem) => {\n this.action.emit(event);\n this.selectorDir()?.close();\n }),\n ],\n };\n });\n}\n"],"mappings":";;;;;;;;;;AAmCA,IAAa,gBAAb,MAAa,cAAa;CACf,UAAU,OAAO,eAAe,EAAE,UAAU,KAAI,CAAE;CAG3D,SAAS,MAAiC,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAC1C,OAAO,MAA2B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAClC,OAAO,MAA2B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAClC,MAAM,MAA2B,GAAA,YAAA,CAAA,QAA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CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,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;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,QAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,iBAAiB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
package/fesm2022/{magmonium-one-multi-range-BnWtK-O0.mjs → magmonium-one-multi-range-mv5rz3uW.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./magmonium-one-rolldown-runtime-DpJrqANO.mjs";
|
|
2
|
-
import { t as LabelComponent } from "./magmonium-one-label-
|
|
3
|
-
import { u as DraggableDirective } from "./magmonium-one-directives-
|
|
2
|
+
import { t as LabelComponent } from "./magmonium-one-label-B8WJHiU4.mjs";
|
|
3
|
+
import { u as DraggableDirective } from "./magmonium-one-directives-Dbe0pfCf.mjs";
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
import { ChangeDetectionStrategy, Component, ElementRef, HostListener, computed, effect, inject, input, linkedSignal, model, signal, viewChild } from "@angular/core";
|
|
6
6
|
var BaseArrayInputComponent = class BaseArrayInputComponent {
|
|
@@ -455,4 +455,4 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
455
455
|
});
|
|
456
456
|
export { multi_range_exports as n, BaseArrayInputComponent as r, MultiRangeInputComponent as t };
|
|
457
457
|
|
|
458
|
-
//# sourceMappingURL=magmonium-one-multi-range-
|
|
458
|
+
//# sourceMappingURL=magmonium-one-multi-range-mv5rz3uW.mjs.map
|