litos-ui 0.20.1 → 0.21.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/dialog/dialog_box.js +1 -1
- package/lib/dialog/dialog_container.d.ts +1 -1
- package/lib/dialog/dialog_container.js +156 -2
- package/lib/dialog/dialog_container_style.d.ts +2 -0
- package/lib/dialog/dialog_container_style.js +2 -0
- package/lib/dialog_container_style-C1s0aBf7.js +5 -0
- package/lib/icon/arrow_down.js +1 -1
- package/lib/icon/arrow_left.js +1 -1
- package/lib/icon/arrow_right.js +1 -1
- package/lib/icon/arrow_up.js +1 -1
- package/lib/icon/base.d.ts +2 -1
- package/lib/icon/base.js +63 -2
- package/lib/icon/calendar.js +1 -1
- package/lib/icon/caret_bottom.js +1 -1
- package/lib/icon/caret_top.js +1 -1
- package/lib/icon/close.js +1 -1
- package/lib/icon/close_filled.js +1 -1
- package/lib/icon/copy.d.ts +6 -0
- package/lib/icon/copy.js +13 -0
- package/lib/icon/d_arrow_left.js +1 -1
- package/lib/icon/d_arrow_right.js +1 -1
- package/lib/icon/font_icon.js +1 -1
- package/lib/icon/icon_style.d.ts +2 -0
- package/lib/icon/icon_style.js +2 -0
- package/lib/icon/info.js +1 -1
- package/lib/icon/loading.js +1 -1
- package/lib/icon/moon.js +1 -1
- package/lib/icon/more.js +1 -1
- package/lib/icon/reduction.js +1 -1
- package/lib/icon/refresh.js +1 -1
- package/lib/icon/refresh_left.js +1 -1
- package/lib/icon/refresh_right.js +1 -1
- package/lib/icon/search.js +1 -1
- package/lib/icon/select.js +1 -1
- package/lib/icon/sort.js +1 -1
- package/lib/icon/success.js +1 -1
- package/lib/icon/sun.js +1 -1
- package/lib/icon/theme_default.js +1 -1
- package/lib/icon/warn.js +1 -1
- package/lib/icon/zoom_in.js +1 -1
- package/lib/icon/zoom_out.js +1 -1
- package/lib/icon_style-J7iiDS_a.js +5 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +66 -63
- package/lib/input_number/index.d.ts +59 -0
- package/lib/input_number/index.js +203 -0
- package/lib/input_number/style.d.ts +2 -0
- package/lib/input_number/style.js +2 -0
- package/lib/modal/modal_box.d.ts +22 -0
- package/lib/style-C5wUmE2b.js +5 -0
- package/package.json +1 -1
- package/lib/base-Dyj1rzaK.js +0 -61
- package/lib/dialog_container-BNPQ9n0V.js +0 -145
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import e from "./base.js";
|
|
2
|
-
import { $ as t, $$ as n, $one as r, formatClass as i, iterate as a, off as o, on as s, shouldEventNext as c } from "ph-utils/browser";
|
|
3
|
-
//#region src/components/dialog/dialog_container.css?inline
|
|
4
|
-
var l = ":host{display:block;position:relative}:host(.l-container-close-outside){padding-top:10px;padding-right:10px}.l-dialog-main{background-color:#fff;border-radius:5px;box-shadow:0 0 8px #0000001a}.l-dialog-header{border-bottom:1px solid var(--l-dialog-line-color,#0000000f);align-items:center;gap:5px;padding:10px;font-size:16px;font-weight:600;display:flex}.l-dialog-footer{border-top:1px solid var(--l-dialog-line-color,#0000000f);justify-content:flex-end;gap:10px;padding:10px;display:flex}.l-dialog-container{padding:15px 10px;font-size:14px}.l-btn-dialog-close{--l-form-control-height:auto;position:absolute}.l-dialog-close1{top:6px;right:5px}.l-dialog-close1::part(default){border:none;width:auto;height:auto;padding:5px;font-size:16px}.l-dialog-close2{top:0;right:0}.l-dialog-close2::part(default){background-color:#fff;width:20px;height:20px;padding:0}.l-dialog-main--mobile{border-radius:10px}.l-dialog-main--mobile .l-dialog-header{text-align:center;border-bottom-color:#0000;justify-content:center;padding:20px 10px 5px;display:flex}.l-dialog-main--mobile .l-dialog-container{text-align:center;padding:5px 15px 20px}.l-dialog-main--mobile .l-dialog-footer{text-align:center;justify-content:stretch;align-items:stretch;gap:0;height:50px;padding:0;display:flex}.l-dialog-main--mobile .l-dialog-footer l-button{flex-grow:1;height:100%}.l-dialog-main--mobile .l-dialog-footer l-button+l-button{border-left:1px solid var(--l-dialog-line-color,#0000000f)}", u = class extends e {
|
|
5
|
-
static baseName = "dialog-container";
|
|
6
|
-
constructor() {
|
|
7
|
-
super(), this.version = 2, this._state = {
|
|
8
|
-
showHeader: !0,
|
|
9
|
-
showFooter: !0,
|
|
10
|
-
showCancel: !0,
|
|
11
|
-
cancelText: "取消",
|
|
12
|
-
showOk: !0,
|
|
13
|
-
okText: "确定",
|
|
14
|
-
close: 1,
|
|
15
|
-
mobile: !1,
|
|
16
|
-
confirmLoading: !1
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
afterInit() {
|
|
20
|
-
this._state.close === 2 && this.classList.add("l-container-close-outside");
|
|
21
|
-
let e = t("[data-action]", this.root);
|
|
22
|
-
a(e, (e) => {
|
|
23
|
-
s(e, "click", this.#e);
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
beforeDestroy() {
|
|
27
|
-
let e = t("[data-action]", this.root);
|
|
28
|
-
a(e, (e) => {
|
|
29
|
-
o(e, "click", this.#e);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
#e(e) {
|
|
33
|
-
let [t, n] = c(e, "data-action");
|
|
34
|
-
t && this.dispatchEvent(new CustomEvent("dialogAction", {
|
|
35
|
-
detail: { action: n },
|
|
36
|
-
composed: !0
|
|
37
|
-
}));
|
|
38
|
-
}
|
|
39
|
-
static get observedAttributes() {
|
|
40
|
-
return [
|
|
41
|
-
"show-header",
|
|
42
|
-
"header",
|
|
43
|
-
"show-footer",
|
|
44
|
-
"show-cancel",
|
|
45
|
-
"cancel-text",
|
|
46
|
-
"show-ok",
|
|
47
|
-
"ok-text",
|
|
48
|
-
"close",
|
|
49
|
-
"container-class",
|
|
50
|
-
"mobile",
|
|
51
|
-
"confirm-loading"
|
|
52
|
-
];
|
|
53
|
-
}
|
|
54
|
-
attributeChanged(e, t, n) {
|
|
55
|
-
switch (e) {
|
|
56
|
-
case "show-header":
|
|
57
|
-
this._state.showHeader = n !== null, this.connectedCallback();
|
|
58
|
-
break;
|
|
59
|
-
case "header":
|
|
60
|
-
this._state.header = n || void 0, this.connectedCallback();
|
|
61
|
-
break;
|
|
62
|
-
case "show-footer":
|
|
63
|
-
this._state.showFooter = n !== null, this.connectedCallback();
|
|
64
|
-
break;
|
|
65
|
-
case "show-cancel":
|
|
66
|
-
this._state.showCancel = n !== null, this.connectedCallback();
|
|
67
|
-
break;
|
|
68
|
-
case "cancel-text":
|
|
69
|
-
this._state.cancelText = n || "取消", this.connectedCallback();
|
|
70
|
-
break;
|
|
71
|
-
case "show-ok":
|
|
72
|
-
this._state.showOk = n !== null, this.connectedCallback();
|
|
73
|
-
break;
|
|
74
|
-
case "ok-text":
|
|
75
|
-
this._state.okText = n || "确定", this.connectedCallback();
|
|
76
|
-
break;
|
|
77
|
-
case "close":
|
|
78
|
-
this._state.close = Number(n), this._state.close === 2 ? this.classList.add("l-container-close-outside") : this.classList.remove("l-container-close-outside");
|
|
79
|
-
let e = r(".l-btn-dialog-close", this.root);
|
|
80
|
-
this._state.close === 0 && e ? (o(e, "click", this.#e), e.remove()) : e ? e.className = this.#t() : (e = this.#n(), s(e, "click", this.#e), this.root.appendChild(e));
|
|
81
|
-
break;
|
|
82
|
-
case "container-class":
|
|
83
|
-
this._state.containerClass = n || void 0, this.connectedCallback();
|
|
84
|
-
break;
|
|
85
|
-
case "mobile":
|
|
86
|
-
this._state.mobile = n !== null, this.connectedCallback();
|
|
87
|
-
break;
|
|
88
|
-
case "confirm-loading":
|
|
89
|
-
this._state.confirmLoading = n !== null;
|
|
90
|
-
let t = r("[data-action=\"ok\"]", this.root);
|
|
91
|
-
t && t.setAttribute("loading", this._state.confirmLoading.toString());
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
#t() {
|
|
95
|
-
return `l-btn-dialog-close l-dialog-close${this._state.close}`;
|
|
96
|
-
}
|
|
97
|
-
#n() {
|
|
98
|
-
let e = n("l-button", {
|
|
99
|
-
shape: "circle",
|
|
100
|
-
type: "normal",
|
|
101
|
-
class: this.#t(),
|
|
102
|
-
"data-action": "close"
|
|
103
|
-
}), t = n("l-close-icon");
|
|
104
|
-
return e.appendChild(t), e;
|
|
105
|
-
}
|
|
106
|
-
render_v2() {
|
|
107
|
-
return {
|
|
108
|
-
style: l,
|
|
109
|
-
template: this.render()
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
render() {
|
|
113
|
-
let e = document.createDocumentFragment();
|
|
114
|
-
this._state.close !== 0 && e.appendChild(this.#n());
|
|
115
|
-
let t = n("div", { class: ["l-dialog-main", this._state.mobile ? "l-dialog-main--mobile" : ""] });
|
|
116
|
-
if (this._state.showHeader) {
|
|
117
|
-
let e = n("header", { class: "l-dialog-header" }), r = n("slot", { name: "header" });
|
|
118
|
-
r.textContent = this._state.header || "", e.appendChild(r), t.appendChild(e);
|
|
119
|
-
}
|
|
120
|
-
let r = n("div", { class: i(["l-dialog-container", this._state.containerClass]) }), a = n("slot");
|
|
121
|
-
if (r.appendChild(a), t.appendChild(r), this._state.showFooter) {
|
|
122
|
-
let e = n("div", { class: "l-dialog-footer" }), r = n("slot", { name: "footer" });
|
|
123
|
-
if (this._state.showCancel) {
|
|
124
|
-
let e = n("l-button", {
|
|
125
|
-
"data-action": "cancel",
|
|
126
|
-
text: this._state.mobile
|
|
127
|
-
});
|
|
128
|
-
e.textContent = this._state.cancelText, r.appendChild(e);
|
|
129
|
-
}
|
|
130
|
-
if (this._state.showOk) {
|
|
131
|
-
let e = n("l-button", {
|
|
132
|
-
type: "primary",
|
|
133
|
-
"data-action": "ok",
|
|
134
|
-
loading: this._state.confirmLoading,
|
|
135
|
-
text: this._state.mobile
|
|
136
|
-
});
|
|
137
|
-
e.textContent = this._state.okText, r.appendChild(e);
|
|
138
|
-
}
|
|
139
|
-
e.appendChild(r), t.appendChild(e);
|
|
140
|
-
}
|
|
141
|
-
return e.appendChild(t), e;
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
//#endregion
|
|
145
|
-
export { u as t };
|