@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,183 @@
|
|
|
1
|
+
import { i as resolveSize } from "./magmonium-one-size-converter-BfT0Aw0g.mjs";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { Directive, ElementRef, computed, effect, inject, input, model } from "@angular/core";
|
|
4
|
+
var BaseInputComponent = class BaseInputComponent {
|
|
5
|
+
focused = input(false, ...ngDevMode ? [{ debugName: "focused" }] : /* istanbul ignore next */ []);
|
|
6
|
+
errors = input([], ...ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []);
|
|
7
|
+
config = input(...ngDevMode ? [void 0, { debugName: "config" }] : /* istanbul ignore next */ []);
|
|
8
|
+
required = input(false, ...ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []);
|
|
9
|
+
disabled = input(false, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
|
|
10
|
+
invalid = input(false, ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
|
|
11
|
+
touched = model(false, ...ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []);
|
|
12
|
+
readonly = input(false, ...ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []);
|
|
13
|
+
elementRef = inject(ElementRef);
|
|
14
|
+
applyConfigSize = effect(() => {
|
|
15
|
+
const size = this.config()?.size;
|
|
16
|
+
const el = this.elementRef.nativeElement;
|
|
17
|
+
if (size) {
|
|
18
|
+
const resolved = resolveSize(size);
|
|
19
|
+
el.style.setProperty("--input-size", resolved);
|
|
20
|
+
el.style.fontSize = resolved;
|
|
21
|
+
} else {
|
|
22
|
+
el.style.removeProperty("--input-size");
|
|
23
|
+
el.style.removeProperty("font-size");
|
|
24
|
+
}
|
|
25
|
+
}, ...ngDevMode ? [{ debugName: "applyConfigSize" }] : /* istanbul ignore next */ []);
|
|
26
|
+
showErrors = computed(() => (this.touched() === true || this.touched() + "" === "true") && (this.invalid() === true || this.invalid() + "" === "true"), ...ngDevMode ? [{ debugName: "showErrors" }] : /* istanbul ignore next */ []);
|
|
27
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
28
|
+
minVersion: "12.0.0",
|
|
29
|
+
version: "22.2.1",
|
|
30
|
+
ngImport: i0,
|
|
31
|
+
type: BaseInputComponent,
|
|
32
|
+
deps: [],
|
|
33
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
34
|
+
});
|
|
35
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
36
|
+
minVersion: "17.1.0",
|
|
37
|
+
version: "22.2.1",
|
|
38
|
+
type: BaseInputComponent,
|
|
39
|
+
isStandalone: true,
|
|
40
|
+
inputs: {
|
|
41
|
+
focused: {
|
|
42
|
+
classPropertyName: "focused",
|
|
43
|
+
publicName: "focused",
|
|
44
|
+
isSignal: true,
|
|
45
|
+
isRequired: false,
|
|
46
|
+
transformFunction: null
|
|
47
|
+
},
|
|
48
|
+
errors: {
|
|
49
|
+
classPropertyName: "errors",
|
|
50
|
+
publicName: "errors",
|
|
51
|
+
isSignal: true,
|
|
52
|
+
isRequired: false,
|
|
53
|
+
transformFunction: null
|
|
54
|
+
},
|
|
55
|
+
config: {
|
|
56
|
+
classPropertyName: "config",
|
|
57
|
+
publicName: "config",
|
|
58
|
+
isSignal: true,
|
|
59
|
+
isRequired: false,
|
|
60
|
+
transformFunction: null
|
|
61
|
+
},
|
|
62
|
+
required: {
|
|
63
|
+
classPropertyName: "required",
|
|
64
|
+
publicName: "required",
|
|
65
|
+
isSignal: true,
|
|
66
|
+
isRequired: false,
|
|
67
|
+
transformFunction: null
|
|
68
|
+
},
|
|
69
|
+
disabled: {
|
|
70
|
+
classPropertyName: "disabled",
|
|
71
|
+
publicName: "disabled",
|
|
72
|
+
isSignal: true,
|
|
73
|
+
isRequired: false,
|
|
74
|
+
transformFunction: null
|
|
75
|
+
},
|
|
76
|
+
invalid: {
|
|
77
|
+
classPropertyName: "invalid",
|
|
78
|
+
publicName: "invalid",
|
|
79
|
+
isSignal: true,
|
|
80
|
+
isRequired: false,
|
|
81
|
+
transformFunction: null
|
|
82
|
+
},
|
|
83
|
+
touched: {
|
|
84
|
+
classPropertyName: "touched",
|
|
85
|
+
publicName: "touched",
|
|
86
|
+
isSignal: true,
|
|
87
|
+
isRequired: false,
|
|
88
|
+
transformFunction: null
|
|
89
|
+
},
|
|
90
|
+
readonly: {
|
|
91
|
+
classPropertyName: "readonly",
|
|
92
|
+
publicName: "readonly",
|
|
93
|
+
isSignal: true,
|
|
94
|
+
isRequired: false,
|
|
95
|
+
transformFunction: null
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
outputs: { touched: "touchedChange" },
|
|
99
|
+
ngImport: i0
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
103
|
+
minVersion: "12.0.0",
|
|
104
|
+
version: "22.2.1",
|
|
105
|
+
ngImport: i0,
|
|
106
|
+
type: BaseInputComponent,
|
|
107
|
+
decorators: [{
|
|
108
|
+
type: Directive,
|
|
109
|
+
args: [{}]
|
|
110
|
+
}],
|
|
111
|
+
propDecorators: {
|
|
112
|
+
focused: [{
|
|
113
|
+
type: i0.Input,
|
|
114
|
+
args: [{
|
|
115
|
+
isSignal: true,
|
|
116
|
+
alias: "focused",
|
|
117
|
+
required: false
|
|
118
|
+
}]
|
|
119
|
+
}],
|
|
120
|
+
errors: [{
|
|
121
|
+
type: i0.Input,
|
|
122
|
+
args: [{
|
|
123
|
+
isSignal: true,
|
|
124
|
+
alias: "errors",
|
|
125
|
+
required: false
|
|
126
|
+
}]
|
|
127
|
+
}],
|
|
128
|
+
config: [{
|
|
129
|
+
type: i0.Input,
|
|
130
|
+
args: [{
|
|
131
|
+
isSignal: true,
|
|
132
|
+
alias: "config",
|
|
133
|
+
required: false
|
|
134
|
+
}]
|
|
135
|
+
}],
|
|
136
|
+
required: [{
|
|
137
|
+
type: i0.Input,
|
|
138
|
+
args: [{
|
|
139
|
+
isSignal: true,
|
|
140
|
+
alias: "required",
|
|
141
|
+
required: false
|
|
142
|
+
}]
|
|
143
|
+
}],
|
|
144
|
+
disabled: [{
|
|
145
|
+
type: i0.Input,
|
|
146
|
+
args: [{
|
|
147
|
+
isSignal: true,
|
|
148
|
+
alias: "disabled",
|
|
149
|
+
required: false
|
|
150
|
+
}]
|
|
151
|
+
}],
|
|
152
|
+
invalid: [{
|
|
153
|
+
type: i0.Input,
|
|
154
|
+
args: [{
|
|
155
|
+
isSignal: true,
|
|
156
|
+
alias: "invalid",
|
|
157
|
+
required: false
|
|
158
|
+
}]
|
|
159
|
+
}],
|
|
160
|
+
touched: [{
|
|
161
|
+
type: i0.Input,
|
|
162
|
+
args: [{
|
|
163
|
+
isSignal: true,
|
|
164
|
+
alias: "touched",
|
|
165
|
+
required: false
|
|
166
|
+
}]
|
|
167
|
+
}, {
|
|
168
|
+
type: i0.Output,
|
|
169
|
+
args: ["touchedChange"]
|
|
170
|
+
}],
|
|
171
|
+
readonly: [{
|
|
172
|
+
type: i0.Input,
|
|
173
|
+
args: [{
|
|
174
|
+
isSignal: true,
|
|
175
|
+
alias: "readonly",
|
|
176
|
+
required: false
|
|
177
|
+
}]
|
|
178
|
+
}]
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
export { BaseInputComponent as t };
|
|
182
|
+
|
|
183
|
+
//# sourceMappingURL=magmonium-one-base-input-CLBOTOUs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"magmonium-one-base-input-CLBOTOUs.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/lib/base-input.ts"],"sourcesContent":["import {\n Directive,\n ElementRef,\n effect,\n inject,\n input,\n model,\n computed,\n InputSignal,\n ModelSignal,\n} from '@angular/core';\nimport { ValidationError, WithOptionalFieldTree } from '@angular/forms/signals';\nimport { Size } from '../../../enum/scaling/size';\nimport { Input } from '../model/input';\nimport { resolveSize } from '../../../functions/size/size-converter';\n\n@Directive({})\nexport class BaseInputComponent<T extends Input = Input> {\n public focused: InputSignal<boolean> = input<boolean>(false);\n public errors: InputSignal<readonly WithOptionalFieldTree<ValidationError>[]> =\n input<readonly WithOptionalFieldTree<ValidationError>[]>([]);\n public config: InputSignal<Partial<T> | undefined> = input<\n Partial<T> | undefined\n >();\n public required: InputSignal<boolean> = input<boolean>(false);\n public disabled: InputSignal<boolean> = input<boolean>(false);\n public invalid: InputSignal<boolean> = input<boolean>(false);\n public touched: ModelSignal<boolean> = model<boolean>(false);\n public readonly: InputSignal<boolean> = input<boolean>(false);\n\n protected readonly elementRef = inject(ElementRef);\n\n // SectionFormItem stamps Size onto config; inputs scale via CSS var\n // so size changes update without destroying the field. Uses CSS var because\n // host may have display: contents, but CSS vars still inherit to children.\n private readonly applyConfigSize = effect(() => {\n const configWithSize = this.config() as Partial<Input> & { size?: Size };\n const size = configWithSize?.size;\n const el = this.elementRef.nativeElement as HTMLElement;\n if (size) {\n const resolved = resolveSize(size);\n el.style.setProperty('--input-size', resolved);\n // Some input variants declare their own font-size on the rendered\n // control. Keep the actual input text synchronized with the size that\n // drives its geometry instead of relying only on inherited variables.\n el.style.fontSize = resolved;\n } else {\n el.style.removeProperty('--input-size');\n el.style.removeProperty('font-size');\n }\n });\n\n public showErrors = computed(() => \n (this.touched() === true || this.touched() + '' === 'true') && \n (this.invalid() === true || this.invalid() + '' === 'true')\n );\n}\n"],"mappings":";;;AAiBA,IAAa,qBAAb,MAAa,mBAAkB;CACtB,UAAgC,MAAe,OAAM,GAAA,YAAA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ect, computed, inject, model, signal, viewChild } from "@angular/core";
|
|
4
|
+
var BaseTextInputComponent = class BaseTextInputComponent extends BaseInputComponent {
|
|
5
|
+
value = model();
|
|
6
|
+
inputElement = viewChild("inputElement", ...ngDevMode ? [{ debugName: "inputElement" }] : /* istanbul ignore next */ []);
|
|
7
|
+
document = inject(DOCUMENT);
|
|
8
|
+
autofocused;
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
afterRenderEffect(() => {
|
|
12
|
+
const element = this.inputElement();
|
|
13
|
+
if (!this.focused() || !element) return;
|
|
14
|
+
const node = element.nativeElement;
|
|
15
|
+
if (this.autofocused === node) return;
|
|
16
|
+
const active = this.document.activeElement;
|
|
17
|
+
if (active && active !== this.document.body && active !== node) return;
|
|
18
|
+
this.autofocused = node;
|
|
19
|
+
node.focus();
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
isFocused = signal(false, ...ngDevMode ? [{ debugName: "isFocused" }] : /* istanbul ignore next */ []);
|
|
23
|
+
iconColor = computed(() => {
|
|
24
|
+
if (this.showErrors()) return "error";
|
|
25
|
+
if (this.isFocused()) return "focus";
|
|
26
|
+
return "border";
|
|
27
|
+
}, ...ngDevMode ? [{ debugName: "iconColor" }] : /* istanbul ignore next */ []);
|
|
28
|
+
setValue = (value) => {
|
|
29
|
+
this.value.set(value);
|
|
30
|
+
this.touched.set(true);
|
|
31
|
+
};
|
|
32
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
33
|
+
minVersion: "12.0.0",
|
|
34
|
+
version: "22.2.1",
|
|
35
|
+
ngImport: i0,
|
|
36
|
+
type: BaseTextInputComponent,
|
|
37
|
+
deps: [],
|
|
38
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
39
|
+
});
|
|
40
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
41
|
+
minVersion: "17.2.0",
|
|
42
|
+
version: "22.2.1",
|
|
43
|
+
type: BaseTextInputComponent,
|
|
44
|
+
isStandalone: true,
|
|
45
|
+
inputs: { value: {
|
|
46
|
+
classPropertyName: "value",
|
|
47
|
+
publicName: "value",
|
|
48
|
+
isSignal: true,
|
|
49
|
+
isRequired: false,
|
|
50
|
+
transformFunction: null
|
|
51
|
+
} },
|
|
52
|
+
outputs: { value: "valueChange" },
|
|
53
|
+
viewQueries: [{
|
|
54
|
+
propertyName: "inputElement",
|
|
55
|
+
first: true,
|
|
56
|
+
predicate: ["inputElement"],
|
|
57
|
+
descendants: true,
|
|
58
|
+
isSignal: true
|
|
59
|
+
}],
|
|
60
|
+
usesInheritance: true,
|
|
61
|
+
ngImport: i0
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
65
|
+
minVersion: "12.0.0",
|
|
66
|
+
version: "22.2.1",
|
|
67
|
+
ngImport: i0,
|
|
68
|
+
type: BaseTextInputComponent,
|
|
69
|
+
decorators: [{
|
|
70
|
+
type: Directive,
|
|
71
|
+
args: [{}]
|
|
72
|
+
}],
|
|
73
|
+
ctorParameters: () => [],
|
|
74
|
+
propDecorators: {
|
|
75
|
+
value: [{
|
|
76
|
+
type: i0.Input,
|
|
77
|
+
args: [{
|
|
78
|
+
isSignal: true,
|
|
79
|
+
alias: "value",
|
|
80
|
+
required: false
|
|
81
|
+
}]
|
|
82
|
+
}, {
|
|
83
|
+
type: i0.Output,
|
|
84
|
+
args: ["valueChange"]
|
|
85
|
+
}],
|
|
86
|
+
inputElement: [{
|
|
87
|
+
type: i0.ViewChild,
|
|
88
|
+
args: ["inputElement", { isSignal: true }]
|
|
89
|
+
}]
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
export { BaseTextInputComponent as t };
|
|
93
|
+
|
|
94
|
+
//# sourceMappingURL=magmonium-one-base-text-Zb0oLNRX.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"magmonium-one-base-text-Zb0oLNRX.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/input/ui/text/base-text.ts"],"sourcesContent":["import {\n afterRenderEffect,\n computed,\n Directive,\n DOCUMENT,\n ElementRef,\n inject,\n model,\n ModelSignal,\n signal,\n viewChild,\n} from '@angular/core';\nimport { FormValueControl } from '@angular/forms/signals';\nimport { Input, TextInput } from '../../model/input';\nimport { BaseInputComponent } from '../../lib/base-input';\n\n@Directive({})\nexport class BaseTextInputComponent<T extends Input = TextInput>\n extends BaseInputComponent<T>\n implements FormValueControl<string>\n{\n public value = model<string>() as ModelSignal<string>;\n\n private inputElement =\n viewChild<ElementRef<HTMLInputElement>>('inputElement');\n\n private readonly document = inject(DOCUMENT);\n\n /** The element this field has already claimed the caret for, once. */\n private autofocused: HTMLInputElement | undefined;\n\n constructor() {\n super();\n afterRenderEffect(() => {\n const element = this.inputElement();\n if (!this.focused() || !element) return;\n\n const node = element.nativeElement;\n // Once per element. A form that re-renders — an inspector rebuilt on\n // every store change — mounts a fresh input each time, and a focus per\n // mount is a focus per keystroke somewhere else on the screen.\n if (this.autofocused === node) return;\n\n // And never out of a surface the User is already working in. Same rule\n // the form makes for its own first field: a caret that has been placed\n // is theirs, not the next form's to take.\n const active = this.document.activeElement;\n if (active && active !== this.document.body && active !== node) return;\n\n this.autofocused = node;\n node.focus();\n });\n }\n\n public readonly isFocused = signal(false);\n\n // Icon tracks the wrapper's border: =input-wrapper paints $error on error,\n // the focus tint on focus, and the border color at rest.\n public readonly iconColor = computed(() => {\n if (this.showErrors()) return 'error';\n if (this.isFocused()) return 'focus';\n return 'border';\n });\n\n protected readonly setValue = (value: string) => {\n this.value.set(value);\n this.touched.set(true);\n };\n}\n"],"mappings":";;;AAiBA,IAAa,yBAAb,MAAa,+BACH,mBAAqB;CAGtB,QAAQ,MAAK;CAEZ,eACN,UAAwC,gBAAe,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CAExC,WAAW,OAAO,QAAQ;CAGnC;CAER,cAAA;EACE,MAAK;EACL,wBAAuB;GACr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