@momentum-design/components 0.122.20 → 0.122.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.
|
@@ -30,12 +30,7 @@ declare class Tooltip extends Popover {
|
|
|
30
30
|
* @default 'description'
|
|
31
31
|
*/
|
|
32
32
|
tooltipType: TooltipType;
|
|
33
|
-
private defaultSlotNodes;
|
|
34
33
|
connectedCallback(): void;
|
|
35
|
-
/**
|
|
36
|
-
* @returns The tooltip text.
|
|
37
|
-
*/
|
|
38
|
-
private getTooltipText;
|
|
39
34
|
/**
|
|
40
35
|
* Sets the type attribute for the tooltip component.
|
|
41
36
|
* If the provided type is not included in the TOOLTIP_TYPES,
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { property
|
|
10
|
+
import { property } from 'lit/decorators.js';
|
|
11
11
|
import { v4 as uuidv4 } from 'uuid';
|
|
12
12
|
import { ROLE } from '../../utils/roles';
|
|
13
13
|
import Popover from '../popover/popover.component';
|
|
@@ -66,13 +66,6 @@ class Tooltip extends Popover {
|
|
|
66
66
|
this.size = false;
|
|
67
67
|
this.disableAriaExpanded = true;
|
|
68
68
|
}
|
|
69
|
-
/**
|
|
70
|
-
* @returns The tooltip text.
|
|
71
|
-
*/
|
|
72
|
-
getTooltipText() {
|
|
73
|
-
var _a, _b;
|
|
74
|
-
return (((_b = (_a = this.defaultSlotNodes) === null || _a === void 0 ? void 0 : _a.map(node => node.textContent).join(' ')) === null || _b === void 0 ? void 0 : _b.trim()) || '');
|
|
75
|
-
}
|
|
76
69
|
/**
|
|
77
70
|
* Sets the type attribute for the tooltip component.
|
|
78
71
|
* If the provided type is not included in the TOOLTIP_TYPES,
|
|
@@ -125,7 +118,6 @@ class Tooltip extends Popover {
|
|
|
125
118
|
this.setTooltipType(DEFAULTS.TOOLTIP_TYPE);
|
|
126
119
|
}
|
|
127
120
|
if (this.triggerElement) {
|
|
128
|
-
const tooltipText = this.getTooltipText();
|
|
129
121
|
switch (this.tooltipType) {
|
|
130
122
|
case TOOLTIP_TYPES.DESCRIPTION:
|
|
131
123
|
if (previousTooltipType === TOOLTIP_TYPES.LABEL) {
|
|
@@ -148,9 +140,6 @@ class Tooltip extends Popover {
|
|
|
148
140
|
}
|
|
149
141
|
break;
|
|
150
142
|
}
|
|
151
|
-
if (tooltipText.length > 0 && this.tooltipType !== TOOLTIP_TYPES.NONE && !this.ariaLabel) {
|
|
152
|
-
this.ariaLabel = tooltipText;
|
|
153
|
-
}
|
|
154
143
|
}
|
|
155
144
|
}
|
|
156
145
|
async update(changedProperties) {
|
|
@@ -171,8 +160,4 @@ __decorate([
|
|
|
171
160
|
property({ type: String, attribute: 'tooltip-type', reflect: true }),
|
|
172
161
|
__metadata("design:type", String)
|
|
173
162
|
], Tooltip.prototype, "tooltipType", void 0);
|
|
174
|
-
__decorate([
|
|
175
|
-
queryAssignedNodes(),
|
|
176
|
-
__metadata("design:type", Array)
|
|
177
|
-
], Tooltip.prototype, "defaultSlotNodes", void 0);
|
|
178
163
|
export default Tooltip;
|
|
@@ -51085,24 +51085,6 @@
|
|
|
51085
51085
|
"attribute": "tooltip-type",
|
|
51086
51086
|
"reflects": true
|
|
51087
51087
|
},
|
|
51088
|
-
{
|
|
51089
|
-
"kind": "field",
|
|
51090
|
-
"name": "defaultSlotNodes",
|
|
51091
|
-
"type": {
|
|
51092
|
-
"text": "Array<Node>"
|
|
51093
|
-
},
|
|
51094
|
-
"privacy": "private"
|
|
51095
|
-
},
|
|
51096
|
-
{
|
|
51097
|
-
"kind": "method",
|
|
51098
|
-
"name": "getTooltipText",
|
|
51099
|
-
"privacy": "private",
|
|
51100
|
-
"return": {
|
|
51101
|
-
"type": {
|
|
51102
|
-
"text": ""
|
|
51103
|
-
}
|
|
51104
|
-
}
|
|
51105
|
-
},
|
|
51106
51088
|
{
|
|
51107
51089
|
"kind": "method",
|
|
51108
51090
|
"name": "setTooltipType",
|