@magmonium/one 0.4.30 → 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.
- package/assets/docs/en/app-release.md +0 -11
- package/assets/i18n/en.json +2 -0
- package/fesm2022/magmonium-one-attribute-value-CLBOZcme.mjs +255 -0
- package/fesm2022/magmonium-one-attribute-value-CLBOZcme.mjs.map +1 -0
- package/fesm2022/magmonium-one-base-checkbox-D7NYJdU3.mjs +77 -0
- package/fesm2022/magmonium-one-base-checkbox-D7NYJdU3.mjs.map +1 -0
- package/fesm2022/magmonium-one-base-dropdown-CEDsqaPz.mjs +604 -0
- package/fesm2022/magmonium-one-base-dropdown-CEDsqaPz.mjs.map +1 -0
- package/fesm2022/magmonium-one-base-input-BOaD-WIi.mjs +183 -0
- package/fesm2022/magmonium-one-base-input-BOaD-WIi.mjs.map +1 -0
- package/fesm2022/magmonium-one-base-text-D6p6_vsb.mjs +94 -0
- package/fesm2022/magmonium-one-base-text-D6p6_vsb.mjs.map +1 -0
- package/fesm2022/magmonium-one-button-rVNnp6G8.mjs +1281 -0
- package/fesm2022/magmonium-one-button-rVNnp6G8.mjs.map +1 -0
- package/fesm2022/magmonium-one-checkbox-rj4XHxb3.mjs +365 -0
- package/fesm2022/magmonium-one-checkbox-rj4XHxb3.mjs.map +1 -0
- package/fesm2022/magmonium-one-color-utl-CirPzUFk.mjs +449 -0
- package/fesm2022/magmonium-one-color-utl-CirPzUFk.mjs.map +1 -0
- package/fesm2022/magmonium-one-directives-DOBENX_K.mjs +1285 -0
- package/fesm2022/magmonium-one-directives-DOBENX_K.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-Cue4x6tD.mjs +428 -0
- package/fesm2022/magmonium-one-group-Cue4x6tD.mjs.map +1 -0
- package/fesm2022/magmonium-one-header-DPVnaEOV.mjs +380 -0
- package/fesm2022/magmonium-one-header-DPVnaEOV.mjs.map +1 -0
- package/fesm2022/magmonium-one-icon-Dso-9RMN.mjs +833 -0
- package/fesm2022/magmonium-one-icon-Dso-9RMN.mjs.map +1 -0
- package/fesm2022/magmonium-one-image-editor-C7AtzEf6.mjs +438 -0
- package/fesm2022/magmonium-one-image-editor-C7AtzEf6.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-B30Q4Vut.mjs +574 -0
- package/fesm2022/magmonium-one-label-B30Q4Vut.mjs.map +1 -0
- package/fesm2022/magmonium-one-m-ref-Dt0DCm8X.mjs +147 -0
- package/fesm2022/magmonium-one-m-ref-Dt0DCm8X.mjs.map +1 -0
- package/fesm2022/magmonium-one-menu-BBOnOK4M.mjs +887 -0
- package/fesm2022/magmonium-one-menu-BBOnOK4M.mjs.map +1 -0
- package/fesm2022/magmonium-one-multi-range-DCOwngql.mjs +458 -0
- package/fesm2022/magmonium-one-multi-range-DCOwngql.mjs.map +1 -0
- package/fesm2022/magmonium-one-options-asset-D8Gg1yNl.mjs +97 -0
- package/fesm2022/magmonium-one-options-asset-D8Gg1yNl.mjs.map +1 -0
- package/fesm2022/magmonium-one-otp-DLF7Pq94.mjs +261 -0
- package/fesm2022/magmonium-one-otp-DLF7Pq94.mjs.map +1 -0
- package/fesm2022/magmonium-one-password-BSOU4RI0.mjs +217 -0
- package/fesm2022/magmonium-one-password-BSOU4RI0.mjs.map +1 -0
- package/fesm2022/magmonium-one-radio-CYnWLXPZ.mjs +111 -0
- package/fesm2022/magmonium-one-radio-CYnWLXPZ.mjs.map +1 -0
- package/fesm2022/magmonium-one-range-CmmZAr57.mjs +216 -0
- package/fesm2022/magmonium-one-range-CmmZAr57.mjs.map +1 -0
- package/fesm2022/magmonium-one-rolldown-runtime-DpJrqANO.mjs +11 -0
- package/fesm2022/magmonium-one-selector-DDnBYNLr.mjs +1065 -0
- package/fesm2022/magmonium-one-selector-DDnBYNLr.mjs.map +1 -0
- package/fesm2022/magmonium-one-size-converter-B-UubQQ0.mjs +1057 -0
- package/fesm2022/magmonium-one-size-converter-B-UubQQ0.mjs.map +1 -0
- package/fesm2022/magmonium-one-text-FXb-RyBh.mjs +406 -0
- package/fesm2022/magmonium-one-text-FXb-RyBh.mjs.map +1 -0
- package/fesm2022/magmonium-one-text-output-D2XQWyL0.mjs +296 -0
- package/fesm2022/magmonium-one-text-output-D2XQWyL0.mjs.map +1 -0
- package/fesm2022/magmonium-one-theme-a7GlFbzE.mjs +1 -0
- package/fesm2022/magmonium-one-toggle-C0eTrtkt.mjs +231 -0
- package/fesm2022/magmonium-one-toggle-C0eTrtkt.mjs.map +1 -0
- package/fesm2022/magmonium-one.mjs +49231 -2
- package/fesm2022/magmonium-one.mjs.map +1 -1
- package/package.json +8 -8
- package/types/magmonium-one.d.ts +13801 -9516
- 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,380 @@
|
|
|
1
|
+
import { i as resolveSize, l as TranslateService } from "./magmonium-one-size-converter-B-UubQQ0.mjs";
|
|
2
|
+
import { i as SIZE_CONTEXT, r as IconComponent } from "./magmonium-one-icon-Dso-9RMN.mjs";
|
|
3
|
+
import { t as ButtonComponent } from "./magmonium-one-button-rVNnp6G8.mjs";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import { ChangeDetectionStrategy, Component, computed, inject, input, output } from "@angular/core";
|
|
6
|
+
var HeaderComponent = class HeaderComponent {
|
|
7
|
+
level = input(3, ...ngDevMode ? [{ debugName: "level" }] : /* istanbul ignore next */ []);
|
|
8
|
+
label = input(...ngDevMode ? [void 0, { debugName: "label" }] : /* istanbul ignore next */ []);
|
|
9
|
+
icon = input(...ngDevMode ? [void 0, { debugName: "icon" }] : /* istanbul ignore next */ []);
|
|
10
|
+
actionButton = input(...ngDevMode ? [void 0, { debugName: "actionButton" }] : /* istanbul ignore next */ []);
|
|
11
|
+
actionLabel = input(...ngDevMode ? [void 0, { debugName: "actionLabel" }] : /* istanbul ignore next */ []);
|
|
12
|
+
noTranslate = input(false, ...ngDevMode ? [{ debugName: "noTranslate" }] : /* istanbul ignore next */ []);
|
|
13
|
+
params = input(void 0, ...ngDevMode ? [{ debugName: "params" }] : /* istanbul ignore next */ []);
|
|
14
|
+
actionClick = output();
|
|
15
|
+
translateService = inject(TranslateService);
|
|
16
|
+
sizeContext = inject(SIZE_CONTEXT, { optional: true });
|
|
17
|
+
actionSize = computed(() => resolveSize(this.sizeContext?.size()), ...ngDevMode ? [{ debugName: "actionSize" }] : /* istanbul ignore next */ []);
|
|
18
|
+
actionConfig = computed(() => {
|
|
19
|
+
const icon = this.actionButton();
|
|
20
|
+
if (!icon) return void 0;
|
|
21
|
+
return {
|
|
22
|
+
icon,
|
|
23
|
+
label: this.actionLabel(),
|
|
24
|
+
iconOnly: true,
|
|
25
|
+
variant: "ghost"
|
|
26
|
+
};
|
|
27
|
+
}, ...ngDevMode ? [{ debugName: "actionConfig" }] : /* istanbul ignore next */ []);
|
|
28
|
+
text = computed(() => this.noTranslate() ? this.label() ?? "" : this.translateService.translate(this.label(), this.params()), ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
|
|
29
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
30
|
+
minVersion: "12.0.0",
|
|
31
|
+
version: "22.2.1",
|
|
32
|
+
ngImport: i0,
|
|
33
|
+
type: HeaderComponent,
|
|
34
|
+
deps: [],
|
|
35
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
36
|
+
});
|
|
37
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
38
|
+
minVersion: "17.0.0",
|
|
39
|
+
version: "22.2.1",
|
|
40
|
+
type: HeaderComponent,
|
|
41
|
+
isStandalone: true,
|
|
42
|
+
selector: "m-header",
|
|
43
|
+
inputs: {
|
|
44
|
+
level: {
|
|
45
|
+
classPropertyName: "level",
|
|
46
|
+
publicName: "level",
|
|
47
|
+
isSignal: true,
|
|
48
|
+
isRequired: false,
|
|
49
|
+
transformFunction: null
|
|
50
|
+
},
|
|
51
|
+
label: {
|
|
52
|
+
classPropertyName: "label",
|
|
53
|
+
publicName: "label",
|
|
54
|
+
isSignal: true,
|
|
55
|
+
isRequired: false,
|
|
56
|
+
transformFunction: null
|
|
57
|
+
},
|
|
58
|
+
icon: {
|
|
59
|
+
classPropertyName: "icon",
|
|
60
|
+
publicName: "icon",
|
|
61
|
+
isSignal: true,
|
|
62
|
+
isRequired: false,
|
|
63
|
+
transformFunction: null
|
|
64
|
+
},
|
|
65
|
+
actionButton: {
|
|
66
|
+
classPropertyName: "actionButton",
|
|
67
|
+
publicName: "actionButton",
|
|
68
|
+
isSignal: true,
|
|
69
|
+
isRequired: false,
|
|
70
|
+
transformFunction: null
|
|
71
|
+
},
|
|
72
|
+
actionLabel: {
|
|
73
|
+
classPropertyName: "actionLabel",
|
|
74
|
+
publicName: "actionLabel",
|
|
75
|
+
isSignal: true,
|
|
76
|
+
isRequired: false,
|
|
77
|
+
transformFunction: null
|
|
78
|
+
},
|
|
79
|
+
noTranslate: {
|
|
80
|
+
classPropertyName: "noTranslate",
|
|
81
|
+
publicName: "noTranslate",
|
|
82
|
+
isSignal: true,
|
|
83
|
+
isRequired: false,
|
|
84
|
+
transformFunction: null
|
|
85
|
+
},
|
|
86
|
+
params: {
|
|
87
|
+
classPropertyName: "params",
|
|
88
|
+
publicName: "params",
|
|
89
|
+
isSignal: true,
|
|
90
|
+
isRequired: false,
|
|
91
|
+
transformFunction: null
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
outputs: { actionClick: "actionClick" },
|
|
95
|
+
ngImport: i0,
|
|
96
|
+
template: `
|
|
97
|
+
@switch (level()) {
|
|
98
|
+
@case (1) {
|
|
99
|
+
<h1 class="header__heading">
|
|
100
|
+
@if (icon(); as iconName) {
|
|
101
|
+
<m-icon class="header__icon" [name]="iconName" />
|
|
102
|
+
}
|
|
103
|
+
<span>{{ text() }}</span>
|
|
104
|
+
<ng-content />
|
|
105
|
+
@if (actionConfig(); as action) {
|
|
106
|
+
<m-button class="header__action" [config]="action" [style.--m-button-size]="actionSize()" (clicked)="actionClick.emit()" />
|
|
107
|
+
}
|
|
108
|
+
</h1>
|
|
109
|
+
}
|
|
110
|
+
@case (2) {
|
|
111
|
+
<h2 class="header__heading">
|
|
112
|
+
@if (icon(); as iconName) {
|
|
113
|
+
<m-icon class="header__icon" [name]="iconName" />
|
|
114
|
+
}
|
|
115
|
+
<span>{{ text() }}</span>
|
|
116
|
+
<ng-content />
|
|
117
|
+
@if (actionConfig(); as action) {
|
|
118
|
+
<m-button class="header__action" [config]="action" [style.--m-button-size]="actionSize()" (clicked)="actionClick.emit()" />
|
|
119
|
+
}
|
|
120
|
+
</h2>
|
|
121
|
+
}
|
|
122
|
+
@case (3) {
|
|
123
|
+
<h3 class="header__heading">
|
|
124
|
+
@if (icon(); as iconName) {
|
|
125
|
+
<m-icon class="header__icon" [name]="iconName" />
|
|
126
|
+
}
|
|
127
|
+
<span>{{ text() }}</span>
|
|
128
|
+
<ng-content />
|
|
129
|
+
@if (actionConfig(); as action) {
|
|
130
|
+
<m-button class="header__action" [config]="action" [style.--m-button-size]="actionSize()" (clicked)="actionClick.emit()" />
|
|
131
|
+
}
|
|
132
|
+
</h3>
|
|
133
|
+
}
|
|
134
|
+
@case (4) {
|
|
135
|
+
<h4 class="header__heading">
|
|
136
|
+
@if (icon(); as iconName) {
|
|
137
|
+
<m-icon class="header__icon" [name]="iconName" />
|
|
138
|
+
}
|
|
139
|
+
<span>{{ text() }}</span>
|
|
140
|
+
<ng-content />
|
|
141
|
+
@if (actionConfig(); as action) {
|
|
142
|
+
<m-button class="header__action" [config]="action" [style.--m-button-size]="actionSize()" (clicked)="actionClick.emit()" />
|
|
143
|
+
}
|
|
144
|
+
</h4>
|
|
145
|
+
}
|
|
146
|
+
@case (5) {
|
|
147
|
+
<h5 class="header__heading">
|
|
148
|
+
@if (icon(); as iconName) {
|
|
149
|
+
<m-icon class="header__icon" [name]="iconName" />
|
|
150
|
+
}
|
|
151
|
+
<span>{{ text() }}</span>
|
|
152
|
+
<ng-content />
|
|
153
|
+
@if (actionConfig(); as action) {
|
|
154
|
+
<m-button class="header__action" [config]="action" [style.--m-button-size]="actionSize()" (clicked)="actionClick.emit()" />
|
|
155
|
+
}
|
|
156
|
+
</h5>
|
|
157
|
+
}
|
|
158
|
+
@case (6) {
|
|
159
|
+
<h6 class="header__heading">
|
|
160
|
+
@if (icon(); as iconName) {
|
|
161
|
+
<m-icon class="header__icon" [name]="iconName" />
|
|
162
|
+
}
|
|
163
|
+
<span>{{ text() }}</span>
|
|
164
|
+
<ng-content />
|
|
165
|
+
@if (actionConfig(); as action) {
|
|
166
|
+
<m-button class="header__action" [config]="action" [style.--m-button-size]="actionSize()" (clicked)="actionClick.emit()" />
|
|
167
|
+
}
|
|
168
|
+
</h6>
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
`,
|
|
172
|
+
isInline: true,
|
|
173
|
+
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)}}.header__heading{display:flex;flex-direction:row;align-items:center;justify-content:var(--m-header-justify, flex-start);gap:.75rem;margin:0;padding:0;line-height:1.1;font-weight:800;letter-spacing:-.025em;color:var(--m-header-color, var(--m-text));transition:transform .2s cubic-bezier(.4,0,.2,1)}.header__heading:hover{transform:translate(2px)}.header__icon{flex-shrink:0}.header__action{margin-left:auto}.header__action span{display:inline-block;vertical-align:middle}h1.header__heading{font-size:var(--m-header-font-size, 2.25rem);font-weight:300;color:var(--m-text-quaternary);letter-spacing:-.035em;line-height:1.15}h2.header__heading{font-size:var(--m-header-font-size, 1.75rem);font-weight:300;color:var(--m-text-tertiary);letter-spacing:-.03em;line-height:1.2}h3.header__heading{font-size:var(--m-header-font-size, 1.375rem);font-weight:400;color:var(--m-text-secondary);letter-spacing:-.025em}h4.header__heading{font-size:var(--m-header-font-size, 1.125rem);font-weight:500;color:var(--m-text);letter-spacing:-.02em}h5.header__heading{font-size:var(--m-header-font-size, 1rem);font-weight:600;color:var(--m-text);letter-spacing:-.01em}h6.header__heading{font-size:var(--m-header-font-size, .875rem);font-weight:600;color:var(--m-text);letter-spacing:.05em;text-transform:uppercase}\n"],
|
|
174
|
+
dependencies: [{
|
|
175
|
+
kind: "component",
|
|
176
|
+
type: ButtonComponent,
|
|
177
|
+
selector: "m-button,m-one-button",
|
|
178
|
+
inputs: [
|
|
179
|
+
"config",
|
|
180
|
+
"color",
|
|
181
|
+
"labelClass",
|
|
182
|
+
"fullWidth",
|
|
183
|
+
"nav",
|
|
184
|
+
"navParams",
|
|
185
|
+
"href",
|
|
186
|
+
"disabled",
|
|
187
|
+
"variant",
|
|
188
|
+
"name",
|
|
189
|
+
"baseUrl",
|
|
190
|
+
"one",
|
|
191
|
+
"remote",
|
|
192
|
+
"label",
|
|
193
|
+
"noTranslate",
|
|
194
|
+
"params",
|
|
195
|
+
"noNative",
|
|
196
|
+
"icon",
|
|
197
|
+
"isRightIcon",
|
|
198
|
+
"iconOnly",
|
|
199
|
+
"stacked",
|
|
200
|
+
"imgSrc",
|
|
201
|
+
"nonClickable",
|
|
202
|
+
"inverted",
|
|
203
|
+
"isSubmit",
|
|
204
|
+
"tabindex"
|
|
205
|
+
],
|
|
206
|
+
outputs: ["configChange", "clicked"]
|
|
207
|
+
}, {
|
|
208
|
+
kind: "component",
|
|
209
|
+
type: IconComponent,
|
|
210
|
+
selector: "m-icon, m-one-icon",
|
|
211
|
+
inputs: [
|
|
212
|
+
"config",
|
|
213
|
+
"name",
|
|
214
|
+
"color",
|
|
215
|
+
"size",
|
|
216
|
+
"one",
|
|
217
|
+
"baseUrl",
|
|
218
|
+
"remote"
|
|
219
|
+
],
|
|
220
|
+
outputs: ["configChange"]
|
|
221
|
+
}],
|
|
222
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
226
|
+
minVersion: "12.0.0",
|
|
227
|
+
version: "22.2.1",
|
|
228
|
+
ngImport: i0,
|
|
229
|
+
type: HeaderComponent,
|
|
230
|
+
decorators: [{
|
|
231
|
+
type: Component,
|
|
232
|
+
args: [{
|
|
233
|
+
selector: "m-header",
|
|
234
|
+
imports: [ButtonComponent, IconComponent],
|
|
235
|
+
template: `
|
|
236
|
+
@switch (level()) {
|
|
237
|
+
@case (1) {
|
|
238
|
+
<h1 class="header__heading">
|
|
239
|
+
@if (icon(); as iconName) {
|
|
240
|
+
<m-icon class="header__icon" [name]="iconName" />
|
|
241
|
+
}
|
|
242
|
+
<span>{{ text() }}</span>
|
|
243
|
+
<ng-content />
|
|
244
|
+
@if (actionConfig(); as action) {
|
|
245
|
+
<m-button class="header__action" [config]="action" [style.--m-button-size]="actionSize()" (clicked)="actionClick.emit()" />
|
|
246
|
+
}
|
|
247
|
+
</h1>
|
|
248
|
+
}
|
|
249
|
+
@case (2) {
|
|
250
|
+
<h2 class="header__heading">
|
|
251
|
+
@if (icon(); as iconName) {
|
|
252
|
+
<m-icon class="header__icon" [name]="iconName" />
|
|
253
|
+
}
|
|
254
|
+
<span>{{ text() }}</span>
|
|
255
|
+
<ng-content />
|
|
256
|
+
@if (actionConfig(); as action) {
|
|
257
|
+
<m-button class="header__action" [config]="action" [style.--m-button-size]="actionSize()" (clicked)="actionClick.emit()" />
|
|
258
|
+
}
|
|
259
|
+
</h2>
|
|
260
|
+
}
|
|
261
|
+
@case (3) {
|
|
262
|
+
<h3 class="header__heading">
|
|
263
|
+
@if (icon(); as iconName) {
|
|
264
|
+
<m-icon class="header__icon" [name]="iconName" />
|
|
265
|
+
}
|
|
266
|
+
<span>{{ text() }}</span>
|
|
267
|
+
<ng-content />
|
|
268
|
+
@if (actionConfig(); as action) {
|
|
269
|
+
<m-button class="header__action" [config]="action" [style.--m-button-size]="actionSize()" (clicked)="actionClick.emit()" />
|
|
270
|
+
}
|
|
271
|
+
</h3>
|
|
272
|
+
}
|
|
273
|
+
@case (4) {
|
|
274
|
+
<h4 class="header__heading">
|
|
275
|
+
@if (icon(); as iconName) {
|
|
276
|
+
<m-icon class="header__icon" [name]="iconName" />
|
|
277
|
+
}
|
|
278
|
+
<span>{{ text() }}</span>
|
|
279
|
+
<ng-content />
|
|
280
|
+
@if (actionConfig(); as action) {
|
|
281
|
+
<m-button class="header__action" [config]="action" [style.--m-button-size]="actionSize()" (clicked)="actionClick.emit()" />
|
|
282
|
+
}
|
|
283
|
+
</h4>
|
|
284
|
+
}
|
|
285
|
+
@case (5) {
|
|
286
|
+
<h5 class="header__heading">
|
|
287
|
+
@if (icon(); as iconName) {
|
|
288
|
+
<m-icon class="header__icon" [name]="iconName" />
|
|
289
|
+
}
|
|
290
|
+
<span>{{ text() }}</span>
|
|
291
|
+
<ng-content />
|
|
292
|
+
@if (actionConfig(); as action) {
|
|
293
|
+
<m-button class="header__action" [config]="action" [style.--m-button-size]="actionSize()" (clicked)="actionClick.emit()" />
|
|
294
|
+
}
|
|
295
|
+
</h5>
|
|
296
|
+
}
|
|
297
|
+
@case (6) {
|
|
298
|
+
<h6 class="header__heading">
|
|
299
|
+
@if (icon(); as iconName) {
|
|
300
|
+
<m-icon class="header__icon" [name]="iconName" />
|
|
301
|
+
}
|
|
302
|
+
<span>{{ text() }}</span>
|
|
303
|
+
<ng-content />
|
|
304
|
+
@if (actionConfig(); as action) {
|
|
305
|
+
<m-button class="header__action" [config]="action" [style.--m-button-size]="actionSize()" (clicked)="actionClick.emit()" />
|
|
306
|
+
}
|
|
307
|
+
</h6>
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
`,
|
|
311
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
312
|
+
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)}}.header__heading{display:flex;flex-direction:row;align-items:center;justify-content:var(--m-header-justify, flex-start);gap:.75rem;margin:0;padding:0;line-height:1.1;font-weight:800;letter-spacing:-.025em;color:var(--m-header-color, var(--m-text));transition:transform .2s cubic-bezier(.4,0,.2,1)}.header__heading:hover{transform:translate(2px)}.header__icon{flex-shrink:0}.header__action{margin-left:auto}.header__action span{display:inline-block;vertical-align:middle}h1.header__heading{font-size:var(--m-header-font-size, 2.25rem);font-weight:300;color:var(--m-text-quaternary);letter-spacing:-.035em;line-height:1.15}h2.header__heading{font-size:var(--m-header-font-size, 1.75rem);font-weight:300;color:var(--m-text-tertiary);letter-spacing:-.03em;line-height:1.2}h3.header__heading{font-size:var(--m-header-font-size, 1.375rem);font-weight:400;color:var(--m-text-secondary);letter-spacing:-.025em}h4.header__heading{font-size:var(--m-header-font-size, 1.125rem);font-weight:500;color:var(--m-text);letter-spacing:-.02em}h5.header__heading{font-size:var(--m-header-font-size, 1rem);font-weight:600;color:var(--m-text);letter-spacing:-.01em}h6.header__heading{font-size:var(--m-header-font-size, .875rem);font-weight:600;color:var(--m-text);letter-spacing:.05em;text-transform:uppercase}\n"]
|
|
313
|
+
}]
|
|
314
|
+
}],
|
|
315
|
+
propDecorators: {
|
|
316
|
+
level: [{
|
|
317
|
+
type: i0.Input,
|
|
318
|
+
args: [{
|
|
319
|
+
isSignal: true,
|
|
320
|
+
alias: "level",
|
|
321
|
+
required: false
|
|
322
|
+
}]
|
|
323
|
+
}],
|
|
324
|
+
label: [{
|
|
325
|
+
type: i0.Input,
|
|
326
|
+
args: [{
|
|
327
|
+
isSignal: true,
|
|
328
|
+
alias: "label",
|
|
329
|
+
required: false
|
|
330
|
+
}]
|
|
331
|
+
}],
|
|
332
|
+
icon: [{
|
|
333
|
+
type: i0.Input,
|
|
334
|
+
args: [{
|
|
335
|
+
isSignal: true,
|
|
336
|
+
alias: "icon",
|
|
337
|
+
required: false
|
|
338
|
+
}]
|
|
339
|
+
}],
|
|
340
|
+
actionButton: [{
|
|
341
|
+
type: i0.Input,
|
|
342
|
+
args: [{
|
|
343
|
+
isSignal: true,
|
|
344
|
+
alias: "actionButton",
|
|
345
|
+
required: false
|
|
346
|
+
}]
|
|
347
|
+
}],
|
|
348
|
+
actionLabel: [{
|
|
349
|
+
type: i0.Input,
|
|
350
|
+
args: [{
|
|
351
|
+
isSignal: true,
|
|
352
|
+
alias: "actionLabel",
|
|
353
|
+
required: false
|
|
354
|
+
}]
|
|
355
|
+
}],
|
|
356
|
+
noTranslate: [{
|
|
357
|
+
type: i0.Input,
|
|
358
|
+
args: [{
|
|
359
|
+
isSignal: true,
|
|
360
|
+
alias: "noTranslate",
|
|
361
|
+
required: false
|
|
362
|
+
}]
|
|
363
|
+
}],
|
|
364
|
+
params: [{
|
|
365
|
+
type: i0.Input,
|
|
366
|
+
args: [{
|
|
367
|
+
isSignal: true,
|
|
368
|
+
alias: "params",
|
|
369
|
+
required: false
|
|
370
|
+
}]
|
|
371
|
+
}],
|
|
372
|
+
actionClick: [{
|
|
373
|
+
type: i0.Output,
|
|
374
|
+
args: ["actionClick"]
|
|
375
|
+
}]
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
export { HeaderComponent as t };
|
|
379
|
+
|
|
380
|
+
//# sourceMappingURL=magmonium-one-header-DPVnaEOV.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"magmonium-one-header-DPVnaEOV.mjs","names":[],"sources":["../../../../libs/one/src/lib/shared/ui/header/ui/header.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n output,\n} from '@angular/core';\nimport { TranslateService } from '../../../services/translate';\nimport { HeaderLevel } from '../type/header';\nimport { ButtonComponent } from '../../button/ui/button';\nimport { IconComponent } from '../../icon';\nimport { Button } from '../../button/type/button';\nimport { SIZE_CONTEXT } from '../../../config/size-context.token';\nimport { resolveSize } from '../../../functions/size/size-converter';\n\n@Component({\n selector: 'm-header',\n imports: [ButtonComponent, IconComponent],\n template: `\n @switch (level()) {\n @case (1) {\n <h1 class=\"header__heading\">\n @if (icon(); as iconName) {\n <m-icon class=\"header__icon\" [name]=\"iconName\" />\n }\n <span>{{ text() }}</span>\n <ng-content />\n @if (actionConfig(); as action) {\n <m-button class=\"header__action\" [config]=\"action\" [style.--m-button-size]=\"actionSize()\" (clicked)=\"actionClick.emit()\" />\n }\n </h1>\n }\n @case (2) {\n <h2 class=\"header__heading\">\n @if (icon(); as iconName) {\n <m-icon class=\"header__icon\" [name]=\"iconName\" />\n }\n <span>{{ text() }}</span>\n <ng-content />\n @if (actionConfig(); as action) {\n <m-button class=\"header__action\" [config]=\"action\" [style.--m-button-size]=\"actionSize()\" (clicked)=\"actionClick.emit()\" />\n }\n </h2>\n }\n @case (3) {\n <h3 class=\"header__heading\">\n @if (icon(); as iconName) {\n <m-icon class=\"header__icon\" [name]=\"iconName\" />\n }\n <span>{{ text() }}</span>\n <ng-content />\n @if (actionConfig(); as action) {\n <m-button class=\"header__action\" [config]=\"action\" [style.--m-button-size]=\"actionSize()\" (clicked)=\"actionClick.emit()\" />\n }\n </h3>\n }\n @case (4) {\n <h4 class=\"header__heading\">\n @if (icon(); as iconName) {\n <m-icon class=\"header__icon\" [name]=\"iconName\" />\n }\n <span>{{ text() }}</span>\n <ng-content />\n @if (actionConfig(); as action) {\n <m-button class=\"header__action\" [config]=\"action\" [style.--m-button-size]=\"actionSize()\" (clicked)=\"actionClick.emit()\" />\n }\n </h4>\n }\n @case (5) {\n <h5 class=\"header__heading\">\n @if (icon(); as iconName) {\n <m-icon class=\"header__icon\" [name]=\"iconName\" />\n }\n <span>{{ text() }}</span>\n <ng-content />\n @if (actionConfig(); as action) {\n <m-button class=\"header__action\" [config]=\"action\" [style.--m-button-size]=\"actionSize()\" (clicked)=\"actionClick.emit()\" />\n }\n </h5>\n }\n @case (6) {\n <h6 class=\"header__heading\">\n @if (icon(); as iconName) {\n <m-icon class=\"header__icon\" [name]=\"iconName\" />\n }\n <span>{{ text() }}</span>\n <ng-content />\n @if (actionConfig(); as action) {\n <m-button class=\"header__action\" [config]=\"action\" [style.--m-button-size]=\"actionSize()\" (clicked)=\"actionClick.emit()\" />\n }\n </h6>\n }\n }\n `,\n styleUrl: './header.sass',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class HeaderComponent {\n readonly level = input<HeaderLevel>(3);\n readonly label = input<string | undefined>();\n // Drawn inside the heading rather than beside it. A glyph placed as the\n // heading's sibling has no line box of its own to centre against — it ends\n // up centred on whatever column it sits next to, which is how a Canvas\n // header's icon came to line up with the label slot's drop rect instead of\n // with the label. Inside, the two share one line box at every level.\n readonly icon = input<string | undefined>();\n readonly actionButton = input<string | undefined>();\n // The action Button's accessible name. It renders icon-only, so the label is\n // the only thing a screen reader has to go on — without it the button reads\n // as nothing at all.\n readonly actionLabel = input<string | undefined>();\n // The label is authored text rather than a translation key. Needed for text\n // carrying angle brackets above all: `translate` reads `<...>` as link\n // markup, so a heading naming a MessageVariable — `<$app>` — resolves to\n // nothing at all rather than to itself.\n readonly noTranslate = input<boolean>(false);\n // A message's [MessageVariable] values, the same record `m-text-output`\n // takes: a heading naming `<$count>` is a sentence with a datum in it, and\n // splicing that datum into the key instead would be parsed as a query\n // string (m-one-ui ADR 0066).\n readonly params = input<Record<string, string> | undefined>(undefined);\n readonly actionClick = output<void>();\n\n private readonly translateService = inject(TranslateService);\n private readonly sizeContext = inject(SIZE_CONTEXT, { optional: true });\n\n // The action Button sits inside the heading, whose font-size is the level's\n // own — 2.25rem at h1 — so `em` inheritance would scale the Button to the\n // heading rather than to the Section it belongs to. It reads the Size in\n // force instead, the way Icon does, and lands at the same size as every\n // other Button on that Section (ADR 0008).\n protected readonly actionSize = computed(() =>\n resolveSize(this.sizeContext?.size())\n );\n\n protected readonly actionConfig = computed<Button | undefined>(() => {\n const icon = this.actionButton();\n if (!icon) return undefined;\n return {\n icon,\n label: this.actionLabel(),\n iconOnly: true,\n variant: 'ghost',\n };\n });\n\n // A computed rather than the impure TranslatePipe repeated six times: one\n // lookup per label change instead of one per change-detection tick, and it\n // still repaints when the language or an in-memory translation moves.\n protected readonly text = computed(() =>\n this.noTranslate()\n ? (this.label() ?? '')\n : this.translateService.translate(this.label(), this.params())\n );\n}\n"],"mappings":";;;;;AAkGA,IAAa,kBAAb,MAAa,gBAAe;CACjB,QAAQ,MAAmB,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC7B,QAAQ,MAA2B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAMnC,OAAO,MAA2B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAClC,eAAe,MAA2B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CAI1C,cAAc,MAA2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