litos-ui 0.10.0 → 0.11.1
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 +4 -0
- package/lib/base.js +13 -7
- package/lib/button/index.d.ts +1 -0
- package/lib/button/index.js +2 -2
- package/lib/dialog/dialog_container.d.ts +28 -0
- package/lib/dialog/dialog_container.js +100 -0
- package/lib/dialog/index.d.ts +30 -0
- package/lib/dialog/index.js +86 -0
- package/lib/icon/close.d.ts +5 -0
- package/lib/icon/close.js +10 -0
- package/lib/index.d.ts +16 -2
- package/lib/index.js +98 -85
- package/lib/input/index.d.ts +1 -0
- package/lib/input/index.js +2 -1
- package/lib/list/index.d.ts +1 -1
- package/lib/litos-ui.css +1 -1
- package/lib/loading/index.d.ts +40 -0
- package/lib/loading/index.js +135 -0
- package/lib/radio/index.js +1 -1
- package/lib/utils/index.d.ts +0 -5
- package/lib/utils/index.js +56 -63
- package/package.json +71 -72
- package/styles/dialog.css +56 -0
- package/styles/loading.css +100 -0
- package/styles/reset.css +10 -0
- package/lib/litos-ui.min.js +0 -1
package/lib/base.d.ts
CHANGED
|
@@ -31,4 +31,8 @@ export default class BaseComponent extends HTMLElement {
|
|
|
31
31
|
connectedCallback(): void;
|
|
32
32
|
disconnectedCallback(): void;
|
|
33
33
|
render(): void | string | HTMLElement | HTMLElement[] | DocumentFragment;
|
|
34
|
+
/** 初始化事件 */
|
|
35
|
+
initEvents(): void;
|
|
36
|
+
/** 移除事件 */
|
|
37
|
+
removeEvents(): void;
|
|
34
38
|
}
|
package/lib/base.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getAttr as
|
|
2
|
-
class
|
|
1
|
+
import { getAttr as n } from "ph-utils/dom";
|
|
2
|
+
class i extends HTMLElement {
|
|
3
3
|
static baseName = "base-component";
|
|
4
4
|
/** 组件是否渲染完成, 是否已经调用 connectedCallback */
|
|
5
5
|
rendered = !1;
|
|
@@ -13,7 +13,7 @@ class a extends HTMLElement {
|
|
|
13
13
|
return [];
|
|
14
14
|
}
|
|
15
15
|
// 当属性发生变化时调用的回调函数
|
|
16
|
-
attributeChangedCallback(t, e,
|
|
16
|
+
attributeChangedCallback(t, e, o) {
|
|
17
17
|
}
|
|
18
18
|
get shadow() {
|
|
19
19
|
return this.shadowRoot;
|
|
@@ -34,7 +34,7 @@ class a extends HTMLElement {
|
|
|
34
34
|
Array.isArray(e) && (e = e.join("")), this.createStyle(e);
|
|
35
35
|
}
|
|
36
36
|
getAttr(t, e) {
|
|
37
|
-
return
|
|
37
|
+
return n(this, t, e);
|
|
38
38
|
}
|
|
39
39
|
appendToRoot(t) {
|
|
40
40
|
if (t)
|
|
@@ -44,14 +44,20 @@ class a extends HTMLElement {
|
|
|
44
44
|
} else t.length ? this.root.append(...t) : this.root.append(t);
|
|
45
45
|
}
|
|
46
46
|
connectedCallback() {
|
|
47
|
-
this.appendToRoot(this.render()), this.rendered = !0;
|
|
47
|
+
this.appendToRoot(this.render()), this.initEvents(), this.rendered = !0;
|
|
48
48
|
}
|
|
49
49
|
disconnectedCallback() {
|
|
50
|
-
this.root.innerHTML = "", this.rendered = !1;
|
|
50
|
+
this.removeEvents(), this.root.innerHTML = "", this.rendered = !1;
|
|
51
51
|
}
|
|
52
52
|
render() {
|
|
53
53
|
}
|
|
54
|
+
/** 初始化事件 */
|
|
55
|
+
initEvents() {
|
|
56
|
+
}
|
|
57
|
+
/** 移除事件 */
|
|
58
|
+
removeEvents() {
|
|
59
|
+
}
|
|
54
60
|
}
|
|
55
61
|
export {
|
|
56
|
-
|
|
62
|
+
i as default
|
|
57
63
|
};
|
package/lib/button/index.d.ts
CHANGED
package/lib/button/index.js
CHANGED
|
@@ -3,9 +3,10 @@ import d from "../base.js";
|
|
|
3
3
|
import { $one as h, addClass as g, removeClass as p, on as v, off as f, formatClass as u, formatStyle as m, getAttr as k } from "ph-utils/dom";
|
|
4
4
|
import { adjust as b } from "ph-utils/color";
|
|
5
5
|
import { a as x } from "../animation-DttknHkX.js";
|
|
6
|
-
const y = ":host{--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-block;width:auto}.l-btn{width:100%;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:
|
|
6
|
+
const y = ":host{--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-block;width:auto;height:var(--l-form-edit-height, 32px);font-size:0}:host([block]){width:100%}.l-btn{width:100%;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:100%;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: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)}";
|
|
7
7
|
class w extends d {
|
|
8
8
|
static baseName = "button";
|
|
9
|
+
static tagName = "l-button";
|
|
9
10
|
htmlType = "button";
|
|
10
11
|
constructor() {
|
|
11
12
|
super(), s(this);
|
|
@@ -35,7 +36,6 @@ class w extends d {
|
|
|
35
36
|
const r = this.getAttr("type", "normal"), t = document.createElement("button"), o = this.getAttr("loading", !1), l = this.getAttr("shape", "default"), e = this.getAttr("text", !1), n = this.getAttr("ghost", !1), i = [
|
|
36
37
|
"l-btn",
|
|
37
38
|
`l-btn-${r}`,
|
|
38
|
-
this.getAttr("block", !1) ? "l-btn-block" : "",
|
|
39
39
|
l === "round" ? "l-btn-round" : "",
|
|
40
40
|
l === "circle" ? "l-btn-circle" : "",
|
|
41
41
|
n ? "l-btn-ghost" : "",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import BaseComponent from "../base";
|
|
2
|
+
export default class DialogContainer extends BaseComponent {
|
|
3
|
+
#private;
|
|
4
|
+
static baseName: string;
|
|
5
|
+
/** 是否显示标题栏 */
|
|
6
|
+
showHeader: boolean;
|
|
7
|
+
/** 头部内容 */
|
|
8
|
+
header?: string;
|
|
9
|
+
/** 是否显示底部 */
|
|
10
|
+
showFooter: boolean;
|
|
11
|
+
/** 是否显示取消按钮 */
|
|
12
|
+
showCancel: boolean;
|
|
13
|
+
/** 取消按钮文本 */
|
|
14
|
+
cancelText: string;
|
|
15
|
+
/** 是否显示确定按钮 */
|
|
16
|
+
showOk: boolean;
|
|
17
|
+
/** 确定按钮文本 */
|
|
18
|
+
okText: string;
|
|
19
|
+
/** 是否显示右上角关闭按钮, 1 - 显示在框内, 2 - 显示在框角, 0 - 不显示 */
|
|
20
|
+
showClose: number;
|
|
21
|
+
containerClass?: string;
|
|
22
|
+
connectedCallback(): void;
|
|
23
|
+
initEvents(): void;
|
|
24
|
+
removeEvents(): void;
|
|
25
|
+
static get observedAttributes(): string[] | null | undefined;
|
|
26
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
27
|
+
render(): HTMLElement[];
|
|
28
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import p from "../base.js";
|
|
2
|
+
import { $ as d, iterate as c, on as r, off as h, shouldEventNext as g, $one as f, $$ as e, formatClass as u } from "ph-utils/dom";
|
|
3
|
+
import { initAttr as x } from "../utils/index.js";
|
|
4
|
+
const C = ":host{display:block;position:relative}:host(.l-container-close-outside){padding-top:10px;padding-right:10px}.l-dialog-main{box-shadow:0 0 8px #0000001a;border-radius:5px;background-color:#fff}.l-dialog-header{padding:10px;font-size:16px;border-bottom:1px solid var(--l-dialog-line-color, rgba(0, 0, 0, .06));font-weight:600;display:flex;align-items:center;gap:5px}.l-dialog-footer{padding:10px;border-top:1px solid var(--l-dialog-line-color, rgba(0, 0, 0, .06));display:flex;justify-content:flex-end;gap:10px}.l-dialog-container{padding:15px 10px;font-size:14px}.l-btn-dialog-close{--nt-form-edit-height: auto;position:absolute}.l-dialog-close1{right:5px;top:6px}.l-dialog-close1::part(default){width:auto;height:auto;padding:5px;border:none;font-size:16px}.l-dialog-close2{right:0;top:0}.l-dialog-close2::part(default){width:20px;height:20px;padding:0;background-color:#fff}";
|
|
5
|
+
class k extends p {
|
|
6
|
+
static baseName = "dialog-container";
|
|
7
|
+
/** 是否显示标题栏 */
|
|
8
|
+
showHeader = !0;
|
|
9
|
+
/** 头部内容 */
|
|
10
|
+
header;
|
|
11
|
+
/** 是否显示底部 */
|
|
12
|
+
showFooter = !0;
|
|
13
|
+
/** 是否显示取消按钮 */
|
|
14
|
+
showCancel = !0;
|
|
15
|
+
/** 取消按钮文本 */
|
|
16
|
+
cancelText = "取消";
|
|
17
|
+
/** 是否显示确定按钮 */
|
|
18
|
+
showOk = !0;
|
|
19
|
+
/** 确定按钮文本 */
|
|
20
|
+
okText = "确定";
|
|
21
|
+
/** 是否显示右上角关闭按钮, 1 - 显示在框内, 2 - 显示在框角, 0 - 不显示 */
|
|
22
|
+
showClose = 1;
|
|
23
|
+
containerClass;
|
|
24
|
+
connectedCallback() {
|
|
25
|
+
this.loadStyleText(C), x(this), this.showClose === 2 && this.classList.add("l-container-close-outside"), super.connectedCallback();
|
|
26
|
+
}
|
|
27
|
+
initEvents() {
|
|
28
|
+
const t = d("[data-action]", this.root);
|
|
29
|
+
c(t, (o) => {
|
|
30
|
+
r(o, "click", this.#t);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
removeEvents() {
|
|
34
|
+
const t = d("[data-action]", this.root);
|
|
35
|
+
c(t, (o) => {
|
|
36
|
+
h(o, "click", this.#t);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
#t(t) {
|
|
40
|
+
const [o, i] = g(t, "data-action");
|
|
41
|
+
o && this.dispatchEvent(
|
|
42
|
+
new CustomEvent("dialogAction", {
|
|
43
|
+
detail: { action: i },
|
|
44
|
+
composed: !0
|
|
45
|
+
})
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
static get observedAttributes() {
|
|
49
|
+
return ["show-close"];
|
|
50
|
+
}
|
|
51
|
+
attributeChangedCallback(t, o, i) {
|
|
52
|
+
switch (t) {
|
|
53
|
+
case "show-close":
|
|
54
|
+
this.showClose = Number(i), this.showClose === 2 ? this.classList.add("l-container-close-outside") : this.classList.remove("l-container-close-outside");
|
|
55
|
+
let s = f(".l-btn-dialog-close", this.root);
|
|
56
|
+
this.showClose === 0 && s ? (h(s, "click", this.#t), s.remove()) : s ? s.className = this.#o() : (s = this.#e(), r(s, "click", this.#t), this.root.appendChild(s));
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
#o() {
|
|
61
|
+
return `l-btn-dialog-close l-dialog-close${this.showClose}`;
|
|
62
|
+
}
|
|
63
|
+
#e() {
|
|
64
|
+
const t = e("l-button", {
|
|
65
|
+
shape: "circle",
|
|
66
|
+
type: "normal",
|
|
67
|
+
class: this.#o(),
|
|
68
|
+
"data-action": "close"
|
|
69
|
+
}), o = e("l-close-icon");
|
|
70
|
+
return t.appendChild(o), t;
|
|
71
|
+
}
|
|
72
|
+
render() {
|
|
73
|
+
const t = [];
|
|
74
|
+
this.showClose !== 0 && t.push(this.#e());
|
|
75
|
+
const o = e("div", { class: "l-dialog-main" });
|
|
76
|
+
if (this.showHeader) {
|
|
77
|
+
const l = e("header", { class: "l-dialog-header" }), a = e("slot", { name: "header" });
|
|
78
|
+
a.textContent = this.header || "", l.appendChild(a), o.appendChild(l);
|
|
79
|
+
}
|
|
80
|
+
const i = e("div", {
|
|
81
|
+
class: u(["l-dialog-container", this.containerClass])
|
|
82
|
+
}), s = e("slot");
|
|
83
|
+
if (i.appendChild(s), o.appendChild(i), this.showFooter) {
|
|
84
|
+
const l = e("div", { class: "l-dialog-footer" }), a = e("slot", { name: "footer" });
|
|
85
|
+
if (this.showCancel) {
|
|
86
|
+
const n = e("l-button", { "data-action": "cancel" });
|
|
87
|
+
n.textContent = this.cancelText, a.appendChild(n);
|
|
88
|
+
}
|
|
89
|
+
if (this.showOk) {
|
|
90
|
+
const n = e("l-button", { type: "primary", "data-action": "ok" });
|
|
91
|
+
n.textContent = this.okText, a.appendChild(n);
|
|
92
|
+
}
|
|
93
|
+
l.appendChild(a), o.appendChild(l);
|
|
94
|
+
}
|
|
95
|
+
return t.push(o), t;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
export {
|
|
99
|
+
k as default
|
|
100
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
type DialogProps = {
|
|
2
|
+
/** 对话框在垂直方向位置 */
|
|
3
|
+
verticalAlign?: "top" | "bottom" | "middle";
|
|
4
|
+
/** css translate, 例如: 0,0,0 -> translate3d(0,0,0) */
|
|
5
|
+
translate?: string;
|
|
6
|
+
/** 对话框宽度 */
|
|
7
|
+
width?: string;
|
|
8
|
+
/** 是否在点击 esc 时关闭弹窗 */
|
|
9
|
+
escClose?: boolean;
|
|
10
|
+
/** 是否可以通过点击 mask 关闭对话框 */
|
|
11
|
+
maskClosable?: boolean;
|
|
12
|
+
/** 是否显示右上角关闭按钮, 1 - 显示在框内, 2 - 显示在框角, 0 - 不显示 */
|
|
13
|
+
showClose?: number;
|
|
14
|
+
};
|
|
15
|
+
/** 初始化对话框配置 */
|
|
16
|
+
type DialogInitialParams = DialogProps & {
|
|
17
|
+
/** dialog 节点 */
|
|
18
|
+
el: HTMLDialogElement | string;
|
|
19
|
+
/** 返回 true 表明手动调用 done 关闭 */
|
|
20
|
+
onAction?: (action: string, done: () => void) => boolean;
|
|
21
|
+
};
|
|
22
|
+
declare const Dialog: (option?: DialogInitialParams) => {
|
|
23
|
+
init: (option: DialogInitialParams) => void;
|
|
24
|
+
open: () => void;
|
|
25
|
+
close: () => void;
|
|
26
|
+
destroy: () => void;
|
|
27
|
+
setProp: (key: keyof DialogProps, value: DialogProps[keyof DialogProps]) => void;
|
|
28
|
+
setProps: (props: DialogProps) => void;
|
|
29
|
+
};
|
|
30
|
+
export default Dialog;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { $one as C, hasClass as v, addClass as s, getAttr as a, on as c, off as f, removeClass as $ } from "ph-utils/dom";
|
|
2
|
+
const D = (g) => {
|
|
3
|
+
let t, l, i;
|
|
4
|
+
function w(e) {
|
|
5
|
+
e.code === "Escape" && (e.preventDefault(), n());
|
|
6
|
+
}
|
|
7
|
+
function h(e) {
|
|
8
|
+
t.isSameNode(e.target) && i && i.maskClosable && n();
|
|
9
|
+
}
|
|
10
|
+
function p(e) {
|
|
11
|
+
const o = e.detail.action;
|
|
12
|
+
i.onAction != null && i.onAction(o, n);
|
|
13
|
+
}
|
|
14
|
+
function u(e) {
|
|
15
|
+
if (!i) {
|
|
16
|
+
let o = {
|
|
17
|
+
escClose: !0,
|
|
18
|
+
verticalAlign: "top",
|
|
19
|
+
maskClosable: !0,
|
|
20
|
+
showClose: 1,
|
|
21
|
+
...e
|
|
22
|
+
};
|
|
23
|
+
if (t = C(e.el), t) {
|
|
24
|
+
v(t, "l-dialog") || s(t, "l-dialog"), l = C("l-dialog-container", t);
|
|
25
|
+
const r = a(t, "vertical-align");
|
|
26
|
+
o.verticalAlign = r || "top", s(t, `l-dialog--vertical-${o.verticalAlign}`);
|
|
27
|
+
const m = a(t, "translate") || o.translate;
|
|
28
|
+
m && t.style.setProperty(
|
|
29
|
+
"--l-dialog-translate",
|
|
30
|
+
`translate3d(${m})`
|
|
31
|
+
);
|
|
32
|
+
const A = a(t, "width") || o.width;
|
|
33
|
+
A && t.style.setProperty("--l-dialog-width", A);
|
|
34
|
+
const d = a(t, "show-close", 1);
|
|
35
|
+
d === 2 && s(t, "l-dialog-close-outside"), l && l.setAttribute("show-close", `${d}`), o.showClose = d, c(t, "keydown", w), c(t, "click", h), l && c(l, "dialogAction", p);
|
|
36
|
+
}
|
|
37
|
+
i = o;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function b() {
|
|
41
|
+
t && (t.showModal(), s(t, "l-dialog--open"), s(document.body, "l-body--dialog-open"));
|
|
42
|
+
}
|
|
43
|
+
function n() {
|
|
44
|
+
t && v(t, "l-dialog--open") && (c(
|
|
45
|
+
t,
|
|
46
|
+
"transitionend",
|
|
47
|
+
() => {
|
|
48
|
+
t.close(), $(document.body, "l-body--dialog-open");
|
|
49
|
+
},
|
|
50
|
+
{ once: !0 }
|
|
51
|
+
), $(t, "l-dialog--open"));
|
|
52
|
+
}
|
|
53
|
+
function P() {
|
|
54
|
+
t && (n(), f(t, "keydown", w), f(t, "click", h), l && f(l, "dialogAction", p), l = void 0, t = void 0);
|
|
55
|
+
}
|
|
56
|
+
function y(e, o) {
|
|
57
|
+
if (i && (i[e] = o, t))
|
|
58
|
+
if (e === "verticalAlign") {
|
|
59
|
+
const r = t.className.replace(
|
|
60
|
+
/l-dialog--vertical-\w+/g,
|
|
61
|
+
function() {
|
|
62
|
+
return `l-dialog--vertical-${o || "top"}`;
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
t.className = r;
|
|
66
|
+
} else e === "translate" ? o ? t.style.setProperty(
|
|
67
|
+
"--l-dialog-translate",
|
|
68
|
+
`translate3d(${o})`
|
|
69
|
+
) : t.style.removeProperty("--l-dialog-translate") : e === "width" ? o ? t.style.setProperty("--l-dialog-width", o) : t.style.removeProperty("--l-dialog-width") : e === "showClose" && l && l.setAttribute("show-close", `${o}`);
|
|
70
|
+
}
|
|
71
|
+
function k(e) {
|
|
72
|
+
for (const o in e)
|
|
73
|
+
y(o, e[o]);
|
|
74
|
+
}
|
|
75
|
+
return g != null && u(g), {
|
|
76
|
+
init: u,
|
|
77
|
+
open: b,
|
|
78
|
+
close: n,
|
|
79
|
+
destroy: P,
|
|
80
|
+
setProp: y,
|
|
81
|
+
setProps: k
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
export {
|
|
85
|
+
D as default
|
|
86
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import e from "./base.js";
|
|
2
|
+
class l extends e {
|
|
3
|
+
static baseName = "close-icon";
|
|
4
|
+
renderChildren() {
|
|
5
|
+
return '<path fill="currentColor" d="M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"></path>';
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
l as default
|
|
10
|
+
};
|
package/lib/index.d.ts
CHANGED
|
@@ -4,6 +4,9 @@ export { default as BaseComponent } from "./base";
|
|
|
4
4
|
export { default as Message } from "./message";
|
|
5
5
|
export { default as Popover } from "./popover";
|
|
6
6
|
export { default as Popconfirm } from "./popconfirm";
|
|
7
|
+
export { default as Dialog } from "./dialog";
|
|
8
|
+
export { default as DialogContainer } from "./dialog/dialog_container";
|
|
9
|
+
export { default as Loading } from "./loading";
|
|
7
10
|
export { default as BaseIcon } from "./icon/base";
|
|
8
11
|
export { default as ArrowDownIcon } from "./icon/arrow_down";
|
|
9
12
|
export { default as ArrowLeftIcon } from "./icon/arrow_left";
|
|
@@ -21,6 +24,10 @@ export { default as RefreshLeftIcon } from "./icon/refresh_left";
|
|
|
21
24
|
export { default as RefreshRightIcon } from "./icon/refresh_right";
|
|
22
25
|
export { default as SortIcon } from "./icon/sort";
|
|
23
26
|
export { default as ThemeDefaultIcon } from "./icon/theme_default";
|
|
27
|
+
export { default as CloseIcon } from "./icon/close";
|
|
28
|
+
export { default as InfoIcon } from "./icon/info";
|
|
29
|
+
export { default as SuccessIcon } from "./icon/success";
|
|
30
|
+
export { default as WarnIcon } from "./icon/warn";
|
|
24
31
|
export { default as Form } from "./form";
|
|
25
32
|
export { default as FormItem } from "./form/form_item";
|
|
26
33
|
export { default as Radio } from "./radio";
|
|
@@ -29,19 +36,22 @@ export { default as Button } from "./button";
|
|
|
29
36
|
export { default as Input } from "./input";
|
|
30
37
|
export { default as SelectOri } from "./select_ori";
|
|
31
38
|
export { default as Switch } from "./switch";
|
|
39
|
+
export { default as MdInput } from "./md_input";
|
|
32
40
|
export { default as List } from "./list";
|
|
33
41
|
export { default as Polygon } from "./polygon";
|
|
34
42
|
export { default as ColorPicker } from "./color_picker";
|
|
35
43
|
export { default as Tabbar } from "./tabbar";
|
|
36
44
|
export { default as Theme } from "./theme";
|
|
37
45
|
export { default as ThemeColor } from "./theme/theme_color";
|
|
38
|
-
export { default as MdInput } from "./md_input";
|
|
39
46
|
|
|
40
47
|
declare global {
|
|
41
48
|
interface HTMLElementTagNameMap {
|
|
42
49
|
"l-base-component": import("./base").default
|
|
43
50
|
"l-popover": import("./popover").default
|
|
44
51
|
"l-popconfirm": import("./popconfirm").default
|
|
52
|
+
"l-dialog": import("./dialog").default
|
|
53
|
+
"l-dialog-container": import("./dialog/dialog_container").default
|
|
54
|
+
"l-loading": import("./loading").default
|
|
45
55
|
"l-base-icon": import("./icon/base").default
|
|
46
56
|
"l-arrow-down-icon": import("./icon/arrow_down").default
|
|
47
57
|
"l-arrow-left-icon": import("./icon/arrow_left").default
|
|
@@ -59,6 +69,10 @@ declare global {
|
|
|
59
69
|
"l-refresh-right-icon": import("./icon/refresh_right").default
|
|
60
70
|
"l-sort-icon": import("./icon/sort").default
|
|
61
71
|
"l-theme-default-icon": import("./icon/theme_default").default
|
|
72
|
+
"l-close-icon": import("./icon/close").default
|
|
73
|
+
"l-info-icon": import("./icon/info").default
|
|
74
|
+
"l-success-icon": import("./icon/success").default
|
|
75
|
+
"l-warn-icon": import("./icon/warn").default
|
|
62
76
|
"l-form": import("./form").default
|
|
63
77
|
"l-form-item": import("./form/form_item").default
|
|
64
78
|
"l-radio": import("./radio").default
|
|
@@ -67,12 +81,12 @@ declare global {
|
|
|
67
81
|
"l-input": import("./input").default
|
|
68
82
|
"l-select-ori": import("./select_ori").default
|
|
69
83
|
"l-switch": import("./switch").default
|
|
84
|
+
"l-md-input": import("./md_input").default
|
|
70
85
|
"l-list": import("./list").default
|
|
71
86
|
"l-polygon": import("./polygon").default
|
|
72
87
|
"l-color-picker": import("./color_picker").default
|
|
73
88
|
"l-tabbar": import("./tabbar").default
|
|
74
89
|
"l-theme": import("./theme").default
|
|
75
90
|
"l-theme-color": import("./theme/theme_color").default
|
|
76
|
-
"l-md-input": import("./md_input").default
|
|
77
91
|
}
|
|
78
92
|
}
|
package/lib/index.js
CHANGED
|
@@ -1,90 +1,103 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { set as
|
|
3
|
-
import { default as
|
|
1
|
+
import { createTransition as t, getPopoverOffsetX as r, getPopoverOffsetY as a, impactDetect as f, initAttr as s, parseAttrValue as m, regist as p, setAttrs as l, tagAttr as u, tagAttrs as d, useId as x } from "./utils/index.js";
|
|
2
|
+
import { set as c, remove as I } from "./utils/clickoutside.js";
|
|
3
|
+
import { default as g } from "./base.js";
|
|
4
4
|
import { default as C } from "./message/index.js";
|
|
5
|
-
import { default as
|
|
6
|
-
import { default as
|
|
7
|
-
import { default as
|
|
8
|
-
import { default as
|
|
9
|
-
import { default as
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
import { default as
|
|
16
|
-
import { default as
|
|
17
|
-
import { default as
|
|
18
|
-
import { default as
|
|
19
|
-
import { default as
|
|
20
|
-
import { default as
|
|
21
|
-
import { default as
|
|
22
|
-
import { default as
|
|
23
|
-
import { default as
|
|
24
|
-
import { default as
|
|
25
|
-
import { default as
|
|
26
|
-
import { default as lo } from "./
|
|
27
|
-
import { default as
|
|
28
|
-
import { default as
|
|
29
|
-
import { default as
|
|
30
|
-
import { default as
|
|
31
|
-
import { default as
|
|
32
|
-
import { default as
|
|
33
|
-
import { default as
|
|
34
|
-
import { default as
|
|
35
|
-
import { default as
|
|
36
|
-
import { default as
|
|
37
|
-
import { default as
|
|
38
|
-
import { default as
|
|
5
|
+
import { default as w } from "./popover/index.js";
|
|
6
|
+
import { default as R } from "./popconfirm/index.js";
|
|
7
|
+
import { default as T } from "./dialog/index.js";
|
|
8
|
+
import { default as D } from "./dialog/dialog_container.js";
|
|
9
|
+
import { default as O } from "./loading/index.js";
|
|
10
|
+
import { default as B } from "./icon/base.js";
|
|
11
|
+
import { default as F } from "./icon/arrow_down.js";
|
|
12
|
+
import { default as y } from "./icon/arrow_left.js";
|
|
13
|
+
import { default as V } from "./icon/arrow_right.js";
|
|
14
|
+
import { default as X } from "./icon/arrow_up.js";
|
|
15
|
+
import { default as j } from "./icon/caret_top.js";
|
|
16
|
+
import { default as z } from "./icon/caret_bottom.js";
|
|
17
|
+
import { default as G } from "./icon/font_icon.js";
|
|
18
|
+
import { default as J } from "./icon/loading.js";
|
|
19
|
+
import { default as N } from "./icon/search.js";
|
|
20
|
+
import { default as Z } from "./icon/sun.js";
|
|
21
|
+
import { default as $ } from "./icon/moon.js";
|
|
22
|
+
import { default as eo } from "./icon/reduction.js";
|
|
23
|
+
import { default as ro } from "./icon/refresh_left.js";
|
|
24
|
+
import { default as fo } from "./icon/refresh_right.js";
|
|
25
|
+
import { default as mo } from "./icon/sort.js";
|
|
26
|
+
import { default as lo } from "./icon/theme_default.js";
|
|
27
|
+
import { default as xo } from "./icon/close.js";
|
|
28
|
+
import { default as co } from "./icon/info.js";
|
|
29
|
+
import { default as io } from "./icon/success.js";
|
|
30
|
+
import { default as ho } from "./icon/warn.js";
|
|
31
|
+
import { default as Ao } from "./form/index.js";
|
|
32
|
+
import { default as Po } from "./form/form_item.js";
|
|
33
|
+
import { default as So } from "./radio/index.js";
|
|
34
|
+
import { default as vo } from "./checkbox/index.js";
|
|
35
|
+
import { default as Lo } from "./button/index.js";
|
|
36
|
+
import { default as ko } from "./input/index.js";
|
|
37
|
+
import { default as bo } from "./select_ori/index.js";
|
|
38
|
+
import { default as Mo } from "./switch/index.js";
|
|
39
|
+
import { default as Uo } from "./md_input/index.js";
|
|
40
|
+
import { default as Wo } from "./list/index.js";
|
|
41
|
+
import { default as Yo } from "./polygon/index.js";
|
|
42
|
+
import { default as qo } from "./color_picker/index.js";
|
|
43
|
+
import { default as Eo } from "./tabbar/index.js";
|
|
44
|
+
import { default as Ho } from "./theme/index.js";
|
|
45
|
+
import { default as Ko } from "./theme/theme_color.js";
|
|
39
46
|
export {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
47
|
+
F as ArrowDownIcon,
|
|
48
|
+
y as ArrowLeftIcon,
|
|
49
|
+
V as ArrowRightIcon,
|
|
50
|
+
X as ArrowUpIcon,
|
|
51
|
+
g as BaseComponent,
|
|
52
|
+
B as BaseIcon,
|
|
53
|
+
Lo as Button,
|
|
54
|
+
z as CaretBottomIcon,
|
|
55
|
+
j as CaretTopIcon,
|
|
56
|
+
vo as Checkbox,
|
|
57
|
+
xo as CloseIcon,
|
|
58
|
+
qo as ColorPicker,
|
|
59
|
+
T as Dialog,
|
|
60
|
+
D as DialogContainer,
|
|
61
|
+
G as FontIcon,
|
|
62
|
+
Ao as Form,
|
|
63
|
+
Po as FormItem,
|
|
64
|
+
co as InfoIcon,
|
|
65
|
+
ko as Input,
|
|
66
|
+
Wo as List,
|
|
67
|
+
O as Loading,
|
|
68
|
+
J as LoadingIcon,
|
|
69
|
+
Uo as MdInput,
|
|
58
70
|
C as Message,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
71
|
+
$ as MoonIcon,
|
|
72
|
+
Yo as Polygon,
|
|
73
|
+
R as Popconfirm,
|
|
74
|
+
w as Popover,
|
|
75
|
+
So as Radio,
|
|
76
|
+
eo as ReductionIcon,
|
|
77
|
+
ro as RefreshLeftIcon,
|
|
78
|
+
fo as RefreshRightIcon,
|
|
79
|
+
N as SearchIcon,
|
|
80
|
+
bo as SelectOri,
|
|
81
|
+
mo as SortIcon,
|
|
82
|
+
io as SuccessIcon,
|
|
83
|
+
Z as SunIcon,
|
|
84
|
+
Mo as Switch,
|
|
85
|
+
Eo as Tabbar,
|
|
86
|
+
Ho as Theme,
|
|
87
|
+
Ko as ThemeColor,
|
|
88
|
+
lo as ThemeDefaultIcon,
|
|
89
|
+
ho as WarnIcon,
|
|
90
|
+
c as addClickOutside,
|
|
91
|
+
t as createTransition,
|
|
92
|
+
r as getPopoverOffsetX,
|
|
93
|
+
a as getPopoverOffsetY,
|
|
94
|
+
f as impactDetect,
|
|
95
|
+
s as initAttr,
|
|
96
|
+
m as parseAttrValue,
|
|
97
|
+
p as regist,
|
|
85
98
|
I as removeClickOutside,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
99
|
+
l as setAttrs,
|
|
100
|
+
u as tagAttr,
|
|
101
|
+
d as tagAttrs,
|
|
102
|
+
x as useId
|
|
90
103
|
};
|
package/lib/input/index.d.ts
CHANGED
package/lib/input/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { off as u, formatClass as o, $one as h, on as p, formatStyle as d, addClass as c, removeClass as f } from "ph-utils/dom";
|
|
2
|
-
import { initAttr as m,
|
|
2
|
+
import { initAttr as m, parseAttrValue as g, tagAttr as n } from "../utils/index.js";
|
|
3
3
|
import v from "../form/form_inner.js";
|
|
4
4
|
import { remove as $, add as b } from "../utils/event.js";
|
|
5
5
|
import { i as _ } from "../index-391POYEJ.js";
|
|
6
6
|
class S extends v {
|
|
7
7
|
static baseName = "input";
|
|
8
|
+
static tagName = "l-input";
|
|
8
9
|
/** 原生 input 的 type */
|
|
9
10
|
type = "text";
|
|
10
11
|
placeholder = void 0;
|