ngx-strata 0.1.0
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/README.md +1 -0
- package/assets/fonts/Inter-VariableFont.ttf +0 -0
- package/assets/icons/arrow-down.svg +1 -0
- package/assets/icons/arrow-left.svg +1 -0
- package/assets/icons/arrow-right.svg +1 -0
- package/assets/icons/arrow-up.svg +1 -0
- package/assets/icons/clipboard.svg +1 -0
- package/assets/icons/close.svg +1 -0
- package/assets/icons/expand-up-down.svg +1 -0
- package/assets/icons/more.svg +1 -0
- package/assets/icons/question.svg +1 -0
- package/assets/styles/base.scss +26 -0
- package/assets/styles/breakpoints.scss +6 -0
- package/assets/styles/colors.scss +57 -0
- package/assets/styles/components/accordion.scss +75 -0
- package/assets/styles/components/action-menu.scss +66 -0
- package/assets/styles/components/avatar.scss +132 -0
- package/assets/styles/components/button.scss +174 -0
- package/assets/styles/components/card.scss +82 -0
- package/assets/styles/components/checkbox.scss +71 -0
- package/assets/styles/components/divider.scss +41 -0
- package/assets/styles/components/grid.scss +242 -0
- package/assets/styles/components/icon.scss +36 -0
- package/assets/styles/components/input-field.scss +72 -0
- package/assets/styles/components/item.scss +69 -0
- package/assets/styles/components/modal.scss +126 -0
- package/assets/styles/components/notification.scss +58 -0
- package/assets/styles/components/number-display.scss +25 -0
- package/assets/styles/components/overlay.scss +3 -0
- package/assets/styles/components/pagination.scss +28 -0
- package/assets/styles/components/progress.scss +118 -0
- package/assets/styles/components/segmented-control.scss +49 -0
- package/assets/styles/components/select.scss +127 -0
- package/assets/styles/components/slider.scss +127 -0
- package/assets/styles/components/spinner.scss +93 -0
- package/assets/styles/components/table.scss +66 -0
- package/assets/styles/components/tag.scss +60 -0
- package/assets/styles/components/text-stack.scss +29 -0
- package/assets/styles/components/toggle.scss +64 -0
- package/assets/styles/components/tooltip.scss +68 -0
- package/assets/styles/focus-outline.scss +11 -0
- package/assets/styles/public-api.scss +36 -0
- package/assets/styles/scrollbar.scss +29 -0
- package/assets/styles/shadows.scss +4 -0
- package/assets/styles/sizes.scss +12 -0
- package/assets/styles/typography.scss +66 -0
- package/dist/my-lib/strata.css +1 -0
- package/dist/strata/strata.css +1 -0
- package/fesm2022/ngx-strata.mjs +1720 -0
- package/fesm2022/ngx-strata.mjs.map +1 -0
- package/package.json +35 -0
- package/types/ngx-strata.d.ts +639 -0
|
@@ -0,0 +1,1720 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, provideAppInitializer, inject, makeEnvironmentProviders, InjectionToken, input, DOCUMENT, Input, Inject, Directive, signal, computed, effect, model, HostListener, Component, HostBinding, contentChild, ElementRef, output, ChangeDetectionStrategy, ViewContainerRef, viewChild, contentChildren, Renderer2, Pipe, LOCALE_ID } from '@angular/core';
|
|
3
|
+
import { computePosition, offset, arrow, autoUpdate, flip, shift } from '@floating-ui/dom';
|
|
4
|
+
import { Observable, tap, map, BehaviorSubject } from 'rxjs';
|
|
5
|
+
import { HttpClient } from '@angular/common/http';
|
|
6
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
7
|
+
import * as i1 from '@angular/forms';
|
|
8
|
+
import { FormsModule } from '@angular/forms';
|
|
9
|
+
import * as i2 from '@angular/common';
|
|
10
|
+
import { NgTemplateOutlet, CommonModule, DecimalPipe, formatNumber, getLocaleNumberSymbol, NumberSymbol } from '@angular/common';
|
|
11
|
+
|
|
12
|
+
class IconLoader {
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
class IconRegistryService {
|
|
16
|
+
iconLoader;
|
|
17
|
+
icons = {};
|
|
18
|
+
svgs = {};
|
|
19
|
+
constructor(iconLoader) {
|
|
20
|
+
this.iconLoader = iconLoader;
|
|
21
|
+
}
|
|
22
|
+
registerIcons(iconConfigs) {
|
|
23
|
+
iconConfigs.forEach((config) => this.registerIcon(config));
|
|
24
|
+
}
|
|
25
|
+
registerIcon(iconConfig) {
|
|
26
|
+
if (this.icons[iconConfig.name]) {
|
|
27
|
+
console.error(`Icon with name ${iconConfig.name} already registered with Zesto. Please rename or stop registering one of the icons.`);
|
|
28
|
+
}
|
|
29
|
+
this.icons[iconConfig.name] = iconConfig.url;
|
|
30
|
+
}
|
|
31
|
+
getIconUrl(name) {
|
|
32
|
+
const iconUrl = this.icons[name];
|
|
33
|
+
return iconUrl ? iconUrl : null;
|
|
34
|
+
}
|
|
35
|
+
getIcon(name) {
|
|
36
|
+
if (this.svgs[name]) {
|
|
37
|
+
return new Observable((subscriber) => {
|
|
38
|
+
subscriber.next(this.svgs[name]);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const url = this.getIconUrl(name);
|
|
42
|
+
if (!url) {
|
|
43
|
+
throw new Error(`Icon '${name}' not registered.`);
|
|
44
|
+
}
|
|
45
|
+
return this.iconLoader.loadSvg(url).pipe(tap((svg) => {
|
|
46
|
+
this.svgs[name] = svg;
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: IconRegistryService, deps: [{ token: IconLoader }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
50
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: IconRegistryService, providedIn: 'root' });
|
|
51
|
+
}
|
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: IconRegistryService, decorators: [{
|
|
53
|
+
type: Injectable,
|
|
54
|
+
args: [{
|
|
55
|
+
providedIn: 'root',
|
|
56
|
+
}]
|
|
57
|
+
}], ctorParameters: () => [{ type: IconLoader }] });
|
|
58
|
+
|
|
59
|
+
const baseIconConfigs = [
|
|
60
|
+
{
|
|
61
|
+
name: 'question',
|
|
62
|
+
url: 'assets/icons/question.svg',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'arrow-right',
|
|
66
|
+
url: 'assets/icons/arrow-right.svg',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'arrow-left',
|
|
70
|
+
url: 'assets/icons/arrow-left.svg',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'arrow-up',
|
|
74
|
+
url: 'assets/icons/arrow-up.svg',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: 'arrow-down',
|
|
78
|
+
url: 'assets/icons/arrow-down.svg',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'close',
|
|
82
|
+
url: 'assets/icons/close.svg',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'expand-up-down',
|
|
86
|
+
url: 'assets/icons/expand-up-down.svg',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: 'clipboard',
|
|
90
|
+
url: 'assets/icons/clipboard.svg',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: 'more',
|
|
94
|
+
url: 'assets/icons/more.svg',
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
|
|
98
|
+
const provideBaseIcons = () => {
|
|
99
|
+
return provideIcons(baseIconConfigs);
|
|
100
|
+
};
|
|
101
|
+
const provideIcons = (iconConfigs) => {
|
|
102
|
+
const providers = [
|
|
103
|
+
provideAppInitializer(() => {
|
|
104
|
+
const initializerFn = ((service) => function () {
|
|
105
|
+
return service.registerIcons(iconConfigs);
|
|
106
|
+
})(inject(IconRegistryService));
|
|
107
|
+
return initializerFn();
|
|
108
|
+
}),
|
|
109
|
+
];
|
|
110
|
+
return makeEnvironmentProviders(providers);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
class HttpIconLoader {
|
|
114
|
+
httpClient = inject(HttpClient);
|
|
115
|
+
sanitizer = inject(DomSanitizer);
|
|
116
|
+
loadSvg(url) {
|
|
117
|
+
return this.httpClient
|
|
118
|
+
.get(url, { responseType: 'text' })
|
|
119
|
+
.pipe(map((raw) => this.sanitizer.bypassSecurityTrustHtml(raw)));
|
|
120
|
+
}
|
|
121
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: HttpIconLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
122
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: HttpIconLoader, providedIn: 'root' });
|
|
123
|
+
}
|
|
124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: HttpIconLoader, decorators: [{
|
|
125
|
+
type: Injectable,
|
|
126
|
+
args: [{ providedIn: 'root' }]
|
|
127
|
+
}] });
|
|
128
|
+
|
|
129
|
+
function provideIconLoader() {
|
|
130
|
+
return {
|
|
131
|
+
provide: IconLoader,
|
|
132
|
+
useExisting: HttpIconLoader,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
class IconRegistry {
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function provideIconRegistry() {
|
|
140
|
+
return {
|
|
141
|
+
provide: IconRegistry,
|
|
142
|
+
useExisting: IconRegistryService,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const DEFAULT_CONFIG = {
|
|
147
|
+
includeBaseIcons: true,
|
|
148
|
+
tooltipDelayMs: 500,
|
|
149
|
+
};
|
|
150
|
+
function provideStrata(config = {}) {
|
|
151
|
+
const mergedConfig = { ...DEFAULT_CONFIG, ...config };
|
|
152
|
+
const providers = [
|
|
153
|
+
provideIconLoader(),
|
|
154
|
+
provideIconRegistry(),
|
|
155
|
+
{
|
|
156
|
+
provide: STRATA_CONFIG,
|
|
157
|
+
useValue: mergedConfig,
|
|
158
|
+
},
|
|
159
|
+
];
|
|
160
|
+
if (mergedConfig.includeBaseIcons) {
|
|
161
|
+
providers.push(provideBaseIcons());
|
|
162
|
+
}
|
|
163
|
+
return providers;
|
|
164
|
+
}
|
|
165
|
+
const STRATA_CONFIG = new InjectionToken('STRATA_CONFIG');
|
|
166
|
+
|
|
167
|
+
class TooltipDirective {
|
|
168
|
+
document;
|
|
169
|
+
element;
|
|
170
|
+
renderer;
|
|
171
|
+
stSimpleTooltip = input.required(...(ngDevMode ? [{ debugName: "stSimpleTooltip" }] : []));
|
|
172
|
+
tooltipEnabled = true;
|
|
173
|
+
tooltipPlacement = 'top';
|
|
174
|
+
tooltipAlwaysShow = false;
|
|
175
|
+
tooltipContentElement;
|
|
176
|
+
arrowElement;
|
|
177
|
+
eventListeners;
|
|
178
|
+
autoUpdateCleanupFunction;
|
|
179
|
+
config = inject(STRATA_CONFIG);
|
|
180
|
+
constructor(document, element, renderer) {
|
|
181
|
+
this.document = document;
|
|
182
|
+
this.element = element;
|
|
183
|
+
this.renderer = renderer;
|
|
184
|
+
}
|
|
185
|
+
ngOnInit() {
|
|
186
|
+
if (!this.stSimpleTooltip() || this.stSimpleTooltip() === '' || !this.tooltipEnabled) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
this.tooltipContentElement = this.document.createElement('div');
|
|
190
|
+
this.tooltipContentElement.classList.add('st-tooltip');
|
|
191
|
+
const textElement = this.document.createElement('p');
|
|
192
|
+
textElement.innerText = this.stSimpleTooltip();
|
|
193
|
+
this.tooltipContentElement.appendChild(textElement);
|
|
194
|
+
this.arrowElement = this.document.createElement('div');
|
|
195
|
+
this.arrowElement.id = 'st-tooltip-arrow';
|
|
196
|
+
this.arrowElement.classList.add('st-tooltip-arrow-' + this.tooltipPlacement);
|
|
197
|
+
this.tooltipContentElement.appendChild(this.arrowElement);
|
|
198
|
+
this.renderer.appendChild(this.element.nativeElement, this.tooltipContentElement);
|
|
199
|
+
if (!this.tooltipAlwaysShow) {
|
|
200
|
+
this.eventListeners = [
|
|
201
|
+
this.renderer.listen(this.element.nativeElement, 'mouseenter', () => {
|
|
202
|
+
this.show();
|
|
203
|
+
}),
|
|
204
|
+
this.renderer.listen(this.element.nativeElement, 'mouseleave', () => this.hide()),
|
|
205
|
+
];
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
this.show();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
ngAfterContentInit() {
|
|
212
|
+
if (!this.shouldRender()) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
this.doPosition();
|
|
216
|
+
}
|
|
217
|
+
doPosition() {
|
|
218
|
+
computePosition(this.element.nativeElement, this.tooltipContentElement, {
|
|
219
|
+
placement: this.tooltipPlacement,
|
|
220
|
+
middleware: [offset(6), arrow({ element: this.arrowElement })],
|
|
221
|
+
}).then(({ x, y, middlewareData }) => {
|
|
222
|
+
Object.assign(this.tooltipContentElement.style, {
|
|
223
|
+
left: `${x}px`,
|
|
224
|
+
top: `${y}px`,
|
|
225
|
+
});
|
|
226
|
+
if (middlewareData.arrow) {
|
|
227
|
+
const { x, y } = middlewareData.arrow;
|
|
228
|
+
Object.assign(this.arrowElement.style, {
|
|
229
|
+
left: x != null ? `${x}px` : '',
|
|
230
|
+
top: y != null ? `${y}px` : '',
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
ngOnDestroy() {
|
|
236
|
+
this.tooltipContentElement.remove();
|
|
237
|
+
if (this.eventListeners?.length) {
|
|
238
|
+
this.eventListeners.forEach((removeEventListenerFn) => removeEventListenerFn());
|
|
239
|
+
}
|
|
240
|
+
if (this.autoUpdateCleanupFunction) {
|
|
241
|
+
this.autoUpdateCleanupFunction();
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
shouldRender() {
|
|
245
|
+
return !!this.stSimpleTooltip() && this.stSimpleTooltip() !== '' && this.tooltipEnabled;
|
|
246
|
+
}
|
|
247
|
+
showTimeoutCancel;
|
|
248
|
+
show() {
|
|
249
|
+
this.showTimeoutCancel = setTimeout(() => {
|
|
250
|
+
this.tooltipContentElement?.setAttribute('data-show', '');
|
|
251
|
+
this.tooltipContentElement?.setAttribute('aria-hidden', 'false');
|
|
252
|
+
this.autoUpdateCleanupFunction = autoUpdate(this.element.nativeElement, this.tooltipContentElement, () => this.doPosition());
|
|
253
|
+
}, this.config.tooltipDelayMs);
|
|
254
|
+
}
|
|
255
|
+
hide() {
|
|
256
|
+
if (this.showTimeoutCancel) {
|
|
257
|
+
clearTimeout(this.showTimeoutCancel);
|
|
258
|
+
this.showTimeoutCancel = undefined;
|
|
259
|
+
}
|
|
260
|
+
this.tooltipContentElement?.removeAttribute('data-show');
|
|
261
|
+
this.tooltipContentElement?.setAttribute('aria-hidden', 'true');
|
|
262
|
+
this.autoUpdateCleanupFunction();
|
|
263
|
+
}
|
|
264
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: TooltipDirective, deps: [{ token: DOCUMENT }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
265
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: TooltipDirective, isStandalone: true, selector: "[stSimpleTooltip]", inputs: { stSimpleTooltip: { classPropertyName: "stSimpleTooltip", publicName: "stSimpleTooltip", isSignal: true, isRequired: true, transformFunction: null }, tooltipEnabled: { classPropertyName: "tooltipEnabled", publicName: "tooltipEnabled", isSignal: false, isRequired: false, transformFunction: null }, tooltipPlacement: { classPropertyName: "tooltipPlacement", publicName: "tooltipPlacement", isSignal: false, isRequired: false, transformFunction: null }, tooltipAlwaysShow: { classPropertyName: "tooltipAlwaysShow", publicName: "tooltipAlwaysShow", isSignal: false, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
266
|
+
}
|
|
267
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: TooltipDirective, decorators: [{
|
|
268
|
+
type: Directive,
|
|
269
|
+
args: [{
|
|
270
|
+
selector: '[stSimpleTooltip]',
|
|
271
|
+
standalone: true,
|
|
272
|
+
}]
|
|
273
|
+
}], ctorParameters: () => [{ type: Document, decorators: [{
|
|
274
|
+
type: Inject,
|
|
275
|
+
args: [DOCUMENT]
|
|
276
|
+
}] }, { type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { stSimpleTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "stSimpleTooltip", required: true }] }], tooltipEnabled: [{
|
|
277
|
+
type: Input
|
|
278
|
+
}], tooltipPlacement: [{
|
|
279
|
+
type: Input
|
|
280
|
+
}], tooltipAlwaysShow: [{
|
|
281
|
+
type: Input
|
|
282
|
+
}] } });
|
|
283
|
+
|
|
284
|
+
class DarkmodeService {
|
|
285
|
+
STORAGE_KEY = 'strata-darkmode';
|
|
286
|
+
document = inject(DOCUMENT);
|
|
287
|
+
osPrefersDark;
|
|
288
|
+
setting = signal('SYSTEM', ...(ngDevMode ? [{ debugName: "setting" }] : []));
|
|
289
|
+
darkmode = signal('LIGHT', ...(ngDevMode ? [{ debugName: "darkmode" }] : []));
|
|
290
|
+
currentMode = computed(() => this.darkmode(), ...(ngDevMode ? [{ debugName: "currentMode" }] : []));
|
|
291
|
+
currentSetting = computed(() => this.setting(), ...(ngDevMode ? [{ debugName: "currentSetting" }] : []));
|
|
292
|
+
constructor() {
|
|
293
|
+
effect(() => this.updateDarkmodeTagOnDOM(this.darkmode()));
|
|
294
|
+
this.setting.set(this.getSettingFromStorage());
|
|
295
|
+
this.osPrefersDark = this.getSystemDarkmodePreference();
|
|
296
|
+
this.calculateDarkmode();
|
|
297
|
+
this.saveSettingToStorage(this.setting());
|
|
298
|
+
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (event) => {
|
|
299
|
+
this.osPrefersDark = event.matches;
|
|
300
|
+
if (this.setting() === 'SYSTEM') {
|
|
301
|
+
this.calculateDarkmode();
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
setDarkmodeSetting(newSetting) {
|
|
306
|
+
this.saveSettingToStorage(newSetting);
|
|
307
|
+
return this.calculateDarkmode();
|
|
308
|
+
}
|
|
309
|
+
getSystemDarkmodePreference() {
|
|
310
|
+
return window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
311
|
+
}
|
|
312
|
+
calculateDarkmode() {
|
|
313
|
+
if (this.setting() === 'SYSTEM') {
|
|
314
|
+
this.darkmode.set(this.osPrefersDark ? 'DARK' : 'LIGHT');
|
|
315
|
+
}
|
|
316
|
+
else {
|
|
317
|
+
this.darkmode.set(this.setting() === 'DARK' ? 'DARK' : 'LIGHT');
|
|
318
|
+
}
|
|
319
|
+
return this.darkmode();
|
|
320
|
+
}
|
|
321
|
+
updateDarkmodeTagOnDOM(mode) {
|
|
322
|
+
const documentNode = this.document.getElementsByTagName('html')[0];
|
|
323
|
+
if (mode === 'DARK') {
|
|
324
|
+
documentNode.setAttribute('data-theme', 'dark');
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
documentNode.setAttribute('data-theme', 'light');
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
saveSettingToStorage(newSetting) {
|
|
331
|
+
localStorage.setItem(this.STORAGE_KEY, newSetting);
|
|
332
|
+
this.setting.set(newSetting);
|
|
333
|
+
}
|
|
334
|
+
getSettingFromStorage() {
|
|
335
|
+
return localStorage.getItem(this.STORAGE_KEY) ?? 'SYSTEM';
|
|
336
|
+
}
|
|
337
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DarkmodeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
338
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DarkmodeService, providedIn: 'root' });
|
|
339
|
+
}
|
|
340
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DarkmodeService, decorators: [{
|
|
341
|
+
type: Injectable,
|
|
342
|
+
args: [{
|
|
343
|
+
providedIn: 'root',
|
|
344
|
+
}]
|
|
345
|
+
}], ctorParameters: () => [] });
|
|
346
|
+
|
|
347
|
+
class CheckboxComponent {
|
|
348
|
+
value = model(false, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
349
|
+
label = input(undefined, ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
350
|
+
name = input(undefined, ...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
351
|
+
onClick(event) {
|
|
352
|
+
event.stopImmediatePropagation();
|
|
353
|
+
this.value.set(!this.value());
|
|
354
|
+
}
|
|
355
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
356
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: CheckboxComponent, isStandalone: true, selector: "st-checkbox", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0, template: "<input type=\"checkbox\" [checked]=\"value()\" />\n<div class=\"checkbox-visual\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z\"\n ></path>\n </svg>\n</div>\n@if (label()) {\n <label [for]=\"name()\"> {{ label() }}</label>\n}\n" });
|
|
357
|
+
}
|
|
358
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CheckboxComponent, decorators: [{
|
|
359
|
+
type: Component,
|
|
360
|
+
args: [{ selector: 'st-checkbox', imports: [], template: "<input type=\"checkbox\" [checked]=\"value()\" />\n<div class=\"checkbox-visual\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z\"\n ></path>\n </svg>\n</div>\n@if (label()) {\n <label [for]=\"name()\"> {{ label() }}</label>\n}\n" }]
|
|
361
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], onClick: [{
|
|
362
|
+
type: HostListener,
|
|
363
|
+
args: ['click', ['$event']]
|
|
364
|
+
}] } });
|
|
365
|
+
|
|
366
|
+
class ToggleComponent {
|
|
367
|
+
checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
|
|
368
|
+
get isChecked() {
|
|
369
|
+
return this.checked();
|
|
370
|
+
}
|
|
371
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
372
|
+
get sizeClass() {
|
|
373
|
+
return this.size();
|
|
374
|
+
}
|
|
375
|
+
onCheckChanged() {
|
|
376
|
+
this.checked.set(!this.checked());
|
|
377
|
+
}
|
|
378
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
379
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: ToggleComponent, isStandalone: true, selector: "st-toggle", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange" }, host: { attributes: { "tabindex": "0" }, listeners: { "click": "onCheckChanged()" }, properties: { "attr.data-checked": "this.isChecked", "class": "this.sizeClass" } }, ngImport: i0, template: "<div class=\"toggle-handle\"></div>\n" });
|
|
380
|
+
}
|
|
381
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ToggleComponent, decorators: [{
|
|
382
|
+
type: Component,
|
|
383
|
+
args: [{ selector: 'st-toggle', imports: [], host: {
|
|
384
|
+
'(click)': 'onCheckChanged()',
|
|
385
|
+
tabindex: '0',
|
|
386
|
+
}, template: "<div class=\"toggle-handle\"></div>\n" }]
|
|
387
|
+
}], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], isChecked: [{
|
|
388
|
+
type: HostBinding,
|
|
389
|
+
args: ['attr.data-checked']
|
|
390
|
+
}], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], sizeClass: [{
|
|
391
|
+
type: HostBinding,
|
|
392
|
+
args: ['class']
|
|
393
|
+
}] } });
|
|
394
|
+
|
|
395
|
+
class ActionMenuItemComponent {
|
|
396
|
+
checkbox = contentChild(CheckboxComponent, { ...(ngDevMode ? { debugName: "checkbox" } : {}), read: ElementRef });
|
|
397
|
+
toggle = contentChild(ToggleComponent, { ...(ngDevMode ? { debugName: "toggle" } : {}), read: ElementRef });
|
|
398
|
+
closeMenuOnClick = input(true, ...(ngDevMode ? [{ debugName: "closeMenuOnClick" }] : []));
|
|
399
|
+
onMenuItemClicked = output();
|
|
400
|
+
elementRef = inject(ElementRef);
|
|
401
|
+
onHostClick(event) {
|
|
402
|
+
this.onMenuItemClicked.emit(this.closeMenuOnClick());
|
|
403
|
+
event.stopPropagation();
|
|
404
|
+
this.checkbox()?.nativeElement.click();
|
|
405
|
+
this.toggle()?.nativeElement.click();
|
|
406
|
+
}
|
|
407
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ActionMenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
408
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.0", type: ActionMenuItemComponent, isStandalone: true, selector: "st-action-menu-item", inputs: { closeMenuOnClick: { classPropertyName: "closeMenuOnClick", publicName: "closeMenuOnClick", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onMenuItemClicked: "onMenuItemClicked" }, host: { listeners: { "click": "onHostClick($event)" } }, queries: [{ propertyName: "checkbox", first: true, predicate: CheckboxComponent, descendants: true, read: ElementRef, isSignal: true }, { propertyName: "toggle", first: true, predicate: ToggleComponent, descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<span class=\"item-start\">\n <ng-content select=\"[area='start']\"></ng-content\n></span>\n<span class=\"item-default\"> <ng-content></ng-content></span>\n<span class=\"item-end\">\n <ng-content select=\"[area='end']\"></ng-content>\n</span>\n", styles: [":host{height:48px}\n"] });
|
|
409
|
+
}
|
|
410
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ActionMenuItemComponent, decorators: [{
|
|
411
|
+
type: Component,
|
|
412
|
+
args: [{ selector: 'st-action-menu-item', imports: [], template: "<span class=\"item-start\">\n <ng-content select=\"[area='start']\"></ng-content\n></span>\n<span class=\"item-default\"> <ng-content></ng-content></span>\n<span class=\"item-end\">\n <ng-content select=\"[area='end']\"></ng-content>\n</span>\n", styles: [":host{height:48px}\n"] }]
|
|
413
|
+
}], propDecorators: { checkbox: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CheckboxComponent), { ...{ read: ElementRef }, isSignal: true }] }], toggle: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ToggleComponent), { ...{ read: ElementRef }, isSignal: true }] }], closeMenuOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeMenuOnClick", required: false }] }], onMenuItemClicked: [{ type: i0.Output, args: ["onMenuItemClicked"] }], onHostClick: [{
|
|
414
|
+
type: HostListener,
|
|
415
|
+
args: ['click', ['$event']]
|
|
416
|
+
}] } });
|
|
417
|
+
|
|
418
|
+
class ButtonDirective {
|
|
419
|
+
host = inject(ElementRef);
|
|
420
|
+
variant = input('secondary', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
421
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
422
|
+
fullWidth = input(false, ...(ngDevMode ? [{ debugName: "fullWidth" }] : []));
|
|
423
|
+
iconAtStart = signal(false, ...(ngDevMode ? [{ debugName: "iconAtStart" }] : []));
|
|
424
|
+
iconAtEnd = signal(false, ...(ngDevMode ? [{ debugName: "iconAtEnd" }] : []));
|
|
425
|
+
iconOnly = signal(false, ...(ngDevMode ? [{ debugName: "iconOnly" }] : []));
|
|
426
|
+
constructor() { }
|
|
427
|
+
get classes() {
|
|
428
|
+
return [
|
|
429
|
+
'st-button',
|
|
430
|
+
`st-button-${this.variant()}`,
|
|
431
|
+
`st-size-${this.size()}`,
|
|
432
|
+
this.iconAtStart() ? 'st-button-has-starting-icon' : '',
|
|
433
|
+
this.iconAtEnd() ? 'st-button-has-ending-icon' : '',
|
|
434
|
+
this.iconOnly() ? 'st-button-icon-only' : '',
|
|
435
|
+
this.fullWidth() ? 'st-button-full-width' : '',
|
|
436
|
+
];
|
|
437
|
+
}
|
|
438
|
+
ngAfterContentInit() {
|
|
439
|
+
const nodes = this.host.nativeElement.childNodes;
|
|
440
|
+
if (nodes === undefined || nodes.length == 0) {
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
if (nodes.length === 1 && this.nodeIsStIcon(nodes[0])) {
|
|
444
|
+
this.iconOnly.set(true);
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
this.iconAtStart.set(this.nodeIsStIcon(nodes[0]));
|
|
448
|
+
this.iconAtEnd.set(this.nodeIsStIcon(nodes[nodes.length - 1]));
|
|
449
|
+
}
|
|
450
|
+
nodeIsStIcon(node) {
|
|
451
|
+
if (node.nodeType === Node.TEXT_NODE && !node.textContent.trim()) {
|
|
452
|
+
return false;
|
|
453
|
+
}
|
|
454
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
455
|
+
const tagName = node.tagName.toLowerCase();
|
|
456
|
+
return tagName === 'st-icon';
|
|
457
|
+
}
|
|
458
|
+
return false;
|
|
459
|
+
}
|
|
460
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
461
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: ButtonDirective, isStandalone: true, selector: "[stButton]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.classes" } }, ngImport: i0 });
|
|
462
|
+
}
|
|
463
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ButtonDirective, decorators: [{
|
|
464
|
+
type: Directive,
|
|
465
|
+
args: [{
|
|
466
|
+
selector: '[stButton]',
|
|
467
|
+
}]
|
|
468
|
+
}], ctorParameters: () => [], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], classes: [{
|
|
469
|
+
type: HostBinding,
|
|
470
|
+
args: ['class']
|
|
471
|
+
}] } });
|
|
472
|
+
|
|
473
|
+
class CardComponent {
|
|
474
|
+
elevated = input(false, ...(ngDevMode ? [{ debugName: "elevated" }] : []));
|
|
475
|
+
selectable = input(false, ...(ngDevMode ? [{ debugName: "selectable" }] : []));
|
|
476
|
+
padding = input(true, ...(ngDevMode ? [{ debugName: "padding" }] : []));
|
|
477
|
+
variant = input('elevated', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
478
|
+
get withPadding() {
|
|
479
|
+
return this.padding();
|
|
480
|
+
}
|
|
481
|
+
get isSelectable() {
|
|
482
|
+
return this.selectable();
|
|
483
|
+
}
|
|
484
|
+
get tabIndex() {
|
|
485
|
+
return this.selectable() ? 0 : null;
|
|
486
|
+
}
|
|
487
|
+
get isElevated() {
|
|
488
|
+
return this.variant() === 'elevated';
|
|
489
|
+
}
|
|
490
|
+
get isFlat() {
|
|
491
|
+
return this.variant() === 'flat';
|
|
492
|
+
}
|
|
493
|
+
get isOutline() {
|
|
494
|
+
return this.variant() === 'outline';
|
|
495
|
+
}
|
|
496
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
497
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: CardComponent, isStandalone: true, selector: "st-card", inputs: { elevated: { classPropertyName: "elevated", publicName: "elevated", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.with-padding": "this.withPadding", "class.selectable": "this.isSelectable", "attr.tabindex": "this.tabIndex", "class.elevated": "this.isElevated", "class.flat": "this.isFlat", "class.outline": "this.isOutline" } }, ngImport: i0, template: "<div class=\"cover-area\">\n <ng-content select=\"[area='cover']\"></ng-content>\n</div>\n<div class=\"card-content\">\n <ng-content></ng-content>\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
498
|
+
}
|
|
499
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CardComponent, decorators: [{
|
|
500
|
+
type: Component,
|
|
501
|
+
args: [{ selector: 'st-card', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"cover-area\">\n <ng-content select=\"[area='cover']\"></ng-content>\n</div>\n<div class=\"card-content\">\n <ng-content></ng-content>\n</div>\n" }]
|
|
502
|
+
}], propDecorators: { elevated: [{ type: i0.Input, args: [{ isSignal: true, alias: "elevated", required: false }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], padding: [{ type: i0.Input, args: [{ isSignal: true, alias: "padding", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], withPadding: [{
|
|
503
|
+
type: HostBinding,
|
|
504
|
+
args: ['class.with-padding']
|
|
505
|
+
}], isSelectable: [{
|
|
506
|
+
type: HostBinding,
|
|
507
|
+
args: ['class.selectable']
|
|
508
|
+
}], tabIndex: [{
|
|
509
|
+
type: HostBinding,
|
|
510
|
+
args: ['attr.tabindex']
|
|
511
|
+
}], isElevated: [{
|
|
512
|
+
type: HostBinding,
|
|
513
|
+
args: ['class.elevated']
|
|
514
|
+
}], isFlat: [{
|
|
515
|
+
type: HostBinding,
|
|
516
|
+
args: ['class.flat']
|
|
517
|
+
}], isOutline: [{
|
|
518
|
+
type: HostBinding,
|
|
519
|
+
args: ['class.outline']
|
|
520
|
+
}] } });
|
|
521
|
+
|
|
522
|
+
class IconComponent {
|
|
523
|
+
defaultIcon = 'question';
|
|
524
|
+
name = input.required(...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
525
|
+
size = model('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
526
|
+
get sizeClass() {
|
|
527
|
+
return this.size() === 'xs';
|
|
528
|
+
}
|
|
529
|
+
get sizeSmClass() {
|
|
530
|
+
return this.size() === 'sm';
|
|
531
|
+
}
|
|
532
|
+
get sizeMdClass() {
|
|
533
|
+
return this.size() === 'md';
|
|
534
|
+
}
|
|
535
|
+
get sizeLgClass() {
|
|
536
|
+
return this.size() === 'lg';
|
|
537
|
+
}
|
|
538
|
+
svgMarkdown;
|
|
539
|
+
iconSubscription;
|
|
540
|
+
iconRegistry = inject(IconRegistry);
|
|
541
|
+
ngOnDestroy() {
|
|
542
|
+
if (this.iconSubscription) {
|
|
543
|
+
this.iconSubscription.unsubscribe();
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
ngOnChanges() {
|
|
547
|
+
const name = this.name();
|
|
548
|
+
if (!name) {
|
|
549
|
+
this.setIcon(this.defaultIcon);
|
|
550
|
+
}
|
|
551
|
+
else {
|
|
552
|
+
this.setIcon(name);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
setIcon(iconName) {
|
|
556
|
+
this.iconSubscription = this.iconRegistry.getIcon(iconName).subscribe((value) => {
|
|
557
|
+
this.svgMarkdown = value;
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
561
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: IconComponent, isStandalone: true, selector: "st-icon", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { size: "sizeChange" }, host: { properties: { "class.xs": "this.sizeClass", "class.sm": "this.sizeSmClass", "class.md": "this.sizeMdClass", "class.lg": "this.sizeLgClass" } }, usesOnChanges: true, ngImport: i0, template: '<span [innerHTML]="svgMarkdown"></span>', isInline: true });
|
|
562
|
+
}
|
|
563
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: IconComponent, decorators: [{
|
|
564
|
+
type: Component,
|
|
565
|
+
args: [{
|
|
566
|
+
selector: 'st-icon',
|
|
567
|
+
imports: [],
|
|
568
|
+
template: '<span [innerHTML]="svgMarkdown"></span>',
|
|
569
|
+
}]
|
|
570
|
+
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }, { type: i0.Output, args: ["sizeChange"] }], sizeClass: [{
|
|
571
|
+
type: HostBinding,
|
|
572
|
+
args: ['class.xs']
|
|
573
|
+
}], sizeSmClass: [{
|
|
574
|
+
type: HostBinding,
|
|
575
|
+
args: ['class.sm']
|
|
576
|
+
}], sizeMdClass: [{
|
|
577
|
+
type: HostBinding,
|
|
578
|
+
args: ['class.md']
|
|
579
|
+
}], sizeLgClass: [{
|
|
580
|
+
type: HostBinding,
|
|
581
|
+
args: ['class.lg']
|
|
582
|
+
}] } });
|
|
583
|
+
|
|
584
|
+
class OverlayDirective {
|
|
585
|
+
stOverlay = input.required(...(ngDevMode ? [{ debugName: "stOverlay" }] : []));
|
|
586
|
+
overlayOpen = model(false, ...(ngDevMode ? [{ debugName: "overlayOpen" }] : []));
|
|
587
|
+
overlayPlacement = input('bottom', ...(ngDevMode ? [{ debugName: "overlayPlacement" }] : []));
|
|
588
|
+
overlayOffset = input(8, ...(ngDevMode ? [{ debugName: "overlayOffset" }] : []));
|
|
589
|
+
element = inject(ElementRef);
|
|
590
|
+
viewContainerRef = inject(ViewContainerRef);
|
|
591
|
+
overlayEl;
|
|
592
|
+
cleanup;
|
|
593
|
+
constructor() { }
|
|
594
|
+
ngOnChanges() {
|
|
595
|
+
if (this.overlayOpen()) {
|
|
596
|
+
this.create();
|
|
597
|
+
}
|
|
598
|
+
else {
|
|
599
|
+
this.destroy();
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
async create() {
|
|
603
|
+
if (this.overlayEl)
|
|
604
|
+
return;
|
|
605
|
+
const view = this.viewContainerRef.createEmbeddedView(this.stOverlay());
|
|
606
|
+
view.detectChanges();
|
|
607
|
+
this.overlayEl = view.rootNodes[0];
|
|
608
|
+
document.body.appendChild(this.overlayEl);
|
|
609
|
+
this.cleanup = autoUpdate(this.element.nativeElement, this.overlayEl, () => this.updatePosition());
|
|
610
|
+
}
|
|
611
|
+
async updatePosition() {
|
|
612
|
+
if (!this.overlayEl)
|
|
613
|
+
return;
|
|
614
|
+
const { x, y } = await computePosition(this.element.nativeElement, this.overlayEl, {
|
|
615
|
+
placement: this.overlayPlacement(),
|
|
616
|
+
middleware: [offset(this.overlayOffset()), flip(), shift()],
|
|
617
|
+
});
|
|
618
|
+
if (!this.overlayEl)
|
|
619
|
+
return;
|
|
620
|
+
const { width, height } = this.element.nativeElement.getBoundingClientRect();
|
|
621
|
+
Object.assign(this.overlayEl.style, {
|
|
622
|
+
position: 'absolute',
|
|
623
|
+
left: `${x}px`,
|
|
624
|
+
top: `${y}px`,
|
|
625
|
+
});
|
|
626
|
+
this.overlayEl.style.setProperty('--st-overlay-anchor-element-width', `${width}px`);
|
|
627
|
+
}
|
|
628
|
+
destroy() {
|
|
629
|
+
if (this.cleanup)
|
|
630
|
+
this.cleanup();
|
|
631
|
+
if (this.overlayEl)
|
|
632
|
+
this.overlayEl.remove();
|
|
633
|
+
this.overlayEl = undefined;
|
|
634
|
+
}
|
|
635
|
+
ngOnDestroy() {
|
|
636
|
+
this.destroy();
|
|
637
|
+
}
|
|
638
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: OverlayDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
639
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: OverlayDirective, isStandalone: true, selector: "[stOverlay]", inputs: { stOverlay: { classPropertyName: "stOverlay", publicName: "stOverlay", isSignal: true, isRequired: true, transformFunction: null }, overlayOpen: { classPropertyName: "overlayOpen", publicName: "overlayOpen", isSignal: true, isRequired: false, transformFunction: null }, overlayPlacement: { classPropertyName: "overlayPlacement", publicName: "overlayPlacement", isSignal: true, isRequired: false, transformFunction: null }, overlayOffset: { classPropertyName: "overlayOffset", publicName: "overlayOffset", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { overlayOpen: "overlayOpenChange" }, usesOnChanges: true, ngImport: i0 });
|
|
640
|
+
}
|
|
641
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: OverlayDirective, decorators: [{
|
|
642
|
+
type: Directive,
|
|
643
|
+
args: [{
|
|
644
|
+
selector: '[stOverlay]',
|
|
645
|
+
}]
|
|
646
|
+
}], ctorParameters: () => [], propDecorators: { stOverlay: [{ type: i0.Input, args: [{ isSignal: true, alias: "stOverlay", required: true }] }], overlayOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlayOpen", required: false }] }, { type: i0.Output, args: ["overlayOpenChange"] }], overlayPlacement: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlayPlacement", required: false }] }], overlayOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlayOffset", required: false }] }] } });
|
|
647
|
+
|
|
648
|
+
class ActionMenuComponent {
|
|
649
|
+
projectedButton = contentChild(ButtonDirective, { ...(ngDevMode ? { debugName: "projectedButton" } : {}), descendants: true,
|
|
650
|
+
read: ElementRef });
|
|
651
|
+
defaultButton = viewChild(ButtonDirective, { ...(ngDevMode ? { debugName: "defaultButton" } : {}), read: ElementRef });
|
|
652
|
+
actionMenuItems = contentChildren(ActionMenuItemComponent, ...(ngDevMode ? [{ debugName: "actionMenuItems" }] : []));
|
|
653
|
+
placement = input('bottom-end', ...(ngDevMode ? [{ debugName: "placement" }] : []));
|
|
654
|
+
renderer = inject(Renderer2);
|
|
655
|
+
menuOpen = signal(false, ...(ngDevMode ? [{ debugName: "menuOpen" }] : []));
|
|
656
|
+
ngAfterViewInit() {
|
|
657
|
+
const button = this.projectedButton() ?? this.defaultButton();
|
|
658
|
+
this.renderer.listen(button.nativeElement, 'click', () => {
|
|
659
|
+
this.menuOpen.set(!this.menuOpen());
|
|
660
|
+
});
|
|
661
|
+
this.actionMenuItems().forEach((item) => {
|
|
662
|
+
item.onMenuItemClicked.subscribe((shouldClose) => {
|
|
663
|
+
if (shouldClose) {
|
|
664
|
+
this.menuOpen.set(false);
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ActionMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
670
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: ActionMenuComponent, isStandalone: true, selector: "st-action-menu", inputs: { placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "projectedButton", first: true, predicate: ButtonDirective, descendants: true, read: ElementRef, isSignal: true }, { propertyName: "actionMenuItems", predicate: ActionMenuItemComponent, isSignal: true }], viewQueries: [{ propertyName: "defaultButton", first: true, predicate: ButtonDirective, descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<div [stOverlay]=\"menu\" [overlayOpen]=\"menuOpen()\" [overlayPlacement]=\"placement()\">\n <ng-content select=\"button[stButton]\"></ng-content>\n @if (!projectedButton()) {\n <button stButton><st-icon name=\"more\"></st-icon></button>\n }\n</div>\n\n<ng-template #menu>\n <st-card [padding]=\"false\"><ng-content select=\"st-action-menu-item\"></ng-content></st-card>\n</ng-template>\n", styles: ["st-card{width:fit-content}\n"], dependencies: [{ kind: "component", type: CardComponent, selector: "st-card", inputs: ["elevated", "selectable", "padding", "variant"] }, { kind: "directive", type: OverlayDirective, selector: "[stOverlay]", inputs: ["stOverlay", "overlayOpen", "overlayPlacement", "overlayOffset"], outputs: ["overlayOpenChange"] }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["name", "size"], outputs: ["sizeChange"] }, { kind: "directive", type: ButtonDirective, selector: "[stButton]", inputs: ["variant", "size", "fullWidth"] }] });
|
|
671
|
+
}
|
|
672
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ActionMenuComponent, decorators: [{
|
|
673
|
+
type: Component,
|
|
674
|
+
args: [{ selector: 'st-action-menu', imports: [CardComponent, OverlayDirective, IconComponent, ButtonDirective], template: "<div [stOverlay]=\"menu\" [overlayOpen]=\"menuOpen()\" [overlayPlacement]=\"placement()\">\n <ng-content select=\"button[stButton]\"></ng-content>\n @if (!projectedButton()) {\n <button stButton><st-icon name=\"more\"></st-icon></button>\n }\n</div>\n\n<ng-template #menu>\n <st-card [padding]=\"false\"><ng-content select=\"st-action-menu-item\"></ng-content></st-card>\n</ng-template>\n", styles: ["st-card{width:fit-content}\n"] }]
|
|
675
|
+
}], propDecorators: { projectedButton: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ButtonDirective), { ...{
|
|
676
|
+
descendants: true,
|
|
677
|
+
read: ElementRef,
|
|
678
|
+
}, isSignal: true }] }], defaultButton: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ButtonDirective), { ...{
|
|
679
|
+
read: ElementRef,
|
|
680
|
+
}, isSignal: true }] }], actionMenuItems: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => ActionMenuItemComponent), { isSignal: true }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }] } });
|
|
681
|
+
|
|
682
|
+
class AccordionItemComponent {
|
|
683
|
+
title = input.required(...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
684
|
+
open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
685
|
+
toggled = output();
|
|
686
|
+
constructor() {
|
|
687
|
+
let firstRun = true;
|
|
688
|
+
effect(() => {
|
|
689
|
+
let value = this.open();
|
|
690
|
+
if (!firstRun) {
|
|
691
|
+
this.toggled.emit(value);
|
|
692
|
+
}
|
|
693
|
+
firstRun = false;
|
|
694
|
+
return;
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
get isOpen() {
|
|
698
|
+
return this.open();
|
|
699
|
+
}
|
|
700
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AccordionItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
701
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: AccordionItemComponent, isStandalone: true, selector: "st-accordion-item", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", toggled: "toggled" }, host: { properties: { "attr.open": "this.isOpen" } }, ngImport: i0, template: "<div class=\"accordion-header\" (click)=\"this.open.set(!this.open())\">\n {{ title() }}\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z\"\n ></path>\n </svg>\n</div>\n\n<div class=\"accordion-content\">\n <ng-content></ng-content>\n</div>\n" });
|
|
702
|
+
}
|
|
703
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AccordionItemComponent, decorators: [{
|
|
704
|
+
type: Component,
|
|
705
|
+
args: [{ selector: 'st-accordion-item', imports: [], template: "<div class=\"accordion-header\" (click)=\"this.open.set(!this.open())\">\n {{ title() }}\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z\"\n ></path>\n </svg>\n</div>\n\n<div class=\"accordion-content\">\n <ng-content></ng-content>\n</div>\n" }]
|
|
706
|
+
}], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], toggled: [{ type: i0.Output, args: ["toggled"] }], isOpen: [{
|
|
707
|
+
type: HostBinding,
|
|
708
|
+
args: ['attr.open']
|
|
709
|
+
}] } });
|
|
710
|
+
|
|
711
|
+
class AccordionGroupComponent {
|
|
712
|
+
items = contentChildren(AccordionItemComponent, ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
713
|
+
allowMultipleOpen = input(false, ...(ngDevMode ? [{ debugName: "allowMultipleOpen" }] : []));
|
|
714
|
+
ngAfterContentInit() {
|
|
715
|
+
this.items().forEach((item) => {
|
|
716
|
+
item.toggled.subscribe((open) => {
|
|
717
|
+
if (open && !this.allowMultipleOpen()) {
|
|
718
|
+
this.closeOtherItems(item);
|
|
719
|
+
}
|
|
720
|
+
});
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
closeOtherItems(currentItem) {
|
|
724
|
+
this.items().forEach((item) => {
|
|
725
|
+
if (item !== currentItem) {
|
|
726
|
+
item.open.set(false);
|
|
727
|
+
}
|
|
728
|
+
});
|
|
729
|
+
}
|
|
730
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AccordionGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
731
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.0", type: AccordionGroupComponent, isStandalone: true, selector: "st-accordion-group", inputs: { allowMultipleOpen: { classPropertyName: "allowMultipleOpen", publicName: "allowMultipleOpen", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "items", predicate: AccordionItemComponent, isSignal: true }], ngImport: i0, template: "<ng-content></ng-content>\n" });
|
|
732
|
+
}
|
|
733
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AccordionGroupComponent, decorators: [{
|
|
734
|
+
type: Component,
|
|
735
|
+
args: [{ selector: 'st-accordion-group', imports: [], template: "<ng-content></ng-content>\n" }]
|
|
736
|
+
}], propDecorators: { items: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => AccordionItemComponent), { isSignal: true }] }], allowMultipleOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowMultipleOpen", required: false }] }] } });
|
|
737
|
+
|
|
738
|
+
class AvatarComponent {
|
|
739
|
+
iconComponents = contentChildren(IconComponent, { ...(ngDevMode ? { debugName: "iconComponents" } : {}), descendants: true });
|
|
740
|
+
text = input(null, ...(ngDevMode ? [{ debugName: "text" }] : []));
|
|
741
|
+
size = model('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
742
|
+
get elementClasses() {
|
|
743
|
+
return [this.size()];
|
|
744
|
+
}
|
|
745
|
+
ngAfterViewInit() {
|
|
746
|
+
setTimeout(() => {
|
|
747
|
+
this.iconComponents().forEach((icon) => {
|
|
748
|
+
icon.size.set(this.size());
|
|
749
|
+
});
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
753
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: AvatarComponent, isStandalone: true, selector: "st-avatar", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { size: "sizeChange" }, host: { properties: { "class": "this.elementClasses" } }, queries: [{ propertyName: "iconComponents", predicate: IconComponent, descendants: true, isSignal: true }], ngImport: i0, template: "@if (text() !== null) {\n <span>{{ text() }}</span>\n}\n<ng-content></ng-content>\n" });
|
|
754
|
+
}
|
|
755
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AvatarComponent, decorators: [{
|
|
756
|
+
type: Component,
|
|
757
|
+
args: [{ selector: 'st-avatar', imports: [], template: "@if (text() !== null) {\n <span>{{ text() }}</span>\n}\n<ng-content></ng-content>\n" }]
|
|
758
|
+
}], propDecorators: { iconComponents: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => IconComponent), { ...{ descendants: true }, isSignal: true }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }, { type: i0.Output, args: ["sizeChange"] }], elementClasses: [{
|
|
759
|
+
type: HostBinding,
|
|
760
|
+
args: ['class']
|
|
761
|
+
}] } });
|
|
762
|
+
|
|
763
|
+
class AvatarStackComponent {
|
|
764
|
+
avatarRefs = contentChildren(AvatarComponent, { ...(ngDevMode ? { debugName: "avatarRefs" } : {}), descendants: true,
|
|
765
|
+
read: ElementRef });
|
|
766
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
767
|
+
spacing = input('mid', ...(ngDevMode ? [{ debugName: "spacing" }] : []));
|
|
768
|
+
firstOnFront = input(false, ...(ngDevMode ? [{ debugName: "firstOnFront" }] : []));
|
|
769
|
+
get xsClass() {
|
|
770
|
+
return this.size() === 'xs';
|
|
771
|
+
}
|
|
772
|
+
get smClass() {
|
|
773
|
+
return this.size() === 'sm';
|
|
774
|
+
}
|
|
775
|
+
get mdClass() {
|
|
776
|
+
return this.size() === 'md';
|
|
777
|
+
}
|
|
778
|
+
get lgClass() {
|
|
779
|
+
return this.size() === 'lg';
|
|
780
|
+
}
|
|
781
|
+
get firstOnFrontClass() {
|
|
782
|
+
return this.firstOnFront();
|
|
783
|
+
}
|
|
784
|
+
get looseClass() {
|
|
785
|
+
return this.spacing() === 'loose';
|
|
786
|
+
}
|
|
787
|
+
get midClass() {
|
|
788
|
+
return this.spacing() === 'mid';
|
|
789
|
+
}
|
|
790
|
+
get tightClass() {
|
|
791
|
+
return this.spacing() === 'tight';
|
|
792
|
+
}
|
|
793
|
+
ngAfterViewInit() {
|
|
794
|
+
setTimeout(() => {
|
|
795
|
+
this.avatarRefs().forEach((ref, index) => {
|
|
796
|
+
if (this.firstOnFront()) {
|
|
797
|
+
ref.nativeElement.style.setProperty('--z', (this.avatarRefs().length - index).toString());
|
|
798
|
+
}
|
|
799
|
+
});
|
|
800
|
+
}, 1);
|
|
801
|
+
}
|
|
802
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AvatarStackComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
803
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.0", type: AvatarStackComponent, isStandalone: true, selector: "st-avatar-stack", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, spacing: { classPropertyName: "spacing", publicName: "spacing", isSignal: true, isRequired: false, transformFunction: null }, firstOnFront: { classPropertyName: "firstOnFront", publicName: "firstOnFront", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.xs": "this.xsClass", "class.sm": "this.smClass", "class.md": "this.mdClass", "class.lg": "this.lgClass", "class.first-on-front": "this.firstOnFrontClass", "class.loose": "this.looseClass", "class.mid": "this.midClass", "class.tight": "this.tightClass" } }, queries: [{ propertyName: "avatarRefs", predicate: AvatarComponent, descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<ng-content></ng-content>\n" });
|
|
804
|
+
}
|
|
805
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AvatarStackComponent, decorators: [{
|
|
806
|
+
type: Component,
|
|
807
|
+
args: [{ selector: 'st-avatar-stack', imports: [], template: "<ng-content></ng-content>\n" }]
|
|
808
|
+
}], propDecorators: { avatarRefs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => AvatarComponent), { ...{
|
|
809
|
+
descendants: true,
|
|
810
|
+
read: ElementRef,
|
|
811
|
+
}, isSignal: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], spacing: [{ type: i0.Input, args: [{ isSignal: true, alias: "spacing", required: false }] }], firstOnFront: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstOnFront", required: false }] }], xsClass: [{
|
|
812
|
+
type: HostBinding,
|
|
813
|
+
args: ['class.xs']
|
|
814
|
+
}], smClass: [{
|
|
815
|
+
type: HostBinding,
|
|
816
|
+
args: ['class.sm']
|
|
817
|
+
}], mdClass: [{
|
|
818
|
+
type: HostBinding,
|
|
819
|
+
args: ['class.md']
|
|
820
|
+
}], lgClass: [{
|
|
821
|
+
type: HostBinding,
|
|
822
|
+
args: ['class.lg']
|
|
823
|
+
}], firstOnFrontClass: [{
|
|
824
|
+
type: HostBinding,
|
|
825
|
+
args: ['class.first-on-front']
|
|
826
|
+
}], looseClass: [{
|
|
827
|
+
type: HostBinding,
|
|
828
|
+
args: ['class.loose']
|
|
829
|
+
}], midClass: [{
|
|
830
|
+
type: HostBinding,
|
|
831
|
+
args: ['class.mid']
|
|
832
|
+
}], tightClass: [{
|
|
833
|
+
type: HostBinding,
|
|
834
|
+
args: ['class.tight']
|
|
835
|
+
}] } });
|
|
836
|
+
|
|
837
|
+
class ButtonGroupComponent {
|
|
838
|
+
renderer = inject(Renderer2);
|
|
839
|
+
justification = input('start', ...(ngDevMode ? [{ debugName: "justification" }] : []));
|
|
840
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ButtonGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
841
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: ButtonGroupComponent, isStandalone: true, selector: "st-button-group", inputs: { justification: { classPropertyName: "justification", publicName: "justification", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-content select=\"[stButton], st-divider\" #buttons></ng-content>\n" });
|
|
842
|
+
}
|
|
843
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ButtonGroupComponent, decorators: [{
|
|
844
|
+
type: Component,
|
|
845
|
+
args: [{ selector: 'st-button-group', imports: [], template: "<ng-content select=\"[stButton], st-divider\" #buttons></ng-content>\n" }]
|
|
846
|
+
}], propDecorators: { justification: [{ type: i0.Input, args: [{ isSignal: true, alias: "justification", required: false }] }] } });
|
|
847
|
+
|
|
848
|
+
class NativeInputRefDirective {
|
|
849
|
+
el = inject((ElementRef));
|
|
850
|
+
constructor() { }
|
|
851
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NativeInputRefDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
852
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.0", type: NativeInputRefDirective, isStandalone: true, selector: "input[stInput], textarea[stInput]", ngImport: i0 });
|
|
853
|
+
}
|
|
854
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NativeInputRefDirective, decorators: [{
|
|
855
|
+
type: Directive,
|
|
856
|
+
args: [{
|
|
857
|
+
selector: 'input[stInput], textarea[stInput]',
|
|
858
|
+
}]
|
|
859
|
+
}], ctorParameters: () => [] });
|
|
860
|
+
|
|
861
|
+
class InputFieldComponent {
|
|
862
|
+
iconComponents = contentChildren(IconComponent, { ...(ngDevMode ? { debugName: "iconComponents" } : {}), descendants: true });
|
|
863
|
+
inputField = contentChild(NativeInputRefDirective, { ...(ngDevMode ? { debugName: "inputField" } : {}), descendants: true });
|
|
864
|
+
pendingFocus = signal(false, ...(ngDevMode ? [{ debugName: "pendingFocus" }] : []));
|
|
865
|
+
constructor() {
|
|
866
|
+
effect(() => {
|
|
867
|
+
const input = this.inputField();
|
|
868
|
+
if (input && this.pendingFocus()) {
|
|
869
|
+
input.el.nativeElement.focus();
|
|
870
|
+
this.pendingFocus.set(false);
|
|
871
|
+
}
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
ngAfterViewInit() {
|
|
875
|
+
setTimeout(() => this.iconComponents().forEach((icon) => icon.size.set('sm')), 1);
|
|
876
|
+
}
|
|
877
|
+
focus() {
|
|
878
|
+
const input = this.inputField();
|
|
879
|
+
this.pendingFocus.set(true);
|
|
880
|
+
}
|
|
881
|
+
blur() {
|
|
882
|
+
this.inputField()?.el.nativeElement.blur();
|
|
883
|
+
}
|
|
884
|
+
get nativeInput() {
|
|
885
|
+
return this.inputField()?.el.nativeElement;
|
|
886
|
+
}
|
|
887
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: InputFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
888
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.0", type: InputFieldComponent, isStandalone: true, selector: "st-input-field", queries: [{ propertyName: "iconComponents", predicate: IconComponent, descendants: true, isSignal: true }, { propertyName: "inputField", first: true, predicate: NativeInputRefDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-content select=\"label\"></ng-content>\n<div class=\"st-input-wrapper\">\n <div class=\"affix\">\n <ng-content select=\"[prefix]\"></ng-content>\n </div>\n <ng-content select=\"input,textarea\"></ng-content>\n <div class=\"affix\">\n <ng-content select=\"[suffix]\"></ng-content>\n </div>\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
889
|
+
}
|
|
890
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: InputFieldComponent, decorators: [{
|
|
891
|
+
type: Component,
|
|
892
|
+
args: [{ selector: 'st-input-field', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content select=\"label\"></ng-content>\n<div class=\"st-input-wrapper\">\n <div class=\"affix\">\n <ng-content select=\"[prefix]\"></ng-content>\n </div>\n <ng-content select=\"input,textarea\"></ng-content>\n <div class=\"affix\">\n <ng-content select=\"[suffix]\"></ng-content>\n </div>\n</div>\n" }]
|
|
893
|
+
}], ctorParameters: () => [], propDecorators: { iconComponents: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => IconComponent), { ...{ descendants: true }, isSignal: true }] }], inputField: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NativeInputRefDirective), { ...{
|
|
894
|
+
descendants: true,
|
|
895
|
+
}, isSignal: true }] }] } });
|
|
896
|
+
|
|
897
|
+
class DropdownComponent {
|
|
898
|
+
open = signal(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
899
|
+
placeholder = input('Select', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
900
|
+
placement = input('bottom-start', ...(ngDevMode ? [{ debugName: "placement" }] : []));
|
|
901
|
+
fullWidth = input(false, ...(ngDevMode ? [{ debugName: "fullWidth" }] : []));
|
|
902
|
+
label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
903
|
+
name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : []));
|
|
904
|
+
selected = model(...(ngDevMode ? [undefined, { debugName: "selected" }] : []));
|
|
905
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
906
|
+
searchable = input(false, ...(ngDevMode ? [{ debugName: "searchable" }] : []));
|
|
907
|
+
searchQuery = model(...(ngDevMode ? [undefined, { debugName: "searchQuery" }] : []));
|
|
908
|
+
searchPlaceholder = input('Search', ...(ngDevMode ? [{ debugName: "searchPlaceholder" }] : []));
|
|
909
|
+
dropdownItems = input.required(...(ngDevMode ? [{ debugName: "dropdownItems" }] : []));
|
|
910
|
+
shownItems = computed(() => {
|
|
911
|
+
if (!this.searchQuery()) {
|
|
912
|
+
return this.dropdownItems();
|
|
913
|
+
}
|
|
914
|
+
return this.dropdownItems().filter((item) => item.text.toLowerCase().includes(this.searchQuery().toLowerCase().trim()));
|
|
915
|
+
}, ...(ngDevMode ? [{ debugName: "shownItems" }] : []));
|
|
916
|
+
onSelect = output();
|
|
917
|
+
inputField = viewChild(InputFieldComponent, ...(ngDevMode ? [{ debugName: "inputField" }] : []));
|
|
918
|
+
get classList() {
|
|
919
|
+
return [this.size()];
|
|
920
|
+
}
|
|
921
|
+
toggleDropdown(event) {
|
|
922
|
+
if (event) {
|
|
923
|
+
event.preventDefault();
|
|
924
|
+
event.stopPropagation();
|
|
925
|
+
}
|
|
926
|
+
if (this.open()) {
|
|
927
|
+
this.hide();
|
|
928
|
+
}
|
|
929
|
+
else {
|
|
930
|
+
this.show();
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
onItemClick(item, mouseEvent) {
|
|
934
|
+
this.toggleDropdown();
|
|
935
|
+
mouseEvent.stopPropagation();
|
|
936
|
+
this.selected.set(item);
|
|
937
|
+
this.onSelect.emit(item);
|
|
938
|
+
}
|
|
939
|
+
onItemHover(mouseEvent) {
|
|
940
|
+
mouseEvent.stopPropagation();
|
|
941
|
+
mouseEvent.stopImmediatePropagation();
|
|
942
|
+
mouseEvent.preventDefault();
|
|
943
|
+
}
|
|
944
|
+
show() {
|
|
945
|
+
this.open.set(true);
|
|
946
|
+
setTimeout(() => {
|
|
947
|
+
this.inputField()?.focus();
|
|
948
|
+
}, 10);
|
|
949
|
+
}
|
|
950
|
+
hide() {
|
|
951
|
+
this.open.set(false);
|
|
952
|
+
}
|
|
953
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
954
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: DropdownComponent, isStandalone: true, selector: "st-dropdown", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, searchQuery: { classPropertyName: "searchQuery", publicName: "searchQuery", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, dropdownItems: { classPropertyName: "dropdownItems", publicName: "dropdownItems", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { selected: "selectedChange", searchQuery: "searchQueryChange", onSelect: "onSelect" }, host: { properties: { "class": "this.classList" } }, viewQueries: [{ propertyName: "inputField", first: true, predicate: InputFieldComponent, descendants: true, isSignal: true }], ngImport: i0, template: "@if (label()) {\n <label [for]=\"name()\"> {{ label() }}</label>\n}\n<div\n class=\"dropdown-input\"\n [id]=\"name()\"\n #dropdownInput\n (click)=\"toggleDropdown($event)\"\n [attr.data-open]=\"open()\"\n tabindex=\"0\"\n [stOverlay]=\"selector\"\n [overlayOpen]=\"open()\"\n [overlayPlacement]=\"placement()\">\n @if (selected()) {\n {{ selected()!.text }}\n } @else {\n <span class=\"placeholder-text\">{{ placeholder() }}</span>\n }\n\n <st-icon name=\"expand-up-down\"></st-icon>\n</div>\n\n<ng-template #selector>\n <div class=\"dropdown-selector\" #dropdownSelector [class.full-width]=\"fullWidth()\">\n @if (searchable()) {\n <st-input-field>\n <input stInput #searchField type=\"text\" [(ngModel)]=\"searchQuery\" [placeholder]=\"searchPlaceholder()\" />\n <button\n stButton\n variant=\"ghost\"\n [class.visible]=\"searchQuery() !== undefined && searchQuery()!.length > 0\"\n suffix\n size=\"sm\"\n (click)=\"searchQuery.set(undefined)\">\n x\n </button>\n </st-input-field>\n }\n @for (item of shownItems(); track item.id) {\n <div class=\"dropdown-item\" (click)=\"onItemClick(item, $event)\" (mouseover)=\"onItemHover($event)\">\n {{ item.text }}\n </div>\n }\n </div>\n</ng-template>\n", dependencies: [{ kind: "component", type: IconComponent, selector: "st-icon", inputs: ["name", "size"], outputs: ["sizeChange"] }, { kind: "directive", type: OverlayDirective, selector: "[stOverlay]", inputs: ["stOverlay", "overlayOpen", "overlayPlacement", "overlayOffset"], outputs: ["overlayOpenChange"] }, { kind: "component", type: InputFieldComponent, selector: "st-input-field" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NativeInputRefDirective, selector: "input[stInput], textarea[stInput]" }, { kind: "directive", type: ButtonDirective, selector: "[stButton]", inputs: ["variant", "size", "fullWidth"] }] });
|
|
955
|
+
}
|
|
956
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DropdownComponent, decorators: [{
|
|
957
|
+
type: Component,
|
|
958
|
+
args: [{ selector: 'st-dropdown', imports: [
|
|
959
|
+
IconComponent,
|
|
960
|
+
OverlayDirective,
|
|
961
|
+
InputFieldComponent,
|
|
962
|
+
FormsModule,
|
|
963
|
+
NativeInputRefDirective,
|
|
964
|
+
ButtonDirective,
|
|
965
|
+
], template: "@if (label()) {\n <label [for]=\"name()\"> {{ label() }}</label>\n}\n<div\n class=\"dropdown-input\"\n [id]=\"name()\"\n #dropdownInput\n (click)=\"toggleDropdown($event)\"\n [attr.data-open]=\"open()\"\n tabindex=\"0\"\n [stOverlay]=\"selector\"\n [overlayOpen]=\"open()\"\n [overlayPlacement]=\"placement()\">\n @if (selected()) {\n {{ selected()!.text }}\n } @else {\n <span class=\"placeholder-text\">{{ placeholder() }}</span>\n }\n\n <st-icon name=\"expand-up-down\"></st-icon>\n</div>\n\n<ng-template #selector>\n <div class=\"dropdown-selector\" #dropdownSelector [class.full-width]=\"fullWidth()\">\n @if (searchable()) {\n <st-input-field>\n <input stInput #searchField type=\"text\" [(ngModel)]=\"searchQuery\" [placeholder]=\"searchPlaceholder()\" />\n <button\n stButton\n variant=\"ghost\"\n [class.visible]=\"searchQuery() !== undefined && searchQuery()!.length > 0\"\n suffix\n size=\"sm\"\n (click)=\"searchQuery.set(undefined)\">\n x\n </button>\n </st-input-field>\n }\n @for (item of shownItems(); track item.id) {\n <div class=\"dropdown-item\" (click)=\"onItemClick(item, $event)\" (mouseover)=\"onItemHover($event)\">\n {{ item.text }}\n </div>\n }\n </div>\n</ng-template>\n" }]
|
|
966
|
+
}], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }, { type: i0.Output, args: ["selectedChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], searchQuery: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchQuery", required: false }] }, { type: i0.Output, args: ["searchQueryChange"] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], dropdownItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropdownItems", required: true }] }], onSelect: [{ type: i0.Output, args: ["onSelect"] }], inputField: [{ type: i0.ViewChild, args: [i0.forwardRef(() => InputFieldComponent), { isSignal: true }] }], classList: [{
|
|
967
|
+
type: HostBinding,
|
|
968
|
+
args: ['class']
|
|
969
|
+
}] } });
|
|
970
|
+
|
|
971
|
+
class DividerComponent {
|
|
972
|
+
label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
973
|
+
margin = input(true, ...(ngDevMode ? [{ debugName: "margin" }] : []));
|
|
974
|
+
vertical = input(false, ...(ngDevMode ? [{ debugName: "vertical" }] : []));
|
|
975
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DividerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
976
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: DividerComponent, isStandalone: true, selector: "st-divider", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, margin: { classPropertyName: "margin", publicName: "margin", isSignal: true, isRequired: false, transformFunction: null }, vertical: { classPropertyName: "vertical", publicName: "vertical", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (!label() || vertical()) {\n <div class=\"divider-line\" [class.divider-margin]=\"margin()\" [class.vertical]=\"vertical()\"></div>\n} @else {\n <div class=\"divider-line-with-text\" [class.divider-margin]=\"margin()\">\n <div class=\"divider-line\"></div>\n <span>{{ label() }}</span>\n <div class=\"divider-line\"></div>\n </div>\n}\n" });
|
|
977
|
+
}
|
|
978
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DividerComponent, decorators: [{
|
|
979
|
+
type: Component,
|
|
980
|
+
args: [{ selector: 'st-divider', imports: [], template: "@if (!label() || vertical()) {\n <div class=\"divider-line\" [class.divider-margin]=\"margin()\" [class.vertical]=\"vertical()\"></div>\n} @else {\n <div class=\"divider-line-with-text\" [class.divider-margin]=\"margin()\">\n <div class=\"divider-line\"></div>\n <span>{{ label() }}</span>\n <div class=\"divider-line\"></div>\n </div>\n}\n" }]
|
|
981
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], margin: [{ type: i0.Input, args: [{ isSignal: true, alias: "margin", required: false }] }], vertical: [{ type: i0.Input, args: [{ isSignal: true, alias: "vertical", required: false }] }] } });
|
|
982
|
+
|
|
983
|
+
class TagComponent {
|
|
984
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
985
|
+
get class() {
|
|
986
|
+
return this.size();
|
|
987
|
+
}
|
|
988
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: TagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
989
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: TagComponent, isStandalone: true, selector: "st-tag", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
|
|
990
|
+
}
|
|
991
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: TagComponent, decorators: [{
|
|
992
|
+
type: Component,
|
|
993
|
+
args: [{
|
|
994
|
+
selector: 'st-tag',
|
|
995
|
+
imports: [],
|
|
996
|
+
template: '<ng-content></ng-content>',
|
|
997
|
+
}]
|
|
998
|
+
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], class: [{
|
|
999
|
+
type: HostBinding,
|
|
1000
|
+
args: ['class']
|
|
1001
|
+
}] } });
|
|
1002
|
+
|
|
1003
|
+
class ItemComponent {
|
|
1004
|
+
interactable = input(false, ...(ngDevMode ? [{ debugName: "interactable" }] : []));
|
|
1005
|
+
get isInteractable() {
|
|
1006
|
+
return this.interactable();
|
|
1007
|
+
}
|
|
1008
|
+
get tabIndex() {
|
|
1009
|
+
return this.interactable() ? 0 : null;
|
|
1010
|
+
}
|
|
1011
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1012
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: ItemComponent, isStandalone: true, selector: "st-item", inputs: { interactable: { classPropertyName: "interactable", publicName: "interactable", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.interactable": "this.isInteractable", "attr.tabindex": "this.tabIndex" } }, ngImport: i0, template: "<span class=\"item-start\">\n <ng-content select=\"[area='start']\"></ng-content\n></span>\n<span class=\"item-default\"> <ng-content></ng-content></span>\n<span class=\"item-end\">\n <ng-content select=\"[area='end']\"></ng-content>\n</span>\n", styles: [""] });
|
|
1013
|
+
}
|
|
1014
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ItemComponent, decorators: [{
|
|
1015
|
+
type: Component,
|
|
1016
|
+
args: [{ selector: 'st-item', imports: [], template: "<span class=\"item-start\">\n <ng-content select=\"[area='start']\"></ng-content\n></span>\n<span class=\"item-default\"> <ng-content></ng-content></span>\n<span class=\"item-end\">\n <ng-content select=\"[area='end']\"></ng-content>\n</span>\n" }]
|
|
1017
|
+
}], propDecorators: { interactable: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactable", required: false }] }], isInteractable: [{
|
|
1018
|
+
type: HostBinding,
|
|
1019
|
+
args: ['class.interactable']
|
|
1020
|
+
}], tabIndex: [{
|
|
1021
|
+
type: HostBinding,
|
|
1022
|
+
args: ['attr.tabindex']
|
|
1023
|
+
}] } });
|
|
1024
|
+
|
|
1025
|
+
class ItemListComponent {
|
|
1026
|
+
items = input.required(...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
1027
|
+
dividers = input(true, ...(ngDevMode ? [{ debugName: "dividers" }] : []));
|
|
1028
|
+
template = input(...(ngDevMode ? [undefined, { debugName: "template" }] : []));
|
|
1029
|
+
get hostClasses() {
|
|
1030
|
+
return [this.dividers() ? 'with-dividers' : ''];
|
|
1031
|
+
}
|
|
1032
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ItemListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1033
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: ItemListComponent, isStandalone: true, selector: "st-item-list", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, dividers: { classPropertyName: "dividers", publicName: "dividers", isSignal: true, isRequired: false, transformFunction: null }, template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "@for (item of items(); track item; let last = $last) {\n <ng-template #defaultItemTemplate>\n <st-item>{{ item }}</st-item>\n </ng-template>\n <ng-container\n [ngTemplateOutlet]=\"template() || defaultItemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n}\n", dependencies: [{ kind: "component", type: ItemComponent, selector: "st-item", inputs: ["interactable"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: CommonModule }] });
|
|
1034
|
+
}
|
|
1035
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ItemListComponent, decorators: [{
|
|
1036
|
+
type: Component,
|
|
1037
|
+
args: [{ selector: 'st-item-list', imports: [ItemComponent, NgTemplateOutlet, CommonModule], template: "@for (item of items(); track item; let last = $last) {\n <ng-template #defaultItemTemplate>\n <st-item>{{ item }}</st-item>\n </ng-template>\n <ng-container\n [ngTemplateOutlet]=\"template() || defaultItemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n}\n" }]
|
|
1038
|
+
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], dividers: [{ type: i0.Input, args: [{ isSignal: true, alias: "dividers", required: false }] }], template: [{ type: i0.Input, args: [{ isSignal: true, alias: "template", required: false }] }], hostClasses: [{
|
|
1039
|
+
type: HostBinding,
|
|
1040
|
+
args: ['class']
|
|
1041
|
+
}] } });
|
|
1042
|
+
|
|
1043
|
+
class AutoResizeDirective {
|
|
1044
|
+
minimumRows = input(1, ...(ngDevMode ? [{ debugName: "minimumRows" }] : []));
|
|
1045
|
+
maximumRows = input(...(ngDevMode ? [undefined, { debugName: "maximumRows" }] : []));
|
|
1046
|
+
lineHeight = 0;
|
|
1047
|
+
element = inject(ElementRef);
|
|
1048
|
+
onInput() {
|
|
1049
|
+
this.resize();
|
|
1050
|
+
}
|
|
1051
|
+
onWindowResize() {
|
|
1052
|
+
this.resize();
|
|
1053
|
+
}
|
|
1054
|
+
constructor() { }
|
|
1055
|
+
ngAfterViewInit() {
|
|
1056
|
+
this.calculateLineHeight();
|
|
1057
|
+
this.resize();
|
|
1058
|
+
}
|
|
1059
|
+
ngOnChanges(changes) {
|
|
1060
|
+
if (changes['minRows'] || changes['maxRows']) {
|
|
1061
|
+
this.resize();
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
calculateLineHeight() {
|
|
1065
|
+
const textarea = this.element.nativeElement;
|
|
1066
|
+
const originalRows = textarea.rows;
|
|
1067
|
+
const originalValue = textarea.value;
|
|
1068
|
+
textarea.rows = 1;
|
|
1069
|
+
textarea.value = '';
|
|
1070
|
+
// Force layout
|
|
1071
|
+
this.lineHeight = textarea.scrollHeight;
|
|
1072
|
+
// Restore
|
|
1073
|
+
textarea.rows = originalRows;
|
|
1074
|
+
textarea.value = originalValue;
|
|
1075
|
+
}
|
|
1076
|
+
resize() {
|
|
1077
|
+
const textarea = this.element.nativeElement;
|
|
1078
|
+
textarea.style.height = 'auto';
|
|
1079
|
+
const scrollHeight = textarea.scrollHeight;
|
|
1080
|
+
const minHeight = this.minimumRows() * this.lineHeight;
|
|
1081
|
+
const maxHeight = this.maximumRows() ? this.maximumRows() * this.lineHeight : Infinity;
|
|
1082
|
+
const newHeight = Math.min(Math.max(scrollHeight, minHeight), maxHeight);
|
|
1083
|
+
textarea.style.height = `${newHeight}px`;
|
|
1084
|
+
textarea.style.overflowY = scrollHeight > maxHeight ? 'auto' : 'hidden';
|
|
1085
|
+
}
|
|
1086
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AutoResizeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1087
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: AutoResizeDirective, isStandalone: true, selector: "[stAutoResize]", inputs: { minimumRows: { classPropertyName: "minimumRows", publicName: "minimumRows", isSignal: true, isRequired: false, transformFunction: null }, maximumRows: { classPropertyName: "maximumRows", publicName: "maximumRows", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "input": "onInput()", "window:resize": "onWindowResize()" } }, usesOnChanges: true, ngImport: i0 });
|
|
1088
|
+
}
|
|
1089
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AutoResizeDirective, decorators: [{
|
|
1090
|
+
type: Directive,
|
|
1091
|
+
args: [{
|
|
1092
|
+
selector: '[stAutoResize]',
|
|
1093
|
+
}]
|
|
1094
|
+
}], ctorParameters: () => [], propDecorators: { minimumRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "minimumRows", required: false }] }], maximumRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "maximumRows", required: false }] }], onInput: [{
|
|
1095
|
+
type: HostListener,
|
|
1096
|
+
args: ['input']
|
|
1097
|
+
}], onWindowResize: [{
|
|
1098
|
+
type: HostListener,
|
|
1099
|
+
args: ['window:resize']
|
|
1100
|
+
}] } });
|
|
1101
|
+
|
|
1102
|
+
class PaginationComponent {
|
|
1103
|
+
currentPage = model(1, ...(ngDevMode ? [{ debugName: "currentPage" }] : []));
|
|
1104
|
+
totalPages = input.required(...(ngDevMode ? [{ debugName: "totalPages" }] : []));
|
|
1105
|
+
onPageSelect = output();
|
|
1106
|
+
pageButtons = computed(() => this.calculatePageButtons(this.currentPage(), this.totalPages()), ...(ngDevMode ? [{ debugName: "pageButtons" }] : []));
|
|
1107
|
+
hideNextPreviousAtStartEnd = input(false, ...(ngDevMode ? [{ debugName: "hideNextPreviousAtStartEnd" }] : []));
|
|
1108
|
+
changePage(newPage) {
|
|
1109
|
+
this.currentPage.set(newPage);
|
|
1110
|
+
this.onPageSelect.emit(this.currentPage());
|
|
1111
|
+
}
|
|
1112
|
+
calculatePageButtons(currentPage, totalPages) {
|
|
1113
|
+
const buttons = [];
|
|
1114
|
+
if (totalPages <= 7) {
|
|
1115
|
+
return this.showAllPages(totalPages);
|
|
1116
|
+
}
|
|
1117
|
+
if (currentPage < 4) {
|
|
1118
|
+
return this.showStartingPages(totalPages);
|
|
1119
|
+
}
|
|
1120
|
+
if (currentPage > totalPages - 4) {
|
|
1121
|
+
return this.showEndingPages(totalPages);
|
|
1122
|
+
}
|
|
1123
|
+
buttons.push(this.pageItem(1));
|
|
1124
|
+
buttons.push(this.spaceItem());
|
|
1125
|
+
buttons.push(this.pageItem(currentPage - 1));
|
|
1126
|
+
buttons.push(this.pageItem(currentPage));
|
|
1127
|
+
buttons.push(this.pageItem(currentPage + 1));
|
|
1128
|
+
buttons.push(this.spaceItem());
|
|
1129
|
+
buttons.push(this.pageItem(totalPages));
|
|
1130
|
+
return buttons;
|
|
1131
|
+
}
|
|
1132
|
+
showStartingPages(totalPages) {
|
|
1133
|
+
return [
|
|
1134
|
+
this.pageItem(1),
|
|
1135
|
+
this.pageItem(2),
|
|
1136
|
+
this.pageItem(3),
|
|
1137
|
+
this.pageItem(4),
|
|
1138
|
+
this.spaceItem(),
|
|
1139
|
+
this.pageItem(totalPages - 1),
|
|
1140
|
+
this.pageItem(totalPages),
|
|
1141
|
+
];
|
|
1142
|
+
}
|
|
1143
|
+
showEndingPages(totalPages) {
|
|
1144
|
+
return [
|
|
1145
|
+
this.pageItem(1),
|
|
1146
|
+
this.pageItem(2),
|
|
1147
|
+
this.spaceItem(),
|
|
1148
|
+
this.pageItem(totalPages - 3),
|
|
1149
|
+
this.pageItem(totalPages - 2),
|
|
1150
|
+
this.pageItem(totalPages - 1),
|
|
1151
|
+
this.pageItem(totalPages),
|
|
1152
|
+
];
|
|
1153
|
+
}
|
|
1154
|
+
showAllPages(totalPages) {
|
|
1155
|
+
const buttons = [];
|
|
1156
|
+
for (let i = 1; i <= totalPages; i++) {
|
|
1157
|
+
buttons.push(this.pageItem(i));
|
|
1158
|
+
}
|
|
1159
|
+
return buttons;
|
|
1160
|
+
}
|
|
1161
|
+
spaceItem() {
|
|
1162
|
+
return { page: undefined, text: '...', clickable: false };
|
|
1163
|
+
}
|
|
1164
|
+
pageItem(page) {
|
|
1165
|
+
return {
|
|
1166
|
+
page: page,
|
|
1167
|
+
text: page + '',
|
|
1168
|
+
clickable: true,
|
|
1169
|
+
};
|
|
1170
|
+
}
|
|
1171
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1172
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: PaginationComponent, isStandalone: true, selector: "st-pagination", inputs: { currentPage: { classPropertyName: "currentPage", publicName: "currentPage", isSignal: true, isRequired: false, transformFunction: null }, totalPages: { classPropertyName: "totalPages", publicName: "totalPages", isSignal: true, isRequired: true, transformFunction: null }, hideNextPreviousAtStartEnd: { classPropertyName: "hideNextPreviousAtStartEnd", publicName: "hideNextPreviousAtStartEnd", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { currentPage: "currentPageChange", onPageSelect: "onPageSelect" }, ngImport: i0, template: "<button\n [disabled]=\"currentPage() === 1\"\n [class.clickable]=\"true\"\n [class.hideOnDisabled]=\"hideNextPreviousAtStartEnd()\"\n (click)=\"changePage(currentPage() - 1)\"\n>\n Previous\n</button>\n@for (page of pageButtons(); track page) {\n <button\n [class.selected]=\"page.page === currentPage()\"\n [class.clickable]=\"page.clickable\"\n (click)=\"page.page ? changePage(page.page) : null\"\n >\n {{ page.text }}\n </button>\n}\n<button\n [disabled]=\"currentPage() === totalPages()\"\n (click)=\"changePage(currentPage() + 1)\"\n [class.clickable]=\"true\"\n [class.hideOnDisabled]=\"hideNextPreviousAtStartEnd()\"\n>\n Next\n</button>\n" });
|
|
1173
|
+
}
|
|
1174
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: PaginationComponent, decorators: [{
|
|
1175
|
+
type: Component,
|
|
1176
|
+
args: [{ selector: 'st-pagination', imports: [], template: "<button\n [disabled]=\"currentPage() === 1\"\n [class.clickable]=\"true\"\n [class.hideOnDisabled]=\"hideNextPreviousAtStartEnd()\"\n (click)=\"changePage(currentPage() - 1)\"\n>\n Previous\n</button>\n@for (page of pageButtons(); track page) {\n <button\n [class.selected]=\"page.page === currentPage()\"\n [class.clickable]=\"page.clickable\"\n (click)=\"page.page ? changePage(page.page) : null\"\n >\n {{ page.text }}\n </button>\n}\n<button\n [disabled]=\"currentPage() === totalPages()\"\n (click)=\"changePage(currentPage() + 1)\"\n [class.clickable]=\"true\"\n [class.hideOnDisabled]=\"hideNextPreviousAtStartEnd()\"\n>\n Next\n</button>\n" }]
|
|
1177
|
+
}], propDecorators: { currentPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentPage", required: false }] }, { type: i0.Output, args: ["currentPageChange"] }], totalPages: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalPages", required: true }] }], onPageSelect: [{ type: i0.Output, args: ["onPageSelect"] }], hideNextPreviousAtStartEnd: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideNextPreviousAtStartEnd", required: false }] }] } });
|
|
1178
|
+
|
|
1179
|
+
class CapitalizePipe {
|
|
1180
|
+
static capitalize(value) {
|
|
1181
|
+
return value.substring(0, 1).toLocaleUpperCase() + value.substring(1);
|
|
1182
|
+
}
|
|
1183
|
+
transform(value, ...args) {
|
|
1184
|
+
return CapitalizePipe.capitalize(value);
|
|
1185
|
+
}
|
|
1186
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CapitalizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1187
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: CapitalizePipe, isStandalone: true, name: "capitalize" });
|
|
1188
|
+
}
|
|
1189
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CapitalizePipe, decorators: [{
|
|
1190
|
+
type: Pipe,
|
|
1191
|
+
args: [{
|
|
1192
|
+
name: 'capitalize',
|
|
1193
|
+
standalone: true,
|
|
1194
|
+
pure: true,
|
|
1195
|
+
}]
|
|
1196
|
+
}] });
|
|
1197
|
+
|
|
1198
|
+
class ProgressComponent {
|
|
1199
|
+
min = input(0, ...(ngDevMode ? [{ debugName: "min" }] : []));
|
|
1200
|
+
max = input(100, ...(ngDevMode ? [{ debugName: "max" }] : []));
|
|
1201
|
+
value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1202
|
+
type = input('linear', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
1203
|
+
showLabel = input(true, ...(ngDevMode ? [{ debugName: "showLabel" }] : []));
|
|
1204
|
+
labelFormat = input('percentage', ...(ngDevMode ? [{ debugName: "labelFormat" }] : []));
|
|
1205
|
+
growDirection = input('right', ...(ngDevMode ? [{ debugName: "growDirection" }] : []));
|
|
1206
|
+
size = input(120, ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
1207
|
+
strokeWidth = input(10, ...(ngDevMode ? [{ debugName: "strokeWidth" }] : []));
|
|
1208
|
+
percentage = computed(() => {
|
|
1209
|
+
if (this.max() <= this.min()) {
|
|
1210
|
+
return 0;
|
|
1211
|
+
}
|
|
1212
|
+
const clampedValue = Math.min(Math.max(this.value(), this.min()), this.max());
|
|
1213
|
+
const progressedValue = clampedValue - this.min();
|
|
1214
|
+
const progressableValues = this.max() - this.min();
|
|
1215
|
+
return (progressedValue / progressableValues) * 100;
|
|
1216
|
+
}, ...(ngDevMode ? [{ debugName: "percentage" }] : []));
|
|
1217
|
+
radius = computed(() => (this.size() - this.strokeWidth()) / 2, ...(ngDevMode ? [{ debugName: "radius" }] : []));
|
|
1218
|
+
circumference = computed(() => 2 * Math.PI * this.radius(), ...(ngDevMode ? [{ debugName: "circumference" }] : []));
|
|
1219
|
+
dashOffset = computed(() => this.circumference() * (1 - this.percentage() / 100), ...(ngDevMode ? [{ debugName: "dashOffset" }] : []));
|
|
1220
|
+
get cssClasses() {
|
|
1221
|
+
return [this.type(), `grow-${this.growDirection()}`];
|
|
1222
|
+
}
|
|
1223
|
+
get percentageProperty() {
|
|
1224
|
+
return this.percentage();
|
|
1225
|
+
}
|
|
1226
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ProgressComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1227
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: ProgressComponent, isStandalone: true, selector: "st-progress", inputs: { min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, labelFormat: { classPropertyName: "labelFormat", publicName: "labelFormat", isSignal: true, isRequired: false, transformFunction: null }, growDirection: { classPropertyName: "growDirection", publicName: "growDirection", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, strokeWidth: { classPropertyName: "strokeWidth", publicName: "strokeWidth", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.cssClasses", "style.--st-progress-percentage": "this.percentageProperty" } }, ngImport: i0, template: "@switch (type()) {\n @case (\"linear\") {\n <div class=\"linear-container\">\n <div class=\"linear-bar\" [style.width.%]=\"percentage()\"></div>\n </div>\n\n <ng-container [ngTemplateOutlet]=\"label\"></ng-container>\n }\n @case (\"radial\") {\n <div class=\"radial-container\">\n <svg width=\"100%\" height=\"100%\">\n <circle class=\"background\"></circle>\n\n <circle class=\"progress\" stroke-linecap=\"round\"></circle>\n </svg>\n\n <ng-container [ngTemplateOutlet]=\"label\"></ng-container>\n </div>\n }\n}\n\n<ng-template #label>\n @if (showLabel()) {\n <span class=\"label\">\n @switch (labelFormat()) {\n @case (\"percentage\") {\n {{ percentage() | number: \"1.0-0\" }}%\n }\n @case (\"value\") {\n {{ value() | number: \"1.0-0\" }}\n }\n }\n </span>\n }\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: DecimalPipe, name: "number" }] });
|
|
1228
|
+
}
|
|
1229
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ProgressComponent, decorators: [{
|
|
1230
|
+
type: Component,
|
|
1231
|
+
args: [{ selector: 'st-progress', imports: [DecimalPipe, NgTemplateOutlet], template: "@switch (type()) {\n @case (\"linear\") {\n <div class=\"linear-container\">\n <div class=\"linear-bar\" [style.width.%]=\"percentage()\"></div>\n </div>\n\n <ng-container [ngTemplateOutlet]=\"label\"></ng-container>\n }\n @case (\"radial\") {\n <div class=\"radial-container\">\n <svg width=\"100%\" height=\"100%\">\n <circle class=\"background\"></circle>\n\n <circle class=\"progress\" stroke-linecap=\"round\"></circle>\n </svg>\n\n <ng-container [ngTemplateOutlet]=\"label\"></ng-container>\n </div>\n }\n}\n\n<ng-template #label>\n @if (showLabel()) {\n <span class=\"label\">\n @switch (labelFormat()) {\n @case (\"percentage\") {\n {{ percentage() | number: \"1.0-0\" }}%\n }\n @case (\"value\") {\n {{ value() | number: \"1.0-0\" }}\n }\n }\n </span>\n }\n</ng-template>\n" }]
|
|
1232
|
+
}], propDecorators: { min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], showLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabel", required: false }] }], labelFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelFormat", required: false }] }], growDirection: [{ type: i0.Input, args: [{ isSignal: true, alias: "growDirection", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], strokeWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "strokeWidth", required: false }] }], cssClasses: [{
|
|
1233
|
+
type: HostBinding,
|
|
1234
|
+
args: ['class']
|
|
1235
|
+
}], percentageProperty: [{
|
|
1236
|
+
type: HostBinding,
|
|
1237
|
+
args: ['style.--st-progress-percentage']
|
|
1238
|
+
}] } });
|
|
1239
|
+
|
|
1240
|
+
class SegmentedControlItemComponent {
|
|
1241
|
+
text = input.required(...(ngDevMode ? [{ debugName: "text" }] : []));
|
|
1242
|
+
selected = model(false, ...(ngDevMode ? [{ debugName: "selected" }] : []));
|
|
1243
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
1244
|
+
onSelection = output();
|
|
1245
|
+
get tabIndex() {
|
|
1246
|
+
return this.selected() || this.disabled() ? null : 0;
|
|
1247
|
+
}
|
|
1248
|
+
get disabledAttribute() {
|
|
1249
|
+
return this.disabled() ? true : null;
|
|
1250
|
+
}
|
|
1251
|
+
onClick() {
|
|
1252
|
+
this.selected.set(true);
|
|
1253
|
+
this.onSelection.emit();
|
|
1254
|
+
}
|
|
1255
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SegmentedControlItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1256
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: SegmentedControlItemComponent, isStandalone: true, selector: "st-segmented-control-item", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: true, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selectedChange", onSelection: "onSelection" }, host: { listeners: { "click": "onClick()" }, properties: { "attr.tabindex": "this.tabIndex", "attr.disabled": "this.disabledAttribute" } }, ngImport: i0, template: `{{ text() }} `, isInline: true, styles: [""] });
|
|
1257
|
+
}
|
|
1258
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SegmentedControlItemComponent, decorators: [{
|
|
1259
|
+
type: Component,
|
|
1260
|
+
args: [{ selector: 'st-segmented-control-item', imports: [], template: `{{ text() }} `, host: {
|
|
1261
|
+
'(click)': 'onClick()',
|
|
1262
|
+
} }]
|
|
1263
|
+
}], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: true }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }, { type: i0.Output, args: ["selectedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], onSelection: [{ type: i0.Output, args: ["onSelection"] }], tabIndex: [{
|
|
1264
|
+
type: HostBinding,
|
|
1265
|
+
args: ['attr.tabindex']
|
|
1266
|
+
}], disabledAttribute: [{
|
|
1267
|
+
type: HostBinding,
|
|
1268
|
+
args: ['attr.disabled']
|
|
1269
|
+
}] } });
|
|
1270
|
+
|
|
1271
|
+
class SegmentedControlComponent {
|
|
1272
|
+
segmentItems = contentChildren(SegmentedControlItemComponent, ...(ngDevMode ? [{ debugName: "segmentItems" }] : []));
|
|
1273
|
+
segmentItemsRefs = contentChildren(SegmentedControlItemComponent, { ...(ngDevMode ? { debugName: "segmentItemsRefs" } : {}), read: ElementRef });
|
|
1274
|
+
selectedItem = signal(null, ...(ngDevMode ? [{ debugName: "selectedItem" }] : []));
|
|
1275
|
+
selectedIndex = signal(0, ...(ngDevMode ? [{ debugName: "selectedIndex" }] : []));
|
|
1276
|
+
offset = computed(() => this.widths()[this.selectedIndex()], ...(ngDevMode ? [{ debugName: "offset" }] : []));
|
|
1277
|
+
widths = signal([], ...(ngDevMode ? [{ debugName: "widths" }] : []));
|
|
1278
|
+
ngAfterViewInit() {
|
|
1279
|
+
if (this.segmentItems().length === 0) {
|
|
1280
|
+
return;
|
|
1281
|
+
}
|
|
1282
|
+
const widths = [];
|
|
1283
|
+
for (let i = 0; i < this.segmentItems().length; i++) {
|
|
1284
|
+
widths.push(this.calculateOffset(i));
|
|
1285
|
+
}
|
|
1286
|
+
this.widths.set(widths);
|
|
1287
|
+
for (const item of this.segmentItems()) {
|
|
1288
|
+
item.onSelection.subscribe(() => {
|
|
1289
|
+
this.selectItem(item);
|
|
1290
|
+
});
|
|
1291
|
+
}
|
|
1292
|
+
const initiallySelected = this.segmentItems().find((item) => item.selected());
|
|
1293
|
+
if (!initiallySelected) {
|
|
1294
|
+
const firstItem = this.segmentItems()[0];
|
|
1295
|
+
firstItem.selected.set(true);
|
|
1296
|
+
this.selectItem(firstItem);
|
|
1297
|
+
}
|
|
1298
|
+
else {
|
|
1299
|
+
this.selectItem(initiallySelected);
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
selectItem(selectedItem) {
|
|
1303
|
+
this.selectedItem.set(selectedItem);
|
|
1304
|
+
this.selectedIndex.set(this.segmentItems().indexOf(selectedItem));
|
|
1305
|
+
}
|
|
1306
|
+
calculateOffset(currentIndex) {
|
|
1307
|
+
const elementsBeforeIndex = this.segmentItemsRefs().slice(0, currentIndex) ?? [];
|
|
1308
|
+
if (elementsBeforeIndex.length > 0) {
|
|
1309
|
+
return elementsBeforeIndex
|
|
1310
|
+
.map((element) => element.nativeElement.offsetWidth)
|
|
1311
|
+
.reduce((sum, currentValue) => (sum += currentValue));
|
|
1312
|
+
}
|
|
1313
|
+
return 0;
|
|
1314
|
+
}
|
|
1315
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SegmentedControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1316
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.0", type: SegmentedControlComponent, isStandalone: true, selector: "st-segmented-control", queries: [{ propertyName: "segmentItems", predicate: SegmentedControlItemComponent, isSignal: true }, { propertyName: "segmentItemsRefs", predicate: SegmentedControlItemComponent, read: ElementRef, isSignal: true }], ngImport: i0, template: "<ng-content select=\"st-segmented-control-item\"></ng-content>\n<div class=\"selection-item\" id=\"selection-indicator\" [style.marginLeft]=\"this.offset() + 'px'\">\n {{ this.selectedItem()?.text() }}\n</div>\n" });
|
|
1317
|
+
}
|
|
1318
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SegmentedControlComponent, decorators: [{
|
|
1319
|
+
type: Component,
|
|
1320
|
+
args: [{ selector: 'st-segmented-control', imports: [], template: "<ng-content select=\"st-segmented-control-item\"></ng-content>\n<div class=\"selection-item\" id=\"selection-indicator\" [style.marginLeft]=\"this.offset() + 'px'\">\n {{ this.selectedItem()?.text() }}\n</div>\n" }]
|
|
1321
|
+
}], propDecorators: { segmentItems: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SegmentedControlItemComponent), { isSignal: true }] }], segmentItemsRefs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SegmentedControlItemComponent), { ...{
|
|
1322
|
+
read: ElementRef,
|
|
1323
|
+
}, isSignal: true }] }] } });
|
|
1324
|
+
|
|
1325
|
+
class SliderComponent {
|
|
1326
|
+
wrapper = viewChild.required('wrapper');
|
|
1327
|
+
resizeObserver;
|
|
1328
|
+
value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
|
|
1329
|
+
minimum = input.required(...(ngDevMode ? [{ debugName: "minimum" }] : []));
|
|
1330
|
+
maximum = input.required(...(ngDevMode ? [{ debugName: "maximum" }] : []));
|
|
1331
|
+
step = input(...(ngDevMode ? [undefined, { debugName: "step" }] : []));
|
|
1332
|
+
computedStep = computed(() => this.step() === 'none' || this.step() === undefined ? 'any' : this.step(), ...(ngDevMode ? [{ debugName: "computedStep" }] : []));
|
|
1333
|
+
steps = computed(() => {
|
|
1334
|
+
const step = this.computedStep();
|
|
1335
|
+
if (step === 'any' || step === undefined) {
|
|
1336
|
+
return 0;
|
|
1337
|
+
}
|
|
1338
|
+
return Math.floor((this.maximum() - this.minimum()) / step) + 1;
|
|
1339
|
+
}, ...(ngDevMode ? [{ debugName: "steps" }] : []));
|
|
1340
|
+
isStepped = computed(() => this.computedStep() !== 'any' && this.computedStep() !== undefined && this.computedStep() !== 0, ...(ngDevMode ? [{ debugName: "isStepped" }] : []));
|
|
1341
|
+
ngAfterViewInit() {
|
|
1342
|
+
this.resizeObserver = new ResizeObserver(() => {
|
|
1343
|
+
this.updateTickMath();
|
|
1344
|
+
});
|
|
1345
|
+
this.resizeObserver.observe(this.wrapper().nativeElement);
|
|
1346
|
+
}
|
|
1347
|
+
ngOnDestroy() {
|
|
1348
|
+
this.resizeObserver.disconnect();
|
|
1349
|
+
}
|
|
1350
|
+
updateTickMath() {
|
|
1351
|
+
if (!this.isStepped())
|
|
1352
|
+
return;
|
|
1353
|
+
const wrapperEl = this.wrapper().nativeElement;
|
|
1354
|
+
const sliderWidth = wrapperEl.offsetWidth;
|
|
1355
|
+
const thumbSize = this.getThumbSize(wrapperEl);
|
|
1356
|
+
const usableWidth = sliderWidth - thumbSize;
|
|
1357
|
+
const intervalCount = this.steps() - 1;
|
|
1358
|
+
if (intervalCount <= 0)
|
|
1359
|
+
return;
|
|
1360
|
+
const intervalPx = Math.round(usableWidth / intervalCount);
|
|
1361
|
+
wrapperEl.style.setProperty('--st-slider-usable-width', `${usableWidth}px`);
|
|
1362
|
+
wrapperEl.style.setProperty('--st-slider-interval-px', `${intervalPx}px`);
|
|
1363
|
+
wrapperEl.style.setProperty('--st-slider-thumb-offset', `${thumbSize / 2}px`);
|
|
1364
|
+
}
|
|
1365
|
+
getThumbSize(el) {
|
|
1366
|
+
const styles = getComputedStyle(el);
|
|
1367
|
+
const size = styles.getPropertyValue('--st-slider-thumb-size');
|
|
1368
|
+
return parseFloat(size);
|
|
1369
|
+
}
|
|
1370
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SliderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1371
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.0", type: SliderComponent, isStandalone: true, selector: "st-slider", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, minimum: { classPropertyName: "minimum", publicName: "minimum", isSignal: true, isRequired: true, transformFunction: null }, maximum: { classPropertyName: "maximum", publicName: "maximum", isSignal: true, isRequired: true, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, viewQueries: [{ propertyName: "wrapper", first: true, predicate: ["wrapper"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n #wrapper\n class=\"range-wrapper\"\n [style.--steps]=\"steps()\"\n [class.stepped]=\"isStepped()\"\n>\n <input\n type=\"range\"\n [(ngModel)]=\"value\"\n [min]=\"minimum()\"\n [max]=\"maximum()\"\n [step]=\"computedStep()\"\n />\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.RangeValueAccessor, selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
1372
|
+
}
|
|
1373
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SliderComponent, decorators: [{
|
|
1374
|
+
type: Component,
|
|
1375
|
+
args: [{ selector: 'st-slider', imports: [FormsModule], template: "<div\n #wrapper\n class=\"range-wrapper\"\n [style.--steps]=\"steps()\"\n [class.stepped]=\"isStepped()\"\n>\n <input\n type=\"range\"\n [(ngModel)]=\"value\"\n [min]=\"minimum()\"\n [max]=\"maximum()\"\n [step]=\"computedStep()\"\n />\n</div>\n" }]
|
|
1376
|
+
}], propDecorators: { wrapper: [{ type: i0.ViewChild, args: ['wrapper', { isSignal: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], minimum: [{ type: i0.Input, args: [{ isSignal: true, alias: "minimum", required: true }] }], maximum: [{ type: i0.Input, args: [{ isSignal: true, alias: "maximum", required: true }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }] } });
|
|
1377
|
+
|
|
1378
|
+
class SpinnerComponent {
|
|
1379
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
1380
|
+
get cssClasses() {
|
|
1381
|
+
return [this.size()];
|
|
1382
|
+
}
|
|
1383
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1384
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: SpinnerComponent, isStandalone: true, selector: "st-spinner", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.cssClasses" } }, ngImport: i0, template: "<span class=\"st-spinner\"></span>\n" });
|
|
1385
|
+
}
|
|
1386
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SpinnerComponent, decorators: [{
|
|
1387
|
+
type: Component,
|
|
1388
|
+
args: [{ selector: 'st-spinner', imports: [], template: "<span class=\"st-spinner\"></span>\n" }]
|
|
1389
|
+
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], cssClasses: [{
|
|
1390
|
+
type: HostBinding,
|
|
1391
|
+
args: ['class']
|
|
1392
|
+
}] } });
|
|
1393
|
+
|
|
1394
|
+
class TextStackComponent {
|
|
1395
|
+
overflow = input('truncate', ...(ngDevMode ? [{ debugName: "overflow" }] : []));
|
|
1396
|
+
get cssClasses() {
|
|
1397
|
+
return [this.overflow()];
|
|
1398
|
+
}
|
|
1399
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: TextStackComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1400
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: TextStackComponent, isStandalone: true, selector: "st-text-stack", inputs: { overflow: { classPropertyName: "overflow", publicName: "overflow", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.cssClasses" } }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [""] });
|
|
1401
|
+
}
|
|
1402
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: TextStackComponent, decorators: [{
|
|
1403
|
+
type: Component,
|
|
1404
|
+
args: [{ selector: 'st-text-stack', imports: [], template: "<ng-content></ng-content>\n" }]
|
|
1405
|
+
}], propDecorators: { overflow: [{ type: i0.Input, args: [{ isSignal: true, alias: "overflow", required: false }] }], cssClasses: [{
|
|
1406
|
+
type: HostBinding,
|
|
1407
|
+
args: ['class']
|
|
1408
|
+
}] } });
|
|
1409
|
+
|
|
1410
|
+
class ThemeDirective {
|
|
1411
|
+
element = inject(ElementRef);
|
|
1412
|
+
stTheme = input.required(...(ngDevMode ? [{ debugName: "stTheme" }] : []));
|
|
1413
|
+
constructor() {
|
|
1414
|
+
effect(() => {
|
|
1415
|
+
const theme = this.stTheme();
|
|
1416
|
+
const el = this.element.nativeElement;
|
|
1417
|
+
// remove previous theme classes
|
|
1418
|
+
el.classList.forEach((cls) => {
|
|
1419
|
+
if (cls.startsWith('st-theme-')) {
|
|
1420
|
+
el.classList.remove(cls);
|
|
1421
|
+
}
|
|
1422
|
+
});
|
|
1423
|
+
el.classList.add(`st-theme-${theme}`);
|
|
1424
|
+
});
|
|
1425
|
+
}
|
|
1426
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ThemeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1427
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: ThemeDirective, isStandalone: true, selector: "[stTheme]", inputs: { stTheme: { classPropertyName: "stTheme", publicName: "stTheme", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
|
|
1428
|
+
}
|
|
1429
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ThemeDirective, decorators: [{
|
|
1430
|
+
type: Directive,
|
|
1431
|
+
args: [{
|
|
1432
|
+
selector: '[stTheme]',
|
|
1433
|
+
standalone: true,
|
|
1434
|
+
}]
|
|
1435
|
+
}], ctorParameters: () => [], propDecorators: { stTheme: [{ type: i0.Input, args: [{ isSignal: true, alias: "stTheme", required: true }] }] } });
|
|
1436
|
+
|
|
1437
|
+
class Stack {
|
|
1438
|
+
items = [];
|
|
1439
|
+
push(item) {
|
|
1440
|
+
this.items.push(item);
|
|
1441
|
+
}
|
|
1442
|
+
pop() {
|
|
1443
|
+
const lastItem = this.items.pop();
|
|
1444
|
+
if (lastItem === undefined) {
|
|
1445
|
+
throw new Error();
|
|
1446
|
+
}
|
|
1447
|
+
return lastItem;
|
|
1448
|
+
}
|
|
1449
|
+
peek() {
|
|
1450
|
+
return this.items[this.items.length - 1];
|
|
1451
|
+
}
|
|
1452
|
+
empty() {
|
|
1453
|
+
return this.items.length === 0;
|
|
1454
|
+
}
|
|
1455
|
+
size() {
|
|
1456
|
+
return this.items.length;
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
class ModalService {
|
|
1461
|
+
stack = new Stack();
|
|
1462
|
+
currentModals = new BehaviorSubject(this.stack);
|
|
1463
|
+
showModal(config) {
|
|
1464
|
+
this.stack.push({
|
|
1465
|
+
...config,
|
|
1466
|
+
id: crypto.randomUUID(),
|
|
1467
|
+
size: config.size ?? 'md',
|
|
1468
|
+
});
|
|
1469
|
+
this.currentModals.next(this.stack);
|
|
1470
|
+
}
|
|
1471
|
+
showAlert(config, callback) {
|
|
1472
|
+
this.showModal({
|
|
1473
|
+
component: AlertContentComponent,
|
|
1474
|
+
size: 'xs',
|
|
1475
|
+
hideCloseButton: true,
|
|
1476
|
+
onModalClosed: callback,
|
|
1477
|
+
disableBackdropClosure: true,
|
|
1478
|
+
inputs: {
|
|
1479
|
+
title: config.title,
|
|
1480
|
+
message: config.message,
|
|
1481
|
+
affirmativeButton: config.affirmativeButton,
|
|
1482
|
+
cancelButton: config.cancelButton,
|
|
1483
|
+
theme: config.theme,
|
|
1484
|
+
icon: config.icon,
|
|
1485
|
+
},
|
|
1486
|
+
});
|
|
1487
|
+
}
|
|
1488
|
+
closeCurrentModal(value) {
|
|
1489
|
+
const currentModal = this.stack.pop();
|
|
1490
|
+
this.currentModals.next(this.stack);
|
|
1491
|
+
if (currentModal.onModalClosed) {
|
|
1492
|
+
currentModal.onModalClosed(value);
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ModalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1496
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ModalService, providedIn: 'root' });
|
|
1497
|
+
}
|
|
1498
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ModalService, decorators: [{
|
|
1499
|
+
type: Injectable,
|
|
1500
|
+
args: [{
|
|
1501
|
+
providedIn: 'root',
|
|
1502
|
+
}]
|
|
1503
|
+
}] });
|
|
1504
|
+
|
|
1505
|
+
class AlertContentComponent {
|
|
1506
|
+
modalService;
|
|
1507
|
+
title = input.required(...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
1508
|
+
message = input(...(ngDevMode ? [undefined, { debugName: "message" }] : []));
|
|
1509
|
+
icon = input(undefined, ...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
1510
|
+
computedIcon = computed(() => {
|
|
1511
|
+
return this.icon() ?? '';
|
|
1512
|
+
}, ...(ngDevMode ? [{ debugName: "computedIcon" }] : []));
|
|
1513
|
+
theme = input('info', ...(ngDevMode ? [{ debugName: "theme" }] : []));
|
|
1514
|
+
affirmativeButton = input.required(...(ngDevMode ? [{ debugName: "affirmativeButton" }] : []));
|
|
1515
|
+
cancelButton = input(undefined, ...(ngDevMode ? [{ debugName: "cancelButton" }] : []));
|
|
1516
|
+
constructor(modalService) {
|
|
1517
|
+
this.modalService = modalService;
|
|
1518
|
+
}
|
|
1519
|
+
onAffirmation() {
|
|
1520
|
+
this.modalService.closeCurrentModal(true);
|
|
1521
|
+
}
|
|
1522
|
+
onCancel() {
|
|
1523
|
+
this.modalService.closeCurrentModal(false);
|
|
1524
|
+
}
|
|
1525
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AlertContentComponent, deps: [{ token: ModalService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1526
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: AlertContentComponent, isStandalone: true, selector: "st-alert-content", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, affirmativeButton: { classPropertyName: "affirmativeButton", publicName: "affirmativeButton", isSignal: true, isRequired: true, transformFunction: null }, cancelButton: { classPropertyName: "cancelButton", publicName: "cancelButton", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"alert-content\">\n @if (icon() !== undefined) {\n <st-avatar size=\"lg\" [stTheme]=\"theme()\">\n <st-icon [name]=\"computedIcon()\"></st-icon>\n </st-avatar>\n }\n\n <p class=\"alert-title\">{{ title() }}</p>\n @if (message()) {\n <p class=\"alert-message\">{{ message() }}</p>\n }\n</div>\n<st-button-group justification=\"expand\">\n @if (cancelButton()) {\n <button stButton (click)=\"onCancel()\">{{ cancelButton() }}</button>\n }\n <button stButton [stTheme]=\"theme()\" variant=\"primary\" (click)=\"onAffirmation()\">{{ affirmativeButton() }}</button>\n</st-button-group>\n", dependencies: [{ kind: "component", type: AvatarComponent, selector: "st-avatar", inputs: ["text", "size"], outputs: ["sizeChange"] }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["name", "size"], outputs: ["sizeChange"] }, { kind: "directive", type: ThemeDirective, selector: "[stTheme]", inputs: ["stTheme"] }, { kind: "component", type: ButtonGroupComponent, selector: "st-button-group", inputs: ["justification"] }, { kind: "directive", type: ButtonDirective, selector: "[stButton]", inputs: ["variant", "size", "fullWidth"] }] });
|
|
1527
|
+
}
|
|
1528
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AlertContentComponent, decorators: [{
|
|
1529
|
+
type: Component,
|
|
1530
|
+
args: [{ selector: 'st-alert-content', imports: [AvatarComponent, IconComponent, ThemeDirective, ButtonGroupComponent, ButtonDirective], template: "<div class=\"alert-content\">\n @if (icon() !== undefined) {\n <st-avatar size=\"lg\" [stTheme]=\"theme()\">\n <st-icon [name]=\"computedIcon()\"></st-icon>\n </st-avatar>\n }\n\n <p class=\"alert-title\">{{ title() }}</p>\n @if (message()) {\n <p class=\"alert-message\">{{ message() }}</p>\n }\n</div>\n<st-button-group justification=\"expand\">\n @if (cancelButton()) {\n <button stButton (click)=\"onCancel()\">{{ cancelButton() }}</button>\n }\n <button stButton [stTheme]=\"theme()\" variant=\"primary\" (click)=\"onAffirmation()\">{{ affirmativeButton() }}</button>\n</st-button-group>\n" }]
|
|
1531
|
+
}], ctorParameters: () => [{ type: ModalService }], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], theme: [{ type: i0.Input, args: [{ isSignal: true, alias: "theme", required: false }] }], affirmativeButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "affirmativeButton", required: true }] }], cancelButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelButton", required: false }] }] } });
|
|
1532
|
+
|
|
1533
|
+
class ModalHeaderComponent {
|
|
1534
|
+
modalService = inject(ModalService);
|
|
1535
|
+
title = input(null, ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
1536
|
+
showCloseButton = input(true, ...(ngDevMode ? [{ debugName: "showCloseButton" }] : []));
|
|
1537
|
+
onCloseButtonClicked(event) {
|
|
1538
|
+
this.modalService.closeCurrentModal();
|
|
1539
|
+
event.stopPropagation();
|
|
1540
|
+
}
|
|
1541
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ModalHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1542
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: ModalHeaderComponent, isStandalone: true, selector: "st-modal-header", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, showCloseButton: { classPropertyName: "showCloseButton", publicName: "showCloseButton", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (title()) {\n <h3>{{ title() }}</h3>\n}\n@if (showCloseButton()) {\n <button stButton (click)=\"onCloseButtonClicked($event)\" variant=\"ghost\">\n <st-icon name=\"close\" size=\"sm\"></st-icon>\n </button>\n}\n", dependencies: [{ kind: "directive", type: ButtonDirective, selector: "[stButton]", inputs: ["variant", "size", "fullWidth"] }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["name", "size"], outputs: ["sizeChange"] }] });
|
|
1543
|
+
}
|
|
1544
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ModalHeaderComponent, decorators: [{
|
|
1545
|
+
type: Component,
|
|
1546
|
+
args: [{ selector: 'st-modal-header', imports: [ButtonDirective, IconComponent, ButtonDirective], template: "@if (title()) {\n <h3>{{ title() }}</h3>\n}\n@if (showCloseButton()) {\n <button stButton (click)=\"onCloseButtonClicked($event)\" variant=\"ghost\">\n <st-icon name=\"close\" size=\"sm\"></st-icon>\n </button>\n}\n" }]
|
|
1547
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], showCloseButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCloseButton", required: false }] }] } });
|
|
1548
|
+
|
|
1549
|
+
class ModalComponent {
|
|
1550
|
+
modalContents = viewChild.required('modalBody', {
|
|
1551
|
+
read: ViewContainerRef,
|
|
1552
|
+
});
|
|
1553
|
+
configuration = input.required(...(ngDevMode ? [{ debugName: "configuration" }] : []));
|
|
1554
|
+
size = model('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
1555
|
+
get sizeClass() {
|
|
1556
|
+
return `st-modal-size-${this.size()}`;
|
|
1557
|
+
}
|
|
1558
|
+
ngAfterViewInit() {
|
|
1559
|
+
if (this.size() === undefined) {
|
|
1560
|
+
this.size.set('md');
|
|
1561
|
+
}
|
|
1562
|
+
const injectedComponent = this.modalContents().createComponent(this.configuration().component);
|
|
1563
|
+
if (this.configuration().inputs) {
|
|
1564
|
+
this.setInputsOnInjectedComponent(injectedComponent, this.configuration().inputs);
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
setInputsOnInjectedComponent(injectedComponent, inputs) {
|
|
1568
|
+
Object.keys(inputs).forEach((key) => {
|
|
1569
|
+
injectedComponent.setInput(key, inputs[key]);
|
|
1570
|
+
});
|
|
1571
|
+
}
|
|
1572
|
+
onCardClick(event) {
|
|
1573
|
+
event.stopPropagation();
|
|
1574
|
+
}
|
|
1575
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1576
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: ModalComponent, isStandalone: true, selector: "st-modal", inputs: { configuration: { classPropertyName: "configuration", publicName: "configuration", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { size: "sizeChange" }, host: { properties: { "class": "this.sizeClass" } }, viewQueries: [{ propertyName: "modalContents", first: true, predicate: ["modalBody"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "@if (configuration().title || !configuration().hideCloseButton) {\n <st-modal-header\n [title]=\"configuration().title\"\n [showCloseButton]=\"configuration().hideCloseButton === true ? false : true\"\n (click)=\"onCardClick($event)\"></st-modal-header>\n}\n\n<div class=\"modal-content\">\n <ng-template #modalBody></ng-template>\n</div>\n", dependencies: [{ kind: "component", type: ModalHeaderComponent, selector: "st-modal-header", inputs: ["title", "showCloseButton"] }] });
|
|
1577
|
+
}
|
|
1578
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ModalComponent, decorators: [{
|
|
1579
|
+
type: Component,
|
|
1580
|
+
args: [{ selector: 'st-modal', imports: [ModalHeaderComponent], template: "@if (configuration().title || !configuration().hideCloseButton) {\n <st-modal-header\n [title]=\"configuration().title\"\n [showCloseButton]=\"configuration().hideCloseButton === true ? false : true\"\n (click)=\"onCardClick($event)\"></st-modal-header>\n}\n\n<div class=\"modal-content\">\n <ng-template #modalBody></ng-template>\n</div>\n" }]
|
|
1581
|
+
}], propDecorators: { modalContents: [{ type: i0.ViewChild, args: ['modalBody', { ...{
|
|
1582
|
+
read: ViewContainerRef,
|
|
1583
|
+
}, isSignal: true }] }], configuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "configuration", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }, { type: i0.Output, args: ["sizeChange"] }], sizeClass: [{
|
|
1584
|
+
type: HostBinding,
|
|
1585
|
+
args: ['class']
|
|
1586
|
+
}] } });
|
|
1587
|
+
|
|
1588
|
+
class ModalContainerComponent {
|
|
1589
|
+
modalService;
|
|
1590
|
+
injectedComponent;
|
|
1591
|
+
currentModal = null;
|
|
1592
|
+
stack = new Stack();
|
|
1593
|
+
subscription;
|
|
1594
|
+
constructor(modalService) {
|
|
1595
|
+
this.modalService = modalService;
|
|
1596
|
+
this.subscription = this.modalService['currentModals'].asObservable().subscribe((modalStack) => {
|
|
1597
|
+
this.stack = modalStack;
|
|
1598
|
+
});
|
|
1599
|
+
}
|
|
1600
|
+
ngOnDestroy() {
|
|
1601
|
+
this.subscription.unsubscribe();
|
|
1602
|
+
}
|
|
1603
|
+
onBackdropClick(event) {
|
|
1604
|
+
event.stopPropagation();
|
|
1605
|
+
const currentModal = this.stack.peek();
|
|
1606
|
+
if (currentModal.disableBackdropClosure) {
|
|
1607
|
+
return;
|
|
1608
|
+
}
|
|
1609
|
+
this.modalService.closeCurrentModal();
|
|
1610
|
+
}
|
|
1611
|
+
stackTrack(index, item) {
|
|
1612
|
+
return item.id;
|
|
1613
|
+
}
|
|
1614
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ModalContainerComponent, deps: [{ token: ModalService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1615
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: ModalContainerComponent, isStandalone: true, selector: "st-modal-container", ngImport: i0, template: "<div class=\"modal-wrapper\">\n @for (modal of stack.items; track modal.id; let last = $last) {\n <st-modal [ngClass]=\"{ 'hidden-under-other-modal': !last }\" [configuration]=\"modal\" [size]=\"modal.size\"> </st-modal>\n }\n</div>\n@if (!stack.empty()) {\n <div class=\"st-internal-backdrop active\" (click)=\"onBackdropClick($event)\"></div>\n}\n", dependencies: [{ kind: "component", type: ModalComponent, selector: "st-modal", inputs: ["configuration", "size"], outputs: ["sizeChange"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
1616
|
+
}
|
|
1617
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ModalContainerComponent, decorators: [{
|
|
1618
|
+
type: Component,
|
|
1619
|
+
args: [{ selector: 'st-modal-container', imports: [ModalComponent, CommonModule], template: "<div class=\"modal-wrapper\">\n @for (modal of stack.items; track modal.id; let last = $last) {\n <st-modal [ngClass]=\"{ 'hidden-under-other-modal': !last }\" [configuration]=\"modal\" [size]=\"modal.size\"> </st-modal>\n }\n</div>\n@if (!stack.empty()) {\n <div class=\"st-internal-backdrop active\" (click)=\"onBackdropClick($event)\"></div>\n}\n" }]
|
|
1620
|
+
}], ctorParameters: () => [{ type: ModalService }] });
|
|
1621
|
+
|
|
1622
|
+
const DEFAULT_THEME = 'info';
|
|
1623
|
+
const DEFAULT_DURATION = 3000;
|
|
1624
|
+
|
|
1625
|
+
class NotificationService {
|
|
1626
|
+
notificationStack = signal([], ...(ngDevMode ? [{ debugName: "notificationStack" }] : []));
|
|
1627
|
+
showNotification(config) {
|
|
1628
|
+
const newNotificationId = crypto.randomUUID();
|
|
1629
|
+
const duration = config.duration ?? DEFAULT_DURATION;
|
|
1630
|
+
const currentStack = this.notificationStack();
|
|
1631
|
+
currentStack.push({
|
|
1632
|
+
id: newNotificationId,
|
|
1633
|
+
message: config.message,
|
|
1634
|
+
duration: duration,
|
|
1635
|
+
theme: config.theme ?? DEFAULT_THEME,
|
|
1636
|
+
icon: config.icon,
|
|
1637
|
+
});
|
|
1638
|
+
this.notificationStack.set(currentStack);
|
|
1639
|
+
this.hideNotification(newNotificationId, duration);
|
|
1640
|
+
}
|
|
1641
|
+
hideNotification(notificationId, duration) {
|
|
1642
|
+
setTimeout(() => {
|
|
1643
|
+
const currentStack = this.notificationStack().filter((notification) => notification.id !== notificationId);
|
|
1644
|
+
this.notificationStack.set(currentStack);
|
|
1645
|
+
}, duration);
|
|
1646
|
+
}
|
|
1647
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1648
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NotificationService, providedIn: 'root' });
|
|
1649
|
+
}
|
|
1650
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NotificationService, decorators: [{
|
|
1651
|
+
type: Injectable,
|
|
1652
|
+
args: [{
|
|
1653
|
+
providedIn: 'root',
|
|
1654
|
+
}]
|
|
1655
|
+
}] });
|
|
1656
|
+
|
|
1657
|
+
class NotificationComponent {
|
|
1658
|
+
icon;
|
|
1659
|
+
message;
|
|
1660
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NotificationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1661
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: NotificationComponent, isStandalone: true, selector: "st-notification", inputs: { icon: "icon", message: "message" }, ngImport: i0, template: "@if (icon) {\n <st-icon [name]=\"icon\"></st-icon>\n}\n{{ message }}\n", dependencies: [{ kind: "component", type: IconComponent, selector: "st-icon", inputs: ["name", "size"], outputs: ["sizeChange"] }] });
|
|
1662
|
+
}
|
|
1663
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NotificationComponent, decorators: [{
|
|
1664
|
+
type: Component,
|
|
1665
|
+
args: [{ selector: 'st-notification', imports: [IconComponent], template: "@if (icon) {\n <st-icon [name]=\"icon\"></st-icon>\n}\n{{ message }}\n" }]
|
|
1666
|
+
}], propDecorators: { icon: [{
|
|
1667
|
+
type: Input
|
|
1668
|
+
}], message: [{
|
|
1669
|
+
type: Input
|
|
1670
|
+
}] } });
|
|
1671
|
+
|
|
1672
|
+
class NotificationContainerComponent {
|
|
1673
|
+
notificationService = inject(NotificationService);
|
|
1674
|
+
notifications = this.notificationService.notificationStack;
|
|
1675
|
+
constructor() { }
|
|
1676
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NotificationContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1677
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: NotificationContainerComponent, isStandalone: true, selector: "st-notification-container", ngImport: i0, template: "@for (notification of notifications(); track notification.id) {\n <st-notification [icon]=\"notification.icon\" [message]=\"notification.message\" [stTheme]=\"notification.theme ?? 'info'\">\n </st-notification>\n}\n", dependencies: [{ kind: "component", type: NotificationComponent, selector: "st-notification", inputs: ["icon", "message"] }, { kind: "directive", type: ThemeDirective, selector: "[stTheme]", inputs: ["stTheme"] }] });
|
|
1678
|
+
}
|
|
1679
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NotificationContainerComponent, decorators: [{
|
|
1680
|
+
type: Component,
|
|
1681
|
+
args: [{ selector: 'st-notification-container', imports: [NotificationComponent, ThemeDirective], template: "@for (notification of notifications(); track notification.id) {\n <st-notification [icon]=\"notification.icon\" [message]=\"notification.message\" [stTheme]=\"notification.theme ?? 'info'\">\n </st-notification>\n}\n" }]
|
|
1682
|
+
}], ctorParameters: () => [] });
|
|
1683
|
+
|
|
1684
|
+
class NumberDisplayComponent {
|
|
1685
|
+
locale = inject(LOCALE_ID);
|
|
1686
|
+
value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1687
|
+
decimals = input(2, ...(ngDevMode ? [{ debugName: "decimals" }] : []));
|
|
1688
|
+
digitsInfo = computed(() => {
|
|
1689
|
+
return `1.${this.decimals()}-${this.decimals()}`;
|
|
1690
|
+
}, ...(ngDevMode ? [{ debugName: "digitsInfo" }] : []));
|
|
1691
|
+
formattedNumber = computed(() => formatNumber(this.value(), this.locale, this.digitsInfo()), ...(ngDevMode ? [{ debugName: "formattedNumber" }] : []));
|
|
1692
|
+
separatedDigits = computed(() => {
|
|
1693
|
+
const parts = this.formattedNumber().split(this.decimalPoint());
|
|
1694
|
+
return {
|
|
1695
|
+
integer: parts[0],
|
|
1696
|
+
decimals: parts[1] ?? undefined,
|
|
1697
|
+
};
|
|
1698
|
+
}, ...(ngDevMode ? [{ debugName: "separatedDigits" }] : []));
|
|
1699
|
+
changedValue = input(false, ...(ngDevMode ? [{ debugName: "changedValue" }] : []));
|
|
1700
|
+
showPlus = input(false, ...(ngDevMode ? [{ debugName: "showPlus" }] : []));
|
|
1701
|
+
deemphasizeDecimals = input(true, ...(ngDevMode ? [{ debugName: "deemphasizeDecimals" }] : []));
|
|
1702
|
+
decimalPoint = computed(() => getLocaleNumberSymbol(this.locale, NumberSymbol.Decimal), ...(ngDevMode ? [{ debugName: "decimalPoint" }] : []));
|
|
1703
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NumberDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1704
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: NumberDisplayComponent, isStandalone: true, selector: "st-number-display", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, decimals: { classPropertyName: "decimals", publicName: "decimals", isSignal: true, isRequired: false, transformFunction: null }, changedValue: { classPropertyName: "changedValue", publicName: "changedValue", isSignal: true, isRequired: false, transformFunction: null }, showPlus: { classPropertyName: "showPlus", publicName: "showPlus", isSignal: true, isRequired: false, transformFunction: null }, deemphasizeDecimals: { classPropertyName: "deemphasizeDecimals", publicName: "deemphasizeDecimals", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<p\n [ngClass]=\"{\n positive: changedValue() && value() > 0,\n negative: changedValue() && value() < 0,\n }\"\n>\n @if (showPlus() && this.value() > 0) {\n +\n }\n <span class=\"integer-value\">{{ separatedDigits().integer }}</span>\n @if (separatedDigits().decimals) {\n <span\n class=\"decimal-number\"\n [ngClass]=\"{ deemphasize: deemphasizeDecimals }\"\n >{{ decimalPoint() }}{{ separatedDigits().decimals }}</span\n >\n }\n</p>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
1705
|
+
}
|
|
1706
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NumberDisplayComponent, decorators: [{
|
|
1707
|
+
type: Component,
|
|
1708
|
+
args: [{ selector: 'st-number-display', imports: [CommonModule], template: "<p\n [ngClass]=\"{\n positive: changedValue() && value() > 0,\n negative: changedValue() && value() < 0,\n }\"\n>\n @if (showPlus() && this.value() > 0) {\n +\n }\n <span class=\"integer-value\">{{ separatedDigits().integer }}</span>\n @if (separatedDigits().decimals) {\n <span\n class=\"decimal-number\"\n [ngClass]=\"{ deemphasize: deemphasizeDecimals }\"\n >{{ decimalPoint() }}{{ separatedDigits().decimals }}</span\n >\n }\n</p>\n" }]
|
|
1709
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], decimals: [{ type: i0.Input, args: [{ isSignal: true, alias: "decimals", required: false }] }], changedValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "changedValue", required: false }] }], showPlus: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPlus", required: false }] }], deemphasizeDecimals: [{ type: i0.Input, args: [{ isSignal: true, alias: "deemphasizeDecimals", required: false }] }] } });
|
|
1710
|
+
|
|
1711
|
+
/*
|
|
1712
|
+
* Public API Surface of ngx-strata
|
|
1713
|
+
*/
|
|
1714
|
+
|
|
1715
|
+
/**
|
|
1716
|
+
* Generated bundle index. Do not edit.
|
|
1717
|
+
*/
|
|
1718
|
+
|
|
1719
|
+
export { AccordionGroupComponent, AccordionItemComponent, ActionMenuComponent, ActionMenuItemComponent, AlertContentComponent, AutoResizeDirective, AvatarComponent, AvatarStackComponent, ButtonDirective, ButtonGroupComponent, CapitalizePipe, CardComponent, CheckboxComponent, DEFAULT_DURATION, DEFAULT_THEME, DarkmodeService, DividerComponent, DropdownComponent, HttpIconLoader, IconComponent, IconLoader, IconRegistry, IconRegistryService, InputFieldComponent, ItemComponent, ItemListComponent, ModalComponent, ModalContainerComponent, ModalHeaderComponent, ModalService, NativeInputRefDirective, NotificationComponent, NotificationContainerComponent, NotificationService, NumberDisplayComponent, OverlayDirective, PaginationComponent, ProgressComponent, STRATA_CONFIG, SegmentedControlComponent, SegmentedControlItemComponent, SliderComponent, SpinnerComponent, TagComponent, TextStackComponent, ThemeDirective, ToggleComponent, TooltipDirective, provideBaseIcons, provideIcons, provideStrata };
|
|
1720
|
+
//# sourceMappingURL=ngx-strata.mjs.map
|