@magmonium/one 0.4.29 → 0.4.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/assets/docs/en/app-release.md +0 -11
  2. package/assets/i18n/en.json +2 -0
  3. package/fesm2022/magmonium-one-attribute-value-CLBOZcme.mjs +255 -0
  4. package/fesm2022/magmonium-one-attribute-value-CLBOZcme.mjs.map +1 -0
  5. package/fesm2022/magmonium-one-base-checkbox-D7NYJdU3.mjs +77 -0
  6. package/fesm2022/magmonium-one-base-checkbox-D7NYJdU3.mjs.map +1 -0
  7. package/fesm2022/magmonium-one-base-dropdown-CEDsqaPz.mjs +604 -0
  8. package/fesm2022/magmonium-one-base-dropdown-CEDsqaPz.mjs.map +1 -0
  9. package/fesm2022/magmonium-one-base-input-BOaD-WIi.mjs +183 -0
  10. package/fesm2022/magmonium-one-base-input-BOaD-WIi.mjs.map +1 -0
  11. package/fesm2022/magmonium-one-base-text-D6p6_vsb.mjs +94 -0
  12. package/fesm2022/magmonium-one-base-text-D6p6_vsb.mjs.map +1 -0
  13. package/fesm2022/magmonium-one-button-rVNnp6G8.mjs +1281 -0
  14. package/fesm2022/magmonium-one-button-rVNnp6G8.mjs.map +1 -0
  15. package/fesm2022/magmonium-one-checkbox-rj4XHxb3.mjs +365 -0
  16. package/fesm2022/magmonium-one-checkbox-rj4XHxb3.mjs.map +1 -0
  17. package/fesm2022/magmonium-one-color-utl-CirPzUFk.mjs +449 -0
  18. package/fesm2022/magmonium-one-color-utl-CirPzUFk.mjs.map +1 -0
  19. package/fesm2022/magmonium-one-directives-DOBENX_K.mjs +1285 -0
  20. package/fesm2022/magmonium-one-directives-DOBENX_K.mjs.map +1 -0
  21. package/fesm2022/magmonium-one-file.service-Bo06pU3_.mjs +65 -0
  22. package/fesm2022/magmonium-one-file.service-Bo06pU3_.mjs.map +1 -0
  23. package/fesm2022/magmonium-one-group-Cue4x6tD.mjs +428 -0
  24. package/fesm2022/magmonium-one-group-Cue4x6tD.mjs.map +1 -0
  25. package/fesm2022/magmonium-one-header-DPVnaEOV.mjs +380 -0
  26. package/fesm2022/magmonium-one-header-DPVnaEOV.mjs.map +1 -0
  27. package/fesm2022/magmonium-one-icon-Dso-9RMN.mjs +833 -0
  28. package/fesm2022/magmonium-one-icon-Dso-9RMN.mjs.map +1 -0
  29. package/fesm2022/magmonium-one-image-editor-C7AtzEf6.mjs +438 -0
  30. package/fesm2022/magmonium-one-image-editor-C7AtzEf6.mjs.map +1 -0
  31. package/fesm2022/magmonium-one-image-frame-BTSaUSAi.mjs +116 -0
  32. package/fesm2022/magmonium-one-image-frame-BTSaUSAi.mjs.map +1 -0
  33. package/fesm2022/magmonium-one-input-DqHPorA1.mjs +39 -0
  34. package/fesm2022/magmonium-one-input-DqHPorA1.mjs.map +1 -0
  35. package/fesm2022/magmonium-one-label-B30Q4Vut.mjs +574 -0
  36. package/fesm2022/magmonium-one-label-B30Q4Vut.mjs.map +1 -0
  37. package/fesm2022/magmonium-one-m-ref-Dt0DCm8X.mjs +147 -0
  38. package/fesm2022/magmonium-one-m-ref-Dt0DCm8X.mjs.map +1 -0
  39. package/fesm2022/magmonium-one-menu-BBOnOK4M.mjs +887 -0
  40. package/fesm2022/magmonium-one-menu-BBOnOK4M.mjs.map +1 -0
  41. package/fesm2022/magmonium-one-multi-range-DCOwngql.mjs +458 -0
  42. package/fesm2022/magmonium-one-multi-range-DCOwngql.mjs.map +1 -0
  43. package/fesm2022/magmonium-one-options-asset-D8Gg1yNl.mjs +97 -0
  44. package/fesm2022/magmonium-one-options-asset-D8Gg1yNl.mjs.map +1 -0
  45. package/fesm2022/magmonium-one-otp-DLF7Pq94.mjs +261 -0
  46. package/fesm2022/magmonium-one-otp-DLF7Pq94.mjs.map +1 -0
  47. package/fesm2022/magmonium-one-password-BSOU4RI0.mjs +217 -0
  48. package/fesm2022/magmonium-one-password-BSOU4RI0.mjs.map +1 -0
  49. package/fesm2022/magmonium-one-radio-CYnWLXPZ.mjs +111 -0
  50. package/fesm2022/magmonium-one-radio-CYnWLXPZ.mjs.map +1 -0
  51. package/fesm2022/magmonium-one-range-CmmZAr57.mjs +216 -0
  52. package/fesm2022/magmonium-one-range-CmmZAr57.mjs.map +1 -0
  53. package/fesm2022/magmonium-one-rolldown-runtime-DpJrqANO.mjs +11 -0
  54. package/fesm2022/magmonium-one-selector-DDnBYNLr.mjs +1065 -0
  55. package/fesm2022/magmonium-one-selector-DDnBYNLr.mjs.map +1 -0
  56. package/fesm2022/magmonium-one-size-converter-B-UubQQ0.mjs +1057 -0
  57. package/fesm2022/magmonium-one-size-converter-B-UubQQ0.mjs.map +1 -0
  58. package/fesm2022/magmonium-one-text-FXb-RyBh.mjs +406 -0
  59. package/fesm2022/magmonium-one-text-FXb-RyBh.mjs.map +1 -0
  60. package/fesm2022/magmonium-one-text-output-D2XQWyL0.mjs +296 -0
  61. package/fesm2022/magmonium-one-text-output-D2XQWyL0.mjs.map +1 -0
  62. package/fesm2022/magmonium-one-theme-a7GlFbzE.mjs +1 -0
  63. package/fesm2022/magmonium-one-toggle-C0eTrtkt.mjs +231 -0
  64. package/fesm2022/magmonium-one-toggle-C0eTrtkt.mjs.map +1 -0
  65. package/fesm2022/magmonium-one.mjs +49231 -2
  66. package/fesm2022/magmonium-one.mjs.map +1 -1
  67. package/package.json +8 -8
  68. package/types/magmonium-one.d.ts +13801 -9510
  69. package/fesm2022/magmonium-one-image-editor-DYbS7fRP.mjs +0 -290
  70. package/fesm2022/magmonium-one-image-editor-DYbS7fRP.mjs.map +0 -1
  71. package/fesm2022/magmonium-one-magmonium-one-jBGfJvgl.mjs +0 -41576
  72. package/fesm2022/magmonium-one-magmonium-one-jBGfJvgl.mjs.map +0 -1
  73. package/fesm2022/magmonium-one-otp-DY1B1djA.mjs +0 -201
  74. package/fesm2022/magmonium-one-otp-DY1B1djA.mjs.map +0 -1
  75. package/fesm2022/magmonium-one-password-CzMwV84X.mjs +0 -105
  76. package/fesm2022/magmonium-one-password-CzMwV84X.mjs.map +0 -1
  77. package/fesm2022/magmonium-one-toggle-EoE3fKjl.mjs +0 -62
  78. package/fesm2022/magmonium-one-toggle-EoE3fKjl.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"magmonium-one-image-frame-BTSaUSAi.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/ui/file-upload-input/image-frame.ts"],"sourcesContent":["export type FrameSize = { width: number; height: number };\n\nexport type FrameRect = FrameSize & { x: number; y: number };\n\n/**\n * Where the ImageEditor's box sits over the source, in source pixels: the\n * point it is centred on and how far it is zoomed past the cover fit. Held in\n * source pixels rather than screen pixels so a stage that resizes mid-edit\n * frames the same part of the picture.\n */\nexport type Framing = { cx: number; cy: number; zoom: number };\n\nexport const MIN_ZOOM = 1;\nexport const MAX_ZOOM = 4;\n\n/** Only raster images a canvas decodes everywhere enter the ImageEditor. */\nconst EDITABLE_TYPES = ['image/png', 'image/jpeg', 'image/webp'];\n\nexport const isEditableImage = (file: File): boolean =>\n EDITABLE_TYPES.includes(file.type.toLowerCase());\n\n/** `'16:9'` as `16 / 9`; undefined for anything but two positive figures. */\nexport const parseRatio = (ratio: unknown): number | undefined => {\n if (typeof ratio !== 'string') return undefined;\n const match = /^\\s*(\\d+(?:\\.\\d+)?)\\s*:\\s*(\\d+(?:\\.\\d+)?)\\s*$/.exec(ratio);\n if (!match) return undefined;\n const width = Number(match[1]);\n const height = Number(match[2]);\n return width > 0 && height > 0 ? width / height : undefined;\n};\n\n/**\n * The exact pixels an edited image comes out at: the Field's `width`, and the\n * height its `ratio` derives. Undefined when either is missing or malformed —\n * a Field without both has no ImageEditor.\n */\nexport const outputSize = (\n ratio: unknown,\n width: unknown\n): FrameSize | undefined => {\n const aspect = parseRatio(ratio);\n const pixels = Math.round(Number(width));\n if (!aspect || !Number.isFinite(pixels) || pixels < 1) return undefined;\n return { width: pixels, height: Math.max(1, Math.round(pixels / aspect)) };\n};\n\n/** The largest box of this aspect that fits inside the image. */\nexport const coverCrop = (image: FrameSize, aspect: number): FrameSize =>\n image.width / image.height > aspect\n ? { width: image.height * aspect, height: image.height }\n : { width: image.width, height: image.width / aspect };\n\nexport const initialFraming = (image: FrameSize): Framing => ({\n cx: image.width / 2,\n cy: image.height / 2,\n zoom: MIN_ZOOM,\n});\n\nconst clamp = (value: number, min: number, max: number): number =>\n Math.min(max, Math.max(min, value));\n\n/**\n * The framing pulled back inside the picture: zoom between the cover fit and\n * MAX_ZOOM, and the centre far enough in that the box never shows past an edge.\n */\nexport const clampFraming = (\n image: FrameSize,\n aspect: number,\n framing: Framing\n): Framing => {\n const zoom = clamp(framing.zoom, MIN_ZOOM, MAX_ZOOM);\n const cover = coverCrop(image, aspect);\n const halfW = cover.width / zoom / 2;\n const halfH = cover.height / zoom / 2;\n return {\n zoom,\n cx: clamp(framing.cx, halfW, image.width - halfW),\n cy: clamp(framing.cy, halfH, image.height - halfH),\n };\n};\n\n/** The part of the source the box holds, in source pixels. */\nexport const cropRect = (\n image: FrameSize,\n aspect: number,\n framing: Framing\n): FrameRect => {\n const { cx, cy, zoom } = clampFraming(image, aspect, framing);\n const cover = coverCrop(image, aspect);\n const width = cover.width / zoom;\n const height = cover.height / zoom;\n return { x: cx - width / 2, y: cy - height / 2, width, height };\n};\n\n/** `avatar.png` holding a WebP is `avatar.webp`. */\nexport const renameForType = (name: string, type: string): string => {\n const extension =\n type === 'image/jpeg' ? 'jpg' : type.split('/')[1] ?? 'bin';\n const dot = name.lastIndexOf('.');\n const base = dot > 0 ? name.slice(0, dot) : name;\n return `${base}.${extension}`;\n};\n\nconst createCanvas = (size: FrameSize): HTMLCanvasElement => {\n const canvas = document.createElement('canvas');\n canvas.width = Math.max(1, Math.round(size.width));\n canvas.height = Math.max(1, Math.round(size.height));\n return canvas;\n};\n\nconst smoothContext = (canvas: HTMLCanvasElement): CanvasRenderingContext2D => {\n const context = canvas.getContext('2d');\n if (!context) throw new Error('2d canvas unavailable');\n context.imageSmoothingEnabled = true;\n context.imageSmoothingQuality = 'high';\n return context;\n};\n\n/**\n * The crop drawn at exactly `output` pixels. A shrink past half is taken in\n * halving steps — one pass that drops more than every other pixel aliases —\n * and a grow is one smoothed pass.\n */\nexport const drawFramed = (\n source: CanvasImageSource,\n rect: FrameRect,\n output: FrameSize\n): HTMLCanvasElement => {\n let from: CanvasImageSource = source;\n let area: FrameRect = rect;\n while (\n area.width >= output.width * 2 &&\n area.height >= output.height * 2\n ) {\n const step = createCanvas({\n width: area.width / 2,\n height: area.height / 2,\n });\n smoothContext(step).drawImage(\n from,\n area.x,\n area.y,\n area.width,\n area.height,\n 0,\n 0,\n step.width,\n step.height\n );\n from = step;\n area = { x: 0, y: 0, width: step.width, height: step.height };\n }\n const canvas = createCanvas(output);\n smoothContext(canvas).drawImage(\n from,\n area.x,\n area.y,\n area.width,\n area.height,\n 0,\n 0,\n canvas.width,\n canvas.height\n );\n return canvas;\n};\n\nconst ENCODE_QUALITY = 0.9;\n\nconst toBlob = (\n canvas: HTMLCanvasElement,\n type: string\n): Promise<Blob | null> =>\n new Promise((resolve) => canvas.toBlob(resolve, type, ENCODE_QUALITY));\n\nconst hasTransparency = (canvas: HTMLCanvasElement): boolean => {\n const { data } = smoothContext(canvas).getImageData(\n 0,\n 0,\n canvas.width,\n canvas.height\n );\n for (let i = 3; i < data.length; i += 4) {\n if (data[i] < 255) return true;\n }\n return false;\n};\n\n/**\n * WebP, the smallest file at this quality. A browser that cannot encode WebP\n * hands back a PNG under the WebP request without saying so, so the blob's own\n * type is what is checked: then an opaque picture goes JPEG and one with\n * transparency PNG, the smallest that keeps what it shows.\n */\nexport const encodeFramed = async (canvas: HTMLCanvasElement): Promise<Blob> => {\n const webp = await toBlob(canvas, 'image/webp');\n if (webp?.type === 'image/webp') return webp;\n const type = hasTransparency(canvas) ? 'image/png' : 'image/jpeg';\n const fallback = await toBlob(canvas, type);\n if (!fallback) throw new Error('canvas encode failed');\n return fallback;\n};\n"],"mappings":"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"}
