litos-ui 0.8.0 → 0.9.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/lib/base.js +26 -30
- package/lib/button/index.js +55 -59
- package/lib/color_picker/index.js +17 -21
- package/lib/form/form_events.js +15 -17
- package/lib/form/form_inner.js +43 -47
- package/lib/form/form_item.js +49 -54
- package/lib/form/index.js +62 -66
- package/lib/icon/arrow_down.js +4 -7
- package/lib/icon/arrow_left.js +4 -7
- package/lib/icon/arrow_right.js +4 -7
- package/lib/icon/arrow_up.js +4 -7
- package/lib/icon/base.js +21 -25
- package/lib/icon/caret_bottom.js +4 -7
- package/lib/icon/caret_top.js +4 -7
- package/lib/icon/font_icon.js +13 -17
- package/lib/icon/info.js +4 -7
- package/lib/icon/loading.js +4 -7
- package/lib/icon/mask_close.js +4 -7
- package/lib/icon/moon.js +4 -7
- package/lib/icon/reduction.js +4 -7
- package/lib/icon/refresh_left.js +4 -7
- package/lib/icon/refresh_right.js +4 -7
- package/lib/icon/search.js +4 -7
- package/lib/icon/sort.js +4 -7
- package/lib/icon/success.js +4 -7
- package/lib/icon/sun.js +4 -7
- package/lib/icon/theme_default.js +4 -7
- package/lib/icon/warn.js +4 -7
- package/lib/input/index.js +66 -71
- package/lib/list/index.js +23 -27
- package/lib/polygon/index.js +14 -18
- package/lib/popconfirm/index.js +11 -14
- package/lib/popover/index.js +107 -113
- package/lib/radio/index.js +53 -57
- package/lib/select_ori/index.js +23 -27
- package/lib/switch/index.js +34 -44
- package/lib/tabbar/index.js +117 -126
- package/lib/theme/index.js +71 -74
- package/lib/theme/theme_color.js +17 -27
- package/lib/utils/event.js +16 -18
- package/lib/utils/transition.js +23 -27
- package/package.json +1 -1
package/lib/utils/event.js
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
|
-
let
|
|
2
|
-
function
|
|
3
|
-
|
|
1
|
+
let e;
|
|
2
|
+
function s(t, i, f) {
|
|
3
|
+
e == null && (e = /* @__PURE__ */ new Map()), e.has(t) || e.set(t, /* @__PURE__ */ new Map([[i, /* @__PURE__ */ new Set()]])), e.get(t).has(i) || e.get(t).set(i, /* @__PURE__ */ new Set()), e.get(t).get(i).add(f);
|
|
4
4
|
}
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
(d = (g = i == null ? void 0 : i.get(f)) == null ? void 0 : g.get(t)) == null || d.delete(o), ((l = (e = i == null ? void 0 : i.get(f)) == null ? void 0 : e.get(t)) == null ? void 0 : l.size) == 0 && ((u = i.get(f)) == null || u.delete(t)), ((r = i == null ? void 0 : i.get(f)) == null ? void 0 : r.size) == 0 && i.delete(f), (i == null ? void 0 : i.size) == 0 && (i = void 0);
|
|
5
|
+
function d(t, i, f) {
|
|
6
|
+
e?.get(t)?.get(i)?.delete(f), e?.get(t)?.get(i)?.size == 0 && e.get(t)?.delete(i), e?.get(t)?.size == 0 && e.delete(t), e?.size == 0 && (e = void 0);
|
|
8
7
|
}
|
|
9
|
-
function
|
|
10
|
-
|
|
8
|
+
function l(t) {
|
|
9
|
+
t == null ? e != null && (e.clear(), e = void 0) : e != null && (e.delete(t), e.size === 0 && (e = void 0));
|
|
11
10
|
}
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
e(...o);
|
|
11
|
+
function u(t, i, ...f) {
|
|
12
|
+
const o = e?.get(t)?.get(i);
|
|
13
|
+
if (o != null)
|
|
14
|
+
for (const g of o)
|
|
15
|
+
g(...f);
|
|
18
16
|
}
|
|
19
17
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
s as add,
|
|
19
|
+
l as clear,
|
|
20
|
+
u as emit,
|
|
21
|
+
d as remove
|
|
24
22
|
};
|
package/lib/utils/transition.js
CHANGED
|
@@ -1,57 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var o = (s, e, t) => d(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { initAttr as p } from "./index.js";
|
|
5
|
-
import u from "../base.js";
|
|
1
|
+
import { initAttr as h } from "./index.js";
|
|
2
|
+
import a from "../base.js";
|
|
6
3
|
import "../message/index.js";
|
|
7
|
-
import { transition as
|
|
4
|
+
import { transition as i } from "ph-utils/dom";
|
|
8
5
|
import "ph-utils";
|
|
9
6
|
import "ph-utils/validator";
|
|
10
7
|
import "ph-utils/color";
|
|
11
8
|
import "ph-utils/theme";
|
|
12
|
-
class
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
o(this, "duration", "0.3s");
|
|
18
|
-
p(this), this.sheetRec = this._parseSheets(this.getAttr("sheets", "opacity: 0"));
|
|
19
|
-
}
|
|
9
|
+
class C extends a {
|
|
10
|
+
static baseName = "transition";
|
|
11
|
+
/** 应用过滤动画的属性值, 例如: opacity: 0; transform: xx; */
|
|
12
|
+
sheetRec;
|
|
13
|
+
duration = "0.3s";
|
|
20
14
|
static get observedAttributes() {
|
|
21
15
|
return ["sheets"];
|
|
22
16
|
}
|
|
17
|
+
constructor() {
|
|
18
|
+
super(), h(this), this.sheetRec = this._parseSheets(this.getAttr("sheets", "opacity: 0"));
|
|
19
|
+
}
|
|
23
20
|
connectedCallback() {
|
|
24
21
|
super.connectedCallback(), this.show();
|
|
25
22
|
}
|
|
26
23
|
render() {
|
|
27
24
|
this.shadow.innerHTML = "<slot></slot>";
|
|
28
25
|
}
|
|
29
|
-
attributeChangedCallback(t,
|
|
30
|
-
t === "sheets" && (this.sheetRec = this._parseSheets(
|
|
26
|
+
attributeChangedCallback(t, e, s) {
|
|
27
|
+
t === "sheets" && (this.sheetRec = this._parseSheets(s));
|
|
31
28
|
}
|
|
32
29
|
show() {
|
|
33
30
|
const t = this._getSlotFirstChild();
|
|
34
|
-
t &&
|
|
31
|
+
t && i(t, this.sheetRec, "enter");
|
|
35
32
|
}
|
|
36
33
|
hide(t) {
|
|
37
|
-
const
|
|
38
|
-
|
|
34
|
+
const e = this._getSlotFirstChild();
|
|
35
|
+
e && i(e, this.sheetRec, "leave", t);
|
|
39
36
|
}
|
|
40
37
|
_parseSheets(t) {
|
|
41
|
-
const
|
|
42
|
-
return
|
|
43
|
-
if (
|
|
44
|
-
const [
|
|
45
|
-
|
|
38
|
+
const e = t.split(";"), s = [];
|
|
39
|
+
return e.forEach((r) => {
|
|
40
|
+
if (r) {
|
|
41
|
+
const [o, n] = r.split(":");
|
|
42
|
+
s.push([o.trim(), n.trim(), this.duration]);
|
|
46
43
|
}
|
|
47
|
-
}),
|
|
44
|
+
}), s;
|
|
48
45
|
}
|
|
49
46
|
_getSlotFirstChild() {
|
|
50
47
|
const t = this.shadow.querySelector("slot");
|
|
51
48
|
return t != null && t.assignedNodes().length > 0 ? t.assignedNodes()[0] : null;
|
|
52
49
|
}
|
|
53
50
|
}
|
|
54
|
-
o(m, "baseName", "transition");
|
|
55
51
|
export {
|
|
56
|
-
|
|
52
|
+
C as Transition
|
|
57
53
|
};
|