litos-ui 0.18.3 → 0.18.5
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/button/index.js +1 -1
- package/lib/{button-DEm6CutF.js → button-CC5NBWtI.js} +1 -1
- package/lib/calendar/index.js +1 -1
- package/lib/carousel/index.js +1 -1
- package/lib/carousel/item.js +1 -1
- 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-B0XraJvb.js → check-BDOpD_0-.js} +2 -2
- package/lib/{check-CvGaONEx.js → check-CrlZ7zVL.js} +3 -3
- package/lib/checkbox-D_bZGoUD.js +16 -0
- package/lib/collapse/index.js +1 -1
- package/lib/collapse/item.js +1 -1
- package/lib/{collapse-C3IRHLeg.js → collapse-BRxYoeJx.js} +1 -1
- package/lib/color_picker/index.js +1 -1
- package/lib/{color_picker-DYN8DCng.js → color_picker-AaFcIczZ.js} +2 -2
- package/lib/date_picker/index.js +1 -1
- package/lib/{date_picker-DQGoiN8v.js → date_picker-HjkRma9j.js} +2 -2
- package/lib/date_picker_ori/index.js +1 -1
- package/lib/{date_picker_ori-aRuSSi9D.js → date_picker_ori-1IOHZsan.js} +1 -1
- package/lib/description_panel/index.js +1 -1
- package/lib/dialog/dialog_container.js +1 -1
- package/lib/esm-Cir9D6cn.js +270 -0
- package/lib/form/form_inner.d.ts +4 -1
- package/lib/form/form_item.js +1 -1
- package/lib/form/index.d.ts +13 -2
- package/lib/form/index.js +1 -1
- package/lib/{form-CNWykMNM.js → form-BvZHaqAt.js} +49 -19
- package/lib/{form_inner-DR9tyB_r.js → form_inner-52DR1IPu.js} +13 -4
- package/lib/{form_item-Clu9QKRa.js → form_item-DtqChzc3.js} +1 -1
- 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.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_preview-CYEup07F.js → image_preview-BeJzfEoF.js} +1 -1
- package/lib/index.js +36 -36
- package/lib/input/index.js +3 -3
- package/lib/{item-DRsOV_Tc.js → item-Dq6M7lxw.js} +1 -1
- package/lib/list/index.js +1 -1
- package/lib/{list-CU7vHS6s.js → list-Dz1Ya118.js} +1 -1
- package/lib/loading/index.js +7 -6
- package/lib/mask/index.js +1 -1
- package/lib/md_input/index.js +1 -1
- package/lib/{md_input-DSQx5TMW.js → md_input-DN3ceqsw.js} +1 -1
- package/lib/menu/index.js +1 -1
- package/lib/modal/index.js +1 -1
- package/lib/modal/modal_box.js +3 -3
- package/lib/page_header/index.js +1 -1
- package/lib/pagination/index.js +1 -1
- package/lib/polygon/index.js +1 -1
- package/lib/qrcode/index.js +1 -1
- package/lib/{radio-2mNSYujz.js → radio-C7dkhgwc.js} +1 -1
- package/lib/select/index.d.ts +24 -15
- package/lib/select/index.js +1 -1
- package/lib/select-Cis6kRjQ.js +351 -0
- package/lib/select_ori/index.d.ts +5 -0
- package/lib/select_ori/index.js +2 -48
- package/lib/select_ori-DcJbNYYr.js +57 -0
- package/lib/space/index.js +1 -1
- package/lib/switch/index.js +1 -1
- package/lib/{switch-BaVBi5Ip.js → switch-UyhlgW7F.js} +1 -1
- package/lib/tabbar/index.js +1 -1
- package/lib/tabbar/item.js +1 -1
- package/lib/table/index.js +1 -1
- package/lib/tag/index.js +1 -1
- package/lib/theme/index.js +1 -1
- package/lib/{theme-BRTI2-Yk.js → theme-Barcq234.js} +5 -2
- package/lib/utils/event.js +1 -1
- package/lib/utils/popover.js +11 -14
- package/package.json +13 -10
- package/styles/vars.css +1 -2
- package/types/preact.d.ts +128 -0
- package/lib/checkbox-DbWsmAaL.js +0 -16
- package/lib/esm-sVEoAVPu.js +0 -244
- package/lib/select-CAgggYh7.js +0 -326
- /package/lib/{animation-CTt9qgA7.js → animation-DStAHzod.js} +0 -0
- /package/lib/{base-Dm0WS1pK.js → base-LvfO4mmL.js} +0 -0
- /package/lib/{calendar-GpYHNmXG.js → calendar-Clbg3qot.js} +0 -0
- /package/lib/{carousel-dT3FJPQo.js → carousel-Dgirxwzb.js} +0 -0
- /package/lib/{description_panel-BY2yljeC.js → description_panel-DaqVcA6-.js} +0 -0
- /package/lib/{dialog_container-DcN87wj0.js → dialog_container-CcTyfoaD.js} +0 -0
- /package/lib/{image-COPKk8Jm.js → image-BCUhVAFo.js} +0 -0
- /package/lib/{input-UfukfZIy.js → input-DUBlLEXS.js} +0 -0
- /package/lib/{input_inner-BKJg9n9A.js → input_inner-x4GfLGjj.js} +0 -0
- /package/lib/{item-B7Elh5xE.js → item-42bYhAkZ.js} +0 -0
- /package/lib/{item-CvoJt3wp.js → item-CX8C9X57.js} +0 -0
- /package/lib/{mask-CEznzwji.js → mask-BlDl9u8F.js} +0 -0
- /package/lib/{menu-CzV6lOlw.js → menu-BOmVa4xN.js} +0 -0
- /package/lib/{modal-DWyWrN-D.js → modal-cjj3Nw1B.js} +0 -0
- /package/lib/{page_header-BJkEstRw.js → page_header-BfuWJIdd.js} +0 -0
- /package/lib/{pagination-5t7AOeFV.js → pagination-DpOSOFwl.js} +0 -0
- /package/lib/{polygon-C4Ow2lxi.js → polygon-BY1FAACc.js} +0 -0
- /package/lib/{qrcode-BKG2MibP.js → qrcode-Bgr8gJzA.js} +0 -0
- /package/lib/{space-Bv-p0DL8.js → space-BT_dVhhv.js} +0 -0
- /package/lib/{tabbar-CI1xSj1G.js → tabbar-DO0kB58Y.js} +0 -0
- /package/lib/{table-DfL2hFqA.js → table-saZMryiV.js} +0 -0
- /package/lib/{tag-72DwCkvq.js → tag-BtDcKdxo.js} +0 -0
package/lib/button/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../button-
|
|
1
|
+
import { t as e } from "../button-CC5NBWtI.js";
|
|
2
2
|
export { e as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
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 { t as i } from "./animation-
|
|
3
|
+
import { t as i } from "./animation-DStAHzod.js";
|
|
4
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/dom";
|
|
5
5
|
import { adjust as f } from "ph-utils/color";
|
|
6
6
|
//#region src/components/button/index.less?inline
|
package/lib/calendar/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../calendar-
|
|
1
|
+
import { t as e } from "../calendar-Clbg3qot.js";
|
|
2
2
|
export { e as default };
|
package/lib/carousel/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../carousel-
|
|
1
|
+
import { t as e } from "../carousel-Dgirxwzb.js";
|
|
2
2
|
export { e as default };
|
package/lib/carousel/item.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../item-
|
|
1
|
+
import { t as e } from "../item-42bYhAkZ.js";
|
|
2
2
|
export { e as default };
|
package/lib/check/checkbox.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../checkbox-
|
|
1
|
+
import { t as e } from "../checkbox-D_bZGoUD.js";
|
|
2
2
|
export { e as default };
|
package/lib/check/radio.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../radio-
|
|
1
|
+
import { t as e } from "../radio-C7dkhgwc.js";
|
|
2
2
|
export { e as default };
|
package/lib/check/radio_group.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { unitNumberStr as e } from "./utils/index.js";
|
|
2
|
-
import { n as t } from "./esm-
|
|
3
|
-
import { t as n } from "./form_inner-
|
|
2
|
+
import { n as t } from "./esm-Cir9D6cn.js";
|
|
3
|
+
import { t as n } from "./form_inner-52DR1IPu.js";
|
|
4
4
|
import { $$ as r, off as i, on as a } from "ph-utils/dom";
|
|
5
5
|
//#region src/components/check/index.less?inline
|
|
6
6
|
var o = ":host{align-items:center;gap:var(--l-check-gap,0px);display:flex}", s = class extends n {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parseAttrValue as e, stopSignal as t } from "./utils/index.js";
|
|
2
|
-
import { t as n } from "./esm-
|
|
3
|
-
import { t as r } from "./form_inner-
|
|
2
|
+
import { t as n } from "./esm-Cir9D6cn.js";
|
|
3
|
+
import { t as r } from "./form_inner-52DR1IPu.js";
|
|
4
4
|
import { $$ as i, addClass as a, off as o, on as s, removeClass as c, toggleClass as l } from "ph-utils/dom";
|
|
5
5
|
//#region src/components/check/check.ts
|
|
6
6
|
var u = class extends r {
|
|
@@ -112,6 +112,6 @@ var u = class extends r {
|
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
_doChangeAction() {}
|
|
115
|
-
}, d = ":host{
|
|
115
|
+
}, d = ":host{cursor:pointer;outline:none;align-items:center;width:auto;transition:color .3s,border-color .3s,background-color .3s;display:inline-flex;position:relative}.l-check__input{z-index:-1;opacity:0;width:0;height:0;margin:0;position:absolute}.l-check__inner{width:var(--l-check-size,14px);height:var(--l-check-size,14px);border-radius:var(--l-check-border-radius,var(--l-border-radius,13px));box-sizing:border-box;border:1px solid #dcddd9;flex-shrink:0;justify-content:center;align-items:center;margin-right:5px;transition:border-color .3s ease-in-out;display:flex;position:relative}.l-check__label{cursor:inherit;line-height:1;transition:color .3s}:host(.is-checked) .l-check__inner{border-color:var(--l-primary-color,#722ed1)}:host(.is-disabled){cursor:not-allowed}:host(.is-disabled) .l-check__label{color:var(--l-disabled-color,#e6e6e6)}:host([button]){height:var(--l-form-control-height,32px);border-radius:inherit;border:1px solid #c0c4cc;border-left-width:0;justify-content:center;margin-left:0;padding:0 15px}:host([button]:first-child){border-top-left-radius:var(--l-check-border-radius,var(--l-border-radius,13px));border-bottom-left-radius:var(--l-check-border-radius,var(--l-border-radius,13px));border-left-width:1px}:host([button]:last-child){border-top-right-radius:var(--l-check-border-radius,var(--l-border-radius,13px));border-bottom-right-radius:var(--l-check-border-radius,var(--l-border-radius,13px))}:host([button].is-checked){background-color:var(--l-primary-color,#722ed1);color:#fff;border-color:var(--l-primary-color,#722ed1);border-right-color:#fff}:host([button].is-checked:last-child){border-right-color:var(--l-primary-color,#722ed1)}";
|
|
116
116
|
//#endregion
|
|
117
117
|
export { u as n, d as t };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { n as e, t } from "./check-CrlZ7zVL.js";
|
|
2
|
+
//#region src/components/check/checkbox.less?inline
|
|
3
|
+
var n = ":host(.is-indeterminate) .l-check__inner{background-color:var(--l-primary-color,#722ed1)}:host(.is-indeterminate) .l-check__inner:after{content:\"\";width:calc(var(--l-check-size,14px) * .4);border:none;border-bottom:1px solid #fff;height:1px;margin-top:0;display:block;transform:rotate(0)}.l-check__inner:after,:host(.is-checked) .l-check__inner:after{content:\"\";width:calc(var(--l-check-size,14px) * .6);height:calc(var(--l-check-size,14px) * .3);border-top:none;border-bottom:1px solid #0000;border-left:1px solid #0000;border-right:none;margin-top:-3px;transition:border-color .2s ease-in-out;display:block;transform:rotate(-45deg)}:host(.is-checked) .l-check__inner{background-color:var(--l-primary-color,#722ed1)}:host(.is-checked) .l-check__inner:after{border-color:#fff}:host(.is-disabled) .l-check__inner{background-color:var(--l-disabled-color,#e6e6e6);border-color:var(--l-disabled-color,#e6e6e6)}", r = class extends e {
|
|
4
|
+
static baseName = "checkbox";
|
|
5
|
+
constructor() {
|
|
6
|
+
super(), this._inputType = "checkbox";
|
|
7
|
+
}
|
|
8
|
+
connectedCallback() {
|
|
9
|
+
this.loadStyleText([t, n]), super.connectedCallback();
|
|
10
|
+
}
|
|
11
|
+
_doChangeAction() {
|
|
12
|
+
this.getChecked() ? this.setChecked(!1) : this.setChecked(!0), this.emitChange();
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { r as t };
|
package/lib/collapse/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../collapse-
|
|
1
|
+
import { t as e } from "../collapse-BRxYoeJx.js";
|
|
2
2
|
export { e as default };
|
package/lib/collapse/item.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../item-
|
|
1
|
+
import { t as e } from "../item-Dq6M7lxw.js";
|
|
2
2
|
export { e as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
3
|
+
import { n as i } from "./esm-Cir9D6cn.js";
|
|
4
4
|
import { $$ as a, off as o, on as s } from "ph-utils/dom";
|
|
5
5
|
//#region src/components/collapse/index.less?inline
|
|
6
6
|
var c = ":host{--l-collapse-border-color:var(--l-border-color,#dedede);--l-collapse-border-radius:0px;gap:var(--l-collapse-gap,0px);box-sizing:border-box;grid-template-columns:1fr;display:grid}:host(.l-collapse-grid){grid-template-columns:repeat(auto-fill,minmax(200px,1fr));align-items:start}", l = class extends e {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../color_picker-
|
|
1
|
+
import { t as e } from "../color_picker-AaFcIczZ.js";
|
|
2
2
|
export { e as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { initAttr as e, setAttrs as t } from "./utils/index.js";
|
|
2
|
-
import { t as n } from "./form_inner-
|
|
3
|
-
import { t as r } from "./input-
|
|
2
|
+
import { t as n } from "./form_inner-52DR1IPu.js";
|
|
3
|
+
import { t as r } from "./input-DUBlLEXS.js";
|
|
4
4
|
import { $one as i, off as a, on as o } from "ph-utils/dom";
|
|
5
5
|
//#region src/components/color_picker/index.less?inline
|
|
6
6
|
var s = ":host{--l-input-width:60px}", c = class extends n {
|
package/lib/date_picker/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { unitNumberStr as e } from "./utils/index.js";
|
|
2
|
-
import { t } from "./form_inner-
|
|
3
|
-
import { t as n } from "./input_inner-
|
|
2
|
+
import { t } from "./form_inner-52DR1IPu.js";
|
|
3
|
+
import { t as n } from "./input_inner-x4GfLGjj.js";
|
|
4
4
|
import { Popover as r } from "./utils/popover.js";
|
|
5
5
|
import { $$ as i, on as a } from "ph-utils/dom";
|
|
6
6
|
//#region src/components/date_picker/index.less?inline
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../date_picker_ori-
|
|
1
|
+
import { t as e } from "../date_picker_ori-1IOHZsan.js";
|
|
2
2
|
export { e as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { kebabToCamel as e, parseAttrValue as t, unitNumberStr as n } from "./utils/index.js";
|
|
2
|
-
import { t as r } from "./form_inner-
|
|
2
|
+
import { t as r } from "./form_inner-52DR1IPu.js";
|
|
3
3
|
import { $ as i, $$ as a, iterate as o, off as s, on as c } from "ph-utils/dom";
|
|
4
4
|
import { parse as l } from "ph-utils/date";
|
|
5
5
|
//#region src/components/date_picker_ori/index.less?inline
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../description_panel-
|
|
1
|
+
import { t as e } from "../description_panel-DaqVcA6-.js";
|
|
2
2
|
export { e as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../dialog_container-
|
|
1
|
+
import { t as e } from "../dialog_container-CcTyfoaD.js";
|
|
2
2
|
export { e as default };
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
//#region node_modules/.pnpm/alien-signals@3.2.1/node_modules/alien-signals/esm/system.mjs
|
|
2
|
+
function e({ update: e, notify: t, unwatched: n }) {
|
|
3
|
+
return {
|
|
4
|
+
link: r,
|
|
5
|
+
unlink: i,
|
|
6
|
+
propagate: a,
|
|
7
|
+
checkDirty: o,
|
|
8
|
+
shallowPropagate: s
|
|
9
|
+
};
|
|
10
|
+
function r(e, t, n) {
|
|
11
|
+
let r = t.depsTail;
|
|
12
|
+
if (r !== void 0 && r.dep === e) return;
|
|
13
|
+
let i = r === void 0 ? t.deps : r.nextDep;
|
|
14
|
+
if (i !== void 0 && i.dep === e) {
|
|
15
|
+
i.version = n, t.depsTail = i;
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
let a = e.subsTail;
|
|
19
|
+
if (a !== void 0 && a.version === n && a.sub === t) return;
|
|
20
|
+
let o = t.depsTail = e.subsTail = {
|
|
21
|
+
version: n,
|
|
22
|
+
dep: e,
|
|
23
|
+
sub: t,
|
|
24
|
+
prevDep: r,
|
|
25
|
+
nextDep: i,
|
|
26
|
+
prevSub: a,
|
|
27
|
+
nextSub: void 0
|
|
28
|
+
};
|
|
29
|
+
i !== void 0 && (i.prevDep = o), r === void 0 ? t.deps = o : r.nextDep = o, a === void 0 ? e.subs = o : a.nextSub = o;
|
|
30
|
+
}
|
|
31
|
+
function i(e, t = e.sub) {
|
|
32
|
+
let { dep: r, prevDep: i, nextDep: a, nextSub: o, prevSub: s } = e;
|
|
33
|
+
return a === void 0 ? t.depsTail = i : a.prevDep = i, i === void 0 ? t.deps = a : i.nextDep = a, o === void 0 ? r.subsTail = s : o.prevSub = s, s === void 0 ? (r.subs = o) === void 0 && n(r) : s.nextSub = o, a;
|
|
34
|
+
}
|
|
35
|
+
function a(e, n) {
|
|
36
|
+
let r = e.nextSub, i;
|
|
37
|
+
top: do {
|
|
38
|
+
let a = e.sub, o = a.flags;
|
|
39
|
+
if (o & 60 ? o & 12 ? o & 4 ? !(o & 48) && c(e, a) ? (a.flags = o | 40, o &= 1) : o = 0 : a.flags = o & -9 | 32 : o = 0 : (a.flags = o | 32, n && (a.flags |= 8)), o & 2 && t(a), o & 1) {
|
|
40
|
+
let t = a.subs;
|
|
41
|
+
if (t !== void 0) {
|
|
42
|
+
let n = (e = t).nextSub;
|
|
43
|
+
n !== void 0 && (i = {
|
|
44
|
+
value: r,
|
|
45
|
+
prev: i
|
|
46
|
+
}, r = n);
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if ((e = r) !== void 0) {
|
|
51
|
+
r = e.nextSub;
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
for (; i !== void 0;) if (e = i.value, i = i.prev, e !== void 0) {
|
|
55
|
+
r = e.nextSub;
|
|
56
|
+
continue top;
|
|
57
|
+
}
|
|
58
|
+
break;
|
|
59
|
+
} while (!0);
|
|
60
|
+
}
|
|
61
|
+
function o(t, n) {
|
|
62
|
+
let r, i = 0, a = !1;
|
|
63
|
+
top: do {
|
|
64
|
+
let o = t.dep, c = o.flags;
|
|
65
|
+
if (n.flags & 16) a = !0;
|
|
66
|
+
else if ((c & 17) == 17) {
|
|
67
|
+
let t = o.subs;
|
|
68
|
+
e(o) && (t.nextSub !== void 0 && s(t), a = !0);
|
|
69
|
+
} else if ((c & 33) == 33) {
|
|
70
|
+
r = {
|
|
71
|
+
value: t,
|
|
72
|
+
prev: r
|
|
73
|
+
}, t = o.deps, n = o, ++i;
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
if (!a) {
|
|
77
|
+
let e = t.nextDep;
|
|
78
|
+
if (e !== void 0) {
|
|
79
|
+
t = e;
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
for (; i--;) {
|
|
84
|
+
if (t = r.value, r = r.prev, a) {
|
|
85
|
+
let r = n.subs;
|
|
86
|
+
if (e(n)) {
|
|
87
|
+
r.nextSub !== void 0 && s(r), n = t.sub;
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
a = !1;
|
|
91
|
+
} else n.flags &= -33;
|
|
92
|
+
n = t.sub;
|
|
93
|
+
let i = t.nextDep;
|
|
94
|
+
if (i !== void 0) {
|
|
95
|
+
t = i;
|
|
96
|
+
continue top;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return a && !!n.flags;
|
|
100
|
+
} while (!0);
|
|
101
|
+
}
|
|
102
|
+
function s(e) {
|
|
103
|
+
do {
|
|
104
|
+
let n = e.sub, r = n.flags;
|
|
105
|
+
(r & 48) == 32 && (n.flags = r | 16, (r & 6) == 2 && t(n));
|
|
106
|
+
} while ((e = e.nextSub) !== void 0);
|
|
107
|
+
}
|
|
108
|
+
function c(e, t) {
|
|
109
|
+
let n = t.depsTail;
|
|
110
|
+
for (; n !== void 0;) {
|
|
111
|
+
if (n === e) return !0;
|
|
112
|
+
n = n.prevDep;
|
|
113
|
+
}
|
|
114
|
+
return !1;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region node_modules/.pnpm/alien-signals@3.2.1/node_modules/alien-signals/esm/index.mjs
|
|
119
|
+
var t = 64, n = 0, r = 0, i = 0, a = 0, o, s = [], { link: c, unlink: l, propagate: u, checkDirty: d, shallowPropagate: f } = e({
|
|
120
|
+
update(e) {
|
|
121
|
+
return "getter" in e ? g(e) : "currentValue" in e ? _(e) : (e.flags = 1, !0);
|
|
122
|
+
},
|
|
123
|
+
notify(e) {
|
|
124
|
+
let t = a, n = t;
|
|
125
|
+
do
|
|
126
|
+
if (s[t++] = e, e.flags &= -3, e = e.subs?.sub, e === void 0 || !(e.flags & 2)) break;
|
|
127
|
+
while (!0);
|
|
128
|
+
for (a = t; n < --t;) {
|
|
129
|
+
let e = s[n];
|
|
130
|
+
s[n++] = s[t], s[t] = e;
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
unwatched(e) {
|
|
134
|
+
"getter" in e ? e.depsTail !== void 0 && (e.flags = 17, w(e)) : "currentValue" in e || ("fn" in e ? S.call(e) : C.call(e));
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
function p(e) {
|
|
138
|
+
let t = o;
|
|
139
|
+
return o = e, t;
|
|
140
|
+
}
|
|
141
|
+
function m(e) {
|
|
142
|
+
return b.bind({
|
|
143
|
+
currentValue: e,
|
|
144
|
+
pendingValue: e,
|
|
145
|
+
subs: void 0,
|
|
146
|
+
subsTail: void 0,
|
|
147
|
+
flags: 1
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
function h(e) {
|
|
151
|
+
let n = {
|
|
152
|
+
fn: e,
|
|
153
|
+
cleanup: void 0,
|
|
154
|
+
subs: void 0,
|
|
155
|
+
subsTail: void 0,
|
|
156
|
+
deps: void 0,
|
|
157
|
+
depsTail: void 0,
|
|
158
|
+
flags: 6
|
|
159
|
+
}, i = p(n);
|
|
160
|
+
i !== void 0 && (c(n, i, 0), i.flags |= t);
|
|
161
|
+
try {
|
|
162
|
+
++r, n.cleanup = n.fn();
|
|
163
|
+
} finally {
|
|
164
|
+
--r, o = i, n.flags &= -5;
|
|
165
|
+
}
|
|
166
|
+
return S.bind(n);
|
|
167
|
+
}
|
|
168
|
+
function g(e) {
|
|
169
|
+
if (e.flags & t) {
|
|
170
|
+
let t = e.depsTail;
|
|
171
|
+
for (; t !== void 0;) {
|
|
172
|
+
let n = t.prevDep, r = t.dep;
|
|
173
|
+
!("getter" in r) && !("currentValue" in r) && l(t, e), t = n;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
e.depsTail = void 0, e.flags = 5;
|
|
177
|
+
let r = p(e);
|
|
178
|
+
try {
|
|
179
|
+
++n;
|
|
180
|
+
let t = e.value;
|
|
181
|
+
return t !== (e.value = e.getter(t));
|
|
182
|
+
} finally {
|
|
183
|
+
o = r, e.flags &= -5, T(e);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
function _(e) {
|
|
187
|
+
return e.flags = 1, e.currentValue !== (e.currentValue = e.pendingValue);
|
|
188
|
+
}
|
|
189
|
+
function v(e) {
|
|
190
|
+
let i = e.flags;
|
|
191
|
+
if (i & 16 || i & 32 && d(e.deps, e)) {
|
|
192
|
+
if (i & t) {
|
|
193
|
+
let t = e.depsTail;
|
|
194
|
+
for (; t !== void 0;) {
|
|
195
|
+
let n = t.prevDep, r = t.dep;
|
|
196
|
+
!("getter" in r) && !("currentValue" in r) && l(t, e), t = n;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
if (e.cleanup && (x(e), !e.flags)) return;
|
|
200
|
+
e.depsTail = void 0, e.flags = 6;
|
|
201
|
+
let a = p(e);
|
|
202
|
+
try {
|
|
203
|
+
++n, ++r, e.cleanup = e.fn();
|
|
204
|
+
} finally {
|
|
205
|
+
--r, o = a, e.flags &= -5, T(e);
|
|
206
|
+
}
|
|
207
|
+
} else e.deps !== void 0 && (e.flags = 2 | i & t);
|
|
208
|
+
}
|
|
209
|
+
function y() {
|
|
210
|
+
try {
|
|
211
|
+
for (; i < a;) {
|
|
212
|
+
let e = s[i];
|
|
213
|
+
s[i++] = void 0, v(e);
|
|
214
|
+
}
|
|
215
|
+
} finally {
|
|
216
|
+
for (; i < a;) {
|
|
217
|
+
let e = s[i];
|
|
218
|
+
s[i++] = void 0, e.flags |= 10;
|
|
219
|
+
}
|
|
220
|
+
i = 0, a = 0;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
function b(...e) {
|
|
224
|
+
if (e.length) {
|
|
225
|
+
if (this.pendingValue !== (this.pendingValue = e[0])) {
|
|
226
|
+
this.flags = 17;
|
|
227
|
+
let e = this.subs;
|
|
228
|
+
e !== void 0 && (u(e, !!r), y());
|
|
229
|
+
}
|
|
230
|
+
} else {
|
|
231
|
+
if (this.flags & 16 && _(this)) {
|
|
232
|
+
let e = this.subs;
|
|
233
|
+
e !== void 0 && f(e);
|
|
234
|
+
}
|
|
235
|
+
let e = o;
|
|
236
|
+
return e !== void 0 && c(this, e, n), this.currentValue;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
function x(e) {
|
|
240
|
+
let t = e.cleanup;
|
|
241
|
+
e.cleanup = void 0;
|
|
242
|
+
let n = o;
|
|
243
|
+
o = void 0;
|
|
244
|
+
try {
|
|
245
|
+
t();
|
|
246
|
+
} finally {
|
|
247
|
+
o = n;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
function S() {
|
|
251
|
+
C.call(this), this.cleanup && x(this);
|
|
252
|
+
}
|
|
253
|
+
function C() {
|
|
254
|
+
this.flags = 0, w(this);
|
|
255
|
+
let e = this.subs;
|
|
256
|
+
e !== void 0 && l(e);
|
|
257
|
+
}
|
|
258
|
+
function w(e) {
|
|
259
|
+
let t = e.depsTail;
|
|
260
|
+
for (; t !== void 0;) {
|
|
261
|
+
let n = t.prevDep;
|
|
262
|
+
l(t, e), t = n;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
function T(e) {
|
|
266
|
+
let t = e.depsTail, n = t === void 0 ? e.deps : t.nextDep;
|
|
267
|
+
for (; n !== void 0;) n = l(n, e);
|
|
268
|
+
}
|
|
269
|
+
//#endregion
|
|
270
|
+
export { m as n, h as t };
|
package/lib/form/form_inner.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BaseComponent from "../base";
|
|
2
2
|
import type { FormItemSignal, FormSignal } from "./types";
|
|
3
3
|
export default class FormInner<T = Record<string, any>> extends BaseComponent<T> {
|
|
4
|
-
|
|
4
|
+
_disabled: boolean;
|
|
5
5
|
_value: any;
|
|
6
6
|
_resetValue?: any;
|
|
7
7
|
protected _firstPushValue: boolean;
|
|
@@ -32,6 +32,9 @@ export default class FormInner<T = Record<string, any>> extends BaseComponent<T>
|
|
|
32
32
|
connectedCallback(): void;
|
|
33
33
|
disconnectedCallback(): void;
|
|
34
34
|
isDisabled(): boolean;
|
|
35
|
+
get disabled(): boolean;
|
|
36
|
+
set disabled(value: boolean);
|
|
37
|
+
setDisabled(value: boolean): void;
|
|
35
38
|
getName(): string | undefined;
|
|
36
39
|
protected disabledChange(): void;
|
|
37
40
|
protected innerBlockChange(_innerBlock: boolean): void;
|
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-DtqChzc3.js";
|
|
2
2
|
export { e as default };
|
package/lib/form/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Validator from "ph-utils/validator";
|
|
2
|
+
import type { SchemaType } from "ph-utils/validator";
|
|
2
3
|
import type { FormSignal } from "./types";
|
|
3
4
|
import BaseComponent from "../base";
|
|
4
5
|
interface FormState {
|
|
@@ -7,6 +8,8 @@ interface FormState {
|
|
|
7
8
|
labelWidth: string;
|
|
8
9
|
labelHeight?: string;
|
|
9
10
|
novalidate: boolean;
|
|
11
|
+
/** 验证错误,不直接处理,而是通过事件上报 */
|
|
12
|
+
emitError: boolean;
|
|
10
13
|
}
|
|
11
14
|
export default class Form extends BaseComponent<FormState> {
|
|
12
15
|
static baseName: string;
|
|
@@ -22,15 +25,20 @@ export default class Form extends BaseComponent<FormState> {
|
|
|
22
25
|
connectedCallback(): void;
|
|
23
26
|
afterInit(): void;
|
|
24
27
|
disconnectedCallback(): void;
|
|
25
|
-
|
|
28
|
+
render_v2(): {
|
|
26
29
|
style: string[];
|
|
27
30
|
template: string;
|
|
28
31
|
};
|
|
29
32
|
render(): string;
|
|
30
33
|
ruleChange: (e: CustomEvent) => void;
|
|
34
|
+
addSchemas(schemas: SchemaType[]): void;
|
|
35
|
+
setSchemas(schemas: SchemaType[]): void;
|
|
36
|
+
setSchema(schema: SchemaType): void;
|
|
37
|
+
addSchema(schema: SchemaType): void;
|
|
31
38
|
private _provide;
|
|
32
39
|
_formAction: (e: CustomEvent) => void;
|
|
33
40
|
_valueChange: (e: CustomEvent) => void;
|
|
41
|
+
setValidateErrors(errs: Record<string, string | undefined>, all?: string | string[] | boolean): void;
|
|
34
42
|
validateField(field: string | string[]): void;
|
|
35
43
|
clearValidate(): void;
|
|
36
44
|
reset(): void;
|
|
@@ -38,7 +46,10 @@ export default class Form extends BaseComponent<FormState> {
|
|
|
38
46
|
/**
|
|
39
47
|
* 校验全部表单数据
|
|
40
48
|
*/
|
|
41
|
-
validate(): Promise<
|
|
49
|
+
validate(): Promise<{
|
|
50
|
+
result: boolean;
|
|
51
|
+
errors: any;
|
|
52
|
+
}>;
|
|
42
53
|
getData(): {
|
|
43
54
|
[x: string]: any;
|
|
44
55
|
};
|
package/lib/form/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../form-
|
|
1
|
+
import { t as e } from "../form-BvZHaqAt.js";
|
|
2
2
|
export { e as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
3
|
+
import { n as i } from "./esm-Cir9D6cn.js";
|
|
4
4
|
import { $one as a, formatClass as o, off as s, on as c } from "ph-utils/dom";
|
|
5
5
|
import l from "ph-utils/validator";
|
|
6
6
|
//#region src/components/form/index.less?inline
|
|
@@ -16,7 +16,8 @@ var u = ":host{display:block}.l-form{gap:var(--l-form-gap,20px);flex-flow:column
|
|
|
16
16
|
inline: !1,
|
|
17
17
|
labelPosition: "right",
|
|
18
18
|
labelWidth: "80px",
|
|
19
|
-
novalidate: !1
|
|
19
|
+
novalidate: !1,
|
|
20
|
+
emitError: !1
|
|
20
21
|
}, this.validator = new l([]), this.context = i({ innerBlock: !1 }), this.errors = i({}), this.resetCtx = i(0);
|
|
21
22
|
}
|
|
22
23
|
static get observedAttributes() {
|
|
@@ -26,7 +27,8 @@ var u = ":host{display:block}.l-form{gap:var(--l-form-gap,20px);flex-flow:column
|
|
|
26
27
|
"inline",
|
|
27
28
|
"novalidate",
|
|
28
29
|
"label-width",
|
|
29
|
-
"label-height"
|
|
30
|
+
"label-height",
|
|
31
|
+
"emit-error"
|
|
30
32
|
];
|
|
31
33
|
}
|
|
32
34
|
attributeChanged(e, i, a) {
|
|
@@ -44,7 +46,7 @@ var u = ":host{display:block}.l-form{gap:var(--l-form-gap,20px);flex-flow:column
|
|
|
44
46
|
break;
|
|
45
47
|
default:
|
|
46
48
|
let o = n(a, !1, e);
|
|
47
|
-
this._state[e] = o;
|
|
49
|
+
this._state[t(e)] = o;
|
|
48
50
|
break;
|
|
49
51
|
}
|
|
50
52
|
}
|
|
@@ -85,6 +87,18 @@ var u = ":host{display:block}.l-form{gap:var(--l-form-gap,20px);flex-flow:column
|
|
|
85
87
|
ruleChange = (e) => {
|
|
86
88
|
e.stopPropagation(), this.validator.addSchema(e.detail);
|
|
87
89
|
};
|
|
90
|
+
addSchemas(e) {
|
|
91
|
+
this.validator.addSchemas(e);
|
|
92
|
+
}
|
|
93
|
+
setSchemas(e) {
|
|
94
|
+
this.validator.setSchemas(e);
|
|
95
|
+
}
|
|
96
|
+
setSchema(e) {
|
|
97
|
+
this.validator.setSchema(e);
|
|
98
|
+
}
|
|
99
|
+
addSchema(e) {
|
|
100
|
+
this.validator.addSchema(e);
|
|
101
|
+
}
|
|
88
102
|
_provide(e) {
|
|
89
103
|
let { context: t, callback: n } = e.detail;
|
|
90
104
|
t === "form-context-request" && n(this.context, this.errors, this.resetCtx);
|
|
@@ -99,14 +113,20 @@ var u = ":host{display:block}.l-form{gap:var(--l-form-gap,20px);flex-flow:column
|
|
|
99
113
|
let i = Object.hasOwn(this._data, t);
|
|
100
114
|
this._data[t] = n, !this._state.novalidate && i && r && this.validator.validateKey(t, n, this._data).then(() => {
|
|
101
115
|
let e = this.errors();
|
|
102
|
-
e[t] = void 0, this.
|
|
116
|
+
e[t] = void 0, this.setValidateErrors({ ...e });
|
|
103
117
|
}).catch((e) => {
|
|
104
|
-
this.
|
|
118
|
+
this.setValidateErrors({
|
|
105
119
|
...this.errors(),
|
|
106
120
|
...e.detail
|
|
107
121
|
});
|
|
108
122
|
});
|
|
109
123
|
};
|
|
124
|
+
setValidateErrors(e, t = !0) {
|
|
125
|
+
this._state.emitError ? this.emit("validate-error", { detail: {
|
|
126
|
+
errors: e,
|
|
127
|
+
all: t
|
|
128
|
+
} }) : this.errors(e);
|
|
129
|
+
}
|
|
110
130
|
validateField(e) {
|
|
111
131
|
let t = [];
|
|
112
132
|
if (this._data != null) {
|
|
@@ -115,19 +135,20 @@ var u = ":host{display:block}.l-form{gap:var(--l-form-gap,20px);flex-flow:column
|
|
|
115
135
|
t.push(this.validator.validateKey(r, this._data[r], this._data));
|
|
116
136
|
}
|
|
117
137
|
else t.push(this.validator.validateKey(e, this._data[e], this._data));
|
|
118
|
-
Promise.allSettled(t).then((
|
|
119
|
-
let
|
|
120
|
-
for (let
|
|
121
|
-
let r = e
|
|
122
|
-
r.status === "rejected" ?
|
|
123
|
-
...
|
|
138
|
+
Promise.allSettled(t).then((t) => {
|
|
139
|
+
let n = {};
|
|
140
|
+
for (let e = 0, r = t.length; e < r; e++) {
|
|
141
|
+
let r = t[e];
|
|
142
|
+
r.status === "rejected" ? n = {
|
|
143
|
+
...n,
|
|
124
144
|
...r.reason.detail
|
|
125
|
-
} :
|
|
145
|
+
} : n[r.value.key] = void 0;
|
|
126
146
|
}
|
|
127
|
-
|
|
147
|
+
let r = {
|
|
128
148
|
...this.errors(),
|
|
129
|
-
...
|
|
130
|
-
}
|
|
149
|
+
...n
|
|
150
|
+
};
|
|
151
|
+
this.setValidateErrors(r, e);
|
|
131
152
|
});
|
|
132
153
|
}
|
|
133
154
|
}
|
|
@@ -141,14 +162,23 @@ var u = ":host{display:block}.l-form{gap:var(--l-form-gap,20px);flex-flow:column
|
|
|
141
162
|
}
|
|
142
163
|
submit() {
|
|
143
164
|
this._state.novalidate ? this.dispatchEvent(new CustomEvent("submit", { detail: this.getData() })) : this.validate().then((e) => {
|
|
144
|
-
e
|
|
165
|
+
e.result ? this.dispatchEvent(new CustomEvent("submit", { detail: this.getData() })) : this._state.emitError ? this.emit("validate-error", { detail: {
|
|
166
|
+
errors: e.errors,
|
|
167
|
+
all: !0
|
|
168
|
+
} }) : this.errors(e.errors);
|
|
145
169
|
});
|
|
146
170
|
}
|
|
147
171
|
async validate() {
|
|
148
172
|
try {
|
|
149
|
-
return await this.validator.validate(this._data || {}),
|
|
173
|
+
return await this.validator.validate(this._data || {}), Promise.resolve({
|
|
174
|
+
result: !0,
|
|
175
|
+
errors: {}
|
|
176
|
+
});
|
|
150
177
|
} catch (e) {
|
|
151
|
-
return
|
|
178
|
+
return Promise.resolve({
|
|
179
|
+
result: !1,
|
|
180
|
+
errors: e.detail
|
|
181
|
+
});
|
|
152
182
|
}
|
|
153
183
|
}
|
|
154
184
|
getData() {
|