litos-ui 0.9.0 → 0.10.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/button/index.js +3 -3
- package/lib/checkbox/index.d.ts +17 -0
- package/lib/checkbox/index.js +135 -0
- package/lib/form/form_inner.js +21 -20
- package/lib/form/form_item.js +1 -1
- package/lib/form/index.js +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.js +30 -26
- package/lib/input/index.js +1 -1
- package/lib/litos-ui.css +1 -1
- package/lib/litos-ui.min.js +1 -1
- package/lib/md_input/index.d.ts +15 -0
- package/lib/md_input/index.js +60 -0
- package/lib/radio/index.js +1 -1
- package/lib/switch/index.js +1 -1
- package/lib/theme/index.js +1 -1
- package/lib/{form/form_events.d.ts → utils/event.d.ts} +5 -7
- package/lib/utils/index.js +21 -21
- package/package.json +1 -1
- package/lib/form/form_events.js +0 -22
package/lib/utils/index.js
CHANGED
|
@@ -17,7 +17,7 @@ function _(t, r) {
|
|
|
17
17
|
function k() {
|
|
18
18
|
return `${y.prefix}-${++E}`;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function I(t, r, e) {
|
|
21
21
|
if (t == null) return r;
|
|
22
22
|
switch (typeof r) {
|
|
23
23
|
case "boolean":
|
|
@@ -34,16 +34,16 @@ function V(t) {
|
|
|
34
34
|
const { name: i, value: n } = e;
|
|
35
35
|
if (i.startsWith("data-") || i.startsWith("aria-") || i.startsWith("_") || i.startsWith("$") || ["id", "class", "style"].includes(i))
|
|
36
36
|
continue;
|
|
37
|
-
const s = i.split("-").map((d,
|
|
38
|
-
i === "value" ? (t[s] = f, t._resetValue = f) : u.includes(s) &&
|
|
37
|
+
const s = i.split("-").map((d, h) => h === 0 ? d : d[0].toUpperCase() + d.slice(1)).join(""), f = I(n, t[s], i), u = Object.getOwnPropertyNames(t);
|
|
38
|
+
(t._ignoreInitAttrs || []).includes(s) || (i === "value" ? (t[s] = f, t._resetValue = f) : u.includes(s) && (t[s] = f));
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function W(t, r) {
|
|
42
42
|
let e = " ";
|
|
43
43
|
return r === !0 ? e = ` ${t}` : typeof r == "string" && !N(r) && (e = ` ${t}="${r}"`), e;
|
|
44
44
|
}
|
|
45
45
|
function B(t) {
|
|
46
|
-
return t.map((e) =>
|
|
46
|
+
return t.map((e) => W(e[0], e[1])).join("");
|
|
47
47
|
}
|
|
48
48
|
function F(t, r) {
|
|
49
49
|
for (const e of r) {
|
|
@@ -59,9 +59,9 @@ function M() {
|
|
|
59
59
|
}, e = (s) => {
|
|
60
60
|
for (let f of s)
|
|
61
61
|
if (f.type === "attributes" && f.attributeName) {
|
|
62
|
-
const u = f.target,
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
const u = f.target, c = u.getAttribute(f.attributeName) || "show", d = u.getAttribute("l-transition") || "l", h = u.getAttribute("l-transition-method") || "hide";
|
|
63
|
+
c === "show" ? (u.style.removeProperty("display"), m(u, d, "enter")) : m(u, d, "leave", () => {
|
|
64
|
+
h === "remove" ? u.remove() : u.style.display = "none";
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
};
|
|
@@ -87,24 +87,24 @@ function x(t, r, e, i, n = 10) {
|
|
|
87
87
|
let o = 0;
|
|
88
88
|
return e === "left" ? o = r.width + n : e === "right" ? o = -(t.width + n) : (e === "top" || e === "bottom") && (i === "" ? o = r.width / 2 - t.width / 2 : i === "end" && (o = r.width - t.width)), o;
|
|
89
89
|
}
|
|
90
|
-
function U(t, r, e, i, n, o, s, f, u = 10,
|
|
91
|
-
const d = window.innerHeight + o - 10,
|
|
92
|
-
let
|
|
93
|
-
|
|
90
|
+
function U(t, r, e, i, n, o, s, f, u = 10, c = "absolute") {
|
|
91
|
+
const d = window.innerHeight + o - 10, h = window.innerWidth + n - 10;
|
|
92
|
+
let a = t.top + o - f;
|
|
93
|
+
a + r.height > d && (e === "left" || e === "right" ? i = "end" : e = "top", f = w(
|
|
94
94
|
t,
|
|
95
95
|
r,
|
|
96
96
|
e,
|
|
97
97
|
i,
|
|
98
98
|
u
|
|
99
|
-
),
|
|
100
|
-
let
|
|
101
|
-
return
|
|
99
|
+
), a = t.top + o - f), a < o && (e === "left" || e === "right" ? i = "start" : e = "bottom");
|
|
100
|
+
let b = t.left + n - s;
|
|
101
|
+
return b + r.width > h && (e === "top" || e === "bottom" ? i = "end" : e = "left", s = x(
|
|
102
102
|
t,
|
|
103
103
|
r,
|
|
104
104
|
e,
|
|
105
105
|
i,
|
|
106
106
|
u
|
|
107
|
-
),
|
|
107
|
+
), b = t.left + n - s), b < n && (e === "top" || e === "bottom" ? i = "start" : e = "right"), c === "fixed" && (f = w(
|
|
108
108
|
t,
|
|
109
109
|
r,
|
|
110
110
|
e,
|
|
@@ -116,9 +116,9 @@ function U(t, r, e, i, n, o, s, f, u = 10, h = "absolute") {
|
|
|
116
116
|
e,
|
|
117
117
|
i,
|
|
118
118
|
u
|
|
119
|
-
),
|
|
120
|
-
x:
|
|
121
|
-
y:
|
|
119
|
+
), b = t.left + n - s, a = t.top + o - f), {
|
|
120
|
+
x: b,
|
|
121
|
+
y: a,
|
|
122
122
|
mainAlign: e,
|
|
123
123
|
crossAlign: i
|
|
124
124
|
};
|
|
@@ -130,10 +130,10 @@ export {
|
|
|
130
130
|
w as getPopoverOffsetY,
|
|
131
131
|
U as impactDetect,
|
|
132
132
|
V as initAttr,
|
|
133
|
-
|
|
133
|
+
I as parseAttrValue,
|
|
134
134
|
_ as regist,
|
|
135
135
|
F as setAttrs,
|
|
136
|
-
|
|
136
|
+
W as tagAttr,
|
|
137
137
|
B as tagAttrs,
|
|
138
138
|
k as useId
|
|
139
139
|
};
|
package/package.json
CHANGED
package/lib/form/form_events.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
let e;
|
|
2
|
-
function o(t, l, f) {
|
|
3
|
-
e == null && (e = /* @__PURE__ */ new Map()), e.has(t) || e.set(t, /* @__PURE__ */ new Map([[l, /* @__PURE__ */ new Set()]])), e.get(t).has(l) || e.get(t).set(l, /* @__PURE__ */ new Set()), e.get(t).get(l).add(f);
|
|
4
|
-
}
|
|
5
|
-
function g(t, l, f) {
|
|
6
|
-
e?.get(t)?.get(l)?.delete(f), e?.get(t)?.get(l)?.size == 0 && e.get(t)?.delete(l), e?.get(t)?.size == 0 && e.delete(t), e?.size == 0 && (e = void 0);
|
|
7
|
-
}
|
|
8
|
-
function s(t) {
|
|
9
|
-
t == null ? e != null && (e.clear(), e = void 0) : e != null && (e.delete(t), e.size === 0 && (e = void 0));
|
|
10
|
-
}
|
|
11
|
-
function u(t, l, ...f) {
|
|
12
|
-
const n = e?.get(t)?.get(l);
|
|
13
|
-
if (n != null)
|
|
14
|
-
for (const i of n)
|
|
15
|
-
i(...f);
|
|
16
|
-
}
|
|
17
|
-
export {
|
|
18
|
-
o as add,
|
|
19
|
-
s as clear,
|
|
20
|
-
u as emit,
|
|
21
|
-
g as remove
|
|
22
|
-
};
|