litos-ui 0.18.5 → 0.20.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.
Files changed (128) hide show
  1. package/lib/{base-LvfO4mmL.js → base-Dyj1rzaK.js} +11 -12
  2. package/lib/base.d.ts +2 -2
  3. package/lib/base.js +14 -10
  4. package/lib/button/index.js +1 -1
  5. package/lib/{button-CC5NBWtI.js → button-CDYYpQu6.js} +3 -4
  6. package/lib/calendar/index.js +1 -1
  7. package/lib/{calendar-Clbg3qot.js → calendar-CvlUsN6w.js} +20 -23
  8. package/lib/carousel/index.js +1 -1
  9. package/lib/carousel/item.js +1 -1
  10. package/lib/{carousel-Dgirxwzb.js → carousel-DvkZ1YXq.js} +23 -19
  11. package/lib/check/checkbox.js +1 -1
  12. package/lib/check/checkbox_group.js +1 -1
  13. package/lib/check/radio.js +1 -1
  14. package/lib/check/radio_group.js +1 -1
  15. package/lib/{check-BDOpD_0-.js → check-DFlwStH9.js} +10 -13
  16. package/lib/{check-CrlZ7zVL.js → check-doQ2ZpQj.js} +10 -10
  17. package/lib/{checkbox-D_bZGoUD.js → checkbox-DhGHJXwI.js} +1 -1
  18. package/lib/collapse/index.js +1 -1
  19. package/lib/collapse/item.js +1 -1
  20. package/lib/{collapse-BRxYoeJx.js → collapse-B6-Rn05A.js} +8 -10
  21. package/lib/color_picker/index.js +1 -1
  22. package/lib/{color_picker-AaFcIczZ.js → color_picker-0a-IGZY9.js} +3 -3
  23. package/lib/date_picker/index.js +1 -1
  24. package/lib/{date_picker-HjkRma9j.js → date_picker-BDN2PAz5.js} +3 -7
  25. package/lib/date_picker_ori/index.js +1 -1
  26. package/lib/{date_picker_ori-1IOHZsan.js → date_picker_ori-BXFs1eET.js} +4 -6
  27. package/lib/description_panel/index.js +1 -1
  28. package/lib/{description_panel-DaqVcA6-.js → description_panel--AKXBzLL.js} +2 -6
  29. package/lib/dialog/dialog_container.js +1 -1
  30. package/lib/dialog/index.js +9 -7
  31. package/lib/{dialog_container-CcTyfoaD.js → dialog_container-Bq6HsKey.js} +7 -6
  32. package/lib/{esm-Cir9D6cn.js → esm-DAha108i.js} +67 -67
  33. package/lib/form/form_item.d.ts +1 -1
  34. package/lib/form/form_item.js +1 -1
  35. package/lib/form/index.d.ts +3 -3
  36. package/lib/form/index.js +1 -1
  37. package/lib/{form-BvZHaqAt.js → form-DJxvBiLy.js} +30 -32
  38. package/lib/{form_inner-52DR1IPu.js → form_inner-Cnwb6f_Q.js} +3 -5
  39. package/lib/{form_item-DtqChzc3.js → form_item-CFIkfH29.js} +3 -5
  40. package/lib/icon/arrow_down.js +1 -1
  41. package/lib/icon/arrow_left.js +1 -1
  42. package/lib/icon/arrow_right.js +1 -1
  43. package/lib/icon/arrow_up.js +1 -1
  44. package/lib/icon/base.js +1 -1
  45. package/lib/icon/calendar.js +1 -1
  46. package/lib/icon/caret_bottom.js +1 -1
  47. package/lib/icon/caret_top.js +1 -1
  48. package/lib/icon/close.js +1 -1
  49. package/lib/icon/close_filled.js +1 -1
  50. package/lib/icon/d_arrow_left.js +1 -1
  51. package/lib/icon/d_arrow_right.js +1 -1
  52. package/lib/icon/font_icon.js +1 -1
  53. package/lib/icon/info.js +1 -1
  54. package/lib/icon/loading.js +1 -1
  55. package/lib/icon/moon.js +1 -1
  56. package/lib/icon/more.js +1 -1
  57. package/lib/icon/reduction.js +1 -1
  58. package/lib/icon/refresh.js +1 -1
  59. package/lib/icon/refresh_left.js +1 -1
  60. package/lib/icon/refresh_right.js +1 -1
  61. package/lib/icon/search.js +1 -1
  62. package/lib/icon/select.js +1 -1
  63. package/lib/icon/sort.js +1 -1
  64. package/lib/icon/success.js +1 -1
  65. package/lib/icon/sun.js +1 -1
  66. package/lib/icon/theme_default.js +1 -1
  67. package/lib/icon/warn.js +1 -1
  68. package/lib/icon/zoom_in.js +1 -1
  69. package/lib/icon/zoom_out.js +1 -1
  70. package/lib/image/image_preview.js +1 -1
  71. package/lib/image/index.js +1 -1
  72. package/lib/{image-BCUhVAFo.js → image-CVQai6NX.js} +19 -19
  73. package/lib/{image_preview-BeJzfEoF.js → image_preview-DfQAKSJH.js} +3 -5
  74. package/lib/index.js +36 -36
  75. package/lib/input/index.js +3 -5
  76. package/lib/{item-42bYhAkZ.js → item-CQ2Sknbz.js} +1 -1
  77. package/lib/{item-Dq6M7lxw.js → item-DI6mQXtB.js} +5 -7
  78. package/lib/{item-CX8C9X57.js → item-D_ZOPXuE.js} +1 -1
  79. package/lib/list/index.js +1 -1
  80. package/lib/{list-Dz1Ya118.js → list-Dg5u5dgr.js} +1 -1
  81. package/lib/loading/index.js +6 -4
  82. package/lib/mask/index.js +1 -1
  83. package/lib/{mask-BlDl9u8F.js → mask-Bx-yNIJv.js} +2 -6
  84. package/lib/md_input/index.js +1 -1
  85. package/lib/{md_input-DN3ceqsw.js → md_input-BX3bujz8.js} +2 -2
  86. package/lib/menu/index.d.ts +10 -2
  87. package/lib/menu/index.js +1 -1
  88. package/lib/menu-DKscK5mw.js +274 -0
  89. package/lib/message/index.js +1 -1
  90. package/lib/modal/index.js +1 -1
  91. package/lib/modal/modal_box.js +4 -4
  92. package/lib/{modal-cjj3Nw1B.js → modal-iwxqmAqW.js} +11 -9
  93. package/lib/page_header/index.js +1 -1
  94. package/lib/{page_header-BfuWJIdd.js → page_header-ujV3pncE.js} +2 -4
  95. package/lib/pagination/index.d.ts +25 -18
  96. package/lib/pagination/index.js +1 -1
  97. package/lib/{pagination-DpOSOFwl.js → pagination-aRbGd3Rf.js} +86 -83
  98. package/lib/polygon/index.js +1 -1
  99. package/lib/{polygon-BY1FAACc.js → polygon-DhhovlrG.js} +1 -1
  100. package/lib/qrcode/index.js +1 -1
  101. package/lib/{qrcode-Bgr8gJzA.js → qrcode-Dip8uLSA.js} +1 -1
  102. package/lib/{radio-C7dkhgwc.js → radio-C9NPQWGI.js} +1 -1
  103. package/lib/select/index.js +1 -1
  104. package/lib/{select-Cis6kRjQ.js → select-BZMDj5VE.js} +33 -30
  105. package/lib/select_ori/index.js +1 -1
  106. package/lib/{select_ori-DcJbNYYr.js → select_ori-C7sUZxen.js} +3 -3
  107. package/lib/space/index.js +1 -1
  108. package/lib/{space-BT_dVhhv.js → space-CKuTk0YB.js} +6 -5
  109. package/lib/switch/index.js +1 -1
  110. package/lib/{switch-UyhlgW7F.js → switch-wh2-ivty.js} +11 -9
  111. package/lib/tabbar/index.js +1 -1
  112. package/lib/tabbar/item.js +1 -1
  113. package/lib/{tabbar-DO0kB58Y.js → tabbar-CBXK-_AV.js} +1 -1
  114. package/lib/table/index.d.ts +7 -3
  115. package/lib/table/index.js +1 -1
  116. package/lib/{table-saZMryiV.js → table-BQxMD2Ae.js} +32 -33
  117. package/lib/tabs/index.js +4 -2
  118. package/lib/tag/index.js +1 -1
  119. package/lib/{tag-BtDcKdxo.js → tag-Di1z9PoZ.js} +3 -5
  120. package/lib/theme/index.js +1 -1
  121. package/lib/theme/theme_color.js +4 -5
  122. package/lib/{theme-Barcq234.js → theme-CLbBS-in.js} +9 -10
  123. package/lib/utils/context_provide.js +1 -1
  124. package/lib/utils/index.d.ts +1 -1
  125. package/lib/utils/popover.js +1 -1
  126. package/lib/utils/transition.js +1 -1
  127. package/package.json +11 -11
  128. package/lib/menu-BOmVa4xN.js +0 -224
