litos-ui 0.1.0 → 0.3.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 +6 -3
- package/lib/base.js +49 -39
- package/lib/browser.d.ts +6 -4
- package/lib/button/index.d.ts +4 -0
- package/lib/button/index.js +73 -59
- package/lib/form/form_events.d.ts +12 -4
- package/lib/form/form_events.js +19 -15
- package/lib/form/form_inner.d.ts +34 -0
- package/lib/form/form_inner.js +121 -0
- package/lib/form/form_item.d.ts +33 -0
- package/lib/form/form_item.js +124 -7
- package/lib/form/index.d.ts +22 -1
- package/lib/form/index.js +108 -19
- package/lib/form/types.js +1 -0
- package/lib/icon/arrow_down.js +8 -6
- package/lib/icon/base.js +24 -19
- package/lib/icon/caret_bottom.js +8 -6
- package/lib/icon/caret_top.js +8 -6
- package/lib/icon/font_icon.js +18 -13
- package/lib/icon/info.js +8 -6
- package/lib/icon/loading.js +8 -6
- package/lib/icon/mask_close.js +8 -6
- package/lib/icon/search.js +8 -6
- package/lib/icon/success.js +7 -5
- package/lib/icon/warn.js +8 -6
- 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-Ikkdx0.js +4 -0
- package/lib/index-oNjb_IVt.js +4 -0
- package/lib/index.d.ts +10 -4
- package/lib/index.js +31 -25
- package/lib/input/index.d.ts +17 -16
- package/lib/input/index.js +86 -86
- package/lib/list/index.d.ts +19 -0
- package/lib/list/index.js +62 -0
- package/lib/litos-ui.css +1 -1
- package/lib/litos-ui.min.js +1 -1
- package/lib/message/index.js +9 -9
- package/lib/radio/index.d.ts +27 -0
- package/lib/radio/index.js +113 -0
- package/lib/transition.js +27 -22
- package/lib/util.js +23 -20
- package/package.json +7 -6
- package/styles/reset.css +5 -0
- package/lib/index-CWq5_ldX.js +0 -4
- package/lib/index-CbaSCp33.js +0 -4
- package/lib/index-DZ2ZMrk1.js +0 -4
- package/lib/index-JjjljTZ2.js +0 -4
package/lib/form/form_item.js
CHANGED
|
@@ -1,11 +1,128 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var h = Object.defineProperty;
|
|
2
|
+
var m = (l, s, e) => s in l ? h(l, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[s] = e;
|
|
3
|
+
var i = (l, s, e) => m(l, typeof s != "symbol" ? s + "" : s, e);
|
|
4
|
+
import { formatClass as f, $one as o, addClass as c, removeClass as u } from "ph-utils/dom";
|
|
5
|
+
import { initAttr as b, parseAttrValue as p } from "../util.js";
|
|
6
|
+
import v from "../base.js";
|
|
7
|
+
import { emit as d, add as _, clear as C, remove as g } from "./form_events.js";
|
|
8
|
+
import { random as n } from "ph-utils";
|
|
9
|
+
class $ extends v {
|
|
3
10
|
constructor() {
|
|
4
|
-
super(
|
|
11
|
+
super();
|
|
12
|
+
i(this, "disabled", !1);
|
|
13
|
+
i(this, "sharedAttrs", ["disabled", "id", "name", "innerBlock"]);
|
|
14
|
+
/** 是否必须 */
|
|
15
|
+
i(this, "required", !1);
|
|
16
|
+
i(this, "error");
|
|
17
|
+
/** 标签文本 */
|
|
18
|
+
i(this, "label");
|
|
19
|
+
i(this, "id");
|
|
20
|
+
/** 内置验证规则: required - 必填, same:password - 一般用于验证确认密码和密码, phone - 验证电话号码 */
|
|
21
|
+
i(this, "verify");
|
|
22
|
+
/** 验证失败错误信息 */
|
|
23
|
+
i(this, "validity");
|
|
24
|
+
/** 自定义验证的正则 */
|
|
25
|
+
i(this, "pattern");
|
|
26
|
+
i(this, "name");
|
|
27
|
+
i(this, "innerBlock", !1);
|
|
28
|
+
i(this, "labelPosition", "right");
|
|
29
|
+
i(this, "formId");
|
|
30
|
+
i(this, "_validateChange", (e, t) => {
|
|
31
|
+
const r = e === !0 ? void 0 : e[this.name];
|
|
32
|
+
(t == null || t === this.name && this.error != r) && (this.error = r, this._updateError());
|
|
33
|
+
});
|
|
34
|
+
b(this), this.id == null && (this.id = `l-fi${n(3)}-${n(6)}`);
|
|
5
35
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
36
|
+
static get observedAttributes() {
|
|
37
|
+
return ["error", "label", "disabled"];
|
|
38
|
+
}
|
|
39
|
+
attributeChangedCallback(e, t, r) {
|
|
40
|
+
if (e === "error")
|
|
41
|
+
r != this.error && (this.error = r, this._updateError());
|
|
42
|
+
else if (e === "label")
|
|
43
|
+
this.label = r, this._updateLabel();
|
|
44
|
+
else if (e === "disabled") {
|
|
45
|
+
const a = p(r, !1, e);
|
|
46
|
+
a !== this.disabled && (d(this.id, "attributeChanged", e, a, this.id), this.disabled = a);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
connectedCallback() {
|
|
50
|
+
var e;
|
|
51
|
+
if (super.connectedCallback(), this.loadStyle(["form"]), this.formId = this._getFormId(), this.name && this.formId) {
|
|
52
|
+
let t = ((e = this.verify) == null ? void 0 : e.split("|")) || [];
|
|
53
|
+
this.pattern && t.push(new RegExp(this.pattern));
|
|
54
|
+
const r = {
|
|
55
|
+
key: this.name,
|
|
56
|
+
required: this.required,
|
|
57
|
+
message: this.validity,
|
|
58
|
+
rules: t
|
|
59
|
+
};
|
|
60
|
+
d(this.formId, "ruleChange", r), _(this.formId, "validateChange", this._validateChange);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
disconnectedCallback() {
|
|
64
|
+
C(this.id), this.formId && g(this.formId, "validateChange", this._validateChange);
|
|
65
|
+
}
|
|
66
|
+
setRules(e) {
|
|
67
|
+
const t = { ...e, key: this.name };
|
|
68
|
+
t.required != null && this.required && (t.required = !0), this.formId && d(this.formId, "ruleChange", t);
|
|
69
|
+
}
|
|
70
|
+
setError(e) {
|
|
71
|
+
this.error = e;
|
|
72
|
+
}
|
|
73
|
+
render() {
|
|
74
|
+
const e = [
|
|
75
|
+
"l-form-item",
|
|
76
|
+
this.required ? "is-required" : void 0,
|
|
77
|
+
this.error ? "is-error" : void 0,
|
|
78
|
+
`l-form-item--${this.labelPosition}`
|
|
79
|
+
], t = this.label != null ? `<label class="l-form-item__label">${this.label}</label>` : "", r = this.error ? `<div class="l-form-item__error">${this.error}</div>` : "";
|
|
80
|
+
this.shadow.innerHTML = [
|
|
81
|
+
`<div class="${f(e)}">${t}`,
|
|
82
|
+
'<div class="l-form-item__content">',
|
|
83
|
+
`<slot></slot>${r}</div></div>`
|
|
84
|
+
].join("");
|
|
85
|
+
}
|
|
86
|
+
_updateError() {
|
|
87
|
+
if (!this.rendered) return;
|
|
88
|
+
let e = o(".l-form-item__error", this.root);
|
|
89
|
+
if (e)
|
|
90
|
+
this.error ? e.textContent = this.error : e.remove();
|
|
91
|
+
else if (this.error) {
|
|
92
|
+
e = document.createElement("div"), e.className = "l-form-item__error", e.textContent = this.error;
|
|
93
|
+
const r = o(".l-form-item__content", this.root);
|
|
94
|
+
r && r.appendChild(e);
|
|
95
|
+
}
|
|
96
|
+
const t = o(".l-form-item", this.root);
|
|
97
|
+
t && (this.error ? c(t, "is-error") : u(t, "is-error"));
|
|
98
|
+
}
|
|
99
|
+
_updateLabel() {
|
|
100
|
+
if (!this.rendered) return;
|
|
101
|
+
let e = o(".l-form-item__label", this.root);
|
|
102
|
+
if (e == null) {
|
|
103
|
+
if (this.label != null) {
|
|
104
|
+
e = document.createElement("div"), e.className = "l-form-item__label", e.textContent = this.label;
|
|
105
|
+
const t = o(".l-form-item", this.root);
|
|
106
|
+
t && t.appendChild(e);
|
|
107
|
+
}
|
|
108
|
+
} else
|
|
109
|
+
this.label != null ? e.textContent = this.label : e.remove();
|
|
110
|
+
}
|
|
111
|
+
_getFormId() {
|
|
112
|
+
let e = this.parentElement, t;
|
|
113
|
+
for (; e != null; ) {
|
|
114
|
+
const r = e.tagName;
|
|
115
|
+
if (r === "L-FORM") {
|
|
116
|
+
t = e.id;
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
if (r === "BODY") break;
|
|
120
|
+
e = e.parentElement;
|
|
121
|
+
}
|
|
122
|
+
return e = null, t;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
i($, "baseName", "form-item");
|
|
9
126
|
export {
|
|
10
|
-
|
|
127
|
+
$ as default
|
|
11
128
|
};
|
package/lib/form/index.d.ts
CHANGED
|
@@ -1,16 +1,37 @@
|
|
|
1
1
|
import BaseComponent from "../base";
|
|
2
|
+
import type { SchemaType } from "ph-utils/validator";
|
|
3
|
+
import Validator from "ph-utils/validator";
|
|
2
4
|
export default class Form extends BaseComponent {
|
|
3
5
|
static baseName: string;
|
|
4
6
|
/** 是否行内表单 */
|
|
5
7
|
inline: boolean;
|
|
6
8
|
labelPosition?: "left" | "right" | "top";
|
|
7
9
|
labelWidth?: string;
|
|
8
|
-
|
|
10
|
+
id: string;
|
|
9
11
|
disabled: boolean;
|
|
10
12
|
sharedAttrs: string[];
|
|
13
|
+
validator: Validator;
|
|
14
|
+
innerBlock: boolean;
|
|
15
|
+
novalidate: boolean;
|
|
16
|
+
private _data?;
|
|
17
|
+
private emit;
|
|
11
18
|
constructor();
|
|
12
19
|
static get observedAttributes(): string[];
|
|
13
20
|
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
14
21
|
connectedCallback(): void;
|
|
22
|
+
disconnectedCallback(): void;
|
|
15
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
|
+
};
|
|
16
37
|
}
|
package/lib/form/index.js
CHANGED
|
@@ -1,37 +1,126 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
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 {
|
|
7
11
|
constructor() {
|
|
8
|
-
super()
|
|
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");
|
|
9
38
|
}
|
|
10
39
|
static get observedAttributes() {
|
|
11
|
-
return ["disabled"];
|
|
40
|
+
return ["disabled", "label-position"];
|
|
12
41
|
}
|
|
13
|
-
attributeChangedCallback(t,
|
|
42
|
+
attributeChangedCallback(t, s, e) {
|
|
14
43
|
if (t === "disabled") {
|
|
15
|
-
const
|
|
16
|
-
|
|
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
|
+
]));
|
|
17
53
|
}
|
|
18
54
|
}
|
|
19
55
|
connectedCallback() {
|
|
20
|
-
this.loadStyle(["form"]), super.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;
|
|
21
60
|
}
|
|
22
61
|
render() {
|
|
23
|
-
const t =
|
|
62
|
+
const t = n([
|
|
24
63
|
"l-form",
|
|
25
64
|
this.inline ? "l-form-inline" : void 0,
|
|
26
65
|
`l-form--${this.labelPosition}`
|
|
27
|
-
]),
|
|
66
|
+
]), s = b({
|
|
28
67
|
"--l-form-label-width": this.labelWidth ? this.labelWidth : ""
|
|
29
68
|
});
|
|
30
|
-
this.shadow.innerHTML = `<form class="${t}" style="${
|
|
69
|
+
this.shadow.innerHTML = `<form class="${t}" style="${s}"><slot></slot></form>`;
|
|
31
70
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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");
|
|
35
124
|
export {
|
|
36
|
-
|
|
125
|
+
k as default
|
|
37
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
|
};
|
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 r = e;
|
|
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 t = e;
|
|
9
|
+
}
|
|
10
|
+
a(c, "baseName", "caret-top-icon");
|
|
9
11
|
export {
|
|
10
|
-
|
|
12
|
+
c as default
|
|
11
13
|
};
|
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 e = c;
|
|
12
|
+
}
|
|
13
|
+
l(o, "baseName", "info-icon");
|
|
12
14
|
export {
|
|
13
|
-
|
|
15
|
+
o as default
|
|
14
16
|
};
|
package/lib/icon/loading.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 {
|
|
3
6
|
renderChildren() {
|
|
4
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>';
|
|
5
8
|
}
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
let t = r;
|
|
9
|
+
}
|
|
10
|
+
c(o, "baseName", "loading-icon");
|
|
9
11
|
export {
|
|
10
|
-
|
|
12
|
+
o as default
|
|
11
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 t = r;
|
|
12
|
+
}
|
|
13
|
+
s(c, "baseName", "mask-close-icon");
|
|
12
14
|
export {
|
|
13
|
-
|
|
15
|
+
c as default
|
|
14
16
|
};
|
package/lib/icon/search.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 {
|
|
3
6
|
renderChildren() {
|
|
4
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>';
|
|
5
8
|
}
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
let e = a;
|
|
9
|
+
}
|
|
10
|
+
t(c, "baseName", "search-icon");
|
|
9
11
|
export {
|
|
10
|
-
|
|
12
|
+
c as default
|
|
11
13
|
};
|
package/lib/icon/success.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
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);
|
|
1
4
|
import t from "./base.js";
|
|
2
|
-
|
|
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 a = 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
|
-
|
|
2
|
-
|
|
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);
|
|
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 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
|
+
};
|