litos-ui 0.3.0 → 0.4.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.d.ts +3 -3
- package/lib/base.js +28 -27
- package/lib/browser.d.ts +5 -0
- package/lib/color_picker/index.d.ts +14 -0
- package/lib/color_picker/index.js +44 -0
- package/lib/event.d.ts +30 -0
- package/lib/event.js +24 -0
- package/lib/form/form_inner.js +15 -15
- package/lib/icon/moon.d.ts +6 -0
- package/lib/icon/moon.js +16 -0
- package/lib/icon/reduction.d.ts +6 -0
- package/lib/icon/reduction.js +16 -0
- package/lib/icon/refresh_left.d.ts +6 -0
- package/lib/icon/refresh_left.js +16 -0
- package/lib/icon/refresh_right.d.ts +5 -0
- package/lib/icon/refresh_right.js +13 -0
- package/lib/icon/sort.d.ts +5 -0
- package/lib/icon/sort.js +13 -0
- package/lib/icon/sun.d.ts +6 -0
- package/lib/icon/sun.js +16 -0
- package/lib/index-1Gw78Uze.js +4 -0
- package/lib/index-BeOxuMd4.js +4 -0
- package/lib/index-BxlGVrX3.js +4 -0
- package/lib/index-C98Kx857.js +4 -0
- package/lib/index-CMz7GCCH.js +4 -0
- package/lib/index-CPpMuwU3.js +4 -0
- package/lib/index-DKvzJmsR.js +4 -0
- package/lib/index.d.ts +22 -0
- package/lib/index.js +51 -27
- package/lib/litos-ui.css +1 -1
- package/lib/litos-ui.min.js +1 -1
- package/lib/message/index.js +13 -13
- package/lib/polygon/index.d.ts +9 -0
- package/lib/polygon/index.js +30 -0
- package/lib/select_ori/index.d.ts +21 -0
- package/lib/select_ori/index.js +59 -0
- package/lib/switch/index.d.ts +21 -0
- package/lib/switch/index.js +67 -0
- package/lib/tabbar/index.d.ts +50 -0
- package/lib/tabbar/index.js +186 -0
- package/lib/util.d.ts +3 -1
- package/lib/util.js +26 -15
- package/package.json +7 -7
- package/lib/index-Boq1Q7q9.js +0 -4
- package/lib/index-ColsUDnt.js +0 -4
package/lib/base.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export default class BaseComponent extends HTMLElement {
|
|
2
2
|
static baseName: string;
|
|
3
|
+
/** 组件是否渲染完成, 是否已经调用 connectedCallback */
|
|
3
4
|
rendered: boolean;
|
|
4
5
|
constructor(shadow?: boolean);
|
|
5
6
|
/**
|
|
@@ -14,8 +15,6 @@ export default class BaseComponent extends HTMLElement {
|
|
|
14
15
|
loadStyle(styleNames: string[]): void;
|
|
15
16
|
loadExternalStyle(styleNames: string[]): void;
|
|
16
17
|
loadStyleText(styleText: string): void;
|
|
17
|
-
setProperty(key: string, value: any): void;
|
|
18
|
-
setProperties(properties: Record<string, any>): void;
|
|
19
18
|
/**
|
|
20
19
|
* 获取属性值
|
|
21
20
|
* @param key 属性名称
|
|
@@ -30,7 +29,8 @@ export default class BaseComponent extends HTMLElement {
|
|
|
30
29
|
getAttr(key: string, defaultValue: number): number;
|
|
31
30
|
getAttr(key: string, defaultValue: boolean): boolean;
|
|
32
31
|
getAttr<T extends Record<string, string | number | boolean>>(filepath: string, defaultValue: T): T;
|
|
32
|
+
appendToRoot(el?: HTMLElement | HTMLElement[] | string): void;
|
|
33
33
|
connectedCallback(): void;
|
|
34
34
|
disconnectedCallback(): void;
|
|
35
|
-
render(): void;
|
|
35
|
+
render(): void | string | HTMLElement | HTMLElement[];
|
|
36
36
|
}
|
package/lib/base.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var d = Object.defineProperty;
|
|
2
|
-
var c = (
|
|
3
|
-
var l = (
|
|
4
|
-
import { getAttr as
|
|
5
|
-
const a = (
|
|
6
|
-
const t =
|
|
7
|
-
return t ? typeof t == "function" ? t() : Promise.resolve(t) : new Promise((
|
|
2
|
+
var c = (o, n, e) => n in o ? d(o, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[n] = e;
|
|
3
|
+
var l = (o, n, e) => c(o, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { getAttr as p } from "ph-utils/dom";
|
|
5
|
+
const a = (o, n, e) => {
|
|
6
|
+
const t = o[n];
|
|
7
|
+
return t ? typeof t == "function" ? t() : Promise.resolve(t) : new Promise((s, i) => {
|
|
8
8
|
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
9
|
-
|
|
9
|
+
i.bind(
|
|
10
10
|
null,
|
|
11
11
|
new Error(
|
|
12
12
|
"Unknown variable dynamic import: " + n + (n.split("/").length !== e ? ". Note that variables only represent file names one level deep." : "")
|
|
@@ -18,6 +18,7 @@ const a = (s, n, e) => {
|
|
|
18
18
|
class m extends HTMLElement {
|
|
19
19
|
constructor(e = !0) {
|
|
20
20
|
super();
|
|
21
|
+
/** 组件是否渲染完成, 是否已经调用 connectedCallback */
|
|
21
22
|
l(this, "rendered", !1);
|
|
22
23
|
e && this.attachShadow({ mode: "open" });
|
|
23
24
|
}
|
|
@@ -28,7 +29,7 @@ class m extends HTMLElement {
|
|
|
28
29
|
return [];
|
|
29
30
|
}
|
|
30
31
|
// 当属性发生变化时调用的回调函数
|
|
31
|
-
attributeChangedCallback(e, t,
|
|
32
|
+
attributeChangedCallback(e, t, s) {
|
|
32
33
|
}
|
|
33
34
|
get shadow() {
|
|
34
35
|
return this.shadowRoot;
|
|
@@ -38,43 +39,43 @@ class m extends HTMLElement {
|
|
|
38
39
|
}
|
|
39
40
|
createStyle(e) {
|
|
40
41
|
const t = document.createElement("style");
|
|
41
|
-
t.textContent = e.trim(), this.
|
|
42
|
+
t.textContent = e.trim(), this.root.appendChild(t);
|
|
42
43
|
}
|
|
43
44
|
createLink(e) {
|
|
44
45
|
const t = document.createElement("link");
|
|
45
|
-
t.rel = "stylesheet", t.href = e, this.
|
|
46
|
+
t.rel = "stylesheet", t.href = e, this.root.appendChild(t);
|
|
46
47
|
}
|
|
47
48
|
loadStyle(e) {
|
|
48
|
-
for (let t = 0,
|
|
49
|
-
const
|
|
50
|
-
a(/* @__PURE__ */ Object.assign({ "./button/index.less": () => import("./index-
|
|
51
|
-
this.createStyle(
|
|
49
|
+
for (let t = 0, s = e.length; t < s; t++) {
|
|
50
|
+
const i = e[t];
|
|
51
|
+
a(/* @__PURE__ */ Object.assign({ "./button/index.less": () => import("./index-1Gw78Uze.js"), "./color_picker/index.less": () => import("./index-BeOxuMd4.js"), "./form/index.less": () => import("./index-BxlGVrX3.js"), "./icon/index.less": () => import("./index-oNjb_IVt.js"), "./input/index.less": () => import("./index-B_9rPBWp.js"), "./list/index.less": () => import("./index-D-Ikkdx0.js"), "./polygon/index.less": () => import("./index-CMz7GCCH.js"), "./radio/index.less": () => import("./index-CCcVpk6U.js"), "./select_ori/index.less": () => import("./index-C98Kx857.js"), "./switch/index.less": () => import("./index-CPpMuwU3.js"), "./tabbar/index.less": () => import("./index-DKvzJmsR.js") }), `./${i}/index.less`, 3).then((r) => {
|
|
52
|
+
this.createStyle(r.default);
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
loadExternalStyle(e) {
|
|
56
|
-
for (let t = 0,
|
|
57
|
-
const
|
|
58
|
-
a(/* @__PURE__ */ Object.assign({ "./styles/animation.css": () => import("./animation-QfX4RtqD.js") }), `./styles/${
|
|
59
|
-
this.createStyle(
|
|
57
|
+
for (let t = 0, s = e.length; t < s; t++) {
|
|
58
|
+
const i = e[t];
|
|
59
|
+
a(/* @__PURE__ */ Object.assign({ "./styles/animation.css": () => import("./animation-QfX4RtqD.js") }), `./styles/${i}.css`, 3).then((r) => {
|
|
60
|
+
this.createStyle(r.default);
|
|
60
61
|
});
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
64
|
loadStyleText(e) {
|
|
64
65
|
this.createStyle(e);
|
|
65
66
|
}
|
|
66
|
-
setProperty(e, t) {
|
|
67
|
-
this[e] = t;
|
|
68
|
-
}
|
|
69
|
-
setProperties(e) {
|
|
70
|
-
for (const t in e)
|
|
71
|
-
this.setProperty(t, e[t]);
|
|
72
|
-
}
|
|
73
67
|
getAttr(e, t) {
|
|
74
|
-
return
|
|
68
|
+
return p(this, e, t);
|
|
69
|
+
}
|
|
70
|
+
appendToRoot(e) {
|
|
71
|
+
if (e)
|
|
72
|
+
if (typeof e == "string") {
|
|
73
|
+
let t = document.createElement("div");
|
|
74
|
+
t.innerHTML = e, this.root.append(...t.children), t = void 0;
|
|
75
|
+
} else e.length ? this.root.append(...e) : this.root.append(e);
|
|
75
76
|
}
|
|
76
77
|
connectedCallback() {
|
|
77
|
-
this.render(), this.rendered = !0;
|
|
78
|
+
this.appendToRoot(this.render()), this.rendered = !0;
|
|
78
79
|
}
|
|
79
80
|
disconnectedCallback() {
|
|
80
81
|
}
|
package/lib/browser.d.ts
CHANGED
|
@@ -7,3 +7,8 @@ import "./input/index.less";
|
|
|
7
7
|
import "./form/index.less";
|
|
8
8
|
import "./radio/index.less";
|
|
9
9
|
import "./list/index.less";
|
|
10
|
+
import "./polygon/index.less";
|
|
11
|
+
import "./select_ori/index.less";
|
|
12
|
+
import "./switch/index.less";
|
|
13
|
+
import "./color_picker/index.less";
|
|
14
|
+
import "./tabbar/index.less";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import FormInner from "../form/form_inner";
|
|
2
|
+
export default class ColorPicker extends FormInner {
|
|
3
|
+
static baseName: string;
|
|
4
|
+
$picker?: HTMLInputElement;
|
|
5
|
+
_value: string;
|
|
6
|
+
private _changeEmit;
|
|
7
|
+
constructor();
|
|
8
|
+
setValue(value: any): void;
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
disconnectedCallback(): void;
|
|
11
|
+
render(): HTMLInputElement;
|
|
12
|
+
protected _changeDisabled(): void;
|
|
13
|
+
private _handleChange;
|
|
14
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var a = Object.defineProperty;
|
|
2
|
+
var c = (i, t, e) => t in i ? a(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var s = (i, t, e) => c(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { $one as r, on as n, off as h } from "ph-utils/dom";
|
|
5
|
+
import l from "../form/form_inner.js";
|
|
6
|
+
import { initAttr as o, setAttrs as p } from "../util.js";
|
|
7
|
+
class d extends l {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
s(this, "$picker");
|
|
11
|
+
s(this, "_value", "#000000");
|
|
12
|
+
s(this, "_changeEmit");
|
|
13
|
+
s(this, "_handleChange", (e) => {
|
|
14
|
+
super.setValue(e.target.value), this.dispatchEvent(this._changeEmit);
|
|
15
|
+
});
|
|
16
|
+
o(this), this._changeEmit = new CustomEvent("change");
|
|
17
|
+
}
|
|
18
|
+
setValue(e) {
|
|
19
|
+
super.setValue(e), this.$picker && (this.$picker.value = e);
|
|
20
|
+
}
|
|
21
|
+
connectedCallback() {
|
|
22
|
+
this.loadStyle(["input", "color_picker"]), super.connectedCallback(), this.$picker = r("input", this.root), n(this.$picker, "change", this._handleChange);
|
|
23
|
+
}
|
|
24
|
+
disconnectedCallback() {
|
|
25
|
+
super.disconnectedCallback(), this.$picker && (h(this.$picker, "change", this._handleChange), this.$picker = void 0);
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
const e = document.createElement("input");
|
|
29
|
+
return p(e, [
|
|
30
|
+
["value", this.value],
|
|
31
|
+
["disabled", this.isDisabled()],
|
|
32
|
+
["name", this.getName()],
|
|
33
|
+
["type", "color"],
|
|
34
|
+
["class", "l-input l-color-picker"]
|
|
35
|
+
]), e;
|
|
36
|
+
}
|
|
37
|
+
_changeDisabled() {
|
|
38
|
+
this.$picker && (this.$picker.disabled = this.isDisabled());
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
s(d, "baseName", "color-picker");
|
|
42
|
+
export {
|
|
43
|
+
d as default
|
|
44
|
+
};
|
package/lib/event.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 添加表单事件监听器。
|
|
3
|
+
* @param formId - 表单的唯一标识符。
|
|
4
|
+
* @param event - 要监听的事件类型
|
|
5
|
+
* @param cb - 当事件触发时调用的回调函数,接收两个参数:属性名和属性值。
|
|
6
|
+
* 该函数用于将回调函数添加到指定表单ID的事件监听器集合中。
|
|
7
|
+
*/
|
|
8
|
+
export declare function add(channel: string, event: string, cb: (...param: any) => void): void;
|
|
9
|
+
/**
|
|
10
|
+
* 移除指定表单的事件监听器。
|
|
11
|
+
* @param formId - 表单的唯一标识符。
|
|
12
|
+
* @param event - 要移除的事件类型,可以是 'attributeChanged' 或 'formSubmitted'。
|
|
13
|
+
* @param cb - 要移除的事件回调函数,该函数接收两个参数:属性名和属性值。
|
|
14
|
+
* 该函数会从事件存储中移除指定的回调函数,如果某个事件类型下没有更多的回调函数,则删除该事件类型;
|
|
15
|
+
* 如果表单下没有更多的事件类型,则删除该表单;如果事件存储为空,则重置事件存储。
|
|
16
|
+
*/
|
|
17
|
+
export declare function remove(channel: string, event: string, cb: (...params: any) => void): void;
|
|
18
|
+
/**
|
|
19
|
+
* 清除事件存储。如果提供了ID,则删除特定ID的事件;如果没有提供ID,则清除所有事件。
|
|
20
|
+
* 当事件存储为空时,将其设置为undefined。
|
|
21
|
+
* @param id 可选参数,指定要删除的事件ID。
|
|
22
|
+
*/
|
|
23
|
+
export declare function clear(channel?: string): void;
|
|
24
|
+
/**
|
|
25
|
+
* 触发指定表单的事件,并执行所有注册的回调函数。
|
|
26
|
+
* @param id - 表单的唯一标识符。
|
|
27
|
+
* @param event - 要触发的事件名称。
|
|
28
|
+
* @param params - 要传递给回调函数的参数列表。
|
|
29
|
+
*/
|
|
30
|
+
export declare function emit(channel: string, event: string, ...params: any): void;
|
package/lib/event.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
let i;
|
|
2
|
+
function w(f, t, o) {
|
|
3
|
+
i == null && (i = /* @__PURE__ */ new Map()), i.has(f) || i.set(f, /* @__PURE__ */ new Map([[t, /* @__PURE__ */ new Set()]])), i.get(f).has(t) || i.get(f).set(t, /* @__PURE__ */ new Set()), i.get(f).get(t).add(o);
|
|
4
|
+
}
|
|
5
|
+
function z(f, t, o) {
|
|
6
|
+
var g, d, e, l, u, r;
|
|
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);
|
|
8
|
+
}
|
|
9
|
+
function p(f) {
|
|
10
|
+
f == null ? i != null && (i.clear(), i = void 0) : i != null && (i.delete(f), i.size === 0 && (i = void 0));
|
|
11
|
+
}
|
|
12
|
+
function m(f, t, ...o) {
|
|
13
|
+
var d;
|
|
14
|
+
const g = (d = i == null ? void 0 : i.get(f)) == null ? void 0 : d.get(t);
|
|
15
|
+
if (g != null)
|
|
16
|
+
for (const e of g)
|
|
17
|
+
e(...o);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
w as add,
|
|
21
|
+
p as clear,
|
|
22
|
+
m as emit,
|
|
23
|
+
z as remove
|
|
24
|
+
};
|
package/lib/form/form_inner.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var e = (h, r, t) =>
|
|
1
|
+
var n = Object.defineProperty;
|
|
2
|
+
var d = (h, r, t) => r in h ? n(h, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[r] = t;
|
|
3
|
+
var e = (h, r, t) => d(h, typeof r != "symbol" ? r + "" : r, t);
|
|
4
4
|
import A from "../base.js";
|
|
5
5
|
import { parseAttrValue as g } from "../util.js";
|
|
6
|
-
import { add as
|
|
6
|
+
import { add as f, remove as m, emit as b } from "./form_events.js";
|
|
7
7
|
class I extends A {
|
|
8
8
|
/**
|
|
9
9
|
*
|
|
@@ -53,14 +53,14 @@ class I extends A {
|
|
|
53
53
|
}
|
|
54
54
|
connectedCallback() {
|
|
55
55
|
const t = this._getForm();
|
|
56
|
-
this.formAttrs = t.formAttr, this.formItemAttrs = t.formItemAttr, this.formAttrs.id && (
|
|
56
|
+
this.formAttrs = t.formAttr, this.formItemAttrs = t.formItemAttr, this.formAttrs.id && (f(this.formAttrs.id, "attributeChanged", this._formAttributeChanged), f(this.formAttrs.id, "reset", this._resetFieldValue), this._firstPushValue && this.pushValueChange()), this.formItemAttrs.id && f(
|
|
57
57
|
this.formItemAttrs.id,
|
|
58
58
|
"attributeChanged",
|
|
59
59
|
this._formAttributeChanged
|
|
60
|
-
),
|
|
60
|
+
), super.connectedCallback();
|
|
61
61
|
}
|
|
62
62
|
disconnectedCallback() {
|
|
63
|
-
this.formAttrs.id && (
|
|
63
|
+
this.formAttrs.id && (m(this.formAttrs.id, "attributeChanged", this._formAttributeChanged), m(this.formAttrs.id, "reset", this._resetFieldValue)), this.formItemAttrs.id && m(
|
|
64
64
|
this.formItemAttrs.id,
|
|
65
65
|
"attributeChanged",
|
|
66
66
|
this._formAttributeChanged
|
|
@@ -77,19 +77,19 @@ class I extends A {
|
|
|
77
77
|
for (; t != null; ) {
|
|
78
78
|
const l = t.tagName;
|
|
79
79
|
if (l === "L-FORM") {
|
|
80
|
-
const
|
|
81
|
-
for (let a = 0; a <
|
|
82
|
-
const
|
|
83
|
-
s[
|
|
80
|
+
const o = t.sharedAttrs;
|
|
81
|
+
for (let a = 0; a < o.length; a++) {
|
|
82
|
+
const u = o[a];
|
|
83
|
+
s[u] = t[u];
|
|
84
84
|
}
|
|
85
85
|
break;
|
|
86
86
|
}
|
|
87
87
|
if (l === "BODY") break;
|
|
88
88
|
if (l === "L-FORM-ITEM") {
|
|
89
|
-
const
|
|
90
|
-
for (let a = 0; a <
|
|
91
|
-
const
|
|
92
|
-
i[
|
|
89
|
+
const o = t.sharedAttrs;
|
|
90
|
+
for (let a = 0; a < o.length; a++) {
|
|
91
|
+
const u = o[a];
|
|
92
|
+
i[u] = t[u];
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
t = t.parentElement;
|
package/lib/icon/moon.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var s = Object.defineProperty;
|
|
2
|
+
var a = (t, e, r) => e in t ? s(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var o = (t, e, r) => a(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import c from "./base.js";
|
|
5
|
+
class n extends c {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(), this.viewBox = "0 0 24 24";
|
|
8
|
+
}
|
|
9
|
+
renderChildren() {
|
|
10
|
+
return '<path d="M12.1 22h-.9c-5.5-.5-9.5-5.4-9-10.9.4-4.8 4.2-8.6 9-9 .4 0 .8.2 1 .5.2.3.2.8-.1 1.1-2 2.7-1.4 6.4 1.3 8.4 2.1 1.6 5 1.6 7.1 0 .3-.2.7-.3 1.1-.1.3.2.5.6.5 1-.2 2.7-1.5 5.1-3.6 6.8-1.9 1.4-4.1 2.2-6.4 2.2zM9.3 4.4c-2.9 1-5 3.6-5.2 6.8-.4 4.4 2.8 8.3 7.2 8.7 2.1.2 4.2-.4 5.8-1.8 1.1-.9 1.9-2.1 2.4-3.4-2.5.9-5.3.5-7.5-1.1-2.8-2.2-3.9-5.9-2.7-9.2z"></path>';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
o(n, "baseName", "moon-icon");
|
|
14
|
+
export {
|
|
15
|
+
n as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var r = Object.defineProperty;
|
|
2
|
+
var c = (e, a, t) => a in e ? r(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t;
|
|
3
|
+
var l = (e, a, t) => c(e, typeof a != "symbol" ? a + "" : a, t);
|
|
4
|
+
import L from "./base.js";
|
|
5
|
+
class s extends L {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
}
|
|
9
|
+
renderChildren() {
|
|
10
|
+
return '<path d="M1039.92888889 967.11111111L1039.92888889 56.88888889c0-40.15900445-32.65877333-72.81777778-72.81777778-72.81777778l-910.22222222 0c-40.15900445 0-72.81777778 32.65877333-72.81777778 72.81777778l0 910.22222222c0 40.15900445 32.65877333 72.81777778 72.81777778 72.81777778L967.11111111 1039.92888889c40.15900445 0 72.81777778-32.65877333 72.81777778-72.81777778zM56.88888889 56.88888889L967.11111111 56.88888889l0 910.22222222-910.22222221 0.07281778L56.88888889 56.88888889z"></path><path d="M876.08888889 349.17944888a36.40888889 36.40888889 0 0 0-36.40888889-36.40888889l-120.47701333 1e-8L719.20298668 184.32a36.40888889 36.40888889 0 0 0-72.81777779 0l0 164.85944889a36.40888889 36.40888889 0 0 0 36.40888889 36.40888889L839.68 385.58833778a36.40888889 36.40888889 0 0 0 36.40888889-36.4088889z m-156.88590221 473.27914667L719.20298667 694.04444445 839.68 694.04444445a36.40888889 36.40888889 0 1 0 0-72.81777778l-156.88590222 0a36.40888889 36.40888889 0 0 0-36.40888889 36.40888888l0 164.82304a36.40888889 36.40888889 0 1 0 72.81777779 0zM366.36444445 349.17944888L366.36444445 184.32a36.40888889 36.40888889 0 1 0-72.81777778 0l0 128.45055999-120.51342222 1e-8a36.40888889 36.40888889 0 1 0 0 72.81777778L329.95555555 385.58833778a36.40888889 36.40888889 0 0 0 36.4088889-36.4088889z m0 473.27914667L366.36444445 657.63555555a36.40888889 36.40888889 0 0 0-36.4088889-36.40888888l-156.9223111-1e-8a36.40888889 36.40888889 0 1 0 0 72.81777779L293.54666667 694.04444445l0 128.4141511a36.40888889 36.40888889 0 1 0 72.81777778 0z"></path>';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
l(s, "baseName", "reduction-icon");
|
|
14
|
+
export {
|
|
15
|
+
s as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var s = Object.defineProperty;
|
|
2
|
+
var n = (a, e, r) => e in a ? s(a, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[e] = r;
|
|
3
|
+
var t = (a, e, r) => n(a, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import o from "./base.js";
|
|
5
|
+
class c extends o {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
}
|
|
9
|
+
renderChildren() {
|
|
10
|
+
return '<path d="M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z"></path>';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
t(c, "baseName", "refresh-left-icon");
|
|
14
|
+
export {
|
|
15
|
+
c as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var s = Object.defineProperty;
|
|
2
|
+
var h = (e, a, r) => a in e ? s(e, a, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[a] = r;
|
|
3
|
+
var t = (e, a, r) => h(e, typeof a != "symbol" ? a + "" : a, r);
|
|
4
|
+
import n from "./base.js";
|
|
5
|
+
class d extends n {
|
|
6
|
+
renderChildren() {
|
|
7
|
+
return '<path d="M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88z"></path>';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
t(d, "baseName", "refresh-right-icon");
|
|
11
|
+
export {
|
|
12
|
+
d as default
|
|
13
|
+
};
|
package/lib/icon/sort.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var s = Object.defineProperty;
|
|
2
|
+
var n = (e, a, t) => a in e ? s(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t;
|
|
3
|
+
var r = (e, a, t) => n(e, typeof a != "symbol" ? a + "" : a, t);
|
|
4
|
+
import o from "./base.js";
|
|
5
|
+
class d extends o {
|
|
6
|
+
renderChildren() {
|
|
7
|
+
return '<path d="M384 96a32 32 0 0 1 64 0v786.752a32 32 0 0 1-54.592 22.656L95.936 608a32 32 0 0 1 0-45.312h.128a32 32 0 0 1 45.184 0L384 805.632zm192 45.248a32 32 0 0 1 54.592-22.592L928.064 416a32 32 0 0 1 0 45.312h-.128a32 32 0 0 1-45.184 0L640 218.496V928a32 32 0 1 1-64 0V141.248z"></path>';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
r(d, "baseName", "sort-icon");
|
|
11
|
+
export {
|
|
12
|
+
d as default
|
|
13
|
+
};
|
package/lib/icon/sun.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var r = Object.defineProperty;
|
|
2
|
+
var l = (s, c, e) => c in s ? r(s, c, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[c] = e;
|
|
3
|
+
var t = (s, c, e) => l(s, typeof c != "symbol" ? c + "" : c, e);
|
|
4
|
+
import z from "./base.js";
|
|
5
|
+
class a extends z {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(), this.viewBox = "0 0 24 24";
|
|
8
|
+
}
|
|
9
|
+
renderChildren() {
|
|
10
|
+
return '<path d="M12 18c-3.3 0-6-2.7-6-6s2.7-6 6-6 6 2.7 6 6-2.7 6-6 6zm0-10c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zM12 4c-.6 0-1-.4-1-1V1c0-.6.4-1 1-1s1 .4 1 1v2c0 .6-.4 1-1 1zM12 24c-.6 0-1-.4-1-1v-2c0-.6.4-1 1-1s1 .4 1 1v2c0 .6-.4 1-1 1zM5.6 6.6c-.3 0-.5-.1-.7-.3L3.5 4.9c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l1.4 1.4c.4.4.4 1 0 1.4-.1.2-.4.3-.7.3zM19.8 20.8c-.3 0-.5-.1-.7-.3l-1.4-1.4c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l1.4 1.4c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3zM3 13H1c-.6 0-1-.4-1-1s.4-1 1-1h2c.6 0 1 .4 1 1s-.4 1-1 1zM23 13h-2c-.6 0-1-.4-1-1s.4-1 1-1h2c.6 0 1 .4 1 1s-.4 1-1 1zM4.2 20.8c-.3 0-.5-.1-.7-.3-.4-.4-.4-1 0-1.4l1.4-1.4c.4-.4 1-.4 1.4 0s.4 1 0 1.4l-1.4 1.4c-.2.2-.4.3-.7.3zM18.4 6.6c-.3 0-.5-.1-.7-.3-.4-.4-.4-1 0-1.4l1.4-1.4c.4-.4 1-.4 1.4 0s.4 1 0 1.4l-1.4 1.4c-.2.2-.5.3-.7.3z"></path>';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
t(a, "baseName", "sun-icon");
|
|
14
|
+
export {
|
|
15
|
+
a as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const r = ":host{display:inline-flex}:host{display:inline-block}.l-btn{--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-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:var(--l-form-edit-height, 32px);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-block{width:100%}.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)}";
|
|
2
|
+
export {
|
|
3
|
+
r as default
|
|
4
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const l = ':host{display:inline-flex}.l-form{display:grid;grid-template-columns:var(--l-form-label-width, auto) 1fr;row-gap:20px}.l-form-item{display:var(--l-form-item-display, contents);font-size:14px;grid-template-columns:1fr}.l-form-item__label{text-align:var(--l-form-label-align, right);display:inline-block;width:var(--l-form-label-width, auto);height:var(--l-form-edit-height, 32px);line-height:var(--l-form-edit-height, 32px);color:#606266;padding:0 10px 0 0}.l-form-item__label:empty{display:var(--l-form-label-empty-display, inline-block)}.l-form-item.is-required .l-form-item__label:before{content:"*";margin-right:4px;color:var(--l-warn-color, #f56c6c);vertical-align:middle}.l-form-item__content{flex:1;position:relative;display:flex;align-items:center}.l-form-item__error{font-size:12px;line-height:1;position:absolute;top:100%;left:0;color:var(--nt-error-color, #ed3f13);padding-top:3px}.l-form--left .l-form-item__label{text-align:left}.l-form--top{grid-template-columns:1fr}.l-form--top .l-form-item{display:grid;grid-template-columns:1fr}.l-form--top .l-form-item__label{text-align:left}.l-form--top .l-form-item__label:empty{display:none}.l-form-inline{display:flex;gap:20px;flex-flow:row wrap}.l-form.l-form-inline{--l-form-item-display: flex}.l-form.l-form--left,.l-form-item.l-form-item--left{--l-form-label-align: left}.l-form.l-form--top,.l-form-item.l-form-item--top{--l-form-item-display: grid;--l-form-label-align: left;--l-form-label-empty-display: none;grid-template-columns:1fr}';
|
|
2
|
+
export {
|
|
3
|
+
l as default
|
|
4
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const l = ".l-polygon{--l-polygen-size: 10px;--l-polygen-width: var(--l-polygen-size);--l-polygen-height: var(--l-polygen-size);--l-polygen-background: #666;display:inline-block;width:var(--l-polygen-width);height:var(--l-polygen-height);background:var(--l-polygen-background);transition:background .3s ease-in-out}.l-polygon-triangle-top{clip-path:polygon(calc(var(--l-polygen-width) / 2) 0,var(--l-polygen-width) var(--l-polygen-height),0 var(--l-polygen-height))}.l-polygon-triangle-top-left{clip-path:polygon(0 0,var(--l-polygen-width) 0,0 var(--l-polygen-height))}.l-polygon-triangle-top-right{clip-path:polygon(0 0,var(--l-polygen-width) 0,var(--l-polygen-width) var(--l-polygen-height))}.l-polygon-triangle-right{clip-path:polygon(0 0,var(--l-polygen-width) calc(var(--l-polygen-height) / 2),0 var(--l-polygen-height))}.l-polygon-triangle-left{clip-path:polygon(var(--l-polygen-width) 0,var(--l-polygen-width) var(--l-polygen-height),0 calc(var(--l-polygen-height) / 2))}.l-polygon-triangle-bottom{clip-path:polygon(0 0,var(--l-polygen-width) 0,calc(var(--l-polygen-width) / 2) var(--l-polygen-height))}.l-polygon-triangle-bottom-left{clip-path:polygon(0 0,0 var(--l-polygen-height),var(--l-polygen-width) var(--l-polygen-height))}.l-polygon-triangle-bottom-right{clip-path:polygon(var(--l-polygen-width) 0,var(--l-polygen-width) var(--l-polygen-height),0 var(--l-polygen-height))}";
|
|
2
|
+
export {
|
|
3
|
+
l as default
|
|
4
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const i = ":host{display:inline-flex}.l-switch{--l-switch-height: 22px;--l-switch-width: 40px;display:inline-flex;box-sizing:border-box;width:var(--l-switch-width);height:var(--l-switch-height);align-items:center;justify-content:flex-start;background-color:#dcdfe6;border-radius:calc(var(--l-switch-height) / 2);padding:2px;position:relative;cursor:pointer;transition:all .3s ease-in-out;vertical-align:middle;border:1px solid #c2c2c2}.l-switch:hover,.l-switch.l-switch--checked:hover{border-color:var(--l-primary-color, #722ed1)}.l-switch--checked{background-color:var(--l-primary-color, #722ed1);border-color:var(--l-primary-color, #722ed1)}.l-switch-action{position:absolute;width:calc(var(--l-switch-height) - 6px);top:2px;left:2px;bottom:2px;background-color:#fff;border-radius:50%;transition:all .3s ease-in-out;display:flex;justify-content:center;align-items:center;padding:2px;font-size:12px;box-sizing:border-box}.l-switch-text{color:#fff;padding-left:calc(var(--l-switch-width) - 20px);transition:padding-left .3s ease-in-out}.l-switch--checked .l-switch-action{left:calc(var(--l-switch-width) - var(--l-switch-height) + 3px)}.l-switch--checked .l-switch-text{padding-left:5px}";
|
|
2
|
+
export {
|
|
3
|
+
i as default
|
|
4
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const a = ":host{--l-tabbar-hover-color: var(--l-primary-color-light1, #9254de);--l-tabbar-active-color: var(--l-primary-color, #722ed1);--l-tabbar-item-gap: 0;--l-tabbar-height: 38px;position:relative;overflow:hidden;height:var(--l-tabbar-height);background-color:#fff;display:block}.l-tabbar-wrapper{display:flex;flex-wrap:nowrap;height:100%;align-items:stretch;gap:var(--l-tabbar-item-gap)}.l-tabbar-item{color:#666;transition:all .3s ease-in-out;cursor:pointer;display:inline-flex;justify-content:center;align-items:center}.l-tabbar-item:hover{color:var(--l-tabbar-hover-color)}.l-tabbar-item.active{color:var(--l-tabbar-active-color)}.l-tabbar-item-icon{font-size:18px;margin-bottom:5px;display:flex;justify-content:center;align-items:center}.l-tabbar-item-icon.only{font-size:24px;margin-bottom:0}:host(.l-tabbar--nav){--l-tabbar-height: 50px;width:100%}:host(.l-tabbar--nav) .l-tabbar-item{flex-grow:1;display:inline-flex;flex-direction:column;justify-content:center;align-items:center;font-size:12px;line-height:1}:host(.l-tabbar--bar){--l-tabbar-bar-vertical-padding: 10px;--l-tabbar-item-gap: 30px;--l-tabbar-line-color: var(--l-primary-color, #722ed1);overflow:auto;white-space:nowrap}.l-tabbar--bar-line{position:absolute;width:32px;left:0;bottom:0;border-radius:1px;height:2px;background-color:var(--l-tabbar-line-color);transition:all .3s ease-in-out}:host(.l-tabbar--card){--l-tabbar-card-border-color: #f5f7fa;--l-tabbar-line-color: #fff;--l-tabbar-item-gap: 0;--l-tabbar-card-border-radius: 5px}.l-tabbar-card-border{position:absolute;left:0;right:0;bottom:0;height:1px;background-color:var(--l-tabbar-card-border-color)}:host(.l-tabbar--card) .l-tabbar-item{padding:0 15px;background:#f5f7fa;border:1px solid #f0f0f0}:host(.l-tabbar--card) .l-tabbar-item:first-child{border-top-left-radius:var(--l-tabbar-card-border-radius)}:host(.l-tabbar--card) .l-tabbar-item:last-child{border-top-right-radius:var(--l-tabbar-card-border-radius)}:host(.l-tabbar-gap) .l-tabbar-item{border-top-left-radius:var(--l-tabbar-card-border-radius);border-top-right-radius:var(--l-tabbar-card-border-radius)}:host(.l-tabbar--card) .l-tabbar-item.active{background:#fff}";
|
|
2
|
+
export {
|
|
3
|
+
a as default
|
|
4
|
+
};
|
package/lib/index.d.ts
CHANGED
|
@@ -7,12 +7,23 @@ export { default as CaretBottomIcon } from "./icon/caret_bottom";
|
|
|
7
7
|
export { default as FontIcon } from "./icon/font_icon";
|
|
8
8
|
export { default as LoadingIcon } from "./icon/loading";
|
|
9
9
|
export { default as SearchIcon } from "./icon/search";
|
|
10
|
+
export { default as SunIcon } from "./icon/sun";
|
|
11
|
+
export { default as MoonIcon } from "./icon/moon";
|
|
12
|
+
export { default as ReductionIcon } from "./icon/reduction";
|
|
13
|
+
export { default as RefreshLeftIcon } from "./icon/refresh_left";
|
|
14
|
+
export { default as RefreshRightIcon } from "./icon/refresh_right";
|
|
15
|
+
export { default as SortIcon } from "./icon/sort";
|
|
10
16
|
export { default as Form } from "./form";
|
|
11
17
|
export { default as FormItem } from "./form/form_item";
|
|
12
18
|
export { default as Radio } from "./radio";
|
|
13
19
|
export { default as Button } from "./button";
|
|
14
20
|
export { default as Input } from "./input";
|
|
21
|
+
export { default as SelectOri } from "./select_ori";
|
|
22
|
+
export { default as Switch } from "./switch";
|
|
15
23
|
export { default as List } from "./list";
|
|
24
|
+
export { default as Polygon } from "./polygon";
|
|
25
|
+
export { default as ColorPicker } from "./color_picker";
|
|
26
|
+
export { default as Tabbar } from "./tabbar";
|
|
16
27
|
|
|
17
28
|
declare global {
|
|
18
29
|
interface HTMLElementTagNameMap {
|
|
@@ -23,11 +34,22 @@ declare global {
|
|
|
23
34
|
"l-font-icon": import("./icon/font_icon").default
|
|
24
35
|
"l-loading-icon": import("./icon/loading").default
|
|
25
36
|
"l-search-icon": import("./icon/search").default
|
|
37
|
+
"l-sun-icon": import("./icon/sun").default
|
|
38
|
+
"l-moon-icon": import("./icon/moon").default
|
|
39
|
+
"l-reduction-icon": import("./icon/reduction").default
|
|
40
|
+
"l-refresh-left-icon": import("./icon/refresh_left").default
|
|
41
|
+
"l-refresh-right-icon": import("./icon/refresh_right").default
|
|
42
|
+
"l-sort-icon": import("./icon/sort").default
|
|
26
43
|
"l-form": import("./form").default
|
|
27
44
|
"l-form-item": import("./form/form_item").default
|
|
28
45
|
"l-radio": import("./radio").default
|
|
29
46
|
"l-button": import("./button").default
|
|
30
47
|
"l-input": import("./input").default
|
|
48
|
+
"l-select-ori": import("./select_ori").default
|
|
49
|
+
"l-switch": import("./switch").default
|
|
31
50
|
"l-list": import("./list").default
|
|
51
|
+
"l-polygon": import("./polygon").default
|
|
52
|
+
"l-color-picker": import("./color_picker").default
|
|
53
|
+
"l-tabbar": import("./tabbar").default
|
|
32
54
|
}
|
|
33
55
|
}
|