matcha-components 1.0.18 → 1.0.21
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 +240 -16
- package/esm2022/lib/matcha-button/button.directive.mjs +59 -3
- package/esm2022/lib/matcha-components.module.mjs +5 -6
- package/esm2022/public-api.mjs +1 -3
- package/fesm2022/matcha-components.mjs +63 -32
- package/fesm2022/matcha-components.mjs.map +1 -1
- package/lib/matcha-button/button.directive.d.ts +5 -1
- package/lib/matcha-components.module.d.ts +35 -36
- package/package.json +1 -1
- package/public-api.d.ts +0 -2
- package/esm2022/lib/test-component/my-test-component/my-test-component.component.mjs +0 -11
- package/esm2022/lib/test-component/test-component.module.mjs +0 -20
- package/lib/test-component/my-test-component/my-test-component.component.d.ts +0 -5
- package/lib/test-component/test-component.module.d.ts +0 -8
|
@@ -260,31 +260,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImpor
|
|
|
260
260
|
type: Input
|
|
261
261
|
}] } });
|
|
262
262
|
|
|
263
|
-
class MyTestComponentComponent {
|
|
264
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: MyTestComponentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
265
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.5", type: MyTestComponentComponent, selector: "lib-my-test-component", ngImport: i0, template: "<p>my-test-component works 2!</p>\n", styles: [""] }); }
|
|
266
|
-
}
|
|
267
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: MyTestComponentComponent, decorators: [{
|
|
268
|
-
type: Component,
|
|
269
|
-
args: [{ selector: 'lib-my-test-component', template: "<p>my-test-component works 2!</p>\n" }]
|
|
270
|
-
}] });
|
|
271
|
-
|
|
272
|
-
class TestComponentModule {
|
|
273
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: TestComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
274
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.5", ngImport: i0, type: TestComponentModule, declarations: [MyTestComponentComponent], imports: [CommonModule], exports: [MyTestComponentComponent] }); }
|
|
275
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: TestComponentModule, imports: [CommonModule] }); }
|
|
276
|
-
}
|
|
277
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: TestComponentModule, decorators: [{
|
|
278
|
-
type: NgModule,
|
|
279
|
-
args: [{
|
|
280
|
-
declarations: [MyTestComponentComponent],
|
|
281
|
-
imports: [
|
|
282
|
-
CommonModule,
|
|
283
|
-
],
|
|
284
|
-
exports: [MyTestComponentComponent]
|
|
285
|
-
}]
|
|
286
|
-
}] });
|
|
287
|
-
|
|
288
263
|
class MatchaCardModule {
|
|
289
264
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: MatchaCardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
290
265
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.5", ngImport: i0, type: MatchaCardModule, declarations: [MatchaCardComponent], imports: [CommonModule], exports: [MatchaCardComponent] }); }
|
|
@@ -497,13 +472,48 @@ class MatchaButtonDirective {
|
|
|
497
472
|
this._renderer = _renderer;
|
|
498
473
|
this.pill = false;
|
|
499
474
|
this.size = null;
|
|
475
|
+
this.color = null;
|
|
476
|
+
this.outline = false;
|
|
477
|
+
this._config = {
|
|
478
|
+
size: 'md',
|
|
479
|
+
color: 'primary',
|
|
480
|
+
pill: false,
|
|
481
|
+
outline: false,
|
|
482
|
+
};
|
|
500
483
|
}
|
|
501
484
|
ngOnInit() {
|
|
485
|
+
this._renderer.addClass(this._elementRef.nativeElement, `matcha-button`);
|
|
502
486
|
this._setConfig();
|
|
487
|
+
// Adicione o evento de clique apenas a elementos com a classe "matcha-button"
|
|
488
|
+
const buttons = document.querySelectorAll('.matcha-button');
|
|
489
|
+
buttons.forEach(button => {
|
|
490
|
+
button.addEventListener('click', this.addRippleEffect, false);
|
|
491
|
+
});
|
|
503
492
|
}
|
|
504
493
|
ngOnChanges() {
|
|
505
494
|
this._setConfig();
|
|
506
495
|
}
|
|
496
|
+
addRippleEffect(e) {
|
|
497
|
+
var target = e.target;
|
|
498
|
+
if (target.tagName.toLowerCase() !== 'button')
|
|
499
|
+
return false;
|
|
500
|
+
var rect = target.getBoundingClientRect();
|
|
501
|
+
var ripple = target.querySelector('.ripple');
|
|
502
|
+
if (!ripple) {
|
|
503
|
+
ripple = document.createElement('span');
|
|
504
|
+
ripple.className = 'ripple';
|
|
505
|
+
ripple.style.height = ripple.style.width = Math.max(rect.width, rect.height) + 'px';
|
|
506
|
+
target.appendChild(ripple);
|
|
507
|
+
console.log(ripple);
|
|
508
|
+
}
|
|
509
|
+
ripple.classList.remove('show');
|
|
510
|
+
var top = e.pageY - rect.top - ripple.offsetHeight / 2 - window.scrollY;
|
|
511
|
+
var left = e.pageX - rect.left - ripple.offsetWidth / 2 - window.scrollX;
|
|
512
|
+
ripple.style.top = top + 'px';
|
|
513
|
+
ripple.style.left = left + 'px';
|
|
514
|
+
ripple.classList.add('show');
|
|
515
|
+
return false;
|
|
516
|
+
}
|
|
507
517
|
_setConfig() {
|
|
508
518
|
// Remove todas as classes relacionadas ao tamanho
|
|
509
519
|
['xs', 'sm', 'md', 'lg', 'xl'].forEach((size) => {
|
|
@@ -513,7 +523,22 @@ class MatchaButtonDirective {
|
|
|
513
523
|
if (this.size) {
|
|
514
524
|
this._renderer.addClass(this._elementRef.nativeElement, `matcha-button-${this.size}`);
|
|
515
525
|
}
|
|
516
|
-
if (this.
|
|
526
|
+
if (this.color) {
|
|
527
|
+
this._renderer.removeClass(this._elementRef.nativeElement, `color-${this._config.color}`);
|
|
528
|
+
this._renderer.removeClass(this._elementRef.nativeElement, `${this._config.color}`);
|
|
529
|
+
this._renderer.addClass(this._elementRef.nativeElement, `${this.color}`);
|
|
530
|
+
this._config.color = this.color;
|
|
531
|
+
}
|
|
532
|
+
if (this.outline) {
|
|
533
|
+
this._renderer.addClass(this._elementRef.nativeElement, `color-${this.color}`);
|
|
534
|
+
this._renderer.addClass(this._elementRef.nativeElement, `matcha-button-outline`);
|
|
535
|
+
}
|
|
536
|
+
else {
|
|
537
|
+
this._renderer.removeClass(this._elementRef.nativeElement, `color-${this.color}`);
|
|
538
|
+
this._renderer.removeClass(this._elementRef.nativeElement, `color-${this._config.color}`);
|
|
539
|
+
this._renderer.removeClass(this._elementRef.nativeElement, `matcha-button-outline`);
|
|
540
|
+
}
|
|
541
|
+
if (this.pill === true || this.pill === 'true') {
|
|
517
542
|
this._renderer.addClass(this._elementRef.nativeElement, `matcha-button-pill`);
|
|
518
543
|
}
|
|
519
544
|
else {
|
|
@@ -521,7 +546,7 @@ class MatchaButtonDirective {
|
|
|
521
546
|
}
|
|
522
547
|
}
|
|
523
548
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: MatchaButtonDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
524
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.5", type: MatchaButtonDirective, selector: "[matcha-button]", inputs: { pill: "pill", size: "size" }, usesOnChanges: true, ngImport: i0 }); }
|
|
549
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.5", type: MatchaButtonDirective, selector: "[matcha-button]", inputs: { pill: "pill", size: "size", color: "color", outline: "outline" }, usesOnChanges: true, ngImport: i0 }); }
|
|
525
550
|
}
|
|
526
551
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: MatchaButtonDirective, decorators: [{
|
|
527
552
|
type: Directive,
|
|
@@ -535,6 +560,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImpor
|
|
|
535
560
|
}], size: [{
|
|
536
561
|
type: Input,
|
|
537
562
|
args: ['size']
|
|
563
|
+
}], color: [{
|
|
564
|
+
type: Input,
|
|
565
|
+
args: ['color']
|
|
566
|
+
}], outline: [{
|
|
567
|
+
type: Input,
|
|
568
|
+
args: ['outline']
|
|
538
569
|
}] } });
|
|
539
570
|
|
|
540
571
|
class MatchaButtonModule {
|
|
@@ -1429,8 +1460,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImpor
|
|
|
1429
1460
|
|
|
1430
1461
|
class MatchaComponentsModule {
|
|
1431
1462
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: MatchaComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1432
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.5", ngImport: i0, type: MatchaComponentsModule, declarations: [MatchaOverflowDraggableComponent], imports: [
|
|
1433
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: MatchaComponentsModule, imports: [
|
|
1463
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.5", ngImport: i0, type: MatchaComponentsModule, declarations: [MatchaOverflowDraggableComponent], imports: [MatchaCardModule, MatchaHeadersModule], exports: [MatchaCardModule, MatchaHeadersModule, MatchaAutocompleteModule, MatchaBadgeModule, MatchaTabsModule, MatchaBottomSheetModule, MatchaButtonToggleModule, MatchaButtonModule, MatchaCheckboxModule, MatchaChipsModule, MatchaDatepickerModule, MatchaDialogModule, MatchaDividerModule, MatchaElevationModule, MatchaExpansionModule, MatchaFormsModule, MatchaIconModule, MatchaInputModule, MatchaListModule, MatchaMenuModule, MatchaSidenavModule, MatchaPaginatorModule, MatchaProgressBarModule, MatchaProgressSpinnerModule, MatchaRadioButtonModule, MatchaSelectModule, MatchaSlideToggleModule, MatchaSliderModule, MatchaSnackBarModule, MatchaSortHeaderModule, MatchaStepperModule, MatchaTableModule, MatchaTabsModule, MatchaTooltipModule, MatchaTreeModule] }); }
|
|
1464
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: MatchaComponentsModule, imports: [MatchaCardModule, MatchaHeadersModule, MatchaCardModule, MatchaHeadersModule, MatchaAutocompleteModule, MatchaBadgeModule, MatchaTabsModule, MatchaBottomSheetModule, MatchaButtonToggleModule, MatchaButtonModule, MatchaCheckboxModule, MatchaChipsModule, MatchaDatepickerModule, MatchaDialogModule, MatchaDividerModule, MatchaElevationModule, MatchaExpansionModule, MatchaFormsModule, MatchaIconModule, MatchaInputModule, MatchaListModule, MatchaMenuModule, MatchaSidenavModule, MatchaPaginatorModule, MatchaProgressBarModule, MatchaProgressSpinnerModule, MatchaRadioButtonModule, MatchaSelectModule, MatchaSlideToggleModule, MatchaSliderModule, MatchaSnackBarModule, MatchaSortHeaderModule, MatchaStepperModule, MatchaTableModule, MatchaTabsModule, MatchaTooltipModule, MatchaTreeModule] }); }
|
|
1434
1465
|
}
|
|
1435
1466
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: MatchaComponentsModule, decorators: [{
|
|
1436
1467
|
type: NgModule,
|
|
@@ -1438,8 +1469,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImpor
|
|
|
1438
1469
|
declarations: [
|
|
1439
1470
|
MatchaOverflowDraggableComponent
|
|
1440
1471
|
],
|
|
1441
|
-
imports: [
|
|
1442
|
-
exports: [
|
|
1472
|
+
imports: [MatchaCardModule, MatchaHeadersModule],
|
|
1473
|
+
exports: [MatchaCardModule, MatchaHeadersModule, MatchaAutocompleteModule, MatchaBadgeModule, MatchaTabsModule, MatchaBottomSheetModule, MatchaButtonToggleModule, MatchaButtonModule, MatchaCheckboxModule, MatchaChipsModule, MatchaDatepickerModule, MatchaDialogModule, MatchaDividerModule, MatchaElevationModule, MatchaExpansionModule, MatchaFormsModule, MatchaIconModule, MatchaInputModule, MatchaListModule, MatchaMenuModule, MatchaSidenavModule, MatchaPaginatorModule, MatchaProgressBarModule, MatchaProgressSpinnerModule, MatchaRadioButtonModule, MatchaSelectModule, MatchaSlideToggleModule, MatchaSliderModule, MatchaSnackBarModule, MatchaSortHeaderModule, MatchaStepperModule, MatchaTableModule, MatchaTabsModule, MatchaTooltipModule, MatchaTreeModule],
|
|
1443
1474
|
}]
|
|
1444
1475
|
}] });
|
|
1445
1476
|
|
|
@@ -1476,5 +1507,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImpor
|
|
|
1476
1507
|
* Generated bundle index. Do not edit.
|
|
1477
1508
|
*/
|
|
1478
1509
|
|
|
1479
|
-
export { MatchaAutocompleteDirective, MatchaAutocompleteModule, MatchaAutocompleteOverviewDirective, MatchaBadgeDirective, MatchaBadgeModule, MatchaBottomSheetDirective, MatchaBottomSheetModule, MatchaButtonDirective, MatchaButtonModule, MatchaButtonToggleDirective, MatchaButtonToggleModule, MatchaCardComponent, MatchaCardFooter, MatchaCardModule, MatchaCheckboxDirective, MatchaCheckboxModule, MatchaChipsDirective, MatchaChipsModule, MatchaComponentsModule, MatchaDatepickerDirective, MatchaDatepickerModule, MatchaDialogDirective, MatchaDialogModule, MatchaDividerDirective, MatchaDividerModule, MatchaElevationDirective, MatchaElevationModule, MatchaExpansionDirective, MatchaExpansionModule, MatchaFormFieldDirective, MatchaFormsModule, MatchaGridComponent, MatchaGridModule, MatchaHeadersModule, MatchaHeadlineComponent, MatchaIconComponent, MatchaIconModule, MatchaInputDirective, MatchaInputModule, MatchaListDirective, MatchaListModule, MatchaMenuDirective, MatchaMenuModule, MatchaPaginatorDirective, MatchaPaginatorModule, MatchaProgressBarDirective, MatchaProgressBarModule, MatchaProgressSpinnerDirective, MatchaProgressSpinnerModule, MatchaRadioButtonDirective, MatchaRadioButtonModule, MatchaSelectDirective, MatchaSelectModule, MatchaSidenavDirective, MatchaSidenavModule, MatchaSlideToggleDirective, MatchaSlideToggleModule, MatchaSliderDirective, MatchaSliderModule, MatchaSnackBarDirective, MatchaSnackBarModule, MatchaSortHeaderDirective, MatchaSortHeaderModule, MatchaStepperDirective, MatchaStepperModule, MatchaSubheadComponent, MatchaTableDirective, MatchaTableModule, MatchaTabsDirective, MatchaTabsModule, MatchaTitleComponent, MatchaTooltipDirective, MatchaTooltipModule, MatchaTreeDirective, MatchaTreeModule
|
|
1510
|
+
export { MatchaAutocompleteDirective, MatchaAutocompleteModule, MatchaAutocompleteOverviewDirective, MatchaBadgeDirective, MatchaBadgeModule, MatchaBottomSheetDirective, MatchaBottomSheetModule, MatchaButtonDirective, MatchaButtonModule, MatchaButtonToggleDirective, MatchaButtonToggleModule, MatchaCardComponent, MatchaCardFooter, MatchaCardModule, MatchaCheckboxDirective, MatchaCheckboxModule, MatchaChipsDirective, MatchaChipsModule, MatchaComponentsModule, MatchaDatepickerDirective, MatchaDatepickerModule, MatchaDialogDirective, MatchaDialogModule, MatchaDividerDirective, MatchaDividerModule, MatchaElevationDirective, MatchaElevationModule, MatchaExpansionDirective, MatchaExpansionModule, MatchaFormFieldDirective, MatchaFormsModule, MatchaGridComponent, MatchaGridModule, MatchaHeadersModule, MatchaHeadlineComponent, MatchaIconComponent, MatchaIconModule, MatchaInputDirective, MatchaInputModule, MatchaListDirective, MatchaListModule, MatchaMenuDirective, MatchaMenuModule, MatchaPaginatorDirective, MatchaPaginatorModule, MatchaProgressBarDirective, MatchaProgressBarModule, MatchaProgressSpinnerDirective, MatchaProgressSpinnerModule, MatchaRadioButtonDirective, MatchaRadioButtonModule, MatchaSelectDirective, MatchaSelectModule, MatchaSidenavDirective, MatchaSidenavModule, MatchaSlideToggleDirective, MatchaSlideToggleModule, MatchaSliderDirective, MatchaSliderModule, MatchaSnackBarDirective, MatchaSnackBarModule, MatchaSortHeaderDirective, MatchaSortHeaderModule, MatchaStepperDirective, MatchaStepperModule, MatchaSubheadComponent, MatchaTableDirective, MatchaTableModule, MatchaTabsDirective, MatchaTabsModule, MatchaTitleComponent, MatchaTooltipDirective, MatchaTooltipModule, MatchaTreeDirective, MatchaTreeModule };
|
|
1480
1511
|
//# sourceMappingURL=matcha-components.mjs.map
|