litos-ui 0.19.0 → 0.20.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/{animation-DStAHzod.js → animation-Bo4jbSGK.js} +4 -3
- package/lib/{base-LvfO4mmL.js → base-Dyj1rzaK.js} +11 -12
- package/lib/base.d.ts +5 -4
- package/lib/base.js +19 -15
- 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/calendar/index.js +1 -1
- package/lib/{calendar-Clbg3qot.js → calendar-CvlUsN6w.js} +20 -23
- 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/carousel/index.js +1 -1
- package/lib/carousel/item.js +1 -1
- package/lib/{carousel-Dgirxwzb.js → carousel-DvkZ1YXq.js} +23 -19
- package/lib/check/checkbox.js +1 -1
- package/lib/check/checkbox_group.js +1 -1
- package/lib/check/radio.js +1 -1
- package/lib/check/radio_group.js +1 -1
- package/lib/{check-BDOpD_0-.js → check-DFlwStH9.js} +10 -13
- package/lib/{check-CrlZ7zVL.js → check-doQ2ZpQj.js} +10 -10
- package/lib/{checkbox-D_bZGoUD.js → checkbox-DhGHJXwI.js} +1 -1
- package/lib/collapse/index.js +1 -1
- package/lib/collapse/item.js +1 -1
- package/lib/{collapse-BRxYoeJx.js → collapse-B6-Rn05A.js} +8 -10
- package/lib/color_picker/index.js +1 -1
- package/lib/{color_picker-AaFcIczZ.js → color_picker-0a-IGZY9.js} +3 -3
- package/lib/date_picker/index.d.ts +2 -2
- package/lib/date_picker/index.js +1 -1
- package/lib/{date_picker-HjkRma9j.js → date_picker-BDN2PAz5.js} +3 -7
- package/lib/date_picker_ori/index.js +1 -1
- package/lib/{date_picker_ori-1IOHZsan.js → date_picker_ori-BXFs1eET.js} +4 -6
- package/lib/description_panel/index.js +1 -1
- package/lib/{description_panel-DaqVcA6-.js → description_panel--AKXBzLL.js} +2 -6
- 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 +1 -1
- package/lib/dialog/index.d.ts +33 -11
- package/lib/dialog/index.js +48 -48
- package/lib/{dialog_container-CcTyfoaD.js → dialog_container-BNPQ9n0V.js} +34 -15
- package/lib/{esm-Cir9D6cn.js → esm-DAha108i.js} +67 -67
- package/lib/form/form_item.d.ts +3 -3
- package/lib/form/form_item.js +1 -1
- package/lib/form/index.d.ts +3 -3
- package/lib/form/index.js +1 -1
- package/lib/{form-BvZHaqAt.js → form-DJxvBiLy.js} +30 -32
- package/lib/{form_inner-52DR1IPu.js → form_inner-Cnwb6f_Q.js} +3 -5
- package/lib/{form_item-DtqChzc3.js → form_item-BqPMRABd.js} +7 -9
- 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 -2
- package/lib/icon/base.js +1 -1
- 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/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/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/image/image_preview.js +1 -1
- package/lib/image/index.js +1 -1
- package/lib/{image-BCUhVAFo.js → image-CVQai6NX.js} +19 -19
- package/lib/{image_preview-BeJzfEoF.js → image_preview-DfQAKSJH.js} +3 -5
- package/lib/index.d.ts +2 -0
- package/lib/index.js +71 -69
- package/lib/input/index.d.ts +2 -2
- package/lib/input/index.js +3 -5
- package/lib/{item-42bYhAkZ.js → item-CQ2Sknbz.js} +1 -1
- package/lib/{item-Dq6M7lxw.js → item-DI6mQXtB.js} +5 -7
- package/lib/{item-CX8C9X57.js → item-D_ZOPXuE.js} +1 -1
- package/lib/list/index.js +1 -1
- package/lib/{list-Dz1Ya118.js → list-MG8PRzos.js} +3 -3
- package/lib/loading/index.js +6 -4
- package/lib/mask/index.js +1 -1
- package/lib/{mask-BlDl9u8F.js → mask-Bx-yNIJv.js} +2 -6
- package/lib/mask-Ox6CoyFB.js +5 -0
- package/lib/md_input/index.js +1 -1
- package/lib/{md_input-DN3ceqsw.js → md_input-BX3bujz8.js} +2 -2
- package/lib/menu/index.d.ts +12 -4
- package/lib/menu/index.js +1 -1
- package/lib/menu-DKscK5mw.js +274 -0
- package/lib/message/index.js +1 -1
- package/lib/modal/index.d.ts +2 -2
- package/lib/modal/index.js +1 -1
- package/lib/modal/modal_box.js +13 -13
- package/lib/{modal-cjj3Nw1B.js → modal-Cwi3qlEf.js} +39 -33
- package/lib/page_header/index.js +1 -1
- package/lib/{page_header-BfuWJIdd.js → page_header-ujV3pncE.js} +2 -4
- package/lib/pagination/index.d.ts +25 -18
- package/lib/pagination/index.js +1 -1
- package/lib/{pagination-DpOSOFwl.js → pagination-aRbGd3Rf.js} +86 -83
- package/lib/polygon/index.js +1 -1
- package/lib/{polygon-BY1FAACc.js → polygon-DhhovlrG.js} +1 -1
- package/lib/qrcode/index.d.ts +2 -2
- package/lib/qrcode/index.js +1 -1
- package/lib/{qrcode-Bgr8gJzA.js → qrcode-Dip8uLSA.js} +1 -1
- package/lib/{radio-C7dkhgwc.js → radio-C9NPQWGI.js} +1 -1
- package/lib/select/index.d.ts +2 -2
- package/lib/select/index.js +1 -1
- package/lib/{select-Cis6kRjQ.js → select-BZMDj5VE.js} +33 -30
- package/lib/select_ori/index.d.ts +2 -2
- package/lib/select_ori/index.js +1 -1
- package/lib/{select_ori-DcJbNYYr.js → select_ori-C7sUZxen.js} +3 -3
- package/lib/space/index.js +1 -1
- package/lib/{space-BT_dVhhv.js → space-CKuTk0YB.js} +6 -5
- 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/switch/index.js +1 -1
- package/lib/{switch-UyhlgW7F.js → switch-wh2-ivty.js} +11 -9
- package/lib/tabbar/index.js +1 -1
- package/lib/tabbar/item.js +1 -1
- package/lib/{tabbar-DO0kB58Y.js → tabbar-CBXK-_AV.js} +1 -1
- package/lib/table/index.d.ts +7 -3
- package/lib/table/index.js +1 -1
- package/lib/{table-saZMryiV.js → table-BQxMD2Ae.js} +32 -33
- package/lib/tabs/index.js +4 -2
- package/lib/tag/index.js +1 -1
- package/lib/{tag-BtDcKdxo.js → tag-Di1z9PoZ.js} +3 -5
- package/lib/theme/index.js +1 -1
- package/lib/theme/theme_color.d.ts +1 -2
- package/lib/theme/theme_color.js +4 -5
- package/lib/{theme-Barcq234.js → theme-CLbBS-in.js} +9 -10
- package/lib/utils/context_provide.js +1 -1
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/popover.js +1 -1
- package/lib/utils/transition.js +1 -1
- package/package.json +11 -11
- package/lib/button-CC5NBWtI.js +0 -152
- package/lib/menu-BOmVa4xN.js +0 -224
|
@@ -1,7 +1,7 @@
|
|
|
1
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/
|
|
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
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 {
|
|
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
5
|
static baseName = "dialog-container";
|
|
6
6
|
constructor() {
|
|
7
7
|
super(), this.version = 2, this._state = {
|
|
@@ -11,16 +11,21 @@ var l = ":host{display:block;position:relative}:host(.l-container-close-outside)
|
|
|
11
11
|
cancelText: "取消",
|
|
12
12
|
showOk: !0,
|
|
13
13
|
okText: "确定",
|
|
14
|
-
|
|
14
|
+
close: 1,
|
|
15
|
+
mobile: !1,
|
|
16
|
+
confirmLoading: !1
|
|
15
17
|
};
|
|
16
18
|
}
|
|
17
19
|
afterInit() {
|
|
18
|
-
this._state.
|
|
20
|
+
this._state.close === 2 && this.classList.add("l-container-close-outside");
|
|
21
|
+
let e = t("[data-action]", this.root);
|
|
22
|
+
a(e, (e) => {
|
|
19
23
|
s(e, "click", this.#e);
|
|
20
24
|
});
|
|
21
25
|
}
|
|
22
26
|
beforeDestroy() {
|
|
23
|
-
|
|
27
|
+
let e = t("[data-action]", this.root);
|
|
28
|
+
a(e, (e) => {
|
|
24
29
|
o(e, "click", this.#e);
|
|
25
30
|
});
|
|
26
31
|
}
|
|
@@ -40,8 +45,10 @@ var l = ":host{display:block;position:relative}:host(.l-container-close-outside)
|
|
|
40
45
|
"cancel-text",
|
|
41
46
|
"show-ok",
|
|
42
47
|
"ok-text",
|
|
43
|
-
"
|
|
44
|
-
"container-class"
|
|
48
|
+
"close",
|
|
49
|
+
"container-class",
|
|
50
|
+
"mobile",
|
|
51
|
+
"confirm-loading"
|
|
45
52
|
];
|
|
46
53
|
}
|
|
47
54
|
attributeChanged(e, t, n) {
|
|
@@ -67,18 +74,25 @@ var l = ":host{display:block;position:relative}:host(.l-container-close-outside)
|
|
|
67
74
|
case "ok-text":
|
|
68
75
|
this._state.okText = n || "确定", this.connectedCallback();
|
|
69
76
|
break;
|
|
70
|
-
case "
|
|
71
|
-
this._state.
|
|
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");
|
|
72
79
|
let e = r(".l-btn-dialog-close", this.root);
|
|
73
|
-
this._state.
|
|
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));
|
|
74
81
|
break;
|
|
75
82
|
case "container-class":
|
|
76
83
|
this._state.containerClass = n || void 0, this.connectedCallback();
|
|
77
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());
|
|
78
92
|
}
|
|
79
93
|
}
|
|
80
94
|
#t() {
|
|
81
|
-
return `l-btn-dialog-close l-dialog-close${this._state.
|
|
95
|
+
return `l-btn-dialog-close l-dialog-close${this._state.close}`;
|
|
82
96
|
}
|
|
83
97
|
#n() {
|
|
84
98
|
let e = n("l-button", {
|
|
@@ -97,8 +111,8 @@ var l = ":host{display:block;position:relative}:host(.l-container-close-outside)
|
|
|
97
111
|
}
|
|
98
112
|
render() {
|
|
99
113
|
let e = document.createDocumentFragment();
|
|
100
|
-
this._state.
|
|
101
|
-
let t = n("div", { class: "l-dialog-main" });
|
|
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" : ""] });
|
|
102
116
|
if (this._state.showHeader) {
|
|
103
117
|
let e = n("header", { class: "l-dialog-header" }), r = n("slot", { name: "header" });
|
|
104
118
|
r.textContent = this._state.header || "", e.appendChild(r), t.appendChild(e);
|
|
@@ -107,13 +121,18 @@ var l = ":host{display:block;position:relative}:host(.l-container-close-outside)
|
|
|
107
121
|
if (r.appendChild(a), t.appendChild(r), this._state.showFooter) {
|
|
108
122
|
let e = n("div", { class: "l-dialog-footer" }), r = n("slot", { name: "footer" });
|
|
109
123
|
if (this._state.showCancel) {
|
|
110
|
-
let e = n("l-button", {
|
|
124
|
+
let e = n("l-button", {
|
|
125
|
+
"data-action": "cancel",
|
|
126
|
+
text: this._state.mobile
|
|
127
|
+
});
|
|
111
128
|
e.textContent = this._state.cancelText, r.appendChild(e);
|
|
112
129
|
}
|
|
113
130
|
if (this._state.showOk) {
|
|
114
131
|
let e = n("l-button", {
|
|
115
132
|
type: "primary",
|
|
116
|
-
"data-action": "ok"
|
|
133
|
+
"data-action": "ok",
|
|
134
|
+
loading: this._state.confirmLoading,
|
|
135
|
+
text: this._state.mobile
|
|
117
136
|
});
|
|
118
137
|
e.textContent = this._state.okText, r.appendChild(e);
|
|
119
138
|
}
|
|
@@ -116,30 +116,30 @@ function e({ update: e, notify: t, unwatched: n }) {
|
|
|
116
116
|
}
|
|
117
117
|
//#endregion
|
|
118
118
|
//#region node_modules/.pnpm/alien-signals@3.2.1/node_modules/alien-signals/esm/index.mjs
|
|
119
|
-
var t =
|
|
119
|
+
var t = 0, n = 0, r = 0, i = 0, a, o = [], { link: s, unlink: c, propagate: l, checkDirty: u, shallowPropagate: d } = e({
|
|
120
120
|
update(e) {
|
|
121
|
-
return "getter" in e ?
|
|
121
|
+
return "getter" in e ? h(e) : "currentValue" in e ? g(e) : (e.flags = 1, !0);
|
|
122
122
|
},
|
|
123
123
|
notify(e) {
|
|
124
|
-
let t =
|
|
124
|
+
let t = i, n = t;
|
|
125
125
|
do
|
|
126
|
-
if (
|
|
126
|
+
if (o[t++] = e, e.flags &= -3, e = e.subs?.sub, e === void 0 || !(e.flags & 2)) break;
|
|
127
127
|
while (!0);
|
|
128
|
-
for (
|
|
129
|
-
let e =
|
|
130
|
-
|
|
128
|
+
for (i = t; n < --t;) {
|
|
129
|
+
let e = o[n];
|
|
130
|
+
o[n++] = o[t], o[t] = e;
|
|
131
131
|
}
|
|
132
132
|
},
|
|
133
133
|
unwatched(e) {
|
|
134
|
-
"getter" in e ? e.depsTail !== void 0 && (e.flags = 17,
|
|
134
|
+
"getter" in e ? e.depsTail !== void 0 && (e.flags = 17, C(e)) : "currentValue" in e || ("fn" in e ? x.call(e) : S.call(e));
|
|
135
135
|
}
|
|
136
136
|
});
|
|
137
|
-
function
|
|
138
|
-
let t =
|
|
139
|
-
return
|
|
137
|
+
function f(e) {
|
|
138
|
+
let t = a;
|
|
139
|
+
return a = e, t;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
return
|
|
141
|
+
function p(e) {
|
|
142
|
+
return y.bind({
|
|
143
143
|
currentValue: e,
|
|
144
144
|
pendingValue: e,
|
|
145
145
|
subs: void 0,
|
|
@@ -147,8 +147,8 @@ function m(e) {
|
|
|
147
147
|
flags: 1
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
let
|
|
150
|
+
function m(e) {
|
|
151
|
+
let t = {
|
|
152
152
|
fn: e,
|
|
153
153
|
cleanup: void 0,
|
|
154
154
|
subs: void 0,
|
|
@@ -156,115 +156,115 @@ function h(e) {
|
|
|
156
156
|
deps: void 0,
|
|
157
157
|
depsTail: void 0,
|
|
158
158
|
flags: 6
|
|
159
|
-
},
|
|
160
|
-
|
|
159
|
+
}, r = f(t);
|
|
160
|
+
r !== void 0 && (s(t, r, 0), r.flags |= 64);
|
|
161
161
|
try {
|
|
162
|
-
++
|
|
162
|
+
++n, t.cleanup = t.fn();
|
|
163
163
|
} finally {
|
|
164
|
-
--
|
|
164
|
+
--n, a = r, t.flags &= -5;
|
|
165
165
|
}
|
|
166
|
-
return
|
|
166
|
+
return x.bind(t);
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
if (e.flags &
|
|
168
|
+
function h(e) {
|
|
169
|
+
if (e.flags & 64) {
|
|
170
170
|
let t = e.depsTail;
|
|
171
171
|
for (; t !== void 0;) {
|
|
172
172
|
let n = t.prevDep, r = t.dep;
|
|
173
|
-
!("getter" in r) && !("currentValue" in r) &&
|
|
173
|
+
!("getter" in r) && !("currentValue" in r) && c(t, e), t = n;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
e.depsTail = void 0, e.flags = 5;
|
|
177
|
-
let
|
|
177
|
+
let n = f(e);
|
|
178
178
|
try {
|
|
179
|
-
++
|
|
180
|
-
let
|
|
181
|
-
return
|
|
179
|
+
++t;
|
|
180
|
+
let n = e.value;
|
|
181
|
+
return n !== (e.value = e.getter(n));
|
|
182
182
|
} finally {
|
|
183
|
-
|
|
183
|
+
a = n, e.flags &= -5, w(e);
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function g(e) {
|
|
187
187
|
return e.flags = 1, e.currentValue !== (e.currentValue = e.pendingValue);
|
|
188
188
|
}
|
|
189
|
-
function
|
|
190
|
-
let
|
|
191
|
-
if (
|
|
192
|
-
if (
|
|
189
|
+
function _(e) {
|
|
190
|
+
let r = e.flags;
|
|
191
|
+
if (r & 16 || r & 32 && u(e.deps, e)) {
|
|
192
|
+
if (r & 64) {
|
|
193
193
|
let t = e.depsTail;
|
|
194
194
|
for (; t !== void 0;) {
|
|
195
195
|
let n = t.prevDep, r = t.dep;
|
|
196
|
-
!("getter" in r) && !("currentValue" in r) &&
|
|
196
|
+
!("getter" in r) && !("currentValue" in r) && c(t, e), t = n;
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
if (e.cleanup && (
|
|
199
|
+
if (e.cleanup && (b(e), !e.flags)) return;
|
|
200
200
|
e.depsTail = void 0, e.flags = 6;
|
|
201
|
-
let
|
|
201
|
+
let i = f(e);
|
|
202
202
|
try {
|
|
203
|
-
++
|
|
203
|
+
++t, ++n, e.cleanup = e.fn();
|
|
204
204
|
} finally {
|
|
205
|
-
--
|
|
205
|
+
--n, a = i, e.flags &= -5, w(e);
|
|
206
206
|
}
|
|
207
|
-
} else e.deps !== void 0 && (e.flags = 2 |
|
|
207
|
+
} else e.deps !== void 0 && (e.flags = 2 | r & 64);
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function v() {
|
|
210
210
|
try {
|
|
211
|
-
for (;
|
|
212
|
-
let e =
|
|
213
|
-
|
|
211
|
+
for (; r < i;) {
|
|
212
|
+
let e = o[r];
|
|
213
|
+
o[r++] = void 0, _(e);
|
|
214
214
|
}
|
|
215
215
|
} finally {
|
|
216
|
-
for (;
|
|
217
|
-
let e =
|
|
218
|
-
|
|
216
|
+
for (; r < i;) {
|
|
217
|
+
let e = o[r];
|
|
218
|
+
o[r++] = void 0, e.flags |= 10;
|
|
219
219
|
}
|
|
220
|
-
|
|
220
|
+
r = 0, i = 0;
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function y(...e) {
|
|
224
224
|
if (e.length) {
|
|
225
225
|
if (this.pendingValue !== (this.pendingValue = e[0])) {
|
|
226
226
|
this.flags = 17;
|
|
227
227
|
let e = this.subs;
|
|
228
|
-
e !== void 0 && (
|
|
228
|
+
e !== void 0 && (l(e, !!n), v());
|
|
229
229
|
}
|
|
230
230
|
} else {
|
|
231
|
-
if (this.flags & 16 &&
|
|
231
|
+
if (this.flags & 16 && g(this)) {
|
|
232
232
|
let e = this.subs;
|
|
233
|
-
e !== void 0 &&
|
|
233
|
+
e !== void 0 && d(e);
|
|
234
234
|
}
|
|
235
|
-
let e =
|
|
236
|
-
return e !== void 0 &&
|
|
235
|
+
let e = a;
|
|
236
|
+
return e !== void 0 && s(this, e, t), this.currentValue;
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function b(e) {
|
|
240
240
|
let t = e.cleanup;
|
|
241
241
|
e.cleanup = void 0;
|
|
242
|
-
let n =
|
|
243
|
-
|
|
242
|
+
let n = a;
|
|
243
|
+
a = void 0;
|
|
244
244
|
try {
|
|
245
245
|
t();
|
|
246
246
|
} finally {
|
|
247
|
-
|
|
247
|
+
a = n;
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
|
|
250
|
+
function x() {
|
|
251
|
+
S.call(this), this.cleanup && b(this);
|
|
252
252
|
}
|
|
253
|
-
function
|
|
254
|
-
this.flags = 0,
|
|
253
|
+
function S() {
|
|
254
|
+
this.flags = 0, C(this);
|
|
255
255
|
let e = this.subs;
|
|
256
|
-
e !== void 0 &&
|
|
256
|
+
e !== void 0 && c(e);
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function C(e) {
|
|
259
259
|
let t = e.depsTail;
|
|
260
260
|
for (; t !== void 0;) {
|
|
261
261
|
let n = t.prevDep;
|
|
262
|
-
|
|
262
|
+
c(t, e), t = n;
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function w(e) {
|
|
266
266
|
let t = e.depsTail, n = t === void 0 ? e.deps : t.nextDep;
|
|
267
|
-
for (; n !== void 0;) n =
|
|
267
|
+
for (; n !== void 0;) n = c(n, e);
|
|
268
268
|
}
|
|
269
269
|
//#endregion
|
|
270
|
-
export {
|
|
270
|
+
export { p as n, m as t };
|
package/lib/form/form_item.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RuleType } from "ph-utils
|
|
1
|
+
import type { RuleType } from "ph-utils";
|
|
2
2
|
import ContextProvide from "../utils/context_provide";
|
|
3
3
|
import type { FormItemSignal } from "./types";
|
|
4
4
|
type FormItemState = {
|
|
@@ -33,8 +33,8 @@ export default class FormItem extends ContextProvide<FormItemSignal, FormItemSta
|
|
|
33
33
|
message?: string;
|
|
34
34
|
}): void;
|
|
35
35
|
render_v2(): {
|
|
36
|
-
template
|
|
37
|
-
style
|
|
36
|
+
template: DocumentFragment;
|
|
37
|
+
style: string[];
|
|
38
38
|
};
|
|
39
39
|
render(): DocumentFragment;
|
|
40
40
|
private _updateRequired;
|
package/lib/form/form_item.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../form_item-
|
|
1
|
+
import { t as e } from "../form_item-BqPMRABd.js";
|
|
2
2
|
export { e as default };
|
package/lib/form/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Validator from "ph-utils
|
|
2
|
-
import type { SchemaType } from "ph-utils
|
|
1
|
+
import { Validator } from "ph-utils";
|
|
2
|
+
import type { SchemaType } from "ph-utils";
|
|
3
3
|
import type { FormSignal } from "./types";
|
|
4
4
|
import BaseComponent from "../base";
|
|
5
5
|
interface FormState {
|
|
@@ -39,7 +39,7 @@ export default class Form extends BaseComponent<FormState> {
|
|
|
39
39
|
_formAction: (e: CustomEvent) => void;
|
|
40
40
|
_valueChange: (e: CustomEvent) => void;
|
|
41
41
|
setValidateErrors(errs: Record<string, string | undefined>, all?: string | string[] | boolean): void;
|
|
42
|
-
validateField(field: string | string[]): void
|
|
42
|
+
validateField(field: string | string[]): Promise<void>;
|
|
43
43
|
clearValidate(): void;
|
|
44
44
|
reset(): void;
|
|
45
45
|
submit(): void;
|
package/lib/form/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../form-
|
|
1
|
+
import { t as e } from "../form-DJxvBiLy.js";
|
|
2
2
|
export { e as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
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 { n as i } from "./esm-
|
|
4
|
-
import { $one as a, formatClass as o, off as s, on as c } from "ph-utils/
|
|
5
|
-
import l from "ph-utils
|
|
3
|
+
import { n as i } from "./esm-DAha108i.js";
|
|
4
|
+
import { $one as a, formatClass as o, off as s, on as c } from "ph-utils/browser";
|
|
5
|
+
import { Validator as l } from "ph-utils";
|
|
6
6
|
//#region src/components/form/index.less?inline
|
|
7
7
|
var u = ":host{display:block}.l-form{gap:var(--l-form-gap,20px);flex-flow:column;display:flex}.l-form-inline{gap:var(--l-form-gap,20px);flex-flow:wrap;display:flex}.l-form.l-form-inline{--l-form-item-display:flex}.l-form.l-form--left{--l-form-label-align:left}.l-form.l-form--top{--l-form-item-display:grid;--l-form-label-align:left;--l-form-label-empty-display:none;grid-template-columns:1fr}", d = class extends e {
|
|
8
8
|
static baseName = "form";
|
|
@@ -47,7 +47,6 @@ var u = ":host{display:block}.l-form{gap:var(--l-form-gap,20px);flex-flow:column
|
|
|
47
47
|
default:
|
|
48
48
|
let o = n(a, !1, e);
|
|
49
49
|
this._state[t(e)] = o;
|
|
50
|
-
break;
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
52
|
updateDOM(e) {
|
|
@@ -111,15 +110,15 @@ var u = ":host{display:block}.l-form{gap:var(--l-form-gap,20px);flex-flow:column
|
|
|
111
110
|
if (!t) return;
|
|
112
111
|
this._data ??= {};
|
|
113
112
|
let i = Object.hasOwn(this._data, t);
|
|
114
|
-
this._data[t] = n, !this._state.novalidate && i && r
|
|
113
|
+
if (this._data[t] = n, !this._state.novalidate && i && r) try {
|
|
115
114
|
let e = this.errors();
|
|
116
115
|
e[t] = void 0, this.setValidateErrors({ ...e });
|
|
117
|
-
}
|
|
116
|
+
} catch (e) {
|
|
118
117
|
this.setValidateErrors({
|
|
119
118
|
...this.errors(),
|
|
120
119
|
...e.detail
|
|
121
120
|
});
|
|
122
|
-
}
|
|
121
|
+
}
|
|
123
122
|
};
|
|
124
123
|
setValidateErrors(e, t = !0) {
|
|
125
124
|
this._state.emitError ? this.emit("validate-error", { detail: {
|
|
@@ -127,29 +126,28 @@ var u = ":host{display:block}.l-form{gap:var(--l-form-gap,20px);flex-flow:column
|
|
|
127
126
|
all: t
|
|
128
127
|
} }) : this.errors(e);
|
|
129
128
|
}
|
|
130
|
-
validateField(e) {
|
|
131
|
-
let t =
|
|
129
|
+
async validateField(e) {
|
|
130
|
+
let t = !1, n = {};
|
|
132
131
|
if (this._data != null) {
|
|
133
|
-
if (Array.isArray(e)) for (let
|
|
134
|
-
let
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
for (let e = 0, r = t.length; e < r; e++) {
|
|
141
|
-
let r = t[e];
|
|
142
|
-
r.status === "rejected" ? n = {
|
|
143
|
-
...n,
|
|
144
|
-
...r.reason.detail
|
|
145
|
-
} : n[r.value.key] = void 0;
|
|
132
|
+
if (Array.isArray(e)) for (let r = 0, i = e.length; r < i; r++) {
|
|
133
|
+
let i = e[r];
|
|
134
|
+
try {
|
|
135
|
+
n[i] = void 0;
|
|
136
|
+
} catch (e) {
|
|
137
|
+
n[i] = e.detail, t = !0;
|
|
138
|
+
break;
|
|
146
139
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
140
|
+
}
|
|
141
|
+
else try {
|
|
142
|
+
n[e] = void 0;
|
|
143
|
+
} catch (r) {
|
|
144
|
+
n[e] = r.detail, t = !0;
|
|
145
|
+
}
|
|
146
|
+
if (t) {
|
|
147
|
+
let e = /* @__PURE__ */ Error("validate field error");
|
|
148
|
+
return e.detail = n, Promise.reject(e);
|
|
149
|
+
}
|
|
150
|
+
return Promise.resolve();
|
|
153
151
|
}
|
|
154
152
|
}
|
|
155
153
|
clearValidate() {
|
|
@@ -161,16 +159,16 @@ var u = ":host{display:block}.l-form{gap:var(--l-form-gap,20px);flex-flow:column
|
|
|
161
159
|
this.resetCtx(e >= 100 ? 1 : e + 1);
|
|
162
160
|
}
|
|
163
161
|
submit() {
|
|
164
|
-
this._state.novalidate ? this.
|
|
165
|
-
e.result ? this.
|
|
162
|
+
this._state.novalidate ? this.emit("submit", { detail: this.getData() }) : this.validate().then((e) => {
|
|
163
|
+
e.result ? this.emit("submit", { detail: this.getData() }) : this._state.emitError ? this.emit("validate-error", { detail: {
|
|
166
164
|
errors: e.errors,
|
|
167
165
|
all: !0
|
|
168
166
|
} }) : this.errors(e.errors);
|
|
169
167
|
});
|
|
170
168
|
}
|
|
171
|
-
|
|
169
|
+
validate() {
|
|
172
170
|
try {
|
|
173
|
-
return
|
|
171
|
+
return this.validator.validate(this._data || {}), Promise.resolve({
|
|
174
172
|
result: !0,
|
|
175
173
|
errors: {}
|
|
176
174
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "./base.js";
|
|
2
2
|
import { parseAttrValue as t, stopSignal as n } from "./utils/index.js";
|
|
3
|
-
import { t as r } from "./esm-
|
|
4
|
-
import { getAttr as i } from "ph-utils/
|
|
3
|
+
import { t as r } from "./esm-DAha108i.js";
|
|
4
|
+
import { getAttr as i } from "ph-utils/browser";
|
|
5
5
|
//#region src/components/form/form_inner.ts
|
|
6
6
|
var a = class extends e {
|
|
7
7
|
_disabled = !1;
|
|
@@ -59,9 +59,7 @@ var a = class extends e {
|
|
|
59
59
|
let i = t(r, !1, e);
|
|
60
60
|
this.innerBlockChange(i);
|
|
61
61
|
break;
|
|
62
|
-
default:
|
|
63
|
-
this.attributeChange(e, n, r);
|
|
64
|
-
break;
|
|
62
|
+
default: this.attributeChange(e, n, r);
|
|
65
63
|
}
|
|
66
64
|
}
|
|
67
65
|
attributeChange(e, t, n) {}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { kebabToCamel as e, parseAttrValue as t, stopSignal as n, unitNumberStr as r } from "./utils/index.js";
|
|
2
|
-
import
|
|
3
|
-
import o from "./
|
|
4
|
-
import { $$ as s, $one as c, addClass as l, removeClass as u } from "ph-utils/
|
|
2
|
+
import i from "./utils/context_provide.js";
|
|
3
|
+
import { n as a, t as o } from "./esm-DAha108i.js";
|
|
4
|
+
import { $$ as s, $one as c, addClass as l, removeClass as u } from "ph-utils/browser";
|
|
5
5
|
//#region src/components/form/form_item.less?inline
|
|
6
|
-
var d = ":host{display:var(--l-form-item-display,flex);font-size:14px}.l-form-item__label{text-align:var(--l-form-label-align,right);width:var(--l-form-label-width,auto);height:var(--l-form-label-height,var(--l-form-control-height,32px));line-height:var(--l-form-label-height,var(--l-form-control-height,32px));color:#606266;box-sizing:border-box;padding:0 10px 0 0;display:inline-block}.l-form-item__label:empty{display:var(--l-form-label-empty-display,inline-block)}:host(.is-required) .l-form-item__label:before{content:\"*\";color:var(--l-warn-color,#f56c6c);vertical-align:middle;margin-right:4px}.l-form-item__content{flex:1;align-items:center;display:flex;position:relative}.l-form-item__error{color:var(--nt-error-color,#ed3f13);padding-top:3px;font-size:12px;line-height:1;position:absolute;top:100%;left:0}:host(.l-form-item--left){--l-form-label-align:left}:host(.l-form-item--top){--l-form-item-display:grid;--l-form-label-align:left;--l-form-label-empty-display:none;grid-template-columns:1fr}", f = class extends
|
|
6
|
+
var d = ":host{display:var(--l-form-item-display,flex);font-size:14px}.l-form-item__label{text-align:var(--l-form-label-align,right);width:var(--l-form-label-width,auto);height:var(--l-form-label-height,var(--l-form-control-height,32px));line-height:var(--l-form-label-height,var(--l-form-control-height,32px));color:#606266;box-sizing:border-box;padding:0 10px 0 0;display:inline-block}.l-form-item__label:empty{display:var(--l-form-label-empty-display,inline-block)}:host(.is-required) .l-form-item__label:before{content:\"*\";color:var(--l-warn-color,#f56c6c);vertical-align:middle;margin-right:4px}.l-form-item__content{flex:1;align-items:center;display:flex;position:relative}.l-form-item__error{color:var(--nt-error-color,#ed3f13);padding-top:3px;font-size:12px;line-height:1;position:absolute;top:100%;left:0}:host(.l-form-item--left){--l-form-label-align:left}:host(.l-form-item--top){--l-form-item-display:grid;--l-form-label-align:left;--l-form-label-empty-display:none;grid-template-columns:1fr}", f = class extends i {
|
|
7
7
|
static baseName = "form-item";
|
|
8
8
|
formErrors;
|
|
9
9
|
_errorSignalStop;
|
|
@@ -11,7 +11,7 @@ var d = ":host{display:var(--l-form-item-display,flex);font-size:14px}.l-form-it
|
|
|
11
11
|
super(), this.version = 2, this.contextEventName = "form-item-context-request", this._state = {
|
|
12
12
|
labelPosition: "right",
|
|
13
13
|
required: !1
|
|
14
|
-
}, this.context =
|
|
14
|
+
}, this.context = a({ innerBlock: !1 });
|
|
15
15
|
}
|
|
16
16
|
static get observedAttributes() {
|
|
17
17
|
return [
|
|
@@ -55,9 +55,7 @@ var d = ":host{display:var(--l-form-item-display,flex);font-size:14px}.l-form-it
|
|
|
55
55
|
});
|
|
56
56
|
break;
|
|
57
57
|
case "label-width":
|
|
58
|
-
case "label-height":
|
|
59
|
-
this._state[e(n)] = r(a);
|
|
60
|
-
break;
|
|
58
|
+
case "label-height": this._state[e(n)] = r(a);
|
|
61
59
|
}
|
|
62
60
|
}
|
|
63
61
|
updateDOM(e) {
|
|
@@ -66,7 +64,7 @@ var d = ":host{display:var(--l-form-item-display,flex);font-size:14px}.l-form-it
|
|
|
66
64
|
connectedCallback() {
|
|
67
65
|
super.connectedCallback(), this._updateRequired(), this._parseSchema(), this.emitInject("form-context-request", ((e, t) => {
|
|
68
66
|
this.formErrors = t;
|
|
69
|
-
})), this._errorSignalStop =
|
|
67
|
+
})), this._errorSignalStop = o(() => {
|
|
70
68
|
let e = this.context().prop, t = this.formErrors ? this.formErrors() : null;
|
|
71
69
|
e && t && (this._state.error = t[e], this._updateError());
|
|
72
70
|
});
|
package/lib/icon/arrow_down.js
CHANGED
package/lib/icon/arrow_left.js
CHANGED
package/lib/icon/arrow_right.js
CHANGED
package/lib/icon/arrow_up.js
CHANGED
package/lib/icon/base.d.ts
CHANGED
|
@@ -15,8 +15,8 @@ export default class BaseIcon extends BaseComponent<ColorState> {
|
|
|
15
15
|
private _updateSize;
|
|
16
16
|
private _updateColor;
|
|
17
17
|
render_v2(): {
|
|
18
|
-
template
|
|
19
|
-
style
|
|
18
|
+
template: any;
|
|
19
|
+
style: string;
|
|
20
20
|
};
|
|
21
21
|
renderChildren(): string;
|
|
22
22
|
createEl(tagName: string): SVGElement;
|
package/lib/icon/base.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../base-
|
|
1
|
+
import { t as e } from "../base-Dyj1rzaK.js";
|
|
2
2
|
export { e as default };
|
package/lib/icon/calendar.js
CHANGED
package/lib/icon/caret_bottom.js
CHANGED
package/lib/icon/caret_top.js
CHANGED
package/lib/icon/close.js
CHANGED
package/lib/icon/close_filled.js
CHANGED
package/lib/icon/d_arrow_left.js
CHANGED