litos-ui 0.11.0 → 0.11.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/lib/button/index.d.ts +1 -0
- package/lib/button/index.js +2 -2
- package/lib/dialog/index.js +1 -1
- package/lib/index.js +101 -102
- package/lib/input/index.d.ts +1 -0
- package/lib/input/index.js +1 -0
- package/lib/utils/index.d.ts +0 -5
- package/lib/utils/index.js +56 -63
- package/package.json +13 -13
- package/styles/dialog.css +56 -56
- package/styles/loading.css +100 -100
package/lib/button/index.d.ts
CHANGED
package/lib/button/index.js
CHANGED
|
@@ -3,9 +3,10 @@ import d from "../base.js";
|
|
|
3
3
|
import { $one as h, addClass as g, removeClass as p, on as v, off as f, formatClass as u, formatStyle as m, getAttr as k } from "ph-utils/dom";
|
|
4
4
|
import { adjust as b } from "ph-utils/color";
|
|
5
5
|
import { a as x } from "../animation-DttknHkX.js";
|
|
6
|
-
const y = ":host{--l-btn-text-color: #ffffff;--l-btn-hover-text-color: var(--l-btn-text-color);--l-btn-active-text-color: var(--l-btn-text-color);--l-btn-border-color: var(--l-primary-color, #722ed1);--l-btn-background: var(--l-btn-border-color);--l-btn-hover-border-color: var(--l-primary-color-light1, #9254de);--l-btn-hover-background: var(--l-btn-hover-border-color);--l-btn-active-border-color: var(--l-primary-color-dark1, #531dab);--l-btn-active-background: var(--l-btn-active-border-color);--l-btn-disabled-color: #c9c9c9;--l-btn-disabled-background: #fbfbfb;--l-btn-disabled-border-color: #e6e6e6;display:inline-block;width:auto;font-size:0}.l-btn{width:100%;display:inline-flex;justify-content:center;align-items:center;cursor:pointer;outline:none;box-sizing:border-box;vertical-align:middle;padding:0 15px;line-height:1;height:
|
|
6
|
+
const y = ":host{--l-btn-text-color: #ffffff;--l-btn-hover-text-color: var(--l-btn-text-color);--l-btn-active-text-color: var(--l-btn-text-color);--l-btn-border-color: var(--l-primary-color, #722ed1);--l-btn-background: var(--l-btn-border-color);--l-btn-hover-border-color: var(--l-primary-color-light1, #9254de);--l-btn-hover-background: var(--l-btn-hover-border-color);--l-btn-active-border-color: var(--l-primary-color-dark1, #531dab);--l-btn-active-background: var(--l-btn-active-border-color);--l-btn-disabled-color: #c9c9c9;--l-btn-disabled-background: #fbfbfb;--l-btn-disabled-border-color: #e6e6e6;display:inline-block;width:auto;height:var(--l-form-edit-height, 32px);font-size:0}:host([block]){width:100%}.l-btn{width:100%;display:inline-flex;justify-content:center;align-items:center;cursor:pointer;outline:none;box-sizing:border-box;vertical-align:middle;padding:0 15px;line-height:1;height:100%;border-radius:3px;font-size:14px;color:var(--l-btn-text-color);background:var(--l-btn-background);border:1px solid var(--l-btn-border-color);position:relative;gap:5px;transition:border-color .3s,background-color .3s,color .3s}.l-btn:hover{border-color:var(--l-btn-hover-border-color, var(--l-btn-hover-background));color:var(--l-btn-hover-text-color);background:var(--l-btn-hover-background)}.l-btn:active{border-color:var(--l-btn-active-border-color, var(--l-btn-active-background));color:var(--l-btn-active-text-color);background:var(--l-btn-active-background)}.l-btn-normal{--l-btn-text-color: auto;--l-btn-background: transparent;--l-btn-border-color: #d9d9d9;--l-btn-hover-text-color: var(--l-primary-color-light1, #9254de);--l-btn-active-text-color: var(--l-primary-color-dark1, #531dab);--l-btn-hover-background: #fff;--l-btn-active-background: #fff;--l-btn-hover-border-color: var(--l-btn-hover-text-color);--l-btn-active-border-color: var(--l-btn-active-text-color)}.l-btn-primary{--l-btn-background: var(--l-primary-color, #722ed1);--l-btn-hover-background: var(--l-primary-color-light1, #9254de);--l-btn-active-background: var(--l-primary-color-dark1, #531dab)}.l-btn:not(.l-btn-loading):disabled{border-color:var(--l-btn-disabled-border-color);background:var(--l-btn-disabled-background);color:var(--l-btn-disabled-color);cursor:not-allowed;opacity:1}.l-btn-text{--l-btn-background: transparent;--l-btn-border-color: transparent;--l-btn-hover-border-color: transparent;--l-btn-active-border-color: transparent;--l-btn-disabled-background: transparent;--l-btn-disabled-border-color: transparent;--l-btn-hover-background: transparent;--l-btn-active-background: transparent;height:auto;padding:5px}.l-btn-primary.l-btn-text{--l-btn-text-color: var(--l-primary-color, #722ed1);--l-btn-hover-text-color: var(--l-primary-color-light1, #9254de);--l-btn-active-text-color: var(--l-primary-color-dark1, #531dab)}.l-btn-ghost{--l-btn-text-color: var(--l-btn-border-color);--l-btn-background: transparent;--l-btn-hover-background: transparent;--l-btn-active-background: transparent;--l-btn-hover-text-color: var(--l-btn-hover-border-color);--l-btn-active-text-color: var(--l-btn-active-border-color)}.l-btn-round{border-radius:calc(var(--l-form-edit-height, 32px) / 2)}.l-btn-circle{border-radius:50%;width:var(--l-form-edit-height, 32px);padding:0}.l-btn:not(.l-btn-text)+.l-btn{margin-left:10px}html.dark .l-btn:disabled{--l-btn-disabled-background: rgba(255, 255, 255, .08);--l-btn-disabled-color: rgba(255, 255, 255, .3);--l-btn-disabled-border-color: rgba(255, 255, 255, .3)}";
|
|
7
7
|
class w extends d {
|
|
8
8
|
static baseName = "button";
|
|
9
|
+
static tagName = "l-button";
|
|
9
10
|
htmlType = "button";
|
|
10
11
|
constructor() {
|
|
11
12
|
super(), s(this);
|
|
@@ -35,7 +36,6 @@ class w extends d {
|
|
|
35
36
|
const r = this.getAttr("type", "normal"), t = document.createElement("button"), o = this.getAttr("loading", !1), l = this.getAttr("shape", "default"), e = this.getAttr("text", !1), n = this.getAttr("ghost", !1), i = [
|
|
36
37
|
"l-btn",
|
|
37
38
|
`l-btn-${r}`,
|
|
38
|
-
this.getAttr("block", !1) ? "l-btn-block" : "",
|
|
39
39
|
l === "round" ? "l-btn-round" : "",
|
|
40
40
|
l === "circle" ? "l-btn-circle" : "",
|
|
41
41
|
n ? "l-btn-ghost" : "",
|
package/lib/dialog/index.js
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,104 +1,103 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { set as
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as
|
|
5
|
-
import { default as
|
|
6
|
-
import { default as
|
|
7
|
-
import { default as
|
|
8
|
-
import { default as
|
|
9
|
-
import { default as
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
import { default as
|
|
16
|
-
import { default as
|
|
17
|
-
import { default as
|
|
18
|
-
import { default as
|
|
19
|
-
import { default as
|
|
20
|
-
import { default as
|
|
21
|
-
import { default as
|
|
22
|
-
import { default as
|
|
23
|
-
import { default as
|
|
24
|
-
import { default as
|
|
25
|
-
import { default as
|
|
26
|
-
import { default as
|
|
27
|
-
import { default as
|
|
28
|
-
import { default as
|
|
29
|
-
import { default as
|
|
30
|
-
import { default as
|
|
31
|
-
import { default as
|
|
32
|
-
import { default as
|
|
33
|
-
import { default as
|
|
34
|
-
import { default as
|
|
35
|
-
import { default as
|
|
36
|
-
import { default as
|
|
37
|
-
import { default as
|
|
38
|
-
import { default as
|
|
39
|
-
import { default as
|
|
40
|
-
import { default as
|
|
41
|
-
import { default as
|
|
42
|
-
import { default as
|
|
43
|
-
import { default as
|
|
44
|
-
import { default as
|
|
45
|
-
import { default as
|
|
1
|
+
import { createTransition as t, getPopoverOffsetX as r, getPopoverOffsetY as a, impactDetect as f, initAttr as s, parseAttrValue as m, regist as p, setAttrs as l, tagAttr as u, tagAttrs as d, useId as x } from "./utils/index.js";
|
|
2
|
+
import { set as c, remove as I } from "./utils/clickoutside.js";
|
|
3
|
+
import { default as g } from "./base.js";
|
|
4
|
+
import { default as C } from "./message/index.js";
|
|
5
|
+
import { default as w } from "./popover/index.js";
|
|
6
|
+
import { default as R } from "./popconfirm/index.js";
|
|
7
|
+
import { default as T } from "./dialog/index.js";
|
|
8
|
+
import { default as D } from "./dialog/dialog_container.js";
|
|
9
|
+
import { default as O } from "./loading/index.js";
|
|
10
|
+
import { default as B } from "./icon/base.js";
|
|
11
|
+
import { default as F } from "./icon/arrow_down.js";
|
|
12
|
+
import { default as y } from "./icon/arrow_left.js";
|
|
13
|
+
import { default as V } from "./icon/arrow_right.js";
|
|
14
|
+
import { default as X } from "./icon/arrow_up.js";
|
|
15
|
+
import { default as j } from "./icon/caret_top.js";
|
|
16
|
+
import { default as z } from "./icon/caret_bottom.js";
|
|
17
|
+
import { default as G } from "./icon/font_icon.js";
|
|
18
|
+
import { default as J } from "./icon/loading.js";
|
|
19
|
+
import { default as N } from "./icon/search.js";
|
|
20
|
+
import { default as Z } from "./icon/sun.js";
|
|
21
|
+
import { default as $ } from "./icon/moon.js";
|
|
22
|
+
import { default as eo } from "./icon/reduction.js";
|
|
23
|
+
import { default as ro } from "./icon/refresh_left.js";
|
|
24
|
+
import { default as fo } from "./icon/refresh_right.js";
|
|
25
|
+
import { default as mo } from "./icon/sort.js";
|
|
26
|
+
import { default as lo } from "./icon/theme_default.js";
|
|
27
|
+
import { default as xo } from "./icon/close.js";
|
|
28
|
+
import { default as co } from "./icon/info.js";
|
|
29
|
+
import { default as io } from "./icon/success.js";
|
|
30
|
+
import { default as ho } from "./icon/warn.js";
|
|
31
|
+
import { default as Ao } from "./form/index.js";
|
|
32
|
+
import { default as Po } from "./form/form_item.js";
|
|
33
|
+
import { default as So } from "./radio/index.js";
|
|
34
|
+
import { default as vo } from "./checkbox/index.js";
|
|
35
|
+
import { default as Lo } from "./button/index.js";
|
|
36
|
+
import { default as ko } from "./input/index.js";
|
|
37
|
+
import { default as bo } from "./select_ori/index.js";
|
|
38
|
+
import { default as Mo } from "./switch/index.js";
|
|
39
|
+
import { default as Uo } from "./md_input/index.js";
|
|
40
|
+
import { default as Wo } from "./list/index.js";
|
|
41
|
+
import { default as Yo } from "./polygon/index.js";
|
|
42
|
+
import { default as qo } from "./color_picker/index.js";
|
|
43
|
+
import { default as Eo } from "./tabbar/index.js";
|
|
44
|
+
import { default as Ho } from "./theme/index.js";
|
|
45
|
+
import { default as Ko } from "./theme/theme_color.js";
|
|
46
46
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
t as
|
|
92
|
-
r as
|
|
93
|
-
a as
|
|
94
|
-
f as
|
|
95
|
-
s as
|
|
96
|
-
m as
|
|
97
|
-
p as
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
u as
|
|
101
|
-
d as
|
|
102
|
-
x as
|
|
103
|
-
n as useId
|
|
47
|
+
F as ArrowDownIcon,
|
|
48
|
+
y as ArrowLeftIcon,
|
|
49
|
+
V as ArrowRightIcon,
|
|
50
|
+
X as ArrowUpIcon,
|
|
51
|
+
g as BaseComponent,
|
|
52
|
+
B as BaseIcon,
|
|
53
|
+
Lo as Button,
|
|
54
|
+
z as CaretBottomIcon,
|
|
55
|
+
j as CaretTopIcon,
|
|
56
|
+
vo as Checkbox,
|
|
57
|
+
xo as CloseIcon,
|
|
58
|
+
qo as ColorPicker,
|
|
59
|
+
T as Dialog,
|
|
60
|
+
D as DialogContainer,
|
|
61
|
+
G as FontIcon,
|
|
62
|
+
Ao as Form,
|
|
63
|
+
Po as FormItem,
|
|
64
|
+
co as InfoIcon,
|
|
65
|
+
ko as Input,
|
|
66
|
+
Wo as List,
|
|
67
|
+
O as Loading,
|
|
68
|
+
J as LoadingIcon,
|
|
69
|
+
Uo as MdInput,
|
|
70
|
+
C as Message,
|
|
71
|
+
$ as MoonIcon,
|
|
72
|
+
Yo as Polygon,
|
|
73
|
+
R as Popconfirm,
|
|
74
|
+
w as Popover,
|
|
75
|
+
So as Radio,
|
|
76
|
+
eo as ReductionIcon,
|
|
77
|
+
ro as RefreshLeftIcon,
|
|
78
|
+
fo as RefreshRightIcon,
|
|
79
|
+
N as SearchIcon,
|
|
80
|
+
bo as SelectOri,
|
|
81
|
+
mo as SortIcon,
|
|
82
|
+
io as SuccessIcon,
|
|
83
|
+
Z as SunIcon,
|
|
84
|
+
Mo as Switch,
|
|
85
|
+
Eo as Tabbar,
|
|
86
|
+
Ho as Theme,
|
|
87
|
+
Ko as ThemeColor,
|
|
88
|
+
lo as ThemeDefaultIcon,
|
|
89
|
+
ho as WarnIcon,
|
|
90
|
+
c as addClickOutside,
|
|
91
|
+
t as createTransition,
|
|
92
|
+
r as getPopoverOffsetX,
|
|
93
|
+
a as getPopoverOffsetY,
|
|
94
|
+
f as impactDetect,
|
|
95
|
+
s as initAttr,
|
|
96
|
+
m as parseAttrValue,
|
|
97
|
+
p as regist,
|
|
98
|
+
I as removeClickOutside,
|
|
99
|
+
l as setAttrs,
|
|
100
|
+
u as tagAttr,
|
|
101
|
+
d as tagAttrs,
|
|
102
|
+
x as useId
|
|
104
103
|
};
|
package/lib/input/index.d.ts
CHANGED
package/lib/input/index.js
CHANGED
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.js
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import { isBlank as N } from "ph-utils";
|
|
2
|
-
import {
|
|
3
|
-
let E = -1
|
|
4
|
-
|
|
5
|
-
prefix: "l"
|
|
6
|
-
};
|
|
7
|
-
function H(t) {
|
|
8
|
-
y = { ...y, ...t };
|
|
9
|
-
}
|
|
10
|
-
function _(t, r) {
|
|
2
|
+
import { $ as x, iterate as $, transition as y } from "ph-utils/dom";
|
|
3
|
+
let E = -1;
|
|
4
|
+
function H(t, r) {
|
|
11
5
|
const e = Array.isArray(t) ? t : [t];
|
|
12
6
|
for (const i of e) {
|
|
13
|
-
const
|
|
14
|
-
customElements.get(
|
|
7
|
+
const s = r || i.tabName || `l-${i.baseName}`;
|
|
8
|
+
customElements.get(s) || customElements.define(s, i);
|
|
15
9
|
}
|
|
16
10
|
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
11
|
+
function _() {
|
|
12
|
+
return `l-${++E}`;
|
|
19
13
|
}
|
|
20
14
|
function I(t, r, e) {
|
|
21
15
|
if (t == null) return r;
|
|
@@ -28,95 +22,95 @@ function I(t, r, e) {
|
|
|
28
22
|
return t;
|
|
29
23
|
}
|
|
30
24
|
}
|
|
31
|
-
function
|
|
25
|
+
function k(t) {
|
|
32
26
|
const r = t.attributes;
|
|
33
27
|
for (const e of r) {
|
|
34
|
-
const { name: i, value:
|
|
28
|
+
const { name: i, value: s } = e;
|
|
35
29
|
if (i.startsWith("data-") || i.startsWith("aria-") || i.startsWith("_") || i.startsWith("$") || ["id", "class", "style"].includes(i))
|
|
36
30
|
continue;
|
|
37
|
-
const
|
|
38
|
-
(t._ignoreInitAttrs || []).includes(
|
|
31
|
+
const n = i.split("-").map((d, h) => h === 0 ? d : d[0].toUpperCase() + d.slice(1)).join(""), u = I(s, t[n], i), f = Object.getOwnPropertyNames(t);
|
|
32
|
+
(t._ignoreInitAttrs || []).includes(n) || (i === "value" ? (t[n] = u, t._resetValue = u) : f.includes(n) && (t[n] = u));
|
|
39
33
|
}
|
|
40
34
|
}
|
|
41
35
|
function W(t, r) {
|
|
42
36
|
let e = " ";
|
|
43
37
|
return r === !0 ? e = ` ${t}` : typeof r == "string" && !N(r) && (e = ` ${t}="${r}"`), e;
|
|
44
38
|
}
|
|
45
|
-
function
|
|
39
|
+
function C(t) {
|
|
46
40
|
return t.map((e) => W(e[0], e[1])).join("");
|
|
47
41
|
}
|
|
48
|
-
function
|
|
42
|
+
function V(t, r) {
|
|
49
43
|
for (const e of r) {
|
|
50
|
-
const i = e[1],
|
|
51
|
-
i === !0 ? t.setAttribute(
|
|
44
|
+
const i = e[1], s = e[0];
|
|
45
|
+
i === !0 ? t.setAttribute(s, "") : typeof i == "string" && !N(i) && t.setAttribute(s, i);
|
|
52
46
|
}
|
|
53
47
|
}
|
|
54
|
-
function
|
|
48
|
+
function B() {
|
|
55
49
|
let t;
|
|
56
50
|
const r = {
|
|
57
51
|
attributes: !0,
|
|
58
52
|
attributeFilter: ["l-transition-emit"]
|
|
59
|
-
}, e = (
|
|
60
|
-
for (let
|
|
61
|
-
if (
|
|
62
|
-
const
|
|
63
|
-
c === "show" ? (
|
|
64
|
-
h === "remove" ?
|
|
53
|
+
}, e = (n) => {
|
|
54
|
+
for (let u of n)
|
|
55
|
+
if (u.type === "attributes" && u.attributeName) {
|
|
56
|
+
const f = u.target, c = f.getAttribute(u.attributeName) || "show", d = f.getAttribute("l-transition") || "l", h = f.getAttribute("l-transition-method") || "hide";
|
|
57
|
+
c === "show" ? (f.style.removeProperty("display"), y(f, d, "enter")) : y(f, d, "leave", () => {
|
|
58
|
+
h === "remove" ? f.remove() : f.style.display = "none";
|
|
65
59
|
});
|
|
66
60
|
}
|
|
67
61
|
};
|
|
68
|
-
function i(
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
|
|
62
|
+
function i(n) {
|
|
63
|
+
n && n.length > 0 && (t == null && (t = new MutationObserver(e)), $(n, (u) => {
|
|
64
|
+
const f = u.getAttribute("l-transition");
|
|
65
|
+
f && (y(u, f, "enter"), t.observe(u, r));
|
|
72
66
|
}));
|
|
73
67
|
}
|
|
74
|
-
function n
|
|
75
|
-
|
|
68
|
+
function s(n) {
|
|
69
|
+
n == null && (n = x("[l-transition]"), i(n));
|
|
76
70
|
}
|
|
77
71
|
function o() {
|
|
78
72
|
t && (t.disconnect(), t = void 0);
|
|
79
73
|
}
|
|
80
|
-
return { destroy: o, add: i, init:
|
|
74
|
+
return { destroy: o, add: i, init: s };
|
|
81
75
|
}
|
|
82
|
-
function
|
|
76
|
+
function m(t, r, e, i, s = 10) {
|
|
83
77
|
let o = 0;
|
|
84
|
-
return e === "top" ? o = r.height +
|
|
78
|
+
return e === "top" ? o = r.height + s : e === "bottom" ? o = -(t.height + s) : (e === "left" || e === "right") && (i === "" ? o = r.height / 2 - t.height / 2 : i === "end" && (o = r.height - t.height)), o;
|
|
85
79
|
}
|
|
86
|
-
function
|
|
80
|
+
function w(t, r, e, i, s = 10) {
|
|
87
81
|
let o = 0;
|
|
88
|
-
return e === "left" ? o = r.width +
|
|
82
|
+
return e === "left" ? o = r.width + s : e === "right" ? o = -(t.width + s) : (e === "top" || e === "bottom") && (i === "" ? o = r.width / 2 - t.width / 2 : i === "end" && (o = r.width - t.width)), o;
|
|
89
83
|
}
|
|
90
|
-
function
|
|
91
|
-
const d = window.innerHeight + o - 10, h = window.innerWidth +
|
|
92
|
-
let a = t.top + o -
|
|
93
|
-
a + r.height > d && (e === "left" || e === "right" ? i = "end" : e = "top",
|
|
84
|
+
function F(t, r, e, i, s, o, n, u, f = 10, c = "absolute") {
|
|
85
|
+
const d = window.innerHeight + o - 10, h = window.innerWidth + s - 10;
|
|
86
|
+
let a = t.top + o - u;
|
|
87
|
+
a + r.height > d && (e === "left" || e === "right" ? i = "end" : e = "top", u = m(
|
|
94
88
|
t,
|
|
95
89
|
r,
|
|
96
90
|
e,
|
|
97
91
|
i,
|
|
98
|
-
|
|
99
|
-
), a = t.top + o -
|
|
100
|
-
let b = t.left +
|
|
101
|
-
return b + r.width > h && (e === "top" || e === "bottom" ? i = "end" : e = "left",
|
|
92
|
+
f
|
|
93
|
+
), a = t.top + o - u), a < o && (e === "left" || e === "right" ? i = "start" : e = "bottom");
|
|
94
|
+
let b = t.left + s - n;
|
|
95
|
+
return b + r.width > h && (e === "top" || e === "bottom" ? i = "end" : e = "left", n = w(
|
|
102
96
|
t,
|
|
103
97
|
r,
|
|
104
98
|
e,
|
|
105
99
|
i,
|
|
106
|
-
|
|
107
|
-
), b = t.left +
|
|
100
|
+
f
|
|
101
|
+
), b = t.left + s - n), b < s && (e === "top" || e === "bottom" ? i = "start" : e = "right"), c === "fixed" && (u = m(
|
|
108
102
|
t,
|
|
109
103
|
r,
|
|
110
104
|
e,
|
|
111
105
|
i,
|
|
112
|
-
|
|
113
|
-
),
|
|
106
|
+
f
|
|
107
|
+
), n = w(
|
|
114
108
|
t,
|
|
115
109
|
r,
|
|
116
110
|
e,
|
|
117
111
|
i,
|
|
118
|
-
|
|
119
|
-
), b = t.left +
|
|
112
|
+
f
|
|
113
|
+
), b = t.left + s - n, a = t.top + o - u), {
|
|
120
114
|
x: b,
|
|
121
115
|
y: a,
|
|
122
116
|
mainAlign: e,
|
|
@@ -124,16 +118,15 @@ function U(t, r, e, i, n, o, s, f, u = 10, c = "absolute") {
|
|
|
124
118
|
};
|
|
125
119
|
}
|
|
126
120
|
export {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
V as initAttr,
|
|
121
|
+
B as createTransition,
|
|
122
|
+
w as getPopoverOffsetX,
|
|
123
|
+
m as getPopoverOffsetY,
|
|
124
|
+
F as impactDetect,
|
|
125
|
+
k as initAttr,
|
|
133
126
|
I as parseAttrValue,
|
|
134
|
-
|
|
135
|
-
|
|
127
|
+
H as regist,
|
|
128
|
+
V as setAttrs,
|
|
136
129
|
W as tagAttr,
|
|
137
|
-
|
|
138
|
-
|
|
130
|
+
C as tagAttrs,
|
|
131
|
+
_ as useId
|
|
139
132
|
};
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "litos-ui",
|
|
3
3
|
"description": "基于 Web Component 的 UI 组件库",
|
|
4
|
-
"version": "0.11.
|
|
4
|
+
"version": "0.11.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"@eslint/js": "^9.
|
|
8
|
-
"@eslint/markdown": "^6.
|
|
9
|
-
"@types/node": "^22.13.
|
|
10
|
-
"eslint": "^9.
|
|
7
|
+
"@eslint/js": "^9.22.0",
|
|
8
|
+
"@eslint/markdown": "^6.3.0",
|
|
9
|
+
"@types/node": "^22.13.10",
|
|
10
|
+
"eslint": "^9.22.0",
|
|
11
11
|
"globals": "^16.0.0",
|
|
12
12
|
"less": "^4.2.2",
|
|
13
|
-
"lightningcss": "^1.29.
|
|
14
|
-
"prettier": "^3.5.
|
|
15
|
-
"typescript": "^5.
|
|
16
|
-
"typescript-eslint": "^8.
|
|
17
|
-
"vite": "^6.
|
|
18
|
-
"vite-plugin-dts": "^4.5.
|
|
13
|
+
"lightningcss": "^1.29.3",
|
|
14
|
+
"prettier": "^3.5.3",
|
|
15
|
+
"typescript": "^5.8.2",
|
|
16
|
+
"typescript-eslint": "^8.26.1",
|
|
17
|
+
"vite": "^6.2.2",
|
|
18
|
+
"vite-plugin-dts": "^4.5.3",
|
|
19
19
|
"vitepress": "^1.6.3"
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
},
|
|
53
53
|
"license": "MIT",
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"ph-utils": "^0.
|
|
56
|
-
"shiki": "^3.
|
|
55
|
+
"ph-utils": "^0.15.0",
|
|
56
|
+
"shiki": "^3.2.1"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"dev": "vite dev",
|
package/styles/dialog.css
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
.l-dialog {
|
|
2
|
-
--l-dialog-translate: translate3d(0, 80px, 0);
|
|
3
|
-
--l-dialog-width: 30%;
|
|
4
|
-
transform: scale3d(0, 0, 0);
|
|
5
|
-
border: none;
|
|
6
|
-
outline: none;
|
|
7
|
-
opacity: 0;
|
|
8
|
-
width: var(--l-dialog-width);
|
|
9
|
-
margin: 0 auto;
|
|
10
|
-
transition:
|
|
11
|
-
transform 0.3s,
|
|
12
|
-
opacity 0.3s;
|
|
13
|
-
max-width: 100%;
|
|
14
|
-
background-color: transparent;
|
|
15
|
-
}
|
|
16
|
-
.l-dialog-close-outside {
|
|
17
|
-
--l-dialog-translate: translate3d(5px, 90px, 0);
|
|
18
|
-
}
|
|
19
|
-
.l-dialog--vertical-middle {
|
|
20
|
-
--l-dialog-translate: translate3d(0, 0, 0);
|
|
21
|
-
margin: auto;
|
|
22
|
-
}
|
|
23
|
-
.l-dialog-close-outside.l-dialog--vertical-middle {
|
|
24
|
-
--l-dialog-translate: translate3d(5px, 0, 0);
|
|
25
|
-
}
|
|
26
|
-
.l-dialog--vertical-bottom {
|
|
27
|
-
--l-dialog-translate: translate3d(0, -100%, 0);
|
|
28
|
-
top: 100%;
|
|
29
|
-
border-bottom-left-radius: 0;
|
|
30
|
-
border-bottom-right-radius: 0;
|
|
31
|
-
}
|
|
32
|
-
.l-dialog-close-outside.l-dialog--vertical-bottom {
|
|
33
|
-
--l-dialog-translate: translate3d(5px, -100%, 0);
|
|
34
|
-
}
|
|
35
|
-
.l-dialog::backdrop {
|
|
36
|
-
background-color: rgba(0, 0, 0, 0.7);
|
|
37
|
-
opacity: 0;
|
|
38
|
-
transition: opacity 0.3s;
|
|
39
|
-
}
|
|
40
|
-
.l-dialog--open {
|
|
41
|
-
transform: scale3d(1, 1, 1) var(--l-dialog-translate);
|
|
42
|
-
opacity: 1;
|
|
43
|
-
}
|
|
44
|
-
.l-dialog--open::backdrop {
|
|
45
|
-
opacity: 1;
|
|
46
|
-
}
|
|
47
|
-
.l-body--dialog-open {
|
|
48
|
-
overflow: hidden;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@media screen and (max-width: 768px) {
|
|
52
|
-
.l-dialog {
|
|
53
|
-
width: 80%;
|
|
54
|
-
max-width: 300px;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
1
|
+
.l-dialog {
|
|
2
|
+
--l-dialog-translate: translate3d(0, 80px, 0);
|
|
3
|
+
--l-dialog-width: 30%;
|
|
4
|
+
transform: scale3d(0, 0, 0);
|
|
5
|
+
border: none;
|
|
6
|
+
outline: none;
|
|
7
|
+
opacity: 0;
|
|
8
|
+
width: var(--l-dialog-width);
|
|
9
|
+
margin: 0 auto;
|
|
10
|
+
transition:
|
|
11
|
+
transform 0.3s,
|
|
12
|
+
opacity 0.3s;
|
|
13
|
+
max-width: 100%;
|
|
14
|
+
background-color: transparent;
|
|
15
|
+
}
|
|
16
|
+
.l-dialog-close-outside {
|
|
17
|
+
--l-dialog-translate: translate3d(5px, 90px, 0);
|
|
18
|
+
}
|
|
19
|
+
.l-dialog--vertical-middle {
|
|
20
|
+
--l-dialog-translate: translate3d(0, 0, 0);
|
|
21
|
+
margin: auto;
|
|
22
|
+
}
|
|
23
|
+
.l-dialog-close-outside.l-dialog--vertical-middle {
|
|
24
|
+
--l-dialog-translate: translate3d(5px, 0, 0);
|
|
25
|
+
}
|
|
26
|
+
.l-dialog--vertical-bottom {
|
|
27
|
+
--l-dialog-translate: translate3d(0, -100%, 0);
|
|
28
|
+
top: 100%;
|
|
29
|
+
border-bottom-left-radius: 0;
|
|
30
|
+
border-bottom-right-radius: 0;
|
|
31
|
+
}
|
|
32
|
+
.l-dialog-close-outside.l-dialog--vertical-bottom {
|
|
33
|
+
--l-dialog-translate: translate3d(5px, -100%, 0);
|
|
34
|
+
}
|
|
35
|
+
.l-dialog::backdrop {
|
|
36
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
37
|
+
opacity: 0;
|
|
38
|
+
transition: opacity 0.3s;
|
|
39
|
+
}
|
|
40
|
+
.l-dialog--open {
|
|
41
|
+
transform: scale3d(1, 1, 1) var(--l-dialog-translate);
|
|
42
|
+
opacity: 1;
|
|
43
|
+
}
|
|
44
|
+
.l-dialog--open::backdrop {
|
|
45
|
+
opacity: 1;
|
|
46
|
+
}
|
|
47
|
+
.l-body--dialog-open {
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@media screen and (max-width: 768px) {
|
|
52
|
+
.l-dialog {
|
|
53
|
+
width: 80%;
|
|
54
|
+
max-width: 300px;
|
|
55
|
+
}
|
|
56
|
+
}
|
package/styles/loading.css
CHANGED
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
.l-loading:not(.l-loading-fullscreen) {
|
|
2
|
-
position: relative;
|
|
3
|
-
}
|
|
4
|
-
.l-loading-mask {
|
|
5
|
-
position: absolute;
|
|
6
|
-
top: 0;
|
|
7
|
-
right: 0;
|
|
8
|
-
bottom: 0;
|
|
9
|
-
left: 0;
|
|
10
|
-
background: rgba(0, 0, 0, 0.6);
|
|
11
|
-
border-radius: inherit;
|
|
12
|
-
display: flex;
|
|
13
|
-
justify-content: center;
|
|
14
|
-
align-items: center;
|
|
15
|
-
transition: opacity 0.3s ease-in-out;
|
|
16
|
-
opacity: 0;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.l-loading-spinner {
|
|
20
|
-
text-align: center;
|
|
21
|
-
}
|
|
22
|
-
.l-loading-spinner .circle {
|
|
23
|
-
display: inline;
|
|
24
|
-
width: 40px;
|
|
25
|
-
height: 40px;
|
|
26
|
-
animation: loading-rotate 1.5s linear infinite;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.l-loading-spinner .path {
|
|
30
|
-
stroke: var(--l-primary-color, #722ed1);
|
|
31
|
-
stroke-width: 2px;
|
|
32
|
-
stroke-linecap: round;
|
|
33
|
-
stroke-linejoin: round;
|
|
34
|
-
stroke-dasharray: 90, 150;
|
|
35
|
-
stroke-dashoffset: 0px;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.l-loading-spinner .l-loading-text {
|
|
39
|
-
color: var(--l-primary-color, #722ed1);
|
|
40
|
-
margin: 0;
|
|
41
|
-
font-size: 14px;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/* 全屏组件 */
|
|
45
|
-
.l-loading-fullscreen.l-loading-lock {
|
|
46
|
-
overflow: hidden;
|
|
47
|
-
}
|
|
48
|
-
.l-loading-fullscreen > .l-loading-mask {
|
|
49
|
-
position: fixed;
|
|
50
|
-
z-index: 100;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/* 进度条样式 */
|
|
54
|
-
.l-loading-bar.l-loading-mask {
|
|
55
|
-
bottom: auto;
|
|
56
|
-
height: 2px;
|
|
57
|
-
border-radius: inherit;
|
|
58
|
-
background-color: transparent;
|
|
59
|
-
justify-content: flex-start;
|
|
60
|
-
opacity: 1;
|
|
61
|
-
}
|
|
62
|
-
.l-loading-bar > .l-loading-spinner {
|
|
63
|
-
width: 100%;
|
|
64
|
-
height: 100%;
|
|
65
|
-
max-width: 0;
|
|
66
|
-
opacity: 1;
|
|
67
|
-
transition:
|
|
68
|
-
max-width 4s linear,
|
|
69
|
-
background-color 0.2s linear,
|
|
70
|
-
opacity 0.2s linear;
|
|
71
|
-
background-color: var(--l-primary-color, #722ed1);
|
|
72
|
-
}
|
|
73
|
-
.l-loading-bar--start .l-loading-spinner {
|
|
74
|
-
max-width: 90%;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.l-loading-bar--finish .l-loading-spinner {
|
|
78
|
-
transition:
|
|
79
|
-
max-width 0.2s linear,
|
|
80
|
-
background-color 0.2s linear,
|
|
81
|
-
opacity 0.2s linear;
|
|
82
|
-
max-width: 100%;
|
|
83
|
-
opacity: 0;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.l-loading-bar--error .l-loading-spinner {
|
|
87
|
-
transition:
|
|
88
|
-
max-width 0.2s linear,
|
|
89
|
-
background-color 0.2s linear,
|
|
90
|
-
opacity 0.2s linear;
|
|
91
|
-
max-width: 100%;
|
|
92
|
-
background-color: var(--l-error-color, #d03050);
|
|
93
|
-
opacity: 0;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
@keyframes loading-rotate {
|
|
97
|
-
100% {
|
|
98
|
-
transform: rotate3d(0, 0, 1, 360deg);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
1
|
+
.l-loading:not(.l-loading-fullscreen) {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
.l-loading-mask {
|
|
5
|
+
position: absolute;
|
|
6
|
+
top: 0;
|
|
7
|
+
right: 0;
|
|
8
|
+
bottom: 0;
|
|
9
|
+
left: 0;
|
|
10
|
+
background: rgba(0, 0, 0, 0.6);
|
|
11
|
+
border-radius: inherit;
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
align-items: center;
|
|
15
|
+
transition: opacity 0.3s ease-in-out;
|
|
16
|
+
opacity: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.l-loading-spinner {
|
|
20
|
+
text-align: center;
|
|
21
|
+
}
|
|
22
|
+
.l-loading-spinner .circle {
|
|
23
|
+
display: inline;
|
|
24
|
+
width: 40px;
|
|
25
|
+
height: 40px;
|
|
26
|
+
animation: loading-rotate 1.5s linear infinite;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.l-loading-spinner .path {
|
|
30
|
+
stroke: var(--l-primary-color, #722ed1);
|
|
31
|
+
stroke-width: 2px;
|
|
32
|
+
stroke-linecap: round;
|
|
33
|
+
stroke-linejoin: round;
|
|
34
|
+
stroke-dasharray: 90, 150;
|
|
35
|
+
stroke-dashoffset: 0px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.l-loading-spinner .l-loading-text {
|
|
39
|
+
color: var(--l-primary-color, #722ed1);
|
|
40
|
+
margin: 0;
|
|
41
|
+
font-size: 14px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* 全屏组件 */
|
|
45
|
+
.l-loading-fullscreen.l-loading-lock {
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
}
|
|
48
|
+
.l-loading-fullscreen > .l-loading-mask {
|
|
49
|
+
position: fixed;
|
|
50
|
+
z-index: 100;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* 进度条样式 */
|
|
54
|
+
.l-loading-bar.l-loading-mask {
|
|
55
|
+
bottom: auto;
|
|
56
|
+
height: 2px;
|
|
57
|
+
border-radius: inherit;
|
|
58
|
+
background-color: transparent;
|
|
59
|
+
justify-content: flex-start;
|
|
60
|
+
opacity: 1;
|
|
61
|
+
}
|
|
62
|
+
.l-loading-bar > .l-loading-spinner {
|
|
63
|
+
width: 100%;
|
|
64
|
+
height: 100%;
|
|
65
|
+
max-width: 0;
|
|
66
|
+
opacity: 1;
|
|
67
|
+
transition:
|
|
68
|
+
max-width 4s linear,
|
|
69
|
+
background-color 0.2s linear,
|
|
70
|
+
opacity 0.2s linear;
|
|
71
|
+
background-color: var(--l-primary-color, #722ed1);
|
|
72
|
+
}
|
|
73
|
+
.l-loading-bar--start .l-loading-spinner {
|
|
74
|
+
max-width: 90%;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.l-loading-bar--finish .l-loading-spinner {
|
|
78
|
+
transition:
|
|
79
|
+
max-width 0.2s linear,
|
|
80
|
+
background-color 0.2s linear,
|
|
81
|
+
opacity 0.2s linear;
|
|
82
|
+
max-width: 100%;
|
|
83
|
+
opacity: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.l-loading-bar--error .l-loading-spinner {
|
|
87
|
+
transition:
|
|
88
|
+
max-width 0.2s linear,
|
|
89
|
+
background-color 0.2s linear,
|
|
90
|
+
opacity 0.2s linear;
|
|
91
|
+
max-width: 100%;
|
|
92
|
+
background-color: var(--l-error-color, #d03050);
|
|
93
|
+
opacity: 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@keyframes loading-rotate {
|
|
97
|
+
100% {
|
|
98
|
+
transform: rotate3d(0, 0, 1, 360deg);
|
|
99
|
+
}
|
|
100
|
+
}
|