@m3e/tooltip 1.0.0-rc.2 → 1.0.0-rc.3
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/dist/custom-elements.json +11 -19
- package/dist/src/TooltipElement.d.ts +103 -0
- package/dist/src/TooltipElement.d.ts.map +1 -0
- package/dist/src/TooltipPosition.d.ts +3 -0
- package/dist/src/TooltipPosition.d.ts.map +1 -0
- package/dist/src/TooltipTouchGestures.d.ts +3 -0
- package/dist/src/TooltipTouchGestures.d.ts.map +1 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -1338,25 +1338,6 @@
|
|
|
1338
1338
|
"kind": "mixin",
|
|
1339
1339
|
"description": "Mixin that adds support for custom event attributes.",
|
|
1340
1340
|
"name": "EventAttribute",
|
|
1341
|
-
"members": [
|
|
1342
|
-
{
|
|
1343
|
-
"kind": "method",
|
|
1344
|
-
"name": "dispatchEvent",
|
|
1345
|
-
"return": {
|
|
1346
|
-
"type": {
|
|
1347
|
-
"text": "boolean"
|
|
1348
|
-
}
|
|
1349
|
-
},
|
|
1350
|
-
"parameters": [
|
|
1351
|
-
{
|
|
1352
|
-
"name": "event",
|
|
1353
|
-
"type": {
|
|
1354
|
-
"text": "Event"
|
|
1355
|
-
}
|
|
1356
|
-
}
|
|
1357
|
-
]
|
|
1358
|
-
}
|
|
1359
|
-
],
|
|
1360
1341
|
"parameters": [
|
|
1361
1342
|
{
|
|
1362
1343
|
"name": "base",
|
|
@@ -1654,6 +1635,17 @@
|
|
|
1654
1635
|
"description": "Mixin to augment an element with behavior used to submit a form.",
|
|
1655
1636
|
"name": "FormSubmitter",
|
|
1656
1637
|
"members": [
|
|
1638
|
+
{
|
|
1639
|
+
"kind": "field",
|
|
1640
|
+
"name": "formAssociated",
|
|
1641
|
+
"type": {
|
|
1642
|
+
"text": "boolean"
|
|
1643
|
+
},
|
|
1644
|
+
"static": true,
|
|
1645
|
+
"readonly": true,
|
|
1646
|
+
"default": "true",
|
|
1647
|
+
"description": "Indicates that this custom element participates in form submission, validation, and form state restoration."
|
|
1648
|
+
},
|
|
1657
1649
|
{
|
|
1658
1650
|
"kind": "field",
|
|
1659
1651
|
"name": "name",
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { CSSResultGroup, LitElement, PropertyValues } from "lit";
|
|
2
|
+
import { TooltipPosition } from "./TooltipPosition";
|
|
3
|
+
import { TooltipTouchGestures } from "./TooltipTouchGestures";
|
|
4
|
+
declare const M3eTooltipElement_base: import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").HtmlForMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").AttachInternalsMixin> & typeof LitElement;
|
|
5
|
+
/**
|
|
6
|
+
* Adds additional context to a button or other UI element.
|
|
7
|
+
*
|
|
8
|
+
* @description
|
|
9
|
+
* The `m3e-tooltip` component provides contextual information in response to user interaction, enhancing comprehension
|
|
10
|
+
* and reducing ambiguity. Tooltips are positioned relative to a target element and support configurable delays for
|
|
11
|
+
* show and hide behavior. The component is designed to reinforce accessibility and usability, especially in dense or
|
|
12
|
+
* icon-driven interfaces. Use the `for` attribute to designate the element for which to provide a tooltip.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* The following example illustrates connecting a tooltip to a button using the `for` attribute.
|
|
16
|
+
* ```html
|
|
17
|
+
* <m3e-icon-button id="button" aria-label="Back">
|
|
18
|
+
* <m3e-icon name="arrow_back"></m3e-icon>
|
|
19
|
+
* </m3e-icon-button>
|
|
20
|
+
* <m3e-tooltip for="button">Go Back</m3e-tooltip>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @tag m3e-tooltip
|
|
24
|
+
*
|
|
25
|
+
* @slot - Renders the content of the tooltip.
|
|
26
|
+
*
|
|
27
|
+
* @attr disabled - Whether the element is disabled.
|
|
28
|
+
* @attr for - The query selector used to specify the element related to this element.
|
|
29
|
+
* @attr hide-delay - The amount of time, in milliseconds, before hiding the tooltip.
|
|
30
|
+
* @attr position - The position of the tooltip.
|
|
31
|
+
* @attr show-delay - The amount of time, in milliseconds, before showing the tooltip.
|
|
32
|
+
*
|
|
33
|
+
* @cssprop --m3e-tooltip-padding - Internal spacing of the tooltip container.
|
|
34
|
+
* @cssprop --m3e-tooltip-min-width - Minimum width of the tooltip.
|
|
35
|
+
* @cssprop --m3e-tooltip-max-width - Maximum width of the tooltip.
|
|
36
|
+
* @cssprop --m3e-tooltip-min-height - Minimum height of the tooltip container.
|
|
37
|
+
* @cssprop --m3e-tooltip-max-height - Maximum height of the tooltip.
|
|
38
|
+
* @cssprop --m3e-tooltip-shape - Border radius of the tooltip container.
|
|
39
|
+
* @cssprop --m3e-tooltip-container-color - Background color of the tooltip.
|
|
40
|
+
* @cssprop --m3e-tooltip-supporting-text-color - Text color of supporting text.
|
|
41
|
+
* @cssprop --m3e-tooltip-supporting-text-font-size - Font size of supporting text.
|
|
42
|
+
* @cssprop --m3e-tooltip-supporting-text-font-weight - Font weight of supporting text.
|
|
43
|
+
* @cssprop --m3e-tooltip-supporting-text-line-height - Line height of supporting text.
|
|
44
|
+
* @cssprop --m3e-tooltip-supporting-text-tracking - Letter spacing of supporting text.
|
|
45
|
+
*/
|
|
46
|
+
export declare class M3eTooltipElement extends M3eTooltipElement_base {
|
|
47
|
+
#private;
|
|
48
|
+
/** The styles of the element. */
|
|
49
|
+
static styles: CSSResultGroup;
|
|
50
|
+
/** @private */ private static readonly __openTooltips;
|
|
51
|
+
/** @private */ private readonly _base;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the element is disabled.
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
disabled: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* The position of the tooltip.
|
|
59
|
+
* @default "below"
|
|
60
|
+
*/
|
|
61
|
+
position: TooltipPosition;
|
|
62
|
+
/**
|
|
63
|
+
* The amount of time, in milliseconds, before showing the tooltip.
|
|
64
|
+
* @default 0
|
|
65
|
+
*/
|
|
66
|
+
get showDelay(): number;
|
|
67
|
+
set showDelay(value: number);
|
|
68
|
+
/**
|
|
69
|
+
* The amount of time, in milliseconds, before hiding the tooltip.
|
|
70
|
+
* @default 200
|
|
71
|
+
*/
|
|
72
|
+
get hideDelay(): number;
|
|
73
|
+
set hideDelay(value: number);
|
|
74
|
+
/**
|
|
75
|
+
* The mode in which to handle touch gestures.
|
|
76
|
+
* @default "auto"
|
|
77
|
+
*/
|
|
78
|
+
touchGestures: TooltipTouchGestures;
|
|
79
|
+
/** @inheritdoc */
|
|
80
|
+
attach(control: HTMLElement): void;
|
|
81
|
+
/** @inheritdoc */
|
|
82
|
+
detach(): void;
|
|
83
|
+
/** @inheritdoc */
|
|
84
|
+
connectedCallback(): void;
|
|
85
|
+
/** @inheritdoc */
|
|
86
|
+
protected update(changedProperties: PropertyValues<this>): void;
|
|
87
|
+
/** @inheritdoc */
|
|
88
|
+
protected render(): unknown;
|
|
89
|
+
/**
|
|
90
|
+
* Manually shows the tooltip.
|
|
91
|
+
* @returns {Promise<void>} A `Promise` that resolves when the tooltip is shown.
|
|
92
|
+
*/
|
|
93
|
+
show(): Promise<void>;
|
|
94
|
+
/** Manually hides the tooltip. */
|
|
95
|
+
hide(): void;
|
|
96
|
+
}
|
|
97
|
+
declare global {
|
|
98
|
+
interface HTMLElementTagNameMap {
|
|
99
|
+
"m3e-tooltip": M3eTooltipElement;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
export {};
|
|
103
|
+
//# sourceMappingURL=TooltipElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TooltipElement.d.ts","sourceRoot":"","sources":["../../src/TooltipElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,cAAc,EAAQ,UAAU,EAAE,cAAc,EAAa,MAAM,KAAK,CAAC;AAgBvF,OAAO,EAAE,eAAe,EAAE,MA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ition.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TooltipTouchGestures.d.ts","sourceRoot":"","sources":["../../src/TooltipTouchGestures.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,IAAI,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m3e/tooltip",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.3",
|
|
4
4
|
"description": "Tooltip for M3E",
|
|
5
5
|
"author": "matraic <matraic@yahoo.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@material/material-color-utilities": "^0.3.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@m3e/core": "1.0.0-rc.
|
|
33
|
+
"@m3e/core": "1.0.0-rc.3",
|
|
34
34
|
"lit": "^3.3.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|