matcha-components 20.116.0 → 20.120.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 +0 -6
- package/fesm2022/matcha-components.mjs +35 -9
- package/fesm2022/matcha-components.mjs.map +1 -1
- package/index.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -158,11 +158,6 @@ Run the serve command:
|
|
|
158
158
|
> Terminal: `ng s`
|
|
159
159
|
|
|
160
160
|
|
|
161
|
-
---
|
|
162
|
-
|
|
163
|
-
### Storybook
|
|
164
|
-
Run `ng run matcha-components:storybook` or `npm run storybook`to execute the storybook aplication and see the documentation of all components via [storybook](https://storybook.js.org/tutorials/intro-to-storybook/angular/en/get-started/).
|
|
165
|
-
|
|
166
161
|
---
|
|
167
162
|
|
|
168
163
|
### Scaffold
|
|
@@ -322,7 +317,6 @@ $matcha-default-theme: matcha.dark-theme($default-dark-primary, $default-dark-ac
|
|
|
322
317
|
## Further help
|
|
323
318
|
|
|
324
319
|
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
|
325
|
-
To get more help on the Storybook [stories](https://github.com/geromegrignon/angular-material-storybook/blob/main/stories/components/progress-bar/progress-bar.stories.ts)
|
|
326
320
|
|
|
327
321
|
## Roadmap
|
|
328
322
|
|
|
@@ -2781,21 +2781,28 @@ class MatchaSkeletonComponent {
|
|
|
2781
2781
|
this.model = 'empty';
|
|
2782
2782
|
this.gap = 16;
|
|
2783
2783
|
}
|
|
2784
|
+
// Getters privados para conversão sem modificar os inputs
|
|
2785
|
+
get amountNumber() {
|
|
2786
|
+
return typeof this.amount === 'string' ? parseInt(this.amount, 10) : this.amount;
|
|
2787
|
+
}
|
|
2788
|
+
get gridNumber() {
|
|
2789
|
+
return typeof this.grid === 'string' ? parseInt(this.grid, 10) : this.grid;
|
|
2790
|
+
}
|
|
2784
2791
|
get classes() {
|
|
2785
|
-
//
|
|
2786
|
-
|
|
2787
|
-
|
|
2792
|
+
// Usa os valores convertidos sem modificar os inputs
|
|
2793
|
+
const amountValue = this.amountNumber;
|
|
2794
|
+
const gridValue = this.gridNumber;
|
|
2788
2795
|
let classes = `gap-${this.gap} `;
|
|
2789
|
-
|
|
2790
|
-
|
|
2796
|
+
amountValue > 1 ? classes += `grid-sm-${gridValue - 1} ` : classes;
|
|
2797
|
+
amountValue > 2 ? classes += `grid-md-${gridValue} ` : classes;
|
|
2791
2798
|
return classes;
|
|
2792
2799
|
}
|
|
2793
2800
|
get heightClass() {
|
|
2794
2801
|
return `h-${this.height}`;
|
|
2795
2802
|
}
|
|
2796
2803
|
get amountArray() {
|
|
2797
|
-
const
|
|
2798
|
-
return Array(
|
|
2804
|
+
const amountValue = this.amountNumber;
|
|
2805
|
+
return Array(amountValue).fill(0).map((_, index) => index);
|
|
2799
2806
|
}
|
|
2800
2807
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaSkeletonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2801
2808
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.0", type: MatchaSkeletonComponent, isStandalone: false, selector: "matcha-skeleton", inputs: { amount: "amount", grid: "grid", height: "height", model: "model", gap: "gap" }, host: { properties: { "attr.amount": "this.amount", "attr.grid": "this.grid", "attr.height": "this.height", "attr.model": "this.model", "attr.gap": "this.gap" } }, ngImport: i0, template: "<ng-content></ng-content>\n<!-- CARD SKELETON -->\n<div [class]=\"classes\" *ngIf=\"model !== 'table'\">\n <div class=\"skeleton-animated-background flex-column--force p-0 radius-8 user-select-none overflow-hidden\" *ngFor=\"let i of amountArray\">\n\n <ng-container *ngIf=\"model === 'profile'\"><span class=\"h8 title p-16 m-0\"> <span class=\"radius-full background-surface-alpha h-48 w-48\"></span> </span></ng-container>\n\n <div [class]=\"'h-'+ height + ' flex-column--force p-16'\"></div>\n\n <ng-container *ngIf=\"model === 'profile'\">\n <div class=\"flex-column--force\">\n <div class=\"flex-column--force p-16 gap-16\">\n <div class=\"w-100-p h-16 background-surface-alpha radius-full\"></div>\n <div class=\"w-100-p h-16 background-surface-alpha radius-full\"></div>\n </div>\n </div>\n </ng-container>\n\n </div>\n</div>\n<!-- CARD SKELETON -->\n\n<!-- TABLE SKELETON -->\n<div class=\"skeleton-animated-background w-100-p mr-16 flex-column--force p-0 radius-8 user-select-none\" *ngIf=\"model === 'table'\">\n\n <div class=\"flex-column--force h-64 background-surface-alpha\">\n <ng-container> </ng-container>\n </div>\n\n <ng-container *ngFor=\"let i of amountArray\">\n <div class=\"grid-4 h-80 px-16 gap-16 flex-align-center--force\">\n <div class=\"w-100-p flex-row--force gap-16\">\n <div class=\"min-h-48 min-w-48 h-48 w-48 background-surface-alpha radius-full\"></div>\n <div class=\"w-100-p flex-column--force flex-center--force gap-16\">\n <div class=\"h-16 w-60-p background-surface-alpha radius-full\"></div>\n <div class=\"h-16 w-100-p background-surface-alpha radius-full\"></div>\n </div>\n </div>\n <div class=\"h-16 w-100-p flex-column--force background-surface-alpha radius-full\"></div>\n <div class=\"w-100-p flex-row--force gap-16\">\n <div class=\"w-100-p flex-column--force flex-center--force gap-16\">\n <div class=\"h-16 w-60-p background-surface-alpha radius-full\"></div>\n <div class=\"h-16 w-100-p background-surface-alpha radius-full\"></div>\n </div>\n </div>\n <div class=\"h-16 w-100-p flex-column--force background-surface-alpha radius-full\"></div>\n </div>\n\n <div class=\"grid-4 h-80 px-16 gap-16 flex-align-center--force background-bg-alpha\">\n <div class=\"w-100-p flex-row--force gap-16\">\n <div class=\"min-h-48 min-w-48 h-48 w-48 background-surface-alpha radius-full\"></div>\n <div class=\"w-100-p flex-column--force flex-center--force gap-16\">\n <div class=\"h-16 w-100-p background-surface-alpha radius-full\"></div>\n <div class=\"h-16 w-30-p background-surface-alpha radius-full\"></div>\n </div>\n </div>\n <div class=\"h-16 w-100-p flex-column--force background-surface-alpha radius-full\"></div>\n <div class=\"w-100-p flex-row--force gap-16\">\n <div class=\"w-100-p flex-column--force flex-center--force gap-16\">\n <div class=\"h-16 w-60-p background-surface-alpha radius-full\"></div>\n <div class=\"h-16 w-100-p background-surface-alpha radius-full\"></div>\n </div>\n </div>\n <div class=\"h-16 w-100-p flex-column--force background-surface-alpha radius-full\"></div>\n </div>\n\n </ng-container>\n\n</div>\n<!-- TABLE SKELETON -->\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
@@ -5728,7 +5735,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
5728
5735
|
type: Injectable
|
|
5729
5736
|
}] });
|
|
5730
5737
|
|
|
5731
|
-
// console.log('🎯 MATCHA-MASK VERSION:
|
|
5738
|
+
// console.log('🎯 MATCHA-MASK VERSION: v107 - FIX DECIMAL DISPLAY & BACKSPACE LOOP - ' + new Date().toISOString());
|
|
5732
5739
|
class MatchaMaskService extends MatchaMaskApplierService {
|
|
5733
5740
|
constructor() {
|
|
5734
5741
|
super(...arguments);
|
|
@@ -6799,6 +6806,18 @@ class MatchaMaskCompatibleDirective {
|
|
|
6799
6806
|
}
|
|
6800
6807
|
const target = event.target;
|
|
6801
6808
|
const value = target.value;
|
|
6809
|
+
// Se o usuário está tentando limpar o campo (apenas prefixo/sufixo restante), permitir vazio
|
|
6810
|
+
const prefix = this._maskService.prefix || '';
|
|
6811
|
+
const suffix = this._maskService.suffix || '';
|
|
6812
|
+
const valueWithoutPrefixSuffix = value.replace(prefix, '').replace(suffix, '').trim();
|
|
6813
|
+
// Se ficou vazio ou apenas com separadores/zeros, permitir limpar completamente
|
|
6814
|
+
const onlySymbols = /^[^\d]*$/.test(valueWithoutPrefixSuffix) ||
|
|
6815
|
+
/^0+[,.]?0*$/.test(valueWithoutPrefixSuffix);
|
|
6816
|
+
if (valueWithoutPrefixSuffix === '' || onlySymbols) {
|
|
6817
|
+
target.value = '';
|
|
6818
|
+
this._maskService.onChange('');
|
|
6819
|
+
return;
|
|
6820
|
+
}
|
|
6802
6821
|
// Aplicar máscara se definida
|
|
6803
6822
|
if (this._mask && this._mask.trim() !== '') {
|
|
6804
6823
|
const maskedValue = this._maskService.applyMask(value, this._mask);
|
|
@@ -6844,7 +6863,14 @@ class MatchaMaskCompatibleDirective {
|
|
|
6844
6863
|
inputValue = '';
|
|
6845
6864
|
}
|
|
6846
6865
|
else if (typeof value === 'number') {
|
|
6847
|
-
|
|
6866
|
+
// Para máscaras de separador, formatar o número com casas decimais
|
|
6867
|
+
if (this._mask && this._mask.trim().startsWith('separator.')) {
|
|
6868
|
+
const precision = parseInt(this._mask.split('.')[1], 10) || 2;
|
|
6869
|
+
inputValue = value.toFixed(precision).replace('.', ',');
|
|
6870
|
+
}
|
|
6871
|
+
else {
|
|
6872
|
+
inputValue = value.toString();
|
|
6873
|
+
}
|
|
6848
6874
|
}
|
|
6849
6875
|
else {
|
|
6850
6876
|
inputValue = String(value);
|