@elcrm/tooltip 0.0.3 → 0.1.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/LICENSE +21 -0
- package/README.md +97 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +48 -30
- package/dist/index.es.js +150 -708
- package/dist/index.umd.js +2 -31
- package/package.json +66 -7
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2026 MaSkal
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# `@elcrm/tooltip`
|
|
2
|
+
|
|
3
|
+
React-подсказки для elCRM: portal в `document.body`, общий стек **z-index** (`globalThis.elcrm.overlayZ`), показ по hover/focus, позиция с clamp к краям viewport. Не нативный `title`.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@elcrm/tooltip)
|
|
6
|
+
[](https://www.npmjs.com/package/@elcrm/tooltip)
|
|
7
|
+
|
|
8
|
+
## Установка
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @elcrm/tooltip
|
|
12
|
+
# или
|
|
13
|
+
bun add @elcrm/tooltip
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
**Требования:** Node.js ≥ 18. Peer-зависимости: `react` ≥ 18, `react-dom` ≥ 18.
|
|
17
|
+
|
|
18
|
+
Для разработки пакета удобен **Bun** ≥ 1.3 (см. `deploy.md` / `dev.md`).
|
|
19
|
+
|
|
20
|
+
## Быстрый старт
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { Tooltip } from "@elcrm/tooltip";
|
|
24
|
+
import "@elcrm/tooltip/style.css";
|
|
25
|
+
|
|
26
|
+
function Example() {
|
|
27
|
+
return (
|
|
28
|
+
<Tooltip content="Подсказка" placement="top">
|
|
29
|
+
<button type="button">Наведите</button>
|
|
30
|
+
</Tooltip>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Стили также инжектятся при импорте JS (через `vite-plugin-lib-inject-css`). Явный импорт `@elcrm/tooltip/style.css` полезен для SSR или если CSS нужен отдельно.
|
|
36
|
+
|
|
37
|
+
В elWMS удобнее `IconAction` (`tip=…`).
|
|
38
|
+
|
|
39
|
+
## API
|
|
40
|
+
|
|
41
|
+
### `Tooltip`
|
|
42
|
+
|
|
43
|
+
| Проп | Тип | По умолчанию | Описание |
|
|
44
|
+
| ------------- | ---------------------------------------- | ------------ | --------------------------------- |
|
|
45
|
+
| `content` | `ReactNode` | — | Текст или разметка подсказки |
|
|
46
|
+
| `children` | `ReactNode` | — | Якорь (триггер) |
|
|
47
|
+
| `placement` | `"top" \| "bottom" \| "left" \| "right"` | `"top"` | Сторона относительно якоря |
|
|
48
|
+
| `orientation` | то же, что `placement` | — | **@deprecated** — используйте `placement` |
|
|
49
|
+
| `textAlign` | `"center" \| "left" \| "right"` | `"center"` | Выравнивание текста |
|
|
50
|
+
| `delay` | `number` | `180` | Задержка показа, мс |
|
|
51
|
+
| `delayHide` | `number` | `60` | Задержка скрытия, мс |
|
|
52
|
+
| `disabled` | `boolean` | `false` | Не показывать |
|
|
53
|
+
| `open` | `boolean` | — | Принудительно открыт (отладка) |
|
|
54
|
+
| `className` | `string` | — | Класс на обёртке якоря |
|
|
55
|
+
|
|
56
|
+
### `overlayZ`
|
|
57
|
+
|
|
58
|
+
Общий стек с modal / form / alert / notice:
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
import {
|
|
62
|
+
acquireOverlayZIndex,
|
|
63
|
+
releaseOverlayZIndex,
|
|
64
|
+
peekOverlayZIndex,
|
|
65
|
+
} from "@elcrm/tooltip";
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Обычно вызывать вручную не нужно — `Tooltip` берёт и отпускает z-index сам.
|
|
69
|
+
|
|
70
|
+
## CSS-переменные
|
|
71
|
+
|
|
72
|
+
| Переменная | Назначение |
|
|
73
|
+
| ----------------------- | ----------------- |
|
|
74
|
+
| `--tooltip-background` | Фон |
|
|
75
|
+
| `--tooltip-color` | Цвет текста |
|
|
76
|
+
| `--tooltip-radius` | Скругление |
|
|
77
|
+
| `--tooltip-max-width` | Макс. ширина |
|
|
78
|
+
| `--tooltip-font-size` | Размер шрифта |
|
|
79
|
+
| `--tooltip-padding` | Внутренние отступы |
|
|
80
|
+
| `--tooltip-shadow` | Тень |
|
|
81
|
+
| `--tooltip-gap` | Зазор до якоря |
|
|
82
|
+
|
|
83
|
+
## Поведение
|
|
84
|
+
|
|
85
|
+
- SSR-безопасно (без `document` portal не создаётся)
|
|
86
|
+
- Portal в `document.body`
|
|
87
|
+
- ARIA: `role="tooltip"`, `aria-describedby` на якоре
|
|
88
|
+
- При нехватке места сторона зеркалится (top↔bottom, left↔right)
|
|
89
|
+
- Позиция обновляется на `resize` / `scroll` (capture)
|
|
90
|
+
|
|
91
|
+
## Публикация
|
|
92
|
+
|
|
93
|
+
Автодеплой на npm через GitHub Actions — см. **[deploy.md](./deploy.md)**.
|
|
94
|
+
|
|
95
|
+
## Лицензия
|
|
96
|
+
|
|
97
|
+
MIT © MaSkal
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
@charset "UTF-8";:root{--tooltip-background: #1e1f24;--tooltip-color: rgba(255, 255, 255, .92);--tooltip-radius: 10px;--tooltip-max-width: 280px;--tooltip-font-size: 13px;--tooltip-padding: 8px 10px;--tooltip-shadow: 0 8px 24px rgba(0, 0, 0, .28);--tooltip-gap: 8px}._t_ai3lm_13{position:fixed;box-sizing:border-box;max-width:var(--tooltip-max-width);padding:var(--tooltip-padding);border-radius:var(--tooltip-radius);background:var(--tooltip-background);color:var(--tooltip-color);font-size:var(--tooltip-font-size);line-height:1.35;font-weight:500;box-shadow:var(--tooltip-shadow);pointer-events:none;opacity:0;transition:opacity .12s ease;white-space:normal;word-break:break-word}._t_ai3lm_13[data-visible=true]{opacity:1}._t_ai3lm_13[data-align=left]{text-align:left}._t_ai3lm_13[data-align=center]{text-align:center}._t_ai3lm_13[data-align=right]{text-align:right}._t_ai3lm_13:before{content:"";position:fixed;pointer-events:none;width:0;height:0;top:var(--tooltip-arrow-y);left:var(--tooltip-arrow-x);transform:var(--tooltip-arrow-r, none);margin-left:-6px;border-width:6px;border-style:solid;border-color:var(--tooltip-background) transparent transparent transparent}._root_ai3lm_64{display:inline-flex;vertical-align:middle;max-width:100%}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,30 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Счётчик z-index оверлеев — общий через globalThis.elcrm.overlayZ
|
|
6
|
+
* (тот же стек, что у modal / form / alert / notice).
|
|
7
|
+
*/
|
|
8
|
+
/** Выделить z-index поверх текущего стека оверлеев */
|
|
9
|
+
export declare function acquireOverlayZIndex(): number;
|
|
10
|
+
|
|
11
|
+
/** @deprecated используйте `Tooltip` */
|
|
12
|
+
export declare const Item: () => null;
|
|
13
|
+
|
|
14
|
+
/** Текущий верхний активный слой (или FLOOR) */
|
|
15
|
+
export declare function peekOverlayZIndex(): number;
|
|
16
|
+
|
|
17
|
+
/** Освободить слой; при пустом стеке сброс счётчика */
|
|
18
|
+
export declare function releaseOverlayZIndex(z: number): void;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Подсказка при наведении / фокусе.
|
|
22
|
+
* Рендер в portal + z-index из общего стека оверлеев elCRM.
|
|
23
|
+
*/
|
|
24
|
+
export declare function Tooltip({ content, children, placement, orientation, textAlign, delay, delayHide, className, disabled, open: openForced, }: TooltipProps): default_2.JSX.Element;
|
|
25
|
+
|
|
26
|
+
export declare type TooltipPlacement = "top" | "bottom" | "left" | "right";
|
|
27
|
+
|
|
28
|
+
export declare type TooltipProps = {
|
|
29
|
+
/** Текст или разметка подсказки */
|
|
30
|
+
content: ReactNode;
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
/** Сторона относительно якоря */
|
|
33
|
+
placement?: TooltipPlacement;
|
|
34
|
+
/** @deprecated используйте placement */
|
|
35
|
+
orientation?: TooltipPlacement;
|
|
36
|
+
textAlign?: "center" | "left" | "right";
|
|
37
|
+
/** Задержка показа, мс */
|
|
38
|
+
delay?: number;
|
|
39
|
+
/** Задержка скрытия, мс */
|
|
40
|
+
delayHide?: number;
|
|
41
|
+
className?: string;
|
|
42
|
+
/** Не показывать */
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
/** Принудительно открыт (отладка) */
|
|
45
|
+
open?: boolean;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export { }
|
package/dist/index.es.js
CHANGED
|
@@ -1,717 +1,159 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { createPortal as
|
|
3
|
-
import './index.css';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import P, { useId as A, useRef as v, useState as T, useCallback as X, useLayoutEffect as B, useEffect as D } from "react";
|
|
2
|
+
import { createPortal as V } from "react-dom";
|
|
3
|
+
import './index.css';const F = "0.1.0", J = {
|
|
4
|
+
version: F
|
|
5
|
+
}, K = "_t_ai3lm_13", Q = "_root_ai3lm_64", z = {
|
|
6
|
+
t: K,
|
|
7
|
+
root: Q
|
|
8
|
+
}, Y = 1e3, U = 10;
|
|
9
|
+
function R() {
|
|
10
|
+
const e = globalThis;
|
|
11
|
+
return e.elcrm || (e.elcrm = {}), e.elcrm.overlayZ || (e.elcrm.overlayZ = { seq: 0, active: /* @__PURE__ */ new Set() }), e.elcrm.overlayZ;
|
|
12
|
+
}
|
|
13
|
+
function ee() {
|
|
14
|
+
const e = R();
|
|
15
|
+
e.seq += 1;
|
|
16
|
+
const t = Y + e.seq * U;
|
|
17
|
+
return e.active.add(t), t;
|
|
18
|
+
}
|
|
19
|
+
function C(e) {
|
|
20
|
+
const t = R();
|
|
21
|
+
t.active.delete(e), t.active.size === 0 && (t.seq = 0);
|
|
22
|
+
}
|
|
23
|
+
function oe() {
|
|
24
|
+
const e = R();
|
|
25
|
+
return e.active.size === 0 ? Y : Math.max(...e.active);
|
|
26
|
+
}
|
|
27
|
+
const n = 8, s = 8;
|
|
28
|
+
function te(e, t, y) {
|
|
29
|
+
const w = e.left + e.width / 2, d = e.top + e.height / 2;
|
|
30
|
+
let o = 0, i = 0, u = w, l = 0, r = "";
|
|
31
|
+
const m = (p) => Math.min(
|
|
32
|
+
Math.max(s, p),
|
|
33
|
+
window.innerWidth - t.width - s
|
|
34
|
+
);
|
|
35
|
+
switch (y) {
|
|
36
|
+
case "top":
|
|
37
|
+
o = e.top - t.height - n, i = m(w - t.width / 2), l = e.top - n, r = "", o < s && (o = e.bottom + n, l = e.bottom + n - 2, r = "rotate(180deg)");
|
|
38
|
+
break;
|
|
39
|
+
case "bottom":
|
|
40
|
+
o = e.bottom + n, i = m(w - t.width / 2), l = e.bottom + n - 2, r = "rotate(180deg)", o + t.height > window.innerHeight - s && (o = e.top - t.height - n, l = e.top - n, r = "");
|
|
41
|
+
break;
|
|
42
|
+
case "left":
|
|
43
|
+
o = Math.min(
|
|
44
|
+
Math.max(s, d - t.height / 2),
|
|
45
|
+
window.innerHeight - t.height - s
|
|
46
|
+
), i = e.left - t.width - n, u = e.left - n + 2, l = d, r = "rotate(270deg)", i < s && (i = e.right + n, u = e.right + n - 2, r = "rotate(90deg)");
|
|
47
|
+
break;
|
|
48
|
+
case "right":
|
|
49
|
+
o = Math.min(
|
|
50
|
+
Math.max(s, d - t.height / 2),
|
|
51
|
+
window.innerHeight - t.height - s
|
|
52
|
+
), i = e.right + n, u = e.right + n - 2, l = d, r = "rotate(90deg)", i + t.width > window.innerWidth - s && (i = e.left - t.width - n, u = e.left - n + 2, r = "rotate(270deg)");
|
|
53
|
+
break;
|
|
24
54
|
}
|
|
25
|
-
return
|
|
55
|
+
return { top: o, left: i, arrowX: u, arrowY: l, arrowR: r };
|
|
26
56
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return !!(typeof e == "string" || typeof e == "function" || e === E || e === m || Ae || e === x || e === g || e === l || Fe || e === Y || je || ke || De || typeof e == "object" && e !== null && (e.$$typeof === P || e.$$typeof === R || e.$$typeof === u || e.$$typeof === c || e.$$typeof === d || // This needs to include all possible module reference object
|
|
69
|
-
// types supported by any Flight configuration anywhere since
|
|
70
|
-
// we don't know which Flight build this will end up being used
|
|
71
|
-
// with.
|
|
72
|
-
e.$$typeof === ee || e.getModuleId !== void 0));
|
|
73
|
-
}
|
|
74
|
-
function We(e, r, t) {
|
|
75
|
-
var n = e.displayName;
|
|
76
|
-
if (n)
|
|
77
|
-
return n;
|
|
78
|
-
var i = r.displayName || r.name || "";
|
|
79
|
-
return i !== "" ? t + "(" + i + ")" : t;
|
|
80
|
-
}
|
|
81
|
-
function re(e) {
|
|
82
|
-
return e.displayName || "Context";
|
|
83
|
-
}
|
|
84
|
-
function T(e) {
|
|
85
|
-
if (e == null)
|
|
86
|
-
return null;
|
|
87
|
-
if (typeof e.tag == "number" && y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
88
|
-
return e.displayName || e.name || null;
|
|
89
|
-
if (typeof e == "string")
|
|
90
|
-
return e;
|
|
91
|
-
switch (e) {
|
|
92
|
-
case E:
|
|
93
|
-
return "Fragment";
|
|
94
|
-
case O:
|
|
95
|
-
return "Portal";
|
|
96
|
-
case m:
|
|
97
|
-
return "Profiler";
|
|
98
|
-
case x:
|
|
99
|
-
return "StrictMode";
|
|
100
|
-
case g:
|
|
101
|
-
return "Suspense";
|
|
102
|
-
case l:
|
|
103
|
-
return "SuspenseList";
|
|
104
|
-
}
|
|
105
|
-
if (typeof e == "object")
|
|
106
|
-
switch (e.$$typeof) {
|
|
107
|
-
case c:
|
|
108
|
-
var r = e;
|
|
109
|
-
return re(r) + ".Consumer";
|
|
110
|
-
case u:
|
|
111
|
-
var t = e;
|
|
112
|
-
return re(t._context) + ".Provider";
|
|
113
|
-
case d:
|
|
114
|
-
return We(e, e.render, "ForwardRef");
|
|
115
|
-
case R:
|
|
116
|
-
var n = e.displayName || null;
|
|
117
|
-
return n !== null ? n : T(e.type) || "Memo";
|
|
118
|
-
case P: {
|
|
119
|
-
var i = e, s = i._payload, o = i._init;
|
|
120
|
-
try {
|
|
121
|
-
return T(o(s));
|
|
122
|
-
} catch {
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return null;
|
|
128
|
-
}
|
|
129
|
-
var C = Object.assign, F = 0, te, ne, ae, oe, ie, ue, le;
|
|
130
|
-
function se() {
|
|
131
|
-
}
|
|
132
|
-
se.__reactDisabledLog = !0;
|
|
133
|
-
function $e() {
|
|
134
|
-
{
|
|
135
|
-
if (F === 0) {
|
|
136
|
-
te = console.log, ne = console.info, ae = console.warn, oe = console.error, ie = console.group, ue = console.groupCollapsed, le = console.groupEnd;
|
|
137
|
-
var e = {
|
|
138
|
-
configurable: !0,
|
|
139
|
-
enumerable: !0,
|
|
140
|
-
value: se,
|
|
141
|
-
writable: !0
|
|
142
|
-
};
|
|
143
|
-
Object.defineProperties(console, {
|
|
144
|
-
info: e,
|
|
145
|
-
log: e,
|
|
146
|
-
warn: e,
|
|
147
|
-
error: e,
|
|
148
|
-
group: e,
|
|
149
|
-
groupCollapsed: e,
|
|
150
|
-
groupEnd: e
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
F++;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
function Ye() {
|
|
157
|
-
{
|
|
158
|
-
if (F--, F === 0) {
|
|
159
|
-
var e = {
|
|
160
|
-
configurable: !0,
|
|
161
|
-
enumerable: !0,
|
|
162
|
-
writable: !0
|
|
163
|
-
};
|
|
164
|
-
Object.defineProperties(console, {
|
|
165
|
-
log: C({}, e, {
|
|
166
|
-
value: te
|
|
167
|
-
}),
|
|
168
|
-
info: C({}, e, {
|
|
169
|
-
value: ne
|
|
170
|
-
}),
|
|
171
|
-
warn: C({}, e, {
|
|
172
|
-
value: ae
|
|
173
|
-
}),
|
|
174
|
-
error: C({}, e, {
|
|
175
|
-
value: oe
|
|
176
|
-
}),
|
|
177
|
-
group: C({}, e, {
|
|
178
|
-
value: ie
|
|
179
|
-
}),
|
|
180
|
-
groupCollapsed: C({}, e, {
|
|
181
|
-
value: ue
|
|
182
|
-
}),
|
|
183
|
-
groupEnd: C({}, e, {
|
|
184
|
-
value: le
|
|
185
|
-
})
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
F < 0 && y("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
var B = j.ReactCurrentDispatcher, J;
|
|
192
|
-
function M(e, r, t) {
|
|
193
|
-
{
|
|
194
|
-
if (J === void 0)
|
|
195
|
-
try {
|
|
196
|
-
throw Error();
|
|
197
|
-
} catch (i) {
|
|
198
|
-
var n = i.stack.trim().match(/\n( *(at )?)/);
|
|
199
|
-
J = n && n[1] || "";
|
|
200
|
-
}
|
|
201
|
-
return `
|
|
202
|
-
` + J + e;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
var K = !1, L;
|
|
206
|
-
{
|
|
207
|
-
var Me = typeof WeakMap == "function" ? WeakMap : Map;
|
|
208
|
-
L = new Me();
|
|
209
|
-
}
|
|
210
|
-
function fe(e, r) {
|
|
211
|
-
if (!e || K)
|
|
212
|
-
return "";
|
|
213
|
-
{
|
|
214
|
-
var t = L.get(e);
|
|
215
|
-
if (t !== void 0)
|
|
216
|
-
return t;
|
|
217
|
-
}
|
|
218
|
-
var n;
|
|
219
|
-
K = !0;
|
|
220
|
-
var i = Error.prepareStackTrace;
|
|
221
|
-
Error.prepareStackTrace = void 0;
|
|
222
|
-
var s;
|
|
223
|
-
s = B.current, B.current = null, $e();
|
|
224
|
-
try {
|
|
225
|
-
if (r) {
|
|
226
|
-
var o = function() {
|
|
227
|
-
throw Error();
|
|
228
|
-
};
|
|
229
|
-
if (Object.defineProperty(o.prototype, "props", {
|
|
230
|
-
set: function() {
|
|
231
|
-
throw Error();
|
|
232
|
-
}
|
|
233
|
-
}), typeof Reflect == "object" && Reflect.construct) {
|
|
234
|
-
try {
|
|
235
|
-
Reflect.construct(o, []);
|
|
236
|
-
} catch (b) {
|
|
237
|
-
n = b;
|
|
238
|
-
}
|
|
239
|
-
Reflect.construct(e, [], o);
|
|
240
|
-
} else {
|
|
241
|
-
try {
|
|
242
|
-
o.call();
|
|
243
|
-
} catch (b) {
|
|
244
|
-
n = b;
|
|
245
|
-
}
|
|
246
|
-
e.call(o.prototype);
|
|
247
|
-
}
|
|
248
|
-
} else {
|
|
249
|
-
try {
|
|
250
|
-
throw Error();
|
|
251
|
-
} catch (b) {
|
|
252
|
-
n = b;
|
|
253
|
-
}
|
|
254
|
-
e();
|
|
255
|
-
}
|
|
256
|
-
} catch (b) {
|
|
257
|
-
if (b && n && typeof b.stack == "string") {
|
|
258
|
-
for (var a = b.stack.split(`
|
|
259
|
-
`), h = n.stack.split(`
|
|
260
|
-
`), v = a.length - 1, p = h.length - 1; v >= 1 && p >= 0 && a[v] !== h[p]; )
|
|
261
|
-
p--;
|
|
262
|
-
for (; v >= 1 && p >= 0; v--, p--)
|
|
263
|
-
if (a[v] !== h[p]) {
|
|
264
|
-
if (v !== 1 || p !== 1)
|
|
265
|
-
do
|
|
266
|
-
if (v--, p--, p < 0 || a[v] !== h[p]) {
|
|
267
|
-
var _ = `
|
|
268
|
-
` + a[v].replace(" at new ", " at ");
|
|
269
|
-
return e.displayName && _.includes("<anonymous>") && (_ = _.replace("<anonymous>", e.displayName)), typeof e == "function" && L.set(e, _), _;
|
|
270
|
-
}
|
|
271
|
-
while (v >= 1 && p >= 0);
|
|
272
|
-
break;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
} finally {
|
|
276
|
-
K = !1, B.current = s, Ye(), Error.prepareStackTrace = i;
|
|
277
|
-
}
|
|
278
|
-
var D = e ? e.displayName || e.name : "", S = D ? M(D) : "";
|
|
279
|
-
return typeof e == "function" && L.set(e, S), S;
|
|
280
|
-
}
|
|
281
|
-
function Le(e, r, t) {
|
|
282
|
-
return fe(e, !1);
|
|
283
|
-
}
|
|
284
|
-
function Ve(e) {
|
|
285
|
-
var r = e.prototype;
|
|
286
|
-
return !!(r && r.isReactComponent);
|
|
287
|
-
}
|
|
288
|
-
function V(e, r, t) {
|
|
289
|
-
if (e == null)
|
|
290
|
-
return "";
|
|
291
|
-
if (typeof e == "function")
|
|
292
|
-
return fe(e, Ve(e));
|
|
293
|
-
if (typeof e == "string")
|
|
294
|
-
return M(e);
|
|
295
|
-
switch (e) {
|
|
296
|
-
case g:
|
|
297
|
-
return M("Suspense");
|
|
298
|
-
case l:
|
|
299
|
-
return M("SuspenseList");
|
|
300
|
-
}
|
|
301
|
-
if (typeof e == "object")
|
|
302
|
-
switch (e.$$typeof) {
|
|
303
|
-
case d:
|
|
304
|
-
return Le(e.render);
|
|
305
|
-
case R:
|
|
306
|
-
return V(e.type, r, t);
|
|
307
|
-
case P: {
|
|
308
|
-
var n = e, i = n._payload, s = n._init;
|
|
309
|
-
try {
|
|
310
|
-
return V(s(i), r, t);
|
|
311
|
-
} catch {
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
return "";
|
|
316
|
-
}
|
|
317
|
-
var A = Object.prototype.hasOwnProperty, ce = {}, de = j.ReactDebugCurrentFrame;
|
|
318
|
-
function U(e) {
|
|
319
|
-
if (e) {
|
|
320
|
-
var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
|
|
321
|
-
de.setExtraStackFrame(t);
|
|
322
|
-
} else
|
|
323
|
-
de.setExtraStackFrame(null);
|
|
324
|
-
}
|
|
325
|
-
function Ue(e, r, t, n, i) {
|
|
326
|
-
{
|
|
327
|
-
var s = Function.call.bind(A);
|
|
328
|
-
for (var o in e)
|
|
329
|
-
if (s(e, o)) {
|
|
330
|
-
var a = void 0;
|
|
331
|
-
try {
|
|
332
|
-
if (typeof e[o] != "function") {
|
|
333
|
-
var h = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
334
|
-
throw h.name = "Invariant Violation", h;
|
|
335
|
-
}
|
|
336
|
-
a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
337
|
-
} catch (v) {
|
|
338
|
-
a = v;
|
|
339
|
-
}
|
|
340
|
-
a && !(a instanceof Error) && (U(i), y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), U(null)), a instanceof Error && !(a.message in ce) && (ce[a.message] = !0, U(i), y("Failed %s type: %s", t, a.message), U(null));
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
var Ne = Array.isArray;
|
|
345
|
-
function q(e) {
|
|
346
|
-
return Ne(e);
|
|
347
|
-
}
|
|
348
|
-
function Be(e) {
|
|
349
|
-
{
|
|
350
|
-
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
351
|
-
return t;
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
function Je(e) {
|
|
355
|
-
try {
|
|
356
|
-
return ve(e), !1;
|
|
357
|
-
} catch {
|
|
358
|
-
return !0;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
function ve(e) {
|
|
362
|
-
return "" + e;
|
|
363
|
-
}
|
|
364
|
-
function pe(e) {
|
|
365
|
-
if (Je(e))
|
|
366
|
-
return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Be(e)), ve(e);
|
|
367
|
-
}
|
|
368
|
-
var ye = j.ReactCurrentOwner, Ke = {
|
|
369
|
-
key: !0,
|
|
370
|
-
ref: !0,
|
|
371
|
-
__self: !0,
|
|
372
|
-
__source: !0
|
|
373
|
-
}, he, ge;
|
|
374
|
-
function qe(e) {
|
|
375
|
-
if (A.call(e, "ref")) {
|
|
376
|
-
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
377
|
-
if (r && r.isReactWarning)
|
|
378
|
-
return !1;
|
|
379
|
-
}
|
|
380
|
-
return e.ref !== void 0;
|
|
381
|
-
}
|
|
382
|
-
function Ge(e) {
|
|
383
|
-
if (A.call(e, "key")) {
|
|
384
|
-
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
385
|
-
if (r && r.isReactWarning)
|
|
386
|
-
return !1;
|
|
387
|
-
}
|
|
388
|
-
return e.key !== void 0;
|
|
389
|
-
}
|
|
390
|
-
function ze(e, r) {
|
|
391
|
-
typeof e.ref == "string" && ye.current;
|
|
392
|
-
}
|
|
393
|
-
function Xe(e, r) {
|
|
394
|
-
{
|
|
395
|
-
var t = function() {
|
|
396
|
-
he || (he = !0, y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
397
|
-
};
|
|
398
|
-
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
399
|
-
get: t,
|
|
400
|
-
configurable: !0
|
|
401
|
-
});
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
function He(e, r) {
|
|
405
|
-
{
|
|
406
|
-
var t = function() {
|
|
407
|
-
ge || (ge = !0, y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
408
|
-
};
|
|
409
|
-
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
410
|
-
get: t,
|
|
411
|
-
configurable: !0
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
var Ze = function(e, r, t, n, i, s, o) {
|
|
416
|
-
var a = {
|
|
417
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
418
|
-
$$typeof: f,
|
|
419
|
-
// Built-in properties that belong on the element
|
|
420
|
-
type: e,
|
|
421
|
-
key: r,
|
|
422
|
-
ref: t,
|
|
423
|
-
props: o,
|
|
424
|
-
// Record the component responsible for creating this element.
|
|
425
|
-
_owner: s
|
|
426
|
-
};
|
|
427
|
-
return a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
428
|
-
configurable: !1,
|
|
429
|
-
enumerable: !1,
|
|
430
|
-
writable: !0,
|
|
431
|
-
value: !1
|
|
432
|
-
}), Object.defineProperty(a, "_self", {
|
|
433
|
-
configurable: !1,
|
|
434
|
-
enumerable: !1,
|
|
435
|
-
writable: !1,
|
|
436
|
-
value: n
|
|
437
|
-
}), Object.defineProperty(a, "_source", {
|
|
438
|
-
configurable: !1,
|
|
439
|
-
enumerable: !1,
|
|
440
|
-
writable: !1,
|
|
441
|
-
value: i
|
|
442
|
-
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
57
|
+
function ie({
|
|
58
|
+
content: e,
|
|
59
|
+
children: t,
|
|
60
|
+
placement: y,
|
|
61
|
+
orientation: w,
|
|
62
|
+
textAlign: d = "center",
|
|
63
|
+
delay: o = 180,
|
|
64
|
+
delayHide: i = 60,
|
|
65
|
+
className: u,
|
|
66
|
+
disabled: l = !1,
|
|
67
|
+
open: r
|
|
68
|
+
}) {
|
|
69
|
+
const m = y ?? w ?? "top", p = A(), M = v(null), k = v(null), b = v(null), x = v(null), c = v(null), [G, L] = T(!1), [a, O] = T(null), [Z, S] = T(null), E = () => {
|
|
70
|
+
b.current != null && (window.clearTimeout(b.current), b.current = null), x.current != null && (window.clearTimeout(x.current), x.current = null);
|
|
71
|
+
}, _ = X(() => {
|
|
72
|
+
l || e == null || e === "" || (E(), b.current = window.setTimeout(() => {
|
|
73
|
+
L(!0);
|
|
74
|
+
}, o));
|
|
75
|
+
}, [e, o, l]), q = X(() => {
|
|
76
|
+
r || (E(), x.current = window.setTimeout(() => {
|
|
77
|
+
L(!1), O(null);
|
|
78
|
+
}, i));
|
|
79
|
+
}, [i, r]), f = r || G;
|
|
80
|
+
B(() => {
|
|
81
|
+
if (f) {
|
|
82
|
+
if (c.current == null) {
|
|
83
|
+
const g = ee();
|
|
84
|
+
c.current = g, S(g);
|
|
85
|
+
}
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
c.current != null && (C(c.current), c.current = null, S(null));
|
|
89
|
+
}, [f]), D(() => () => {
|
|
90
|
+
E(), c.current != null && (C(c.current), c.current = null);
|
|
91
|
+
}, []), B(() => {
|
|
92
|
+
if (!f) return;
|
|
93
|
+
const g = M.current, $ = k.current;
|
|
94
|
+
if (!g || !$) return;
|
|
95
|
+
const h = () => {
|
|
96
|
+
const W = g.getBoundingClientRect(), j = $.getBoundingClientRect();
|
|
97
|
+
O(te(W, j, m));
|
|
443
98
|
};
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
var s, o = {}, a = null, h = null;
|
|
447
|
-
t !== void 0 && (pe(t), a = "" + t), Ge(r) && (pe(r.key), a = "" + r.key), qe(r) && (h = r.ref, ze(r, i));
|
|
448
|
-
for (s in r)
|
|
449
|
-
A.call(r, s) && !Ke.hasOwnProperty(s) && (o[s] = r[s]);
|
|
450
|
-
if (e && e.defaultProps) {
|
|
451
|
-
var v = e.defaultProps;
|
|
452
|
-
for (s in v)
|
|
453
|
-
o[s] === void 0 && (o[s] = v[s]);
|
|
454
|
-
}
|
|
455
|
-
if (a || h) {
|
|
456
|
-
var p = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
457
|
-
a && Xe(o, p), h && He(o, p);
|
|
458
|
-
}
|
|
459
|
-
return Ze(e, a, h, i, n, ye.current, o);
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
var G = j.ReactCurrentOwner, be = j.ReactDebugCurrentFrame;
|
|
463
|
-
function k(e) {
|
|
464
|
-
if (e) {
|
|
465
|
-
var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
|
|
466
|
-
be.setExtraStackFrame(t);
|
|
467
|
-
} else
|
|
468
|
-
be.setExtraStackFrame(null);
|
|
469
|
-
}
|
|
470
|
-
var z;
|
|
471
|
-
z = !1;
|
|
472
|
-
function X(e) {
|
|
473
|
-
return typeof e == "object" && e !== null && e.$$typeof === f;
|
|
474
|
-
}
|
|
475
|
-
function _e() {
|
|
476
|
-
{
|
|
477
|
-
if (G.current) {
|
|
478
|
-
var e = T(G.current.type);
|
|
479
|
-
if (e)
|
|
480
|
-
return `
|
|
481
|
-
|
|
482
|
-
Check the render method of \`` + e + "`.";
|
|
483
|
-
}
|
|
484
|
-
return "";
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
function er(e) {
|
|
488
|
-
return "";
|
|
489
|
-
}
|
|
490
|
-
var Ee = {};
|
|
491
|
-
function rr(e) {
|
|
492
|
-
{
|
|
493
|
-
var r = _e();
|
|
494
|
-
if (!r) {
|
|
495
|
-
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
496
|
-
t && (r = `
|
|
497
|
-
|
|
498
|
-
Check the top-level render call using <` + t + ">.");
|
|
499
|
-
}
|
|
500
|
-
return r;
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
function Re(e, r) {
|
|
504
|
-
{
|
|
505
|
-
if (!e._store || e._store.validated || e.key != null)
|
|
506
|
-
return;
|
|
507
|
-
e._store.validated = !0;
|
|
508
|
-
var t = rr(r);
|
|
509
|
-
if (Ee[t])
|
|
510
|
-
return;
|
|
511
|
-
Ee[t] = !0;
|
|
512
|
-
var n = "";
|
|
513
|
-
e && e._owner && e._owner !== G.current && (n = " It was passed a child from " + T(e._owner.type) + "."), k(e), y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), k(null);
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
function me(e, r) {
|
|
517
|
-
{
|
|
518
|
-
if (typeof e != "object")
|
|
519
|
-
return;
|
|
520
|
-
if (q(e))
|
|
521
|
-
for (var t = 0; t < e.length; t++) {
|
|
522
|
-
var n = e[t];
|
|
523
|
-
X(n) && Re(n, r);
|
|
524
|
-
}
|
|
525
|
-
else if (X(e))
|
|
526
|
-
e._store && (e._store.validated = !0);
|
|
527
|
-
else if (e) {
|
|
528
|
-
var i = Ce(e);
|
|
529
|
-
if (typeof i == "function" && i !== e.entries)
|
|
530
|
-
for (var s = i.call(e), o; !(o = s.next()).done; )
|
|
531
|
-
X(o.value) && Re(o.value, r);
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
function tr(e) {
|
|
536
|
-
{
|
|
537
|
-
var r = e.type;
|
|
538
|
-
if (r == null || typeof r == "string")
|
|
539
|
-
return;
|
|
540
|
-
var t;
|
|
541
|
-
if (typeof r == "function")
|
|
542
|
-
t = r.propTypes;
|
|
543
|
-
else if (typeof r == "object" && (r.$$typeof === d || // Note: Memo only checks outer props here.
|
|
544
|
-
// Inner props are checked in the reconciler.
|
|
545
|
-
r.$$typeof === R))
|
|
546
|
-
t = r.propTypes;
|
|
547
|
-
else
|
|
548
|
-
return;
|
|
549
|
-
if (t) {
|
|
550
|
-
var n = T(r);
|
|
551
|
-
Ue(t, e.props, "prop", n, e);
|
|
552
|
-
} else if (r.PropTypes !== void 0 && !z) {
|
|
553
|
-
z = !0;
|
|
554
|
-
var i = T(r);
|
|
555
|
-
y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
|
|
556
|
-
}
|
|
557
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
function nr(e) {
|
|
561
|
-
{
|
|
562
|
-
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
563
|
-
var n = r[t];
|
|
564
|
-
if (n !== "children" && n !== "key") {
|
|
565
|
-
k(e), y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), k(null);
|
|
566
|
-
break;
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
e.ref !== null && (k(e), y("Invalid attribute `ref` supplied to `React.Fragment`."), k(null));
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
var we = {};
|
|
573
|
-
function xe(e, r, t, n, i, s) {
|
|
574
|
-
{
|
|
575
|
-
var o = Ie(e);
|
|
576
|
-
if (!o) {
|
|
577
|
-
var a = "";
|
|
578
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
579
|
-
var h = er();
|
|
580
|
-
h ? a += h : a += _e();
|
|
581
|
-
var v;
|
|
582
|
-
e === null ? v = "null" : q(e) ? v = "array" : e !== void 0 && e.$$typeof === f ? (v = "<" + (T(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : v = typeof e, y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", v, a);
|
|
583
|
-
}
|
|
584
|
-
var p = Qe(e, r, t, i, s);
|
|
585
|
-
if (p == null)
|
|
586
|
-
return p;
|
|
587
|
-
if (o) {
|
|
588
|
-
var _ = r.children;
|
|
589
|
-
if (_ !== void 0)
|
|
590
|
-
if (n)
|
|
591
|
-
if (q(_)) {
|
|
592
|
-
for (var D = 0; D < _.length; D++)
|
|
593
|
-
me(_[D], e);
|
|
594
|
-
Object.freeze && Object.freeze(_);
|
|
595
|
-
} else
|
|
596
|
-
y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
597
|
-
else
|
|
598
|
-
me(_, e);
|
|
599
|
-
}
|
|
600
|
-
if (A.call(r, "key")) {
|
|
601
|
-
var S = T(e), b = Object.keys(r).filter(function(sr) {
|
|
602
|
-
return sr !== "key";
|
|
603
|
-
}), H = b.length > 0 ? "{key: someKey, " + b.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
604
|
-
if (!we[S + H]) {
|
|
605
|
-
var lr = b.length > 0 ? "{" + b.join(": ..., ") + ": ...}" : "{}";
|
|
606
|
-
y(`A props object containing a "key" prop is being spread into JSX:
|
|
607
|
-
let props = %s;
|
|
608
|
-
<%s {...props} />
|
|
609
|
-
React keys must be passed directly to JSX without using spread:
|
|
610
|
-
let props = %s;
|
|
611
|
-
<%s key={someKey} {...props} />`, H, S, lr, S), we[S + H] = !0;
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
return e === E ? nr(p) : tr(p), p;
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
function ar(e, r, t) {
|
|
618
|
-
return xe(e, r, t, !0);
|
|
619
|
-
}
|
|
620
|
-
function or(e, r, t) {
|
|
621
|
-
return xe(e, r, t, !1);
|
|
622
|
-
}
|
|
623
|
-
var ir = or, ur = ar;
|
|
624
|
-
W.Fragment = E, W.jsx = ir, W.jsxs = ur;
|
|
625
|
-
}()), W;
|
|
626
|
-
}
|
|
627
|
-
process.env.NODE_ENV === "production" ? Z.exports = cr() : Z.exports = dr();
|
|
628
|
-
var N = Z.exports;
|
|
629
|
-
const vr = "_t_bkucs_7", pr = {
|
|
630
|
-
t: vr
|
|
631
|
-
}, yr = ({
|
|
632
|
-
content: w,
|
|
633
|
-
position: f,
|
|
634
|
-
orientation: O = "up",
|
|
635
|
-
update: E,
|
|
636
|
-
textAlign: x
|
|
637
|
-
}) => {
|
|
638
|
-
const m = $.useRef(null);
|
|
639
|
-
return $.useEffect(() => {
|
|
640
|
-
const u = m.current;
|
|
641
|
-
u.style.opacity = "0", u.style.width = "auto", u.style.left = "0px", u.style.top = "0px";
|
|
642
|
-
let c = {
|
|
643
|
-
x: 0,
|
|
644
|
-
y: 0,
|
|
645
|
-
r: ""
|
|
99
|
+
return h(), window.addEventListener("resize", h), window.addEventListener("scroll", h, !0), () => {
|
|
100
|
+
window.removeEventListener("resize", h), window.removeEventListener("scroll", h, !0);
|
|
646
101
|
};
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
}, l = () => {
|
|
679
|
-
m || d(null);
|
|
680
|
-
};
|
|
681
|
-
return /* @__PURE__ */ N.jsxs(
|
|
102
|
+
}, [f, m, e]);
|
|
103
|
+
const H = a ? {
|
|
104
|
+
top: a.top,
|
|
105
|
+
left: a.left,
|
|
106
|
+
zIndex: Z ?? 1e3,
|
|
107
|
+
"--tooltip-arrow-x": `${a.arrowX}px`,
|
|
108
|
+
"--tooltip-arrow-y": `${a.arrowY}px`,
|
|
109
|
+
"--tooltip-arrow-r": a.arrowR || "none"
|
|
110
|
+
} : {
|
|
111
|
+
// скрытый замер до первой позиции
|
|
112
|
+
top: -9999,
|
|
113
|
+
left: -9999,
|
|
114
|
+
zIndex: Z ?? 1e3,
|
|
115
|
+
visibility: "hidden"
|
|
116
|
+
}, N = f && typeof document < "u" ? V(
|
|
117
|
+
/* @__PURE__ */ P.createElement(
|
|
118
|
+
"div",
|
|
119
|
+
{
|
|
120
|
+
ref: k,
|
|
121
|
+
id: p,
|
|
122
|
+
role: "tooltip",
|
|
123
|
+
className: z.t,
|
|
124
|
+
"data-visible": a ? "true" : "false",
|
|
125
|
+
"data-align": d,
|
|
126
|
+
style: H
|
|
127
|
+
},
|
|
128
|
+
e
|
|
129
|
+
),
|
|
130
|
+
document.body
|
|
131
|
+
) : null;
|
|
132
|
+
return /* @__PURE__ */ P.createElement(
|
|
682
133
|
"span",
|
|
683
134
|
{
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
position: c.getBoundingClientRect(),
|
|
695
|
-
textAlign: E,
|
|
696
|
-
update: Date.now()
|
|
697
|
-
}
|
|
698
|
-
) : /* @__PURE__ */ N.jsx(
|
|
699
|
-
yr,
|
|
700
|
-
{
|
|
701
|
-
update: Date.now(),
|
|
702
|
-
orientation: x,
|
|
703
|
-
content: w,
|
|
704
|
-
textAlign: E,
|
|
705
|
-
position: c.getBoundingClientRect()
|
|
706
|
-
}
|
|
707
|
-
),
|
|
708
|
-
document.body
|
|
709
|
-
)
|
|
710
|
-
]
|
|
711
|
-
}
|
|
135
|
+
ref: M,
|
|
136
|
+
className: u ? `${z.root} ${u}` : z.root,
|
|
137
|
+
onMouseEnter: _,
|
|
138
|
+
onMouseLeave: q,
|
|
139
|
+
onFocus: _,
|
|
140
|
+
onBlur: q,
|
|
141
|
+
"aria-describedby": f ? p : void 0
|
|
142
|
+
},
|
|
143
|
+
t,
|
|
144
|
+
N
|
|
712
145
|
);
|
|
713
|
-
}
|
|
146
|
+
}
|
|
147
|
+
const le = () => null;
|
|
148
|
+
function I() {
|
|
149
|
+
return typeof globalThis < "u" ? globalThis : {};
|
|
150
|
+
}
|
|
151
|
+
I().elcrm || (I().elcrm = {});
|
|
152
|
+
Object.assign(I().elcrm, { tooltip: J.version });
|
|
714
153
|
export {
|
|
715
|
-
|
|
716
|
-
|
|
154
|
+
le as Item,
|
|
155
|
+
ie as Tooltip,
|
|
156
|
+
ee as acquireOverlayZIndex,
|
|
157
|
+
oe as peekOverlayZIndex,
|
|
158
|
+
C as releaseOverlayZIndex
|
|
717
159
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1,31 +1,2 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
/*$vite$:1*/`,document.head.appendChild(
|
|
3
|
-
* @license React
|
|
4
|
-
* react-jsx-runtime.production.min.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var re;function ke(){if(re)return I;re=1;var T=x,f=Symbol.for("react.element"),P=Symbol.for("react.fragment"),E=Object.prototype.hasOwnProperty,O=T.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,w={key:!0,ref:!0,__self:!0,__source:!0};function u(c,d,g){var l,R={},S=null,L=null;g!==void 0&&(S=""+g),d.key!==void 0&&(S=""+d.key),d.ref!==void 0&&(L=d.ref);for(l in d)E.call(d,l)&&!w.hasOwnProperty(l)&&(R[l]=d[l]);if(c&&c.defaultProps)for(l in d=c.defaultProps,d)R[l]===void 0&&(R[l]=d[l]);return{$$typeof:f,type:c,key:S,ref:L,props:R,_owner:O.current}}return I.Fragment=P,I.jsx=u,I.jsxs=u,I}var $={};/**
|
|
11
|
-
* @license React
|
|
12
|
-
* react-jsx-runtime.development.js
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var te;function De(){return te||(te=1,process.env.NODE_ENV!=="production"&&function(){var T=x,f=Symbol.for("react.element"),P=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),L=Symbol.for("react.offscreen"),ae=Symbol.iterator,Ie="@@iterator";function $e(e){if(e===null||typeof e!="object")return null;var r=ae&&e[ae]||e[Ie];return typeof r=="function"?r:null}var D=T.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];We("error",e,t)}}function We(e,r,t){{var n=D.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var s=t.map(function(o){return String(o)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,s)}}var Me=!1,Ye=!1,Le=!1,Ve=!1,Ue=!1,oe;oe=Symbol.for("react.module.reference");function Ne(e){return!!(typeof e=="string"||typeof e=="function"||e===E||e===w||Ue||e===O||e===g||e===l||Ve||e===L||Me||Ye||Le||typeof e=="object"&&e!==null&&(e.$$typeof===S||e.$$typeof===R||e.$$typeof===u||e.$$typeof===c||e.$$typeof===d||e.$$typeof===oe||e.getModuleId!==void 0))}function Be(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function ie(e){return e.displayName||"Context"}function C(e){if(e==null)return null;if(typeof e.tag=="number"&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case P:return"Portal";case w:return"Profiler";case O:return"StrictMode";case g:return"Suspense";case l:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case c:var r=e;return ie(r)+".Consumer";case u:var t=e;return ie(t._context)+".Provider";case d:return Be(e,e.render,"ForwardRef");case R:var n=e.displayName||null;return n!==null?n:C(e.type)||"Memo";case S:{var i=e,s=i._payload,o=i._init;try{return C(o(s))}catch{return null}}}return null}var j=Object.assign,W=0,ue,le,se,fe,ce,de,ve;function pe(){}pe.__reactDisabledLog=!0;function qe(){{if(W===0){ue=console.log,le=console.info,se=console.warn,fe=console.error,ce=console.group,de=console.groupCollapsed,ve=console.groupEnd;var e={configurable:!0,enumerable:!0,value:pe,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}W++}}function Je(){{if(W--,W===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:j({},e,{value:ue}),info:j({},e,{value:le}),warn:j({},e,{value:se}),error:j({},e,{value:fe}),group:j({},e,{value:ce}),groupCollapsed:j({},e,{value:de}),groupEnd:j({},e,{value:ve})})}W<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var J=D.ReactCurrentDispatcher,K;function V(e,r,t){{if(K===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);K=n&&n[1]||""}return`
|
|
19
|
-
`+K+e}}var z=!1,U;{var Ke=typeof WeakMap=="function"?WeakMap:Map;U=new Ke}function ye(e,r){if(!e||z)return"";{var t=U.get(e);if(t!==void 0)return t}var n;z=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=J.current,J.current=null,qe();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(b){n=b}Reflect.construct(e,[],o)}else{try{o.call()}catch(b){n=b}e.call(o.prototype)}}else{try{throw Error()}catch(b){n=b}e()}}catch(b){if(b&&n&&typeof b.stack=="string"){for(var a=b.stack.split(`
|
|
20
|
-
`),h=n.stack.split(`
|
|
21
|
-
`),v=a.length-1,p=h.length-1;v>=1&&p>=0&&a[v]!==h[p];)p--;for(;v>=1&&p>=0;v--,p--)if(a[v]!==h[p]){if(v!==1||p!==1)do if(v--,p--,p<0||a[v]!==h[p]){var m=`
|
|
22
|
-
`+a[v].replace(" at new "," at ");return e.displayName&&m.includes("<anonymous>")&&(m=m.replace("<anonymous>",e.displayName)),typeof e=="function"&&U.set(e,m),m}while(v>=1&&p>=0);break}}}finally{z=!1,J.current=s,Je(),Error.prepareStackTrace=i}var A=e?e.displayName||e.name:"",k=A?V(A):"";return typeof e=="function"&&U.set(e,k),k}function ze(e,r,t){return ye(e,!1)}function Ge(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function N(e,r,t){if(e==null)return"";if(typeof e=="function")return ye(e,Ge(e));if(typeof e=="string")return V(e);switch(e){case g:return V("Suspense");case l:return V("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return ze(e.render);case R:return N(e.type,r,t);case S:{var n=e,i=n._payload,s=n._init;try{return N(s(i),r,t)}catch{}}}return""}var M=Object.prototype.hasOwnProperty,he={},ge=D.ReactDebugCurrentFrame;function B(e){if(e){var r=e._owner,t=N(e.type,e._source,r?r.type:null);ge.setExtraStackFrame(t)}else ge.setExtraStackFrame(null)}function Xe(e,r,t,n,i){{var s=Function.call.bind(M);for(var o in e)if(s(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var h=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(v){a=v}a&&!(a instanceof Error)&&(B(i),y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof a),B(null)),a instanceof Error&&!(a.message in he)&&(he[a.message]=!0,B(i),y("Failed %s type: %s",t,a.message),B(null))}}}var He=Array.isArray;function G(e){return He(e)}function Ze(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Qe(e){try{return be(e),!1}catch{return!0}}function be(e){return""+e}function me(e){if(Qe(e))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ze(e)),be(e)}var _e=D.ReactCurrentOwner,er={key:!0,ref:!0,__self:!0,__source:!0},Ee,Re;function rr(e){if(M.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function tr(e){if(M.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function nr(e,r){typeof e.ref=="string"&&_e.current}function ar(e,r){{var t=function(){Ee||(Ee=!0,y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function or(e,r){{var t=function(){Re||(Re=!0,y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var ir=function(e,r,t,n,i,s,o){var a={$$typeof:f,type:e,key:r,ref:t,props:o,_owner:s};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function ur(e,r,t,n,i){{var s,o={},a=null,h=null;t!==void 0&&(me(t),a=""+t),tr(r)&&(me(r.key),a=""+r.key),rr(r)&&(h=r.ref,nr(r,i));for(s in r)M.call(r,s)&&!er.hasOwnProperty(s)&&(o[s]=r[s]);if(e&&e.defaultProps){var v=e.defaultProps;for(s in v)o[s]===void 0&&(o[s]=v[s])}if(a||h){var p=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ar(o,p),h&&or(o,p)}return ir(e,a,h,i,n,_e.current,o)}}var X=D.ReactCurrentOwner,xe=D.ReactDebugCurrentFrame;function F(e){if(e){var r=e._owner,t=N(e.type,e._source,r?r.type:null);xe.setExtraStackFrame(t)}else xe.setExtraStackFrame(null)}var H;H=!1;function Z(e){return typeof e=="object"&&e!==null&&e.$$typeof===f}function we(){{if(X.current){var e=C(X.current.type);if(e)return`
|
|
23
|
-
|
|
24
|
-
Check the render method of \``+e+"`."}return""}}function lr(e){return""}var Te={};function sr(e){{var r=we();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
25
|
-
|
|
26
|
-
Check the top-level render call using <`+t+">.")}return r}}function Oe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=sr(r);if(Te[t])return;Te[t]=!0;var n="";e&&e._owner&&e._owner!==X.current&&(n=" It was passed a child from "+C(e._owner.type)+"."),F(e),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),F(null)}}function Ce(e,r){{if(typeof e!="object")return;if(G(e))for(var t=0;t<e.length;t++){var n=e[t];Z(n)&&Oe(n,r)}else if(Z(e))e._store&&(e._store.validated=!0);else if(e){var i=$e(e);if(typeof i=="function"&&i!==e.entries)for(var s=i.call(e),o;!(o=s.next()).done;)Z(o.value)&&Oe(o.value,r)}}}function fr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===d||r.$$typeof===R))t=r.propTypes;else return;if(t){var n=C(r);Xe(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!H){H=!0;var i=C(r);y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function cr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){F(e),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),F(null);break}}e.ref!==null&&(F(e),y("Invalid attribute `ref` supplied to `React.Fragment`."),F(null))}}var Pe={};function Se(e,r,t,n,i,s){{var o=Ne(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var h=lr();h?a+=h:a+=we();var v;e===null?v="null":G(e)?v="array":e!==void 0&&e.$$typeof===f?(v="<"+(C(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):v=typeof e,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",v,a)}var p=ur(e,r,t,i,s);if(p==null)return p;if(o){var m=r.children;if(m!==void 0)if(n)if(G(m)){for(var A=0;A<m.length;A++)Ce(m[A],e);Object.freeze&&Object.freeze(m)}else y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ce(m,e)}if(M.call(r,"key")){var k=C(e),b=Object.keys(r).filter(function(gr){return gr!=="key"}),Q=b.length>0?"{key: someKey, "+b.join(": ..., ")+": ...}":"{key: someKey}";if(!Pe[k+Q]){var hr=b.length>0?"{"+b.join(": ..., ")+": ...}":"{}";y(`A props object containing a "key" prop is being spread into JSX:
|
|
27
|
-
let props = %s;
|
|
28
|
-
<%s {...props} />
|
|
29
|
-
React keys must be passed directly to JSX without using spread:
|
|
30
|
-
let props = %s;
|
|
31
|
-
<%s key={someKey} {...props} />`,Q,k,hr,k),Pe[k+Q]=!0}}return e===E?cr(p):fr(p),p}}function dr(e,r,t){return Se(e,r,t,!0)}function vr(e,r,t){return Se(e,r,t,!1)}var pr=vr,yr=dr;$.Fragment=E,$.jsx=pr,$.jsxs=yr}()),$}process.env.NODE_ENV==="production"?q.exports=ke():q.exports=De();var Y=q.exports;const Fe={t:"_t_bkucs_7"},ne=({content:T,position:f,orientation:P="up",update:E,textAlign:O})=>{const w=x.useRef(null);return x.useEffect(()=>{const u=w.current;u.style.opacity="0",u.style.width="auto",u.style.left="0px",u.style.top="0px";let c={x:0,y:0,r:""};const d=u.getBoundingClientRect();let g=f.width/2;u.style.width=d.width+"px";let l=0;switch(P){case"up":l=f.left+g-d.width/2-10,l=window.innerWidth<l+d.width?window.innerWidth-d.width-20:l,l=l<0?0:l,u.style.left=l+"px",u.style.top=f.top-d.height-10+"px",c.x=f.left+g,c.y=f.top-10;break;case"down":l=f.left+g-d.width/2-10,l=l<0?0:l,u.style.left=l+"px",u.style.top=f.bottom+10+"px",c.x=f.left+g,c.y=f.bottom-5,c.r="rotate(180deg)";break;case"left":u.style.top=f.top-10+"px",u.style.left=f.left-d.width-f.width+"px",c.x=f.left-g+5,c.y=f.top+5,c.r="rotate(270deg)";break;case"right":u.style.top=f.top-10+"px",u.style.left=f.right+"px",c.x=f.right+5,c.y=f.top+5,c.r="rotate(90deg)";break}u.style.setProperty("--tooltip-arrow-x",c.x+"px"),u.style.setProperty("--tooltip-arrow-y",c.y+"px"),u.style.setProperty("--tooltip-arrow-r",c.r),u.style.transition="opacity 0.3s",u.style.textAlign=O,u.style.opacity="1"},[E]),Y.jsx("div",{ref:w,className:Fe.t,children:T})},Ae=({content:T,children:f,className:P,textAlign:E="center",orientation:O="down",dev:w,...u})=>{const[c,d]=x.useState(null),g=R=>{d(R.currentTarget)},l=()=>{w||d(null)};return Y.jsxs("span",{className:P,onMouseOver:g,onMouseOut:l,children:[f,c!==null&&je.createPortal(u.element?Y.jsx(u.element,{content:T,position:c.getBoundingClientRect(),textAlign:E,update:Date.now()}):Y.jsx(ne,{update:Date.now(),orientation:O,content:T,textAlign:E,position:c.getBoundingClientRect()}),document.body)]})};_.Item=ne,_.Tooltip=Ae,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(n,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],o):(n=typeof globalThis<"u"?globalThis:n||self,o((n.elCRM=n.elCRM||{},n.elCRM.tooltip={}),n.React,n.ReactDOM))})(this,function(n,o,R){"use strict";var M=document.createElement("style");M.textContent=`@charset "UTF-8";:root{--tooltip-background: #1e1f24;--tooltip-color: rgba(255, 255, 255, .92);--tooltip-radius: 10px;--tooltip-max-width: 280px;--tooltip-font-size: 13px;--tooltip-padding: 8px 10px;--tooltip-shadow: 0 8px 24px rgba(0, 0, 0, .28);--tooltip-gap: 8px}._t_ai3lm_13{position:fixed;box-sizing:border-box;max-width:var(--tooltip-max-width);padding:var(--tooltip-padding);border-radius:var(--tooltip-radius);background:var(--tooltip-background);color:var(--tooltip-color);font-size:var(--tooltip-font-size);line-height:1.35;font-weight:500;box-shadow:var(--tooltip-shadow);pointer-events:none;opacity:0;transition:opacity .12s ease;white-space:normal;word-break:break-word}._t_ai3lm_13[data-visible=true]{opacity:1}._t_ai3lm_13[data-align=left]{text-align:left}._t_ai3lm_13[data-align=center]{text-align:center}._t_ai3lm_13[data-align=right]{text-align:right}._t_ai3lm_13:before{content:"";position:fixed;pointer-events:none;width:0;height:0;top:var(--tooltip-arrow-y);left:var(--tooltip-arrow-x);transform:var(--tooltip-arrow-r, none);margin-left:-6px;border-width:6px;border-style:solid;border-color:var(--tooltip-background) transparent transparent transparent}._root_ai3lm_64{display:inline-flex;vertical-align:middle;max-width:100%}
|
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(M);const Y={version:"0.1.0"},y={t:"_t_ai3lm_13",root:"_root_ai3lm_64"},O=1e3,D=10;function T(){const t=globalThis;return t.elcrm||(t.elcrm={}),t.elcrm.overlayZ||(t.elcrm.overlayZ={seq:0,active:new Set}),t.elcrm.overlayZ}function S(){const t=T();t.seq+=1;const e=O+t.seq*D;return t.active.add(e),e}function E(t){const e=T();e.active.delete(t),e.active.size===0&&(e.seq=0)}function G(){const t=T();return t.active.size===0?O:Math.max(...t.active)}const i=8,a=8;function H(t,e,z){const w=t.left+t.width/2,p=t.top+t.height/2;let l=0,s=0,u=w,d=0,r="";const g=x=>Math.min(Math.max(a,x),window.innerWidth-e.width-a);switch(z){case"top":l=t.top-e.height-i,s=g(w-e.width/2),d=t.top-i,r="",l<a&&(l=t.bottom+i,d=t.bottom+i-2,r="rotate(180deg)");break;case"bottom":l=t.bottom+i,s=g(w-e.width/2),d=t.bottom+i-2,r="rotate(180deg)",l+e.height>window.innerHeight-a&&(l=t.top-e.height-i,d=t.top-i,r="");break;case"left":l=Math.min(Math.max(a,p-e.height/2),window.innerHeight-e.height-a),s=t.left-e.width-i,u=t.left-i+2,d=p,r="rotate(270deg)",s<a&&(s=t.right+i,u=t.right+i-2,r="rotate(90deg)");break;case"right":l=Math.min(Math.max(a,p-e.height/2),window.innerHeight-e.height-a),s=t.right+i,u=t.right+i-2,d=p,r="rotate(90deg)",s+e.width>window.innerWidth-a&&(s=t.left-e.width-i,u=t.left-i+2,r="rotate(270deg)");break}return{top:l,left:s,arrowX:u,arrowY:d,arrowR:r}}function N({content:t,children:e,placement:z,orientation:w,textAlign:p="center",delay:l=180,delayHide:s=60,className:u,disabled:d=!1,open:r}){const g=z??w??"top",x=o.useId(),Z=o.useRef(null),C=o.useRef(null),b=o.useRef(null),_=o.useRef(null),c=o.useRef(null),[A,q]=o.useState(!1),[f,L]=o.useState(null),[$,P]=o.useState(null),I=()=>{b.current!=null&&(window.clearTimeout(b.current),b.current=null),_.current!=null&&(window.clearTimeout(_.current),_.current=null)},X=o.useCallback(()=>{d||t==null||t===""||(I(),b.current=window.setTimeout(()=>{q(!0)},l))},[t,l,d]),j=o.useCallback(()=>{r||(I(),_.current=window.setTimeout(()=>{q(!1),L(null)},s))},[s,r]),m=r||A;o.useLayoutEffect(()=>{if(m){if(c.current==null){const h=S();c.current=h,P(h)}return}c.current!=null&&(E(c.current),c.current=null,P(null))},[m]),o.useEffect(()=>()=>{I(),c.current!=null&&(E(c.current),c.current=null)},[]),o.useLayoutEffect(()=>{if(!m)return;const h=Z.current,B=C.current;if(!h||!B)return;const v=()=>{const V=h.getBoundingClientRect(),J=B.getBoundingClientRect();L(H(V,J,g))};return v(),window.addEventListener("resize",v),window.addEventListener("scroll",v,!0),()=>{window.removeEventListener("resize",v),window.removeEventListener("scroll",v,!0)}},[m,g,t]);const F=f?{top:f.top,left:f.left,zIndex:$??1e3,"--tooltip-arrow-x":`${f.arrowX}px`,"--tooltip-arrow-y":`${f.arrowY}px`,"--tooltip-arrow-r":f.arrowR||"none"}:{top:-9999,left:-9999,zIndex:$??1e3,visibility:"hidden"},U=m&&typeof document<"u"?R.createPortal(o.createElement("div",{ref:C,id:x,role:"tooltip",className:y.t,"data-visible":f?"true":"false","data-align":p,style:F},t),document.body):null;return o.createElement("span",{ref:Z,className:u?`${y.root} ${u}`:y.root,onMouseEnter:X,onMouseLeave:j,onFocus:X,onBlur:j,"aria-describedby":m?x:void 0},e,U)}const W=()=>null;function k(){return typeof globalThis<"u"?globalThis:{}}k().elcrm||(k().elcrm={}),Object.assign(k().elcrm,{tooltip:Y.version}),n.Item=W,n.Tooltip=N,n.acquireOverlayZIndex=S,n.peekOverlayZIndex=G,n.releaseOverlayZIndex=E,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,17 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elcrm/tooltip",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "React-подсказки для elCRM: portal, общий overlayZ-стек, hover/focus, CSS-переменные.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "MaSkal <dev@elcrm.online>",
|
|
7
7
|
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/elcrm-lib/elcrm.tooltip.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/elcrm-lib/elcrm.tooltip/issues"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://www.npmjs.com/package/@elcrm/tooltip",
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=18"
|
|
21
|
+
},
|
|
8
22
|
"files": [
|
|
9
23
|
"dist"
|
|
10
24
|
],
|
|
11
25
|
"keywords": [
|
|
12
26
|
"elcrm",
|
|
13
|
-
"
|
|
14
|
-
"react"
|
|
27
|
+
"tooltip",
|
|
28
|
+
"react",
|
|
29
|
+
"overlay",
|
|
30
|
+
"portal"
|
|
31
|
+
],
|
|
32
|
+
"sideEffects": [
|
|
33
|
+
"**/*.css"
|
|
15
34
|
],
|
|
16
35
|
"main": "./dist/index.umd.js",
|
|
17
36
|
"module": "./dist/index.es.js",
|
|
@@ -22,13 +41,53 @@
|
|
|
22
41
|
"import": "./dist/index.es.js",
|
|
23
42
|
"require": "./dist/index.umd.js"
|
|
24
43
|
},
|
|
44
|
+
"./style.css": {
|
|
45
|
+
"import": "./dist/index.css",
|
|
46
|
+
"require": "./dist/index.css",
|
|
47
|
+
"default": "./dist/index.css"
|
|
48
|
+
},
|
|
25
49
|
"./dist/style.css": {
|
|
26
50
|
"import": "./dist/index.css",
|
|
27
|
-
"require": "./dist/index.css"
|
|
28
|
-
|
|
51
|
+
"require": "./dist/index.css",
|
|
52
|
+
"default": "./dist/index.css"
|
|
53
|
+
},
|
|
54
|
+
"./package.json": "./package.json"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"dev": "vite",
|
|
58
|
+
"build": "vite build",
|
|
59
|
+
"test": "vitest run",
|
|
60
|
+
"test:watch": "vitest",
|
|
61
|
+
"prepublishOnly": "vitest run && vite build",
|
|
62
|
+
"pack:check": "npm pack --dry-run"
|
|
29
63
|
},
|
|
30
64
|
"peerDependencies": {
|
|
31
65
|
"@types/react": ">=18.0.0",
|
|
32
|
-
"react": ">=18.0.0"
|
|
66
|
+
"react": ">=18.0.0",
|
|
67
|
+
"react-dom": ">=18.0.0"
|
|
68
|
+
},
|
|
69
|
+
"peerDependenciesMeta": {
|
|
70
|
+
"@types/react": {
|
|
71
|
+
"optional": true
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"@elcrm/storybook": "^0.0.3",
|
|
76
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
77
|
+
"@testing-library/react": "^16.2.0",
|
|
78
|
+
"@testing-library/user-event": "^14.6.1",
|
|
79
|
+
"@types/node": "^22.13.10",
|
|
80
|
+
"@types/react": "^18.2.66",
|
|
81
|
+
"@types/react-dom": "^18.2.22",
|
|
82
|
+
"@vitejs/plugin-react": "^4.3.1",
|
|
83
|
+
"jsdom": "^26.0.0",
|
|
84
|
+
"react": "^18.2.0",
|
|
85
|
+
"react-dom": "^18.2.0",
|
|
86
|
+
"sass-embedded": "^1.85.1",
|
|
87
|
+
"typescript": "^5.8.2",
|
|
88
|
+
"vite": "^5.4.2",
|
|
89
|
+
"vite-plugin-dts": "^4.0.3",
|
|
90
|
+
"vite-plugin-lib-inject-css": "^2.1.1",
|
|
91
|
+
"vitest": "^3.0.8"
|
|
33
92
|
}
|
|
34
93
|
}
|