litos-ui 0.6.2 → 0.7.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 +13 -13
- package/lib/browser.d.ts +1 -0
- package/lib/button/regist.d.ts +2 -0
- package/lib/button/regist.js +7 -0
- package/lib/index-C2D4YsFw.js +4 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.js +34 -24
- package/lib/litos-ui.css +1 -1
- package/lib/litos-ui.min.js +1 -1
- package/lib/popconfirm/index.d.ts +7 -0
- package/lib/popconfirm/index.js +36 -0
- package/lib/popconfirm/regist.d.ts +2 -0
- package/lib/popconfirm/regist.js +7 -0
- package/lib/popover/index.d.ts +5 -2
- package/lib/popover/index.js +68 -60
- package/lib/popover/regist.d.ts +2 -0
- package/lib/popover/regist.js +7 -0
- package/lib/tabbar/index.d.ts +0 -1
- package/lib/tabbar/index.js +106 -99
- package/lib/tabbar/regist.d.ts +2 -0
- package/lib/tabbar/regist.js +7 -0
- package/lib/utils/index.js +46 -43
- package/lib/utils/transition.js +11 -6
- package/package.json +1 -1
package/lib/popover/index.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var N = Object.defineProperty;
|
|
2
|
+
var L = (e) => {
|
|
3
3
|
throw TypeError(e);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var s = (e, i, t) =>
|
|
7
|
-
var o = (e, i, t) => (
|
|
8
|
-
var
|
|
9
|
-
import
|
|
10
|
-
import { initAttr as
|
|
11
|
-
import { set as
|
|
12
|
-
import { $one as
|
|
13
|
-
var r,
|
|
14
|
-
class
|
|
5
|
+
var j = (e, i, t) => i in e ? N(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t;
|
|
6
|
+
var s = (e, i, t) => j(e, typeof i != "symbol" ? i + "" : i, t), O = (e, i, t) => i.has(e) || L("Cannot " + t);
|
|
7
|
+
var o = (e, i, t) => (O(e, i, "read from private field"), t ? t.call(e) : i.get(e)), d = (e, i, t) => i.has(e) ? L("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, t);
|
|
8
|
+
var f = (e, i, t) => (O(e, i, "access private method"), t);
|
|
9
|
+
import D from "../base.js";
|
|
10
|
+
import { initAttr as X, useId as Y, getPopoverOffsetY as q, getPopoverOffsetX as z, impactDetect as F } from "../utils/index.js";
|
|
11
|
+
import { set as G, remove as J } from "../utils/clickoutside.js";
|
|
12
|
+
import { $one as p, $$ as P, on as u, off as m } from "ph-utils/dom";
|
|
13
|
+
var r, S, x, H, C, l, c, v, E, M;
|
|
14
|
+
class K extends D {
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
17
17
|
d(this, r);
|
|
18
|
-
s(this, "inline", !1);
|
|
19
18
|
s(this, "placement", "top");
|
|
20
19
|
s(this, "content");
|
|
21
20
|
s(this, "showArrow", !0);
|
|
@@ -31,11 +30,14 @@ class J extends j {
|
|
|
31
30
|
/** 浮层定位方式 */
|
|
32
31
|
s(this, "position", "absolute");
|
|
33
32
|
s(this, "theme", "default");
|
|
33
|
+
/**
|
|
34
|
+
* @property inline = false
|
|
35
|
+
*/
|
|
34
36
|
s(this, "_t");
|
|
35
|
-
d(this,
|
|
37
|
+
d(this, C, (t) => {
|
|
36
38
|
t.target.id !== this.id && this.hide();
|
|
37
39
|
});
|
|
38
|
-
d(this,
|
|
40
|
+
d(this, l, (t) => {
|
|
39
41
|
this.show(t.target);
|
|
40
42
|
});
|
|
41
43
|
d(this, c, () => {
|
|
@@ -44,13 +46,13 @@ class J extends j {
|
|
|
44
46
|
d(this, v, (t) => {
|
|
45
47
|
this.trigger === "click" ? this.toggle(t.target) : this.trigger === "focus" && this.show(t.target);
|
|
46
48
|
});
|
|
47
|
-
|
|
49
|
+
X(this);
|
|
48
50
|
}
|
|
49
51
|
connectedCallback() {
|
|
50
|
-
this.loadStyle(["popover"]), super.connectedCallback(), this.renderContent(),
|
|
52
|
+
this.loadStyle(["popover"]), f(this, r, S).call(this), super.connectedCallback(), this.renderContent(), f(this, r, x).call(this);
|
|
51
53
|
}
|
|
52
54
|
disconnectedCallback() {
|
|
53
|
-
super.disconnectedCallback(),
|
|
55
|
+
super.disconnectedCallback(), f(this, r, H).call(this);
|
|
54
56
|
}
|
|
55
57
|
render() {
|
|
56
58
|
const t = document.createElement("slot");
|
|
@@ -58,36 +60,39 @@ class J extends j {
|
|
|
58
60
|
}
|
|
59
61
|
renderContent() {
|
|
60
62
|
if (!this.isShow) return;
|
|
61
|
-
let t =
|
|
63
|
+
let t = p(".l-popover--content", this.root);
|
|
62
64
|
if (t) {
|
|
63
65
|
t.style.removeProperty("display");
|
|
64
66
|
return;
|
|
65
67
|
}
|
|
66
|
-
if (t =
|
|
68
|
+
if (t = P("div", {
|
|
67
69
|
class: [
|
|
68
70
|
"l-popover--content",
|
|
69
71
|
`l-popover-${this.placement}`,
|
|
70
|
-
this.theme === "
|
|
72
|
+
this.theme === "default" ? void 0 : `l-popover-${this.theme}`
|
|
71
73
|
]
|
|
72
|
-
}), this.offset && (t.style.cssText = "--l-popover-offset: ${this.offset}px;"), t.part = "content", t.innerHTML = this.
|
|
73
|
-
const n =
|
|
74
|
+
}), this.offset && (t.style.cssText = "--l-popover-offset: ${this.offset}px;"), t.part = "content", t.innerHTML = this.contentHTML(), this.showArrow) {
|
|
75
|
+
const n = P("div", {
|
|
74
76
|
class: "l-popover--arrow"
|
|
75
77
|
});
|
|
76
78
|
t.appendChild(n);
|
|
77
79
|
}
|
|
78
|
-
this.trigger === "hover" && (
|
|
80
|
+
this.trigger === "hover" && (u(t, "mouseenter", o(this, l)), u(t, "mouseleave", o(this, c))), this.root.appendChild(t);
|
|
81
|
+
}
|
|
82
|
+
contentHTML() {
|
|
83
|
+
return this.content ? `<span>${this.content}</span>` : "<slot></slot>";
|
|
79
84
|
}
|
|
80
85
|
hideContent() {
|
|
81
|
-
const t =
|
|
82
|
-
t && (this.destroyOnHide ? (this.trigger === "hover" && (
|
|
86
|
+
const t = p(".l-popover--content", this.root);
|
|
87
|
+
t && (this.destroyOnHide ? (this.trigger === "hover" && (m(t, "mouseenter", o(this, l)), m(t, "mouseleave", o(this, c))), this.root.removeChild(t)) : t.style.display = "none");
|
|
83
88
|
}
|
|
84
89
|
show(t) {
|
|
85
90
|
if (!this.disabled) {
|
|
86
91
|
if (this.isShow) {
|
|
87
|
-
|
|
92
|
+
f(this, r, E).call(this);
|
|
88
93
|
return;
|
|
89
94
|
}
|
|
90
|
-
this.isShow = !0, this.renderContent(),
|
|
95
|
+
this.isShow = !0, this.renderContent(), f(this, r, M).call(this, t);
|
|
91
96
|
}
|
|
92
97
|
}
|
|
93
98
|
hide() {
|
|
@@ -99,55 +104,58 @@ class J extends j {
|
|
|
99
104
|
this.isShow ? this.hide() : this.show(t);
|
|
100
105
|
}
|
|
101
106
|
}
|
|
102
|
-
r = new WeakSet(),
|
|
103
|
-
const t =
|
|
104
|
-
|
|
105
|
-
},
|
|
106
|
-
const t =
|
|
107
|
-
t && (this.trigger === "hover" ? (u(t, "mouseenter", o(this,
|
|
108
|
-
},
|
|
107
|
+
r = new WeakSet(), S = function() {
|
|
108
|
+
const t = this.getAttr("inline", !1);
|
|
109
|
+
this.style.display = t ? "inline-block" : "block", this.id || (this.id = `${Y()}-popover`);
|
|
110
|
+
}, x = function() {
|
|
111
|
+
const t = p('[slot="trigger"]', this);
|
|
112
|
+
t && (this.trigger === "hover" ? (u(t, "mouseenter", o(this, l)), u(t, "mouseleave", o(this, c))) : (this.trigger === "click" || this.trigger === "focus") && (u(t, "click", o(this, v)), G(t, o(this, C))));
|
|
113
|
+
}, H = function() {
|
|
114
|
+
const t = p('[slot="trigger"]', this);
|
|
115
|
+
t && (this.trigger === "hover" ? (m(t, "mouseenter", o(this, l)), m(t, "mouseleave", o(this, c))) : (this.trigger === "click" || this.trigger === "focus") && (m(t, "click", o(this, v)), J(t)));
|
|
116
|
+
}, C = new WeakMap(), l = new WeakMap(), c = new WeakMap(), v = new WeakMap(), E = function() {
|
|
109
117
|
this._t && (clearTimeout(this._t), this._t = void 0);
|
|
110
|
-
},
|
|
111
|
-
let n = "bottom",
|
|
118
|
+
}, M = function(t) {
|
|
119
|
+
let n = "bottom", h = "";
|
|
112
120
|
const y = this.placement.split("-");
|
|
113
|
-
y != null && (n = y[0],
|
|
121
|
+
y != null && (n = y[0], h = y[1] || "");
|
|
114
122
|
let a;
|
|
115
|
-
t == null && (t =
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
let w =
|
|
119
|
-
const
|
|
123
|
+
t == null && (t = p('[slot="trigger"]', this));
|
|
124
|
+
const g = p(".l-popover--content", this.root);
|
|
125
|
+
if (g) {
|
|
126
|
+
let w = g.getBoundingClientRect();
|
|
127
|
+
const $ = t.getBoundingClientRect();
|
|
120
128
|
let k = document.documentElement;
|
|
121
|
-
const
|
|
122
|
-
this.width != null && (this.width === "trigger" ? a =
|
|
123
|
-
const B =
|
|
124
|
-
|
|
129
|
+
const R = k.scrollLeft, _ = k.scrollTop;
|
|
130
|
+
this.width != null && (this.width === "trigger" ? a = $.width : a = this.width), a != null && (w.width = a);
|
|
131
|
+
const B = q(
|
|
132
|
+
$,
|
|
125
133
|
w,
|
|
126
134
|
n,
|
|
127
|
-
|
|
135
|
+
h,
|
|
128
136
|
this.offset
|
|
129
|
-
), I =
|
|
130
|
-
|
|
137
|
+
), I = z(
|
|
138
|
+
$,
|
|
131
139
|
w,
|
|
132
140
|
n,
|
|
133
|
-
|
|
141
|
+
h,
|
|
134
142
|
this.offset
|
|
135
|
-
),
|
|
136
|
-
|
|
143
|
+
), T = F(
|
|
144
|
+
$,
|
|
137
145
|
w,
|
|
138
146
|
n,
|
|
139
|
-
|
|
147
|
+
h,
|
|
148
|
+
R,
|
|
140
149
|
_,
|
|
141
|
-
H,
|
|
142
150
|
I,
|
|
143
151
|
B,
|
|
144
152
|
this.offset
|
|
145
153
|
);
|
|
146
|
-
n =
|
|
147
|
-
const
|
|
148
|
-
b[1] !==
|
|
154
|
+
n = T.mainAlign, h = T.crossAlign, a != null && g.style.setProperty("width", `${a}px`);
|
|
155
|
+
const A = `l-popover-${n}${h === "" ? "" : "-" + h}`, b = g.className.split(" ");
|
|
156
|
+
b[1] !== A && (b[1] = `${A}`, g.className = b.join(" "));
|
|
149
157
|
}
|
|
150
|
-
}, s(
|
|
158
|
+
}, s(K, "baseName", "popover");
|
|
151
159
|
export {
|
|
152
|
-
|
|
160
|
+
K as default
|
|
153
161
|
};
|
package/lib/tabbar/index.d.ts
CHANGED
package/lib/tabbar/index.js
CHANGED
|
@@ -1,41 +1,40 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var L = Object.defineProperty;
|
|
2
|
+
var A = (n) => {
|
|
3
|
+
throw TypeError(n);
|
|
4
4
|
};
|
|
5
|
-
var N = (
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
import { isBlank as
|
|
5
|
+
var N = (n, a, e) => a in n ? L(n, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[a] = e;
|
|
6
|
+
var f = (n, a, e) => N(n, typeof a != "symbol" ? a + "" : a, e), w = (n, a, e) => a.has(n) || A("Cannot " + e);
|
|
7
|
+
var k = (n, a, e) => a.has(n) ? A("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(n) : a.set(n, e);
|
|
8
|
+
var u = (n, a, e) => (w(n, a, "access private method"), e);
|
|
9
|
+
import { isBlank as g, isNumeric as T } from "ph-utils";
|
|
10
10
|
import W from "../base.js";
|
|
11
|
-
import { initAttr as
|
|
12
|
-
import { addClass as
|
|
13
|
-
function R(
|
|
14
|
-
let
|
|
11
|
+
import { initAttr as E, parseAttrValue as C } from "../utils/index.js";
|
|
12
|
+
import { addClass as v, removeClass as $, $one as l, create as b, $ as x, iterate as j, on as S, off as B, isVisible as D, formatStyle as I, formatClass as M } from "ph-utils/dom";
|
|
13
|
+
function R(n, a, e) {
|
|
14
|
+
let t = n.target, i = "";
|
|
15
15
|
do
|
|
16
|
-
if (
|
|
16
|
+
if (e && e.isSameNode(t) || t.tagName === "BODY" || (t.getAttribute && (i = t.getAttribute(a) || ""), i === "" && (t = t.parentNode), !t)) break;
|
|
17
17
|
while (i === "");
|
|
18
|
-
return [i !== "__stop__" && i !== "", i,
|
|
18
|
+
return [i !== "__stop__" && i !== "", i, t];
|
|
19
19
|
}
|
|
20
|
-
var
|
|
20
|
+
var p, y, _;
|
|
21
21
|
class F extends W {
|
|
22
22
|
constructor() {
|
|
23
23
|
super();
|
|
24
|
-
|
|
24
|
+
k(this, p);
|
|
25
25
|
/**
|
|
26
26
|
* 标签类型:
|
|
27
27
|
* 1. nav - 每一项等分排列, 类似于移动端底部的标签栏
|
|
28
28
|
* 2. bar - 选项卡
|
|
29
29
|
* 3. card - 卡片
|
|
30
30
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
e && i !== this.name && (this.name = i, this.dispatchEvent(
|
|
31
|
+
f(this, "type", "nav");
|
|
32
|
+
f(this, "name");
|
|
33
|
+
f(this, "gap");
|
|
34
|
+
f(this, "$line");
|
|
35
|
+
f(this, "_handleClick", (e) => {
|
|
36
|
+
const [t, i] = R(e, "l-name", this.root);
|
|
37
|
+
t && i !== this.name && (this.name = i, this.dispatchEvent(
|
|
39
38
|
new CustomEvent("change", {
|
|
40
39
|
detail: {
|
|
41
40
|
name: i
|
|
@@ -43,56 +42,63 @@ class F extends W {
|
|
|
43
42
|
})
|
|
44
43
|
), this._updateActive(), this._updateLine());
|
|
45
44
|
});
|
|
46
|
-
|
|
45
|
+
E(this);
|
|
47
46
|
}
|
|
48
47
|
connectedCallback() {
|
|
49
|
-
this.loadStyle(["tabbar"]),
|
|
48
|
+
this.loadStyle(["tabbar"]), v(this, `l-tabbar--${this.type}`), !g(this.gap) && !this.gap.startsWith("0") && v(this, "l-tabbar-gap"), super.connectedCallback(), this._init();
|
|
50
49
|
}
|
|
51
50
|
static get observedAttributes() {
|
|
52
51
|
return ["name", "type", "justify-content", "gap"];
|
|
53
52
|
}
|
|
54
|
-
attributeChangedCallback(
|
|
55
|
-
if (
|
|
56
|
-
const
|
|
57
|
-
this.name =
|
|
58
|
-
} else if (
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
let
|
|
62
|
-
|
|
53
|
+
attributeChangedCallback(e, t, i) {
|
|
54
|
+
if (e === "name") {
|
|
55
|
+
const s = C(i, void 0);
|
|
56
|
+
this.name = s, this._updateActive(), this._updateLine();
|
|
57
|
+
} else if (e === "type") {
|
|
58
|
+
const s = C(i, "nav");
|
|
59
|
+
if (s !== this.type && ($(this, `l-tabbar--${this.type}`), this.type = s, $(this, `l-tabbar--${s}`), s === "card")) {
|
|
60
|
+
let r = l(".l-tabbar-card-border", this.root);
|
|
61
|
+
r || (r = b("div", { class: "l-tabbar-card-border" }), this.root.appendChild(r));
|
|
63
62
|
}
|
|
64
63
|
} else {
|
|
65
|
-
const
|
|
66
|
-
this[
|
|
67
|
-
const
|
|
68
|
-
|
|
64
|
+
const s = C(i, void 0);
|
|
65
|
+
this[e] = s;
|
|
66
|
+
const r = l(".l-tabbar-wrapper", this.root);
|
|
67
|
+
r && (r.style.cssText = u(this, p, y).call(this)), e === "gap" && (!g(this.gap) && !this.gap.startsWith("0") ? v(this, "l-tabbar-gap") : $(this, "l-tabbar-gap"));
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
70
|
disconnectedCallback() {
|
|
72
71
|
super.disconnectedCallback(), this._destroy();
|
|
73
72
|
}
|
|
74
73
|
render() {
|
|
75
|
-
const
|
|
76
|
-
if (
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
74
|
+
const e = document.createDocumentFragment(), t = document.createElement("div");
|
|
75
|
+
if (t.className = "l-tabbar-wrapper", t.style.cssText = u(this, p, y).call(this), t.setAttribute("part", "default"), this.getAttr("custom-content", !1)) {
|
|
76
|
+
const s = document.createElement("slot");
|
|
77
|
+
t.appendChild(s);
|
|
78
|
+
} else {
|
|
79
|
+
const s = x("[l-name]", this);
|
|
80
|
+
s.length > 0 && j(s, (r) => {
|
|
81
|
+
const h = r.getAttribute("l-name");
|
|
82
|
+
if (h) {
|
|
83
|
+
const o = r.cloneNode(!0);
|
|
84
|
+
o.classList.add("l-tabbar-item"), o.setAttribute("part", "item"), h === this.name && o.classList.add("active");
|
|
85
|
+
const d = l("[l-icon]", o), c = x(":not([l-icon])", o);
|
|
86
|
+
if (d) {
|
|
87
|
+
const m = b("div", {
|
|
88
|
+
class: [
|
|
89
|
+
"l-tabbar-item-icon",
|
|
90
|
+
c.length === 0 ? "only" : void 0
|
|
91
|
+
]
|
|
92
|
+
});
|
|
93
|
+
m.appendChild(d.cloneNode(!0)), d.replaceWith(m);
|
|
94
|
+
}
|
|
95
|
+
t.appendChild(o);
|
|
90
96
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
e.appendChild(
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if (e.appendChild(t), this.type === "card") {
|
|
100
|
+
const s = b("div", { class: "l-tabbar-card-border" });
|
|
101
|
+
e.appendChild(s);
|
|
96
102
|
}
|
|
97
103
|
return e;
|
|
98
104
|
}
|
|
@@ -101,18 +107,18 @@ class F extends W {
|
|
|
101
107
|
* @param items - 选项卡栏项目的数组。
|
|
102
108
|
* 该方法首先清空选项卡栏的包装器元素,然后根据传入的项目数组创建并追加新的选项卡项目。
|
|
103
109
|
*/
|
|
104
|
-
setItems(
|
|
105
|
-
const
|
|
106
|
-
|
|
110
|
+
setItems(e) {
|
|
111
|
+
const t = l(".l-tabbar-wrapper", this.root);
|
|
112
|
+
t && (t.innerHTML = "", t.appendChild(u(this, p, _).call(this, e)));
|
|
107
113
|
}
|
|
108
114
|
/**
|
|
109
115
|
* 向标签栏添加项目。
|
|
110
116
|
* @param items 要添加的标签栏项目数组。
|
|
111
117
|
* @returns 无返回值。
|
|
112
118
|
*/
|
|
113
|
-
addItems(
|
|
114
|
-
const
|
|
115
|
-
|
|
119
|
+
addItems(e) {
|
|
120
|
+
const t = l(".l-tabbar-wrapper", this.root);
|
|
121
|
+
t && t.appendChild(u(this, p, _).call(this, e));
|
|
116
122
|
}
|
|
117
123
|
_init() {
|
|
118
124
|
S(this.root, "click", this._handleClick), setTimeout(() => {
|
|
@@ -123,10 +129,10 @@ class F extends W {
|
|
|
123
129
|
B(this.root, "click", this._handleClick), this.$line = void 0;
|
|
124
130
|
}
|
|
125
131
|
_updateActive() {
|
|
126
|
-
const t =
|
|
127
|
-
|
|
128
|
-
const
|
|
129
|
-
|
|
132
|
+
const t = this.getAttr("custom-content", !1) ? this : this.root, i = l(".active", t);
|
|
133
|
+
i && $(i, "active");
|
|
134
|
+
const s = l(`[l-name="${this.name}"]`, t);
|
|
135
|
+
s && v(s, "active");
|
|
130
136
|
}
|
|
131
137
|
/**
|
|
132
138
|
* 初始化线条的方法,在微任务队列中执行。
|
|
@@ -135,51 +141,52 @@ class F extends W {
|
|
|
135
141
|
_updateLine() {
|
|
136
142
|
queueMicrotask(() => {
|
|
137
143
|
if (!this.name || this.type === "nav" || !this.rendered) return;
|
|
138
|
-
const t =
|
|
144
|
+
const e = this.getAttr("custom-content", !1), t = l(".active", e ? this : this.root);
|
|
139
145
|
if (!t) return;
|
|
140
|
-
const
|
|
146
|
+
const i = t.offsetLeft;
|
|
141
147
|
if (!this.$line) {
|
|
142
|
-
const
|
|
143
|
-
this.root.appendChild(
|
|
148
|
+
const s = b("div", { class: "l-tabbar--bar-line" });
|
|
149
|
+
s.part = "line", this.root.appendChild(s), this.$line = l(".l-tabbar--bar-line", this.root);
|
|
144
150
|
}
|
|
145
|
-
this.$line.style.cssText = `width:${t.offsetWidth}px;left:${
|
|
146
|
-
left:
|
|
151
|
+
this.$line.style.cssText = `width:${t.offsetWidth}px;left:${i}px`, D(t, this) || this.scrollTo({
|
|
152
|
+
left: i,
|
|
147
153
|
behavior: "smooth"
|
|
148
154
|
});
|
|
149
155
|
});
|
|
150
156
|
}
|
|
151
157
|
}
|
|
152
|
-
|
|
153
|
-
const
|
|
154
|
-
if (
|
|
155
|
-
let
|
|
156
|
-
T(
|
|
158
|
+
p = new WeakSet(), y = function() {
|
|
159
|
+
const e = {}, t = this.getAttr("justify-content");
|
|
160
|
+
if (g(t) || (e["justify-content"] = t), !g(this.gap)) {
|
|
161
|
+
let i = this.gap;
|
|
162
|
+
T(i, { isPositive: !0 }) && (i = `${i}px`), e["--l-tabbar-item-gap"] = i;
|
|
157
163
|
}
|
|
158
|
-
return I(
|
|
159
|
-
}, _ = function(
|
|
160
|
-
const
|
|
161
|
-
for (let i = 0,
|
|
162
|
-
const
|
|
164
|
+
return I(e);
|
|
165
|
+
}, _ = function(e) {
|
|
166
|
+
const t = document.createDocumentFragment();
|
|
167
|
+
for (let i = 0, s = e.length; i < s; i++) {
|
|
168
|
+
const r = e[i], h = b("div", {
|
|
163
169
|
class: M([
|
|
164
170
|
"l-tabbar-item",
|
|
165
|
-
this.name ===
|
|
171
|
+
this.name === r.name ? "active" : void 0
|
|
166
172
|
]),
|
|
167
|
-
"l-name":
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
typeof
|
|
173
|
+
"l-name": r.name,
|
|
174
|
+
part: "item"
|
|
175
|
+
}), o = r.icon;
|
|
176
|
+
if (o) {
|
|
177
|
+
const c = b("div", { class: "l-tabbar-item-icon" });
|
|
178
|
+
let m = typeof o == "string" ? o : o();
|
|
179
|
+
typeof m == "string" ? c.innerHTML = m : c.appendChild(m), h.appendChild(c);
|
|
173
180
|
}
|
|
174
|
-
const
|
|
175
|
-
if (
|
|
176
|
-
let
|
|
177
|
-
typeof
|
|
181
|
+
const d = r.text;
|
|
182
|
+
if (d) {
|
|
183
|
+
let c = typeof d == "string" ? d : d();
|
|
184
|
+
typeof c == "string" ? h.appendChild(b(c)) : h.appendChild(c);
|
|
178
185
|
}
|
|
179
|
-
|
|
186
|
+
t.appendChild(h);
|
|
180
187
|
}
|
|
181
|
-
return
|
|
182
|
-
},
|
|
188
|
+
return t;
|
|
189
|
+
}, f(F, "baseName", "tabbar");
|
|
183
190
|
export {
|
|
184
191
|
F as default,
|
|
185
192
|
R as shouldEventNext
|