@voidable/ui 0.6.0 → 0.8.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/README.md +168 -9
- package/dist/angular/index.d.ts +20 -0
- package/dist/angular/index.js +78 -0
- package/dist/autoloader-core.d.ts +45 -0
- package/dist/autoloader-table.generated.d.ts +5 -0
- package/dist/autoloader.d.ts +13 -0
- package/dist/autoloader.js +229 -0
- package/dist/base.d.ts +173 -2
- package/dist/base.js +2 -9
- package/dist/chunks/base-CMruMbxC.js +824 -0
- package/dist/chunks/{decorate-DKuCkHK4.js → decorate-CaYbmmmm.js} +1 -1
- package/dist/chunks/disclosure-Bj_49GcC.js +23 -0
- package/dist/chunks/dismiss-Drsy_dE5.js +37 -0
- package/dist/chunks/form-control-C0vH6gii.js +300 -0
- package/dist/chunks/keyboard-MQpfTX5I.js +46 -0
- package/dist/chunks/keyboard-activation-CV0m4hkn.js +29 -0
- package/dist/chunks/modal-D_YVy2vg.js +71 -0
- package/dist/chunks/overlay-BywGMcDW.js +467 -0
- package/dist/chunks/parts-D30c8OoG.js +229 -0
- package/dist/chunks/{shape-DmgCwYvY.js → shape-C_LW7EjG.js} +12 -4
- package/dist/components/accordion.d.ts +38 -10
- package/dist/components/accordion.js +52 -54
- package/dist/components/action-input.d.ts +64 -6
- package/dist/components/action-input.js +85 -42
- package/dist/components/alert.d.ts +24 -10
- package/dist/components/alert.js +27 -28
- package/dist/components/avatar.d.ts +8 -2
- package/dist/components/avatar.js +4 -4
- package/dist/components/badge.d.ts +8 -3
- package/dist/components/badge.js +3 -3
- package/dist/components/banner.d.ts +21 -10
- package/dist/components/banner.js +28 -28
- package/dist/components/bar-chart.d.ts +30 -6
- package/dist/components/bar-chart.js +29 -39
- package/dist/components/breadcrumbs.d.ts +19 -6
- package/dist/components/breadcrumbs.js +17 -23
- package/dist/components/button.d.ts +64 -10
- package/dist/components/button.js +71 -27
- package/dist/components/calendar.d.ts +65 -10
- package/dist/components/calendar.js +158 -107
- package/dist/components/card.d.ts +14 -9
- package/dist/components/card.js +9 -23
- package/dist/components/carousel.d.ts +65 -14
- package/dist/components/carousel.js +85 -94
- package/dist/components/charts/scale.d.ts +0 -1
- package/dist/components/charts/shape.d.ts +0 -1
- package/dist/components/checkbox-group.d.ts +38 -5
- package/dist/components/checkbox-group.js +61 -20
- package/dist/components/checkbox.d.ts +53 -7
- package/dist/components/checkbox.js +66 -29
- package/dist/components/collapsible.d.ts +29 -9
- package/dist/components/collapsible.js +43 -45
- package/dist/components/color-picker.d.ts +20 -4
- package/dist/components/color-picker.js +36 -30
- package/dist/components/combobox.d.ts +84 -10
- package/dist/components/combobox.js +142 -45
- package/dist/components/compose-input.d.ts +8 -1
- package/dist/components/compose-input.js +10 -4
- package/dist/components/dialog.d.ts +24 -20
- package/dist/components/dialog.js +8 -57
- package/dist/components/divider.d.ts +8 -1
- package/dist/components/divider.js +4 -4
- package/dist/components/donut-chart.d.ts +28 -5
- package/dist/components/donut-chart.js +55 -54
- package/dist/components/drawer.d.ts +19 -18
- package/dist/components/drawer.js +9 -53
- package/dist/components/dropdown-menu.d.ts +62 -7
- package/dist/components/dropdown-menu.js +125 -34
- package/dist/components/editable.d.ts +37 -3
- package/dist/components/editable.js +45 -24
- package/dist/components/error-fallback.d.ts +36 -5
- package/dist/components/error-fallback.js +74 -24
- package/dist/components/field.d.ts +38 -4
- package/dist/components/field.js +63 -21
- package/dist/components/file-upload.d.ts +23 -2
- package/dist/components/file-upload.js +48 -25
- package/dist/components/gauge.d.ts +48 -9
- package/dist/components/gauge.js +57 -55
- package/dist/components/hamburger.d.ts +19 -4
- package/dist/components/hamburger.js +29 -20
- package/dist/components/hover-card.d.ts +40 -14
- package/dist/components/hover-card.js +77 -60
- package/dist/components/indicator.d.ts +18 -7
- package/dist/components/indicator.js +17 -19
- package/dist/components/input.d.ts +70 -5
- package/dist/components/input.js +84 -21
- package/dist/components/line-chart.d.ts +27 -5
- package/dist/components/line-chart.js +19 -21
- package/dist/components/list.d.ts +10 -1
- package/dist/components/list.js +4 -4
- package/dist/components/menu.d.ts +67 -21
- package/dist/components/menu.js +117 -116
- package/dist/components/multiselect.d.ts +108 -13
- package/dist/components/multiselect.js +207 -70
- package/dist/components/nav-bar.d.ts +12 -7
- package/dist/components/nav-bar.js +12 -22
- package/dist/components/nav-menu.d.ts +52 -12
- package/dist/components/nav-menu.js +69 -71
- package/dist/components/number-input.d.ts +76 -8
- package/dist/components/number-input.js +117 -51
- package/dist/components/pagination.d.ts +19 -1
- package/dist/components/pagination.js +69 -8
- package/dist/components/panel.d.ts +16 -8
- package/dist/components/panel.js +21 -21
- package/dist/components/pin-input.d.ts +41 -4
- package/dist/components/pin-input.js +45 -27
- package/dist/components/popover.d.ts +29 -11
- package/dist/components/popover.js +48 -36
- package/dist/components/progress.d.ts +7 -3
- package/dist/components/progress.js +4 -4
- package/dist/components/radio-group.d.ts +30 -5
- package/dist/components/radio-group.js +56 -19
- package/dist/components/radio.d.ts +47 -7
- package/dist/components/radio.js +68 -29
- package/dist/components/scroll-area.d.ts +8 -5
- package/dist/components/scroll-area.js +19 -20
- package/dist/components/segmented-control.d.ts +52 -8
- package/dist/components/segmented-control.js +67 -37
- package/dist/components/select.d.ts +59 -12
- package/dist/components/select.js +97 -47
- package/dist/components/sidebar.d.ts +22 -3
- package/dist/components/sidebar.js +21 -11
- package/dist/components/skeleton.d.ts +5 -2
- package/dist/components/skeleton.js +5 -5
- package/dist/components/slider.d.ts +27 -5
- package/dist/components/slider.js +30 -18
- package/dist/components/spinner.d.ts +6 -2
- package/dist/components/spinner.js +4 -4
- package/dist/components/stat.d.ts +21 -4
- package/dist/components/stat.js +8 -4
- package/dist/components/status-dot.d.ts +4 -1
- package/dist/components/status-dot.js +4 -4
- package/dist/components/stepper.d.ts +5 -1
- package/dist/components/stepper.js +3 -3
- package/dist/components/switch.d.ts +24 -5
- package/dist/components/switch.js +38 -20
- package/dist/components/table.d.ts +51 -2
- package/dist/components/table.js +158 -9
- package/dist/components/tabs.d.ts +49 -17
- package/dist/components/tabs.js +86 -55
- package/dist/components/tag.d.ts +17 -7
- package/dist/components/tag.js +19 -21
- package/dist/components/tags-input.d.ts +33 -4
- package/dist/components/tags-input.js +41 -31
- package/dist/components/textarea.d.ts +61 -5
- package/dist/components/textarea.js +59 -22
- package/dist/components/toast.d.ts +89 -15
- package/dist/components/toast.js +106 -31
- package/dist/components/toggle-group.d.ts +30 -3
- package/dist/components/toggle-group.js +44 -17
- package/dist/components/toggle.d.ts +25 -4
- package/dist/components/toggle.js +29 -19
- package/dist/components/tooltip.d.ts +31 -12
- package/dist/components/tooltip.js +63 -29
- package/dist/components.json +1518 -0
- package/dist/custom-elements.json +31817 -0
- package/dist/dev/index.d.ts +40 -0
- package/dist/dev/rules.d.ts +46 -0
- package/dist/dev/table.generated.d.ts +8 -0
- package/dist/dev/types.d.ts +113 -0
- package/dist/dev.js +3364 -0
- package/dist/disclosure.d.ts +30 -0
- package/dist/dismiss.d.ts +20 -0
- package/dist/form-control.d.ts +92 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +24 -24
- package/dist/keyboard-activation.d.ts +31 -0
- package/dist/keyboard.d.ts +32 -0
- package/dist/modal.d.ts +44 -0
- package/dist/overlay.d.ts +249 -0
- package/dist/parts.d.ts +171 -0
- package/dist/projection.d.ts +370 -0
- package/dist/types/elements.d.ts +648 -0
- package/dist/types/react.d.ts +163 -0
- package/dist/types/solid.d.ts +164 -0
- package/dist/types/solid2.d.ts +161 -0
- package/dist/types/svelte.d.ts +154 -0
- package/dist/types/vue.d.ts +156 -0
- package/dist/vscode.html-custom-data.json +6004 -0
- package/dist/web-types.json +8365 -0
- package/package.json +113 -25
- package/dist/base.d.ts.map +0 -1
- package/dist/components/accordion.d.ts.map +0 -1
- package/dist/components/action-input.d.ts.map +0 -1
- package/dist/components/alert.d.ts.map +0 -1
- package/dist/components/avatar.d.ts.map +0 -1
- package/dist/components/badge.d.ts.map +0 -1
- package/dist/components/banner.d.ts.map +0 -1
- package/dist/components/bar-chart.d.ts.map +0 -1
- package/dist/components/breadcrumbs.d.ts.map +0 -1
- package/dist/components/button.d.ts.map +0 -1
- package/dist/components/calendar.d.ts.map +0 -1
- package/dist/components/card.d.ts.map +0 -1
- package/dist/components/carousel.d.ts.map +0 -1
- package/dist/components/charts/scale.d.ts.map +0 -1
- package/dist/components/charts/shape.d.ts.map +0 -1
- package/dist/components/checkbox-group.d.ts.map +0 -1
- package/dist/components/checkbox.d.ts.map +0 -1
- package/dist/components/collapsible.d.ts.map +0 -1
- package/dist/components/color-picker.d.ts.map +0 -1
- package/dist/components/combobox.d.ts.map +0 -1
- package/dist/components/compose-input.d.ts.map +0 -1
- package/dist/components/dialog.d.ts.map +0 -1
- package/dist/components/divider.d.ts.map +0 -1
- package/dist/components/donut-chart.d.ts.map +0 -1
- package/dist/components/drawer.d.ts.map +0 -1
- package/dist/components/dropdown-menu.d.ts.map +0 -1
- package/dist/components/editable.d.ts.map +0 -1
- package/dist/components/error-fallback.d.ts.map +0 -1
- package/dist/components/field.d.ts.map +0 -1
- package/dist/components/file-upload.d.ts.map +0 -1
- package/dist/components/gauge.d.ts.map +0 -1
- package/dist/components/hamburger.d.ts.map +0 -1
- package/dist/components/hover-card.d.ts.map +0 -1
- package/dist/components/indicator.d.ts.map +0 -1
- package/dist/components/input.d.ts.map +0 -1
- package/dist/components/line-chart.d.ts.map +0 -1
- package/dist/components/list.d.ts.map +0 -1
- package/dist/components/menu.d.ts.map +0 -1
- package/dist/components/multiselect.d.ts.map +0 -1
- package/dist/components/nav-bar.d.ts.map +0 -1
- package/dist/components/nav-menu.d.ts.map +0 -1
- package/dist/components/number-input.d.ts.map +0 -1
- package/dist/components/pagination.d.ts.map +0 -1
- package/dist/components/panel.d.ts.map +0 -1
- package/dist/components/pin-input.d.ts.map +0 -1
- package/dist/components/popover.d.ts.map +0 -1
- package/dist/components/progress.d.ts.map +0 -1
- package/dist/components/radio-group.d.ts.map +0 -1
- package/dist/components/radio.d.ts.map +0 -1
- package/dist/components/scroll-area.d.ts.map +0 -1
- package/dist/components/segmented-control.d.ts.map +0 -1
- package/dist/components/select.d.ts.map +0 -1
- package/dist/components/sidebar.d.ts.map +0 -1
- package/dist/components/skeleton.d.ts.map +0 -1
- package/dist/components/slider.d.ts.map +0 -1
- package/dist/components/spinner.d.ts.map +0 -1
- package/dist/components/stat.d.ts.map +0 -1
- package/dist/components/status-dot.d.ts.map +0 -1
- package/dist/components/stepper.d.ts.map +0 -1
- package/dist/components/switch.d.ts.map +0 -1
- package/dist/components/table.d.ts.map +0 -1
- package/dist/components/tabs.d.ts.map +0 -1
- package/dist/components/tag.d.ts.map +0 -1
- package/dist/components/tags-input.d.ts.map +0 -1
- package/dist/components/textarea.d.ts.map +0 -1
- package/dist/components/toast.d.ts.map +0 -1
- package/dist/components/toggle-group.d.ts.map +0 -1
- package/dist/components/toggle.d.ts.map +0 -1
- package/dist/components/tooltip.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- /package/dist/chunks/{scale-BFZNL3Ss.js → scale-_ccSuoYg.js} +0 -0
|
@@ -1,44 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../chunks/decorate-
|
|
3
|
-
import {
|
|
1
|
+
import { t as e } from "../chunks/base-CMruMbxC.js";
|
|
2
|
+
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
+
import { t as n } from "../chunks/keyboard-activation-CV0m4hkn.js";
|
|
4
|
+
import { i as r, r as i } from "../chunks/form-control-C0vH6gii.js";
|
|
5
|
+
import { property as a } from "lit/decorators.js";
|
|
4
6
|
//#region src/components/toggle.ts
|
|
5
|
-
var
|
|
7
|
+
var o = class extends e {
|
|
6
8
|
constructor(...e) {
|
|
7
|
-
super(...e), this.pressed = !1, this.disabled = !1, this.color = "default", this.size = "md", this.variant = "outline", this._handleClick = () => {
|
|
8
|
-
this.
|
|
9
|
+
super(...e), this._activation = new n(this, { disabled: () => this.formDisabled }), this.pressed = !1, this.value = "", this.disabled = !1, this.color = "default", this.size = "md", this.variant = "outline", this._unwatch = null, this._handleClick = () => {
|
|
10
|
+
this.formDisabled || (this.pressed = !this.pressed, this.dispatchEvent(new CustomEvent("void-change", {
|
|
9
11
|
bubbles: !0,
|
|
10
12
|
composed: !0,
|
|
11
|
-
detail: {
|
|
13
|
+
detail: {
|
|
14
|
+
value: this.value,
|
|
15
|
+
pressed: this.pressed
|
|
16
|
+
}
|
|
12
17
|
})));
|
|
13
|
-
}, this._handleKeydown = (e) => {
|
|
14
|
-
(e.key === " " || e.key === "Enter") && !this.disabled && (e.preventDefault(), this._handleClick());
|
|
15
18
|
};
|
|
16
19
|
}
|
|
20
|
+
get formDisabled() {
|
|
21
|
+
return this.disabled || i(this);
|
|
22
|
+
}
|
|
23
|
+
_syncDisabled() {
|
|
24
|
+
let e = this.formDisabled;
|
|
25
|
+
this.setHostAttribute("aria-disabled", e ? "true" : null), this.setHostAttribute("tabindex", e ? "-1" : "0");
|
|
26
|
+
}
|
|
17
27
|
connectedCallback() {
|
|
18
|
-
super.connectedCallback(), this.
|
|
28
|
+
super.connectedCallback(), this.setHostAttribute("role", "button"), this._syncDisabled(), this._unwatch = r(this, () => this._syncDisabled()), this.closest("void-toggle-group")?._syncToggle?.(this), this.setHostAttribute("aria-pressed", String(this.pressed)), this.addEventListener("click", this._handleClick);
|
|
19
29
|
}
|
|
20
30
|
disconnectedCallback() {
|
|
21
|
-
super.disconnectedCallback(), this.removeEventListener("click", this._handleClick), this.
|
|
31
|
+
super.disconnectedCallback(), this.removeEventListener("click", this._handleClick), this._unwatch?.(), this._unwatch = null;
|
|
22
32
|
}
|
|
23
33
|
updated(e) {
|
|
24
|
-
e.has("pressed") && this.
|
|
34
|
+
e.has("pressed") && this.setHostAttribute("aria-pressed", String(this.pressed)), e.has("disabled") && this._syncDisabled();
|
|
25
35
|
}
|
|
26
36
|
};
|
|
27
|
-
t([
|
|
37
|
+
t([a({
|
|
28
38
|
type: Boolean,
|
|
29
39
|
reflect: !0
|
|
30
|
-
})],
|
|
40
|
+
})], o.prototype, "pressed", void 0), t([a({ type: String })], o.prototype, "value", void 0), t([a({
|
|
31
41
|
type: Boolean,
|
|
32
42
|
reflect: !0
|
|
33
|
-
})],
|
|
43
|
+
})], o.prototype, "disabled", void 0), t([a({
|
|
34
44
|
type: String,
|
|
35
45
|
reflect: !0
|
|
36
|
-
})],
|
|
46
|
+
})], o.prototype, "color", void 0), t([a({
|
|
37
47
|
type: String,
|
|
38
48
|
reflect: !0
|
|
39
|
-
})],
|
|
49
|
+
})], o.prototype, "size", void 0), t([a({
|
|
40
50
|
type: String,
|
|
41
51
|
reflect: !0
|
|
42
|
-
})],
|
|
52
|
+
})], o.prototype, "variant", void 0), customElements.get("void-toggle") || customElements.define("void-toggle", o);
|
|
43
53
|
//#endregion
|
|
44
|
-
export {
|
|
54
|
+
export { o as VoidToggle };
|
|
@@ -1,26 +1,45 @@
|
|
|
1
1
|
import { VoidElement } from '../base.js';
|
|
2
|
-
|
|
2
|
+
import { OverlayController } from '../overlay.js';
|
|
3
|
+
import { PartsController } from '../parts.js';
|
|
4
|
+
/**
|
|
5
|
+
* Hover hint for icon buttons and truncated text that need a label without cluttering the visible interface.
|
|
6
|
+
*
|
|
7
|
+
* Two parts: `<void-tooltip-trigger>` around the described element (one element: a `<void-button>`, a link), and
|
|
8
|
+
* `<void-tooltip-content>` with the hint text. The parts are the final DOM. Follows the WAI-ARIA tooltip pattern:
|
|
9
|
+
* the trigger's element is described by the content with `aria-describedby` (its own descriptions are kept), also
|
|
10
|
+
* when either part arrives after the tooltip upgraded. The content appears after `delay` on pointer hover and at
|
|
11
|
+
* once on keyboard focus, never takes focus, and Escape hides it. It is shown in the top layer and placed with CSS
|
|
12
|
+
* anchor positioning, flipping at viewport edges.
|
|
13
|
+
*
|
|
14
|
+
* @fires {CustomEvent<{ reason: 'hover' | 'focus' | 'api' }>} void-open - The tooltip appeared.
|
|
15
|
+
* @fires {CustomEvent<{ reason: 'hover' | 'blur' | 'escape' | 'parent' | 'api' }>} void-close - The tooltip is hiding.
|
|
16
|
+
*/
|
|
3
17
|
export declare class VoidTooltip extends VoidElement {
|
|
4
|
-
|
|
5
|
-
|
|
18
|
+
/** Side of the trigger the tooltip appears on; it flips to the opposite side when there is no room. */
|
|
19
|
+
side: 'top' | 'bottom' | 'left' | 'right';
|
|
20
|
+
/** Alignment with the trigger along that side. */
|
|
21
|
+
align: 'start' | 'center' | 'end';
|
|
22
|
+
/** Milliseconds the pointer rests on the trigger before the content appears (keyboard focus shows it at once). Defaults to 200. */
|
|
6
23
|
delay: number;
|
|
7
|
-
|
|
24
|
+
/** Whether the tooltip is shown. It opens and closes itself from hover, focus and Escape; set it to drive it from script. */
|
|
25
|
+
open: boolean;
|
|
8
26
|
private _timerId;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
private
|
|
27
|
+
protected readonly _parts: PartsController;
|
|
28
|
+
protected readonly _overlay: OverlayController;
|
|
29
|
+
private _control;
|
|
30
|
+
/** The content is the trigger's description. */
|
|
31
|
+
private _wire;
|
|
12
32
|
connectedCallback(): void;
|
|
13
33
|
disconnectedCallback(): void;
|
|
14
|
-
|
|
15
|
-
private
|
|
16
|
-
private
|
|
34
|
+
private _inTrigger;
|
|
35
|
+
private _onOver;
|
|
36
|
+
private _onOut;
|
|
17
37
|
private _onFocusIn;
|
|
18
38
|
private _onFocusOut;
|
|
19
|
-
|
|
39
|
+
private _focusVisible;
|
|
20
40
|
}
|
|
21
41
|
declare global {
|
|
22
42
|
interface HTMLElementTagNameMap {
|
|
23
43
|
'void-tooltip': VoidTooltip;
|
|
24
44
|
}
|
|
25
45
|
}
|
|
26
|
-
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -1,45 +1,79 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../chunks/decorate-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { t as e } from "../chunks/base-CMruMbxC.js";
|
|
2
|
+
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
+
import { i as n, n as r } from "../chunks/parts-D30c8OoG.js";
|
|
4
|
+
import { t as i } from "../chunks/overlay-BywGMcDW.js";
|
|
5
|
+
import { property as a } from "lit/decorators.js";
|
|
5
6
|
//#region src/components/tooltip.ts
|
|
6
|
-
var
|
|
7
|
+
var o = class extends e {
|
|
7
8
|
constructor(...e) {
|
|
8
|
-
super(...e), this.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
super(...e), this.side = "top", this.align = "center", this.delay = 200, this.open = !1, this._parts = new r(this, {
|
|
10
|
+
tags: ["void-tooltip-trigger", "void-tooltip-content"],
|
|
11
|
+
onChange: () => {
|
|
12
|
+
this._wire(), this.requestUpdate();
|
|
13
|
+
}
|
|
14
|
+
}), this._overlay = new i(this, {
|
|
15
|
+
kind: "tooltip",
|
|
16
|
+
surface: () => this._parts.one("void-tooltip-content"),
|
|
17
|
+
isOpen: () => this.open,
|
|
18
|
+
setOpen: (e) => {
|
|
19
|
+
this.open = e;
|
|
20
|
+
},
|
|
21
|
+
trigger: () => this._control(),
|
|
22
|
+
anchor: () => this._control() ?? this,
|
|
23
|
+
placement: () => ({
|
|
24
|
+
side: this.side,
|
|
25
|
+
align: this.align
|
|
26
|
+
}),
|
|
27
|
+
attr: (e, t, n) => this._parts.set(e, t, n),
|
|
28
|
+
style: (e, t, n) => this._parts.style(e, t, n)
|
|
29
|
+
}), this._onOver = (e) => {
|
|
30
|
+
!this._inTrigger(e.target) || this._inTrigger(e.relatedTarget) || (clearTimeout(this._timerId), this._timerId = setTimeout(() => this._overlay.requestOpen("hover"), this.delay));
|
|
31
|
+
}, this._onOut = (e) => {
|
|
32
|
+
!this._inTrigger(e.target) || this._inTrigger(e.relatedTarget) || (clearTimeout(this._timerId), !(this.ownerDocument.activeElement && this.contains(this.ownerDocument.activeElement) && this._focusVisible()) && this._overlay.requestClose("hover"));
|
|
14
33
|
}, this._onFocusIn = () => {
|
|
15
|
-
clearTimeout(this._timerId), this.
|
|
34
|
+
clearTimeout(this._timerId), this._focusVisible() && this._overlay.requestOpen("focus");
|
|
16
35
|
}, this._onFocusOut = () => {
|
|
17
|
-
clearTimeout(this._timerId), this.
|
|
36
|
+
clearTimeout(this._timerId), this._overlay.requestClose("blur");
|
|
18
37
|
};
|
|
19
38
|
}
|
|
39
|
+
_control() {
|
|
40
|
+
return n(this._parts.one("void-tooltip-trigger"));
|
|
41
|
+
}
|
|
42
|
+
_wire() {
|
|
43
|
+
let e = this._parts.one("void-tooltip-content"), t = this._control();
|
|
44
|
+
if (!e) return;
|
|
45
|
+
this._parts.set(e, "popover", "manual"), this._parts.set(e, "role", "tooltip");
|
|
46
|
+
let n = this._parts.id(e, "void-tooltip-content");
|
|
47
|
+
t && this._parts.token(t, "aria-describedby", n);
|
|
48
|
+
}
|
|
20
49
|
connectedCallback() {
|
|
21
|
-
|
|
50
|
+
super.connectedCallback(), this.addEventListener("mouseover", this._onOver), this.addEventListener("mouseout", this._onOut), this.addEventListener("focusin", this._onFocusIn), this.addEventListener("focusout", this._onFocusOut);
|
|
22
51
|
}
|
|
23
52
|
disconnectedCallback() {
|
|
24
|
-
super.disconnectedCallback(), clearTimeout(this._timerId), this.removeEventListener("
|
|
53
|
+
super.disconnectedCallback(), clearTimeout(this._timerId), this.removeEventListener("mouseover", this._onOver), this.removeEventListener("mouseout", this._onOut), this.removeEventListener("focusin", this._onFocusIn), this.removeEventListener("focusout", this._onFocusOut);
|
|
25
54
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
this._didSetup = !0;
|
|
29
|
-
let e = this.querySelector(".void-tooltip-bubble");
|
|
30
|
-
if (e) for (let t of this._userContent) this.insertBefore(t, e);
|
|
31
|
-
}
|
|
32
|
-
this._visible ? this.setAttribute("visible", "") : this.removeAttribute("visible");
|
|
33
|
-
let e = this.children[0];
|
|
34
|
-
e && (this._visible ? e.setAttribute("aria-describedby", this._tooltipId) : e.removeAttribute("aria-describedby"));
|
|
55
|
+
_inTrigger(e) {
|
|
56
|
+
return e instanceof Node && !!this._parts.one("void-tooltip-trigger")?.contains(e);
|
|
35
57
|
}
|
|
36
|
-
|
|
37
|
-
|
|
58
|
+
_focusVisible() {
|
|
59
|
+
let e = this.ownerDocument.activeElement;
|
|
60
|
+
if (!e) return !1;
|
|
61
|
+
try {
|
|
62
|
+
return e.matches(":focus-visible");
|
|
63
|
+
} catch {
|
|
64
|
+
return !0;
|
|
65
|
+
}
|
|
38
66
|
}
|
|
39
67
|
};
|
|
40
|
-
t([
|
|
68
|
+
t([a({
|
|
41
69
|
type: String,
|
|
42
70
|
reflect: !0
|
|
43
|
-
})],
|
|
71
|
+
})], o.prototype, "side", void 0), t([a({
|
|
72
|
+
type: String,
|
|
73
|
+
reflect: !0
|
|
74
|
+
})], o.prototype, "align", void 0), t([a({ type: Number })], o.prototype, "delay", void 0), t([a({
|
|
75
|
+
type: Boolean,
|
|
76
|
+
reflect: !0
|
|
77
|
+
})], o.prototype, "open", void 0), customElements.get("void-tooltip") || customElements.define("void-tooltip", o);
|
|
44
78
|
//#endregion
|
|
45
|
-
export {
|
|
79
|
+
export { o as VoidTooltip };
|