litos-ui 0.3.0 → 0.6.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 +29 -27
- package/lib/browser.d.ts +7 -0
- package/lib/button/index.js +10 -11
- package/lib/color_picker/index.d.ts +13 -0
- package/lib/color_picker/index.js +44 -0
- package/lib/form/form_inner.js +26 -26
- package/lib/form/form_item.js +1 -1
- package/lib/form/index.js +1 -1
- package/lib/icon/arrow_left.d.ts +5 -0
- package/lib/icon/arrow_left.js +13 -0
- package/lib/icon/arrow_right.d.ts +5 -0
- package/lib/icon/arrow_right.js +13 -0
- package/lib/icon/arrow_up.d.ts +6 -0
- package/lib/icon/arrow_up.js +16 -0
- package/lib/icon/base.js +13 -13
- 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/icon/theme_default.d.ts +6 -0
- package/lib/icon/theme_default.js +16 -0
- package/lib/index-116dRdDj.js +4 -0
- package/lib/index-BUyxD_nH.js +4 -0
- package/lib/index-BeOxuMd4.js +4 -0
- package/lib/index-Bl8lRTJd.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-DJ70Xyma.js +4 -0
- package/lib/index-DKvzJmsR.js +4 -0
- package/lib/index.d.ts +40 -1
- package/lib/index.js +82 -36
- package/lib/input/index.d.ts +1 -1
- package/lib/input/index.js +14 -14
- package/lib/list/index.js +1 -1
- package/lib/litos-ui.css +1 -1
- package/lib/litos-ui.min.js +1 -1
- package/lib/message/index.js +32 -32
- package/lib/polygon/index.d.ts +9 -0
- package/lib/polygon/index.js +30 -0
- package/lib/popover/index.d.ts +34 -0
- package/lib/popover/index.js +153 -0
- package/lib/radio/index.d.ts +1 -0
- package/lib/radio/index.js +61 -49
- package/lib/select_ori/index.d.ts +21 -0
- package/lib/select_ori/index.js +59 -0
- package/lib/switch/index.d.ts +18 -0
- package/lib/switch/index.js +64 -0
- package/lib/tabbar/index.d.ts +50 -0
- package/lib/tabbar/index.js +186 -0
- package/lib/theme/index.d.ts +12 -0
- package/lib/theme/index.js +95 -0
- package/lib/theme/theme_color.d.ts +9 -0
- package/lib/theme/theme_color.js +40 -0
- package/lib/utils/clickoutside.d.ts +5 -0
- package/lib/utils/clickoutside.js +22 -0
- package/lib/utils/event.js +24 -0
- package/lib/utils/index.d.ts +88 -0
- package/lib/utils/index.js +139 -0
- package/lib/utils/transition.js +58 -0
- package/package.json +69 -68
- package/styles/animation.css +13 -0
- package/styles/container.css +51 -0
- package/styles/scrollbar.css +23 -0
- package/styles/transition.css +33 -0
- package/lib/index-Boq1Q7q9.js +0 -4
- package/lib/index-ColsUDnt.js +0 -4
- package/lib/transition.d.ts +0 -15
- package/lib/transition.js +0 -52
- package/lib/util.d.ts +0 -40
- package/lib/util.js +0 -56
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 | DocumentFragment): void;
|
|
33
33
|
connectedCallback(): void;
|
|
34
34
|
disconnectedCallback(): void;
|
|
35
|
-
render(): void;
|
|
35
|
+
render(): void | string | HTMLElement | HTMLElement[] | DocumentFragment;
|
|
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,45 +39,46 @@ 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-Bl8lRTJd.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"), "./popover/index.less": () => import("./index-BUyxD_nH.js"), "./radio/index.less": () => import("./index-CCcVpk6U.js"), "./select_ori/index.less": () => import("./index-C98Kx857.js"), "./switch/index.less": () => import("./index-116dRdDj.js"), "./tabbar/index.less": () => import("./index-DKvzJmsR.js"), "./theme/index.less": () => import("./index-DJ70Xyma.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() {
|
|
81
|
+
this.root.innerHTML = "", this.rendered = !1;
|
|
80
82
|
}
|
|
81
83
|
render() {
|
|
82
84
|
}
|
package/lib/browser.d.ts
CHANGED
|
@@ -7,3 +7,10 @@ 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";
|
|
15
|
+
import "./theme/index.less";
|
|
16
|
+
import "./popover/index.less";
|
package/lib/button/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var b = Object.defineProperty;
|
|
2
2
|
var h = (r, o, t) => o in r ? b(r, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[o] = t;
|
|
3
3
|
var i = (r, o, t) => h(r, typeof o != "symbol" ? o + "" : o, t);
|
|
4
|
-
import { regist as p, initAttr as g, parseAttrValue as m } from "../
|
|
4
|
+
import { regist as p, initAttr as g, parseAttrValue as m } from "../utils/index.js";
|
|
5
5
|
import u from "../base.js";
|
|
6
|
-
import { $one as y, addClass as
|
|
6
|
+
import { $one as y, addClass as A, removeClass as k, on as C, off as T, formatClass as $, formatStyle as v, getAttr as x } from "ph-utils/dom";
|
|
7
7
|
import L from "../icon/loading.js";
|
|
8
|
-
import { adjust as
|
|
8
|
+
import { adjust as c } from "ph-utils/color";
|
|
9
9
|
p(L);
|
|
10
10
|
class M extends u {
|
|
11
11
|
constructor() {
|
|
@@ -22,19 +22,18 @@ class M extends u {
|
|
|
22
22
|
}
|
|
23
23
|
// 初始化属性观察器
|
|
24
24
|
static get observedAttributes() {
|
|
25
|
-
return ["loading", "color"];
|
|
25
|
+
return ["loading", "color", "disabled"];
|
|
26
26
|
}
|
|
27
27
|
// 当属性发生变化时调用的回调函数
|
|
28
28
|
attributeChangedCallback(t, e, s) {
|
|
29
29
|
const l = y(".l-button", this.root);
|
|
30
|
-
if (l)
|
|
30
|
+
if (l)
|
|
31
31
|
if (t === "loading")
|
|
32
|
-
m(s, !1, t) ? (
|
|
32
|
+
m(s, !1, t) ? (A(l, "l-btn-loading"), l.disabled = !0, l.innerHTML = this.loadingBody()) : (k(l, "l-btn-loading"), l.disabled = this.getAttr("disabled", !1), l.innerHTML = "<slot></slot>");
|
|
33
33
|
else if (t === "color") {
|
|
34
34
|
const n = this.getAttr("text", !1), a = this.getAttr("ghost", !1);
|
|
35
35
|
l.style.cssText = this.applyColor(s, n, a);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
36
|
+
} else t === "disabled" && (l.disabled = this.getAttr("disabled", !1));
|
|
38
37
|
}
|
|
39
38
|
connectedCallback() {
|
|
40
39
|
this.loadStyle(["button"]), this.loadExternalStyle(["animation"]), this.render(), (this.htmlType === "reset" || this.htmlType === "submit") && C(this, "click", this._handleClick);
|
|
@@ -54,8 +53,8 @@ class M extends u {
|
|
|
54
53
|
s ? "l-btn-loading" : ""
|
|
55
54
|
];
|
|
56
55
|
e.className = $(f), e.disabled = this.getAttr("disabled", !1) || s, e.type = this.getAttr("html-type", "button");
|
|
57
|
-
const
|
|
58
|
-
|
|
56
|
+
const d = this.applyColor(this.getAttr("color"), n, a);
|
|
57
|
+
d && (e.style.cssText = d), s ? e.innerHTML = this.loadingBody() : e.innerHTML = "<slot></slot>", e.setAttribute("part", "default"), this.root.appendChild(e);
|
|
59
58
|
}
|
|
60
59
|
loadingBody() {
|
|
61
60
|
const t = this.getAttr("loading-text", ""), e = ['<l-loading-icon class="l-rotate-anim"></l-loading-icon>'];
|
|
@@ -63,7 +62,7 @@ class M extends u {
|
|
|
63
62
|
}
|
|
64
63
|
applyColor(t, e = !1, s = !1) {
|
|
65
64
|
if (!t) return "";
|
|
66
|
-
const l =
|
|
65
|
+
const l = c(t, 1, !0), n = c(t, 3, !1);
|
|
67
66
|
return v({
|
|
68
67
|
"--l-btn-border-color": e ? "transparent" : t,
|
|
69
68
|
"--l-btn-text-color": s || e ? t : "#ffffff",
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
constructor();
|
|
7
|
+
setValue(value: any): void;
|
|
8
|
+
connectedCallback(): void;
|
|
9
|
+
disconnectedCallback(): void;
|
|
10
|
+
render(): HTMLInputElement;
|
|
11
|
+
protected _changeDisabled(): void;
|
|
12
|
+
private _handleChange;
|
|
13
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var r = (i, t, e) => t in i ? c(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var s = (i, t, e) => r(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { $one as n, on as l, off as o } from "ph-utils/dom";
|
|
5
|
+
import h from "../form/form_inner.js";
|
|
6
|
+
import { initAttr as p, setAttrs as d } from "../utils/index.js";
|
|
7
|
+
class u extends h {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
s(this, "$picker");
|
|
11
|
+
s(this, "_value", "#000000");
|
|
12
|
+
s(this, "_handleChange", (e) => {
|
|
13
|
+
const a = e.target.value;
|
|
14
|
+
super.setValue(a), this.dispatchEvent(new CustomEvent("change", { detail: a }));
|
|
15
|
+
});
|
|
16
|
+
p(this);
|
|
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 = n("input", this.root), l(this.$picker, "change", this._handleChange);
|
|
23
|
+
}
|
|
24
|
+
disconnectedCallback() {
|
|
25
|
+
super.disconnectedCallback(), this.$picker && (o(this.$picker, "change", this._handleChange), this.$picker = void 0);
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
const e = document.createElement("input");
|
|
29
|
+
return d(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(u, "baseName", "color-picker");
|
|
42
|
+
export {
|
|
43
|
+
u as default
|
|
44
|
+
};
|
package/lib/form/form_inner.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var e = (h,
|
|
1
|
+
var f = Object.defineProperty;
|
|
2
|
+
var m = (h, s, t) => s in h ? f(h, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[s] = t;
|
|
3
|
+
var e = (h, s, t) => m(h, typeof s != "symbol" ? s + "" : s, t);
|
|
4
4
|
import A from "../base.js";
|
|
5
|
-
import { parseAttrValue as g } from "../
|
|
6
|
-
import { add as
|
|
7
|
-
class
|
|
5
|
+
import { parseAttrValue as g } from "../utils/index.js";
|
|
6
|
+
import { add as u, remove as d, emit as b } from "./form_events.js";
|
|
7
|
+
class p extends A {
|
|
8
8
|
/**
|
|
9
9
|
*
|
|
10
10
|
* @param firstPushValue 是否第一次赋值 value 时, 推送数据到 Form, 默认: true
|
|
@@ -19,8 +19,8 @@ class I extends A {
|
|
|
19
19
|
e(this, "_resetValue");
|
|
20
20
|
e(this, "_firstPushValue", !0);
|
|
21
21
|
e(this, "_reseting", !1);
|
|
22
|
-
e(this, "_formAttributeChanged", (t,
|
|
23
|
-
i === this.formAttrs.formId ? this.formAttrs[t] =
|
|
22
|
+
e(this, "_formAttributeChanged", (t, r, i) => {
|
|
23
|
+
i === this.formAttrs.formId ? this.formAttrs[t] = r : this.formItemAttrs[t] = r, t === "disabled" && this._changeDisabled();
|
|
24
24
|
});
|
|
25
25
|
e(this, "_resetFieldValue", () => {
|
|
26
26
|
this._reseting = !0, this.reset();
|
|
@@ -42,29 +42,29 @@ class I extends A {
|
|
|
42
42
|
static get observedAttributes() {
|
|
43
43
|
return ["disabled"];
|
|
44
44
|
}
|
|
45
|
-
attributeChangedCallback(t,
|
|
45
|
+
attributeChangedCallback(t, r, i) {
|
|
46
46
|
if (t === "disabled") {
|
|
47
47
|
const l = g(i, !1, t);
|
|
48
48
|
l !== this.disabled && (this._changeDisabled(), this.disabled = l);
|
|
49
49
|
} else
|
|
50
|
-
this.attributeChange(t,
|
|
50
|
+
this.attributeChange(t, r, i);
|
|
51
51
|
}
|
|
52
|
-
attributeChange(t,
|
|
52
|
+
attributeChange(t, r, i) {
|
|
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 && (u(this.formAttrs.id, "attributeChanged", this._formAttributeChanged), u(this.formAttrs.id, "reset", this._resetFieldValue), this._firstPushValue && this.pushValueChange()), this.formItemAttrs.id && u(
|
|
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 && (d(this.formAttrs.id, "attributeChanged", this._formAttributeChanged), d(this.formAttrs.id, "reset", this._resetFieldValue)), this.formItemAttrs.id && d(
|
|
64
64
|
this.formItemAttrs.id,
|
|
65
65
|
"attributeChanged",
|
|
66
66
|
this._formAttributeChanged
|
|
67
|
-
);
|
|
67
|
+
), super.disconnectedCallback();
|
|
68
68
|
}
|
|
69
69
|
isDisabled() {
|
|
70
70
|
return this.disabled === !0 || this.formItemAttrs.disabled === !0 ? !0 : this.formAttrs.disabled || !1;
|
|
@@ -73,29 +73,29 @@ class I extends A {
|
|
|
73
73
|
return this.name ? this.name : this.formItemAttrs.name;
|
|
74
74
|
}
|
|
75
75
|
_getForm() {
|
|
76
|
-
let t = this.parentElement,
|
|
76
|
+
let t = this.parentElement, r = {}, i = {};
|
|
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
|
-
|
|
80
|
+
const n = t.sharedAttrs;
|
|
81
|
+
for (let a = 0; a < n.length; a++) {
|
|
82
|
+
const o = n[a];
|
|
83
|
+
r[o] = t[o];
|
|
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 n = t.sharedAttrs;
|
|
90
|
+
for (let a = 0; a < n.length; a++) {
|
|
91
|
+
const o = n[a];
|
|
92
|
+
i[o] = t[o];
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
t = t.parentElement;
|
|
96
96
|
}
|
|
97
97
|
return t = null, {
|
|
98
|
-
formAttr:
|
|
98
|
+
formAttr: r,
|
|
99
99
|
formItemAttr: i
|
|
100
100
|
};
|
|
101
101
|
}
|
|
@@ -117,5 +117,5 @@ class I extends A {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
export {
|
|
120
|
-
|
|
120
|
+
p as default
|
|
121
121
|
};
|
package/lib/form/form_item.js
CHANGED
|
@@ -2,7 +2,7 @@ var h = Object.defineProperty;
|
|
|
2
2
|
var m = (l, s, e) => s in l ? h(l, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[s] = e;
|
|
3
3
|
var i = (l, s, e) => m(l, typeof s != "symbol" ? s + "" : s, e);
|
|
4
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 "../
|
|
5
|
+
import { initAttr as b, parseAttrValue as p } from "../utils/index.js";
|
|
6
6
|
import v from "../base.js";
|
|
7
7
|
import { emit as d, add as _, clear as C, remove as g } from "./form_events.js";
|
|
8
8
|
import { random as n } from "ph-utils";
|
package/lib/form/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var m = (d, r, t) => r in d ? v(d, r, { enumerable: !0, configurable: !0, writab
|
|
|
3
3
|
var i = (d, r, t) => m(d, typeof r != "symbol" ? r + "" : r, t);
|
|
4
4
|
import { $one as u, formatClass as n, formatStyle as b } from "ph-utils/dom";
|
|
5
5
|
import C from "../base.js";
|
|
6
|
-
import { initAttr as g, parseAttrValue as p } from "../
|
|
6
|
+
import { initAttr as g, parseAttrValue as p } from "../utils/index.js";
|
|
7
7
|
import { random as c } from "ph-utils";
|
|
8
8
|
import { emit as l, add as f, clear as _ } from "./form_events.js";
|
|
9
9
|
import y from "ph-utils/validator";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var l = Object.defineProperty;
|
|
2
|
+
var o = (e, a, r) => a in e ? l(e, a, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[a] = r;
|
|
3
|
+
var t = (e, a, r) => o(e, typeof a != "symbol" ? a + "" : a, r);
|
|
4
|
+
import n from "./base.js";
|
|
5
|
+
class s extends n {
|
|
6
|
+
renderChildren() {
|
|
7
|
+
return '<path fill="currentColor" d="M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"></path>';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
t(s, "baseName", "arrow-left-icon");
|
|
11
|
+
export {
|
|
12
|
+
s as default
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var o = Object.defineProperty;
|
|
2
|
+
var n = (r, a, e) => a in r ? o(r, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[a] = e;
|
|
3
|
+
var t = (r, a, e) => n(r, typeof a != "symbol" ? a + "" : a, e);
|
|
4
|
+
import s from "./base.js";
|
|
5
|
+
class i extends s {
|
|
6
|
+
renderChildren() {
|
|
7
|
+
return '<path fill="currentColor" d="M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"></path>';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
t(i, "baseName", "arrow-right-icon");
|
|
11
|
+
export {
|
|
12
|
+
i as default
|
|
13
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
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 l = (e, a, r) => c(e, typeof a != "symbol" ? a + "" : a, r);
|
|
4
|
+
import n from "./base.js";
|
|
5
|
+
class o extends n {
|
|
6
|
+
connectedCallback() {
|
|
7
|
+
super.connectedCallback();
|
|
8
|
+
}
|
|
9
|
+
renderChildren() {
|
|
10
|
+
return '<path fill="currentColor" d="m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"></path>';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
l(o, "baseName", "arrow-up-icon");
|
|
14
|
+
export {
|
|
15
|
+
o as default
|
|
16
|
+
};
|
package/lib/icon/base.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var u = Object.defineProperty;
|
|
2
|
-
var p = (
|
|
3
|
-
var n = (
|
|
2
|
+
var p = (s, t, e) => t in s ? u(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
|
+
var n = (s, t, e) => p(s, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
import w from "../base.js";
|
|
5
5
|
class v extends w {
|
|
6
6
|
constructor() {
|
|
@@ -10,24 +10,24 @@ class v extends w {
|
|
|
10
10
|
this.useLink = !1, this.viewBox = "0 0 1024 1024";
|
|
11
11
|
}
|
|
12
12
|
connectedCallback() {
|
|
13
|
-
this.loadStyle(["icon"]), this.render();
|
|
13
|
+
this.loadStyle(["icon"]), this.render(), this.rendered = !0;
|
|
14
14
|
}
|
|
15
15
|
render() {
|
|
16
|
-
const e = this.createEl("svg"), h = this.getAttr("useLink", this.useLink),
|
|
17
|
-
e.classList.add("l-icon"), h || e.setAttribute("viewBox",
|
|
18
|
-
const
|
|
19
|
-
if (typeof
|
|
20
|
-
if (
|
|
16
|
+
const e = this.createEl("svg"), h = this.getAttr("useLink", this.useLink), l = this.getAttr("viewBox", this.viewBox);
|
|
17
|
+
e.classList.add("l-icon"), h || e.setAttribute("viewBox", l);
|
|
18
|
+
const i = this.renderChildren();
|
|
19
|
+
if (typeof i == "string")
|
|
20
|
+
if (i === "") {
|
|
21
21
|
const o = this.children, c = [];
|
|
22
|
-
for (let r = 0,
|
|
23
|
-
const
|
|
24
|
-
c.push(
|
|
22
|
+
for (let r = 0, d = o.length; r < d; r++) {
|
|
23
|
+
const a = o[r];
|
|
24
|
+
c.push(a.outerHTML);
|
|
25
25
|
}
|
|
26
26
|
e.innerHTML = c.join("");
|
|
27
27
|
} else
|
|
28
|
-
e.innerHTML =
|
|
28
|
+
e.innerHTML = i;
|
|
29
29
|
else
|
|
30
|
-
e.append(
|
|
30
|
+
e.append(i);
|
|
31
31
|
this.shadow.appendChild(e);
|
|
32
32
|
}
|
|
33
33
|
renderChildren() {
|
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
|
+
};
|