litos-ui 0.20.0 → 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/{animation-DStAHzod.js → animation-Bo4jbSGK.js} +4 -3
- package/lib/base.d.ts +3 -2
- package/lib/base.js +7 -7
- package/lib/button/index.d.ts +2 -2
- package/lib/button/index.js +152 -2
- package/lib/button/style.d.ts +2 -0
- package/lib/button/style.js +2 -0
- package/lib/calendar/index.d.ts +2 -2
- package/lib/card/index.d.ts +23 -0
- package/lib/card/index.js +2 -0
- package/lib/card-3DM-lJQV.js +63 -0
- package/lib/date_picker/index.d.ts +2 -2
- package/lib/dialog/dialog_box.d.ts +22 -0
- package/lib/dialog/dialog_box.js +98 -0
- package/lib/dialog/dialog_container.d.ts +7 -3
- 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/index.d.ts +33 -11
- package/lib/dialog/index.js +45 -47
- package/lib/dialog_container_style-C1s0aBf7.js +5 -0
- package/lib/form/form_item.d.ts +2 -2
- package/lib/form/form_item.js +1 -1
- package/lib/{form_item-CFIkfH29.js → form_item-BqPMRABd.js} +5 -5
- 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 +3 -2
- 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 +5 -0
- package/lib/index.js +74 -69
- package/lib/input/index.d.ts +2 -2
- 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/list/index.js +1 -1
- package/lib/{list-Dg5u5dgr.js → list-MG8PRzos.js} +2 -2
- package/lib/mask-Ox6CoyFB.js +5 -0
- package/lib/menu/index.d.ts +2 -2
- package/lib/modal/index.d.ts +2 -2
- package/lib/modal/index.js +1 -1
- package/lib/modal/modal_box.d.ts +22 -0
- package/lib/modal/modal_box.js +12 -12
- package/lib/{modal-iwxqmAqW.js → modal-Cwi3qlEf.js} +36 -32
- package/lib/pagination/index.d.ts +2 -2
- package/lib/qrcode/index.d.ts +2 -2
- package/lib/select/index.d.ts +2 -2
- package/lib/select_ori/index.d.ts +2 -2
- package/lib/style-C5wUmE2b.js +5 -0
- package/lib/style-gKR_qwzm.js +5 -0
- package/lib/styles/animation/index.d.ts +2 -0
- package/lib/styles/animation/index.js +2 -0
- package/lib/styles/mask/index.d.ts +2 -0
- package/lib/styles/mask/index.js +2 -0
- package/lib/theme/theme_color.d.ts +1 -2
- package/package.json +1 -1
- package/lib/base-Dyj1rzaK.js +0 -61
- package/lib/button-CDYYpQu6.js +0 -151
- package/lib/dialog_container-Bq6HsKey.js +0 -127
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import e from "./base.js";
|
|
2
2
|
import { kebabToCamel as t, parseAttrValue as n, unitNumberStr as r } from "./utils/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { t as i } from "./mask-Ox6CoyFB.js";
|
|
4
|
+
import { $$ as a, $one as o, off as s, on as c, shouldEventNext as l, transition as u } from "ph-utils/browser";
|
|
4
5
|
//#region src/components/modal/index.less?inline
|
|
5
|
-
var
|
|
6
|
+
var d = ":host{display:none}:host(.open){display:block}.l-modal-mask{z-index:var(--l-modal-zindex,100)}.l-modal-wrapper{width:100%;height:100%;z-index:calc(var(--l-modal-zindex,100) + 1);position:fixed;top:0;left:0}.l-modal{--l-modal-translate:translate3d(0, 80px, 0);border-radius:var(--l-modal-border-radius,5px);width:var(--l-modal-width,27%);opacity:1;transform:var(--l-modal-translate) scale3d(1, 1, 1);background-color:#fff;margin:auto;transition:opacity .3s,transform .3s;position:relative;box-shadow:0 0 8px #0000001a}.l-modal-header{padding:var(--l-modal-header-padding,10px);border-bottom:1px solid var(--l-modal-line-color,#0000000f);align-items:center;gap:5px;font-size:16px;font-weight:600;display:flex}.l-modal-footer{padding:var(--l-modal-footer-padding,10px);border-top:1px solid var(--l-modal-line-color,#0000000f);justify-content:flex-end;gap:10px;display:flex}.l-modal-container{padding:var(--l-modal-container-padding,15px 10px);font-size:14px}.l-btn-modal-close{--l-form-control-height:auto;position:absolute}.l-modal-close1{top:8px;right:5px}.l-modal-close1::part(default){border:none;width:auto;height:auto;padding:5px;font-size:16px}.l-modal-close2{top:-10px;right:-10px}.l-modal-close2::part(default){background-color:#fff;width:20px;height:20px;padding:0}.mask-transition-enter-from,.mask-transition-leave-to{opacity:0}.modal-transition-enter-from,.modal-transition-leave-to{transform:translate(0,0)scale3d(0,0,0)}.l-modal--mobile{border-radius:10px}.l-modal--mobile .l-modal-header{text-align:center;border-bottom-color:#0000;justify-content:center;padding:20px 10px 5px;display:flex}.l-modal--mobile .l-modal-container{--l-modal-container-padding:5px 15px 20px;text-align:center}.l-modal--mobile .l-modal-footer{text-align:center;justify-content:stretch;align-items:stretch;gap:0;height:50px;padding:0;display:flex}.l-modal--mobile .l-modal-footer-btn{flex-grow:1;height:100%}.l-modal--mobile .l-modal-footer-btn+.l-modal-footer-btn{border-left:1px solid var(--l-modal-line-color,#0000000f)}.l-modal--middle{--l-modal-translate:translate3d(0, -50%, 0);top:50%}.l-modal--bottom{--l-modal-translate:translate3d(0, -100%, 0);border-bottom-right-radius:0;border-bottom-left-radius:0;width:100%;top:100%}@media screen and (width<=768px){:host{--l-modal-width:80%}}", f = class extends e {
|
|
6
7
|
static baseName = "modal";
|
|
7
8
|
_bodyOverflow = "";
|
|
8
9
|
constructor() {
|
|
@@ -78,7 +79,7 @@ var u = ":host{display:none}:host(.open){display:block}.l-modal-mask{z-index:var
|
|
|
78
79
|
}
|
|
79
80
|
updateDOM(e) {
|
|
80
81
|
if (e.has("show") && (this._state.show ? this.#e() : this.#t()), e.has("width") && this._setWidth(), e.has("confirm-loading")) {
|
|
81
|
-
let e =
|
|
82
|
+
let e = o("l-button[modal-action=\"ok\"]", this.root);
|
|
82
83
|
e && e.setAttribute("loading", this._state.confirmLoading.toString());
|
|
83
84
|
}
|
|
84
85
|
e.has("z-index") && this._setZIndex();
|
|
@@ -87,7 +88,10 @@ var u = ":host{display:none}:host(.open){display:block}.l-modal-mask{z-index:var
|
|
|
87
88
|
this._setWidth(), this._setZIndex(), this._state.show && this.#e();
|
|
88
89
|
}
|
|
89
90
|
render_v2() {
|
|
90
|
-
return {
|
|
91
|
+
return {
|
|
92
|
+
style: [d],
|
|
93
|
+
styleSheets: [i]
|
|
94
|
+
};
|
|
91
95
|
}
|
|
92
96
|
_setZIndex() {
|
|
93
97
|
this._state.zIndex ? this.style.setProperty("--l-modal-zindex", this._state.zIndex) : this.style.removeProperty("--l-modal-zindex");
|
|
@@ -97,22 +101,22 @@ var u = ":host{display:none}:host(.open){display:block}.l-modal-mask{z-index:var
|
|
|
97
101
|
}
|
|
98
102
|
#e() {
|
|
99
103
|
this._bodyOverflow = getComputedStyle(document.body).overflow, this.classList.add("open"), document.body.style.overflow = "hidden";
|
|
100
|
-
let e =
|
|
104
|
+
let e = o(".l-modal-wrapper", this.root);
|
|
101
105
|
if (e) {
|
|
102
|
-
let e =
|
|
103
|
-
e &&
|
|
104
|
-
let t =
|
|
105
|
-
|
|
106
|
+
let e = o(".l-mask", this.root);
|
|
107
|
+
e && u(e, "mask-transition");
|
|
108
|
+
let t = o(".l-modal", this.root);
|
|
109
|
+
u(t, "modal-transition");
|
|
106
110
|
} else {
|
|
107
111
|
let t = document.createDocumentFragment(), n = null;
|
|
108
|
-
this._state.mask && (n =
|
|
112
|
+
this._state.mask && (n = a("div", {
|
|
109
113
|
class: "l-mask l-modal-mask",
|
|
110
114
|
part: "mask"
|
|
111
|
-
}), t.appendChild(n)), e =
|
|
115
|
+
}), t.appendChild(n)), e = a("div", {
|
|
112
116
|
class: "l-modal-wrapper",
|
|
113
117
|
part: "wrapper"
|
|
114
118
|
});
|
|
115
|
-
let r =
|
|
119
|
+
let r = a("div", {
|
|
116
120
|
class: [
|
|
117
121
|
"l-modal",
|
|
118
122
|
`l-modal--${this._state.mobile ? "mobile" : "pc"}`,
|
|
@@ -121,39 +125,39 @@ var u = ":host{display:none}:host(.open){display:block}.l-modal-mask{z-index:var
|
|
|
121
125
|
part: "default"
|
|
122
126
|
});
|
|
123
127
|
if (r.setAttribute("modal-action", "modal"), this._state.close !== 0) {
|
|
124
|
-
let e =
|
|
128
|
+
let e = a("l-button", {
|
|
125
129
|
shape: "circle",
|
|
126
130
|
type: "normal",
|
|
127
131
|
class: `l-btn-modal-close l-modal-close${this._state.close}`,
|
|
128
132
|
"modal-action": "close",
|
|
129
133
|
part: "close-btn"
|
|
130
|
-
}), t =
|
|
134
|
+
}), t = a("l-close-icon");
|
|
131
135
|
e.appendChild(t), r.appendChild(e);
|
|
132
136
|
}
|
|
133
137
|
if (this._state.header) {
|
|
134
|
-
let e =
|
|
138
|
+
let e = a("header", {
|
|
135
139
|
class: "l-modal-header",
|
|
136
140
|
part: "header"
|
|
137
|
-
}), t =
|
|
141
|
+
}), t = a("slot", { name: "header" });
|
|
138
142
|
t.textContent = this._state.headerTitle || "", e.appendChild(t), r.appendChild(e);
|
|
139
143
|
}
|
|
140
|
-
let
|
|
144
|
+
let i = a("div", {
|
|
141
145
|
class: "l-modal-container",
|
|
142
146
|
part: "container"
|
|
143
|
-
}), o =
|
|
144
|
-
if (
|
|
145
|
-
let e =
|
|
147
|
+
}), o = a("slot");
|
|
148
|
+
if (i.appendChild(o), r.appendChild(i), this._state.footer) {
|
|
149
|
+
let e = a("footer", {
|
|
146
150
|
class: "l-modal-footer",
|
|
147
151
|
part: "footer"
|
|
148
|
-
}), t =
|
|
152
|
+
}), t = a("slot", { name: "footer" });
|
|
149
153
|
if (this._state.cancel) {
|
|
150
|
-
let e =
|
|
154
|
+
let e = a("l-button", {
|
|
151
155
|
class: "l-modal-footer-btn",
|
|
152
156
|
text: this._state.mobile
|
|
153
157
|
});
|
|
154
158
|
e.textContent = this._state.cancelText, e.setAttribute("modal-action", "cancel"), t.appendChild(e);
|
|
155
159
|
}
|
|
156
|
-
let n =
|
|
160
|
+
let n = a("l-button", {
|
|
157
161
|
type: "primary",
|
|
158
162
|
class: "l-modal-footer-btn",
|
|
159
163
|
loading: this._state.confirmLoading,
|
|
@@ -161,29 +165,29 @@ var u = ":host{display:none}:host(.open){display:block}.l-modal-mask{z-index:var
|
|
|
161
165
|
});
|
|
162
166
|
n.textContent = this._state.okText, n.setAttribute("modal-action", "ok"), t.appendChild(n), e.appendChild(t), r.appendChild(e);
|
|
163
167
|
}
|
|
164
|
-
e.appendChild(r), e.setAttribute("role", "dialog"), e.setAttribute("modal-action", "mask"),
|
|
168
|
+
e.appendChild(r), e.setAttribute("role", "dialog"), e.setAttribute("modal-action", "mask"), c(e, "click", this.#r), t.appendChild(e), this.appendToRoot(t), u(r, "modal-transition"), n && u(n, "mask-transition");
|
|
165
169
|
}
|
|
166
170
|
}
|
|
167
171
|
#t() {
|
|
168
172
|
document.body.style.setProperty("overflow", this._bodyOverflow);
|
|
169
|
-
let e =
|
|
170
|
-
|
|
173
|
+
let e = o(".l-modal", this.root);
|
|
174
|
+
u(e, "modal-transition", "leave", () => {
|
|
171
175
|
this._state.destroyOnClose && this.#n(), this.classList.remove("open"), this.emit("close");
|
|
172
176
|
});
|
|
173
|
-
let t =
|
|
174
|
-
t &&
|
|
177
|
+
let t = o(".l-mask", this.root);
|
|
178
|
+
t && u(t, "mask-transition", "leave");
|
|
175
179
|
}
|
|
176
180
|
disconnectedCallback() {
|
|
177
181
|
this.#n(), super.disconnectedCallback();
|
|
178
182
|
}
|
|
179
183
|
#n() {
|
|
180
|
-
let e =
|
|
181
|
-
e && (
|
|
182
|
-
let t =
|
|
184
|
+
let e = o(".l-modal-wrapper", this.root);
|
|
185
|
+
e && (s(e, "click", this.#r), this.root.removeChild(e));
|
|
186
|
+
let t = o(".l-mask", this.root);
|
|
183
187
|
t && this.root.removeChild(t);
|
|
184
188
|
}
|
|
185
189
|
#r = (e) => {
|
|
186
|
-
let [t, n] =
|
|
190
|
+
let [t, n] = l(e, "modal-action", this.root);
|
|
187
191
|
if (t) {
|
|
188
192
|
let e = "";
|
|
189
193
|
this._state.maskClosable && n === "mask" || n === "cancel" || n === "close" ? e = "cancel" : n === "ok" && (e = "ok"), e && this.dispatchEvent(new CustomEvent(e, { detail: { action: n } }));
|
|
@@ -25,8 +25,8 @@ export default class Pagination extends BaseComponent<PaginationProps> {
|
|
|
25
25
|
rerender(): void;
|
|
26
26
|
render(): string;
|
|
27
27
|
render_v2(): {
|
|
28
|
-
template
|
|
29
|
-
style
|
|
28
|
+
template: string;
|
|
29
|
+
style: string;
|
|
30
30
|
};
|
|
31
31
|
afterInit(): void;
|
|
32
32
|
beforeDestroy(): void;
|
package/lib/qrcode/index.d.ts
CHANGED
|
@@ -23,8 +23,8 @@ export default class Qrcode extends BaseComponent<QrcodeState> {
|
|
|
23
23
|
afterInit(): void;
|
|
24
24
|
beforeDestroy(): void;
|
|
25
25
|
render_v2(): {
|
|
26
|
-
template
|
|
27
|
-
style
|
|
26
|
+
template: string;
|
|
27
|
+
style: string;
|
|
28
28
|
};
|
|
29
29
|
render(): string;
|
|
30
30
|
}
|
package/lib/select/index.d.ts
CHANGED
|
@@ -75,8 +75,8 @@ export default class Select extends FormInner<SelectState> {
|
|
|
75
75
|
afterInit(): void;
|
|
76
76
|
beforeDestroy(): void;
|
|
77
77
|
render_v2(): {
|
|
78
|
-
template
|
|
79
|
-
style
|
|
78
|
+
template: DocumentFragment;
|
|
79
|
+
style: string[];
|
|
80
80
|
};
|
|
81
81
|
render(): DocumentFragment;
|
|
82
82
|
protected disabledChange(): void;
|
|
@@ -10,8 +10,8 @@ export default class SelectOri extends FormInner {
|
|
|
10
10
|
connectedCallback(): void;
|
|
11
11
|
disconnectedCallback(): void;
|
|
12
12
|
render_v2(): {
|
|
13
|
-
template
|
|
14
|
-
style
|
|
13
|
+
template: string;
|
|
14
|
+
style: string[];
|
|
15
15
|
};
|
|
16
16
|
render(): string;
|
|
17
17
|
protected disabledChange(): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
//#region src/components/input_number/index.less?inline
|
|
2
|
+
var e = ":host{--l-input-number-border-color:var(--l-border-color,#d9d9d9);--l-input-number-btn-color:#606266;--l-input-number-btn-hover-color:var(--l-primary-color,#722ed1);--l-input-number-btn-disabled-color:#c0c4cc;--l-input-number-bg:#fff;--l-input-number-btn-bg:#f5f7fa;--l-input-number-btn-hover-bg:var(--l-primary-color-light5,#f3e8ff);--l-input-number-width:170px;width:var(--l-input-number-width);height:var(--l-form-control-height,32px);border:1px solid var(--l-input-number-border-color);border-radius:var(--l-border-radius,3px);box-sizing:border-box;vertical-align:middle;background-color:var(--l-input-number-bg);align-items:center;transition:border-color .3s,box-shadow .3s;display:inline-flex;overflow:hidden}:host(:focus-within){--l-input-number-border-color:var(--l-primary-color,#722ed1);box-shadow:0 0 0 3px var(--l-primary-color-light5)}:host(.is-block){width:100%}:host(.is-disabled){background-color:var(--l-disabled-color,#f5f7fa);cursor:not-allowed}:host(.is-disabled) .l-input-number__btn{color:var(--l-input-number-btn-disabled-color);cursor:not-allowed}:host(.is-disabled) .l-input-number__btn:hover{background-color:var(--l-input-number-btn-bg)}:host(.is-error){--l-input-number-border-color:var(--l-error-color)}:host(.is-error:focus-within){box-shadow:0 0 0 3px var(--l-error-color-light5)}:host(.l-input-number--small){--l-form-control-height:24px;font-size:12px}:host(.l-input-number--large){--l-form-control-height:40px;--l-border-radius:6px;font-size:16px}.l-input-number__btn{background:var(--l-input-number-btn-bg);width:32px;height:100%;color:var(--l-input-number-btn-color);cursor:pointer;-webkit-user-select:none;user-select:none;font-size:inherit;border:none;outline:none;flex-shrink:0;justify-content:center;align-items:center;padding:0;transition:background-color .25s,color .25s;display:inline-flex}.l-input-number__btn:hover:not(:disabled){background:var(--l-input-number-btn-hover-bg);color:var(--l-input-number-btn-hover-color)}.l-input-number__btn:active:not(:disabled){background:var(--l-primary-color-light4,#e2d3fa);color:var(--l-primary-color-dark1,#531dab)}.l-input-number__btn:disabled{color:var(--l-input-number-btn-disabled-color);cursor:not-allowed}:host(.l-input-number--no-controls) .l-input-number__inner{text-align:left}.l-input-number__inner{text-align:center;width:100%;height:100%;font-size:inherit;color:var(--l-input-number-btn-color);box-sizing:border-box;-moz-appearance:textfield;background:0 0;border:none;outline:none;flex:1;padding:0 8px}.l-input-number__inner::-webkit-outer-spin-button,.l-input-number__inner::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.l-input-number__inner::placeholder{color:#c0c4cc}html.dark :host{--l-input-number-bg:#ffffff0f;--l-input-number-btn-bg:#ffffff14;--l-input-number-btn-color:#ffffffa6;--l-input-number-btn-hover-bg:var(--l-primary-color-light5);--l-input-number-btn-disabled-color:#ffffff40}html.dark :host(.is-disabled){background-color:#ffffff14}html.dark .l-input-number__inner::placeholder{color:#ffffff4d}", t = new CSSStyleSheet();
|
|
3
|
+
t.replaceSync(e);
|
|
4
|
+
//#endregion
|
|
5
|
+
export { t };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
//#region src/components/button/index.less?inline
|
|
2
|
+
var e = ":host{--l-btn-padding:0 15px;--l-btn-text-color:#fff;--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;--l-btn-height:var(--l-form-control-height,32px);width:auto;height:var(--l-btn-height);text-indent:0;box-sizing:border-box;border-radius:var(--l-border-radius,3px);display:inline-flex}:host([block]){width:100%}:host(.l-btn-small){--l-btn-height:24px;--l-btn-padding:0 7px}:host(.l-btn-large){--l-border-radius:6px;--l-btn-height:40px;--l-btn-padding:0 15px;font-size:16px}.l-btn{cursor:pointer;box-sizing:border-box;vertical-align:middle;width:100%;padding:var(--l-btn-padding);border-radius:inherit;height:100%;color:var(--l-btn-text-color);background:var(--l-btn-background);border:1px solid var(--l-btn-border-color);justify-content:center;align-items:center;gap:var(--l-btn-gap,5px);line-height:1;font-size:inherit;outline:none;transition:border-color .3s,background-color .3s,color .3s;display:inline-flex;position:relative}.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-box-shadow:hover{box-shadow:0 4px 12px var(--l-primary-color-light4)}.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-normal-v2{--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:transparent;--l-btn-active-background:transparent;--l-btn-hover-border-color:var(--l-btn-hover-text-color);--l-btn-active-border-color:var(--l-btn-active-text-color)}.l-btn-normal-v2{--l-btn-hover-background:var(--l-primary-color-light5);--l-btn-active-background:var(--l-primary-color-light4)}.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-disabled-border-color:var(--l-primary-color-light2,#b37feb);--l-btn-disabled-background:var(--l-primary-color-light2,#b37feb);--l-btn-disabled-color:#fff}.l-btn: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.l-btn-loading{cursor:default}.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;--l-btn-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-control-height,32px) / 2)}.l-btn-circle{width:var(--l-form-control-height,32px);border-radius:50%;padding:0}.l-btn:not(.l-btn-text)+.l-btn{margin-left:10px}html.dark .l-btn:disabled{--l-btn-disabled-background:#ffffff14;--l-btn-disabled-color:#ffffff4d;--l-btn-disabled-border-color:#ffffff4d}", t = new CSSStyleSheet();
|
|
3
|
+
t.replaceSync(e);
|
|
4
|
+
//#endregion
|
|
5
|
+
export { t };
|
|
@@ -7,8 +7,7 @@ export default class ThemeColor extends BaseComponent<ThemeColorState> {
|
|
|
7
7
|
static baseName: string;
|
|
8
8
|
constructor();
|
|
9
9
|
render_v2(): {
|
|
10
|
-
template
|
|
11
|
-
style?: string | string[];
|
|
10
|
+
template: string;
|
|
12
11
|
};
|
|
13
12
|
afterInit(): void;
|
|
14
13
|
}
|
package/package.json
CHANGED
package/lib/base-Dyj1rzaK.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import e from "./base.js";
|
|
2
|
-
import { unitNumberStr as t } from "./utils/index.js";
|
|
3
|
-
//#region src/components/icon/index.less?inline
|
|
4
|
-
var n = ":host{display:inline-flex}.l-icon{fill:currentColor;vertical-align:middle;width:1em;height:1em;color:var(--l-icon-color,inherit);font-size:var(--l-icon-size,inherit);display:inline-block}", r = class extends e {
|
|
5
|
-
static baseName = "base-icon";
|
|
6
|
-
useLink;
|
|
7
|
-
viewBox;
|
|
8
|
-
constructor() {
|
|
9
|
-
super(), this.useLink = !1, this.viewBox = "0 0 1024 1024", this.version = 2, this._state = {};
|
|
10
|
-
}
|
|
11
|
-
static get observedAttributes() {
|
|
12
|
-
return ["color", "size"];
|
|
13
|
-
}
|
|
14
|
-
attributeChanged(e, n, r) {
|
|
15
|
-
switch (e) {
|
|
16
|
-
case "color":
|
|
17
|
-
this._state.color = r;
|
|
18
|
-
break;
|
|
19
|
-
case "size": this._state.size = t(r);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
connectedCallback() {
|
|
23
|
-
super.connectedCallback(), this._updateColor(), this._updateSize();
|
|
24
|
-
}
|
|
25
|
-
updateDOM(e) {
|
|
26
|
-
console.log("up"), e.has("color") && this._updateColor(), e.has("size") && this._updateSize();
|
|
27
|
-
}
|
|
28
|
-
_updateSize() {
|
|
29
|
-
this._state.size ? this.style.setProperty("--l-icon-size", this._state.size) : this.style.removeProperty("--l-icon-size");
|
|
30
|
-
}
|
|
31
|
-
_updateColor() {
|
|
32
|
-
this._state.color ? this.style.setProperty("--l-icon-color", this._state.color) : this.style.removeProperty("--l-icon-color");
|
|
33
|
-
}
|
|
34
|
-
render_v2() {
|
|
35
|
-
let e = this.createEl("svg");
|
|
36
|
-
e.classList.add("l-icon"), this.useLink || e.setAttribute("viewBox", this.viewBox);
|
|
37
|
-
let t = this.renderChildren();
|
|
38
|
-
if (typeof t == "string") {
|
|
39
|
-
if (t === "") {
|
|
40
|
-
let t = this.children, n = [];
|
|
41
|
-
for (let e = 0, r = t.length; e < r; e++) {
|
|
42
|
-
let r = t[e];
|
|
43
|
-
n.push(r.outerHTML);
|
|
44
|
-
}
|
|
45
|
-
e.innerHTML = n.join("");
|
|
46
|
-
} else e.innerHTML = t;
|
|
47
|
-
} else e.append(t);
|
|
48
|
-
return {
|
|
49
|
-
template: e,
|
|
50
|
-
style: n
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
renderChildren() {
|
|
54
|
-
return "";
|
|
55
|
-
}
|
|
56
|
-
createEl(e) {
|
|
57
|
-
return document.createElementNS("http://www.w3.org/2000/svg", e);
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
//#endregion
|
|
61
|
-
export { r as t };
|
package/lib/button-CDYYpQu6.js
DELETED
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import e from "./base.js";
|
|
2
|
-
import { kebabToCamel as t, parseAttrValue as n, unitNumberStr as r } from "./utils/index.js";
|
|
3
|
-
import { t as i } from "./animation-DStAHzod.js";
|
|
4
|
-
import { $one as a, addClass as o, formatClass as s, formatStyle as c, off as l, on as u, removeClass as d } from "ph-utils/browser";
|
|
5
|
-
import { adjust as f } from "ph-utils";
|
|
6
|
-
//#region src/components/button/index.less?inline
|
|
7
|
-
var p = ":host{--l-btn-padding:0 15px;--l-btn-text-color:#fff;--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;--l-btn-height:var(--l-form-control-height,32px);width:auto;height:var(--l-btn-height);text-indent:0;box-sizing:border-box;border-radius:var(--l-border-radius,3px);display:inline-flex}:host([block]){width:100%}:host(.l-btn-small){--l-btn-height:24px;--l-btn-padding:0 7px}:host(.l-btn-large){--l-border-radius:6px;--l-btn-height:40px;--l-btn-padding:0 15px;font-size:16px}.l-btn{cursor:pointer;box-sizing:border-box;vertical-align:middle;width:100%;padding:var(--l-btn-padding);border-radius:inherit;height:100%;color:var(--l-btn-text-color);background:var(--l-btn-background);border:1px solid var(--l-btn-border-color);justify-content:center;align-items:center;gap:var(--l-btn-gap,5px);line-height:1;font-size:inherit;outline:none;transition:border-color .3s,background-color .3s,color .3s;display:inline-flex;position:relative}.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-box-shadow:hover{box-shadow:0 4px 12px var(--l-primary-color-light4)}.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-normal-v2{--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:transparent;--l-btn-active-background:transparent;--l-btn-hover-border-color:var(--l-btn-hover-text-color);--l-btn-active-border-color:var(--l-btn-active-text-color)}.l-btn-normal-v2{--l-btn-hover-background:var(--l-primary-color-light5);--l-btn-active-background:var(--l-primary-color-light4)}.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-disabled-border-color:var(--l-primary-color-light2,#b37feb);--l-btn-disabled-background:var(--l-primary-color-light2,#b37feb);--l-btn-disabled-color:#fff}.l-btn: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.l-btn-loading{cursor:default}.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;--l-btn-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-control-height,32px) / 2)}.l-btn-circle{width:var(--l-form-control-height,32px);border-radius:50%;padding:0}.l-btn:not(.l-btn-text)+.l-btn{margin-left:10px}html.dark .l-btn:disabled{--l-btn-disabled-background:#ffffff14;--l-btn-disabled-color:#ffffff4d;--l-btn-disabled-border-color:#ffffff4d}", m = class extends e {
|
|
8
|
-
static baseName = "button";
|
|
9
|
-
$btn;
|
|
10
|
-
constructor() {
|
|
11
|
-
super(), this.version = 2, this._state = {
|
|
12
|
-
loading: !1,
|
|
13
|
-
htmlType: "button",
|
|
14
|
-
text: !1,
|
|
15
|
-
ghost: !1,
|
|
16
|
-
disabled: !1,
|
|
17
|
-
type: "normal",
|
|
18
|
-
shape: "default",
|
|
19
|
-
loadingText: "加载中……",
|
|
20
|
-
size: "default",
|
|
21
|
-
boxShadow: "box-shadow-none"
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
get disabled() {
|
|
25
|
-
return this._state.disabled;
|
|
26
|
-
}
|
|
27
|
-
set disabled(e) {
|
|
28
|
-
this.setDisabled(e);
|
|
29
|
-
}
|
|
30
|
-
setLoading(e) {
|
|
31
|
-
this.$btn && (e ? (o(this.$btn, "l-btn-loading"), this.$btn.disabled = !0, this.$btn.innerHTML = this.loadingBody()) : (d(this.$btn, "l-btn-loading"), this.$btn.disabled = this.disabled, this.$btn.innerHTML = "<slot></slot>"));
|
|
32
|
-
}
|
|
33
|
-
setDisabled(e) {
|
|
34
|
-
this._state.disabled = e, this.$btn && (this.$btn.disabled = e);
|
|
35
|
-
}
|
|
36
|
-
static get observedAttributes() {
|
|
37
|
-
return [
|
|
38
|
-
"loading",
|
|
39
|
-
"color",
|
|
40
|
-
"text",
|
|
41
|
-
"ghost",
|
|
42
|
-
"disabled",
|
|
43
|
-
"height",
|
|
44
|
-
"html-type",
|
|
45
|
-
"type",
|
|
46
|
-
"shape",
|
|
47
|
-
"loading-text",
|
|
48
|
-
"size",
|
|
49
|
-
"box-shadow"
|
|
50
|
-
];
|
|
51
|
-
}
|
|
52
|
-
attributeChanged(e, i, a) {
|
|
53
|
-
switch (e) {
|
|
54
|
-
case "color":
|
|
55
|
-
case "shape":
|
|
56
|
-
case "type":
|
|
57
|
-
case "size":
|
|
58
|
-
this._state[e] = a;
|
|
59
|
-
break;
|
|
60
|
-
case "height":
|
|
61
|
-
this._state[e] = r(a);
|
|
62
|
-
break;
|
|
63
|
-
case "text":
|
|
64
|
-
case "ghost":
|
|
65
|
-
case "disabled":
|
|
66
|
-
case "loading":
|
|
67
|
-
this._state[e] = n(a, !1, e);
|
|
68
|
-
break;
|
|
69
|
-
case "html-type":
|
|
70
|
-
case "loading-text":
|
|
71
|
-
this._state[t(e)] = a;
|
|
72
|
-
break;
|
|
73
|
-
case "box-shadow":
|
|
74
|
-
let i = n(a, !1, "box-shadow");
|
|
75
|
-
this._state.boxShadow = `box-shadow${i ? "" : "-none"}`;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
updateDOM(e) {
|
|
79
|
-
this.$btn && (e.has("loading") && this.setLoading(this._state.loading), e.has("disabled") && this.setDisabled(this.disabled), e.has("color") && this._state.color && (this.$btn.style.cssText = this.applyColor(this._state.color, this._state.text, this._state.ghost)), (e.has("type") || e.has("shape") || e.has("box-shadow")) && (this.$btn.className = this._resetBtnClass())), e.has("height") && this._updateHeight();
|
|
80
|
-
}
|
|
81
|
-
connectedCallback() {
|
|
82
|
-
this.className = `l-btn-${this._state.size || "default"} ${this.className}`, super.connectedCallback(), this.isFormButton() && u(this, "click", this._handleClick), this._updateHeight();
|
|
83
|
-
}
|
|
84
|
-
disconnectedCallback() {
|
|
85
|
-
super.disconnectedCallback(), this.isFormButton() && l(this, "click", this._handleClick), this.$btn = void 0;
|
|
86
|
-
}
|
|
87
|
-
isFormButton() {
|
|
88
|
-
let e = this.getHtmlType();
|
|
89
|
-
return e === "submit" || e === "reset";
|
|
90
|
-
}
|
|
91
|
-
getHtmlType() {
|
|
92
|
-
return this._state.htmlType;
|
|
93
|
-
}
|
|
94
|
-
render_v2() {
|
|
95
|
-
return this._changedProperties.clear(), {
|
|
96
|
-
style: [i, p],
|
|
97
|
-
template: this.render()
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
afterInit() {
|
|
101
|
-
this.$btn ||= a(".l-btn", this.root);
|
|
102
|
-
}
|
|
103
|
-
render() {
|
|
104
|
-
let e = document.createElement("button"), t = this._state.loading, n = this._state.text, r = this._state.ghost;
|
|
105
|
-
e.className = this._resetBtnClass(), (this.disabled || t) && (e.disabled = !0), e.type = this._state.htmlType;
|
|
106
|
-
let i = this.applyColor(this._state.color || "", n, r);
|
|
107
|
-
return i && (e.style.cssText = i), e.innerHTML = t ? this.loadingBody() : "<slot></slot>", e.setAttribute("part", "default"), e;
|
|
108
|
-
}
|
|
109
|
-
loadingBody() {
|
|
110
|
-
let e = this._state.loadingText, t = ["<l-loading-icon class=\"l-rotate-anim\"></l-loading-icon>"];
|
|
111
|
-
return e ? t.push(`<span>${e}</span>`) : t.push("<slot></slot>"), t.join("");
|
|
112
|
-
}
|
|
113
|
-
applyColor(e, t = !1, n = !1) {
|
|
114
|
-
if (!e) return "";
|
|
115
|
-
let r = f(e, 1, !0), i = f(e, 3, !1);
|
|
116
|
-
return c({
|
|
117
|
-
"--l-btn-border-color": t ? "transparent" : e,
|
|
118
|
-
"--l-btn-text-color": n || t ? e : "#ffffff",
|
|
119
|
-
"--l-btn-hover-text-color": n || t ? r : "#ffffff",
|
|
120
|
-
"--l-btn-background": n || t ? "transparent" : e,
|
|
121
|
-
"--l-btn-active-text-color": n || t ? i : "#ffffff",
|
|
122
|
-
"--l-btn-hover-border-color": t ? "transparent" : r,
|
|
123
|
-
"--l-btn-hover-background": n || t ? "transparent" : r,
|
|
124
|
-
"--l-btn-active-background": n || t ? "transparent" : i,
|
|
125
|
-
"--l-btn-active-border-color": t ? "transparent" : i
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
_updateHeight() {
|
|
129
|
-
this._state.height ? this.style.setProperty("--l-btn-height", this._state.height) : this.style.removeProperty("--l-btn-height");
|
|
130
|
-
}
|
|
131
|
-
_resetBtnClass() {
|
|
132
|
-
return s([
|
|
133
|
-
"l-btn",
|
|
134
|
-
`l-btn-${this._state.type}`,
|
|
135
|
-
`l-btn-${this._state.shape}`,
|
|
136
|
-
`l-btn-${this._state.boxShadow}`,
|
|
137
|
-
this._state.ghost ? "l-btn-ghost" : "",
|
|
138
|
-
this._state.text ? "l-btn-text" : "",
|
|
139
|
-
this._state.loading ? "l-btn-loading" : ""
|
|
140
|
-
]);
|
|
141
|
-
}
|
|
142
|
-
_handleClick = () => {
|
|
143
|
-
(this._state.htmlType === "reset" || this._state.htmlType === "submit") && this.emit("form-action", {
|
|
144
|
-
bubbles: !0,
|
|
145
|
-
composed: !0,
|
|
146
|
-
detail: this._state.htmlType
|
|
147
|
-
});
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
//#endregion
|
|
151
|
-
export { m as t };
|
|
@@ -1,127 +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}", 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
|
-
showClose: 1
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
afterInit() {
|
|
18
|
-
this._state.showClose === 2 && this.classList.add("l-container-close-outside");
|
|
19
|
-
let e = t("[data-action]", this.root);
|
|
20
|
-
a(e, (e) => {
|
|
21
|
-
s(e, "click", this.#e);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
beforeDestroy() {
|
|
25
|
-
let e = t("[data-action]", this.root);
|
|
26
|
-
a(e, (e) => {
|
|
27
|
-
o(e, "click", this.#e);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
#e(e) {
|
|
31
|
-
let [t, n] = c(e, "data-action");
|
|
32
|
-
t && this.dispatchEvent(new CustomEvent("dialogAction", {
|
|
33
|
-
detail: { action: n },
|
|
34
|
-
composed: !0
|
|
35
|
-
}));
|
|
36
|
-
}
|
|
37
|
-
static get observedAttributes() {
|
|
38
|
-
return [
|
|
39
|
-
"show-header",
|
|
40
|
-
"header",
|
|
41
|
-
"show-footer",
|
|
42
|
-
"show-cancel",
|
|
43
|
-
"cancel-text",
|
|
44
|
-
"show-ok",
|
|
45
|
-
"ok-text",
|
|
46
|
-
"show-close",
|
|
47
|
-
"container-class"
|
|
48
|
-
];
|
|
49
|
-
}
|
|
50
|
-
attributeChanged(e, t, n) {
|
|
51
|
-
switch (e) {
|
|
52
|
-
case "show-header":
|
|
53
|
-
this._state.showHeader = n !== null, this.connectedCallback();
|
|
54
|
-
break;
|
|
55
|
-
case "header":
|
|
56
|
-
this._state.header = n || void 0, this.connectedCallback();
|
|
57
|
-
break;
|
|
58
|
-
case "show-footer":
|
|
59
|
-
this._state.showFooter = n !== null, this.connectedCallback();
|
|
60
|
-
break;
|
|
61
|
-
case "show-cancel":
|
|
62
|
-
this._state.showCancel = n !== null, this.connectedCallback();
|
|
63
|
-
break;
|
|
64
|
-
case "cancel-text":
|
|
65
|
-
this._state.cancelText = n || "取消", this.connectedCallback();
|
|
66
|
-
break;
|
|
67
|
-
case "show-ok":
|
|
68
|
-
this._state.showOk = n !== null, this.connectedCallback();
|
|
69
|
-
break;
|
|
70
|
-
case "ok-text":
|
|
71
|
-
this._state.okText = n || "确定", this.connectedCallback();
|
|
72
|
-
break;
|
|
73
|
-
case "show-close":
|
|
74
|
-
this._state.showClose = Number(n), this._state.showClose === 2 ? this.classList.add("l-container-close-outside") : this.classList.remove("l-container-close-outside");
|
|
75
|
-
let e = r(".l-btn-dialog-close", this.root);
|
|
76
|
-
this._state.showClose === 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));
|
|
77
|
-
break;
|
|
78
|
-
case "container-class": this._state.containerClass = n || void 0, this.connectedCallback();
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
#t() {
|
|
82
|
-
return `l-btn-dialog-close l-dialog-close${this._state.showClose}`;
|
|
83
|
-
}
|
|
84
|
-
#n() {
|
|
85
|
-
let e = n("l-button", {
|
|
86
|
-
shape: "circle",
|
|
87
|
-
type: "normal",
|
|
88
|
-
class: this.#t(),
|
|
89
|
-
"data-action": "close"
|
|
90
|
-
}), t = n("l-close-icon");
|
|
91
|
-
return e.appendChild(t), e;
|
|
92
|
-
}
|
|
93
|
-
render_v2() {
|
|
94
|
-
return {
|
|
95
|
-
style: l,
|
|
96
|
-
template: this.render()
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
render() {
|
|
100
|
-
let e = document.createDocumentFragment();
|
|
101
|
-
this._state.showClose !== 0 && e.appendChild(this.#n());
|
|
102
|
-
let t = n("div", { class: "l-dialog-main" });
|
|
103
|
-
if (this._state.showHeader) {
|
|
104
|
-
let e = n("header", { class: "l-dialog-header" }), r = n("slot", { name: "header" });
|
|
105
|
-
r.textContent = this._state.header || "", e.appendChild(r), t.appendChild(e);
|
|
106
|
-
}
|
|
107
|
-
let r = n("div", { class: i(["l-dialog-container", this._state.containerClass]) }), a = n("slot");
|
|
108
|
-
if (r.appendChild(a), t.appendChild(r), this._state.showFooter) {
|
|
109
|
-
let e = n("div", { class: "l-dialog-footer" }), r = n("slot", { name: "footer" });
|
|
110
|
-
if (this._state.showCancel) {
|
|
111
|
-
let e = n("l-button", { "data-action": "cancel" });
|
|
112
|
-
e.textContent = this._state.cancelText, r.appendChild(e);
|
|
113
|
-
}
|
|
114
|
-
if (this._state.showOk) {
|
|
115
|
-
let e = n("l-button", {
|
|
116
|
-
type: "primary",
|
|
117
|
-
"data-action": "ok"
|
|
118
|
-
});
|
|
119
|
-
e.textContent = this._state.okText, r.appendChild(e);
|
|
120
|
-
}
|
|
121
|
-
e.appendChild(r), t.appendChild(e);
|
|
122
|
-
}
|
|
123
|
-
return e.appendChild(t), e;
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
//#endregion
|
|
127
|
-
export { u as t };
|