matcha-components 19.49.0 → 19.51.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/fesm2022/matcha-components.mjs +151 -54
- package/fesm2022/matcha-components.mjs.map +1 -1
- package/lib/matcha-button-group/button-group/button-group.component.d.ts +10 -1
- package/lib/matcha-button-group/button-item/button-item.component.d.ts +1 -2
- package/lib/matcha-form-field/matcha-form-field/matcha-form-field.component.d.ts +11 -1
- package/lib/matcha-spin/spin/spin.component.d.ts +14 -2
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { ElementRef, Renderer2, Input, Inject, Component, EventEmitter, ContentChild, Output, ContentChildren, HostBinding, HostListener, Directive, forwardRef, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
3
5
|
import { animation, style, animate, trigger, transition, useAnimation, state, query, stagger, animateChild, sequence, group } from '@angular/animations';
|
|
4
6
|
import { Subscription, Subject } from 'rxjs';
|
|
5
7
|
import { debounceTime } from 'rxjs/operators';
|
|
6
|
-
import
|
|
7
|
-
import { CommonModule } from '@angular/common';
|
|
8
|
-
import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
8
|
+
import { FormControlName, NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
9
9
|
|
|
10
10
|
class MatchaButtonComponent {
|
|
11
11
|
constructor(_elementRef, _renderer) {
|
|
@@ -201,34 +201,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
|
|
|
201
201
|
class MatchaButtonItemComponent {
|
|
202
202
|
constructor(renderer) {
|
|
203
203
|
this.renderer = renderer;
|
|
204
|
-
// Propriedade que indica se o botão está ativo
|
|
205
204
|
this.active = false;
|
|
206
|
-
// Evento emitido quando o botão for clicado
|
|
207
205
|
this.selected = new EventEmitter();
|
|
208
206
|
}
|
|
209
207
|
ngAfterContentInit() {
|
|
210
|
-
// Atualiza a cor inicial do botão conforme o estado
|
|
211
|
-
this.updateButtonColor();
|
|
212
|
-
// Registra o clique no botão interno
|
|
213
208
|
if (this.innerButton) {
|
|
214
|
-
this.renderer.listen(this.innerButton.nativeElement, 'click', () =>
|
|
215
|
-
this.onClick();
|
|
216
|
-
});
|
|
209
|
+
this.renderer.listen(this.innerButton.nativeElement, 'click', () => this.onClick());
|
|
217
210
|
}
|
|
218
211
|
}
|
|
219
212
|
onClick() {
|
|
220
213
|
this.selected.emit();
|
|
221
214
|
}
|
|
222
|
-
|
|
223
|
-
setActiveState(isActive, activeColor, inactiveColor) {
|
|
215
|
+
setActiveState(isActive, activeColor, inactiveColor, activeType, inactiveType) {
|
|
224
216
|
this.active = isActive;
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
this.renderer.setAttribute(this.innerButton.nativeElement, '
|
|
217
|
+
const color = isActive ? activeColor : inactiveColor;
|
|
218
|
+
const type = isActive ? activeType : inactiveType;
|
|
219
|
+
// Aplica a cor correta ao botão interno
|
|
220
|
+
this.renderer.setAttribute(this.innerButton.nativeElement, 'color', color);
|
|
221
|
+
// Limpa todos os tipos anteriores
|
|
222
|
+
['basic', 'outline', 'alpha', 'pill'].forEach(attr => {
|
|
223
|
+
this.renderer.setAttribute(this.innerButton.nativeElement, attr, 'false');
|
|
224
|
+
});
|
|
225
|
+
// Aplica o tipo correto ao botão interno se houver algum
|
|
226
|
+
if (type) {
|
|
227
|
+
this.renderer.setAttribute(this.innerButton.nativeElement, type, 'true');
|
|
232
228
|
}
|
|
233
229
|
}
|
|
234
230
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: MatchaButtonItemComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -246,59 +242,79 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
|
|
|
246
242
|
args: [MatchaButtonComponent, { static: true, read: ElementRef }]
|
|
247
243
|
}] } });
|
|
248
244
|
|
|
249
|
-
// button-group.component.ts
|
|
250
245
|
class MatchaButtonGroupComponent {
|
|
251
246
|
constructor() {
|
|
252
247
|
this._multiple = false;
|
|
253
|
-
|
|
248
|
+
this._disabled = false;
|
|
254
249
|
this.activeColor = 'blue';
|
|
255
|
-
this.inactiveColor = '
|
|
250
|
+
this.inactiveColor = 'disabled';
|
|
251
|
+
this.activeType = '';
|
|
252
|
+
this.inactiveType = 'basic';
|
|
253
|
+
this._gap = 16;
|
|
256
254
|
}
|
|
257
255
|
get multiple() {
|
|
258
256
|
return this._multiple;
|
|
259
257
|
}
|
|
260
258
|
set multiple(value) {
|
|
261
|
-
// Converte string 'false' para boolean false
|
|
262
|
-
// Qualquer outro valor string será convertido para true
|
|
263
259
|
this._multiple = value === 'false' ? false : Boolean(value);
|
|
264
260
|
}
|
|
261
|
+
get disabled() {
|
|
262
|
+
return this._disabled;
|
|
263
|
+
}
|
|
264
|
+
set disabled(value) {
|
|
265
|
+
this._disabled = value === 'false' ? false : Boolean(value);
|
|
266
|
+
}
|
|
267
|
+
get isDisabled() {
|
|
268
|
+
return this.disabled || null;
|
|
269
|
+
}
|
|
270
|
+
set gap(value) {
|
|
271
|
+
const numericGap = Number(value);
|
|
272
|
+
this._gap = isNaN(numericGap) ? 16 : numericGap;
|
|
273
|
+
}
|
|
274
|
+
get gapClass() {
|
|
275
|
+
return `gap-${this._gap}`;
|
|
276
|
+
}
|
|
265
277
|
ngAfterContentInit() {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
item.setActiveState(
|
|
270
|
-
// Inscreve-se para saber quando algum item for selecionado
|
|
278
|
+
this.buttonItems.forEach((item, index) => {
|
|
279
|
+
const isFirst = index === 0;
|
|
280
|
+
// Opcionalmente, primeiro botão pode iniciar ativo por padrão
|
|
281
|
+
item.setActiveState(isFirst, this.activeColor, this.inactiveColor, this.activeType, this.inactiveType);
|
|
271
282
|
item.selected.subscribe(() => this.onItemSelected(item));
|
|
272
283
|
});
|
|
273
|
-
// Opcional: define o primeiro item como ativo por padrão
|
|
274
|
-
if (this.buttonItems.first) {
|
|
275
|
-
this.buttonItems.first.setActiveState(true, this.activeColor, this.inactiveColor);
|
|
276
|
-
}
|
|
277
284
|
}
|
|
278
285
|
onItemSelected(selectedItem) {
|
|
279
286
|
if (this.multiple) {
|
|
280
|
-
|
|
281
|
-
selectedItem.setActiveState(!selectedItem.active, this.activeColor, this.inactiveColor);
|
|
287
|
+
selectedItem.setActiveState(!selectedItem.active, this.activeColor, this.inactiveColor, this.activeType, this.inactiveType);
|
|
282
288
|
}
|
|
283
289
|
else {
|
|
284
|
-
// Se único, desativa todos e ativa somente o item clicado
|
|
285
290
|
this.buttonItems.forEach(item => {
|
|
286
|
-
item.setActiveState(item === selectedItem, this.activeColor, this.inactiveColor);
|
|
291
|
+
item.setActiveState(item === selectedItem, this.activeColor, this.inactiveColor, this.activeType, this.inactiveType);
|
|
287
292
|
});
|
|
288
293
|
}
|
|
289
294
|
}
|
|
290
295
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: MatchaButtonGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
291
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: MatchaButtonGroupComponent, isStandalone: false, selector: "matcha-button-group", inputs: { multiple: "multiple", activeColor: "activeColor", inactiveColor: "inactiveColor" }, queries: [{ propertyName: "buttonItems", predicate: MatchaButtonItemComponent }], ngImport: i0, template: "<div class=\"button-group d-flex flex-wrap
|
|
296
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: MatchaButtonGroupComponent, isStandalone: false, selector: "matcha-button-group", inputs: { multiple: "multiple", disabled: "disabled", activeColor: "activeColor", inactiveColor: "inactiveColor", activeType: "activeType", inactiveType: "inactiveType", gap: "gap" }, host: { properties: { "attr.disabled": "this.isDisabled" } }, queries: [{ propertyName: "buttonItems", predicate: MatchaButtonItemComponent }], ngImport: i0, template: "<div class=\"button-group d-flex flex-wrap\" [ngClass]=\"gapClass\" role=\"group\"><ng-content></ng-content></div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); }
|
|
292
297
|
}
|
|
293
298
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: MatchaButtonGroupComponent, decorators: [{
|
|
294
299
|
type: Component,
|
|
295
|
-
args: [{ selector: 'matcha-button-group', standalone: false, template: "<div class=\"button-group d-flex flex-wrap
|
|
300
|
+
args: [{ selector: 'matcha-button-group', standalone: false, template: "<div class=\"button-group d-flex flex-wrap\" [ngClass]=\"gapClass\" role=\"group\"><ng-content></ng-content></div>\n" }]
|
|
296
301
|
}], propDecorators: { multiple: [{
|
|
297
302
|
type: Input
|
|
303
|
+
}], disabled: [{
|
|
304
|
+
type: Input
|
|
305
|
+
}], isDisabled: [{
|
|
306
|
+
type: HostBinding,
|
|
307
|
+
args: ['attr.disabled']
|
|
298
308
|
}], activeColor: [{
|
|
299
309
|
type: Input
|
|
300
310
|
}], inactiveColor: [{
|
|
301
311
|
type: Input
|
|
312
|
+
}], activeType: [{
|
|
313
|
+
type: Input
|
|
314
|
+
}], inactiveType: [{
|
|
315
|
+
type: Input
|
|
316
|
+
}], gap: [{
|
|
317
|
+
type: Input
|
|
302
318
|
}], buttonItems: [{
|
|
303
319
|
type: ContentChildren,
|
|
304
320
|
args: [MatchaButtonItemComponent]
|
|
@@ -1561,15 +1577,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
|
|
|
1561
1577
|
class MatchaFormFieldComponent {
|
|
1562
1578
|
constructor() {
|
|
1563
1579
|
this.color = 'grey';
|
|
1580
|
+
this.size = null;
|
|
1581
|
+
this.sizeXs = null;
|
|
1582
|
+
this.sizeSm = null;
|
|
1583
|
+
this.sizeMd = null;
|
|
1584
|
+
this.sizeLg = null;
|
|
1585
|
+
this.sizeXl = null;
|
|
1586
|
+
}
|
|
1587
|
+
get control() {
|
|
1588
|
+
return this.controlDir?.control;
|
|
1589
|
+
}
|
|
1590
|
+
get showError() {
|
|
1591
|
+
return !!this.control?.invalid && (this.control?.touched || this.control?.dirty);
|
|
1564
1592
|
}
|
|
1565
1593
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: MatchaFormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1566
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: MatchaFormFieldComponent, isStandalone: false, selector: "matcha-form-field", inputs: { color: "color" }, ngImport: i0, template: "<div class=\"flex-column gap-4\">\n <div class=\"matcha-form-field position-relative w-100-p min-h-40 flex-align-center\" #inputSelector>\n <div class=\"flex-row position-absolute w-100-p min-h-40 h-100-p\">\n <div class=\"bl-2 bt-2 bb-2 radius-left-8 min-w-8 border-color-{{color}}\"></div>\n <div class=\"bb-2 w-auto border-color-{{color}}\">\n <ng-content select=\"matcha-label\"></ng-content>\n </div>\n <div class=\"br-2 bt-2 bb-2 radius-right-8 w-100-p border-color-{{color}}\"></div>\n </div>\n <div class=\"flex-row position-relative
|
|
1594
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: MatchaFormFieldComponent, isStandalone: false, selector: "matcha-form-field", inputs: { color: "color", size: "size", sizeXs: ["size-xs", "sizeXs"], sizeSm: ["size-sm", "sizeSm"], sizeMd: ["size-md", "sizeMd"], sizeLg: ["size-lg", "sizeLg"], sizeXl: ["size-xl", "sizeXl"] }, queries: [{ propertyName: "controlDir", first: true, predicate: FormControlName, descendants: true }], ngImport: i0, template: "<div class=\"flex-column gap-4\">\n <div class=\"matcha-form-field position-relative w-100-p min-h-40 flex-align-center\" #inputSelector>\n <div class=\"flex-row position-absolute w-100-p min-h-40 h-100-p\">\n <div class=\"bl-2 bt-2 bb-2 radius-left-8 min-w-8 border-color-{{color}}\"></div>\n <div class=\"bb-2 w-auto border-color-{{color}}\">\n <ng-content select=\"matcha-label\"></ng-content>\n </div>\n <div class=\"br-2 bt-2 bb-2 radius-right-8 w-100-p border-color-{{color}}\"></div>\n </div>\n <div class=\"flex-row position-relative py-8 px-12 gap-8 w-100-p\">\n <ng-content></ng-content>\n </div>\n </div>\n <ng-container *ngIf=\"showError\">\n <ng-content select=\"matcha-error\"></ng-content>\n </ng-container>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
1567
1595
|
}
|
|
1568
1596
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: MatchaFormFieldComponent, decorators: [{
|
|
1569
1597
|
type: Component,
|
|
1570
|
-
args: [{ selector: 'matcha-form-field', standalone: false, template: "<div class=\"flex-column gap-4\">\n <div class=\"matcha-form-field position-relative w-100-p min-h-40 flex-align-center\" #inputSelector>\n <div class=\"flex-row position-absolute w-100-p min-h-40 h-100-p\">\n <div class=\"bl-2 bt-2 bb-2 radius-left-8 min-w-8 border-color-{{color}}\"></div>\n <div class=\"bb-2 w-auto border-color-{{color}}\">\n <ng-content select=\"matcha-label\"></ng-content>\n </div>\n <div class=\"br-2 bt-2 bb-2 radius-right-8 w-100-p border-color-{{color}}\"></div>\n </div>\n <div class=\"flex-row position-relative
|
|
1598
|
+
args: [{ selector: 'matcha-form-field', standalone: false, template: "<div class=\"flex-column gap-4\">\n <div class=\"matcha-form-field position-relative w-100-p min-h-40 flex-align-center\" #inputSelector>\n <div class=\"flex-row position-absolute w-100-p min-h-40 h-100-p\">\n <div class=\"bl-2 bt-2 bb-2 radius-left-8 min-w-8 border-color-{{color}}\"></div>\n <div class=\"bb-2 w-auto border-color-{{color}}\">\n <ng-content select=\"matcha-label\"></ng-content>\n </div>\n <div class=\"br-2 bt-2 bb-2 radius-right-8 w-100-p border-color-{{color}}\"></div>\n </div>\n <div class=\"flex-row position-relative py-8 px-12 gap-8 w-100-p\">\n <ng-content></ng-content>\n </div>\n </div>\n <ng-container *ngIf=\"showError\">\n <ng-content select=\"matcha-error\"></ng-content>\n </ng-container>\n</div>\n" }]
|
|
1571
1599
|
}], propDecorators: { color: [{
|
|
1572
1600
|
type: Input
|
|
1601
|
+
}], size: [{
|
|
1602
|
+
type: Input,
|
|
1603
|
+
args: ['size']
|
|
1604
|
+
}], sizeXs: [{
|
|
1605
|
+
type: Input,
|
|
1606
|
+
args: ['size-xs']
|
|
1607
|
+
}], sizeSm: [{
|
|
1608
|
+
type: Input,
|
|
1609
|
+
args: ['size-sm']
|
|
1610
|
+
}], sizeMd: [{
|
|
1611
|
+
type: Input,
|
|
1612
|
+
args: ['size-md']
|
|
1613
|
+
}], sizeLg: [{
|
|
1614
|
+
type: Input,
|
|
1615
|
+
args: ['size-lg']
|
|
1616
|
+
}], sizeXl: [{
|
|
1617
|
+
type: Input,
|
|
1618
|
+
args: ['size-xl']
|
|
1619
|
+
}], controlDir: [{
|
|
1620
|
+
type: ContentChild,
|
|
1621
|
+
args: [FormControlName]
|
|
1573
1622
|
}] } });
|
|
1574
1623
|
|
|
1575
1624
|
class MatchaLabelComponent {
|
|
@@ -1577,11 +1626,11 @@ class MatchaLabelComponent {
|
|
|
1577
1626
|
this.color = 'blue-grey';
|
|
1578
1627
|
}
|
|
1579
1628
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: MatchaLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1580
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: MatchaLabelComponent, isStandalone: false, selector: "matcha-label", inputs: { color: "color" }, ngImport: i0, template: "<label\n class=\"d-flex d-flex-align-center position-relative text-nowrap px-
|
|
1629
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: MatchaLabelComponent, isStandalone: false, selector: "matcha-label", inputs: { color: "color" }, ngImport: i0, template: "<label\n class=\"d-flex d-flex-align-center position-relative text-nowrap px-4 fs-12 lh-18 fw-700 color-{{color}}\"\n style=\"transform: translateY(-8px);\">\n <ng-content></ng-content>\n <!-- <span class=\"pl-4 fs-10 fw-400 lh-16 matcha-color-placeholder\">*</span>\n <span class=\"pl-4 fs-10 fw-400 lh-16 matcha-color-placeholder\">(Opcional)</span> -->\n</label>", styles: [""] }); }
|
|
1581
1630
|
}
|
|
1582
1631
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: MatchaLabelComponent, decorators: [{
|
|
1583
1632
|
type: Component,
|
|
1584
|
-
args: [{ selector: 'matcha-label', standalone: false, template: "<label\n class=\"d-flex d-flex-align-center position-relative text-nowrap px-
|
|
1633
|
+
args: [{ selector: 'matcha-label', standalone: false, template: "<label\n class=\"d-flex d-flex-align-center position-relative text-nowrap px-4 fs-12 lh-18 fw-700 color-{{color}}\"\n style=\"transform: translateY(-8px);\">\n <ng-content></ng-content>\n <!-- <span class=\"pl-4 fs-10 fw-400 lh-16 matcha-color-placeholder\">*</span>\n <span class=\"pl-4 fs-10 fw-400 lh-16 matcha-color-placeholder\">(Opcional)</span> -->\n</label>" }]
|
|
1585
1634
|
}], propDecorators: { color: [{
|
|
1586
1635
|
type: Input
|
|
1587
1636
|
}] } });
|
|
@@ -1742,18 +1791,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
|
|
|
1742
1791
|
}] } });
|
|
1743
1792
|
|
|
1744
1793
|
class MatchaSpinComponent {
|
|
1745
|
-
constructor() {
|
|
1746
|
-
this._progress = 0;
|
|
1747
|
-
this.color = 'accent';
|
|
1748
|
-
this.diameter = 60;
|
|
1749
|
-
this.strokeWidth = 5;
|
|
1750
|
-
}
|
|
1751
1794
|
set progress(value) {
|
|
1752
1795
|
this._progress = Number(value);
|
|
1753
1796
|
}
|
|
1754
1797
|
get progress() {
|
|
1755
1798
|
return this._progress;
|
|
1756
1799
|
}
|
|
1800
|
+
constructor(_elementRef, _renderer) {
|
|
1801
|
+
this._elementRef = _elementRef;
|
|
1802
|
+
this._renderer = _renderer;
|
|
1803
|
+
this._progress = 0;
|
|
1804
|
+
this.color = 'accent';
|
|
1805
|
+
this.size = null;
|
|
1806
|
+
this.sizeXs = null;
|
|
1807
|
+
this.sizeSm = null;
|
|
1808
|
+
this.sizeMd = null;
|
|
1809
|
+
this.sizeLg = null;
|
|
1810
|
+
this.sizeXl = null;
|
|
1811
|
+
this.strokeWidth = 5;
|
|
1812
|
+
}
|
|
1813
|
+
ngOnInit() {
|
|
1814
|
+
this._renderer.addClass(this._elementRef.nativeElement, 'matcha-spin');
|
|
1815
|
+
this.setSize();
|
|
1816
|
+
}
|
|
1817
|
+
setSize() {
|
|
1818
|
+
const sizes = ['tiny', 'small', 'medium', 'large', 'huge'];
|
|
1819
|
+
sizes.forEach(size => {
|
|
1820
|
+
this._renderer.removeClass(this._elementRef.nativeElement, `matcha-spin-${size}`);
|
|
1821
|
+
});
|
|
1822
|
+
if (this.size) {
|
|
1823
|
+
this._renderer.addClass(this._elementRef.nativeElement, `matcha-spin-${this.size}`);
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
get diameter() {
|
|
1827
|
+
const rect = this._elementRef.nativeElement.getBoundingClientRect();
|
|
1828
|
+
return rect.width;
|
|
1829
|
+
}
|
|
1757
1830
|
get radius() {
|
|
1758
1831
|
return (this.diameter - this.strokeWidth) / 2;
|
|
1759
1832
|
}
|
|
@@ -1764,16 +1837,40 @@ class MatchaSpinComponent {
|
|
|
1764
1837
|
const progress = Math.min(Math.max(Number(this.progress), 0), 100);
|
|
1765
1838
|
return this.circumference - (progress / 100) * this.circumference;
|
|
1766
1839
|
}
|
|
1767
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: MatchaSpinComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1768
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: MatchaSpinComponent, isStandalone: false, selector: "matcha-spin", inputs: { progress: "progress", color: "color" }, ngImport: i0, template: "<div\n class=\"matcha-spin\"\n role=\"progressbar\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-valuenow]=\"progress\"\n
|
|
1840
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: MatchaSpinComponent, deps: [{ token: ElementRef }, { token: Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1841
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: MatchaSpinComponent, isStandalone: false, selector: "matcha-spin", inputs: { progress: "progress", color: "color", size: "size", sizeXs: ["size-xs", "sizeXs"], sizeSm: ["size-sm", "sizeSm"], sizeMd: ["size-md", "sizeMd"], sizeLg: ["size-lg", "sizeLg"], sizeXl: ["size-xl", "sizeXl"] }, ngImport: i0, template: "<div\n class=\"matcha-spin\"\n role=\"progressbar\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-valuenow]=\"progress\"\n>\n <svg [attr.viewBox]=\"'0 0 ' + diameter + ' ' + diameter\">\n <circle\n class=\"spin-placeholder\"\n [attr.cx]=\"diameter / 2\"\n [attr.cy]=\"diameter / 2\"\n [attr.r]=\"radius\"\n [attr.stroke-width]=\"strokeWidth\"\n />\n <circle\n class=\"spin-progress\"\n [attr.cx]=\"diameter / 2\"\n [attr.cy]=\"diameter / 2\"\n [attr.r]=\"radius\"\n [attr.stroke-width]=\"strokeWidth\"\n [attr.stroke]=\"color\"\n [attr.stroke-dasharray]=\"circumference\"\n [attr.stroke-dashoffset]=\"progress ? dashOffset : null\"\n />\n </svg>\n</div>\n", styles: [""] }); }
|
|
1769
1842
|
}
|
|
1770
1843
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: MatchaSpinComponent, decorators: [{
|
|
1771
1844
|
type: Component,
|
|
1772
|
-
args: [{ selector: 'matcha-spin', standalone: false, template: "<div\n class=\"matcha-spin\"\n role=\"progressbar\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-valuenow]=\"progress\"\n
|
|
1773
|
-
}],
|
|
1845
|
+
args: [{ selector: 'matcha-spin', standalone: false, template: "<div\n class=\"matcha-spin\"\n role=\"progressbar\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-valuenow]=\"progress\"\n>\n <svg [attr.viewBox]=\"'0 0 ' + diameter + ' ' + diameter\">\n <circle\n class=\"spin-placeholder\"\n [attr.cx]=\"diameter / 2\"\n [attr.cy]=\"diameter / 2\"\n [attr.r]=\"radius\"\n [attr.stroke-width]=\"strokeWidth\"\n />\n <circle\n class=\"spin-progress\"\n [attr.cx]=\"diameter / 2\"\n [attr.cy]=\"diameter / 2\"\n [attr.r]=\"radius\"\n [attr.stroke-width]=\"strokeWidth\"\n [attr.stroke]=\"color\"\n [attr.stroke-dasharray]=\"circumference\"\n [attr.stroke-dashoffset]=\"progress ? dashOffset : null\"\n />\n </svg>\n</div>\n" }]
|
|
1846
|
+
}], ctorParameters: () => [{ type: i0.ElementRef, decorators: [{
|
|
1847
|
+
type: Inject,
|
|
1848
|
+
args: [ElementRef]
|
|
1849
|
+
}] }, { type: i0.Renderer2, decorators: [{
|
|
1850
|
+
type: Inject,
|
|
1851
|
+
args: [Renderer2]
|
|
1852
|
+
}] }], propDecorators: { progress: [{
|
|
1774
1853
|
type: Input
|
|
1775
1854
|
}], color: [{
|
|
1776
1855
|
type: Input
|
|
1856
|
+
}], size: [{
|
|
1857
|
+
type: Input,
|
|
1858
|
+
args: ['size']
|
|
1859
|
+
}], sizeXs: [{
|
|
1860
|
+
type: Input,
|
|
1861
|
+
args: ['size-xs']
|
|
1862
|
+
}], sizeSm: [{
|
|
1863
|
+
type: Input,
|
|
1864
|
+
args: ['size-sm']
|
|
1865
|
+
}], sizeMd: [{
|
|
1866
|
+
type: Input,
|
|
1867
|
+
args: ['size-md']
|
|
1868
|
+
}], sizeLg: [{
|
|
1869
|
+
type: Input,
|
|
1870
|
+
args: ['size-lg']
|
|
1871
|
+
}], sizeXl: [{
|
|
1872
|
+
type: Input,
|
|
1873
|
+
args: ['size-xl']
|
|
1777
1874
|
}] } });
|
|
1778
1875
|
|
|
1779
1876
|
class MatchaHintTextComponent {
|