@magmonium/one 0.4.30 → 0.4.32
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/button_groups/nav_user_actions.json +1 -0
- package/assets/button_groups/notification_filter.json +2 -13
- package/assets/buttons/nav_user_edit_profile.json +5 -0
- package/assets/docs/en/app-release.md +0 -11
- package/assets/i18n/af.json +10 -2
- package/assets/i18n/am.json +10 -1
- package/assets/i18n/ar.json +10 -2
- package/assets/i18n/as.json +11 -2
- package/assets/i18n/az.json +11 -2
- package/assets/i18n/ba.json +8 -0
- package/assets/i18n/be.json +11 -2
- package/assets/i18n/bg.json +11 -2
- package/assets/i18n/bn.json +11 -2
- package/assets/i18n/br.json +7 -0
- package/assets/i18n/bs.json +10 -2
- package/assets/i18n/ca.json +10 -2
- package/assets/i18n/ceb.json +9 -2
- package/assets/i18n/cnr.json +8 -0
- package/assets/i18n/co.json +7 -1
- package/assets/i18n/cs.json +9 -2
- package/assets/i18n/cy.json +11 -2
- package/assets/i18n/da.json +7 -1
- package/assets/i18n/de.json +8 -2
- package/assets/i18n/doi.json +9 -0
- package/assets/i18n/el.json +10 -2
- package/assets/i18n/en.json +21 -4
- package/assets/i18n/eo.json +9 -2
- package/assets/i18n/es.json +9 -2
- package/assets/i18n/et.json +8 -2
- package/assets/i18n/eu.json +9 -2
- package/assets/i18n/fa.json +10 -2
- package/assets/i18n/fi.json +9 -2
- package/assets/i18n/fr.json +9 -2
- package/assets/i18n/fy.json +6 -2
- package/assets/i18n/ga.json +10 -2
- package/assets/i18n/gd.json +9 -2
- package/assets/i18n/gl.json +8 -1
- package/assets/i18n/gu.json +11 -2
- package/assets/i18n/ha.json +7 -1
- package/assets/i18n/haw.json +8 -2
- package/assets/i18n/he.json +8 -0
- package/assets/i18n/hi.json +10 -2
- package/assets/i18n/hmn.json +6 -2
- package/assets/i18n/hr.json +10 -2
- package/assets/i18n/hu.json +10 -2
- package/assets/i18n/hy.json +11 -2
- package/assets/i18n/id.json +10 -2
- package/assets/i18n/ig.json +8 -1
- package/assets/i18n/ilo.json +6 -0
- package/assets/i18n/is.json +10 -2
- package/assets/i18n/it.json +9 -2
- package/assets/i18n/iw.json +9 -1
- package/assets/i18n/ja.json +8 -1
- package/assets/i18n/jw.json +8 -2
- package/assets/i18n/ka.json +10 -2
- package/assets/i18n/kk.json +10 -2
- package/assets/i18n/km.json +10 -2
- package/assets/i18n/kn.json +11 -2
- package/assets/i18n/ko.json +8 -1
- package/assets/i18n/kok.json +9 -0
- package/assets/i18n/ku.json +10 -2
- package/assets/i18n/ky.json +9 -1
- package/assets/i18n/la.json +6 -1
- package/assets/i18n/lb.json +6 -2
- package/assets/i18n/lo.json +10 -2
- package/assets/i18n/lt.json +10 -2
- package/assets/i18n/lv.json +10 -2
- package/assets/i18n/mai.json +9 -0
- package/assets/i18n/mg.json +8 -2
- package/assets/i18n/mi.json +8 -2
- package/assets/i18n/mk.json +10 -2
- package/assets/i18n/ml.json +11 -2
- package/assets/i18n/mn.json +10 -2
- package/assets/i18n/mr.json +11 -2
- package/assets/i18n/ms.json +9 -2
- package/assets/i18n/mt.json +9 -2
- package/assets/i18n/my.json +10 -2
- package/assets/i18n/ne.json +10 -2
- package/assets/i18n/nl.json +6 -2
- package/assets/i18n/no.json +8 -2
- package/assets/i18n/ny.json +9 -2
- package/assets/i18n/or.json +10 -1
- package/assets/i18n/pa.json +11 -2
- package/assets/i18n/pl.json +8 -2
- package/assets/i18n/ps.json +8 -1
- package/assets/i18n/pt.json +9 -2
- package/assets/i18n/ro.json +9 -2
- package/assets/i18n/ru.json +9 -2
- package/assets/i18n/sa.json +9 -0
- package/assets/i18n/sat.json +9 -0
- package/assets/i18n/sd.json +11 -2
- package/assets/i18n/si.json +10 -2
- package/assets/i18n/sk.json +6 -1
- package/assets/i18n/sl.json +10 -2
- package/assets/i18n/sm.json +7 -1
- package/assets/i18n/sn.json +6 -2
- package/assets/i18n/so.json +8 -1
- package/assets/i18n/sq.json +10 -2
- package/assets/i18n/sr.json +10 -2
- package/assets/i18n/st.json +8 -2
- package/assets/i18n/su.json +8 -2
- package/assets/i18n/sv.json +8 -2
- package/assets/i18n/sw.json +10 -2
- package/assets/i18n/ta.json +11 -2
- package/assets/i18n/te.json +11 -2
- package/assets/i18n/tg.json +11 -2
- package/assets/i18n/th.json +10 -1
- package/assets/i18n/tl.json +8 -2
- package/assets/i18n/tr.json +10 -2
- package/assets/i18n/uk.json +11 -2
- package/assets/i18n/ur.json +11 -2
- package/assets/i18n/uz.json +10 -2
- package/assets/i18n/vi.json +10 -1
- package/assets/i18n/xh.json +11 -2
- package/assets/i18n/yi.json +10 -1
- package/assets/i18n/yo.json +9 -1
- package/assets/i18n/zh.json +9 -1
- package/assets/i18n/zu.json +11 -2
- package/assets/index.json +1 -1
- package/fesm2022/magmonium-one-attribute-value-DMI0yJpL.mjs +255 -0
- package/fesm2022/magmonium-one-attribute-value-DMI0yJpL.mjs.map +1 -0
- package/fesm2022/magmonium-one-base-checkbox-C9dvZ2IH.mjs +77 -0
- package/fesm2022/magmonium-one-base-checkbox-C9dvZ2IH.mjs.map +1 -0
- package/fesm2022/magmonium-one-base-dropdown-U-cWl3p9.mjs +604 -0
- package/fesm2022/magmonium-one-base-dropdown-U-cWl3p9.mjs.map +1 -0
- package/fesm2022/magmonium-one-base-input-CLBOTOUs.mjs +183 -0
- package/fesm2022/magmonium-one-base-input-CLBOTOUs.mjs.map +1 -0
- package/fesm2022/magmonium-one-base-text-Zb0oLNRX.mjs +94 -0
- package/fesm2022/magmonium-one-base-text-Zb0oLNRX.mjs.map +1 -0
- package/fesm2022/magmonium-one-button-Bwzaxxn3.mjs +1281 -0
- package/fesm2022/magmonium-one-button-Bwzaxxn3.mjs.map +1 -0
- package/fesm2022/magmonium-one-checkbox-CPQ9m291.mjs +365 -0
- package/fesm2022/magmonium-one-checkbox-CPQ9m291.mjs.map +1 -0
- package/fesm2022/magmonium-one-color-utl-CAbZLKB5.mjs +449 -0
- package/fesm2022/magmonium-one-color-utl-CAbZLKB5.mjs.map +1 -0
- package/fesm2022/magmonium-one-directives-BVKX77zM.mjs +1285 -0
- package/fesm2022/magmonium-one-directives-BVKX77zM.mjs.map +1 -0
- package/fesm2022/magmonium-one-file.service-Bo06pU3_.mjs +65 -0
- package/fesm2022/magmonium-one-file.service-Bo06pU3_.mjs.map +1 -0
- package/fesm2022/magmonium-one-group-D4yYrVP3.mjs +428 -0
- package/fesm2022/magmonium-one-group-D4yYrVP3.mjs.map +1 -0
- package/fesm2022/magmonium-one-header-DmN8M1a3.mjs +380 -0
- package/fesm2022/magmonium-one-header-DmN8M1a3.mjs.map +1 -0
- package/fesm2022/magmonium-one-icon-Ep14YeRY.mjs +833 -0
- package/fesm2022/magmonium-one-icon-Ep14YeRY.mjs.map +1 -0
- package/fesm2022/magmonium-one-image-editor-BX4eNd4u.mjs +438 -0
- package/fesm2022/magmonium-one-image-editor-BX4eNd4u.mjs.map +1 -0
- package/fesm2022/magmonium-one-image-frame-BTSaUSAi.mjs +116 -0
- package/fesm2022/magmonium-one-image-frame-BTSaUSAi.mjs.map +1 -0
- package/fesm2022/magmonium-one-input-DqHPorA1.mjs +39 -0
- package/fesm2022/magmonium-one-input-DqHPorA1.mjs.map +1 -0
- package/fesm2022/magmonium-one-label-D2gjTbKX.mjs +574 -0
- package/fesm2022/magmonium-one-label-D2gjTbKX.mjs.map +1 -0
- package/fesm2022/magmonium-one-m-ref-Bq0gQbKE.mjs +147 -0
- package/fesm2022/magmonium-one-m-ref-Bq0gQbKE.mjs.map +1 -0
- package/fesm2022/magmonium-one-menu-BM9f2knw.mjs +887 -0
- package/fesm2022/magmonium-one-menu-BM9f2knw.mjs.map +1 -0
- package/fesm2022/magmonium-one-multi-range-a3ZVTy7i.mjs +458 -0
- package/fesm2022/magmonium-one-multi-range-a3ZVTy7i.mjs.map +1 -0
- package/fesm2022/magmonium-one-options-asset-CDEXIif6.mjs +97 -0
- package/fesm2022/magmonium-one-options-asset-CDEXIif6.mjs.map +1 -0
- package/fesm2022/magmonium-one-otp-DO4oTeSK.mjs +261 -0
- package/fesm2022/magmonium-one-otp-DO4oTeSK.mjs.map +1 -0
- package/fesm2022/magmonium-one-password-D3oTo41c.mjs +217 -0
- package/fesm2022/magmonium-one-password-D3oTo41c.mjs.map +1 -0
- package/fesm2022/magmonium-one-radio-CkaWESS3.mjs +111 -0
- package/fesm2022/magmonium-one-radio-CkaWESS3.mjs.map +1 -0
- package/fesm2022/magmonium-one-range-D_WEKrli.mjs +216 -0
- package/fesm2022/magmonium-one-range-D_WEKrli.mjs.map +1 -0
- package/fesm2022/magmonium-one-rolldown-runtime-DpJrqANO.mjs +11 -0
- package/fesm2022/magmonium-one-selector-BowevmOd.mjs +1065 -0
- package/fesm2022/magmonium-one-selector-BowevmOd.mjs.map +1 -0
- package/fesm2022/magmonium-one-size-converter-BfT0Aw0g.mjs +1060 -0
- package/fesm2022/magmonium-one-size-converter-BfT0Aw0g.mjs.map +1 -0
- package/fesm2022/magmonium-one-text-B4xKn-EQ.mjs +406 -0
- package/fesm2022/magmonium-one-text-B4xKn-EQ.mjs.map +1 -0
- package/fesm2022/magmonium-one-text-output-CfVeqYM7.mjs +296 -0
- package/fesm2022/magmonium-one-text-output-CfVeqYM7.mjs.map +1 -0
- package/fesm2022/magmonium-one-theme-Xgsx8bJs.mjs +1 -0
- package/fesm2022/magmonium-one-toggle-D2XEbN-b.mjs +231 -0
- package/fesm2022/magmonium-one-toggle-D2XEbN-b.mjs.map +1 -0
- package/fesm2022/magmonium-one.mjs +49250 -2
- package/fesm2022/magmonium-one.mjs.map +1 -1
- package/package.json +8 -8
- package/types/magmonium-one.d.ts +13909 -9533
- package/assets/menu/user_header.json +0 -27
- package/fesm2022/magmonium-one-image-editor-QPOy7XQt.mjs +0 -290
- package/fesm2022/magmonium-one-image-editor-QPOy7XQt.mjs.map +0 -1
- package/fesm2022/magmonium-one-magmonium-one-BTi-rHpF.mjs +0 -41583
- package/fesm2022/magmonium-one-magmonium-one-BTi-rHpF.mjs.map +0 -1
- package/fesm2022/magmonium-one-otp-BcNCgGpz.mjs +0 -201
- package/fesm2022/magmonium-one-otp-BcNCgGpz.mjs.map +0 -1
- package/fesm2022/magmonium-one-password-BDcSzmV_.mjs +0 -105
- package/fesm2022/magmonium-one-password-BDcSzmV_.mjs.map +0 -1
- package/fesm2022/magmonium-one-toggle-bLWTwEHE.mjs +0 -62
- package/fesm2022/magmonium-one-toggle-bLWTwEHE.mjs.map +0 -1
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { l as TranslateService, nt as LAYOUT_ASSET_FOLDER } from "./magmonium-one-size-converter-BfT0Aw0g.mjs";
|
|
2
|
+
import { n as resolvePallet } from "./magmonium-one-color-utl-CAbZLKB5.mjs";
|
|
3
|
+
import { r as ConfigComponent, t as toAttrBool } from "./magmonium-one-attribute-value-DMI0yJpL.mjs";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import { ChangeDetectionStrategy, Component, computed, inject, input, model, output } from "@angular/core";
|
|
6
|
+
var TextOutputComponent = class TextOutputComponent extends ConfigComponent {
|
|
7
|
+
subFolder = LAYOUT_ASSET_FOLDER.text_output;
|
|
8
|
+
config = model(...ngDevMode ? [void 0, { debugName: "config" }] : /* istanbul ignore next */ []);
|
|
9
|
+
translateService = inject(TranslateService);
|
|
10
|
+
align = input(void 0, ...ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []);
|
|
11
|
+
variant = input(void 0, ...ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []);
|
|
12
|
+
color = input(void 0, ...ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []);
|
|
13
|
+
fontWeight = input(void 0, ...ngDevMode ? [{ debugName: "fontWeight" }] : /* istanbul ignore next */ []);
|
|
14
|
+
label = input(void 0, ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
15
|
+
noTranslate = input(void 0, ...ngDevMode ? [{ debugName: "noTranslate" }] : /* istanbul ignore next */ []);
|
|
16
|
+
params = input(void 0, ...ngDevMode ? [{ debugName: "params" }] : /* istanbul ignore next */ []);
|
|
17
|
+
resolvedAlign = computed(() => this.align() ?? this.config()?.align ?? "left", ...ngDevMode ? [{ debugName: "resolvedAlign" }] : /* istanbul ignore next */ []);
|
|
18
|
+
resolvedVariant = computed(() => this.variant() ?? this.config()?.variant, ...ngDevMode ? [{ debugName: "resolvedVariant" }] : /* istanbul ignore next */ []);
|
|
19
|
+
resolvedFontWeight = computed(() => this.fontWeight() ?? this.config()?.fontWeight, ...ngDevMode ? [{ debugName: "resolvedFontWeight" }] : /* istanbul ignore next */ []);
|
|
20
|
+
isLink = computed(() => {
|
|
21
|
+
const variant = this.resolvedVariant();
|
|
22
|
+
return variant === "link" || variant === "link-small";
|
|
23
|
+
}, ...ngDevMode ? [{ debugName: "isLink" }] : /* istanbul ignore next */ []);
|
|
24
|
+
clicked = output();
|
|
25
|
+
onClick() {
|
|
26
|
+
if (this.isLink()) this.clicked.emit();
|
|
27
|
+
}
|
|
28
|
+
resolvedColorPallet = computed(() => resolvePallet(this.color() ?? this.config()?.color ?? this.defaultColor, this.themeStore.color()), ...ngDevMode ? [{ debugName: "resolvedColorPallet" }] : /* istanbul ignore next */ []);
|
|
29
|
+
resolveComponentOverrides() {
|
|
30
|
+
const overrides = {};
|
|
31
|
+
const align = this.align();
|
|
32
|
+
if (align !== void 0) overrides.align = align;
|
|
33
|
+
const label = this.label();
|
|
34
|
+
if (label !== void 0) overrides.label = label;
|
|
35
|
+
const noTranslate = toAttrBool(this.noTranslate());
|
|
36
|
+
if (noTranslate !== void 0) overrides.noTranslate = noTranslate;
|
|
37
|
+
const variant = this.variant();
|
|
38
|
+
if (variant !== void 0) overrides.variant = variant;
|
|
39
|
+
const color = this.color();
|
|
40
|
+
if (color !== void 0) overrides.color = color;
|
|
41
|
+
const fontWeight = this.fontWeight();
|
|
42
|
+
if (fontWeight !== void 0) overrides.fontWeight = fontWeight;
|
|
43
|
+
return overrides;
|
|
44
|
+
}
|
|
45
|
+
resolvedLabel = computed(() => this.config()?.label, ...ngDevMode ? [{ debugName: "resolvedLabel" }] : /* istanbul ignore next */ []);
|
|
46
|
+
shouldTranslate = computed(() => !this.config()?.noTranslate, ...ngDevMode ? [{ debugName: "shouldTranslate" }] : /* istanbul ignore next */ []);
|
|
47
|
+
html = computed(() => {
|
|
48
|
+
const label = this.resolvedLabel();
|
|
49
|
+
return this.shouldTranslate() ? this.translateService.translateToHtml(label, this.params()) : this.translateService.toSafeHtml(label);
|
|
50
|
+
}, ...ngDevMode ? [{ debugName: "html" }] : /* istanbul ignore next */ []);
|
|
51
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
52
|
+
minVersion: "12.0.0",
|
|
53
|
+
version: "22.2.1",
|
|
54
|
+
ngImport: i0,
|
|
55
|
+
type: TextOutputComponent,
|
|
56
|
+
deps: null,
|
|
57
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
58
|
+
});
|
|
59
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
60
|
+
minVersion: "17.1.0",
|
|
61
|
+
version: "22.2.1",
|
|
62
|
+
type: TextOutputComponent,
|
|
63
|
+
isStandalone: true,
|
|
64
|
+
selector: "m-text-output",
|
|
65
|
+
inputs: {
|
|
66
|
+
config: {
|
|
67
|
+
classPropertyName: "config",
|
|
68
|
+
publicName: "config",
|
|
69
|
+
isSignal: true,
|
|
70
|
+
isRequired: false,
|
|
71
|
+
transformFunction: null
|
|
72
|
+
},
|
|
73
|
+
align: {
|
|
74
|
+
classPropertyName: "align",
|
|
75
|
+
publicName: "align",
|
|
76
|
+
isSignal: true,
|
|
77
|
+
isRequired: false,
|
|
78
|
+
transformFunction: null
|
|
79
|
+
},
|
|
80
|
+
variant: {
|
|
81
|
+
classPropertyName: "variant",
|
|
82
|
+
publicName: "variant",
|
|
83
|
+
isSignal: true,
|
|
84
|
+
isRequired: false,
|
|
85
|
+
transformFunction: null
|
|
86
|
+
},
|
|
87
|
+
color: {
|
|
88
|
+
classPropertyName: "color",
|
|
89
|
+
publicName: "color",
|
|
90
|
+
isSignal: true,
|
|
91
|
+
isRequired: false,
|
|
92
|
+
transformFunction: null
|
|
93
|
+
},
|
|
94
|
+
fontWeight: {
|
|
95
|
+
classPropertyName: "fontWeight",
|
|
96
|
+
publicName: "fontWeight",
|
|
97
|
+
isSignal: true,
|
|
98
|
+
isRequired: false,
|
|
99
|
+
transformFunction: null
|
|
100
|
+
},
|
|
101
|
+
label: {
|
|
102
|
+
classPropertyName: "label",
|
|
103
|
+
publicName: "label",
|
|
104
|
+
isSignal: true,
|
|
105
|
+
isRequired: false,
|
|
106
|
+
transformFunction: null
|
|
107
|
+
},
|
|
108
|
+
noTranslate: {
|
|
109
|
+
classPropertyName: "noTranslate",
|
|
110
|
+
publicName: "noTranslate",
|
|
111
|
+
isSignal: true,
|
|
112
|
+
isRequired: false,
|
|
113
|
+
transformFunction: null
|
|
114
|
+
},
|
|
115
|
+
params: {
|
|
116
|
+
classPropertyName: "params",
|
|
117
|
+
publicName: "params",
|
|
118
|
+
isSignal: true,
|
|
119
|
+
isRequired: false,
|
|
120
|
+
transformFunction: null
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
outputs: {
|
|
124
|
+
config: "configChange",
|
|
125
|
+
clicked: "clicked"
|
|
126
|
+
},
|
|
127
|
+
host: {
|
|
128
|
+
listeners: {
|
|
129
|
+
"click": "onClick()",
|
|
130
|
+
"keydown.enter": "onClick()"
|
|
131
|
+
},
|
|
132
|
+
properties: {
|
|
133
|
+
"class.is-design-mode": "isDesignMode",
|
|
134
|
+
"class.align-left": "resolvedAlign() === \"left\"",
|
|
135
|
+
"class.align-right": "resolvedAlign() === \"right\"",
|
|
136
|
+
"class.align-center": "resolvedAlign() === \"center\"",
|
|
137
|
+
"class.variant-lead": "resolvedVariant() === \"lead\"",
|
|
138
|
+
"class.variant-big": "resolvedVariant() === \"big\"",
|
|
139
|
+
"class.variant-bold": "resolvedVariant() === \"bold\"",
|
|
140
|
+
"class.variant-footer": "resolvedVariant() === \"footer\"",
|
|
141
|
+
"class.variant-footnote": "resolvedVariant() === \"footnote\"",
|
|
142
|
+
"class.variant-link": "resolvedVariant() === \"link\"",
|
|
143
|
+
"class.variant-link-small": "resolvedVariant() === \"link-small\"",
|
|
144
|
+
"class.weight-light": "resolvedFontWeight() === \"light\"",
|
|
145
|
+
"class.weight-normal": "resolvedFontWeight() === \"normal\"",
|
|
146
|
+
"class.weight-medium": "resolvedFontWeight() === \"medium\"",
|
|
147
|
+
"class.weight-semibold": "resolvedFontWeight() === \"semibold\"",
|
|
148
|
+
"class.weight-bold": "resolvedFontWeight() === \"bold\"",
|
|
149
|
+
"class.has-color": "!!(color() ?? config()?.color)",
|
|
150
|
+
"attr.role": "isLink() ? \"link\" : null",
|
|
151
|
+
"attr.tabindex": "isLink() ? 0 : null",
|
|
152
|
+
"style.--m-text-output-color": "resolvedColorPallet().color",
|
|
153
|
+
"style.--m-text-output-color-contrast": "resolvedColorPallet().contrastColor",
|
|
154
|
+
"style.--m-text-output-color-opposite": "resolvedColorPallet().oppositeColor"
|
|
155
|
+
},
|
|
156
|
+
classAttribute: "m-text-output-host"
|
|
157
|
+
},
|
|
158
|
+
usesInheritance: true,
|
|
159
|
+
ngImport: i0,
|
|
160
|
+
template: `
|
|
161
|
+
<div
|
|
162
|
+
class="m-text-output"
|
|
163
|
+
[style.color]="resolvedColorPallet().color"
|
|
164
|
+
[innerHTML]="html()"
|
|
165
|
+
></div>
|
|
166
|
+
`,
|
|
167
|
+
isInline: true,
|
|
168
|
+
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(.is-design-mode){display:block;min-width:1em;min-height:1em}:host(.align-left) .m-text-output{text-align:left}:host(.align-center) .m-text-output{text-align:center}:host(.align-right) .m-text-output{text-align:right}:host{font-size:inherit}:host(.variant-lead){display:block;font-size:1.15em;font-weight:300}:host(.variant-lead) .m-text-output{line-height:1.6}:host(.variant-big){display:block;font-size:1.5em;font-weight:600}:host(.variant-big) .m-text-output{line-height:1.25}:host(.variant-bold){display:block;font-weight:700}:host(.variant-footer){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-footer) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-footer){font-size:calc(var(--m-text-output-body-font-size, 1em) * .75);display:block;margin-top:.25rem}m-flex.align-items-center.direction-row>:host(.variant-footer),m-flex.align-items-center.direction-row-reverse>:host(.variant-footer){margin-top:0}:host(.variant-footnote){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-footnote) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-footnote){font-size:calc(var(--m-text-output-body-font-size, 1em) * .6);display:block;margin-top:.25rem}:host(.variant-link){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-link) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-link){text-decoration:none;cursor:pointer;transition:color .2s ease-in-out,text-decoration .2s ease-in-out;outline:none}:host(.variant-link):focus{outline:2px solid var(--m-focus);outline-offset:2px}:host(.variant-link){display:inline;border-radius:.25rem}:host(.variant-link) .m-text-output{display:inline;text-decoration:underline;text-decoration-color:color-mix(in srgb,currentColor 35%,transparent);text-decoration-thickness:max(1px,.06em);text-underline-offset:.18em;transition:text-decoration-color .15s ease-in-out,text-decoration-thickness .15s ease-in-out}:host(.variant-link) .m-text-output:hover{text-decoration-color:currentColor;text-decoration-thickness:max(2px,.1em)}:host(.variant-link) .m-text-output>p{display:inline;margin:0}:host(.variant-link-small){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-link-small) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-link-small){text-decoration:none;cursor:pointer;transition:color .2s ease-in-out,text-decoration .2s ease-in-out;outline:none}:host(.variant-link-small):focus{outline:2px solid var(--m-focus);outline-offset:2px}:host(.variant-link-small){display:inline;border-radius:.25rem}:host(.variant-link-small) .m-text-output{display:inline;text-decoration:underline;text-decoration-color:color-mix(in srgb,currentColor 35%,transparent);text-decoration-thickness:max(1px,.06em);text-underline-offset:.18em;transition:text-decoration-color .15s ease-in-out,text-decoration-thickness .15s ease-in-out}:host(.variant-link-small) .m-text-output:hover{text-decoration-color:currentColor;text-decoration-thickness:max(2px,.1em)}:host(.variant-link-small) .m-text-output>p{display:inline;margin:0}:host(.weight-light){font-weight:300}:host(.weight-normal){font-weight:400}:host(.weight-medium){font-weight:500}:host(.weight-semibold){font-weight:600}:host(.weight-bold){font-weight:700}:host(.has-color) .m-text-output{-webkit-text-fill-color:currentColor}.m-text-output{color:var(--m-text-output-color, var(--m-text));font-size:inherit;line-height:1.5}.m-text-output>:first-child{margin-top:0}.m-text-output>:last-child{margin-bottom:0}.m-text-output p,.m-text-output ul,.m-text-output blockquote,.m-text-output h1,.m-text-output h2,.m-text-output h3,.m-text-output h4,.m-text-output h5,.m-text-output h6{margin:0 0 1rem}.m-text-output ul{padding-left:1.5rem;list-style-type:disc;list-style-position:outside}.m-text-output li{margin-bottom:.25rem}.m-text-output li:last-child{margin-bottom:0}.m-text-output a{color:var(--m-text-output-link-color, var(--m-mm));text-decoration:underline;text-decoration-color:color-mix(in srgb,currentColor 35%,transparent);text-decoration-thickness:max(1px,.06em);text-underline-offset:.18em;transition:text-decoration-color .15s ease-in-out,text-decoration-thickness .15s ease-in-out}.m-text-output a:hover{text-decoration-color:currentColor;text-decoration-thickness:max(2px,.1em)}.m-text-output blockquote{padding-left:1rem;border-left:1px solid var(--m-border);color:var(--m-text-output-color, var(--m-text-secondary))}\n"],
|
|
169
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
173
|
+
minVersion: "12.0.0",
|
|
174
|
+
version: "22.2.1",
|
|
175
|
+
ngImport: i0,
|
|
176
|
+
type: TextOutputComponent,
|
|
177
|
+
decorators: [{
|
|
178
|
+
type: Component,
|
|
179
|
+
args: [{
|
|
180
|
+
selector: "m-text-output",
|
|
181
|
+
imports: [],
|
|
182
|
+
template: `
|
|
183
|
+
<div
|
|
184
|
+
class="m-text-output"
|
|
185
|
+
[style.color]="resolvedColorPallet().color"
|
|
186
|
+
[innerHTML]="html()"
|
|
187
|
+
></div>
|
|
188
|
+
`,
|
|
189
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
190
|
+
host: {
|
|
191
|
+
class: "m-text-output-host",
|
|
192
|
+
"[class.is-design-mode]": "isDesignMode",
|
|
193
|
+
"[class.align-left]": "resolvedAlign() === \"left\"",
|
|
194
|
+
"[class.align-right]": "resolvedAlign() === \"right\"",
|
|
195
|
+
"[class.align-center]": "resolvedAlign() === \"center\"",
|
|
196
|
+
"[class.variant-lead]": "resolvedVariant() === \"lead\"",
|
|
197
|
+
"[class.variant-big]": "resolvedVariant() === \"big\"",
|
|
198
|
+
"[class.variant-bold]": "resolvedVariant() === \"bold\"",
|
|
199
|
+
"[class.variant-footer]": "resolvedVariant() === \"footer\"",
|
|
200
|
+
"[class.variant-footnote]": "resolvedVariant() === \"footnote\"",
|
|
201
|
+
"[class.variant-link]": "resolvedVariant() === \"link\"",
|
|
202
|
+
"[class.variant-link-small]": "resolvedVariant() === \"link-small\"",
|
|
203
|
+
"[class.weight-light]": "resolvedFontWeight() === \"light\"",
|
|
204
|
+
"[class.weight-normal]": "resolvedFontWeight() === \"normal\"",
|
|
205
|
+
"[class.weight-medium]": "resolvedFontWeight() === \"medium\"",
|
|
206
|
+
"[class.weight-semibold]": "resolvedFontWeight() === \"semibold\"",
|
|
207
|
+
"[class.weight-bold]": "resolvedFontWeight() === \"bold\"",
|
|
208
|
+
"[class.has-color]": "!!(color() ?? config()?.color)",
|
|
209
|
+
"[attr.role]": "isLink() ? \"link\" : null",
|
|
210
|
+
"[attr.tabindex]": "isLink() ? 0 : null",
|
|
211
|
+
"(click)": "onClick()",
|
|
212
|
+
"(keydown.enter)": "onClick()",
|
|
213
|
+
"[style.--m-text-output-color]": "resolvedColorPallet().color",
|
|
214
|
+
"[style.--m-text-output-color-contrast]": "resolvedColorPallet().contrastColor",
|
|
215
|
+
"[style.--m-text-output-color-opposite]": "resolvedColorPallet().oppositeColor"
|
|
216
|
+
},
|
|
217
|
+
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(.is-design-mode){display:block;min-width:1em;min-height:1em}:host(.align-left) .m-text-output{text-align:left}:host(.align-center) .m-text-output{text-align:center}:host(.align-right) .m-text-output{text-align:right}:host{font-size:inherit}:host(.variant-lead){display:block;font-size:1.15em;font-weight:300}:host(.variant-lead) .m-text-output{line-height:1.6}:host(.variant-big){display:block;font-size:1.5em;font-weight:600}:host(.variant-big) .m-text-output{line-height:1.25}:host(.variant-bold){display:block;font-weight:700}:host(.variant-footer){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-footer) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-footer){font-size:calc(var(--m-text-output-body-font-size, 1em) * .75);display:block;margin-top:.25rem}m-flex.align-items-center.direction-row>:host(.variant-footer),m-flex.align-items-center.direction-row-reverse>:host(.variant-footer){margin-top:0}:host(.variant-footnote){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-footnote) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-footnote){font-size:calc(var(--m-text-output-body-font-size, 1em) * .6);display:block;margin-top:.25rem}:host(.variant-link){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-link) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-link){text-decoration:none;cursor:pointer;transition:color .2s ease-in-out,text-decoration .2s ease-in-out;outline:none}:host(.variant-link):focus{outline:2px solid var(--m-focus);outline-offset:2px}:host(.variant-link){display:inline;border-radius:.25rem}:host(.variant-link) .m-text-output{display:inline;text-decoration:underline;text-decoration-color:color-mix(in srgb,currentColor 35%,transparent);text-decoration-thickness:max(1px,.06em);text-underline-offset:.18em;transition:text-decoration-color .15s ease-in-out,text-decoration-thickness .15s ease-in-out}:host(.variant-link) .m-text-output:hover{text-decoration-color:currentColor;text-decoration-thickness:max(2px,.1em)}:host(.variant-link) .m-text-output>p{display:inline;margin:0}:host(.variant-link-small){font-size:var(--m-text-output-body-font-size, inherit);font-weight:400;letter-spacing:normal}:host(.variant-link-small) .m-text-output{-webkit-text-fill-color:currentColor}:host(.variant-link-small){text-decoration:none;cursor:pointer;transition:color .2s ease-in-out,text-decoration .2s ease-in-out;outline:none}:host(.variant-link-small):focus{outline:2px solid var(--m-focus);outline-offset:2px}:host(.variant-link-small){display:inline;border-radius:.25rem}:host(.variant-link-small) .m-text-output{display:inline;text-decoration:underline;text-decoration-color:color-mix(in srgb,currentColor 35%,transparent);text-decoration-thickness:max(1px,.06em);text-underline-offset:.18em;transition:text-decoration-color .15s ease-in-out,text-decoration-thickness .15s ease-in-out}:host(.variant-link-small) .m-text-output:hover{text-decoration-color:currentColor;text-decoration-thickness:max(2px,.1em)}:host(.variant-link-small) .m-text-output>p{display:inline;margin:0}:host(.weight-light){font-weight:300}:host(.weight-normal){font-weight:400}:host(.weight-medium){font-weight:500}:host(.weight-semibold){font-weight:600}:host(.weight-bold){font-weight:700}:host(.has-color) .m-text-output{-webkit-text-fill-color:currentColor}.m-text-output{color:var(--m-text-output-color, var(--m-text));font-size:inherit;line-height:1.5}.m-text-output>:first-child{margin-top:0}.m-text-output>:last-child{margin-bottom:0}.m-text-output p,.m-text-output ul,.m-text-output blockquote,.m-text-output h1,.m-text-output h2,.m-text-output h3,.m-text-output h4,.m-text-output h5,.m-text-output h6{margin:0 0 1rem}.m-text-output ul{padding-left:1.5rem;list-style-type:disc;list-style-position:outside}.m-text-output li{margin-bottom:.25rem}.m-text-output li:last-child{margin-bottom:0}.m-text-output a{color:var(--m-text-output-link-color, var(--m-mm));text-decoration:underline;text-decoration-color:color-mix(in srgb,currentColor 35%,transparent);text-decoration-thickness:max(1px,.06em);text-underline-offset:.18em;transition:text-decoration-color .15s ease-in-out,text-decoration-thickness .15s ease-in-out}.m-text-output a:hover{text-decoration-color:currentColor;text-decoration-thickness:max(2px,.1em)}.m-text-output blockquote{padding-left:1rem;border-left:1px solid var(--m-border);color:var(--m-text-output-color, var(--m-text-secondary))}\n"]
|
|
218
|
+
}]
|
|
219
|
+
}],
|
|
220
|
+
propDecorators: {
|
|
221
|
+
config: [{
|
|
222
|
+
type: i0.Input,
|
|
223
|
+
args: [{
|
|
224
|
+
isSignal: true,
|
|
225
|
+
alias: "config",
|
|
226
|
+
required: false
|
|
227
|
+
}]
|
|
228
|
+
}, {
|
|
229
|
+
type: i0.Output,
|
|
230
|
+
args: ["configChange"]
|
|
231
|
+
}],
|
|
232
|
+
align: [{
|
|
233
|
+
type: i0.Input,
|
|
234
|
+
args: [{
|
|
235
|
+
isSignal: true,
|
|
236
|
+
alias: "align",
|
|
237
|
+
required: false
|
|
238
|
+
}]
|
|
239
|
+
}],
|
|
240
|
+
variant: [{
|
|
241
|
+
type: i0.Input,
|
|
242
|
+
args: [{
|
|
243
|
+
isSignal: true,
|
|
244
|
+
alias: "variant",
|
|
245
|
+
required: false
|
|
246
|
+
}]
|
|
247
|
+
}],
|
|
248
|
+
color: [{
|
|
249
|
+
type: i0.Input,
|
|
250
|
+
args: [{
|
|
251
|
+
isSignal: true,
|
|
252
|
+
alias: "color",
|
|
253
|
+
required: false
|
|
254
|
+
}]
|
|
255
|
+
}],
|
|
256
|
+
fontWeight: [{
|
|
257
|
+
type: i0.Input,
|
|
258
|
+
args: [{
|
|
259
|
+
isSignal: true,
|
|
260
|
+
alias: "fontWeight",
|
|
261
|
+
required: false
|
|
262
|
+
}]
|
|
263
|
+
}],
|
|
264
|
+
label: [{
|
|
265
|
+
type: i0.Input,
|
|
266
|
+
args: [{
|
|
267
|
+
isSignal: true,
|
|
268
|
+
alias: "label",
|
|
269
|
+
required: false
|
|
270
|
+
}]
|
|
271
|
+
}],
|
|
272
|
+
noTranslate: [{
|
|
273
|
+
type: i0.Input,
|
|
274
|
+
args: [{
|
|
275
|
+
isSignal: true,
|
|
276
|
+
alias: "noTranslate",
|
|
277
|
+
required: false
|
|
278
|
+
}]
|
|
279
|
+
}],
|
|
280
|
+
params: [{
|
|
281
|
+
type: i0.Input,
|
|
282
|
+
args: [{
|
|
283
|
+
isSignal: true,
|
|
284
|
+
alias: "params",
|
|
285
|
+
required: false
|
|
286
|
+
}]
|
|
287
|
+
}],
|
|
288
|
+
clicked: [{
|
|
289
|
+
type: i0.Output,
|
|
290
|
+
args: ["clicked"]
|
|
291
|
+
}]
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
export { TextOutputComponent as t };
|
|
295
|
+
|
|
296
|
+
//# sourceMappingURL=magmonium-one-text-output-CfVeqYM7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"magmonium-one-text-output-CfVeqYM7.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/text-output/ui/text-output.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n model,\n output,\n} from '@angular/core';\nimport { TranslateService } from '../../../services/translate';\nimport { ConfigComponent } from '../../../lib/components/config-component';\nimport { Config } from '../../../type/config/config-type';\nimport { LAYOUT_ASSET_FOLDER } from '../../../enum';\nimport { toAttrBool } from '../../../functions/config/attribute-value';\nimport { resolvePallet } from '../../../lib/theme/lib/color-utl';\n\nexport type TextOutputAlign = 'left' | 'right' | 'center';\n\n// Variants are roles, not styles: each one says what the text is doing on the\n// page, and the Section it sits in decides how big that role renders. Every\n// size below is therefore an `em` multiple of the inherited Section font-size\n// — a `lead` in a compact Section stays proportionally a lead — which is the\n// one rule the plain (undefined) variant keeps by inheriting outright.\n//\n// - `lead` opening paragraph that introduces the block under it\n// - `big` one-line statement — a number, a verdict, a headline that is\n// not a SectionHeader\n// - `bold` emphasis at body size, for the line that must be read first\n// - `footer` annotation under the thing it describes — a field's validation\n// message, a caption, a disclaimer; 0.75 of body, body colour\n// - `footnote` aside the reader may skip — source, legal line, small print;\n// 0.6 of body, body colour\n// - `link` text that goes somewhere on click — an affordance rather than\n// a size, so it is the one role that stays inline, takes focus,\n// and emits `clicked`\n// - `link-small` the same affordance for a link that trails the content it\n// belongs to rather than carrying a line of its own — a \"see\n// all\", an \"edit\" beside a field; body size like `link`\nexport type TextOutputVariant =\n | 'lead'\n | 'big'\n | 'bold'\n | 'footer'\n | 'footnote'\n | 'link'\n | 'link-small';\n\n// Weight tokens of the type scale. Applied after the variant, so it overrides\n// the weight a role implies (`lead` light, `big` semibold, `bold` bold).\nexport type TextOutputFontWeight =\n | 'light'\n | 'normal'\n | 'medium'\n | 'semibold'\n | 'bold';\n\nexport interface TextOutputConfig extends Config {\n label?: string;\n noTranslate?: boolean;\n align?: TextOutputAlign;\n variant?: TextOutputVariant;\n color?: string;\n fontWeight?: TextOutputFontWeight;\n}\n\n@Component({\n selector: 'm-text-output',\n imports: [],\n template: `\n <div\n class=\"m-text-output\"\n [style.color]=\"resolvedColorPallet().color\"\n [innerHTML]=\"html()\"\n ></div>\n `,\n styleUrl: './text-output.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'm-text-output-host',\n '[class.is-design-mode]': 'isDesignMode',\n '[class.align-left]': 'resolvedAlign() === \"left\"',\n '[class.align-right]': 'resolvedAlign() === \"right\"',\n '[class.align-center]': 'resolvedAlign() === \"center\"',\n '[class.variant-lead]': 'resolvedVariant() === \"lead\"',\n '[class.variant-big]': 'resolvedVariant() === \"big\"',\n '[class.variant-bold]': 'resolvedVariant() === \"bold\"',\n '[class.variant-footer]': 'resolvedVariant() === \"footer\"',\n '[class.variant-footnote]': 'resolvedVariant() === \"footnote\"',\n '[class.variant-link]': 'resolvedVariant() === \"link\"',\n '[class.variant-link-small]': 'resolvedVariant() === \"link-small\"',\n '[class.weight-light]': 'resolvedFontWeight() === \"light\"',\n '[class.weight-normal]': 'resolvedFontWeight() === \"normal\"',\n '[class.weight-medium]': 'resolvedFontWeight() === \"medium\"',\n '[class.weight-semibold]': 'resolvedFontWeight() === \"semibold\"',\n '[class.weight-bold]': 'resolvedFontWeight() === \"bold\"',\n '[class.has-color]': '!!(color() ?? config()?.color)',\n // Only a link is reachable and announced as one. Every other variant is a\n // size, and a focus stop on plain text is a tab stop that does nothing.\n '[attr.role]': 'isLink() ? \"link\" : null',\n '[attr.tabindex]': 'isLink() ? 0 : null',\n '(click)': 'onClick()',\n '(keydown.enter)': 'onClick()',\n '[style.--m-text-output-color]': 'resolvedColorPallet().color',\n '[style.--m-text-output-color-contrast]': 'resolvedColorPallet().contrastColor',\n '[style.--m-text-output-color-opposite]': 'resolvedColorPallet().oppositeColor',\n },\n})\nexport class TextOutputComponent extends ConfigComponent<TextOutputConfig> {\n override subFolder = LAYOUT_ASSET_FOLDER.text_output;\n override config = model<Partial<TextOutputConfig>>();\n private readonly translateService = inject(TranslateService);\n\n readonly align = input<TextOutputAlign | undefined>(undefined);\n readonly variant = input<TextOutputVariant | undefined>(undefined);\n // A theme colour key (`error`, `warning`, `success`, …) or a raw CSS colour,\n // resolved the same way an Icon's or a Logo's is so a token follows the\n // active theme instead of freezing one theme's hex into a template.\n readonly color = input<string | undefined>(undefined);\n readonly fontWeight = input<TextOutputFontWeight | undefined>(undefined);\n // `label` is the text itself, so a one-off TextOutput needs no asset behind\n // it (ADR 0010). MiniMark is a single string whatever it renders to, which\n // is what lets it ride on the tag at all.\n readonly label = input<string | undefined>(undefined);\n readonly noTranslate = input<boolean | string | undefined>(undefined);\n // Values for the message's `<name>` / `<$name>` placeholders. An input and\n // deliberately not a TextOutputConfig key: an asset is resolved by name and\n // shared across every Control that names it, and these differ per render\n // (ADR 0020). The query-string form (`min_length?len=6`) still works and\n // still loses to this on a shared placeholder, that being the precedence\n // TranslateService already had. Bind a named member — an object literal in a\n // template is refused by `no-inline-config` (ADR 0010).\n readonly params = input<Record<string, string> | undefined>(undefined);\n\n readonly resolvedAlign = computed<TextOutputAlign>(\n () => this.align() ?? this.config()?.align ?? 'left'\n );\n\n protected readonly resolvedVariant = computed<TextOutputVariant | undefined>(\n () => this.variant() ?? this.config()?.variant\n );\n\n protected readonly resolvedFontWeight = computed<\n TextOutputFontWeight | undefined\n >(() => this.fontWeight() ?? this.config()?.fontWeight);\n\n // Both link roles are the same affordance, so both take the focus stop, the\n // `role=\"link\"` and the `clicked` output; only their size differs.\n protected readonly isLink = computed(() => {\n const variant = this.resolvedVariant();\n return variant === 'link' || variant === 'link-small';\n });\n\n /**\n * Fired by a `link` variant and by nothing else. A text that is not a link\n * draws no affordance and takes no focus, so a click on it is a click on\n * prose — emitting there would be a control only a mouse could find.\n *\n * Where the link goes to a route instead, the caller attaches `routerLink`\n * and binds nothing here: one click means one thing.\n */\n readonly clicked = output<void>();\n\n protected onClick(): void {\n if (this.isLink()) this.clicked.emit();\n }\n\n protected readonly resolvedColorPallet = computed(() =>\n resolvePallet(\n this.color() ?? this.config()?.color ?? this.defaultColor,\n this.themeStore.color()\n )\n );\n\n protected override resolveComponentOverrides(): Partial<TextOutputConfig> {\n const overrides: Partial<TextOutputConfig> = {};\n const align = this.align();\n if (align !== undefined) overrides.align = align;\n const label = this.label();\n if (label !== undefined) overrides.label = label;\n const noTranslate = toAttrBool(this.noTranslate());\n if (noTranslate !== undefined) overrides.noTranslate = noTranslate;\n const variant = this.variant();\n if (variant !== undefined) overrides.variant = variant;\n const color = this.color();\n if (color !== undefined) overrides.color = color;\n const fontWeight = this.fontWeight();\n if (fontWeight !== undefined) overrides.fontWeight = fontWeight;\n return overrides;\n }\n\n protected readonly resolvedLabel = computed(() => this.config()?.label);\n protected readonly shouldTranslate = computed(\n () => !this.config()?.noTranslate\n );\n protected readonly html = computed(() => {\n const label = this.resolvedLabel();\n return this.shouldTranslate()\n ? this.translateService.translateToHtml(label, this.params())\n : this.translateService.toSafeHtml(label);\n });\n}\n"],"mappings":";;;;;AA2GA,IAAa,sBAAb,MAAa,4BAA4B,gBAAiC;CAC/D,YAAY,oBAAoB;CAChC,SAAS,MAAkC,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CACnC,mBAAmB,OAAO,gBAAgB;CAElD,QAAQ,MAAmC,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACrD,UAAU,MAAqC,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAIzD,QAAQ,MAA0B,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC5C,aAAa,MAAwC,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAI/D,QAAQ,MAA0B,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC5C,cAAc,MAAoC,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAQ5D,SAAS,MAA0C,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAE7D,gBAAgB,eACjB,KAAK,MAAK,KAAM,KAAK,OAAM,CAAE,EAAE,SAAS,QAC/C,GAAA,YAAA,CAAA,EAAA,WAAA,gBAAA,CAAA,+BAAA,CAAA,CAAA;CAEkB,kBAAkB,eAC7B,KAAK,QAAO,KAAM,KAAK,OAAM,CAAE,EAAE,SACxC,GAAA,YAAA,CAAA,EAAA,WAAA,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import { c as TranslatePipe } from "./magmonium-one-size-converter-BfT0Aw0g.mjs";
|
|
2
|
+
import { t as BaseInputComponent } from "./magmonium-one-base-input-CLBOTOUs.mjs";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import { ChangeDetectionStrategy, Component, computed, input, model } from "@angular/core";
|
|
5
|
+
var ToggleInputComponent = class ToggleInputComponent extends BaseInputComponent {
|
|
6
|
+
value = void 0;
|
|
7
|
+
checked = model(false);
|
|
8
|
+
config = input(...ngDevMode ? [void 0, { debugName: "config" }] : /* istanbul ignore next */ []);
|
|
9
|
+
required = input(false, ...ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []);
|
|
10
|
+
disabled = input(false, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
|
|
11
|
+
invalid = input(false, ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
|
|
12
|
+
touched = model(false, ...ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []);
|
|
13
|
+
focused = input(false, ...ngDevMode ? [{ debugName: "focused" }] : /* istanbul ignore next */ []);
|
|
14
|
+
errors = input([], ...ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []);
|
|
15
|
+
showErrors = computed(() => this.touched() && this.invalid(), ...ngDevMode ? [{ debugName: "showErrors" }] : /* istanbul ignore next */ []);
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
}
|
|
19
|
+
onChange(event) {
|
|
20
|
+
const target = event.target;
|
|
21
|
+
this.checked.set(target?.checked ?? false);
|
|
22
|
+
}
|
|
23
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
24
|
+
minVersion: "12.0.0",
|
|
25
|
+
version: "22.2.1",
|
|
26
|
+
ngImport: i0,
|
|
27
|
+
type: ToggleInputComponent,
|
|
28
|
+
deps: [],
|
|
29
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
30
|
+
});
|
|
31
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
32
|
+
minVersion: "17.0.0",
|
|
33
|
+
version: "22.2.1",
|
|
34
|
+
type: ToggleInputComponent,
|
|
35
|
+
isStandalone: true,
|
|
36
|
+
selector: "m-toggle-input",
|
|
37
|
+
inputs: {
|
|
38
|
+
checked: {
|
|
39
|
+
classPropertyName: "checked",
|
|
40
|
+
publicName: "checked",
|
|
41
|
+
isSignal: true,
|
|
42
|
+
isRequired: false,
|
|
43
|
+
transformFunction: null
|
|
44
|
+
},
|
|
45
|
+
config: {
|
|
46
|
+
classPropertyName: "config",
|
|
47
|
+
publicName: "config",
|
|
48
|
+
isSignal: true,
|
|
49
|
+
isRequired: false,
|
|
50
|
+
transformFunction: null
|
|
51
|
+
},
|
|
52
|
+
required: {
|
|
53
|
+
classPropertyName: "required",
|
|
54
|
+
publicName: "required",
|
|
55
|
+
isSignal: true,
|
|
56
|
+
isRequired: false,
|
|
57
|
+
transformFunction: null
|
|
58
|
+
},
|
|
59
|
+
disabled: {
|
|
60
|
+
classPropertyName: "disabled",
|
|
61
|
+
publicName: "disabled",
|
|
62
|
+
isSignal: true,
|
|
63
|
+
isRequired: false,
|
|
64
|
+
transformFunction: null
|
|
65
|
+
},
|
|
66
|
+
invalid: {
|
|
67
|
+
classPropertyName: "invalid",
|
|
68
|
+
publicName: "invalid",
|
|
69
|
+
isSignal: true,
|
|
70
|
+
isRequired: false,
|
|
71
|
+
transformFunction: null
|
|
72
|
+
},
|
|
73
|
+
touched: {
|
|
74
|
+
classPropertyName: "touched",
|
|
75
|
+
publicName: "touched",
|
|
76
|
+
isSignal: true,
|
|
77
|
+
isRequired: false,
|
|
78
|
+
transformFunction: null
|
|
79
|
+
},
|
|
80
|
+
focused: {
|
|
81
|
+
classPropertyName: "focused",
|
|
82
|
+
publicName: "focused",
|
|
83
|
+
isSignal: true,
|
|
84
|
+
isRequired: false,
|
|
85
|
+
transformFunction: null
|
|
86
|
+
},
|
|
87
|
+
errors: {
|
|
88
|
+
classPropertyName: "errors",
|
|
89
|
+
publicName: "errors",
|
|
90
|
+
isSignal: true,
|
|
91
|
+
isRequired: false,
|
|
92
|
+
transformFunction: null
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
outputs: {
|
|
96
|
+
checked: "checkedChange",
|
|
97
|
+
touched: "touchedChange"
|
|
98
|
+
},
|
|
99
|
+
usesInheritance: true,
|
|
100
|
+
ngImport: i0,
|
|
101
|
+
template: `
|
|
102
|
+
@if (config(); as toggle) {
|
|
103
|
+
<div class="toggle">
|
|
104
|
+
<input
|
|
105
|
+
[id]="toggle.name ?? ''"
|
|
106
|
+
[checked]="checked()"
|
|
107
|
+
(change)="onChange($event)"
|
|
108
|
+
type="checkbox"
|
|
109
|
+
/>
|
|
110
|
+
<label [attr.for]="toggle.name || null">{{
|
|
111
|
+
toggle.label | translate
|
|
112
|
+
}}</label>
|
|
113
|
+
</div>
|
|
114
|
+
}
|
|
115
|
+
`,
|
|
116
|
+
isInline: true,
|
|
117
|
+
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-block}:host-context(.m-dynamic-input),:host-context(.section-form-item__input),:host-context(.option-set__edit){display:contents}.toggle{--m-toggle-input-color: var(--m-input-color, var(--m-mm));display:flex;align-items:center;width:100%;box-sizing:border-box;cursor:pointer;-webkit-user-select:none;user-select:none;position:relative;height:calc(var(--input-size, 1em) * 2.25);min-height:calc(var(--input-size, 1em) * 2.25);padding:0;gap:.375em;border:none;background:transparent;box-shadow:none}.toggle--row{flex-direction:row}.toggle input[type=checkbox]{appearance:none;-webkit-appearance:none;-moz-appearance:none;position:relative;box-sizing:content-box;flex-shrink:0;margin:0;outline:none;cursor:pointer;width:calc(var(--input-size, 1em) * 2);height:var(--input-size, 1em);border-style:solid;border-width:2px;border-radius:calc(var(--input-size, 1em) / 2 + 2px);border-color:var(--m-text-input-border, color-mix(in srgb, var(--m-mm) 18%, var(--m-background)));background:color-mix(in srgb,var(--m-mm) 8%,var(--m-text-input-background, var(--m-background)));box-shadow:none;transition:var(--m-text-input-transition, border-color .2s ease, box-shadow .2s ease, background-color .2s ease)}.toggle input[type=checkbox]:after{content:\"\";position:absolute;top:calc((var(--input-size, 1em) - calc(var(--input-size, 1em) * .7)) / 2);left:calc((var(--input-size, 1em) - calc(var(--input-size, 1em) * .7)) / 2);width:calc(var(--input-size, 1em) * .7);height:calc(var(--input-size, 1em) * .7);border-radius:50%;background-color:var(--m-input-color, var(--m-mm));box-shadow:none;transition:transform .25s cubic-bezier(.4,0,.2,1)}.toggle input[type=checkbox]:hover:not(:disabled){border-color:var(--m-text-input-hover-border, color-mix(in srgb, var(--m-mm) 55%, var(--m-background)));background:var(--m-text-input-hover-background, color-mix(in srgb, var(--m-mm) 12%, var(--m-background)))}.toggle input[type=checkbox]:focus,.toggle input[type=checkbox]:focus-visible{border-color:var(--m-text-input-focus-border, var(--m-mm));box-shadow:none;outline:none}.toggle input[type=checkbox]:checked{border-color:var(--m-toggle-checked-border, var(--m-input-color, var(--m-mm)));background:var(--m-toggle-checked-background, var(--m-input-color, var(--m-mm)))}.toggle input[type=checkbox]:checked:after{transform:translate(calc(calc(var(--input-size, 1em) * 2) - var(--input-size, 1em)));background-color:var(--m-text-input-background, var(--m-background))}.toggle input[type=checkbox]:checked:hover:not(:disabled){background:color-mix(in srgb,var(--m-toggle-checked-background, var(--m-mm)) 88%,black 12%);border-color:color-mix(in srgb,var(--m-toggle-checked-border, var(--m-mm)) 88%,black 12%);box-shadow:0 0 0 3px color-mix(in srgb,var(--m-mm) 18%,transparent)}.toggle input[type=checkbox]:checked:focus,.toggle input[type=checkbox]:checked:focus-visible{box-shadow:none}.toggle input[type=checkbox]:disabled{opacity:.5;cursor:not-allowed}.toggle input[type=checkbox]:disabled+label{opacity:.5;cursor:not-allowed}.toggle label{flex:1;min-width:0;margin:0;cursor:pointer;font-size:var(--m-label-font-size, calc(var(--input-size, 1em) * .85));font-weight:var(--m-label-weight, var(--m-text-input-label-weight, 500));line-height:1.2;color:var(--m-label-color, var(--m-text))}\n"],
|
|
118
|
+
dependencies: [{
|
|
119
|
+
kind: "pipe",
|
|
120
|
+
type: TranslatePipe,
|
|
121
|
+
name: "translate"
|
|
122
|
+
}],
|
|
123
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
127
|
+
minVersion: "12.0.0",
|
|
128
|
+
version: "22.2.1",
|
|
129
|
+
ngImport: i0,
|
|
130
|
+
type: ToggleInputComponent,
|
|
131
|
+
decorators: [{
|
|
132
|
+
type: Component,
|
|
133
|
+
args: [{
|
|
134
|
+
selector: "m-toggle-input",
|
|
135
|
+
template: `
|
|
136
|
+
@if (config(); as toggle) {
|
|
137
|
+
<div class="toggle">
|
|
138
|
+
<input
|
|
139
|
+
[id]="toggle.name ?? ''"
|
|
140
|
+
[checked]="checked()"
|
|
141
|
+
(change)="onChange($event)"
|
|
142
|
+
type="checkbox"
|
|
143
|
+
/>
|
|
144
|
+
<label [attr.for]="toggle.name || null">{{
|
|
145
|
+
toggle.label | translate
|
|
146
|
+
}}</label>
|
|
147
|
+
</div>
|
|
148
|
+
}
|
|
149
|
+
`,
|
|
150
|
+
imports: [TranslatePipe],
|
|
151
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
152
|
+
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-block}:host-context(.m-dynamic-input),:host-context(.section-form-item__input),:host-context(.option-set__edit){display:contents}.toggle{--m-toggle-input-color: var(--m-input-color, var(--m-mm));display:flex;align-items:center;width:100%;box-sizing:border-box;cursor:pointer;-webkit-user-select:none;user-select:none;position:relative;height:calc(var(--input-size, 1em) * 2.25);min-height:calc(var(--input-size, 1em) * 2.25);padding:0;gap:.375em;border:none;background:transparent;box-shadow:none}.toggle--row{flex-direction:row}.toggle input[type=checkbox]{appearance:none;-webkit-appearance:none;-moz-appearance:none;position:relative;box-sizing:content-box;flex-shrink:0;margin:0;outline:none;cursor:pointer;width:calc(var(--input-size, 1em) * 2);height:var(--input-size, 1em);border-style:solid;border-width:2px;border-radius:calc(var(--input-size, 1em) / 2 + 2px);border-color:var(--m-text-input-border, color-mix(in srgb, var(--m-mm) 18%, var(--m-background)));background:color-mix(in srgb,var(--m-mm) 8%,var(--m-text-input-background, var(--m-background)));box-shadow:none;transition:var(--m-text-input-transition, border-color .2s ease, box-shadow .2s ease, background-color .2s ease)}.toggle input[type=checkbox]:after{content:\"\";position:absolute;top:calc((var(--input-size, 1em) - calc(var(--input-size, 1em) * .7)) / 2);left:calc((var(--input-size, 1em) - calc(var(--input-size, 1em) * .7)) / 2);width:calc(var(--input-size, 1em) * .7);height:calc(var(--input-size, 1em) * .7);border-radius:50%;background-color:var(--m-input-color, var(--m-mm));box-shadow:none;transition:transform .25s cubic-bezier(.4,0,.2,1)}.toggle input[type=checkbox]:hover:not(:disabled){border-color:var(--m-text-input-hover-border, color-mix(in srgb, var(--m-mm) 55%, var(--m-background)));background:var(--m-text-input-hover-background, color-mix(in srgb, var(--m-mm) 12%, var(--m-background)))}.toggle input[type=checkbox]:focus,.toggle input[type=checkbox]:focus-visible{border-color:var(--m-text-input-focus-border, var(--m-mm));box-shadow:none;outline:none}.toggle input[type=checkbox]:checked{border-color:var(--m-toggle-checked-border, var(--m-input-color, var(--m-mm)));background:var(--m-toggle-checked-background, var(--m-input-color, var(--m-mm)))}.toggle input[type=checkbox]:checked:after{transform:translate(calc(calc(var(--input-size, 1em) * 2) - var(--input-size, 1em)));background-color:var(--m-text-input-background, var(--m-background))}.toggle input[type=checkbox]:checked:hover:not(:disabled){background:color-mix(in srgb,var(--m-toggle-checked-background, var(--m-mm)) 88%,black 12%);border-color:color-mix(in srgb,var(--m-toggle-checked-border, var(--m-mm)) 88%,black 12%);box-shadow:0 0 0 3px color-mix(in srgb,var(--m-mm) 18%,transparent)}.toggle input[type=checkbox]:checked:focus,.toggle input[type=checkbox]:checked:focus-visible{box-shadow:none}.toggle input[type=checkbox]:disabled{opacity:.5;cursor:not-allowed}.toggle input[type=checkbox]:disabled+label{opacity:.5;cursor:not-allowed}.toggle label{flex:1;min-width:0;margin:0;cursor:pointer;font-size:var(--m-label-font-size, calc(var(--input-size, 1em) * .85));font-weight:var(--m-label-weight, var(--m-text-input-label-weight, 500));line-height:1.2;color:var(--m-label-color, var(--m-text))}\n"]
|
|
153
|
+
}]
|
|
154
|
+
}],
|
|
155
|
+
ctorParameters: () => [],
|
|
156
|
+
propDecorators: {
|
|
157
|
+
checked: [{
|
|
158
|
+
type: i0.Input,
|
|
159
|
+
args: [{
|
|
160
|
+
isSignal: true,
|
|
161
|
+
alias: "checked",
|
|
162
|
+
required: false
|
|
163
|
+
}]
|
|
164
|
+
}, {
|
|
165
|
+
type: i0.Output,
|
|
166
|
+
args: ["checkedChange"]
|
|
167
|
+
}],
|
|
168
|
+
config: [{
|
|
169
|
+
type: i0.Input,
|
|
170
|
+
args: [{
|
|
171
|
+
isSignal: true,
|
|
172
|
+
alias: "config",
|
|
173
|
+
required: false
|
|
174
|
+
}]
|
|
175
|
+
}],
|
|
176
|
+
required: [{
|
|
177
|
+
type: i0.Input,
|
|
178
|
+
args: [{
|
|
179
|
+
isSignal: true,
|
|
180
|
+
alias: "required",
|
|
181
|
+
required: false
|
|
182
|
+
}]
|
|
183
|
+
}],
|
|
184
|
+
disabled: [{
|
|
185
|
+
type: i0.Input,
|
|
186
|
+
args: [{
|
|
187
|
+
isSignal: true,
|
|
188
|
+
alias: "disabled",
|
|
189
|
+
required: false
|
|
190
|
+
}]
|
|
191
|
+
}],
|
|
192
|
+
invalid: [{
|
|
193
|
+
type: i0.Input,
|
|
194
|
+
args: [{
|
|
195
|
+
isSignal: true,
|
|
196
|
+
alias: "invalid",
|
|
197
|
+
required: false
|
|
198
|
+
}]
|
|
199
|
+
}],
|
|
200
|
+
touched: [{
|
|
201
|
+
type: i0.Input,
|
|
202
|
+
args: [{
|
|
203
|
+
isSignal: true,
|
|
204
|
+
alias: "touched",
|
|
205
|
+
required: false
|
|
206
|
+
}]
|
|
207
|
+
}, {
|
|
208
|
+
type: i0.Output,
|
|
209
|
+
args: ["touchedChange"]
|
|
210
|
+
}],
|
|
211
|
+
focused: [{
|
|
212
|
+
type: i0.Input,
|
|
213
|
+
args: [{
|
|
214
|
+
isSignal: true,
|
|
215
|
+
alias: "focused",
|
|
216
|
+
required: false
|
|
217
|
+
}]
|
|
218
|
+
}],
|
|
219
|
+
errors: [{
|
|
220
|
+
type: i0.Input,
|
|
221
|
+
args: [{
|
|
222
|
+
isSignal: true,
|
|
223
|
+
alias: "errors",
|
|
224
|
+
required: false
|
|
225
|
+
}]
|
|
226
|
+
}]
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
export { ToggleInputComponent };
|
|
230
|
+
|
|
231
|
+
//# sourceMappingURL=magmonium-one-toggle-D2XEbN-b.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"magmonium-one-toggle-D2XEbN-b.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/ui/toggle/toggle.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n model,\n ModelSignal,\n} from '@angular/core';\nimport { ToggleInput } from '../../model/input';\nimport { TranslatePipe } from '../../../../pipe/translate';\nimport {\n FormCheckboxControl,\n ValidationError,\n WithOptionalFieldTree,\n} from '@angular/forms/signals';\nimport { BaseInputComponent } from '../../lib/base-input';\n\n@Component({\n selector: 'm-toggle-input',\n template: `\n @if (config(); as toggle) {\n <div class=\"toggle\">\n <input\n [id]=\"toggle.name ?? ''\"\n [checked]=\"checked()\"\n (change)=\"onChange($event)\"\n type=\"checkbox\"\n />\n <label [attr.for]=\"toggle.name || null\">{{\n toggle.label | translate\n }}</label>\n </div>\n }\n `,\n imports: [TranslatePipe],\n styleUrl: './toggle.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ToggleInputComponent\n extends BaseInputComponent<ToggleInput>\n implements FormCheckboxControl\n{\n public value = undefined;\n public checked = model<boolean>(false) as ModelSignal<boolean>;\n public override config = input<Partial<ToggleInput> | undefined>();\n public override required = input<boolean>(false);\n public override disabled = input<boolean>(false);\n public override invalid = input<boolean>(false);\n public override touched = model<boolean>(false);\n public override focused = input<boolean>(false);\n public override errors = input<readonly WithOptionalFieldTree<ValidationError>[]>(\n []\n );\n public override showErrors = computed(() => this.touched() && this.invalid());\n\n /** Required by FormCheckboxControl interface */\n // public readonly checked: ModelSignal<boolean> = this.value; // Already defined above\n\n constructor() {\n super();\n }\n\n protected onChange(event: Event): void {\n const target = event.target as HTMLInputElement;\n this.checked.set(target?.checked ?? false);\n }\n}\n"],"mappings":";;;;AAsCA,IAAa,uBAAb,MAAa,6BACH,mBAA+B;CAGhC,QAAQ;CACR,UAAU,MAAe,KAAK;CACrB,SAAS,MAAyC,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAClD,WAAW,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,WAAW,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,UAAU,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,UAAU,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,UAAU,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAA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