litos-ui 0.0.2 → 0.2.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/animation-QfX4RtqD.js +4 -0
- package/lib/base.d.ts +36 -0
- package/lib/base.js +54 -19
- package/lib/browser.d.ts +8 -0
- package/lib/button/index.d.ts +15 -0
- package/lib/button/index.js +84 -16
- package/lib/form/form_events.d.ts +32 -0
- package/lib/form/form_events.js +24 -0
- package/lib/form/form_inner.d.ts +34 -0
- package/lib/form/form_inner.js +121 -0
- package/lib/form/form_item.d.ts +39 -0
- package/lib/form/form_item.js +128 -0
- package/lib/form/index.d.ts +37 -0
- package/lib/form/index.js +126 -0
- package/lib/form/types.js +1 -0
- package/lib/icon/arrow_down.d.ts +6 -0
- package/lib/icon/arrow_down.js +8 -6
- package/lib/icon/base.d.ts +11 -0
- package/lib/icon/base.js +24 -19
- package/lib/icon/caret_bottom.d.ts +5 -0
- package/lib/icon/caret_bottom.js +8 -6
- package/lib/icon/caret_top.d.ts +5 -0
- package/lib/icon/caret_top.js +8 -6
- package/lib/icon/font_icon.d.ts +12 -0
- package/lib/icon/font_icon.js +18 -13
- package/lib/icon/info.d.ts +6 -0
- package/lib/icon/info.js +8 -6
- package/lib/icon/loading.d.ts +5 -0
- package/lib/icon/loading.js +13 -0
- package/lib/icon/mask_close.d.ts +6 -0
- package/lib/icon/mask_close.js +8 -6
- package/lib/icon/search.d.ts +5 -0
- package/lib/icon/search.js +13 -0
- package/lib/icon/success.d.ts +6 -0
- package/lib/icon/success.js +8 -6
- package/lib/icon/warn.d.ts +6 -0
- package/lib/icon/warn.js +7 -5
- package/lib/index-B_9rPBWp.js +4 -0
- package/lib/index-Boq1Q7q9.js +4 -0
- package/lib/index-CCcVpk6U.js +4 -0
- package/lib/index-ColsUDnt.js +4 -0
- package/lib/index.d.ts +31 -0
- package/lib/index.js +34 -19
- package/lib/input/index.d.ts +52 -0
- package/lib/input/index.js +118 -0
- package/lib/litos-ui.css +1 -0
- package/lib/litos-ui.min.js +1 -0
- package/lib/message/index.d.ts +25 -0
- package/lib/message/index.js +19 -19
- package/lib/radio/index.d.ts +27 -0
- package/lib/radio/index.js +113 -0
- package/lib/transition.d.ts +15 -0
- package/lib/transition.js +27 -22
- package/lib/util.d.ts +40 -0
- package/lib/util.js +46 -17
- package/package.json +22 -14
- package/styles/message.css +4 -4
- package/styles/reset.css +5 -0
- package/lib/index-DMj9CroY.js +0 -4
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import BaseComponent from "../base";
|
|
2
|
+
import type { SchemaType } from "ph-utils/validator";
|
|
3
|
+
import Validator from "ph-utils/validator";
|
|
4
|
+
export default class Form extends BaseComponent {
|
|
5
|
+
static baseName: string;
|
|
6
|
+
/** 是否行内表单 */
|
|
7
|
+
inline: boolean;
|
|
8
|
+
labelPosition?: "left" | "right" | "top";
|
|
9
|
+
labelWidth?: string;
|
|
10
|
+
id: string;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
sharedAttrs: string[];
|
|
13
|
+
validator: Validator;
|
|
14
|
+
innerBlock: boolean;
|
|
15
|
+
novalidate: boolean;
|
|
16
|
+
private _data?;
|
|
17
|
+
private emit;
|
|
18
|
+
constructor();
|
|
19
|
+
static get observedAttributes(): string[];
|
|
20
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
21
|
+
connectedCallback(): void;
|
|
22
|
+
disconnectedCallback(): void;
|
|
23
|
+
render(): void;
|
|
24
|
+
ruleChange: (schema: SchemaType) => void;
|
|
25
|
+
_valueChange: (name: string, value: any, valid?: boolean) => void;
|
|
26
|
+
validateField(field: string | string[]): void;
|
|
27
|
+
clearValidate(): void;
|
|
28
|
+
reset(): void;
|
|
29
|
+
submit(): void;
|
|
30
|
+
/**
|
|
31
|
+
* 校验全部表单数据
|
|
32
|
+
*/
|
|
33
|
+
validate(): Promise<boolean>;
|
|
34
|
+
getData(): {
|
|
35
|
+
[x: string]: any;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
var v = Object.defineProperty;
|
|
2
|
+
var m = (d, r, t) => r in d ? v(d, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[r] = t;
|
|
3
|
+
var i = (d, r, t) => m(d, typeof r != "symbol" ? r + "" : r, t);
|
|
4
|
+
import { $one as u, formatClass as n, formatStyle as b } from "ph-utils/dom";
|
|
5
|
+
import C from "../base.js";
|
|
6
|
+
import { initAttr as g, parseAttrValue as p } from "../util.js";
|
|
7
|
+
import { random as c } from "ph-utils";
|
|
8
|
+
import { emit as l, add as f, clear as _ } from "./form_events.js";
|
|
9
|
+
import y from "ph-utils/validator";
|
|
10
|
+
class k extends C {
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
/** 是否行内表单 */
|
|
14
|
+
i(this, "inline", !1);
|
|
15
|
+
i(this, "labelPosition", "right");
|
|
16
|
+
i(this, "labelWidth");
|
|
17
|
+
i(this, "id");
|
|
18
|
+
i(this, "disabled", !1);
|
|
19
|
+
i(this, "sharedAttrs", ["disabled", "id", "innerBlock"]);
|
|
20
|
+
i(this, "validator");
|
|
21
|
+
i(this, "innerBlock", !1);
|
|
22
|
+
i(this, "novalidate", !1);
|
|
23
|
+
i(this, "_data");
|
|
24
|
+
i(this, "emit");
|
|
25
|
+
i(this, "ruleChange", (t) => {
|
|
26
|
+
this.validator.addSchema(t);
|
|
27
|
+
});
|
|
28
|
+
i(this, "_valueChange", (t, s, e = !0) => {
|
|
29
|
+
this._data == null && (this._data = {});
|
|
30
|
+
const a = Object.hasOwn(this._data, t);
|
|
31
|
+
this._data[t] = s, !this.novalidate && a && e && this.validator.validateKey(t, s, this._data).then(() => {
|
|
32
|
+
l(this.id, "validateChange", !0, t);
|
|
33
|
+
}).catch((h) => {
|
|
34
|
+
l(this.id, "validateChange", h.detail, t);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
g(this), this.id == null && (this.id = `l-f${c(3)}-${c(6)}`), this.validator = new y([]), this.emit = new CustomEvent("submit");
|
|
38
|
+
}
|
|
39
|
+
static get observedAttributes() {
|
|
40
|
+
return ["disabled", "label-position"];
|
|
41
|
+
}
|
|
42
|
+
attributeChangedCallback(t, s, e) {
|
|
43
|
+
if (t === "disabled") {
|
|
44
|
+
const a = p(e, !1, t);
|
|
45
|
+
a !== this.disabled && (l(this.id, "attributeChanged", t, a, this.id), this.disabled = a);
|
|
46
|
+
} else if (t === "label-position") {
|
|
47
|
+
const a = u("form", this.root);
|
|
48
|
+
a && (a.className = n([
|
|
49
|
+
"l-form",
|
|
50
|
+
this.inline ? "l-form-inline" : void 0,
|
|
51
|
+
`l-form--${e}`
|
|
52
|
+
]));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
connectedCallback() {
|
|
56
|
+
this.loadStyle(["form"]), super.connectedCallback(), f(this.id, "ruleChange", this.ruleChange), f(this.id, "valueChange", this._valueChange);
|
|
57
|
+
}
|
|
58
|
+
disconnectedCallback() {
|
|
59
|
+
_(this.id), this.validator = void 0;
|
|
60
|
+
}
|
|
61
|
+
render() {
|
|
62
|
+
const t = n([
|
|
63
|
+
"l-form",
|
|
64
|
+
this.inline ? "l-form-inline" : void 0,
|
|
65
|
+
`l-form--${this.labelPosition}`
|
|
66
|
+
]), s = b({
|
|
67
|
+
"--l-form-label-width": this.labelWidth ? this.labelWidth : ""
|
|
68
|
+
});
|
|
69
|
+
this.shadow.innerHTML = `<form class="${t}" style="${s}"><slot></slot></form>`;
|
|
70
|
+
}
|
|
71
|
+
validateField(t) {
|
|
72
|
+
const s = [];
|
|
73
|
+
if (this._data != null) {
|
|
74
|
+
if (Array.isArray(t))
|
|
75
|
+
for (let e = 0, a = t.length; e < a; e++) {
|
|
76
|
+
const h = t[e];
|
|
77
|
+
s.push(this.validator.validateKey(h, this._data[h], this._data));
|
|
78
|
+
}
|
|
79
|
+
else
|
|
80
|
+
s.push(
|
|
81
|
+
this.validator.validateKey(t, this._data[t], this._data)
|
|
82
|
+
);
|
|
83
|
+
Promise.allSettled(s).then((e) => {
|
|
84
|
+
for (let a = 0, h = e.length; a < h; a++) {
|
|
85
|
+
const o = e[a];
|
|
86
|
+
o.status === "rejected" ? l(
|
|
87
|
+
this.id,
|
|
88
|
+
"validateChange",
|
|
89
|
+
o.reason.detail,
|
|
90
|
+
o.reason.key
|
|
91
|
+
) : l(this.id, "validateChange", !0, o.value.key);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
clearValidate() {
|
|
97
|
+
l(this.id, "validateChange", !0);
|
|
98
|
+
}
|
|
99
|
+
reset() {
|
|
100
|
+
this.clearValidate(), l(this.id, "reset");
|
|
101
|
+
}
|
|
102
|
+
submit() {
|
|
103
|
+
this.novalidate ? this.dispatchEvent(this.emit) : this.validate().then((t) => {
|
|
104
|
+
t && this.dispatchEvent(this.emit);
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* 校验全部表单数据
|
|
109
|
+
*/
|
|
110
|
+
async validate() {
|
|
111
|
+
if (this._data != null)
|
|
112
|
+
try {
|
|
113
|
+
return await this.validator.validate(this._data), l(this.id, "validateChange", !0), Promise.resolve(!0);
|
|
114
|
+
} catch (t) {
|
|
115
|
+
return l(this.id, "validateChange", t.detail), Promise.resolve(!1);
|
|
116
|
+
}
|
|
117
|
+
return Promise.resolve(!0);
|
|
118
|
+
}
|
|
119
|
+
getData() {
|
|
120
|
+
return { ...this._data };
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
i(k, "baseName", "form");
|
|
124
|
+
export {
|
|
125
|
+
k as default
|
|
126
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/lib/icon/arrow_down.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var t = Object.defineProperty;
|
|
2
|
+
var c = (e, a, r) => a in e ? t(e, a, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[a] = r;
|
|
3
|
+
var n = (e, a, r) => c(e, typeof a != "symbol" ? a + "" : a, r);
|
|
4
|
+
import l from "./base.js";
|
|
5
|
+
class o extends l {
|
|
3
6
|
connectedCallback() {
|
|
4
7
|
super.connectedCallback();
|
|
5
8
|
}
|
|
6
9
|
renderChildren() {
|
|
7
10
|
return '<path fill="currentColor" d="M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"></path>';
|
|
8
11
|
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
let e = a;
|
|
12
|
+
}
|
|
13
|
+
n(o, "baseName", "arrow-down-icon");
|
|
12
14
|
export {
|
|
13
|
-
|
|
15
|
+
o as default
|
|
14
16
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import BaseComponent from "../base";
|
|
2
|
+
export default class BaseIcon extends BaseComponent {
|
|
3
|
+
static baseName: string;
|
|
4
|
+
useLink: boolean;
|
|
5
|
+
viewBox: string;
|
|
6
|
+
constructor();
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
render(): void;
|
|
9
|
+
renderChildren(): string;
|
|
10
|
+
createEl(tagName: string): SVGElement;
|
|
11
|
+
}
|
package/lib/icon/base.js
CHANGED
|
@@ -1,27 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var p = (i, t, e) => t in i ? u(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var n = (i, t, e) => p(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import w from "../base.js";
|
|
5
|
+
class v extends w {
|
|
3
6
|
constructor() {
|
|
4
|
-
super()
|
|
7
|
+
super();
|
|
8
|
+
n(this, "useLink");
|
|
9
|
+
n(this, "viewBox");
|
|
10
|
+
this.useLink = !1, this.viewBox = "0 0 1024 1024";
|
|
5
11
|
}
|
|
6
12
|
connectedCallback() {
|
|
7
13
|
this.loadStyle(["icon"]), this.render();
|
|
8
14
|
}
|
|
9
15
|
render() {
|
|
10
|
-
const e = this.createEl("svg"),
|
|
11
|
-
e.classList.add("l-icon"),
|
|
12
|
-
const
|
|
13
|
-
if (typeof
|
|
14
|
-
if (
|
|
15
|
-
const
|
|
16
|
-
for (let
|
|
17
|
-
const
|
|
18
|
-
|
|
16
|
+
const e = this.createEl("svg"), h = this.getAttr("useLink", this.useLink), d = this.getAttr("viewBox", this.viewBox);
|
|
17
|
+
e.classList.add("l-icon"), h || e.setAttribute("viewBox", d);
|
|
18
|
+
const s = this.renderChildren();
|
|
19
|
+
if (typeof s == "string")
|
|
20
|
+
if (s === "") {
|
|
21
|
+
const o = this.children, c = [];
|
|
22
|
+
for (let r = 0, a = o.length; r < a; r++) {
|
|
23
|
+
const l = o[r];
|
|
24
|
+
c.push(l.outerHTML), e.appendChild(l);
|
|
19
25
|
}
|
|
20
|
-
e.innerHTML =
|
|
26
|
+
e.innerHTML = c.join("");
|
|
21
27
|
} else
|
|
22
|
-
e.innerHTML =
|
|
28
|
+
e.innerHTML = s;
|
|
23
29
|
else
|
|
24
|
-
e.append(
|
|
30
|
+
e.append(s);
|
|
25
31
|
this.shadow.appendChild(e);
|
|
26
32
|
}
|
|
27
33
|
renderChildren() {
|
|
@@ -30,9 +36,8 @@ const s = class s extends a {
|
|
|
30
36
|
createEl(e) {
|
|
31
37
|
return document.createElementNS("http://www.w3.org/2000/svg", e);
|
|
32
38
|
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
let h = s;
|
|
39
|
+
}
|
|
40
|
+
n(v, "baseName", "base-icon");
|
|
36
41
|
export {
|
|
37
|
-
|
|
42
|
+
v as default
|
|
38
43
|
};
|
package/lib/icon/caret_bottom.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var o = Object.defineProperty;
|
|
2
|
+
var n = (t, e, r) => e in t ? o(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var a = (t, e, r) => n(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import s from "./base.js";
|
|
5
|
+
class c extends s {
|
|
3
6
|
renderChildren() {
|
|
4
7
|
return '<path fill="currentColor" d="m192 384 320 384 320-384z"></path>';
|
|
5
8
|
}
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
let e = t;
|
|
9
|
+
}
|
|
10
|
+
a(c, "baseName", "caret-bottom-icon");
|
|
9
11
|
export {
|
|
10
|
-
|
|
12
|
+
c as default
|
|
11
13
|
};
|
package/lib/icon/caret_top.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var o = Object.defineProperty;
|
|
2
|
+
var n = (r, e, t) => e in r ? o(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var a = (r, e, t) => n(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import s from "./base.js";
|
|
5
|
+
class c extends s {
|
|
3
6
|
renderChildren() {
|
|
4
7
|
return '<path fill="currentColor" d="M512 320 192 704h639.936z"></path>';
|
|
5
8
|
}
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
let e = t;
|
|
9
|
+
}
|
|
10
|
+
a(c, "baseName", "caret-top-icon");
|
|
9
11
|
export {
|
|
10
|
-
|
|
12
|
+
c as default
|
|
11
13
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import BaseIcon from "./base";
|
|
2
|
+
export default class FontIcon extends BaseIcon {
|
|
3
|
+
static baseName: string;
|
|
4
|
+
private _t;
|
|
5
|
+
private _start;
|
|
6
|
+
constructor();
|
|
7
|
+
renderChildren(): string;
|
|
8
|
+
render(): void;
|
|
9
|
+
disconnectedCallback(): void;
|
|
10
|
+
connectedCallback(): void;
|
|
11
|
+
_loadIcon(name: string): void;
|
|
12
|
+
}
|
package/lib/icon/font_icon.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var a = Object.defineProperty;
|
|
2
|
+
var c = (n, e, t) => e in n ? a(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var r = (n, e, t) => c(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import l from "./base.js";
|
|
5
|
+
class u extends l {
|
|
3
6
|
constructor() {
|
|
4
|
-
super()
|
|
7
|
+
super();
|
|
8
|
+
r(this, "_t");
|
|
9
|
+
r(this, "_start");
|
|
10
|
+
this.useLink = !0, this._t = void 0, this._start = 0;
|
|
5
11
|
}
|
|
6
12
|
renderChildren() {
|
|
7
13
|
return "";
|
|
@@ -19,21 +25,20 @@ const s = class s extends o {
|
|
|
19
25
|
}
|
|
20
26
|
_loadIcon(t) {
|
|
21
27
|
Date.now() - this._start >= 1e4 || (this._t = requestAnimationFrame(() => {
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
28
|
+
const i = document.querySelector(`#${t}`);
|
|
29
|
+
if (i == null) {
|
|
24
30
|
this._loadIcon(t);
|
|
25
31
|
return;
|
|
26
32
|
}
|
|
27
33
|
this._t = void 0;
|
|
28
|
-
let
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
|
|
34
|
+
let s = i.getAttribute("viewBox");
|
|
35
|
+
s || (s = "0 0 1024 1024");
|
|
36
|
+
const o = this.shadow.querySelector("svg");
|
|
37
|
+
o != null && (o.setAttribute("viewBox", s), o.innerHTML = i.innerHTML);
|
|
32
38
|
}));
|
|
33
39
|
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
let n = s;
|
|
40
|
+
}
|
|
41
|
+
r(u, "baseName", "font-icon");
|
|
37
42
|
export {
|
|
38
|
-
|
|
43
|
+
u as default
|
|
39
44
|
};
|
package/lib/icon/info.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var n = Object.defineProperty;
|
|
2
|
+
var r = (e, c, a) => c in e ? n(e, c, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[c] = a;
|
|
3
|
+
var l = (e, c, a) => r(e, typeof c != "symbol" ? c + "" : c, a);
|
|
4
|
+
import t from "./base.js";
|
|
5
|
+
class o extends t {
|
|
3
6
|
connectedCallback() {
|
|
4
7
|
super.connectedCallback();
|
|
5
8
|
}
|
|
6
9
|
renderChildren() {
|
|
7
10
|
return '<path fill="currentColor" d="M512 64a448 448 0 110 896.064A448 448 0 01512 64zm67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344zM590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 01-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 017.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"></path>';
|
|
8
11
|
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
let a = c;
|
|
12
|
+
}
|
|
13
|
+
l(o, "baseName", "info-icon");
|
|
12
14
|
export {
|
|
13
|
-
|
|
15
|
+
o as default
|
|
14
16
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var t = Object.defineProperty;
|
|
2
|
+
var s = (a, e, r) => e in a ? t(a, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[e] = r;
|
|
3
|
+
var c = (a, e, r) => s(a, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import n from "./base.js";
|
|
5
|
+
class o extends n {
|
|
6
|
+
renderChildren() {
|
|
7
|
+
return '<path d="M520.665 64.564a29.244 29.244 0 0 0-7.071-.894c-16.211 0-29.35 13.14-29.35 29.35 0 15.83 12.538 28.696 28.223 29.293v.073c.375 0 .751-.014 1.127-.014 216.493 0 389.629 173.942 389.629 390.433 0 216.496-173.136 388.827-389.63 388.827s-389.63-172.333-389.63-388.829c0-.27.01-.536.01-.804h-.01c0-16.209-13.141-29.35-29.35-29.35s-29.35 13.139-29.35 29.35c0 .055.007.11.007.164-.001.214-.007.425-.007.64 0 247.609 200.722 448.331 448.33 448.331 247.607 0 448.33-200.722 448.33-448.33-.002-245.242-196.917-444.456-441.258-448.24z" fill="currentColor"></path>';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
c(o, "baseName", "loading-icon");
|
|
11
|
+
export {
|
|
12
|
+
o as default
|
|
13
|
+
};
|
package/lib/icon/mask_close.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var a = Object.defineProperty;
|
|
2
|
+
var o = (r, e, t) => e in r ? a(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var s = (r, e, t) => o(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import l from "./base.js";
|
|
5
|
+
class c extends l {
|
|
3
6
|
constructor() {
|
|
4
7
|
super(), this.viewBox = "0 0 24 24";
|
|
5
8
|
}
|
|
6
9
|
renderChildren() {
|
|
7
10
|
return '<path fill="currentColor" d="M12 23a11 11 0 100-22 11 11 0 000 22zM8.82 7.4L12 10.6l3.18-3.19 1.42 1.42L13.4 12l3.19 3.18-1.42 1.42L12 13.4 8.82 16.6 7.4 15.18 10.6 12 7.4 8.82 8.82 7.4z"></path>';
|
|
8
11
|
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
let r = t;
|
|
12
|
+
}
|
|
13
|
+
s(c, "baseName", "mask-close-icon");
|
|
12
14
|
export {
|
|
13
|
-
|
|
15
|
+
c as default
|
|
14
16
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var s = Object.defineProperty;
|
|
2
|
+
var n = (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) => n(e, typeof a != "symbol" ? a + "" : a, r);
|
|
4
|
+
import o from "./base.js";
|
|
5
|
+
class c extends o {
|
|
6
|
+
renderChildren() {
|
|
7
|
+
return '<path fill="currentColor" d="m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"></path>';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
t(c, "baseName", "search-icon");
|
|
11
|
+
export {
|
|
12
|
+
c as default
|
|
13
|
+
};
|
package/lib/icon/success.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var r = Object.defineProperty;
|
|
2
|
+
var s = (c, e, a) => e in c ? r(c, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : c[e] = a;
|
|
3
|
+
var l = (c, e, a) => s(c, typeof e != "symbol" ? e + "" : e, a);
|
|
4
|
+
import t from "./base.js";
|
|
5
|
+
class n extends t {
|
|
3
6
|
connectedCallback() {
|
|
4
7
|
super.connectedCallback();
|
|
5
8
|
}
|
|
6
9
|
renderChildren() {
|
|
7
10
|
return '<path fill="currentColor" d="M512 0C228.693333 0 0 228.693333 0 512s228.693333 512 512 512 512-228.693333 512-512S795.306667 0 512 0z m307.2 368.64L467.626667 730.453333c0 3.413333-3.413333 3.413333-3.413334 6.826667-13.653333 13.653333-37.546667 13.653333-51.2 0l-177.493333-177.493333c-13.653333-13.653333-13.653333-37.546667 0-51.2 13.653333-13.653333 37.546667-13.653333 51.2 0l150.186667 153.6 334.506666-341.333334c13.653333-13.653333 37.546667-13.653333 51.2 0 10.24 10.24 10.24 34.133333-3.413333 47.786667z m0 0"></path>';
|
|
8
11
|
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
let t = e;
|
|
12
|
+
}
|
|
13
|
+
l(n, "baseName", "success-icon");
|
|
12
14
|
export {
|
|
13
|
-
|
|
15
|
+
n as default
|
|
14
16
|
};
|
package/lib/icon/warn.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
var l = Object.defineProperty;
|
|
2
|
+
var n = (a, e, c) => e in a ? l(a, e, { enumerable: !0, configurable: !0, writable: !0, value: c }) : a[e] = c;
|
|
3
|
+
var r = (a, e, c) => n(a, typeof e != "symbol" ? e + "" : e, c);
|
|
1
4
|
import t from "./base.js";
|
|
2
|
-
|
|
5
|
+
class o extends t {
|
|
3
6
|
connectedCallback() {
|
|
4
7
|
super.connectedCallback();
|
|
5
8
|
}
|
|
6
9
|
renderChildren() {
|
|
7
10
|
return '<path fill="currentColor" d="M512 1024C229.234 1024 0 794.766 0 512S229.234 0 512 0s512 229.234 512 512-229.234 512-512 512z m-64.853-734.52l19.484 244.906 1.309 16.156c1.251 15.93 15.018 28.644 30.72 28.644h25.571c15.56 0 29.298-12.601 30.663-28.132l1.422-16.668 21.334-244.907c3.214-36.978-24.434-66.844-61.725-66.844h-6.627c-37.462 0-65.138 29.923-62.18 66.844zM512 801.393a66.788 66.788 0 1 0 0-133.575 66.788 66.788 0 0 0 0 133.575z"></path>';
|
|
8
11
|
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
let c = e;
|
|
12
|
+
}
|
|
13
|
+
r(o, "baseName", "warn-icon");
|
|
12
14
|
export {
|
|
13
|
-
|
|
15
|
+
o as default
|
|
14
16
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const r = ":host{display:inline-block;width:var(--l-input-width, auto)}.l-input{outline:none;box-sizing:border-box;width:100%;max-width:100%;height:var(--l-form-edit-height, 32px);border:1px solid var(--l-border-color, #dedede);transition:border-color .3s;text-align:inherit;padding:0 5px;border-radius:3px;vertical-align:middle}.l-input.is-error{--l-border-color: var(--nt-error-color, #ed3f13)}.l-input:not(.is-error):focus{border-color:var(--l-primary-color, #722ed1)}.l-input:disabled{cursor:not-allowed;background:var(--l-disabled-color, #f5f7fa)}";
|
|
2
|
+
export {
|
|
3
|
+
r as default
|
|
4
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const r = ":host{display:contents}: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 r = ':host{display:flex;align-items:center}.l-radio{--l-radio-size: 16px;--l-radio-label-color: #333;--l-radio-disabled-color: #e6e6e6;--l-radio-disabled-label-color: var(--l-disabled-color, #c0c4cc);--l-radio-checked-color: var(--l-primary-color, #722ed1);--l-radio-item-margin: 10px;display:inline-flex;align-items:center;position:relative;cursor:pointer}.l-radio__label{transition:color .3s ease-in-out;margin-left:5px}.l-radio__input{position:absolute;z-index:-1;width:0;height:0;opacity:0}.l-radio__inner{display:flex;justify-content:center;align-items:center;width:var(--l-radio-size);height:var(--l-radio-size);border:1px solid #dcddd9;border-radius:50%;box-sizing:border-box;transition:border-color .3s ease-in-out}.l-radio__inner:before{content:"";display:block;width:60%;height:60%;background-color:transparent;border-radius:50%;transition:background-color .3s ease-in-out}.l-radio.is-checked .l-radio__inner{border-color:var(--l-primary-color, #722ed1)}.l-radio.is-checked .l-radio__inner:before{background-color:var(--l-primary-color, #722ed1)}.l-radio.is-checked .l-radio__label{color:var(--l-primary-color, #722ed1)}.l-radio--disabled{cursor:not-allowed}.l-radio--disabledd .l-radio__inner{border-color:var(--l-radio-disabled-color)}.l-radio--disabled .l-radio__label{color:var(--l-radio-disabled-label-color)}.l-radio:not(:first-child){margin-left:var(--l-radio-item-margin)}.l-radio--button .l-radio__label{display:inline-flex;height:var(--l-form-edit-height, 32px);justify-content:center;align-items:center;padding:0 15px;border:1px solid #c0c4cc;border-left-width:0;margin-left:0}.l-radio--button:not(:first-of-type){margin-left:0}.l-radio--button:first-of-type .l-radio__label{border-left-width:1px;border-top-left-radius:3px;border-bottom-left-radius:3px}.l-radio--button:last-of-type .l-radio__label{border-top-right-radius:3px;border-bottom-right-radius:3px}.is-checked.l-radio--button .l-radio__label{background-color:var(--l-radio-checked-color);color:#fff;border-color:var(--l-radio-checked-color)}';
|
|
2
|
+
export {
|
|
3
|
+
r as default
|
|
4
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const l = ':host{display:contents}.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
|
+
};
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export * from "./util";
|
|
2
|
+
export { default as Message } from "./message";
|
|
3
|
+
export { default as BaseIcon } from "./icon/base";
|
|
4
|
+
export { default as ArrowDownIcon } from "./icon/arrow_down";
|
|
5
|
+
export { default as CaretTopIcon } from "./icon/caret_top";
|
|
6
|
+
export { default as CaretBottomIcon } from "./icon/caret_bottom";
|
|
7
|
+
export { default as FontIcon } from "./icon/font_icon";
|
|
8
|
+
export { default as LoadingIcon } from "./icon/loading";
|
|
9
|
+
export { default as SearchIcon } from "./icon/search";
|
|
10
|
+
export { default as Form } from "./form";
|
|
11
|
+
export { default as FormItem } from "./form/form_item";
|
|
12
|
+
export { default as Radio } from "./radio";
|
|
13
|
+
export { default as Button } from "./button";
|
|
14
|
+
export { default as Input } from "./input";
|
|
15
|
+
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
"l-base-icon": import("./icon/base").default
|
|
19
|
+
"l-arrow-down-icon": import("./icon/arrow_down").default
|
|
20
|
+
"l-caret-top-icon": import("./icon/caret_top").default
|
|
21
|
+
"l-caret-bottom-icon": import("./icon/caret_bottom").default
|
|
22
|
+
"l-font-icon": import("./icon/font_icon").default
|
|
23
|
+
"l-loading-icon": import("./icon/loading").default
|
|
24
|
+
"l-search-icon": import("./icon/search").default
|
|
25
|
+
"l-form": import("./form").default
|
|
26
|
+
"l-form-item": import("./form/form_item").default
|
|
27
|
+
"l-radio": import("./radio").default
|
|
28
|
+
"l-button": import("./button").default
|
|
29
|
+
"l-input": import("./input").default
|
|
30
|
+
}
|
|
31
|
+
}
|