@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,833 @@
1
+ import { p as AssetStore, r as resolveIconSize, v as HttpService, z as ICON_SOURCE } from "./magmonium-one-size-converter-B-UubQQ0.mjs";
2
+ import { m as ThemeStore, t as applyColorsToElement } from "./magmonium-one-color-utl-CirPzUFk.mjs";
3
+ import "./magmonium-one-theme-a7GlFbzE.mjs";
4
+ import * as i0 from "@angular/core";
5
+ import { ChangeDetectionStrategy, Component, ElementRef, HostListener, InjectionToken, computed, effect, inject, input, model, untracked } from "@angular/core";
6
+ import { of } from "rxjs";
7
+ import { rxResource } from "@angular/core/rxjs-interop";
8
+ import { catchError as catchError$1 } from "rxjs/operators";
9
+ const MAGMONIUM = `
10
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="-15 -15 120 165">
11
+ <g>
12
+ <path fill="#color" style="opacity: 0.7;" d="M5 5 L5 65 L85 65 Z" />
13
+ <path fill="#color" style="opacity: 0.3;" d="M85 5 L5 65 L85 65 Z" />
14
+ </g>
15
+ <g>
16
+ <path fill="#color" style="opacity: 0.3;" d="M5 70 L85 70 L5 130 Z" />
17
+ <path fill="#color" style="opacity: 0.7;" d="M85 70 L5 70 L85 130 Z" />
18
+ </g>
19
+ </svg>
20
+ `;
21
+ const SHARED_ICONS = [
22
+ "accordion_chevron",
23
+ "account_balance_wallet",
24
+ "activity",
25
+ "add-image",
26
+ "adjust",
27
+ "alert-circle",
28
+ "analytics",
29
+ "apps",
30
+ "arrow-down",
31
+ "arrow-left",
32
+ "arrow-left-right",
33
+ "arrow-right",
34
+ "arrow-up",
35
+ "arrow_back",
36
+ "bell",
37
+ "bold",
38
+ "books",
39
+ "calendar",
40
+ "calendar-open",
41
+ "camera",
42
+ "chat",
43
+ "check",
44
+ "chevron-down",
45
+ "chevron-left",
46
+ "chevron-right",
47
+ "chevron-up",
48
+ "chevron_left",
49
+ "chevrons-down",
50
+ "chevrons-left",
51
+ "chevrons-right",
52
+ "chevrons-up",
53
+ "clipboard",
54
+ "code",
55
+ "coins",
56
+ "color-picker",
57
+ "copy",
58
+ "copyright",
59
+ "corner-left-up",
60
+ "currency_exchange",
61
+ "dot",
62
+ "download",
63
+ "ellipsis-vertical",
64
+ "exclamation-triangle",
65
+ "eye",
66
+ "eye_close",
67
+ "file-code",
68
+ "file-data",
69
+ "file-image",
70
+ "file-markup",
71
+ "file-style",
72
+ "file-text",
73
+ "fixed",
74
+ "flower",
75
+ "folder",
76
+ "games",
77
+ "gear",
78
+ "heading",
79
+ "heart",
80
+ "heart_filled",
81
+ "help",
82
+ "hero",
83
+ "info",
84
+ "install",
85
+ "instrument",
86
+ "investments",
87
+ "italic",
88
+ "language",
89
+ "layers",
90
+ "layouts",
91
+ "link",
92
+ "link-broken",
93
+ "list",
94
+ "loading",
95
+ "loading-bars",
96
+ "loading-dots",
97
+ "loading-logo",
98
+ "loading-pulse",
99
+ "location",
100
+ "lock",
101
+ "logo",
102
+ "magazines",
103
+ "mail",
104
+ "menu",
105
+ "mic",
106
+ "minus",
107
+ "monitor",
108
+ "more",
109
+ "notification",
110
+ "notification_off",
111
+ "open",
112
+ "pause",
113
+ "pencil",
114
+ "play",
115
+ "plus",
116
+ "posts",
117
+ "quote",
118
+ "redo",
119
+ "reload",
120
+ "reset",
121
+ "save",
122
+ "scissors",
123
+ "search",
124
+ "section",
125
+ "security",
126
+ "settings",
127
+ "shield",
128
+ "smartphone",
129
+ "sort-alpha-asc",
130
+ "sort-alpha-desc",
131
+ "sparkles",
132
+ "square",
133
+ "star",
134
+ "store",
135
+ "strategies",
136
+ "strikethrough",
137
+ "sun",
138
+ "table",
139
+ "tablet",
140
+ "target",
141
+ "theme",
142
+ "trash",
143
+ "trash-2",
144
+ "trending-down",
145
+ "trending-up",
146
+ "undo",
147
+ "user",
148
+ "users",
149
+ "wallet_manager",
150
+ "wallet_owner",
151
+ "wallet_shareholder",
152
+ "wand",
153
+ "wifi",
154
+ "x",
155
+ "zap"
156
+ ];
157
+ function isOneIcon(element, config) {
158
+ if (typeof config?.one !== "undefined") return !!config.one;
159
+ if (config?.name && SHARED_ICONS.includes(config.name)) return true;
160
+ return element.nativeElement.tagName === "M-ONE-ICON";
161
+ }
162
+ function textToSvg(str = MAGMONIUM, color) {
163
+ if (typeof str !== "string") return str;
164
+ return str.replace(/#color/g, color).replace(/currentColor/g, color);
165
+ }
166
+ function svgElementFromString(str, color) {
167
+ const parser = new DOMParser();
168
+ const svg = parser.parseFromString(textToSvg(str, color), "image/svg+xml").documentElement;
169
+ if (svg && svg.nodeName === "svg") return svg;
170
+ return parser.parseFromString(textToSvg(MAGMONIUM, color), "image/svg+xml").documentElement;
171
+ }
172
+ const SIZE_CONTEXT = new InjectionToken("SIZE_CONTEXT");
173
+ function provideSizeContext(declarer) {
174
+ return {
175
+ provide: SIZE_CONTEXT,
176
+ useFactory: () => ({ size: inject(declarer).resolvedSize })
177
+ };
178
+ }
179
+ function injectParentSize() {
180
+ return inject(SIZE_CONTEXT, {
181
+ optional: true,
182
+ skipSelf: true
183
+ });
184
+ }
185
+ var IconComponent = class IconComponent {
186
+ config = model(void 0, ...ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []);
187
+ name = input(...ngDevMode ? [void 0, { debugName: "name" }] : /* istanbul ignore next */ []);
188
+ color = input(...ngDevMode ? [void 0, { debugName: "color" }] : /* istanbul ignore next */ []);
189
+ size = input(...ngDevMode ? [void 0, { debugName: "size" }] : /* istanbul ignore next */ []);
190
+ one = input(...ngDevMode ? [void 0, { debugName: "one" }] : /* istanbul ignore next */ []);
191
+ baseUrl = input(...ngDevMode ? [void 0, { debugName: "baseUrl" }] : /* istanbul ignore next */ []);
192
+ remote = input(...ngDevMode ? [void 0, { debugName: "remote" }] : /* istanbul ignore next */ []);
193
+ resolvedConfig = computed(() => {
194
+ const config = this.config();
195
+ const overrides = {};
196
+ const name = this.name();
197
+ if (name !== void 0) overrides.name = name;
198
+ const color = this.color();
199
+ if (color !== void 0) overrides.color = color;
200
+ const one = this.one();
201
+ if (one !== void 0) overrides.one = one;
202
+ const baseUrl = this.baseUrl();
203
+ if (baseUrl !== void 0) overrides.baseUrl = baseUrl;
204
+ const remote = this.remote();
205
+ if (remote !== void 0) overrides.remote = remote;
206
+ if (!config && !Object.keys(overrides).length) return void 0;
207
+ return {
208
+ ...config,
209
+ ...overrides
210
+ };
211
+ }, ...ngDevMode ? [{ debugName: "resolvedConfig" }] : /* istanbul ignore next */ []);
212
+ elementRef = inject(ElementRef);
213
+ sizeContext = inject(SIZE_CONTEXT, { optional: true });
214
+ assetStore = inject(AssetStore);
215
+ http = inject(HttpService);
216
+ currentSvgElement = null;
217
+ themeStore = inject(ThemeStore);
218
+ isOneIcon = computed(() => isOneIcon(this.elementRef, this.resolvedConfig()), ...ngDevMode ? [{ debugName: "isOneIcon" }] : /* istanbul ignore next */ []);
219
+ remoteBaseUrl = computed(() => {
220
+ const remoteId = this.resolvedConfig()?.remote;
221
+ return remoteId ? this.http.buildWcAssetBaseUrl(remoteId) : void 0;
222
+ }, ...ngDevMode ? [{ debugName: "remoteBaseUrl" }] : /* istanbul ignore next */ []);
223
+ iconSource = inject(ICON_SOURCE, { optional: true });
224
+ inlineSvg = computed(() => {
225
+ const name = this.resolvedConfig()?.name;
226
+ return name ? this.iconSource?.()?.[name] : void 0;
227
+ }, ...ngDevMode ? [{ debugName: "inlineSvg" }] : /* istanbul ignore next */ []);
228
+ text = rxResource({
229
+ params: computed(() => ({
230
+ name: this.resolvedConfig()?.name,
231
+ isOneIcon: untracked(() => this.isOneIcon()),
232
+ remoteBaseUrl: this.remoteBaseUrl()
233
+ }), { equal: (a, b) => a?.name === b?.name && a?.remoteBaseUrl === b?.remoteBaseUrl }),
234
+ stream: ({ params: { name, isOneIcon, remoteBaseUrl } }) => {
235
+ if (!name) return untracked(() => this.assetStore.resolve("icons", "logo", true).pipe(catchError$1(() => of(MAGMONIUM))));
236
+ const inline = untracked(() => this.inlineSvg());
237
+ if (inline) return of(inline);
238
+ return untracked(() => this.assetStore.resolve("icons", name, isOneIcon, remoteBaseUrl).pipe(catchError$1(() => of(MAGMONIUM))));
239
+ }
240
+ });
241
+ pallet = computed(() => applyColorsToElement(this.resolvedConfig()?.color ?? this.themeStore.color()?.mm ?? "#fff", this.themeStore.color(), this.elementRef.nativeElement), ...ngDevMode ? [{ debugName: "pallet" }] : /* istanbul ignore next */ []);
242
+ constructor() {
243
+ effect(this.updateElement);
244
+ effect(this.applySize);
245
+ }
246
+ applySize = () => {
247
+ this.elementRef.nativeElement.style.setProperty("--m-icon-size", resolveIconSize(this.size(), this.sizeContext?.size()));
248
+ };
249
+ updateElement = () => {
250
+ const element = this.elementRef.nativeElement;
251
+ if (this.currentSvgElement) {
252
+ this.currentSvgElement.remove();
253
+ this.currentSvgElement = null;
254
+ }
255
+ const svg = svgElementFromString(this.inlineSvg() ?? this.text.value(), this.pallet()?.color ?? this.themeStore.color()?.mm ?? "#fff");
256
+ if (!svg) return;
257
+ this.currentSvgElement = svg;
258
+ svg.removeAttribute("width");
259
+ svg.removeAttribute("height");
260
+ svg.style.width = "var(--m-icon-size, 1em)";
261
+ svg.style.height = "var(--m-icon-size, 1em)";
262
+ svg.style.flexShrink = "0";
263
+ svg.removeAttribute("stroke-width");
264
+ svg.style.setProperty("stroke-width", "2px");
265
+ svg.querySelectorAll("*").forEach((el) => {
266
+ el.removeAttribute("stroke-width");
267
+ if (el instanceof HTMLElement || el instanceof SVGElement) el.style.removeProperty("stroke-width");
268
+ });
269
+ element.prepend(svg);
270
+ };
271
+ static ɵfac = i0.ɵɵngDeclareFactory({
272
+ minVersion: "12.0.0",
273
+ version: "22.2.1",
274
+ ngImport: i0,
275
+ type: IconComponent,
276
+ deps: [],
277
+ target: i0.ɵɵFactoryTarget.Component
278
+ });
279
+ static ɵcmp = i0.ɵɵngDeclareComponent({
280
+ minVersion: "17.1.0",
281
+ version: "22.2.1",
282
+ type: IconComponent,
283
+ isStandalone: true,
284
+ selector: "m-icon, m-one-icon",
285
+ inputs: {
286
+ config: {
287
+ classPropertyName: "config",
288
+ publicName: "config",
289
+ isSignal: true,
290
+ isRequired: false,
291
+ transformFunction: null
292
+ },
293
+ name: {
294
+ classPropertyName: "name",
295
+ publicName: "name",
296
+ isSignal: true,
297
+ isRequired: false,
298
+ transformFunction: null
299
+ },
300
+ color: {
301
+ classPropertyName: "color",
302
+ publicName: "color",
303
+ isSignal: true,
304
+ isRequired: false,
305
+ transformFunction: null
306
+ },
307
+ size: {
308
+ classPropertyName: "size",
309
+ publicName: "size",
310
+ isSignal: true,
311
+ isRequired: false,
312
+ transformFunction: null
313
+ },
314
+ one: {
315
+ classPropertyName: "one",
316
+ publicName: "one",
317
+ isSignal: true,
318
+ isRequired: false,
319
+ transformFunction: null
320
+ },
321
+ baseUrl: {
322
+ classPropertyName: "baseUrl",
323
+ publicName: "baseUrl",
324
+ isSignal: true,
325
+ isRequired: false,
326
+ transformFunction: null
327
+ },
328
+ remote: {
329
+ classPropertyName: "remote",
330
+ publicName: "remote",
331
+ isSignal: true,
332
+ isRequired: false,
333
+ transformFunction: null
334
+ }
335
+ },
336
+ outputs: { config: "configChange" },
337
+ host: { properties: { "class.has-color": "resolvedConfig()?.color" } },
338
+ ngImport: i0,
339
+ template: `<ng-content></ng-content>`,
340
+ isInline: true,
341
+ 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:inline-flex;align-items:center;justify-content:center;height:var(--m-icon-size, 1em);width:var(--m-icon-size, 1em);overflow:hidden}:host svg{width:var(--m-icon-size, 1em);height:var(--m-icon-size, 1em);flex-shrink:0;overflow:visible;fill:var(--m-icon-fill, currentColor);stroke:var(--m-icon-stroke, currentColor)}:host svg path,:host svg circle,:host svg rect,:host svg line,:host svg polyline,:host svg polygon,:host svg ellipse{stroke-width:2px;vector-effect:non-scaling-stroke}:host.has-color{color:var(--m-icon-color, inherit)}:host:has(>:not(svg)){width:auto;gap:.25rem;justify-content:flex-start;overflow:visible}\n"],
342
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
343
+ });
344
+ };
345
+ i0.ɵɵngDeclareClassMetadata({
346
+ minVersion: "12.0.0",
347
+ version: "22.2.1",
348
+ ngImport: i0,
349
+ type: IconComponent,
350
+ decorators: [{
351
+ type: Component,
352
+ args: [{
353
+ selector: "m-icon, m-one-icon",
354
+ template: `<ng-content></ng-content>`,
355
+ host: { "[class.has-color]": "resolvedConfig()?.color" },
356
+ changeDetection: ChangeDetectionStrategy.OnPush,
357
+ 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:inline-flex;align-items:center;justify-content:center;height:var(--m-icon-size, 1em);width:var(--m-icon-size, 1em);overflow:hidden}:host svg{width:var(--m-icon-size, 1em);height:var(--m-icon-size, 1em);flex-shrink:0;overflow:visible;fill:var(--m-icon-fill, currentColor);stroke:var(--m-icon-stroke, currentColor)}:host svg path,:host svg circle,:host svg rect,:host svg line,:host svg polyline,:host svg polygon,:host svg ellipse{stroke-width:2px;vector-effect:non-scaling-stroke}:host.has-color{color:var(--m-icon-color, inherit)}:host:has(>:not(svg)){width:auto;gap:.25rem;justify-content:flex-start;overflow:visible}\n"]
358
+ }]
359
+ }],
360
+ ctorParameters: () => [],
361
+ propDecorators: {
362
+ config: [{
363
+ type: i0.Input,
364
+ args: [{
365
+ isSignal: true,
366
+ alias: "config",
367
+ required: false
368
+ }]
369
+ }, {
370
+ type: i0.Output,
371
+ args: ["configChange"]
372
+ }],
373
+ name: [{
374
+ type: i0.Input,
375
+ args: [{
376
+ isSignal: true,
377
+ alias: "name",
378
+ required: false
379
+ }]
380
+ }],
381
+ color: [{
382
+ type: i0.Input,
383
+ args: [{
384
+ isSignal: true,
385
+ alias: "color",
386
+ required: false
387
+ }]
388
+ }],
389
+ size: [{
390
+ type: i0.Input,
391
+ args: [{
392
+ isSignal: true,
393
+ alias: "size",
394
+ required: false
395
+ }]
396
+ }],
397
+ one: [{
398
+ type: i0.Input,
399
+ args: [{
400
+ isSignal: true,
401
+ alias: "one",
402
+ required: false
403
+ }]
404
+ }],
405
+ baseUrl: [{
406
+ type: i0.Input,
407
+ args: [{
408
+ isSignal: true,
409
+ alias: "baseUrl",
410
+ required: false
411
+ }]
412
+ }],
413
+ remote: [{
414
+ type: i0.Input,
415
+ args: [{
416
+ isSignal: true,
417
+ alias: "remote",
418
+ required: false
419
+ }]
420
+ }]
421
+ }
422
+ });
423
+ function genColor(colors, color) {
424
+ return colors[color] ?? color;
425
+ }
426
+ function isLargeImage(svg) {
427
+ const width = svg.width || 0;
428
+ const height = svg.height || 0;
429
+ return width * height > 2e6 || width > 2e3 || height > 2e3;
430
+ }
431
+ function genViewPort(svg) {
432
+ if (!svg) return "0 0 0 0";
433
+ return `0 0 ${svg.width || 0} ${svg.height || 0}`;
434
+ }
435
+ function computedFillColor(svg, colors, fillColor) {
436
+ const { lineColor, backgroundColor, invertSvg } = svg.edit;
437
+ if (!colors) return fillColor ?? backgroundColor;
438
+ return genColor(colors, invertSvg ? lineColor : fillColor ?? backgroundColor);
439
+ }
440
+ function computeLineColor(svg, colors, strokeColor) {
441
+ const { lineColor, backgroundColor, invertSvg } = svg.edit;
442
+ if (!colors) return strokeColor ?? lineColor;
443
+ return genColor(colors, invertSvg ? backgroundColor : strokeColor ?? lineColor);
444
+ }
445
+ var CustomIconClass = class CustomIconClass {
446
+ svg = input.required(...ngDevMode ? [{ debugName: "svg" }] : /* istanbul ignore next */ []);
447
+ strokeColor = input(void 0, ...ngDevMode ? [{ debugName: "strokeColor" }] : /* istanbul ignore next */ []);
448
+ fillColor = input(void 0, ...ngDevMode ? [{ debugName: "fillColor" }] : /* istanbul ignore next */ []);
449
+ strokeWidth = input(void 0, ...ngDevMode ? [{ debugName: "strokeWidth" }] : /* istanbul ignore next */ []);
450
+ viewBox = computed(() => genViewPort(this.svg()), ...ngDevMode ? [{ debugName: "viewBox" }] : /* istanbul ignore next */ []);
451
+ vectorEffect = computed(() => {
452
+ return isLargeImage(this.svg()) ? "non-scaling-stroke" : null;
453
+ }, ...ngDevMode ? [{ debugName: "vectorEffect" }] : /* istanbul ignore next */ []);
454
+ themeStore = inject(ThemeStore);
455
+ _fillColor = computed(() => computedFillColor(this.svg(), this.themeStore.color(), this.fillColor()), ...ngDevMode ? [{ debugName: "_fillColor" }] : /* istanbul ignore next */ []);
456
+ _strokeColor = computed(() => {
457
+ return computeLineColor(this.svg(), this.themeStore.color(), this.strokeColor());
458
+ }, ...ngDevMode ? [{ debugName: "_strokeColor" }] : /* istanbul ignore next */ []);
459
+ static ɵfac = i0.ɵɵngDeclareFactory({
460
+ minVersion: "12.0.0",
461
+ version: "22.2.1",
462
+ ngImport: i0,
463
+ type: CustomIconClass,
464
+ deps: [],
465
+ target: i0.ɵɵFactoryTarget.Component
466
+ });
467
+ static ɵcmp = i0.ɵɵngDeclareComponent({
468
+ minVersion: "17.0.0",
469
+ version: "22.2.1",
470
+ type: CustomIconClass,
471
+ isStandalone: true,
472
+ selector: "m-custom-icon",
473
+ inputs: {
474
+ svg: {
475
+ classPropertyName: "svg",
476
+ publicName: "svg",
477
+ isSignal: true,
478
+ isRequired: true,
479
+ transformFunction: null
480
+ },
481
+ strokeColor: {
482
+ classPropertyName: "strokeColor",
483
+ publicName: "strokeColor",
484
+ isSignal: true,
485
+ isRequired: false,
486
+ transformFunction: null
487
+ },
488
+ fillColor: {
489
+ classPropertyName: "fillColor",
490
+ publicName: "fillColor",
491
+ isSignal: true,
492
+ isRequired: false,
493
+ transformFunction: null
494
+ },
495
+ strokeWidth: {
496
+ classPropertyName: "strokeWidth",
497
+ publicName: "strokeWidth",
498
+ isSignal: true,
499
+ isRequired: false,
500
+ transformFunction: null
501
+ }
502
+ },
503
+ ngImport: i0,
504
+ template: `
505
+ <!-- eslint-disable local/no-raw-svg -->
506
+ @if (svg(); as svg) {
507
+ <svg
508
+ xmlns="http:/www.w3.org/2000/svg"
509
+ [attr.viewBox]="viewBox()"
510
+ [attr.width]="svg.width"
511
+ [attr.height]="svg.height"
512
+ preserveAspectRatio="xMidYMid meet"
513
+ >
514
+ @if (_fillColor(); as fillColor) {
515
+ <rect
516
+ [attr.width]="svg.width"
517
+ [attr.height]="svg.height"
518
+ [attr.fill]="fillColor"
519
+ />
520
+ }
521
+ @if (_strokeColor(); as stroke) {
522
+ @for (path of svg?.paths; track $index) {
523
+ <path
524
+ class="svg-path"
525
+ [attr.d]="path"
526
+ [attr.fill]="'none'"
527
+ [attr.stroke]="stroke"
528
+ [attr.stroke-linecap]="svg?.edit?.linecap"
529
+ [attr.stroke-linejoin]="svg?.edit?.linejoin"
530
+ [attr.stroke-width]="svg.edit.strokeWidth"
531
+ [attr.vector-effect]="vectorEffect()"
532
+ />
533
+ }
534
+ }
535
+ </svg>
536
+ }
537
+ `,
538
+ isInline: true,
539
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
540
+ });
541
+ };
542
+ i0.ɵɵngDeclareClassMetadata({
543
+ minVersion: "12.0.0",
544
+ version: "22.2.1",
545
+ ngImport: i0,
546
+ type: CustomIconClass,
547
+ decorators: [{
548
+ type: Component,
549
+ args: [{
550
+ selector: "m-custom-icon",
551
+ template: `
552
+ <!-- eslint-disable local/no-raw-svg -->
553
+ @if (svg(); as svg) {
554
+ <svg
555
+ xmlns="http:/www.w3.org/2000/svg"
556
+ [attr.viewBox]="viewBox()"
557
+ [attr.width]="svg.width"
558
+ [attr.height]="svg.height"
559
+ preserveAspectRatio="xMidYMid meet"
560
+ >
561
+ @if (_fillColor(); as fillColor) {
562
+ <rect
563
+ [attr.width]="svg.width"
564
+ [attr.height]="svg.height"
565
+ [attr.fill]="fillColor"
566
+ />
567
+ }
568
+ @if (_strokeColor(); as stroke) {
569
+ @for (path of svg?.paths; track $index) {
570
+ <path
571
+ class="svg-path"
572
+ [attr.d]="path"
573
+ [attr.fill]="'none'"
574
+ [attr.stroke]="stroke"
575
+ [attr.stroke-linecap]="svg?.edit?.linecap"
576
+ [attr.stroke-linejoin]="svg?.edit?.linejoin"
577
+ [attr.stroke-width]="svg.edit.strokeWidth"
578
+ [attr.vector-effect]="vectorEffect()"
579
+ />
580
+ }
581
+ }
582
+ </svg>
583
+ }
584
+ `,
585
+ changeDetection: ChangeDetectionStrategy.OnPush
586
+ }]
587
+ }],
588
+ propDecorators: {
589
+ svg: [{
590
+ type: i0.Input,
591
+ args: [{
592
+ isSignal: true,
593
+ alias: "svg",
594
+ required: true
595
+ }]
596
+ }],
597
+ strokeColor: [{
598
+ type: i0.Input,
599
+ args: [{
600
+ isSignal: true,
601
+ alias: "strokeColor",
602
+ required: false
603
+ }]
604
+ }],
605
+ fillColor: [{
606
+ type: i0.Input,
607
+ args: [{
608
+ isSignal: true,
609
+ alias: "fillColor",
610
+ required: false
611
+ }]
612
+ }],
613
+ strokeWidth: [{
614
+ type: i0.Input,
615
+ args: [{
616
+ isSignal: true,
617
+ alias: "strokeWidth",
618
+ required: false
619
+ }]
620
+ }]
621
+ }
622
+ });
623
+ var CustomIconEditComponent = class CustomIconEditComponent {
624
+ svg = model(void 0, ...ngDevMode ? [{ debugName: "svg" }] : /* istanbul ignore next */ []);
625
+ strokeColor = input(void 0, ...ngDevMode ? [{ debugName: "strokeColor" }] : /* istanbul ignore next */ []);
626
+ fillColor = input(void 0, ...ngDevMode ? [{ debugName: "fillColor" }] : /* istanbul ignore next */ []);
627
+ themeStore = inject(ThemeStore);
628
+ onKeydown(event) {
629
+ if (!this.svg()?.edit?.canInteract || this._selectedIndex.length === 0) return;
630
+ if (event.key === " ") {
631
+ event.preventDefault();
632
+ this.deleteSelectedPaths();
633
+ } else if (event.key === "Escape") {
634
+ event.preventDefault();
635
+ this._selectedIndex = [];
636
+ }
637
+ }
638
+ _viewBox = computed(() => genViewPort(this.svg()), ...ngDevMode ? [{ debugName: "_viewBox" }] : /* istanbul ignore next */ []);
639
+ _vectorEffect = computed(() => {
640
+ const svg = this.svg();
641
+ return svg && isLargeImage(svg) ? "non-scaling-stroke" : null;
642
+ }, ...ngDevMode ? [{ debugName: "_vectorEffect" }] : /* istanbul ignore next */ []);
643
+ _fillColor = computed(() => {
644
+ const svg = this.svg();
645
+ if (!svg) return void 0;
646
+ return computedFillColor(svg, this.themeStore.color(), this.fillColor());
647
+ }, ...ngDevMode ? [{ debugName: "_fillColor" }] : /* istanbul ignore next */ []);
648
+ _strokeColor = computed(() => {
649
+ const svg = this.svg();
650
+ if (!svg) return void 0;
651
+ return computeLineColor(svg, this.themeStore.color(), this.strokeColor());
652
+ }, ...ngDevMode ? [{ debugName: "_strokeColor" }] : /* istanbul ignore next */ []);
653
+ _onPathClick = (index) => {
654
+ if (!this.svg()?.edit?.canInteract) return;
655
+ this._selectedIndex = Array.from(/* @__PURE__ */ new Set([...this._selectedIndex, index]));
656
+ };
657
+ deleteSelectedPaths = () => {
658
+ this.svg.update((prev) => {
659
+ if (!prev) return prev;
660
+ return {
661
+ ...prev,
662
+ paths: prev.paths.filter((_, i) => !this._selectedIndex.includes(i))
663
+ };
664
+ });
665
+ this._selectedIndex = [];
666
+ };
667
+ _selectedIndex = [];
668
+ static ɵfac = i0.ɵɵngDeclareFactory({
669
+ minVersion: "12.0.0",
670
+ version: "22.2.1",
671
+ ngImport: i0,
672
+ type: CustomIconEditComponent,
673
+ deps: [],
674
+ target: i0.ɵɵFactoryTarget.Component
675
+ });
676
+ static ɵcmp = i0.ɵɵngDeclareComponent({
677
+ minVersion: "17.0.0",
678
+ version: "22.2.1",
679
+ type: CustomIconEditComponent,
680
+ isStandalone: true,
681
+ selector: "m-custom-icon-edit",
682
+ inputs: {
683
+ svg: {
684
+ classPropertyName: "svg",
685
+ publicName: "svg",
686
+ isSignal: true,
687
+ isRequired: false,
688
+ transformFunction: null
689
+ },
690
+ strokeColor: {
691
+ classPropertyName: "strokeColor",
692
+ publicName: "strokeColor",
693
+ isSignal: true,
694
+ isRequired: false,
695
+ transformFunction: null
696
+ },
697
+ fillColor: {
698
+ classPropertyName: "fillColor",
699
+ publicName: "fillColor",
700
+ isSignal: true,
701
+ isRequired: false,
702
+ transformFunction: null
703
+ }
704
+ },
705
+ outputs: { svg: "svgChange" },
706
+ host: { listeners: { "window:keydown": "onKeydown($event)" } },
707
+ ngImport: i0,
708
+ template: `
709
+ <!-- eslint-disable local/no-raw-svg -->
710
+ @if (svg(); as svg) {
711
+ <svg
712
+ xmlns="http:/www.w3.org/2000/svg"
713
+ [attr.viewBox]="_viewBox()"
714
+ [attr.width]="svg.width"
715
+ [attr.height]="svg.height"
716
+ preserveAspectRatio="xMidYMid meet"
717
+ >
718
+ @if (_fillColor(); as fillColor) {
719
+ <rect
720
+ [attr.width]="svg.width"
721
+ [attr.height]="svg.height"
722
+ [attr.fill]="fillColor"
723
+ />
724
+ }
725
+ @for (path of svg.paths; track $index) {
726
+ <path
727
+ class="svg-path"
728
+ (click)="_onPathClick($index)"
729
+ [class.interactive]="svg.edit.canInteract"
730
+ [class.selected]="_selectedIndex.includes($index)"
731
+ [attr.d]="path"
732
+ [attr.fill]="'none'"
733
+ [attr.stroke]="_strokeColor()"
734
+ [attr.stroke-linecap]="svg.edit.linecap"
735
+ [attr.stroke-linejoin]="svg.edit.linejoin"
736
+ [attr.stroke-width]="svg.edit.strokeWidth"
737
+ [attr.vector-effect]="_vectorEffect()"
738
+ />
739
+ }
740
+ </svg>
741
+ }
742
+ `,
743
+ isInline: true,
744
+ styles: [":host{display:contents;width:100%;height:100%;overflow:hidden;outline:none}:host:focus{outline:2px solid var(--primary-color, #007bff);outline-offset:2px}svg{width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;display:block}.interactive{cursor:pointer;transition:stroke-width .2s ease-in-out,stroke .2s ease-in-out}.interactive:hover{stroke-width:calc(var(--stroke-width, 2) * 1.5);stroke:var(--hover-color, #ff0000)}.selected{stroke:var(--hover-color, #ff0000)}\n"],
745
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
746
+ });
747
+ };
748
+ i0.ɵɵngDeclareClassMetadata({
749
+ minVersion: "12.0.0",
750
+ version: "22.2.1",
751
+ ngImport: i0,
752
+ type: CustomIconEditComponent,
753
+ decorators: [{
754
+ type: Component,
755
+ args: [{
756
+ selector: "m-custom-icon-edit",
757
+ imports: [],
758
+ changeDetection: ChangeDetectionStrategy.OnPush,
759
+ template: `
760
+ <!-- eslint-disable local/no-raw-svg -->
761
+ @if (svg(); as svg) {
762
+ <svg
763
+ xmlns="http:/www.w3.org/2000/svg"
764
+ [attr.viewBox]="_viewBox()"
765
+ [attr.width]="svg.width"
766
+ [attr.height]="svg.height"
767
+ preserveAspectRatio="xMidYMid meet"
768
+ >
769
+ @if (_fillColor(); as fillColor) {
770
+ <rect
771
+ [attr.width]="svg.width"
772
+ [attr.height]="svg.height"
773
+ [attr.fill]="fillColor"
774
+ />
775
+ }
776
+ @for (path of svg.paths; track $index) {
777
+ <path
778
+ class="svg-path"
779
+ (click)="_onPathClick($index)"
780
+ [class.interactive]="svg.edit.canInteract"
781
+ [class.selected]="_selectedIndex.includes($index)"
782
+ [attr.d]="path"
783
+ [attr.fill]="'none'"
784
+ [attr.stroke]="_strokeColor()"
785
+ [attr.stroke-linecap]="svg.edit.linecap"
786
+ [attr.stroke-linejoin]="svg.edit.linejoin"
787
+ [attr.stroke-width]="svg.edit.strokeWidth"
788
+ [attr.vector-effect]="_vectorEffect()"
789
+ />
790
+ }
791
+ </svg>
792
+ }
793
+ `,
794
+ styles: [":host{display:contents;width:100%;height:100%;overflow:hidden;outline:none}:host:focus{outline:2px solid var(--primary-color, #007bff);outline-offset:2px}svg{width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;display:block}.interactive{cursor:pointer;transition:stroke-width .2s ease-in-out,stroke .2s ease-in-out}.interactive:hover{stroke-width:calc(var(--stroke-width, 2) * 1.5);stroke:var(--hover-color, #ff0000)}.selected{stroke:var(--hover-color, #ff0000)}\n"]
795
+ }]
796
+ }],
797
+ propDecorators: {
798
+ svg: [{
799
+ type: i0.Input,
800
+ args: [{
801
+ isSignal: true,
802
+ alias: "svg",
803
+ required: false
804
+ }]
805
+ }, {
806
+ type: i0.Output,
807
+ args: ["svgChange"]
808
+ }],
809
+ strokeColor: [{
810
+ type: i0.Input,
811
+ args: [{
812
+ isSignal: true,
813
+ alias: "strokeColor",
814
+ required: false
815
+ }]
816
+ }],
817
+ fillColor: [{
818
+ type: i0.Input,
819
+ args: [{
820
+ isSignal: true,
821
+ alias: "fillColor",
822
+ required: false
823
+ }]
824
+ }],
825
+ onKeydown: [{
826
+ type: HostListener,
827
+ args: ["window:keydown", ["$event"]]
828
+ }]
829
+ }
830
+ });
831
+ export { injectParentSize as a, SIZE_CONTEXT as i, CustomIconClass as n, provideSizeContext as o, IconComponent as r, SHARED_ICONS as s, CustomIconEditComponent as t };
832
+
833
+ //# sourceMappingURL=magmonium-one-icon-Dso-9RMN.mjs.map