litos-ui 0.10.0 → 0.11.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 +4 -0
- package/lib/base.js +13 -7
- package/lib/button/index.js +1 -1
- 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 +89 -75
- package/lib/input/index.js +1 -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.js +3 -3
- 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.js
CHANGED
|
@@ -3,7 +3,7 @@ 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: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)}";
|
|
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;font-size:0}.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: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)}";
|
|
7
7
|
class w extends d {
|
|
8
8
|
static baseName = "button";
|
|
9
9
|
htmlType = "button";
|
|
@@ -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), 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,79 +1,93 @@
|
|
|
1
|
-
import { config as t, createTransition as r, getPopoverOffsetX as a, getPopoverOffsetY as f, impactDetect as s, initAttr as m, parseAttrValue as p, regist as
|
|
2
|
-
import { set as
|
|
1
|
+
import { config as t, createTransition as r, getPopoverOffsetX as a, getPopoverOffsetY as f, impactDetect as s, initAttr as m, parseAttrValue as p, regist as l, setAttrs as u, tagAttr as d, tagAttrs as x, useId as n } from "./utils/index.js";
|
|
2
|
+
import { set as I, remove as i } from "./utils/clickoutside.js";
|
|
3
3
|
import { default as h } from "./base.js";
|
|
4
|
-
import { default as
|
|
4
|
+
import { default as A } from "./message/index.js";
|
|
5
5
|
import { default as P } from "./popover/index.js";
|
|
6
|
-
import { default as
|
|
7
|
-
import { default as
|
|
8
|
-
import { default as
|
|
9
|
-
import { default as
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as M } from "./icon/
|
|
12
|
-
import { default as U } from "./icon/
|
|
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 _ } from "./icon/
|
|
21
|
-
import { default as oo } from "./icon/
|
|
22
|
-
import { default as to } from "./icon/
|
|
23
|
-
import { default as ao } from "./icon/
|
|
24
|
-
import { default as so } from "./
|
|
25
|
-
import { default as po } from "./
|
|
26
|
-
import { default as
|
|
27
|
-
import { default as no } from "./
|
|
28
|
-
import { default as
|
|
29
|
-
import { default as go } from "./
|
|
30
|
-
import { default as
|
|
31
|
-
import { default as wo } from "./
|
|
32
|
-
import { default as Ro } from "./
|
|
33
|
-
import { default as
|
|
34
|
-
import { default as
|
|
35
|
-
import { default as
|
|
36
|
-
import { default as
|
|
37
|
-
import { default as Fo } from "./
|
|
38
|
-
import { default as yo } from "./
|
|
6
|
+
import { default as S } from "./popconfirm/index.js";
|
|
7
|
+
import { default as v } from "./dialog/index.js";
|
|
8
|
+
import { default as L } from "./dialog/dialog_container.js";
|
|
9
|
+
import { default as k } from "./loading/index.js";
|
|
10
|
+
import { default as b } from "./icon/base.js";
|
|
11
|
+
import { default as M } from "./icon/arrow_down.js";
|
|
12
|
+
import { default as U } from "./icon/arrow_left.js";
|
|
13
|
+
import { default as W } from "./icon/arrow_right.js";
|
|
14
|
+
import { default as Y } from "./icon/arrow_up.js";
|
|
15
|
+
import { default as q } from "./icon/caret_top.js";
|
|
16
|
+
import { default as E } from "./icon/caret_bottom.js";
|
|
17
|
+
import { default as H } from "./icon/font_icon.js";
|
|
18
|
+
import { default as K } from "./icon/loading.js";
|
|
19
|
+
import { default as Q } from "./icon/search.js";
|
|
20
|
+
import { default as _ } from "./icon/sun.js";
|
|
21
|
+
import { default as oo } from "./icon/moon.js";
|
|
22
|
+
import { default as to } from "./icon/reduction.js";
|
|
23
|
+
import { default as ao } from "./icon/refresh_left.js";
|
|
24
|
+
import { default as so } from "./icon/refresh_right.js";
|
|
25
|
+
import { default as po } from "./icon/sort.js";
|
|
26
|
+
import { default as uo } from "./icon/theme_default.js";
|
|
27
|
+
import { default as no } from "./icon/close.js";
|
|
28
|
+
import { default as Io } from "./icon/info.js";
|
|
29
|
+
import { default as go } from "./icon/success.js";
|
|
30
|
+
import { default as Co } from "./icon/warn.js";
|
|
31
|
+
import { default as wo } from "./form/index.js";
|
|
32
|
+
import { default as Ro } from "./form/form_item.js";
|
|
33
|
+
import { default as To } from "./radio/index.js";
|
|
34
|
+
import { default as Do } from "./checkbox/index.js";
|
|
35
|
+
import { default as Oo } from "./button/index.js";
|
|
36
|
+
import { default as Bo } from "./input/index.js";
|
|
37
|
+
import { default as Fo } from "./select_ori/index.js";
|
|
38
|
+
import { default as yo } from "./switch/index.js";
|
|
39
|
+
import { default as Vo } from "./md_input/index.js";
|
|
40
|
+
import { default as Xo } from "./list/index.js";
|
|
41
|
+
import { default as jo } from "./polygon/index.js";
|
|
42
|
+
import { default as zo } from "./color_picker/index.js";
|
|
43
|
+
import { default as Go } from "./tabbar/index.js";
|
|
44
|
+
import { default as Jo } from "./theme/index.js";
|
|
45
|
+
import { default as No } from "./theme/theme_color.js";
|
|
39
46
|
export {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
M as ArrowDownIcon,
|
|
48
|
+
U as ArrowLeftIcon,
|
|
49
|
+
W as ArrowRightIcon,
|
|
50
|
+
Y as ArrowUpIcon,
|
|
44
51
|
h as BaseComponent,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
b as BaseIcon,
|
|
53
|
+
Oo as Button,
|
|
54
|
+
E as CaretBottomIcon,
|
|
55
|
+
q as CaretTopIcon,
|
|
56
|
+
Do as Checkbox,
|
|
57
|
+
no as CloseIcon,
|
|
58
|
+
zo as ColorPicker,
|
|
59
|
+
v as Dialog,
|
|
60
|
+
L as DialogContainer,
|
|
61
|
+
H as FontIcon,
|
|
62
|
+
wo as Form,
|
|
63
|
+
Ro as FormItem,
|
|
64
|
+
Io as InfoIcon,
|
|
65
|
+
Bo as Input,
|
|
66
|
+
Xo as List,
|
|
67
|
+
k as Loading,
|
|
68
|
+
K as LoadingIcon,
|
|
69
|
+
Vo as MdInput,
|
|
70
|
+
A as Message,
|
|
71
|
+
oo as MoonIcon,
|
|
72
|
+
jo as Polygon,
|
|
73
|
+
S as Popconfirm,
|
|
62
74
|
P as Popover,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
To as Radio,
|
|
76
|
+
to as ReductionIcon,
|
|
77
|
+
ao as RefreshLeftIcon,
|
|
78
|
+
so as RefreshRightIcon,
|
|
79
|
+
Q as SearchIcon,
|
|
80
|
+
Fo as SelectOri,
|
|
81
|
+
po as SortIcon,
|
|
82
|
+
go as SuccessIcon,
|
|
83
|
+
_ as SunIcon,
|
|
84
|
+
yo as Switch,
|
|
85
|
+
Go as Tabbar,
|
|
86
|
+
Jo as Theme,
|
|
87
|
+
No as ThemeColor,
|
|
88
|
+
uo as ThemeDefaultIcon,
|
|
89
|
+
Co as WarnIcon,
|
|
90
|
+
I as addClickOutside,
|
|
77
91
|
t as config,
|
|
78
92
|
r as createTransition,
|
|
79
93
|
a as getPopoverOffsetX,
|
|
@@ -81,10 +95,10 @@ export {
|
|
|
81
95
|
s as impactDetect,
|
|
82
96
|
m as initAttr,
|
|
83
97
|
p as parseAttrValue,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
98
|
+
l as regist,
|
|
99
|
+
i as removeClickOutside,
|
|
100
|
+
u as setAttrs,
|
|
101
|
+
d as tagAttr,
|
|
88
102
|
x as tagAttrs,
|
|
89
103
|
n as useId
|
|
90
104
|
};
|
package/lib/input/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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";
|
package/lib/list/index.d.ts
CHANGED