matcha-components 20.48.0 → 20.50.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 +74 -12
- package/fesm2022/matcha-components.mjs.map +1 -1
- package/index.d.ts +27 -7
- package/package.json +1 -1
|
@@ -8737,7 +8737,7 @@ class MatchaSelectComponent {
|
|
|
8737
8737
|
useExisting: forwardRef(() => MatchaSelectComponent),
|
|
8738
8738
|
multi: true
|
|
8739
8739
|
}
|
|
8740
|
-
], queries: [{ propertyName: "options", predicate: MatchaOptionComponent, descendants: true }], viewQueries: [{ propertyName: "panel", first: true, predicate: MatchaPanelComponent, descendants: true }], ngImport: i0, template: "<div class=\"matcha-select-container\" [class.matcha-select-disabled]=\"disabled || isDisabled\">\n <div\n class=\"matcha-select-trigger\"\n [class.matcha-select-open]=\"open\"\n [class.matcha-select-disabled]=\"disabled || isDisabled\"\n (click)=\"onTriggerClick()\"\n [attr.tabindex]=\"(disabled || isDisabled) ? -1 : 0\"\n role=\"combobox\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-haspopup]=\"true\"\n [attr.aria-disabled]=\"disabled || isDisabled\">\n\n <span class=\"matcha-select-value\" [class.matcha-select-placeholder]=\"!selectedValue\">\n {{ getSelectedLabel() || placeholder }}\n </span>\n\n <span class=\"matcha-select-arrow\" [class.matcha-select-arrow-open]=\"open\">\n <span class=\"i-matcha-
|
|
8740
|
+
], queries: [{ propertyName: "options", predicate: MatchaOptionComponent, descendants: true }], viewQueries: [{ propertyName: "panel", first: true, predicate: MatchaPanelComponent, descendants: true }], ngImport: i0, template: "<div class=\"matcha-select-container\" [class.matcha-select-disabled]=\"disabled || isDisabled\">\n <div\n class=\"matcha-select-trigger\"\n [class.matcha-select-open]=\"open\"\n [class.matcha-select-disabled]=\"disabled || isDisabled\"\n (click)=\"onTriggerClick()\"\n [attr.tabindex]=\"(disabled || isDisabled) ? -1 : 0\"\n role=\"combobox\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-haspopup]=\"true\"\n [attr.aria-disabled]=\"disabled || isDisabled\">\n\n <span class=\"matcha-select-value\" [class.matcha-select-placeholder]=\"!selectedValue\">\n {{ getSelectedLabel() || placeholder }}\n </span>\n\n <span class=\"matcha-select-arrow\" [class.matcha-select-arrow-open]=\"open\">\n <span class=\"i-matcha-action_arrow_down\"></span>\n </span>\n </div>\n\n <matcha-panel\n #panel\n [placement]=\"placement\"\n [maxHeight]=\"maxHeight\"\n [minWidth]=\"minWidth\"\n [open]=\"open\">\n <ng-content></ng-content>\n </matcha-panel>\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: MatchaPanelComponent, selector: "matcha-panel", inputs: ["placement", "maxHeight", "minWidth", "offset", "triggerElement", "open"], outputs: ["opened", "closed"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
8741
8741
|
}
|
|
8742
8742
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaSelectComponent, decorators: [{
|
|
8743
8743
|
type: Component,
|
|
@@ -8747,7 +8747,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
8747
8747
|
useExisting: forwardRef(() => MatchaSelectComponent),
|
|
8748
8748
|
multi: true
|
|
8749
8749
|
}
|
|
8750
|
-
], template: "<div class=\"matcha-select-container\" [class.matcha-select-disabled]=\"disabled || isDisabled\">\n <div\n class=\"matcha-select-trigger\"\n [class.matcha-select-open]=\"open\"\n [class.matcha-select-disabled]=\"disabled || isDisabled\"\n (click)=\"onTriggerClick()\"\n [attr.tabindex]=\"(disabled || isDisabled) ? -1 : 0\"\n role=\"combobox\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-haspopup]=\"true\"\n [attr.aria-disabled]=\"disabled || isDisabled\">\n\n <span class=\"matcha-select-value\" [class.matcha-select-placeholder]=\"!selectedValue\">\n {{ getSelectedLabel() || placeholder }}\n </span>\n\n <span class=\"matcha-select-arrow\" [class.matcha-select-arrow-open]=\"open\">\n <span class=\"i-matcha-
|
|
8750
|
+
], template: "<div class=\"matcha-select-container\" [class.matcha-select-disabled]=\"disabled || isDisabled\">\n <div\n class=\"matcha-select-trigger\"\n [class.matcha-select-open]=\"open\"\n [class.matcha-select-disabled]=\"disabled || isDisabled\"\n (click)=\"onTriggerClick()\"\n [attr.tabindex]=\"(disabled || isDisabled) ? -1 : 0\"\n role=\"combobox\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-haspopup]=\"true\"\n [attr.aria-disabled]=\"disabled || isDisabled\">\n\n <span class=\"matcha-select-value\" [class.matcha-select-placeholder]=\"!selectedValue\">\n {{ getSelectedLabel() || placeholder }}\n </span>\n\n <span class=\"matcha-select-arrow\" [class.matcha-select-arrow-open]=\"open\">\n <span class=\"i-matcha-action_arrow_down\"></span>\n </span>\n </div>\n\n <matcha-panel\n #panel\n [placement]=\"placement\"\n [maxHeight]=\"maxHeight\"\n [minWidth]=\"minWidth\"\n [open]=\"open\">\n <ng-content></ng-content>\n </matcha-panel>\n</div>\n" }]
|
|
8751
8751
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }], propDecorators: { options: [{
|
|
8752
8752
|
type: ContentChildren,
|
|
8753
8753
|
args: [MatchaOptionComponent, { descendants: true }]
|
|
@@ -9780,21 +9780,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
9780
9780
|
}] } });
|
|
9781
9781
|
|
|
9782
9782
|
class MatchaTooltipDirective {
|
|
9783
|
+
get tooltipDisabled() { return this._tooltipDisabled; }
|
|
9784
|
+
set tooltipDisabled(v) { this._tooltipDisabled = v === 'false' ? false : !!v; }
|
|
9785
|
+
get tooltipDisabledAttr() {
|
|
9786
|
+
return this.tooltipDisabled ? 'true' : 'false';
|
|
9787
|
+
}
|
|
9788
|
+
get preferAbove() { return this._preferAbove; }
|
|
9789
|
+
set preferAbove(v) { this._preferAbove = v === 'false' ? false : !!v; }
|
|
9790
|
+
get preferAboveAttr() {
|
|
9791
|
+
return this.preferAbove ? 'true' : 'false';
|
|
9792
|
+
}
|
|
9793
|
+
get preferBelow() { return this._preferBelow; }
|
|
9794
|
+
set preferBelow(v) { this._preferBelow = v === 'false' ? false : !!v; }
|
|
9795
|
+
get preferBelowAttr() {
|
|
9796
|
+
return this.preferBelow ? 'true' : 'false';
|
|
9797
|
+
}
|
|
9798
|
+
get preferLeft() { return this._preferLeft; }
|
|
9799
|
+
set preferLeft(v) { this._preferLeft = v === 'false' ? false : !!v; }
|
|
9800
|
+
get preferLeftAttr() {
|
|
9801
|
+
return this.preferLeft ? 'true' : 'false';
|
|
9802
|
+
}
|
|
9803
|
+
get preferRight() { return this._preferRight; }
|
|
9804
|
+
set preferRight(v) { this._preferRight = v === 'false' ? false : !!v; }
|
|
9805
|
+
get preferRightAttr() {
|
|
9806
|
+
return this.preferRight ? 'true' : 'false';
|
|
9807
|
+
}
|
|
9808
|
+
get tooltipEnableClose() { return this._tooltipEnableClose; }
|
|
9809
|
+
set tooltipEnableClose(v) { this._tooltipEnableClose = v === 'false' ? false : !!v; }
|
|
9810
|
+
get tooltipEnableCloseAttr() {
|
|
9811
|
+
return this.tooltipEnableClose ? 'true' : 'false';
|
|
9812
|
+
}
|
|
9783
9813
|
constructor(el, renderer) {
|
|
9784
9814
|
this.el = el;
|
|
9785
9815
|
this.renderer = renderer;
|
|
9786
9816
|
this.tooltipText = '';
|
|
9787
|
-
this.
|
|
9788
|
-
this.
|
|
9789
|
-
this.
|
|
9790
|
-
this.
|
|
9791
|
-
this.
|
|
9792
|
-
this.
|
|
9817
|
+
this._tooltipDisabled = false;
|
|
9818
|
+
this._preferAbove = false;
|
|
9819
|
+
this._preferBelow = false;
|
|
9820
|
+
this._preferLeft = false;
|
|
9821
|
+
this._preferRight = false;
|
|
9822
|
+
this._tooltipEnableClose = false;
|
|
9793
9823
|
this.tooltipElement = null;
|
|
9794
9824
|
this.documentClickListener = null;
|
|
9825
|
+
this.isDestroyed = false;
|
|
9795
9826
|
}
|
|
9796
9827
|
onMouseEnter() {
|
|
9797
|
-
if (this.tooltipEnableClose) {
|
|
9828
|
+
if (this.isDestroyed || this.tooltipEnableClose) {
|
|
9798
9829
|
// Em modo de clique/tap, não abre via hover
|
|
9799
9830
|
return;
|
|
9800
9831
|
}
|
|
@@ -9804,12 +9835,12 @@ class MatchaTooltipDirective {
|
|
|
9804
9835
|
this.createTooltip();
|
|
9805
9836
|
}
|
|
9806
9837
|
onMouseLeave() {
|
|
9807
|
-
if (!this.tooltipEnableClose && this.tooltipElement) {
|
|
9838
|
+
if (this.isDestroyed || (!this.tooltipEnableClose && this.tooltipElement)) {
|
|
9808
9839
|
this.destroyTooltip();
|
|
9809
9840
|
}
|
|
9810
9841
|
}
|
|
9811
9842
|
onClick(event) {
|
|
9812
|
-
if (!this.tooltipEnableClose) {
|
|
9843
|
+
if (this.isDestroyed || !this.tooltipEnableClose) {
|
|
9813
9844
|
return;
|
|
9814
9845
|
}
|
|
9815
9846
|
event.stopPropagation();
|
|
@@ -9818,6 +9849,10 @@ class MatchaTooltipDirective {
|
|
|
9818
9849
|
}
|
|
9819
9850
|
}
|
|
9820
9851
|
createTooltip() {
|
|
9852
|
+
// Verificar se já existe um tooltip ativo
|
|
9853
|
+
if (this.tooltipElement || this.isDestroyed) {
|
|
9854
|
+
return;
|
|
9855
|
+
}
|
|
9821
9856
|
// Cria o tooltip e adiciona a classe base
|
|
9822
9857
|
this.tooltipElement = this.renderer.createElement('div');
|
|
9823
9858
|
this.renderer.addClass(this.tooltipElement, 'matcha-tooltip-content');
|
|
@@ -9838,6 +9873,11 @@ class MatchaTooltipDirective {
|
|
|
9838
9873
|
e.stopPropagation();
|
|
9839
9874
|
this.destroyTooltip();
|
|
9840
9875
|
});
|
|
9876
|
+
// Remover listener anterior se existir
|
|
9877
|
+
if (this.documentClickListener) {
|
|
9878
|
+
this.documentClickListener();
|
|
9879
|
+
this.documentClickListener = null;
|
|
9880
|
+
}
|
|
9841
9881
|
this.documentClickListener = this.renderer.listen('document', 'click', (e) => {
|
|
9842
9882
|
if (this.tooltipElement && !this.tooltipElement.contains(e.target)) {
|
|
9843
9883
|
this.destroyTooltip();
|
|
@@ -9920,8 +9960,12 @@ class MatchaTooltipDirective {
|
|
|
9920
9960
|
this.documentClickListener = null;
|
|
9921
9961
|
}
|
|
9922
9962
|
}
|
|
9963
|
+
ngOnDestroy() {
|
|
9964
|
+
this.isDestroyed = true;
|
|
9965
|
+
this.destroyTooltip();
|
|
9966
|
+
}
|
|
9923
9967
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaTooltipDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
9924
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.0", type: MatchaTooltipDirective, isStandalone: false, selector: "[matchaTooltip]", inputs: { tooltipText: ["matchaTooltip", "tooltipText"], tooltipDisabled: ["matchaTooltipDisabled", "tooltipDisabled"], preferAbove: ["matchaTooltipAbove", "preferAbove"], preferBelow: ["matchaTooltipBelow", "preferBelow"], preferLeft: ["matchaTooltipLeft", "preferLeft"], preferRight: ["matchaTooltipRight", "preferRight"], tooltipEnableClose: ["matchaTooltipEnableClose", "tooltipEnableClose"] }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "click": "onClick($event)" } }, ngImport: i0 }); }
|
|
9968
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.0", type: MatchaTooltipDirective, isStandalone: false, selector: "[matchaTooltip]", inputs: { tooltipText: ["matchaTooltip", "tooltipText"], tooltipDisabled: ["matchaTooltipDisabled", "tooltipDisabled"], preferAbove: ["matchaTooltipAbove", "preferAbove"], preferBelow: ["matchaTooltipBelow", "preferBelow"], preferLeft: ["matchaTooltipLeft", "preferLeft"], preferRight: ["matchaTooltipRight", "preferRight"], tooltipEnableClose: ["matchaTooltipEnableClose", "tooltipEnableClose"] }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "click": "onClick($event)" }, properties: { "attr.tooltip-disabled": "this.tooltipDisabledAttr", "attr.tooltip-above": "this.preferAboveAttr", "attr.tooltip-below": "this.preferBelowAttr", "attr.tooltip-left": "this.preferLeftAttr", "attr.tooltip-right": "this.preferRightAttr", "attr.tooltip-enable-close": "this.tooltipEnableCloseAttr" } }, ngImport: i0 }); }
|
|
9925
9969
|
}
|
|
9926
9970
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaTooltipDirective, decorators: [{
|
|
9927
9971
|
type: Directive,
|
|
@@ -9935,21 +9979,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
9935
9979
|
}], tooltipDisabled: [{
|
|
9936
9980
|
type: Input,
|
|
9937
9981
|
args: ['matchaTooltipDisabled']
|
|
9982
|
+
}], tooltipDisabledAttr: [{
|
|
9983
|
+
type: HostBinding,
|
|
9984
|
+
args: ['attr.tooltip-disabled']
|
|
9938
9985
|
}], preferAbove: [{
|
|
9939
9986
|
type: Input,
|
|
9940
9987
|
args: ['matchaTooltipAbove']
|
|
9988
|
+
}], preferAboveAttr: [{
|
|
9989
|
+
type: HostBinding,
|
|
9990
|
+
args: ['attr.tooltip-above']
|
|
9941
9991
|
}], preferBelow: [{
|
|
9942
9992
|
type: Input,
|
|
9943
9993
|
args: ['matchaTooltipBelow']
|
|
9994
|
+
}], preferBelowAttr: [{
|
|
9995
|
+
type: HostBinding,
|
|
9996
|
+
args: ['attr.tooltip-below']
|
|
9944
9997
|
}], preferLeft: [{
|
|
9945
9998
|
type: Input,
|
|
9946
9999
|
args: ['matchaTooltipLeft']
|
|
10000
|
+
}], preferLeftAttr: [{
|
|
10001
|
+
type: HostBinding,
|
|
10002
|
+
args: ['attr.tooltip-left']
|
|
9947
10003
|
}], preferRight: [{
|
|
9948
10004
|
type: Input,
|
|
9949
10005
|
args: ['matchaTooltipRight']
|
|
10006
|
+
}], preferRightAttr: [{
|
|
10007
|
+
type: HostBinding,
|
|
10008
|
+
args: ['attr.tooltip-right']
|
|
9950
10009
|
}], tooltipEnableClose: [{
|
|
9951
10010
|
type: Input,
|
|
9952
10011
|
args: ['matchaTooltipEnableClose']
|
|
10012
|
+
}], tooltipEnableCloseAttr: [{
|
|
10013
|
+
type: HostBinding,
|
|
10014
|
+
args: ['attr.tooltip-enable-close']
|
|
9953
10015
|
}], onMouseEnter: [{
|
|
9954
10016
|
type: HostListener,
|
|
9955
10017
|
args: ['mouseenter']
|