@v1nt1248/3nclient-lib 0.3.51 → 0.4.1
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 +4 -0
- package/dist/chunks/{plugins-keys-DdadrIAg.js → plugins-keys-CjKqZeyH.js} +2 -2
- package/dist/chunks/ui3n-tooltip-BbbM2459.js +409 -0
- package/dist/src/components/ui3n-chip/ui3n-chip.d.ts +0 -5
- package/dist/src/components/ui3n-icon/ui3n-icon.d.ts +0 -1
- package/dist/src/components/ui3n-progress/ui3n-progress-circular.d.ts +0 -2
- package/dist/src/components/ui3n-progress/ui3n-progress-linear.d.ts +0 -2
- package/dist/src/components/ui3n-scrollbar-horizontal/ui3n-scrollbar-horizontal.d.ts +0 -7
- package/dist/src/components/ui3n-scrollbar-vertical/ui3n-scrollbar-vertical.d.ts +0 -7
- package/dist/src/components/ui3n-slider/ui3n-slider.d.ts +0 -5
- package/dist/src/components/ui3n-tabs/ui3n-tabs.d.ts +0 -4
- package/dist/src/components/ui3n-tooltip/types.d.ts +8 -2
- package/dist/src/components/ui3n-tooltip/ui3n-tooltip-container.d.ts +16 -0
- package/dist/src/components/ui3n-tooltip/ui3n-tooltip.d.ts +1 -5
- package/dist/src/constants/plugins-keys.d.ts +2 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/plugins/index.d.ts +4 -1
- package/dist/src/plugins/tooltips/store-tooltips.d.ts +4 -0
- package/dist/src/plugins/tooltips/tooltips.d.ts +8 -0
- package/dist/src/plugins/tooltips/types.d.ts +34 -0
- package/dist/src/ui3n-plugins.d.ts +5 -3
- package/dist/style.css +1 -1
- package/dist/ui3n-components.js +1011 -1183
- package/dist/ui3n-plugins.js +169 -50
- package/dist/ui3n-utils.js +4 -4
- package/package.json +11 -4
- package/src/components/ui3n-autocomplete/ui3n-autocomplete.vue +28 -25
- package/src/components/ui3n-badge/ui3n-badge-simple.vue +18 -17
- package/src/components/ui3n-badge/ui3n-badge.vue +3 -2
- package/src/components/ui3n-breadcrumbs/ui3n-breadcrumb.vue +11 -10
- package/src/components/ui3n-breadcrumbs/ui3n-breadcrumbs.vue +4 -1
- package/src/components/ui3n-button/ui3n-button.vue +244 -158
- package/src/components/ui3n-checkbox/ui3n-checkbox.vue +22 -21
- package/src/components/ui3n-chip/ui3n-chip.vue +56 -40
- package/src/components/ui3n-dialog/ui3n-dialog-provider.vue +1 -0
- package/src/components/ui3n-dialog/ui3n-dialog.vue +19 -18
- package/src/components/ui3n-drop-files/ui3n-drop-files.vue +8 -7
- package/src/components/ui3n-editable/ui3n-content-editable.vue +11 -10
- package/src/components/ui3n-editable/ui3n-editable.vue +26 -25
- package/src/components/ui3n-emoji/ui3n-emoji.vue +7 -6
- package/src/components/ui3n-icon/ui3n-icon.vue +26 -16
- package/src/components/ui3n-input/ui3n-input.vue +36 -32
- package/src/components/ui3n-input-file/ui3n-input-file.vue +8 -5
- package/src/components/ui3n-list/ui3n-list.vue +8 -7
- package/src/components/ui3n-menu/ui3n-menu.vue +6 -5
- package/src/components/ui3n-mobile-menu/ui3n-mobile-menu.vue +4 -3
- package/src/components/ui3n-mobile-menu-item/ui3n-mobile-menu-item.vue +7 -6
- package/src/components/ui3n-notification/ui3n-notification-container.vue +1 -0
- package/src/components/ui3n-notification/ui3n-notification.vue +28 -26
- package/src/components/ui3n-progress/ui3n-progress-circular.vue +32 -19
- package/src/components/ui3n-progress/ui3n-progress-linear.vue +31 -18
- package/src/components/ui3n-radio-group/ui3n-radio-group.vue +4 -1
- package/src/components/ui3n-radio-group/ui3n-radio.vue +6 -5
- package/src/components/ui3n-scrollbar/ui3n-scrollbar.vue +94 -83
- package/src/components/ui3n-scrollbar-horizontal/ui3n-scrollbar-horizontal.vue +51 -39
- package/src/components/ui3n-scrollbar-vertical/ui3n-scrollbar-vertical.vue +51 -39
- package/src/components/ui3n-selector/ui3n-selector.vue +33 -28
- package/src/components/ui3n-slider/ui3n-slider.vue +53 -34
- package/src/components/ui3n-step-line-bar/ui3n-step-line-bar.vue +10 -6
- package/src/components/ui3n-switch/ui3n-switch.vue +23 -22
- package/src/components/ui3n-table/ui3n-table.vue +50 -48
- package/src/components/ui3n-tabs/ui3n-tabs.vue +38 -20
- package/src/components/ui3n-text/ui3n-text.vue +15 -14
- package/src/components/ui3n-tooltip/types.ts +8 -2
- package/src/components/ui3n-tooltip/ui3n-tooltip-container.vue +79 -0
- package/src/components/ui3n-tooltip/ui3n-tooltip.vue +140 -79
- package/dist/chunks/ui3n-notification-o0tuhTpO.js +0 -272
- package/src/components/ui3n-tooltip/ui3n-tooltip-old.vue +0 -198
package/README.md
CHANGED
|
@@ -56,12 +56,14 @@ You can run the project as `pnpm dev` or `npm run dev`.
|
|
|
56
56
|
- notifications
|
|
57
57
|
- vue-bus
|
|
58
58
|
- theme
|
|
59
|
+
- tooltips
|
|
59
60
|
|
|
60
61
|
### Store plugins [`@v1nt1248/3nclient-lib/plugins`]
|
|
61
62
|
- store-dialogs
|
|
62
63
|
- store-notifications
|
|
63
64
|
- store-vue-bus
|
|
64
65
|
- store-theme
|
|
66
|
+
- store-tooltips
|
|
65
67
|
|
|
66
68
|
### Constants
|
|
67
69
|
- emoticons
|
|
@@ -120,6 +122,8 @@ import '@v1nt1248/3nclient-lib/style.css';
|
|
|
120
122
|
|
|
121
123
|
`variables.css` contains design tokens only (palette, theme semantics, `--color-*` mapping). Light tokens and the color mapping are applied on `:root`, so `<html>` classes are **not** required for the default (light) look.
|
|
122
124
|
|
|
125
|
+
Every component also has CSS variables of its own, which you can set on `:root`, on a container or on the element through its `data-ui3n` attribute. See [Styling](docs/guide/styling.md) for how they work, and a component's documentation page for the ones it has.
|
|
126
|
+
|
|
123
127
|
`.default-theme` is a deprecated alias of `.light-theme`.
|
|
124
128
|
|
|
125
129
|
To start with another theme or switch at runtime:
|
|
@@ -4468,6 +4468,6 @@ function Q(e) {
|
|
|
4468
4468
|
}
|
|
4469
4469
|
//#endregion
|
|
4470
4470
|
//#region src/constants/plugins-keys.ts
|
|
4471
|
-
var Ot = Symbol.for("ui3n-dialogs-plugin"), kt = Symbol.for("ui3n-notifications-plugin"), At = Symbol.for("ui3n-vuebus-plugin"), jt = Symbol.for("ui3n-theme-plugin");
|
|
4471
|
+
var Ot = Symbol.for("ui3n-dialogs-plugin"), kt = Symbol.for("ui3n-notifications-plugin"), At = Symbol.for("ui3n-vuebus-plugin"), jt = Symbol.for("ui3n-theme-plugin"), Mt = Symbol.for("ui3n-tooltips-plugin");
|
|
4472
4472
|
//#endregion
|
|
4473
|
-
export {
|
|
4473
|
+
export { de as $, Fe as A, W as B, He as C, Le as D, Re as E, ke as F, _e as G, U as H, G as I, me as J, ge as K, Oe as L, Me as M, je as N, Ie as O, Ae as P, z as Q, K as R, Ue as S, ze as T, ye as U, Te as V, ve as W, pe as X, fe as Y, B as Z, et as _, f as _t, At as a, ie as at, Ge as b, X as c, N as ct, ct as d, k as dt, L as et, st as f, O as ft, rt as g, g as gt, it as h, _ as ht, Mt as i, ae as it, Pe as j, Ne as k, ut as l, M as lt, at as m, b as mt, kt as n, F as nt, St as o, re as ot, ot as p, x as pt, H as q, jt as r, oe as rt, dt as s, te as st, Ot as t, I as tt, lt as u, A as ut, Ze as v, m as vt, Be as w, We as x, Je as y, De as z };
|
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
import { D as e, x as t } from "./plugins-keys-CjKqZeyH.js";
|
|
2
|
+
import { Fragment as n, Teleport as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, mergeProps as d, normalizeClass as f, normalizeStyle as p, onBeforeUnmount as m, onMounted as h, openBlock as g, ref as _, renderSlot as v, toDisplayString as y, unref as b, useCssModule as x, useSlots as S, watch as C, withDirectives as w, withKeys as T } from "vue";
|
|
3
|
+
import { arrow as E, autoUpdate as D, offset as O, useFloating as k } from "@floating-ui/vue";
|
|
4
|
+
//#region src/directives/ui3n-ripple.ts
|
|
5
|
+
var A = /* @__PURE__ */ new WeakMap();
|
|
6
|
+
function j(e, t, n) {
|
|
7
|
+
let r = document.createElement("div"), i = Math.max(e.clientWidth, e.clientHeight), a = i / 2;
|
|
8
|
+
r.style.width = r.style.height = `${i}px`, r.style.left = `${Math.round(e.clientWidth / 2 - a)}px`, r.style.top = `${Math.round(e.clientHeight / 2 - a)}px`, r.classList.add("ui3n-ripple"), t && r.style.setProperty("--ui3n-ripple-bg-color", t), n && r.style.setProperty("--ui3n-ripple-duration", `${n}ms`);
|
|
9
|
+
let o = e.getElementsByClassName("ui3n-ripple")[0];
|
|
10
|
+
o && o.remove(), e.appendChild(r);
|
|
11
|
+
}
|
|
12
|
+
function M(e, t) {
|
|
13
|
+
A.get(e)?.controller.abort();
|
|
14
|
+
let { color: n, duration: r, eventsTriggers: i = [], disabled: a = !1 } = t.value || {};
|
|
15
|
+
if (a) {
|
|
16
|
+
A.delete(e);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
let o = new AbortController(), s = { signal: o.signal };
|
|
20
|
+
(!i.length || i.includes("click")) && e.addEventListener("click", () => j(e, n, r), s), i.length && i.includes("enter") && e.addEventListener("keydown", (t) => {
|
|
21
|
+
t.key === "Enter" && j(e, n, r);
|
|
22
|
+
}, s), A.set(e, { controller: o });
|
|
23
|
+
}
|
|
24
|
+
var N = {
|
|
25
|
+
mounted(e, t) {
|
|
26
|
+
M(e, t);
|
|
27
|
+
},
|
|
28
|
+
updated(e, t) {
|
|
29
|
+
M(e, t);
|
|
30
|
+
},
|
|
31
|
+
beforeUnmount(e) {
|
|
32
|
+
A.get(e)?.controller.abort(), A.delete(e);
|
|
33
|
+
}
|
|
34
|
+
}, P = ["id", "title"], F = /* @__PURE__ */ u({
|
|
35
|
+
__name: "ui3n-icon",
|
|
36
|
+
props: {
|
|
37
|
+
id: {},
|
|
38
|
+
icon: {},
|
|
39
|
+
title: { default: "" },
|
|
40
|
+
size: {},
|
|
41
|
+
width: {},
|
|
42
|
+
height: {},
|
|
43
|
+
color: {},
|
|
44
|
+
horizontalFlip: { type: Boolean },
|
|
45
|
+
verticalFlip: { type: Boolean },
|
|
46
|
+
rotate: { default: 0 }
|
|
47
|
+
},
|
|
48
|
+
emits: ["click"],
|
|
49
|
+
setup(e, { emit: t }) {
|
|
50
|
+
let n = e, r = t, a = i(() => n.size || n.width), o = i(() => n.size || n.height), c = i(() => {
|
|
51
|
+
let e = {};
|
|
52
|
+
a.value !== void 0 && (e["--ui3n-icon-width"] = l(a.value)), o.value !== void 0 && (e["--ui3n-icon-height"] = l(o.value)), n.color && (e["--ui3n-icon-color"] = n.color);
|
|
53
|
+
let t = [];
|
|
54
|
+
return n.horizontalFlip && t.push("rotateY(180deg)"), n.verticalFlip && t.push("rotateX(180deg)"), n.rotate && t.push(`rotate(${n.rotate}deg)`), t.length && (e.transform = t.join(" ")), e;
|
|
55
|
+
});
|
|
56
|
+
function l(e) {
|
|
57
|
+
return isNaN(Number(e)) ? String(e) : `${e}px`;
|
|
58
|
+
}
|
|
59
|
+
return (t, n) => (g(), s("div", d({
|
|
60
|
+
id: e.id,
|
|
61
|
+
"data-ui3n": "icon",
|
|
62
|
+
class: t.$style.ui3nIcon,
|
|
63
|
+
title: e.title,
|
|
64
|
+
style: c.value
|
|
65
|
+
}, { "data-icon": e.icon }, { onClick: n[0] ||= (e) => r("click", e) }), null, 16, P));
|
|
66
|
+
}
|
|
67
|
+
}), I = { ui3nIcon: "_ui3nIcon_pfn1q_1" }, L = (e, t) => {
|
|
68
|
+
let n = e.__vccOpts || e;
|
|
69
|
+
for (let [e, r] of t) n[e] = r;
|
|
70
|
+
return n;
|
|
71
|
+
}, R = /* @__PURE__ */ L(F, [["__cssModules", { $style: I }]]), z = {
|
|
72
|
+
small: 12,
|
|
73
|
+
regular: 16,
|
|
74
|
+
large: 24
|
|
75
|
+
}, B = ["id", "disabled"], V = /* @__PURE__ */ L(/* @__PURE__ */ u({
|
|
76
|
+
__name: "ui3n-button",
|
|
77
|
+
props: {
|
|
78
|
+
id: {},
|
|
79
|
+
type: { default: "primary" },
|
|
80
|
+
size: { default: "regular" },
|
|
81
|
+
square: { type: Boolean },
|
|
82
|
+
block: { type: Boolean },
|
|
83
|
+
textColor: {},
|
|
84
|
+
color: {},
|
|
85
|
+
elevation: { type: Boolean },
|
|
86
|
+
icon: {},
|
|
87
|
+
iconSize: {},
|
|
88
|
+
iconColor: {},
|
|
89
|
+
iconPosition: { default: "right" },
|
|
90
|
+
disabled: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: !1
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
emits: [
|
|
96
|
+
"init",
|
|
97
|
+
"click",
|
|
98
|
+
"enter",
|
|
99
|
+
"focus",
|
|
100
|
+
"blur"
|
|
101
|
+
],
|
|
102
|
+
setup(e, { emit: t }) {
|
|
103
|
+
let n = N, r = e, c = t, l = x(), u = _(null), d = i(() => {
|
|
104
|
+
let e = [
|
|
105
|
+
l.ui3nButton,
|
|
106
|
+
l[r.size],
|
|
107
|
+
l[r.type]
|
|
108
|
+
];
|
|
109
|
+
return r.block && r.type !== "icon" && e.push(l.block), r.square && e.push(l.square), r.icon && e.push(l[`withIcon-${r.iconPosition}`]), r.elevation && e.push(l.elevation), e;
|
|
110
|
+
}), p = i(() => r.iconSize ? r.iconSize : z[r.size]), m = i(() => r.iconColor ? r.iconColor : "inherit");
|
|
111
|
+
async function y(e, t) {
|
|
112
|
+
["init", "enter"].includes(e) ? c(e, u.value) : c(e, t);
|
|
113
|
+
}
|
|
114
|
+
return C([() => r.color, () => r.textColor], (e, t) => {
|
|
115
|
+
if (!u.value) return;
|
|
116
|
+
let [n, i] = t, [a, o] = e;
|
|
117
|
+
(r.type === "custom" || r.type === "icon") && a !== n && u.value.style.setProperty("--ui3n-button-bg-color", a ?? "var(--color-bg-button-primary-default)"), (r.type === "custom" || r.type === "icon") && o !== i && u.value.style.setProperty("--ui3n-button-text-color", o ?? "var(--color-text-button-primary-default)");
|
|
118
|
+
}), h(() => {
|
|
119
|
+
u.value && ((r.type === "custom" || r.type === "icon") && r.color && u.value.style.setProperty("--ui3n-button-bg-color", r.color), r.type === "custom" && r.textColor && u.value.style.setProperty("--ui3n-button-text-color", r.textColor), y("init"));
|
|
120
|
+
}), (t, r) => w((g(), s("button", {
|
|
121
|
+
ref_key: "buttonEl",
|
|
122
|
+
ref: u,
|
|
123
|
+
id: e.id,
|
|
124
|
+
"data-ui3n": "button",
|
|
125
|
+
class: f(d.value),
|
|
126
|
+
type: "button",
|
|
127
|
+
disabled: e.disabled,
|
|
128
|
+
onClick: r[0] ||= (e) => y("click", e),
|
|
129
|
+
onFocusin: r[1] ||= (e) => y("focus", e),
|
|
130
|
+
onFocusout: r[2] ||= (e) => y("blur", e),
|
|
131
|
+
onKeydown: r[3] ||= T((e) => y("enter"), ["enter"])
|
|
132
|
+
}, [e.icon ? (g(), a(R, {
|
|
133
|
+
key: 0,
|
|
134
|
+
class: f(t.$style.buttonIcon),
|
|
135
|
+
icon: e.icon,
|
|
136
|
+
size: p.value,
|
|
137
|
+
color: m.value
|
|
138
|
+
}, null, 8, [
|
|
139
|
+
"class",
|
|
140
|
+
"icon",
|
|
141
|
+
"size",
|
|
142
|
+
"color"
|
|
143
|
+
])) : o("", !0), e.type === "icon" ? o("", !0) : (g(), s("span", {
|
|
144
|
+
key: 1,
|
|
145
|
+
class: f(t.$style.text)
|
|
146
|
+
}, [v(t.$slots, "default")], 2))], 42, B)), [[b(n)]]);
|
|
147
|
+
}
|
|
148
|
+
}), [["__cssModules", { $style: {
|
|
149
|
+
ui3nButton: "_ui3nButton_1y5ej_3",
|
|
150
|
+
"withIcon-left": "_withIcon-left_1y5ej_43",
|
|
151
|
+
"withIcon-right": "_withIcon-right_1y5ej_46",
|
|
152
|
+
square: "_square_1y5ej_49",
|
|
153
|
+
regular: "_regular_1y5ej_57",
|
|
154
|
+
small: "_small_1y5ej_67",
|
|
155
|
+
large: "_large_1y5ej_77",
|
|
156
|
+
block: "_block_1y5ej_87",
|
|
157
|
+
primary: "_primary_1y5ej_91",
|
|
158
|
+
elevation: "_elevation_1y5ej_117",
|
|
159
|
+
text: "_text_1y5ej_122",
|
|
160
|
+
secondary: "_secondary_1y5ej_160",
|
|
161
|
+
tertiary: "_tertiary_1y5ej_232",
|
|
162
|
+
outline: "_outline_1y5ej_302",
|
|
163
|
+
icon: "_icon_1y5ej_340",
|
|
164
|
+
custom: "_custom_1y5ej_360",
|
|
165
|
+
buttonIcon: "_buttonIcon_1y5ej_392"
|
|
166
|
+
} }]]), H = ["id"], U = /* @__PURE__ */ L(/* @__PURE__ */ u({
|
|
167
|
+
__name: "ui3n-notification",
|
|
168
|
+
props: {
|
|
169
|
+
id: {},
|
|
170
|
+
type: { default: "info" },
|
|
171
|
+
content: {},
|
|
172
|
+
position: { default: "center" },
|
|
173
|
+
duration: { default: 0 },
|
|
174
|
+
withIcon: {
|
|
175
|
+
type: Boolean,
|
|
176
|
+
default: !0
|
|
177
|
+
},
|
|
178
|
+
borderRadius: { default: 8 },
|
|
179
|
+
onOpen: {
|
|
180
|
+
type: Function,
|
|
181
|
+
default: () => {}
|
|
182
|
+
},
|
|
183
|
+
onClose: {
|
|
184
|
+
type: Function,
|
|
185
|
+
default: () => {}
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
setup(e) {
|
|
189
|
+
let n = e, r = null, u = x(), d = i(() => ({
|
|
190
|
+
success: {
|
|
191
|
+
icon: "round-check-circle",
|
|
192
|
+
iconColor: "var(--success-fill-default)",
|
|
193
|
+
iconRotate: 0
|
|
194
|
+
},
|
|
195
|
+
warning: {
|
|
196
|
+
icon: "round-warning",
|
|
197
|
+
iconColor: "var(--warning-fill-default)",
|
|
198
|
+
iconRotate: 0
|
|
199
|
+
},
|
|
200
|
+
info: {
|
|
201
|
+
icon: "round-info",
|
|
202
|
+
iconColor: "var(--info-fill-default)",
|
|
203
|
+
iconRotate: 180
|
|
204
|
+
},
|
|
205
|
+
error: {
|
|
206
|
+
icon: "round-info",
|
|
207
|
+
iconColor: "var(--error-fill-default)",
|
|
208
|
+
iconRotate: 180
|
|
209
|
+
}
|
|
210
|
+
})[n.type || "info"]), _ = i(() => {
|
|
211
|
+
let e = [
|
|
212
|
+
u.ui3nNotification,
|
|
213
|
+
u[`${n.type}Type`],
|
|
214
|
+
u[`${n.position}Position`]
|
|
215
|
+
];
|
|
216
|
+
return n.withIcon && e.push(u.withIcon), e;
|
|
217
|
+
}), v = i(() => ({ "--ui3n-notification-border-radius": t(n.borderRadius, "8px") }));
|
|
218
|
+
function S() {
|
|
219
|
+
n.onClose && n.onClose();
|
|
220
|
+
}
|
|
221
|
+
return h(() => {
|
|
222
|
+
n.onOpen && n.onOpen(), n.duration > 0 && (r = setTimeout(() => {
|
|
223
|
+
S();
|
|
224
|
+
}, n.duration));
|
|
225
|
+
}), m(() => {
|
|
226
|
+
r && clearTimeout(r);
|
|
227
|
+
}), (t, n) => (g(), s("div", {
|
|
228
|
+
id: e.id,
|
|
229
|
+
"data-ui3n": "notification",
|
|
230
|
+
class: f(_.value),
|
|
231
|
+
style: p(v.value)
|
|
232
|
+
}, [
|
|
233
|
+
e.withIcon ? (g(), s("div", {
|
|
234
|
+
key: 0,
|
|
235
|
+
class: f(b(u).ui3nNotificationIcon)
|
|
236
|
+
}, [l(R, {
|
|
237
|
+
icon: d.value.icon,
|
|
238
|
+
size: "16",
|
|
239
|
+
rotate: d.value.iconRotate,
|
|
240
|
+
color: d.value.iconColor
|
|
241
|
+
}, null, 8, [
|
|
242
|
+
"icon",
|
|
243
|
+
"rotate",
|
|
244
|
+
"color"
|
|
245
|
+
])], 2)) : o("", !0),
|
|
246
|
+
c("div", { class: f(b(u).ui3nNotificationContent) }, y(e.content), 3),
|
|
247
|
+
e.duration ? o("", !0) : (g(), a(V, {
|
|
248
|
+
key: 1,
|
|
249
|
+
type: "icon",
|
|
250
|
+
size: "small",
|
|
251
|
+
color: "transparent",
|
|
252
|
+
icon: "round-close",
|
|
253
|
+
"icon-size": "16",
|
|
254
|
+
class: f(b(u).closeBtn),
|
|
255
|
+
onClick: S
|
|
256
|
+
}, null, 8, ["class"]))
|
|
257
|
+
], 14, H));
|
|
258
|
+
}
|
|
259
|
+
}), [["__cssModules", { $style: {
|
|
260
|
+
ui3nNotification: "_ui3nNotification_152ae_1",
|
|
261
|
+
withIcon: "_withIcon_152ae_24",
|
|
262
|
+
ui3nNotificationIcon: "_ui3nNotificationIcon_152ae_28",
|
|
263
|
+
ui3nNotificationContent: "_ui3nNotificationContent_152ae_41",
|
|
264
|
+
closeBtn: "_closeBtn_152ae_51",
|
|
265
|
+
infoType: "_infoType_152ae_59",
|
|
266
|
+
successType: "_successType_152ae_70",
|
|
267
|
+
warningType: "_warningType_152ae_81",
|
|
268
|
+
errorType: "_errorType_152ae_92",
|
|
269
|
+
leftPosition: "_leftPosition_152ae_103",
|
|
270
|
+
centerPosition: "_centerPosition_152ae_108",
|
|
271
|
+
rightPosition: "_rightPosition_152ae_113"
|
|
272
|
+
} }]]), W = 8, G = /* @__PURE__ */ L(/* @__PURE__ */ u({
|
|
273
|
+
__name: "ui3n-tooltip",
|
|
274
|
+
props: {
|
|
275
|
+
id: {},
|
|
276
|
+
modelValue: { type: Boolean },
|
|
277
|
+
content: {},
|
|
278
|
+
maxContentWidth: {},
|
|
279
|
+
color: {},
|
|
280
|
+
textColor: {},
|
|
281
|
+
placement: { default: "top" },
|
|
282
|
+
triggerElement: {},
|
|
283
|
+
positionStrategy: {},
|
|
284
|
+
offsetX: { default: 0 },
|
|
285
|
+
offsetY: { default: 0 },
|
|
286
|
+
trigger: { default: "hover" },
|
|
287
|
+
disabled: {
|
|
288
|
+
type: Boolean,
|
|
289
|
+
default: !1
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
emits: [
|
|
293
|
+
"open",
|
|
294
|
+
"opened",
|
|
295
|
+
"close",
|
|
296
|
+
"closed",
|
|
297
|
+
"update:modelValue"
|
|
298
|
+
],
|
|
299
|
+
setup(l, { emit: u }) {
|
|
300
|
+
let d = Math.round(W / 2 * Math.SQRT2), x = l, w = u, T = S(), A = _(!1), j = _(null), M = _(null), N = _(null), P = _(!1), F = null, I = i(() => !x.triggerElement || e(T.default)), L = i(() => x.positionStrategy ? x.positionStrategy : x.triggerElement ? "fixed" : "absolute"), R = i(() => !!x.triggerElement || L.value === "fixed"), z = i(() => x.triggerElement || j.value), B = i(() => {
|
|
301
|
+
let e = z.value;
|
|
302
|
+
return e ? e instanceof HTMLElement ? e : "contextElement" in e && e.contextElement instanceof HTMLElement ? e.contextElement : null : null;
|
|
303
|
+
}), V = i(() => {
|
|
304
|
+
let [e] = x.placement.split("-");
|
|
305
|
+
return e;
|
|
306
|
+
}), H = i(() => {
|
|
307
|
+
let e = {
|
|
308
|
+
mainAxis: 0,
|
|
309
|
+
crossAxis: 0
|
|
310
|
+
};
|
|
311
|
+
switch (V.value) {
|
|
312
|
+
case "top":
|
|
313
|
+
e.mainAxis = -1 * Number(x.offsetY) + d, e.crossAxis = Number(x.offsetX);
|
|
314
|
+
break;
|
|
315
|
+
case "bottom":
|
|
316
|
+
e.mainAxis = Number(x.offsetY) + d, e.crossAxis = Number(x.offsetX);
|
|
317
|
+
break;
|
|
318
|
+
case "left":
|
|
319
|
+
e.mainAxis = -1 * Number(x.offsetX) + d, e.crossAxis = Number(x.offsetY);
|
|
320
|
+
break;
|
|
321
|
+
case "right":
|
|
322
|
+
e.mainAxis = Number(x.offsetX) + d, e.crossAxis = Number(x.offsetY);
|
|
323
|
+
break;
|
|
324
|
+
}
|
|
325
|
+
return e;
|
|
326
|
+
}), { floatingStyles: U, isPositioned: G, middlewareData: K, update: q } = k(z, M, {
|
|
327
|
+
open: A,
|
|
328
|
+
placement: () => x.placement,
|
|
329
|
+
strategy: L,
|
|
330
|
+
middleware: i(() => [O(H.value), E({
|
|
331
|
+
element: N,
|
|
332
|
+
padding: 8
|
|
333
|
+
})]),
|
|
334
|
+
whileElementsMounted: (e, t, n) => L.value === "fixed" || x.triggerElement ? D(e, t, n) : (n(), () => void 0)
|
|
335
|
+
}), J = i(() => {
|
|
336
|
+
let e = {
|
|
337
|
+
...U.value,
|
|
338
|
+
"--ui3n-tooltip-arrow-size": `${W}px`
|
|
339
|
+
};
|
|
340
|
+
return x.color && (e["--ui3n-tooltip-bg-color"] = x.color), x.textColor && (e["--ui3n-tooltip-text-color"] = x.textColor), x.maxContentWidth !== void 0 && (e["--ui3n-tooltip-max-width"] = t(x.maxContentWidth)), e;
|
|
341
|
+
});
|
|
342
|
+
function Y() {
|
|
343
|
+
x.disabled || (A.value = !0, w("open"), w("update:modelValue", !0));
|
|
344
|
+
}
|
|
345
|
+
function X() {
|
|
346
|
+
x.disabled && !A.value || (A.value = !1, w("close"), w("update:modelValue", !1));
|
|
347
|
+
}
|
|
348
|
+
function Z() {
|
|
349
|
+
x.disabled && !A.value || (A.value ? X() : Y());
|
|
350
|
+
}
|
|
351
|
+
function Q() {
|
|
352
|
+
F &&= (F.removeEventListener("mouseenter", Y), F.removeEventListener("mouseleave", X), F.removeEventListener("click", Z), null);
|
|
353
|
+
}
|
|
354
|
+
function $() {
|
|
355
|
+
Q(), !(!B.value || x.disabled) && (F = B.value, x.trigger === "hover" ? (F.addEventListener("mouseenter", Y), F.addEventListener("mouseleave", X)) : x.trigger === "click" && F.addEventListener("click", Z));
|
|
356
|
+
}
|
|
357
|
+
return h(() => {
|
|
358
|
+
P.value = !0, $();
|
|
359
|
+
}), m(() => {
|
|
360
|
+
Q();
|
|
361
|
+
}), C([
|
|
362
|
+
() => x.trigger,
|
|
363
|
+
() => x.disabled,
|
|
364
|
+
B
|
|
365
|
+
], () => {
|
|
366
|
+
P.value && $();
|
|
367
|
+
}), C(() => x.triggerElement, () => {
|
|
368
|
+
q();
|
|
369
|
+
}), C(() => x.modelValue, (e) => x.trigger === "manual" && (A.value = e), { immediate: !0 }), C(G, (e) => {
|
|
370
|
+
w(e ? "opened" : "closed");
|
|
371
|
+
}), (e, t) => (g(), s(n, null, [I.value ? (g(), s("div", {
|
|
372
|
+
key: 0,
|
|
373
|
+
ref_key: "referenceContainer",
|
|
374
|
+
ref: j,
|
|
375
|
+
"data-ui3n": "tooltip",
|
|
376
|
+
class: f(e.$style.container)
|
|
377
|
+
}, [v(e.$slots, "default")], 2)) : o("", !0), (g(), a(r, {
|
|
378
|
+
to: "body",
|
|
379
|
+
disabled: !P.value || !R.value
|
|
380
|
+
}, [A.value ? (g(), s("div", {
|
|
381
|
+
key: 0,
|
|
382
|
+
ref_key: "floatingEl",
|
|
383
|
+
ref: M,
|
|
384
|
+
"data-ui3n": "tooltip-content",
|
|
385
|
+
class: f([e.$style.floating, R.value && e.$style.floatingTeleported]),
|
|
386
|
+
style: p(J.value)
|
|
387
|
+
}, [v(e.$slots, "content", {}, () => [c("div", {
|
|
388
|
+
ref_key: "floatingArrowEl",
|
|
389
|
+
ref: N,
|
|
390
|
+
class: f([e.$style.arrow, e.$style[`arrow-${V.value}`]]),
|
|
391
|
+
style: p({
|
|
392
|
+
left: b(K).arrow?.x == null ? "" : `${b(K).arrow.x}px`,
|
|
393
|
+
top: b(K).arrow?.y == null ? "" : `${b(K).arrow.y}px`
|
|
394
|
+
})
|
|
395
|
+
}, null, 6), c("div", { class: f(e.$style.content) }, y(l.content), 3)])], 6)) : o("", !0)], 8, ["disabled"]))], 64));
|
|
396
|
+
}
|
|
397
|
+
}), [["__cssModules", { $style: {
|
|
398
|
+
container: "_container_1xxjj_1",
|
|
399
|
+
floating: "_floating_1xxjj_7",
|
|
400
|
+
floatingTeleported: "_floatingTeleported_1xxjj_16",
|
|
401
|
+
arrow: "_arrow_1xxjj_20",
|
|
402
|
+
"arrow-top": "_arrow-top_1xxjj_29",
|
|
403
|
+
"arrow-bottom": "_arrow-bottom_1xxjj_32",
|
|
404
|
+
"arrow-left": "_arrow-left_1xxjj_35",
|
|
405
|
+
"arrow-right": "_arrow-right_1xxjj_38",
|
|
406
|
+
content: "_content_1xxjj_42"
|
|
407
|
+
} }]]);
|
|
408
|
+
//#endregion
|
|
409
|
+
export { L as a, R as i, U as n, N as o, V as r, G as t };
|
|
@@ -13,14 +13,9 @@ declare const __VLS_component: import('vue').DefineComponent<Ui3nChipProps, {},
|
|
|
13
13
|
onClick?: ((value: MouseEvent) => any) | undefined;
|
|
14
14
|
onClose?: (() => any) | undefined;
|
|
15
15
|
}>, {
|
|
16
|
-
height: number | string;
|
|
17
|
-
color: string;
|
|
18
|
-
textColor: string;
|
|
19
|
-
maxWidth: number | string;
|
|
20
16
|
plain: boolean;
|
|
21
17
|
round: boolean;
|
|
22
18
|
closeable: boolean;
|
|
23
|
-
textSize: number | string;
|
|
24
19
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
25
20
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
26
21
|
export default _default;
|
|
@@ -5,7 +5,6 @@ declare const _default: import('vue').DefineComponent<Ui3nIconProps, {}, {}, {},
|
|
|
5
5
|
onClick?: ((value: MouseEvent) => any) | undefined;
|
|
6
6
|
}>, {
|
|
7
7
|
title: string;
|
|
8
|
-
color: string;
|
|
9
8
|
rotate: number;
|
|
10
9
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
11
10
|
export default _default;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Ui3nProgressCircularProps } from './types';
|
|
2
2
|
declare const _default: import('vue').DefineComponent<Ui3nProgressCircularProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Ui3nProgressCircularProps> & Readonly<{}>, {
|
|
3
3
|
size: number | string;
|
|
4
|
-
color: string;
|
|
5
4
|
value: number | string;
|
|
6
|
-
bgColor: string;
|
|
7
5
|
indeterminate: boolean;
|
|
8
6
|
withText: boolean;
|
|
9
7
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Ui3nProgressLinearProps } from './types';
|
|
2
2
|
declare const _default: import('vue').DefineComponent<Ui3nProgressLinearProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Ui3nProgressLinearProps> & Readonly<{}>, {
|
|
3
3
|
height: number | string;
|
|
4
|
-
color: string;
|
|
5
4
|
value: number | string;
|
|
6
|
-
bgColor: string;
|
|
7
5
|
indeterminate: boolean;
|
|
8
6
|
withText: boolean;
|
|
9
7
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
@@ -18,13 +18,6 @@ declare const __VLS_component: import('vue').DefineComponent<Ui3nScrollbarHorizo
|
|
|
18
18
|
}, string, import('vue').PublicProps, Readonly<Ui3nScrollbarHorizontalProps> & Readonly<{
|
|
19
19
|
onScroll?: ((value: Event) => any) | undefined;
|
|
20
20
|
}>, {
|
|
21
|
-
thumbRadius: number | string;
|
|
22
|
-
thumbColor: string;
|
|
23
|
-
thumbHoverColor: string;
|
|
24
|
-
thumbActiveColor: string;
|
|
25
|
-
trackRadius: number | string;
|
|
26
|
-
trackColor: string;
|
|
27
|
-
trackHeight: number | string;
|
|
28
21
|
thumbMinWidth: number | string;
|
|
29
22
|
thumbWidth: number | string | "auto";
|
|
30
23
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
@@ -22,13 +22,6 @@ declare const __VLS_component: import('vue').DefineComponent<Ui3nScrollbarVertic
|
|
|
22
22
|
autoUpdate: boolean;
|
|
23
23
|
thumbMinHeight: number | string;
|
|
24
24
|
thumbHeight: number | string | "auto";
|
|
25
|
-
thumbRadius: number | string;
|
|
26
|
-
thumbColor: string;
|
|
27
|
-
thumbHoverColor: string;
|
|
28
|
-
thumbActiveColor: string;
|
|
29
|
-
trackWidth: number;
|
|
30
|
-
trackRadius: number | string;
|
|
31
|
-
trackColor: string;
|
|
32
25
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
33
26
|
containerRef: HTMLDivElement;
|
|
34
27
|
trackRef: HTMLDivElement;
|
|
@@ -7,16 +7,11 @@ declare const _default: import('vue').DefineComponent<UI3nSliderProps, {
|
|
|
7
7
|
"onUpdate:modelValue"?: ((value: number | [number, number]) => any) | undefined;
|
|
8
8
|
}>, {
|
|
9
9
|
name: string;
|
|
10
|
-
activeColor: string;
|
|
11
|
-
thumbColor: string;
|
|
12
|
-
trackColor: string;
|
|
13
10
|
min: string | number;
|
|
14
11
|
max: string | number;
|
|
15
12
|
labelVisible: "always" | "normal" | "never";
|
|
16
13
|
labelTextColor: string;
|
|
17
14
|
labelColor: string;
|
|
18
|
-
trackHeight: string | number;
|
|
19
|
-
thumbSize: string | number;
|
|
20
15
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
21
16
|
sliderEl: HTMLDivElement;
|
|
22
17
|
pointerEl1: HTMLDivElement;
|
|
@@ -15,10 +15,6 @@ declare const __VLS_component: import('vue').DefineComponent<Ui3nTabsProps, {},
|
|
|
15
15
|
}>, {
|
|
16
16
|
modelValue: number;
|
|
17
17
|
itemDirection: "horizontal" | "vertical";
|
|
18
|
-
activeColor: string;
|
|
19
|
-
inactiveColor: string;
|
|
20
|
-
indicatorColor: string;
|
|
21
|
-
indicatorSize: number | string;
|
|
22
18
|
indicatorPosition: "normal" | "reverse";
|
|
23
19
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
24
20
|
tabs: HTMLDivElement;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
|
+
import { Ui3nVirtualElement } from '../ui3n-menu/types';
|
|
2
3
|
/**
|
|
3
4
|
* Tooltip placement types
|
|
4
5
|
*/
|
|
@@ -35,9 +36,14 @@ export interface Ui3nTooltipProps {
|
|
|
35
36
|
* Tooltip placement
|
|
36
37
|
*/
|
|
37
38
|
placement?: Ui3nTooltipPlacement;
|
|
39
|
+
/**
|
|
40
|
+
* External element the tooltip is positioned against.
|
|
41
|
+
* When set, this node is the floating-ui reference and receives hover/click listeners.
|
|
42
|
+
*/
|
|
43
|
+
triggerElement?: HTMLElement | Ui3nVirtualElement;
|
|
38
44
|
/**
|
|
39
45
|
* Position strategy
|
|
40
|
-
* @default 'absolute'
|
|
46
|
+
* @default 'absolute' (or 'fixed' when triggerElement is set)
|
|
41
47
|
*/
|
|
42
48
|
positionStrategy?: 'absolute' | 'fixed';
|
|
43
49
|
/**
|
|
@@ -91,7 +97,7 @@ export interface Ui3nTooltipSlots {
|
|
|
91
97
|
/**
|
|
92
98
|
* Default slot
|
|
93
99
|
*/
|
|
94
|
-
default
|
|
100
|
+
default?: () => VNode;
|
|
95
101
|
/**
|
|
96
102
|
* Content slot
|
|
97
103
|
*/
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TooltipInstance, Ui3nTooltipShowOptions } from '../../plugins/tooltips/types';
|
|
2
|
+
declare function add(item: TooltipInstance): void;
|
|
3
|
+
declare function remove(id: string): void;
|
|
4
|
+
declare function removeByKind(kind: 'show' | 'attach'): void;
|
|
5
|
+
declare function removeByTarget(target: HTMLElement): void;
|
|
6
|
+
declare function update(id: string, patch: Partial<Ui3nTooltipShowOptions>): void;
|
|
7
|
+
declare function clearAll(): void;
|
|
8
|
+
declare const _default: import('vue').DefineComponent<{}, {
|
|
9
|
+
add: typeof add;
|
|
10
|
+
remove: typeof remove;
|
|
11
|
+
removeByKind: typeof removeByKind;
|
|
12
|
+
removeByTarget: typeof removeByTarget;
|
|
13
|
+
update: typeof update;
|
|
14
|
+
clearAll: typeof clearAll;
|
|
15
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
16
|
+
export default _default;
|
|
@@ -23,15 +23,11 @@ declare const __VLS_component: import('vue').DefineComponent<Ui3nTooltipProps, {
|
|
|
23
23
|
onOpened?: (() => any) | undefined;
|
|
24
24
|
onClosed?: (() => any) | undefined;
|
|
25
25
|
}>, {
|
|
26
|
-
color: string;
|
|
27
26
|
disabled: boolean;
|
|
28
27
|
offsetX: string | number;
|
|
29
28
|
offsetY: string | number;
|
|
30
|
-
textColor: string;
|
|
31
|
-
positionStrategy: "absolute" | "fixed";
|
|
32
|
-
placement: import('./types').Ui3nTooltipPlacement;
|
|
33
|
-
maxContentWidth: number | string;
|
|
34
29
|
trigger: "click" | "hover" | "manual";
|
|
30
|
+
placement: import('./types').Ui3nTooltipPlacement;
|
|
35
31
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
36
32
|
referenceContainer: HTMLDivElement;
|
|
37
33
|
floatingEl: HTMLDivElement;
|
|
@@ -3,7 +3,9 @@ import { DialogsPlugin } from '../plugins/dialogs/types';
|
|
|
3
3
|
import { NotificationsPlugin } from '../plugins/notifications/types';
|
|
4
4
|
import { VueBusPlugin } from '../plugins/vue-bus/types';
|
|
5
5
|
import { ThemePlugin } from '../plugins/theme/types';
|
|
6
|
+
import { TooltipsPlugin } from '../plugins/tooltips/types';
|
|
6
7
|
export declare const DIALOGS_KEY: InjectionKey<DialogsPlugin>;
|
|
7
8
|
export declare const NOTIFICATIONS_KEY: InjectionKey<NotificationsPlugin>;
|
|
8
9
|
export declare const VUEBUS_KEY: InjectionKey<VueBusPlugin<any>>;
|
|
9
10
|
export declare const THEME_KEY: InjectionKey<ThemePlugin>;
|
|
11
|
+
export declare const TOOLTIPS_KEY: InjectionKey<TooltipsPlugin>;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ import { default as Ui3nLongPress } from './directives/ui3n-long-press';
|
|
|
45
45
|
import { VueEventBus } from './plugins/vue-bus/types';
|
|
46
46
|
import { ExtractComponentProps } from './types/components.types';
|
|
47
47
|
import { DialogOptions } from './plugins/dialogs/types';
|
|
48
|
+
import { TooltipsPlugin } from './plugins/tooltips/types';
|
|
48
49
|
export * from './constants';
|
|
49
50
|
export * from './utils';
|
|
50
51
|
export * from './plugins';
|
|
@@ -65,6 +66,7 @@ declare module 'vue' {
|
|
|
65
66
|
dialogStack: Ref<DialogOptions<any>[]>;
|
|
66
67
|
$createNotice: (params: Ui3nNotificationProps) => void;
|
|
67
68
|
$emitter: VueEventBus<any>;
|
|
69
|
+
$tooltip: TooltipsPlugin;
|
|
68
70
|
}
|
|
69
71
|
interface GlobalComponents {
|
|
70
72
|
Ui3nAutocomplete: typeof Ui3nAutocomplete;
|
|
@@ -128,5 +130,6 @@ declare module 'pinia' {
|
|
|
128
130
|
};
|
|
129
131
|
$createNotice: (params: Ui3nNotificationProps) => void;
|
|
130
132
|
$emitter: VueEventBus<any>;
|
|
133
|
+
$tooltip: TooltipsPlugin;
|
|
131
134
|
}
|
|
132
135
|
}
|
|
@@ -10,4 +10,7 @@ import { storeDialogs } from './dialogs/store-dialog';
|
|
|
10
10
|
import { theme } from './theme/theme';
|
|
11
11
|
import { storeTheme } from './theme/store-theme';
|
|
12
12
|
import { ThemePlugin, ThemePluginOptions, ThemeId } from './theme/types';
|
|
13
|
-
|
|
13
|
+
import { tooltips } from './tooltips/tooltips';
|
|
14
|
+
import { storeTooltips } from './tooltips/store-tooltips';
|
|
15
|
+
import { TooltipsPlugin, TooltipHandle, TooltipTarget, Ui3nTooltipShowOptions, Ui3nTooltipAttachOptions } from './tooltips/types';
|
|
16
|
+
export { notifications, NotificationsPlugin, vueBus, VueBusPlugin, dialogs, DialogsPlugin, DialogOptions, theme, ThemePlugin, ThemePluginOptions, ThemeId, tooltips, TooltipsPlugin, TooltipHandle, TooltipTarget, Ui3nTooltipShowOptions, Ui3nTooltipAttachOptions, storeNotifications, storeVueBus, storeDialogs, storeTheme, storeTooltips, };
|