@@ -1,6 +1,6 @@
1
1
  import e from "./base.js";
2
2
  import { kebabToCamel as t, parseAttrValue as n } from "./utils/index.js";
3
- import { $one as r, addClass as i, hasClass as a, on as o, removeClass as s, shouldEventNext as c } from "ph-utils/dom";
3
+ import { $one as r, addClass as i, hasClass as a, on as o, removeClass as s, shouldEventNext as c } from "ph-utils/browser";
4
4
  //#region src/components/description_panel/index.less?inline
5
5
  var l = ":host{--l-desc-panel-min-height:100px;--l-desc-panel-font-size:14px;--l-desc-panel-textindent:calc(var(--l-desc-panel-font-size) * 2);max-height:var(--l-desc-panel-max-height,max-content);color:#1f2937;font-size:var(--l-desc-panel-font-size);text-indent:var(--l-desc-panel-textindent);box-sizing:border-box;transition:all .15s linear;display:block;position:relative}.content{box-sizing:border-box;border:1px solid #0000}.l-desc-panel-operator{z-index:2;box-sizing:border-box;background:0 0;justify-content:center;width:100%;padding-top:0;padding-bottom:0;display:flex}.l-desc-panel-btnmore{font-size:var(--nt-desc-panel-font-size)}.l-desc-panel-btnmore:before{content:attr(data-text)}.l-desc-panel-arrow{transition:transform .3s ease-in-out;transform:rotate(180deg)}:host(.collapse){max-height:var(--l-desc-panel-min-height);overflow-y:hidden}:host(.collapse) .l-desc-panel-operator{background:linear-gradient(-180deg,#fff0 0%,#fff 80%);padding-top:65px;position:absolute;bottom:0;left:0}:host(.collapse) .l-desc-panel-arrow{transform:rotateX(0)}", u = class extends e {
6
6
  static baseName = "description-panel";
@@ -11,11 +11,7 @@ var l = ":host{--l-desc-panel-min-height:100px;--l-desc-panel-font-size:14px;--l
11
11
  attributeChangedCallback(e, r, i) {
12
12
  e = t(e);
13
13
  let a = n(i, this[e]);
14
- if (a !== this[e]) switch (this[e] = a, e) {
15
- case "collapseHeight":
16
- this.collapseHeight === 100 ? this.style.removeProperty("--l-desc-panel-min-height") : this.style.setProperty("--l-desc-panel-min-height", `${this.collapseHeight}px`);
17
- break;
18
- }
14
+ a !== this[e] && (this[e] = a, e === "collapseHeight") && (this.collapseHeight === 100 ? this.style.removeProperty("--l-desc-panel-min-height") : this.style.setProperty("--l-desc-panel-min-height", `${this.collapseHeight}px`));
19
15
  }
20
16
  connectedCallback() {
21
17
  this.loadStyleText(l), super.connectedCallback();
@@ -1,2 +1,2 @@
1
- import { t as e } from "../dialog_container-CcTyfoaD.js";
1
+ import { t as e } from "../dialog_container-Bq6HsKey.js";
2
2
  export { e as default };
@@ -1,4 +1,4 @@
1
- import { $one as e, addClass as t, getAttr as n, hasClass as r, off as i, on as a, removeClass as o } from "ph-utils/dom";
1
+ import { $one as e, addClass as t, getAttr as n, hasClass as r, off as i, on as a, removeClass as o } from "ph-utils/browser";
2
2
  //#region src/components/dialog/index.ts
3
3
  var s = (s) => {
4
4
  let c, l, u;
@@ -45,12 +45,14 @@ var s = (s) => {
45
45
  c &&= (g(), i(c, "keydown", d), i(c, "click", f), l && i(l, "dialogAction", p), l = void 0, void 0);
46
46
  }
47
47
  function v(e, t) {
48
- if (u && (u[e] = t, c)) if (e === "verticalAlign") {
49
- let e = c.className.replace(/l-dialog--vertical-\w+/g, function() {
50
- return `l-dialog--vertical-${t || "top"}`;
51
- });
52
- c.className = e;
53
- } else e === "translate" ? t ? c.style.setProperty("--l-dialog-translate", `translate3d(${t})`) : c.style.removeProperty("--l-dialog-translate") : e === "width" ? t ? c.style.setProperty("--l-dialog-width", t) : c.style.removeProperty("--l-dialog-width") : e === "showClose" && l && l.setAttribute("show-close", `${t}`);
48
+ if (u && (u[e] = t, c)) {
49
+ if (e === "verticalAlign") {
50
+ let e = c.className.replace(/l-dialog--vertical-\w+/g, function() {
51
+ return `l-dialog--vertical-${t || "top"}`;
52
+ });
53
+ c.className = e;
54
+ } else e === "translate" ? t ? c.style.setProperty("--l-dialog-translate", `translate3d(${t})`) : c.style.removeProperty("--l-dialog-translate") : e === "width" ? t ? c.style.setProperty("--l-dialog-width", t) : c.style.removeProperty("--l-dialog-width") : e === "showClose" && l && l.setAttribute("show-close", `${t}`);
55
+ }
54
56
  }
55
57
  function y(e) {
56
58
  for (let t in e) v(t, e[t]);
@@ -1,5 +1,5 @@
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/dom";
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
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
5
  static baseName = "dialog-container";
@@ -15,12 +15,15 @@ var l = ":host{display:block;position:relative}:host(.l-container-close-outside)
15
15
  };
16
16
  }
17
17
  afterInit() {
18
- this._state.showClose === 2 && this.classList.add("l-container-close-outside"), a(t("[data-action]", this.root), (e) => {
18
+ this._state.showClose === 2 && this.classList.add("l-container-close-outside");
19
+ let e = t("[data-action]", this.root);
20
+ a(e, (e) => {
19
21
  s(e, "click", this.#e);
20
22
  });
21
23
  }
22
24
  beforeDestroy() {
23
- a(t("[data-action]", this.root), (e) => {
25
+ let e = t("[data-action]", this.root);
26
+ a(e, (e) => {
24
27
  o(e, "click", this.#e);
25
28
  });
26
29
  }
@@ -72,9 +75,7 @@ var l = ":host{display:block;position:relative}:host(.l-container-close-outside)
72
75
  let e = r(".l-btn-dialog-close", this.root);
73
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));
74
77
  break;
75
- case "container-class":
76
- this._state.containerClass = n || void 0, this.connectedCallback();
77
- break;
78
+ case "container-class": this._state.containerClass = n || void 0, this.connectedCallback();
78
79
  }
79
80
  }
80
81
  #t() {
@@ -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 = 64, n = 0, r = 0, i = 0, a = 0, o, s = [], { link: c, unlink: l, propagate: u, checkDirty: d, shallowPropagate: f } = e({
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 ? g(e) : "currentValue" in e ? _(e) : (e.flags = 1, !0);
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 = a, n = t;
124
+ let t = i, n = t;
125
125
  do
126
- if (s[t++] = e, e.flags &= -3, e = e.subs?.sub, e === void 0 || !(e.flags & 2)) break;
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 (a = t; n < --t;) {
129
- let e = s[n];
130
- s[n++] = s[t], s[t] = e;
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, w(e)) : "currentValue" in e || ("fn" in e ? S.call(e) : C.call(e));
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 p(e) {
138
- let t = o;
139
- return o = e, t;
137
+ function f(e) {
138
+ let t = a;
139
+ return a = e, t;
140
140
  }
141
- function m(e) {
142
- return b.bind({
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 h(e) {
151
- let n = {
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
- }, i = p(n);
160
- i !== void 0 && (c(n, i, 0), i.flags |= t);
159
+ }, r = f(t);
160
+ r !== void 0 && (s(t, r, 0), r.flags |= 64);
161
161
  try {
162
- ++r, n.cleanup = n.fn();
162
+ ++n, t.cleanup = t.fn();
163
163
  } finally {
164
- --r, o = i, n.flags &= -5;
164
+ --n, a = r, t.flags &= -5;
165
165
  }
166
- return S.bind(n);
166
+ return x.bind(t);
167
167
  }
168
- function g(e) {
169
- if (e.flags & t) {
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) && l(t, e), t = n;
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 r = p(e);
177
+ let n = f(e);
178
178
  try {
179
- ++n;
180
- let t = e.value;
181
- return t !== (e.value = e.getter(t));
179
+ ++t;
180
+ let n = e.value;
181
+ return n !== (e.value = e.getter(n));
182
182
  } finally {
183
- o = r, e.flags &= -5, T(e);
183
+ a = n, e.flags &= -5, w(e);
184
184
  }
185
185
  }
186
- function _(e) {
186
+ function g(e) {
187
187
  return e.flags = 1, e.currentValue !== (e.currentValue = e.pendingValue);
188
188
  }
189
- function v(e) {
190
- let i = e.flags;
191
- if (i & 16 || i & 32 && d(e.deps, e)) {
192
- if (i & t) {
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) && l(t, e), t = n;
196
+ !("getter" in r) && !("currentValue" in r) && c(t, e), t = n;
197
197
  }
198
198
  }
199
- if (e.cleanup && (x(e), !e.flags)) return;
199
+ if (e.cleanup && (b(e), !e.flags)) return;
200
200
  e.depsTail = void 0, e.flags = 6;
201
- let a = p(e);
201
+ let i = f(e);
202
202
  try {
203
- ++n, ++r, e.cleanup = e.fn();
203
+ ++t, ++n, e.cleanup = e.fn();
204
204
  } finally {
205
- --r, o = a, e.flags &= -5, T(e);
205
+ --n, a = i, e.flags &= -5, w(e);
206
206
  }
207
- } else e.deps !== void 0 && (e.flags = 2 | i & t);
207
+ } else e.deps !== void 0 && (e.flags = 2 | r & 64);
208
208
  }
209
- function y() {
209
+ function v() {
210
210
  try {
211
- for (; i < a;) {
212
- let e = s[i];
213
- s[i++] = void 0, v(e);
211
+ for (; r < i;) {
212
+ let e = o[r];
213
+ o[r++] = void 0, _(e);
214
214
  }
215
215
  } finally {
216
- for (; i < a;) {
217
- let e = s[i];
218
- s[i++] = void 0, e.flags |= 10;
216
+ for (; r < i;) {
217
+ let e = o[r];
218
+ o[r++] = void 0, e.flags |= 10;
219
219
  }
220
- i = 0, a = 0;
220
+ r = 0, i = 0;
221
221
  }
222
222
  }
223
- function b(...e) {
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 && (u(e, !!r), y());
228
+ e !== void 0 && (l(e, !!n), v());
229
229
  }
230
230
  } else {
231
- if (this.flags & 16 && _(this)) {
231
+ if (this.flags & 16 && g(this)) {
232
232
  let e = this.subs;
233
- e !== void 0 && f(e);
233
+ e !== void 0 && d(e);
234
234
  }
235
- let e = o;
236
- return e !== void 0 && c(this, e, n), this.currentValue;
235
+ let e = a;
236
+ return e !== void 0 && s(this, e, t), this.currentValue;
237
237
  }
238
238
  }
239
- function x(e) {
239
+ function b(e) {
240
240
  let t = e.cleanup;
241
241
  e.cleanup = void 0;
242
- let n = o;
243
- o = void 0;
242
+ let n = a;
243
+ a = void 0;
244
244
  try {
245
245
  t();
246
246
  } finally {
247
- o = n;
247
+ a = n;
248
248
  }
249
249
  }
250
- function S() {
251
- C.call(this), this.cleanup && x(this);
250
+ function x() {
251
+ S.call(this), this.cleanup && b(this);
252
252
  }
253
- function C() {
254
- this.flags = 0, w(this);
253
+ function S() {
254
+ this.flags = 0, C(this);
255
255
  let e = this.subs;
256
- e !== void 0 && l(e);
256
+ e !== void 0 && c(e);
257
257
  }
258
- function w(e) {
258
+ function C(e) {
259
259
  let t = e.depsTail;
260
260
  for (; t !== void 0;) {
261
261
  let n = t.prevDep;
262
- l(t, e), t = n;
262
+ c(t, e), t = n;
263
263
  }
264
264
  }
265
- function T(e) {
265
+ function w(e) {
266
266
  let t = e.depsTail, n = t === void 0 ? e.deps : t.nextDep;
267
- for (; n !== void 0;) n = l(n, e);
267
+ for (; n !== void 0;) n = c(n, e);
268
268
  }
269
269
  //#endregion
270
- export { m as n, h as t };
270
+ export { p as n, m as t };
@@ -1,4 +1,4 @@
1
- import type { RuleType } from "ph-utils/validator";
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 = {
@@ -1,2 +1,2 @@
1
- import { t as e } from "../form_item-DtqChzc3.js";
1
+ import { t as e } from "../form_item-CFIkfH29.js";
2
2
  export { e as default };
@@ -1,5 +1,5 @@
1
- import Validator from "ph-utils/validator";
2
- import type { SchemaType } from "ph-utils/validator";
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-BvZHaqAt.js";
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-Cir9D6cn.js";
4
- import { $one as a, formatClass as o, off as s, on as c } from "ph-utils/dom";
5
- import l from "ph-utils/validator";
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 && this.validator.validateKey(t, n, this._data).then(() => {
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
- }).catch((e) => {
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 n = 0, r = e.length; n < r; n++) {
134
- let r = e[n];
135
- t.push(this.validator.validateKey(r, this._data[r], this._data));
136
- }
137
- else t.push(this.validator.validateKey(e, this._data[e], this._data));
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,
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
- let r = {
148
- ...this.errors(),
149
- ...n
150
- };
151
- this.setValidateErrors(r, e);
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.dispatchEvent(new CustomEvent("submit", { detail: this.getData() })) : this.validate().then((e) => {
165
- e.result ? this.dispatchEvent(new CustomEvent("submit", { detail: this.getData() })) : this._state.emitError ? this.emit("validate-error", { detail: {
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
- async validate() {
169
+ validate() {
172
170
  try {
173
- return await this.validator.validate(this._data || {}), Promise.resolve({
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-Cir9D6cn.js";
4
- import { getAttr as i } from "ph-utils/dom";
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,7 +1,7 @@
1
1
  import { kebabToCamel as e, parseAttrValue as t, stopSignal as n, unitNumberStr as r } from "./utils/index.js";
2
- import { n as i, t as a } from "./esm-Cir9D6cn.js";
2
+ import { n as i, t as a } from "./esm-DAha108i.js";
3
3
  import o from "./utils/context_provide.js";
4
- import { $$ as s, $one as c, addClass as l, removeClass as u } from "ph-utils/dom";
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
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 o {
7
7
  static baseName = "form-item";
@@ -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) {
@@ -1,4 +1,4 @@
1
- import { t as e } from "../base-LvfO4mmL.js";
1
+ import { t as e } from "../base-Dyj1rzaK.js";
2
2
  //#region src/components/icon/arrow_down.ts
3
3
  var t = class extends e {
4
4
  static baseName = "arrow-down-icon";
@@ -1,4 +1,4 @@
1
- import { t as e } from "../base-LvfO4mmL.js";
1
+ import { t as e } from "../base-Dyj1rzaK.js";
2
2
  //#region src/components/icon/arrow_left.ts
3
3
  var t = class extends e {
4
4
  static baseName = "arrow-left-icon";
@@ -1,4 +1,4 @@
1
- import { t as e } from "../base-LvfO4mmL.js";
1
+ import { t as e } from "../base-Dyj1rzaK.js";
2
2
  //#region src/components/icon/arrow_right.ts
3
3
  var t = class extends e {
4
4
  static baseName = "arrow-right-icon";
@@ -1,4 +1,4 @@
1
- import { t as e } from "../base-LvfO4mmL.js";
1
+ import { t as e } from "../base-Dyj1rzaK.js";
2
2
  //#region src/components/icon/arrow_up.ts
3
3
  var t = class extends e {
4
4
  static baseName = "arrow-up-icon";
package/lib/icon/base.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as e } from "../base-LvfO4mmL.js";
1
+ import { t as e } from "../base-Dyj1rzaK.js";
2
2
  export { e as default };
@@ -1,4 +1,4 @@
1
- import { t as e } from "../base-LvfO4mmL.js";
1
+ import { t as e } from "../base-Dyj1rzaK.js";
2
2
  //#region src/components/icon/calendar.ts
3
3
  var t = class extends e {
4
4
  static baseName = "calendar-icon";
@@ -1,4 +1,4 @@
1
- import { t as e } from "../base-LvfO4mmL.js";
1
+ import { t as e } from "../base-Dyj1rzaK.js";
2
2
  //#region src/components/icon/caret_bottom.ts
3
3
  var t = class extends e {
4
4
  static baseName = "caret-bottom-icon";
@@ -1,4 +1,4 @@
1
- import { t as e } from "../base-LvfO4mmL.js";
1
+ import { t as e } from "../base-Dyj1rzaK.js";
2
2
  //#region src/components/icon/caret_top.ts
3
3
  var t = class extends e {
4
4
  static baseName = "caret-top-icon";
package/lib/icon/close.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "../base-LvfO4mmL.js";
1
+ import { t as e } from "../base-Dyj1rzaK.js";
2
2
  //#region src/components/icon/close.ts
3
3
  var t = class extends e {
4
4
  static baseName = "close-icon";
@@ -1,4 +1,4 @@
1
- import { t as e } from "../base-LvfO4mmL.js";
1
+ import { t as e } from "../base-Dyj1rzaK.js";
2
2
  //#region src/components/icon/close_filled.ts
3
3
  var t = class extends e {
4
4
  static baseName = "close-filled-icon";
@@ -1,4 +1,4 @@
1
- import { t as e } from "../base-LvfO4mmL.js";
1
+ import { t as e } from "../base-Dyj1rzaK.js";
2
2
  //#region src/components/icon/d_arrow_left.ts
3
3
  var t = class extends e {
4
4
  static baseName = "d-arrow-left-icon";
@@ -1,4 +1,4 @@
1
- import { t as e } from "../base-LvfO4mmL.js";
1
+ import { t as e } from "../base-Dyj1rzaK.js";
2
2
  //#region src/components/icon/d_arrow_right.ts
3
3
  var t = class extends e {
4
4
  static baseName = "d-arrow-right-icon";
@@ -1,4 +1,4 @@
1
- import { t as e } from "../base-LvfO4mmL.js";
1
+ import { t as e } from "../base-Dyj1rzaK.js";
2
2
  //#region src/components/icon/font_icon.ts
3
3
  var t = class extends e {
4
4
  static baseName = "font-icon";
package/lib/icon/info.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "../base-LvfO4mmL.js";
1
+ import { t as e } from "../base-Dyj1rzaK.js";
2
2
  //#region src/components/icon/info.ts
3
3
  var t = class extends e {
4
4
  static baseName = "info-icon";
@@ -1,4 +1,4 @@
1
- import { t as e } from "../base-LvfO4mmL.js";
1
+ import { t as e } from "../base-Dyj1rzaK.js";
2
2
  //#region src/components/icon/loading.ts
3
3
  var t = class extends e {
4
4
  static baseName = "loading-icon";
package/lib/icon/moon.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "../base-LvfO4mmL.js";
1
+ import { t as e } from "../base-Dyj1rzaK.js";
2
2
  //#region src/components/icon/moon.ts
3
3
  var t = class extends e {
4
4
  static baseName = "moon-icon";
package/lib/icon/more.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "../base-LvfO4mmL.js";
1
+ import { t as e } from "../base-Dyj1rzaK.js";
2
2
  //#region src/components/icon/more.ts
3
3
  var t = class extends e {
4
4
  static baseName = "more-icon";
@@ -1,4 +1,4 @@
1
- import { t as e } from "../base-LvfO4mmL.js";
1
+ import { t as e } from "../base-Dyj1rzaK.js";
2
2
  //#region src/components/icon/reduction.ts
3
3
  var t = class extends e {
4
4
  static baseName = "reduction-icon";
@@ -1,4 +1,4 @@
1
- import { t as e } from "../base-LvfO4mmL.js";
1
+ import { t as e } from "../base-Dyj1rzaK.js";
2
2
  //#region src/components/icon/refresh.ts
3
3
  var t = class extends e {
4
4
  static baseName = "refresh-icon";