@m3e/tooltip 1.1.10 → 1.2.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RichTooltipPosition.d.ts","sourceRoot":"","sources":["../../src/RichTooltipPosition.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,MAAM,MAAM,mBAAmB,GAC3B,aAAa,GACb,cAAc,GACd,cAAc,GACd,aAAa,GACb,QAAQ,GACR,OAAO,GACP,OAAO,GACP,OAAO,CAAC"}
@@ -1,7 +1,7 @@
1
- import { CSSResultGroup, LitElement, PropertyValues } from "lit";
1
+ import { CSSResultGroup } from "lit";
2
+ import { AnchorPosition } from "@m3e/core/anchoring";
2
3
  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;
4
+ import { TooltipElementBase } from "./TooltipElementBase";
5
5
  /**
6
6
  * Adds additional context to a button or other UI element.
7
7
  *
@@ -43,39 +43,17 @@ declare const M3eTooltipElement_base: import("node_modules/@m3e/core/dist/src/sh
43
43
  * @cssprop --m3e-tooltip-supporting-text-line-height - Line height of supporting text.
44
44
  * @cssprop --m3e-tooltip-supporting-text-tracking - Letter spacing of supporting text.
45
45
  */
46
- export declare class M3eTooltipElement extends M3eTooltipElement_base {
46
+ export declare class M3eTooltipElement extends TooltipElementBase {
47
47
  #private;
48
48
  /** The styles of the element. */
49
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
50
  /**
58
51
  * The position of the tooltip.
59
52
  * @default "below"
60
53
  */
61
54
  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;
55
+ /** @inheritdoc */
56
+ protected get _anchorPosition(): AnchorPosition;
79
57
  /** @inheritdoc */
80
58
  attach(control: HTMLElement): void;
81
59
  /** @inheritdoc */
@@ -83,21 +61,13 @@ export declare class M3eTooltipElement extends M3eTooltipElement_base {
83
61
  /** @inheritdoc */
84
62
  connectedCallback(): void;
85
63
  /** @inheritdoc */
86
- protected update(changedProperties: PropertyValues<this>): void;
87
- /** @inheritdoc */
88
64
  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;
65
+ /** @inheritdoc */
66
+ protected _updatePosition(base: HTMLElement, x: number, y: number): void;
96
67
  }
97
68
  declare global {
98
69
  interface HTMLElementTagNameMap {
99
70
  "m3e-tooltip": M3eTooltipElement;
100
71
  }
101
72
  }
102
- export {};
103
73
  //# sourceMappingURL=TooltipElement.d.ts.map
@@ -1 +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;AAiBvF,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;;AAQ9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAC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C;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,qBACa,iBAAkB,SAAQ,kBAAkB;;IACvD,iCAAiC;IACjC,OAAgB,MAAM,EAAE,cAAc,CAgFpC;IAIF;;;OAGG;IACS,QAAQ,EAAE,eAAe,CAAW;IAEhD,kBAAkB;IAClB,SAAS,KAAK,eAAe,IAAI,cAAc,CAY9C;IAED,kBAAkB;IACT,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAQ3C,kBAAkB;IACT,MAAM,IAAI,IAAI;IAOvB,kBAAkB;IACT,iBAAiB,IAAI,IAAI;IAKlC,kBAAkB;cACC,MAAM,IAAI,OAAO;IAMpC,kBAAkB;IAClB,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;CAoCzE;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,iBAAiB,CAAC;KAClC;CACF"}
@@ -0,0 +1,69 @@
1
+ import { LitElement, PropertyValues } from "lit";
2
+ import { AnchorPosition } from "@m3e/core/anchoring";
3
+ import { TooltipTouchGestures } from "./TooltipTouchGestures";
4
+ declare const TooltipElementBase_base: import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").HtmlForMixin> & typeof LitElement;
5
+ /** Provides a base implementation for a tooltip. This class must be inherited. */
6
+ export declare abstract class TooltipElementBase extends TooltipElementBase_base {
7
+ #private;
8
+ /** @private */ private static __openTooltips;
9
+ /** @internal */ protected readonly _base: HTMLElement;
10
+ /**
11
+ * Whether the element is disabled.
12
+ * @default false
13
+ */
14
+ disabled: boolean;
15
+ /**
16
+ * The amount of time, in milliseconds, before showing the tooltip.
17
+ * @default 0
18
+ */
19
+ get showDelay(): number;
20
+ set showDelay(value: number);
21
+ /**
22
+ * The amount of time, in milliseconds, before hiding the tooltip.
23
+ * @default 200
24
+ */
25
+ get hideDelay(): number;
26
+ set hideDelay(value: number);
27
+ /**
28
+ * The mode in which to handle touch gestures.
29
+ * @default "auto"
30
+ */
31
+ touchGestures: TooltipTouchGestures;
32
+ /** Whether the tooltip is currently open. */
33
+ get isOpen(): boolean;
34
+ /**
35
+ * Whether the tooltip is interactive.
36
+ * @internal
37
+ */
38
+ protected get _isInteractive(): boolean;
39
+ /**
40
+ * The position in which to anchor the tooltip relative to its trigger.
41
+ * @internal
42
+ */
43
+ protected abstract get _anchorPosition(): AnchorPosition;
44
+ /** @inheritdoc */
45
+ attach(control: HTMLElement): void;
46
+ /** @inheritdoc */
47
+ detach(): void;
48
+ /** @inheritdoc */
49
+ protected update(changedProperties: PropertyValues): void;
50
+ /** @inheritdoc */
51
+ protected firstUpdated(_changedProperties: PropertyValues<this>): void;
52
+ /**
53
+ * Manually shows the tooltip.
54
+ * @returns {Promise<void>} A `Promise` that resolves when the tooltip is shown.
55
+ */
56
+ show(): Promise<void>;
57
+ /** Manually hides the tooltip. */
58
+ hide(): void;
59
+ /**
60
+ * Updates the position of the tooltip.
61
+ * @internal
62
+ * @param {HTMLElement} base The internal element of the tooltip to position.
63
+ * @param {number} x The x-coordinate, in pixels, to which to position `base`.
64
+ * @param {number} y The y-coordinate, in pixels, to which to position `base`.
65
+ */
66
+ protected abstract _updatePosition(base: HTMLElement, x: number, y: number): void;
67
+ }
68
+ export {};
69
+ //# sourceMappingURL=TooltipElementBase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TooltipElementBase.d.ts","sourceRoot":"","sources":["../../src/TooltipElementBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAKjD,OAAO,EAAE,cAAc,EAAkB,MAAM,qBAAqB,CAAC;AAErE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CA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"./TooltipElement";
5
+ export * from "./TooltipElementBase";
2
6
  export * from "./TooltipPosition";
3
7
  export * from "./TooltipTouchGestures";
4
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,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.1.10",
3
+ "version": "1.2.0",
4
4
  "description": "Tooltip for M3E",
5
5
  "author": "matraic <matraic@yahoo.com>",
6
6
  "license": "MIT",
@@ -12,7 +12,8 @@
12
12
  "keywords": [
13
13
  "material design",
14
14
  "web components",
15
- "tooltip"
15
+ "tooltip",
16
+ "rich tooltip"
16
17
  ],
17
18
  "main": "dist/index.js",
18
19
  "module": "dist/index.js",
@@ -27,7 +28,7 @@
27
28
  "clean": "rimraf dist"
28
29
  },
29
30
  "peerDependencies": {
30
- "@m3e/core": "^1.1.3",
31
+ "@m3e/core": "^1.2.0",
31
32
  "lit": "^3.3.0"
32
33
  },
33
34
  "customElements": "dist/custom-elements.json"