@operato/utils 2.0.0-beta.13 → 2.0.0-beta.23
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/CHANGELOG.md
CHANGED
@@ -3,6 +3,24 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [2.0.0-beta.23](https://github.com/hatiolab/operato/compare/v2.0.0-beta.22...v2.0.0-beta.23) (2024-06-13)
|
7
|
+
|
8
|
+
|
9
|
+
### :bug: Bug Fix
|
10
|
+
|
11
|
+
* export package.json ([538e6e0](https://github.com/hatiolab/operato/commit/538e6e050f5a3d77b8ed805968d66a9093a7d5e9))
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
## [2.0.0-beta.22](https://github.com/hatiolab/operato/compare/v2.0.0-beta.21...v2.0.0-beta.22) (2024-06-13)
|
16
|
+
|
17
|
+
|
18
|
+
### :bug: Bug Fix
|
19
|
+
|
20
|
+
* operato tag for all package.json ([2334960](https://github.com/hatiolab/operato/commit/2334960db2186ade87ee590796a269fe5f5e9419))
|
21
|
+
|
22
|
+
|
23
|
+
|
6
24
|
## [2.0.0-beta.13](https://github.com/hatiolab/operato/compare/v2.0.0-beta.12...v2.0.0-beta.13) (2024-06-09)
|
7
25
|
|
8
26
|
|
package/package.json
CHANGED
@@ -2,11 +2,12 @@
|
|
2
2
|
"name": "@operato/utils",
|
3
3
|
"description": "Webcomponent utils following open-wc recommendations",
|
4
4
|
"author": "heartyoh",
|
5
|
-
"version": "2.0.0-beta.
|
5
|
+
"version": "2.0.0-beta.23",
|
6
6
|
"main": "dist/src/index.js",
|
7
7
|
"module": "dist/src/index.js",
|
8
8
|
"exports": {
|
9
9
|
".": "./dist/src/index.js",
|
10
|
+
"./package.json": "./package.json",
|
10
11
|
"./mixins.js": "./dist/src/mixins/index.js",
|
11
12
|
"./fullscreen.js": "./dist/src/fullscreen.js",
|
12
13
|
"./os.js": "./dist/src/os.js",
|
@@ -61,6 +62,7 @@
|
|
61
62
|
}
|
62
63
|
},
|
63
64
|
"license": "MIT",
|
65
|
+
"operato": true,
|
64
66
|
"publishConfig": {
|
65
67
|
"access": "public",
|
66
68
|
"@operato:registry": "https://registry.npmjs.org"
|
@@ -117,5 +119,5 @@
|
|
117
119
|
"dependencies": {
|
118
120
|
"lodash-es": "^4.17.21"
|
119
121
|
},
|
120
|
-
"gitHead": "
|
122
|
+
"gitHead": "f2b3faf23eb7a8c51baa922b1baf6cabf3e6db13"
|
121
123
|
}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
2
|
-
export declare class TooltipMouseController implements ReactiveController {
|
3
|
-
private host;
|
4
|
-
private attributeName;
|
5
|
-
constructor(host: ReactiveControllerHost & HTMLElement, attributeName?: string);
|
6
|
-
hostConnected(): void;
|
7
|
-
hostDisconnected(): void;
|
8
|
-
private handleMouseOver;
|
9
|
-
private handleMouseOut;
|
10
|
-
}
|
@@ -1,43 +0,0 @@
|
|
1
|
-
import { hasOverflow } from '../has-overflow';
|
2
|
-
export class TooltipMouseController {
|
3
|
-
constructor(host, attributeName = 'data-reactive-tooltip') {
|
4
|
-
this.handleMouseOver = (e) => {
|
5
|
-
var _a;
|
6
|
-
const element = e.target;
|
7
|
-
if (element.hasAttribute(this.attributeName) && hasOverflow(element)) {
|
8
|
-
element.setAttribute('data-tooltip', ((_a = element.textContent) === null || _a === void 0 ? void 0 : _a.trim()) || '');
|
9
|
-
// Calculate tooltip position
|
10
|
-
const rect = element.getBoundingClientRect();
|
11
|
-
const top = rect.top + rect.height; // - window.scrollY
|
12
|
-
const left = rect.left + window.scrollX;
|
13
|
-
// Set CSS variables for position
|
14
|
-
element.style.setProperty('--tooltip-top', `${top}px`);
|
15
|
-
element.style.setProperty('--tooltip-left', `${left}px`);
|
16
|
-
}
|
17
|
-
};
|
18
|
-
this.handleMouseOut = (e) => {
|
19
|
-
const element = e.target;
|
20
|
-
if (element.hasAttribute('data-tooltip')) {
|
21
|
-
element.removeAttribute('data-tooltip');
|
22
|
-
element.style.removeProperty('--tooltip-top');
|
23
|
-
element.style.removeProperty('--tooltip-left');
|
24
|
-
}
|
25
|
-
};
|
26
|
-
this.host = host;
|
27
|
-
this.attributeName = attributeName;
|
28
|
-
host.addController(this);
|
29
|
-
}
|
30
|
-
hostConnected() {
|
31
|
-
var _a;
|
32
|
-
const target = (_a = this.host.shadowRoot) !== null && _a !== void 0 ? _a : this.host;
|
33
|
-
target.addEventListener('mouseover', this.handleMouseOver);
|
34
|
-
target.addEventListener('mouseout', this.handleMouseOut);
|
35
|
-
}
|
36
|
-
hostDisconnected() {
|
37
|
-
var _a;
|
38
|
-
const target = (_a = this.host.shadowRoot) !== null && _a !== void 0 ? _a : this.host;
|
39
|
-
target.removeEventListener('mouseover', this.handleMouseOver);
|
40
|
-
target.removeEventListener('mouseout', this.handleMouseOut);
|
41
|
-
}
|
42
|
-
}
|
43
|
-
//# sourceMappingURL=tooltip-mouse-controller.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"tooltip-mouse-controller.js","sourceRoot":"","sources":["../../../src/reactive-controllers/tooltip-mouse-controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAE7C,MAAM,OAAO,sBAAsB;IAIjC,YAAY,IAA0C,EAAE,gBAAwB,uBAAuB;QAkB/F,oBAAe,GAAG,CAAC,CAAQ,EAAE,EAAE;;YACrC,MAAM,OAAO,GAAG,CAAC,CAAC,MAAqB,CAAA;YACvC,IAAI,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;gBACrE,OAAO,CAAC,YAAY,CAAC,cAAc,EAAE,CAAA,MAAA,OAAO,CAAC,WAAW,0CAAE,IAAI,EAAE,KAAI,EAAE,CAAC,CAAA;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ED,gBAAgB;;QACd,MAAM,MAAM,GAAG,MAAA,IAAI,CAAC,IAAI,CAAC,UAAU,mCAAI,IAAI,CAAC,IAAI,CAAA;QAChD,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,IAAI,CAAC,eAAe,CAAC,CAAA;QAC7D,MAAM,CAAC,mBAAmB,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,CAAC,CAAA;IAC7D,CAAC;CA0BF","sourcesContent":["import { ReactiveController, ReactiveControllerHost } from 'lit'\nimport { hasOverflow } from '../has-overflow'\n\nexport class TooltipMouseController implements ReactiveController {\n private host: ReactiveControllerHost & HTMLElement\n private attributeName: string\n\n constructor(host: ReactiveControllerHost & HTMLElement, attributeName: string = 'data-reactive-tooltip') {\n this.host = host\n this.attributeName = attributeName\n host.addController(this)\n }\n\n hostConnected() {\n const target = this.host.shadowRoot ?? this.host\n target.addEventListener('mouseover', this.handleMouseOver)\n target.addEventListener('mouseout', this.handleMouseOut)\n }\n\n hostDisconnected() {\n const target = this.host.shadowRoot ?? this.host\n target.removeEventListener('mouseover', this.handleMouseOver)\n target.removeEventListener('mouseout', this.handleMouseOut)\n }\n\n private handleMouseOver = (e: Event) => {\n const element = e.target as HTMLElement\n if (element.hasAttribute(this.attributeName) && hasOverflow(element)) {\n element.setAttribute('data-tooltip', element.textContent?.trim() || '')\n\n // Calculate tooltip position\n const rect = element.getBoundingClientRect()\n const top = rect.top + rect.height // - window.scrollY\n const left = rect.left + window.scrollX\n\n // Set CSS variables for position\n element.style.setProperty('--tooltip-top', `${top}px`)\n element.style.setProperty('--tooltip-left', `${left}px`)\n }\n }\n\n private handleMouseOut = (e: Event) => {\n const element = e.target as HTMLElement\n if (element.hasAttribute('data-tooltip')) {\n element.removeAttribute('data-tooltip')\n element.style.removeProperty('--tooltip-top')\n element.style.removeProperty('--tooltip-left')\n }\n }\n}\n"]}
|