@@ -0,0 +1,39 @@
1
+ var InputType;
2
+ (function(InputType) {
3
+ InputType["TEXT"] = "text";
4
+ InputType["PASSWORD"] = "password";
5
+ InputType["OTP"] = "one-time-password";
6
+ InputType["EMAIL"] = "email";
7
+ InputType["NUMBER"] = "number";
8
+ InputType["PHONE"] = "phone";
9
+ InputType["DATE"] = "date";
10
+ InputType["TIME"] = "time";
11
+ InputType["DATETIME"] = "datetime";
12
+ InputType["CHECKBOX"] = "checkbox";
13
+ InputType["CHECKBOX_GROUP"] = "checkbox_group";
14
+ InputType["RADIO"] = "radio";
15
+ InputType["RADIO_GROUP"] = "radio_group";
16
+ InputType["DROPDOWN"] = "dropdown";
17
+ InputType["MULTISELECT"] = "multiselect";
18
+ InputType["TEXTAREA"] = "textarea";
19
+ InputType["FILE"] = "file";
20
+ InputType["FOLDER"] = "folder";
21
+ InputType["RANGE"] = "range";
22
+ InputType["MULTI_RANGE"] = "multi_range";
23
+ InputType["TOGGLE"] = "toggle";
24
+ InputType["DATA_TOGGLE"] = "data_toggle";
25
+ InputType["TOGGLE_RADIO"] = "toggle_radio";
26
+ InputType["SEARCH"] = "search";
27
+ InputType["URL"] = "url";
28
+ InputType["COLOR"] = "color";
29
+ InputType["MONTH"] = "month";
30
+ InputType["WEEK"] = "week";
31
+ InputType["MONEY"] = "money";
32
+ InputType["AUTOFILL"] = "autofill";
33
+ InputType["SELECTABLE_CARD"] = "selectable_card";
34
+ InputType["RATING"] = "rating";
35
+ InputType["COMPONENT"] = "component";
36
+ })(InputType || (InputType = {}));
37
+ export { InputType as t };
38
+
39
+ //# sourceMappingURL=magmonium-one-input-DqHPorA1.mjs.map
@@ -0,0 +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\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"}
@@ -0,0 +1,574 @@
1
+ import { c as TranslatePipe, l as TranslateService, v as HttpService } from "./magmonium-one-size-converter-B-UubQQ0.mjs";
2
+ import * as i0 from "@angular/core";
3
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Pipe, inject, input } from "@angular/core";
4
+ import { interval } from "rxjs";
5
+ const SECONDS_IN_MINUTE = 60;
6
+ const SECONDS_IN_HOUR = 3600;
7
+ const SECONDS_IN_DAY = 86400;
8
+ const SECONDS_IN_MONTH = 2592e3;
9
+ const SECONDS_IN_YEAR = 31536e3;
10
+ var TimeAgoPipe = class TimeAgoPipe {
11
+ translateService = inject(TranslateService);
12
+ cdr = inject(ChangeDetectorRef);
13
+ timerSubscription = null;
14
+ lastValue = void 0;
15
+ transform(value) {
16
+ if (!value) return "";
17
+ if (value !== this.lastValue) {
18
+ this.lastValue = value;
19
+ this.setupTimer();
20
+ }
21
+ const date = typeof value === "string" ? new Date(value) : value;
22
+ const seconds = Math.floor(((/* @__PURE__ */ new Date()).getTime() - date.getTime()) / 1e3);
23
+ if (seconds < SECONDS_IN_MINUTE) return this.translateService.translate("just-now");
24
+ let count;
25
+ let unit;
26
+ if (seconds < SECONDS_IN_HOUR) {
27
+ count = Math.floor(seconds / SECONDS_IN_MINUTE);
28
+ unit = count === 1 ? "minute" : "minutes";
29
+ } else if (seconds < SECONDS_IN_DAY) {
30
+ count = Math.floor(seconds / SECONDS_IN_HOUR);
31
+ unit = count === 1 ? "hour" : "hours";
32
+ } else if (seconds < SECONDS_IN_MONTH) {
33
+ count = Math.floor(seconds / SECONDS_IN_DAY);
34
+ unit = count === 1 ? "day" : "days";
35
+ } else if (seconds < SECONDS_IN_YEAR) {
36
+ count = Math.floor(seconds / SECONDS_IN_MONTH);
37
+ unit = count === 1 ? "month" : "months";
38
+ } else {
39
+ count = Math.floor(seconds / SECONDS_IN_YEAR);
40
+ unit = count === 1 ? "year" : "years";
41
+ }
42
+ return this.translateService.translate(`time-ago?count=${count}&unit=${unit}`);
43
+ }
44
+ setupTimer() {
45
+ this.clearTimer();
46
+ this.timerSubscription = interval(3e4).subscribe(() => {
47
+ this.cdr.detectChanges();
48
+ });
49
+ }
50
+ clearTimer() {
51
+ if (this.timerSubscription) {
52
+ this.timerSubscription.unsubscribe();
53
+ this.timerSubscription = null;
54
+ }
55
+ }
56
+ ngOnDestroy() {
57
+ this.clearTimer();
58
+ }
59
+ static ɵfac = i0.ɵɵngDeclareFactory({
60
+ minVersion: "12.0.0",
61
+ version: "22.2.1",
62
+ ngImport: i0,
63
+ type: TimeAgoPipe,
64
+ deps: [],
65
+ target: i0.ɵɵFactoryTarget.Pipe
66
+ });
67
+ static ɵpipe = i0.ɵɵngDeclarePipe({
68
+ minVersion: "14.0.0",
69
+ version: "22.2.1",
70
+ ngImport: i0,
71
+ type: TimeAgoPipe,
72
+ isStandalone: true,
73
+ name: "timeAgo",
74
+ pure: false
75
+ });
76
+ };
77
+ i0.ɵɵngDeclareClassMetadata({
78
+ minVersion: "12.0.0",
79
+ version: "22.2.1",
80
+ ngImport: i0,
81
+ type: TimeAgoPipe,
82
+ decorators: [{
83
+ type: Pipe,
84
+ args: [{
85
+ name: "timeAgo",
86
+ pure: false
87
+ }]
88
+ }]
89
+ });
90
+ const IN_THRESHOLDS = [
91
+ {
92
+ min: 1e7,
93
+ labelKey: "cr",
94
+ overflowAt: Infinity
95
+ },
96
+ {
97
+ min: 1e5,
98
+ labelKey: "l",
99
+ overflowAt: 100
100
+ },
101
+ {
102
+ min: 1e3,
103
+ labelKey: "k",
104
+ overflowAt: 100
105
+ }
106
+ ];
107
+ const INTL_THRESHOLDS = [
108
+ {
109
+ min: 0xe8d4a51000,
110
+ labelKey: "t",
111
+ overflowAt: Infinity
112
+ },
113
+ {
114
+ min: 1e9,
115
+ labelKey: "b",
116
+ overflowAt: 1e3
117
+ },
118
+ {
119
+ min: 1e6,
120
+ labelKey: "m",
121
+ overflowAt: 1e3
122
+ },
123
+ {
124
+ min: 1e3,
125
+ labelKey: "k",
126
+ overflowAt: 1e3
127
+ }
128
+ ];
129
+ const formatMoney = (value, system) => {
130
+ const thresholds = system === "IN" ? IN_THRESHOLDS : INTL_THRESHOLDS;
131
+ for (let i = 0; i < thresholds.length; i++) {
132
+ const { min, labelKey, overflowAt } = thresholds[i];
133
+ if (value >= min) {
134
+ const rounded = parseFloat((value / min).toFixed(1));
135
+ if (rounded >= overflowAt && i > 0) {
136
+ const higher = thresholds[i - 1];
137
+ return {
138
+ amount: parseFloat((value / higher.min).toFixed(1)).toString(),
139
+ labelKey: higher.labelKey
140
+ };
141
+ }
142
+ return {
143
+ amount: rounded.toString(),
144
+ labelKey
145
+ };
146
+ }
147
+ }
148
+ return {
149
+ amount: parseFloat(value.toFixed(2)).toString(),
150
+ labelKey: ""
151
+ };
152
+ };
153
+ var MoneyPipe = class MoneyPipe {
154
+ translateService = inject(TranslateService);
155
+ transform(value, system = "IN", symbol = "₹", forceSign = false) {
156
+ if (value == null || isNaN(value)) return "";
157
+ if (value === 0) return `${symbol}0`;
158
+ const isNegative = value < 0;
159
+ const { amount, labelKey } = formatMoney(Math.abs(value), system);
160
+ const label = labelKey ? ` ${this.translateService.translate(labelKey)}` : "";
161
+ return `${isNegative ? "-" : forceSign ? "+" : ""}${symbol}${amount}${label}`;
162
+ }
163
+ static ɵfac = i0.ɵɵngDeclareFactory({
164
+ minVersion: "12.0.0",
165
+ version: "22.2.1",
166
+ ngImport: i0,
167
+ type: MoneyPipe,
168
+ deps: [],
169
+ target: i0.ɵɵFactoryTarget.Pipe
170
+ });
171
+ static ɵpipe = i0.ɵɵngDeclarePipe({
172
+ minVersion: "14.0.0",
173
+ version: "22.2.1",
174
+ ngImport: i0,
175
+ type: MoneyPipe,
176
+ isStandalone: true,
177
+ name: "money",
178
+ pure: false
179
+ });
180
+ };
181
+ i0.ɵɵngDeclareClassMetadata({
182
+ minVersion: "12.0.0",
183
+ version: "22.2.1",
184
+ ngImport: i0,
185
+ type: MoneyPipe,
186
+ decorators: [{
187
+ type: Pipe,
188
+ args: [{
189
+ name: "money",
190
+ pure: false
191
+ }]
192
+ }]
193
+ });
194
+ var PercentagePipe = class PercentagePipe {
195
+ transform(value, decimals = 2, forceSign = false) {
196
+ if (value == null || isNaN(value)) return "";
197
+ const digits = Math.max(0, Math.trunc(decimals));
198
+ const rendered = Math.abs(value).toFixed(digits);
199
+ return `${value < 0 && Number(rendered) !== 0 ? "-" : forceSign && Number(rendered) !== 0 ? "+" : ""}${rendered}%`;
200
+ }
201
+ static ɵfac = i0.ɵɵngDeclareFactory({
202
+ minVersion: "12.0.0",
203
+ version: "22.2.1",
204
+ ngImport: i0,
205
+ type: PercentagePipe,
206
+ deps: [],
207
+ target: i0.ɵɵFactoryTarget.Pipe
208
+ });
209
+ static ɵpipe = i0.ɵɵngDeclarePipe({
210
+ minVersion: "14.0.0",
211
+ version: "22.2.1",
212
+ ngImport: i0,
213
+ type: PercentagePipe,
214
+ isStandalone: true,
215
+ name: "percentage"
216
+ });
217
+ };
218
+ i0.ɵɵngDeclareClassMetadata({
219
+ minVersion: "12.0.0",
220
+ version: "22.2.1",
221
+ ngImport: i0,
222
+ type: PercentagePipe,
223
+ decorators: [{
224
+ type: Pipe,
225
+ args: [{ name: "percentage" }]
226
+ }]
227
+ });
228
+ var CompactNumberPipe = class CompactNumberPipe {
229
+ translateService = inject(TranslateService);
230
+ transform(value, system = "IN", forceSign = false) {
231
+ if (value == null || isNaN(value)) return "";
232
+ if (value === 0) return "0";
233
+ const { amount, labelKey } = formatMoney(Math.abs(value), system);
234
+ if (Number(amount) === 0) return "0";
235
+ const label = labelKey ? ` ${this.translateService.translate(labelKey)}` : "";
236
+ return `${value < 0 ? "-" : forceSign ? "+" : ""}${amount}${label}`;
237
+ }
238
+ static ɵfac = i0.ɵɵngDeclareFactory({
239
+ minVersion: "12.0.0",
240
+ version: "22.2.1",
241
+ ngImport: i0,
242
+ type: CompactNumberPipe,
243
+ deps: [],
244
+ target: i0.ɵɵFactoryTarget.Pipe
245
+ });
246
+ static ɵpipe = i0.ɵɵngDeclarePipe({
247
+ minVersion: "14.0.0",
248
+ version: "22.2.1",
249
+ ngImport: i0,
250
+ type: CompactNumberPipe,
251
+ isStandalone: true,
252
+ name: "compactNumber",
253
+ pure: false
254
+ });
255
+ };
256
+ i0.ɵɵngDeclareClassMetadata({
257
+ minVersion: "12.0.0",
258
+ version: "22.2.1",
259
+ ngImport: i0,
260
+ type: CompactNumberPipe,
261
+ decorators: [{
262
+ type: Pipe,
263
+ args: [{
264
+ name: "compactNumber",
265
+ pure: false
266
+ }]
267
+ }]
268
+ });
269
+ var AssetUrlPipe = class AssetUrlPipe {
270
+ http = inject(HttpService);
271
+ transform(value) {
272
+ return this.http.getAssetUrl(value);
273
+ }
274
+ static ɵfac = i0.ɵɵngDeclareFactory({
275
+ minVersion: "12.0.0",
276
+ version: "22.2.1",
277
+ ngImport: i0,
278
+ type: AssetUrlPipe,
279
+ deps: [],
280
+ target: i0.ɵɵFactoryTarget.Pipe
281
+ });
282
+ static ɵpipe = i0.ɵɵngDeclarePipe({
283
+ minVersion: "14.0.0",
284
+ version: "22.2.1",
285
+ ngImport: i0,
286
+ type: AssetUrlPipe,
287
+ isStandalone: true,
288
+ name: "assetUrl"
289
+ });
290
+ };
291
+ i0.ɵɵngDeclareClassMetadata({
292
+ minVersion: "12.0.0",
293
+ version: "22.2.1",
294
+ ngImport: i0,
295
+ type: AssetUrlPipe,
296
+ decorators: [{
297
+ type: Pipe,
298
+ args: [{ name: "assetUrl" }]
299
+ }]
300
+ });
301
+ const sectionTableColumnId = (column, index) => column.id || String(index);
302
+ const sectionTableColumnWidths = (columns) => columns.map(({ span }) => {
303
+ if (span == null || !Number.isFinite(span)) return void 0;
304
+ return `${Math.min(12, Math.max(1, Math.round(span))) * 100 / 12}%`;
305
+ });
306
+ const sectionTableFrozenCount = (columns) => {
307
+ let last = -1;
308
+ columns.forEach((column, i) => {
309
+ if (column.freeze) last = i;
310
+ });
311
+ return last + 1;
312
+ };
313
+ const nextSectionTableSort = (current, id, dataType) => current?.id === id ? {
314
+ id,
315
+ dataType,
316
+ direction: current.direction === "asc" ? "desc" : "asc"
317
+ } : {
318
+ id,
319
+ dataType,
320
+ direction: "asc"
321
+ };
322
+ const readPath = (row, path) => path.split(".").reduce((value, key) => value != null && typeof value === "object" ? value[key] : void 0, row);
323
+ const comparable = (value, dataType) => {
324
+ if (value == null || value === "") return void 0;
325
+ if (dataType === "number") {
326
+ const n = typeof value === "number" ? value : Number(value);
327
+ return Number.isNaN(n) ? void 0 : n;
328
+ }
329
+ if (dataType === "date") {
330
+ const t = value instanceof Date ? value.getTime() : new Date(String(value)).getTime();
331
+ return Number.isNaN(t) ? void 0 : t;
332
+ }
333
+ return String(value).toLocaleLowerCase();
334
+ };
335
+ const sortSectionTableRows = (rows, sort) => {
336
+ const list = [...rows ?? []];
337
+ if (!sort) return list;
338
+ const sign = sort.direction === "asc" ? 1 : -1;
339
+ return list.map((row, i) => ({
340
+ row,
341
+ i,
342
+ key: comparable(readPath(row, sort.id), sort.dataType)
343
+ })).sort((a, b) => {
344
+ if (a.key === void 0 || b.key === void 0) {
345
+ if (a.key === b.key) return a.i - b.i;
346
+ return a.key === void 0 ? 1 : -1;
347
+ }
348
+ const diff = typeof a.key === "number" && typeof b.key === "number" ? a.key - b.key : String(a.key).localeCompare(String(b.key));
349
+ return diff === 0 ? a.i - b.i : diff * sign;
350
+ }).map(({ row }) => row);
351
+ };
352
+ var SectionTableSortPipe = class SectionTableSortPipe {
353
+ transform(rows, sort) {
354
+ return sortSectionTableRows(rows, sort);
355
+ }
356
+ static ɵfac = i0.ɵɵngDeclareFactory({
357
+ minVersion: "12.0.0",
358
+ version: "22.2.1",
359
+ ngImport: i0,
360
+ type: SectionTableSortPipe,
361
+ deps: [],
362
+ target: i0.ɵɵFactoryTarget.Pipe
363
+ });
364
+ static ɵpipe = i0.ɵɵngDeclarePipe({
365
+ minVersion: "14.0.0",
366
+ version: "22.2.1",
367
+ ngImport: i0,
368
+ type: SectionTableSortPipe,
369
+ isStandalone: true,
370
+ name: "sectionTableSort"
371
+ });
372
+ };
373
+ i0.ɵɵngDeclareClassMetadata({
374
+ minVersion: "12.0.0",
375
+ version: "22.2.1",
376
+ ngImport: i0,
377
+ type: SectionTableSortPipe,
378
+ decorators: [{
379
+ type: Pipe,
380
+ args: [{ name: "sectionTableSort" }]
381
+ }]
382
+ });
383
+ var LabelComponent = class LabelComponent {
384
+ for = input(...ngDevMode ? [void 0, { debugName: "for" }] : /* istanbul ignore next */ []);
385
+ placeholder = input(...ngDevMode ? [void 0, { debugName: "placeholder" }] : /* istanbul ignore next */ []);
386
+ params = input(...ngDevMode ? [void 0, { debugName: "params" }] : /* istanbul ignore next */ []);
387
+ required = input(...ngDevMode ? [void 0, { debugName: "required" }] : /* istanbul ignore next */ []);
388
+ disabled = input(...ngDevMode ? [void 0, { debugName: "disabled" }] : /* istanbul ignore next */ []);
389
+ color = input(...ngDevMode ? [void 0, { debugName: "color" }] : /* istanbul ignore next */ []);
390
+ noTranslate = input(...ngDevMode ? [void 0, { debugName: "noTranslate" }] : /* istanbul ignore next */ []);
391
+ static ɵfac = i0.ɵɵngDeclareFactory({
392
+ minVersion: "12.0.0",
393
+ version: "22.2.1",
394
+ ngImport: i0,
395
+ type: LabelComponent,
396
+ deps: [],
397
+ target: i0.ɵɵFactoryTarget.Component
398
+ });
399
+ static ɵcmp = i0.ɵɵngDeclareComponent({
400
+ minVersion: "17.0.0",
401
+ version: "22.2.1",
402
+ type: LabelComponent,
403
+ isStandalone: true,
404
+ selector: "m-label",
405
+ inputs: {
406
+ for: {
407
+ classPropertyName: "for",
408
+ publicName: "for",
409
+ isSignal: true,
410
+ isRequired: false,
411
+ transformFunction: null
412
+ },
413
+ placeholder: {
414
+ classPropertyName: "placeholder",
415
+ publicName: "placeholder",
416
+ isSignal: true,
417
+ isRequired: false,
418
+ transformFunction: null
419
+ },
420
+ params: {
421
+ classPropertyName: "params",
422
+ publicName: "params",
423
+ isSignal: true,
424
+ isRequired: false,
425
+ transformFunction: null
426
+ },
427
+ required: {
428
+ classPropertyName: "required",
429
+ publicName: "required",
430
+ isSignal: true,
431
+ isRequired: false,
432
+ transformFunction: null
433
+ },
434
+ disabled: {
435
+ classPropertyName: "disabled",
436
+ publicName: "disabled",
437
+ isSignal: true,
438
+ isRequired: false,
439
+ transformFunction: null
440
+ },
441
+ color: {
442
+ classPropertyName: "color",
443
+ publicName: "color",
444
+ isSignal: true,
445
+ isRequired: false,
446
+ transformFunction: null
447
+ },
448
+ noTranslate: {
449
+ classPropertyName: "noTranslate",
450
+ publicName: "noTranslate",
451
+ isSignal: true,
452
+ isRequired: false,
453
+ transformFunction: null
454
+ }
455
+ },
456
+ ngImport: i0,
457
+ template: `
458
+ <label
459
+ [class.required]="required()"
460
+ [class.disabled]="disabled()"
461
+ [attr.for]="for() || null"
462
+ >
463
+ @if (color()) {
464
+ <span class="label__swatch" [style.background]="color()"></span>
465
+ }
466
+ @if (noTranslate()) {
467
+ {{ placeholder() }}
468
+ } @else {
469
+ {{ placeholder() | translate: params() }}
470
+ }
471
+ </label>
472
+ `,
473
+ isInline: true,
474
+ styles: ["@keyframes toggle-pulse{0%,to{transform:scale(1)}50%{transform:scale(1.02)}}@keyframes thumb-slide{0%{transform:translate(0) scale(1)}50%{transform:translate(.3em) scale(.9)}to{transform:translate(.6em) scale(1)}}:host{display:contents}label{position:relative;display:flex;align-items:center;gap:calc(var(--m-label-size, var(--input-size, 1em)) * .375);width:var(--m-label-width, var(--m-text-input-label-width, auto));margin:var(--m-label-margin, var(--m-text-input-label-margin, 0 0 calc(var(--m-label-size, var(--input-size, 1em)) * .5)));padding-left:var(--m-label-required-space, .75em);font-size:var(--m-label-font-size, calc(var(--m-label-size, var(--input-size, 1em)) * .8));font-weight:var(--m-label-weight, var(--m-text-input-label-weight, 300));line-height:1.4;cursor:pointer;color:var(--m-label-color, var(--m-text-secondary));transition:color .2s ease}label.required:before{content:\"*\";position:absolute;left:0;top:0;color:var(--m-error);font-weight:600}label.disabled{color:var(--m-text-secondary);cursor:not-allowed}label .label__swatch{width:1em;height:1em;border-radius:calc(var(--m-label-size, var(--input-size, 1em)) * .4);border:1px solid var(--m-border);flex-shrink:0}:host-context(m-text-input:focus-within) label,:host-context(m-textarea-input:focus-within) label,:host-context(m-dropdown-input:focus-within) label,:host-context(m-checkbox:focus-within) label,:host-context(m-radio:focus-within) label{color:var(--m-label-focus-color, var(--m-focus))}\n"],
475
+ dependencies: [{
476
+ kind: "pipe",
477
+ type: TranslatePipe,
478
+ name: "translate"
479
+ }],
480
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
481
+ });
482
+ };
483
+ i0.ɵɵngDeclareClassMetadata({
484
+ minVersion: "12.0.0",
485
+ version: "22.2.1",
486
+ ngImport: i0,
487
+ type: LabelComponent,
488
+ decorators: [{
489
+ type: Component,
490
+ args: [{
491
+ selector: "m-label",
492
+ template: `
493
+ <label
494
+ [class.required]="required()"
495
+ [class.disabled]="disabled()"
496
+ [attr.for]="for() || null"
497
+ >
498
+ @if (color()) {
499
+ <span class="label__swatch" [style.background]="color()"></span>
500
+ }
501
+ @if (noTranslate()) {
502
+ {{ placeholder() }}
503
+ } @else {
504
+ {{ placeholder() | translate: params() }}
505
+ }
506
+ </label>
507
+ `,
508
+ imports: [TranslatePipe],
509
+ changeDetection: ChangeDetectionStrategy.OnPush,
510
+ styles: ["@keyframes toggle-pulse{0%,to{transform:scale(1)}50%{transform:scale(1.02)}}@keyframes thumb-slide{0%{transform:translate(0) scale(1)}50%{transform:translate(.3em) scale(.9)}to{transform:translate(.6em) scale(1)}}:host{display:contents}label{position:relative;display:flex;align-items:center;gap:calc(var(--m-label-size, var(--input-size, 1em)) * .375);width:var(--m-label-width, var(--m-text-input-label-width, auto));margin:var(--m-label-margin, var(--m-text-input-label-margin, 0 0 calc(var(--m-label-size, var(--input-size, 1em)) * .5)));padding-left:var(--m-label-required-space, .75em);font-size:var(--m-label-font-size, calc(var(--m-label-size, var(--input-size, 1em)) * .8));font-weight:var(--m-label-weight, var(--m-text-input-label-weight, 300));line-height:1.4;cursor:pointer;color:var(--m-label-color, var(--m-text-secondary));transition:color .2s ease}label.required:before{content:\"*\";position:absolute;left:0;top:0;color:var(--m-error);font-weight:600}label.disabled{color:var(--m-text-secondary);cursor:not-allowed}label .label__swatch{width:1em;height:1em;border-radius:calc(var(--m-label-size, var(--input-size, 1em)) * .4);border:1px solid var(--m-border);flex-shrink:0}:host-context(m-text-input:focus-within) label,:host-context(m-textarea-input:focus-within) label,:host-context(m-dropdown-input:focus-within) label,:host-context(m-checkbox:focus-within) label,:host-context(m-radio:focus-within) label{color:var(--m-label-focus-color, var(--m-focus))}\n"]
511
+ }]
512
+ }],
513
+ propDecorators: {
514
+ for: [{
515
+ type: i0.Input,
516
+ args: [{
517
+ isSignal: true,
518
+ alias: "for",
519
+ required: false
520
+ }]
521
+ }],
522
+ placeholder: [{
523
+ type: i0.Input,
524
+ args: [{
525
+ isSignal: true,
526
+ alias: "placeholder",
527
+ required: false
528
+ }]
529
+ }],
530
+ params: [{
531
+ type: i0.Input,
532
+ args: [{
533
+ isSignal: true,
534
+ alias: "params",
535
+ required: false
536
+ }]
537
+ }],
538
+ required: [{
539
+ type: i0.Input,
540
+ args: [{
541
+ isSignal: true,
542
+ alias: "required",
543
+ required: false
544
+ }]
545
+ }],
546
+ disabled: [{
547
+ type: i0.Input,
548
+ args: [{
549
+ isSignal: true,
550
+ alias: "disabled",
551
+ required: false
552
+ }]
553
+ }],
554
+ color: [{
555
+ type: i0.Input,
556
+ args: [{
557
+ isSignal: true,
558
+ alias: "color",
559
+ required: false
560
+ }]
561
+ }],
562
+ noTranslate: [{
563
+ type: i0.Input,
564
+ args: [{
565
+ isSignal: true,
566
+ alias: "noTranslate",
567
+ required: false
568
+ }]
569
+ }]
570
+ }
571
+ });
572
+ export { sectionTableColumnWidths as a, AssetUrlPipe as c, MoneyPipe as d, TimeAgoPipe as f, sectionTableColumnId as i, CompactNumberPipe as l, SectionTableSortPipe as n, sectionTableFrozenCount as o, nextSectionTableSort as r, sortSectionTableRows as s, LabelComponent as t, PercentagePipe as u };
573
+
574
+ //# sourceMappingURL=magmonium-one-label-B30Q4Vut.mjs.map