litos-ui 0.23.1 → 0.24.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 (309) hide show
  1. package/lib/base.d.ts +3 -2
  2. package/lib/base.js +11 -8
  3. package/lib/button/index.d.ts +21 -5
  4. package/lib/button/index.js +115 -62
  5. package/lib/button/index.less_inline.js +2 -3
  6. package/lib/button/style.js +1 -2
  7. package/lib/calendar/index.js +22 -24
  8. package/lib/calendar/index.less_inline.js +1 -2
  9. package/lib/calendar/langs.js +1 -2
  10. package/lib/card/index.js +8 -9
  11. package/lib/card/index.less_inline.js +1 -2
  12. package/lib/carousel/index.js +10 -11
  13. package/lib/carousel/index.less_inline.js +1 -2
  14. package/lib/carousel/item.js +1 -2
  15. package/lib/carousel/item.less_inline.js +1 -2
  16. package/lib/carousel/timer.js +1 -2
  17. package/lib/check/check.d.ts +40 -8
  18. package/lib/check/check.js +200 -65
  19. package/lib/check/check.less_inline.js +2 -3
  20. package/lib/check/checkbox.js +2 -3
  21. package/lib/check/checkbox.less_inline.js +2 -3
  22. package/lib/check/checkbox_group.js +1 -2
  23. package/lib/check/index.d.ts +28 -8
  24. package/lib/check/index.js +151 -46
  25. package/lib/check/index.less_inline.js +1 -2
  26. package/lib/check/radio.js +2 -3
  27. package/lib/check/radio.less_inline.js +1 -2
  28. package/lib/check/radio_group.js +2 -3
  29. package/lib/collapse/index.d.ts +12 -4
  30. package/lib/collapse/index.js +80 -46
  31. package/lib/collapse/index.less_inline.js +2 -3
  32. package/lib/collapse/item.d.ts +35 -9
  33. package/lib/collapse/item.js +219 -57
  34. package/lib/collapse/item.less_inline.js +2 -3
  35. package/lib/collapse/types.d.ts +17 -3
  36. package/lib/color_picker/index.d.ts +4 -2
  37. package/lib/color_picker/index.js +26 -17
  38. package/lib/color_picker/index.less_inline.js +1 -2
  39. package/lib/date_picker/index.d.ts +5 -1
  40. package/lib/date_picker/index.js +39 -23
  41. package/lib/date_picker/index.less_inline.js +1 -2
  42. package/lib/date_picker_ori/index.d.ts +7 -2
  43. package/lib/date_picker_ori/index.js +123 -47
  44. package/lib/date_picker_ori/index.less_inline.js +1 -2
  45. package/lib/description_panel/index.js +2 -10
  46. package/lib/description_panel/index.less_inline.js +1 -2
  47. package/lib/dialog/dialog_box.js +28 -29
  48. package/lib/dialog/dialog_container.css_inline.js +1 -2
  49. package/lib/dialog/dialog_container.js +13 -14
  50. package/lib/dialog/dialog_container_style.js +1 -2
  51. package/lib/dialog/index.js +1 -2
  52. package/lib/dropdown/index.d.ts +39 -0
  53. package/lib/dropdown/index.js +98 -0
  54. package/lib/entries/base.js +1 -2
  55. package/lib/entries/button.js +5 -6
  56. package/lib/entries/calendar.js +5 -6
  57. package/lib/entries/card.js +5 -6
  58. package/lib/entries/carousel-item.js +5 -6
  59. package/lib/entries/carousel.js +5 -6
  60. package/lib/entries/checkbox-group.js +5 -6
  61. package/lib/entries/checkbox.js +5 -6
  62. package/lib/entries/collapse-item.d.ts +0 -1
  63. package/lib/entries/collapse-item.js +6 -6
  64. package/lib/entries/collapse.d.ts +0 -1
  65. package/lib/entries/collapse.js +11 -6
  66. package/lib/entries/color-picker.js +5 -6
  67. package/lib/entries/date-picker-ori.js +5 -6
  68. package/lib/entries/date-picker.js +5 -6
  69. package/lib/entries/description-panel.js +5 -6
  70. package/lib/entries/dialog-box.js +1 -2
  71. package/lib/entries/dialog-container.js +5 -6
  72. package/lib/entries/dialog.js +1 -2
  73. package/lib/entries/dropdown.d.ts +2 -0
  74. package/lib/entries/dropdown.js +1 -0
  75. package/lib/entries/form-item.js +5 -6
  76. package/lib/entries/form.js +5 -6
  77. package/lib/entries/icon-arrow-down.js +5 -6
  78. package/lib/entries/icon-arrow-left.js +5 -6
  79. package/lib/entries/icon-arrow-right.js +5 -6
  80. package/lib/entries/icon-arrow-up.js +5 -6
  81. package/lib/entries/icon-base.js +5 -6
  82. package/lib/entries/icon-calendar.js +5 -6
  83. package/lib/entries/icon-caret-bottom.js +5 -6
  84. package/lib/entries/icon-caret-top.js +5 -6
  85. package/lib/entries/icon-close-filled.js +5 -6
  86. package/lib/entries/icon-close.js +5 -6
  87. package/lib/entries/icon-copy.js +5 -6
  88. package/lib/entries/icon-d-arrow-left.js +5 -6
  89. package/lib/entries/icon-d-arrow-right.js +5 -6
  90. package/lib/entries/icon-delete.js +5 -6
  91. package/lib/entries/icon-eye-outline.js +5 -6
  92. package/lib/entries/icon-font-icon.js +5 -6
  93. package/lib/entries/icon-info.js +5 -6
  94. package/lib/entries/icon-loading.js +5 -6
  95. package/lib/entries/icon-minus.js +5 -6
  96. package/lib/entries/icon-moon.js +5 -6
  97. package/lib/entries/icon-more.js +5 -6
  98. package/lib/entries/icon-picture.js +5 -6
  99. package/lib/entries/icon-plus.js +5 -6
  100. package/lib/entries/icon-reduction.js +5 -6
  101. package/lib/entries/icon-refresh-left.js +5 -6
  102. package/lib/entries/icon-refresh-right.js +5 -6
  103. package/lib/entries/icon-refresh.js +5 -6
  104. package/lib/entries/icon-search.js +5 -6
  105. package/lib/entries/icon-select.js +5 -6
  106. package/lib/entries/icon-sort.js +5 -6
  107. package/lib/entries/icon-success.js +5 -6
  108. package/lib/entries/icon-sun.js +5 -6
  109. package/lib/entries/icon-theme-default.js +5 -6
  110. package/lib/entries/icon-warn.js +5 -6
  111. package/lib/entries/icon-zoom-in.js +5 -6
  112. package/lib/entries/icon-zoom-out.js +5 -6
  113. package/lib/entries/image-preview.js +5 -6
  114. package/lib/entries/image.js +5 -6
  115. package/lib/entries/input-number.js +5 -6
  116. package/lib/entries/input.js +5 -6
  117. package/lib/entries/list.js +5 -6
  118. package/lib/entries/loading.js +1 -2
  119. package/lib/entries/mask.js +5 -6
  120. package/lib/entries/md-input.js +5 -6
  121. package/lib/entries/menu.js +5 -6
  122. package/lib/entries/message.js +1 -2
  123. package/lib/entries/modal-box.js +1 -2
  124. package/lib/entries/modal.js +5 -6
  125. package/lib/entries/notification-box.js +1 -2
  126. package/lib/entries/notification.js +1 -2
  127. package/lib/entries/page-header.js +5 -6
  128. package/lib/entries/pagination.js +5 -6
  129. package/lib/entries/polygon.js +5 -6
  130. package/lib/entries/popconfirm.js +1 -2
  131. package/lib/entries/popover.js +1 -2
  132. package/lib/entries/qrcode.js +5 -6
  133. package/lib/entries/radio-group.js +5 -6
  134. package/lib/entries/radio.js +5 -6
  135. package/lib/entries/select-ori.js +5 -6
  136. package/lib/entries/select.js +5 -6
  137. package/lib/entries/space.js +5 -6
  138. package/lib/entries/switch.js +5 -6
  139. package/lib/entries/tabbar-item.js +5 -6
  140. package/lib/entries/tabbar.js +5 -6
  141. package/lib/entries/table.js +5 -6
  142. package/lib/entries/tabs.js +1 -2
  143. package/lib/entries/tag.js +5 -6
  144. package/lib/entries/theme-color.js +5 -6
  145. package/lib/entries/theme.js +5 -6
  146. package/lib/entries/transition.js +1 -2
  147. package/lib/entries/upload.js +5 -6
  148. package/lib/entries/utils.js +1 -3
  149. package/lib/form/accessibility.d.ts +15 -0
  150. package/lib/form/accessibility.js +56 -0
  151. package/lib/form/autocomplete.d.ts +21 -0
  152. package/lib/form/autocomplete.js +59 -0
  153. package/lib/form/context.d.ts +157 -0
  154. package/lib/form/context.js +88 -0
  155. package/lib/form/form_inner.d.ts +99 -24
  156. package/lib/form/form_inner.js +424 -72
  157. package/lib/form/form_item.d.ts +35 -11
  158. package/lib/form/form_item.js +210 -78
  159. package/lib/form/form_item.less_inline.js +2 -3
  160. package/lib/form/form_item_style.d.ts +3 -0
  161. package/lib/form/form_item_style.js +7 -0
  162. package/lib/form/index.d.ts +69 -15
  163. package/lib/form/index.js +501 -101
  164. package/lib/form/index.less_inline.js +1 -2
  165. package/lib/form/owner.d.ts +78 -0
  166. package/lib/form/owner.js +138 -0
  167. package/lib/form/style.d.ts +3 -0
  168. package/lib/form/style.js +7 -0
  169. package/lib/icon/arrow_down.js +1 -2
  170. package/lib/icon/arrow_left.js +1 -2
  171. package/lib/icon/arrow_right.js +1 -2
  172. package/lib/icon/arrow_up.js +1 -2
  173. package/lib/icon/base.js +1 -2
  174. package/lib/icon/calendar.js +1 -2
  175. package/lib/icon/caret_bottom.js +1 -2
  176. package/lib/icon/caret_top.js +1 -2
  177. package/lib/icon/close.js +1 -2
  178. package/lib/icon/close_filled.js +1 -2
  179. package/lib/icon/copy.js +1 -2
  180. package/lib/icon/d_arrow_left.js +1 -2
  181. package/lib/icon/d_arrow_right.js +1 -2
  182. package/lib/icon/delete.js +1 -2
  183. package/lib/icon/eye_outline.js +1 -2
  184. package/lib/icon/font_icon.js +1 -2
  185. package/lib/icon/icon_style.js +1 -2
  186. package/lib/icon/index.less_inline.js +1 -2
  187. package/lib/icon/info.js +1 -2
  188. package/lib/icon/loading.js +1 -2
  189. package/lib/icon/minus.js +1 -2
  190. package/lib/icon/moon.js +1 -2
  191. package/lib/icon/more.js +1 -2
  192. package/lib/icon/picture.js +1 -2
  193. package/lib/icon/plus.js +1 -2
  194. package/lib/icon/reduction.js +1 -2
  195. package/lib/icon/refresh.js +1 -2
  196. package/lib/icon/refresh_left.js +1 -2
  197. package/lib/icon/refresh_right.js +1 -2
  198. package/lib/icon/search.js +1 -2
  199. package/lib/icon/select.js +1 -2
  200. package/lib/icon/sort.js +1 -2
  201. package/lib/icon/success.js +1 -2
  202. package/lib/icon/sun.js +1 -2
  203. package/lib/icon/theme_default.js +1 -2
  204. package/lib/icon/warn.js +1 -2
  205. package/lib/icon/zoom_in.js +1 -2
  206. package/lib/icon/zoom_out.js +1 -2
  207. package/lib/image/image_preview.js +1 -2
  208. package/lib/image/image_preview.less_inline.js +1 -2
  209. package/lib/image/index.js +1 -2
  210. package/lib/image/index.less_inline.js +1 -2
  211. package/lib/index.d.ts +2 -1
  212. package/lib/index.js +91 -91
  213. package/lib/input/index.d.ts +14 -0
  214. package/lib/input/index.js +126 -31
  215. package/lib/input/index.less_inline.js +2 -3
  216. package/lib/input/input_inner.less_inline.js +1 -2
  217. package/lib/input/style.d.ts +1 -0
  218. package/lib/input/style.js +5 -7
  219. package/lib/input_number/index.d.ts +7 -0
  220. package/lib/input_number/index.js +70 -48
  221. package/lib/input_number/index.less_inline.js +1 -2
  222. package/lib/input_number/style.js +1 -2
  223. package/lib/list/index.js +4 -5
  224. package/lib/list/index.less_inline.js +1 -2
  225. package/lib/loading/index.js +1 -2
  226. package/lib/mask/index.js +2 -7
  227. package/lib/mask/index.less_inline.js +1 -2
  228. package/lib/md_input/index.d.ts +11 -2
  229. package/lib/md_input/index.js +63 -27
  230. package/lib/md_input/index.less_inline.js +2 -3
  231. package/lib/menu/index.js +2 -7
  232. package/lib/menu/index.less_inline.js +1 -2
  233. package/lib/message/index.js +1 -2
  234. package/lib/modal/index.js +15 -16
  235. package/lib/modal/index.less_inline.js +1 -2
  236. package/lib/modal/modal_box.js +24 -25
  237. package/lib/notification/index.js +15 -29
  238. package/lib/notification/index.less_inline.js +1 -2
  239. package/lib/notification/notification_box.js +2 -3
  240. package/lib/notification/placement.js +1 -2
  241. package/lib/notification/style.js +1 -2
  242. package/lib/page_header/index.js +1 -2
  243. package/lib/page_header/index.less_inline.js +1 -2
  244. package/lib/pagination/index.js +2 -7
  245. package/lib/pagination/index.less_inline.js +1 -2
  246. package/lib/polygon/index.js +1 -2
  247. package/lib/polygon/index.less_inline.js +1 -2
  248. package/lib/qrcode/index.js +1 -2
  249. package/lib/qrcode/index.less_inline.js +1 -2
  250. package/lib/select/index.d.ts +19 -2
  251. package/lib/select/index.js +128 -74
  252. package/lib/select/index.less_inline.js +1 -2
  253. package/lib/select_ori/index.d.ts +9 -1
  254. package/lib/select_ori/index.js +36 -24
  255. package/lib/select_ori/index.less_inline.js +1 -2
  256. package/lib/space/index.js +1 -2
  257. package/lib/space/index.less_inline.js +1 -2
  258. package/lib/styles/animation/index.css_inline.js +1 -2
  259. package/lib/styles/animation/index.js +1 -2
  260. package/lib/styles/mask/index.css_inline.js +1 -2
  261. package/lib/styles/mask/index.js +1 -2
  262. package/lib/switch/index.d.ts +6 -0
  263. package/lib/switch/index.js +31 -16
  264. package/lib/switch/index.less_inline.js +1 -2
  265. package/lib/tabbar/index.js +1 -2
  266. package/lib/tabbar/index.less_inline.js +1 -2
  267. package/lib/tabbar/item.js +1 -2
  268. package/lib/tabbar/item.less_inline.js +1 -2
  269. package/lib/table/index.js +1 -2
  270. package/lib/table/index.less_inline.js +1 -2
  271. package/lib/tabs/index.js +1 -2
  272. package/lib/tag/index.d.ts +11 -3
  273. package/lib/tag/index.js +25 -24
  274. package/lib/tag/index.less_inline.js +2 -3
  275. package/lib/theme/appearance.d.ts +5 -0
  276. package/lib/theme/appearance.js +34 -0
  277. package/lib/theme/index.js +83 -39
  278. package/lib/theme/index.less_inline.js +1 -2
  279. package/lib/theme/theme_color.js +1 -2
  280. package/lib/upload/index.js +28 -41
  281. package/lib/upload/index.less_inline.js +2 -3
  282. package/lib/upload/style.js +1 -2
  283. package/lib/utils/clickoutside.js +1 -2
  284. package/lib/utils/event.js +1 -2
  285. package/lib/utils/index.d.ts +27 -6
  286. package/lib/utils/index.js +26 -6
  287. package/lib/utils/popover.js +7 -16
  288. package/lib/utils/transition.js +1 -2
  289. package/package.json +16 -13
  290. package/styles/dark.css +10 -2
  291. package/styles/dropdown.css +46 -0
  292. package/styles/reset.css +0 -1
  293. package/styles/select.css +5 -0
  294. package/styles/themes/apple.css +47 -0
  295. package/styles/{theme-coral.css → themes/coral.css} +5 -3
  296. package/styles/themes/deep-sea-blue.css +12 -0
  297. package/styles/themes/gamboge.css +15 -0
  298. package/styles/{theme-jade.css → themes/jade.css} +5 -3
  299. package/styles/themes/lotus-seed.css +12 -0
  300. package/styles/{theme-tangerine.css → themes/tangerine.css} +5 -3
  301. package/styles/themes.css +8 -0
  302. package/styles/vars.css +8 -2
  303. package/types/preact.d.ts +42 -0
  304. package/lib/form/types.d.ts +0 -7
  305. package/lib/utils/context_provide.d.ts +0 -10
  306. package/lib/utils/context_provide.js +0 -22
  307. package/lib/utils/locale.d.ts +0 -6
  308. package/lib/utils/locale.js +0 -34
  309. package/lib/utils/signal_types.d.ts +0 -5
@@ -2,11 +2,56 @@ import { parseAttrValue as e, unitNumberStr as t } from "../utils/index.js";
2
2
  import n from "../form/form_inner.js";
3
3
  import r from "./style.js";
4
4
  import { $ as i, $$ as a, $one as o, addClass as s, formatStyle as c, off as l, on as u, removeClass as d } from "utilane/browser";
5
- //#region src/components/input/index.ts
5
+ // src/components/input/index.ts
6
6
  var f = class extends n {
7
7
  static baseName = "input";
8
8
  parser;
9
9
  $inner;
10
+ formInnerBlock = !1;
11
+ userBadInput = !1;
12
+ get formStateRestorationEnabled() {
13
+ return (this.getAttribute("type") || "text").toLowerCase() !== "password";
14
+ }
15
+ get acceptsAutocompleteText() {
16
+ return !0;
17
+ }
18
+ get nativeBadInput() {
19
+ return this.userBadInput;
20
+ }
21
+ syncInputAttributes() {
22
+ if (this.$inner) {
23
+ this.$inner.type = this.getAttribute("type") || "text";
24
+ for (let e of [
25
+ "pattern",
26
+ "min",
27
+ "max",
28
+ "step",
29
+ "minlength",
30
+ "maxlength",
31
+ "inputmode"
32
+ ]) {
33
+ let t = this.getAttribute(e);
34
+ t === null ? this.$inner.removeAttribute(e) : this.$inner.setAttribute(e, t);
35
+ }
36
+ this.$inner.readOnly = this.readOnly, this.$inner.disabled = this.isDisabled();
37
+ }
38
+ }
39
+ configurationApplied() {
40
+ this.syncInputAttributes();
41
+ }
42
+ attributeChanged(e, t, n) {
43
+ if (super.attributeChanged(e, t, n), this.syncInputAttributes(), e === "type" && this.$inner) {
44
+ let e = this.dirtyValue;
45
+ this.setValue(this.$inner.value), this.dirtyValue = e;
46
+ }
47
+ this.rendered && ["readonly", "clearable"].includes(e) && this.#t();
48
+ }
49
+ focus(e) {
50
+ this.isDisabled() || this.$inner?.focus(e);
51
+ }
52
+ blur() {
53
+ this.$inner?.blur();
54
+ }
10
55
  constructor() {
11
56
  super(), this.version = 2, this._state = {
12
57
  type: "text",
@@ -18,8 +63,21 @@ var f = class extends n {
18
63
  readonly: !1
19
64
  };
20
65
  }
66
+ get nativeValueEnabled() {
67
+ return !0;
68
+ }
69
+ serializeFormValue() {
70
+ return String(this.getValue() ?? "");
71
+ }
72
+ setValue(e) {
73
+ this.userBadInput = !1;
74
+ let t = this.$inner ?? this.ownerDocument.createElement("input");
75
+ t.type = this.getAttribute("type") || "text";
76
+ let n = String(e ?? "");
77
+ t.value = n, super.setValue(t.value === n ? e : t.value), this.$inner && this.#t(), this.syncNativeValue();
78
+ }
21
79
  set value(e) {
22
- this.setValue(e), this.$inner && (this.$inner.value = e, this.#e());
80
+ this.setValue(e);
23
81
  }
24
82
  get value() {
25
83
  return this.getValue();
@@ -31,7 +89,8 @@ var f = class extends n {
31
89
  e ? this.setAttribute("readonly", "") : this.removeAttribute("readonly");
32
90
  }
33
91
  static get observedAttributes() {
34
- return [
92
+ return [.../* @__PURE__ */ new Set([
93
+ ...n.observedAttributes,
35
94
  "disabled",
36
95
  "readonly",
37
96
  "value",
@@ -45,17 +104,34 @@ var f = class extends n {
45
104
  "type",
46
105
  "placeholder",
47
106
  "width",
48
- "block"
49
- ];
107
+ "block",
108
+ "autocomplete"
109
+ ])];
50
110
  }
51
111
  afterInit() {
52
- this.$inner = o(".l-input__inner", this.root), u(this.$inner, "input", this._input), u(this.$inner, "change", this.#n), this.style.cssText = c(this._getStyleObj()) + this.getAttr("style", "");
112
+ this.$inner = o(".l-input__inner", this.root), this.$inner.value = String(this.getValue() ?? ""), this.#t(), this.syncInputAttributes(), this.$inner.addEventListener("keydown", this.#e), u(this.$inner, "input", this._input), u(this.$inner, "change", this.#r), this.style.cssText = c(this._getStyleObj()) + this.getAttr("style", "");
53
113
  }
54
114
  beforeDestroy() {
55
- l(this.$inner, "input", this._input), l(this.$inner, "change", this.#n);
115
+ this.$inner?.removeEventListener("keydown", this.#e), l(this.$inner, "input", this._input), l(this.$inner, "change", this.#r);
56
116
  let e = o(".l-clearable", this.root);
57
- e && l(e, "click", this.#t);
117
+ e && l(e, "click", this.#n);
58
118
  }
119
+ #e = (e) => {
120
+ let t = this.$inner, n = this.form;
121
+ if (!t || !n || t.form || this.isDisabled() || e.defaultPrevented || e.key !== "Enter" || e.isComposing || e.keyCode === 229 || e.repeat || ![
122
+ "text",
123
+ "search",
124
+ "tel",
125
+ "url",
126
+ "email",
127
+ "password",
128
+ "number"
129
+ ].includes(t.type)) return;
130
+ let r = this.closest("l-form"), i = r && n.contains(r) ? r : n.getRootNode(), a = (e) => e.form === n ? e instanceof HTMLButtonElement || e instanceof HTMLInputElement ? e.type === "submit" || e.type === "image" : e.getAttribute("html-type") === "submit" : !1, o = Array.from(i.querySelectorAll("button, input, l-button[html-type=\"submit\"]")).find(a);
131
+ o && setTimeout(() => {
132
+ e.defaultPrevented || !this.isConnected || this.$inner !== t || this.isDisabled() || this.form === n && a(o) && o.click();
133
+ }, 0);
134
+ };
59
135
  attributeChange(n, r, i) {
60
136
  switch (n) {
61
137
  case "error":
@@ -76,7 +152,7 @@ var f = class extends n {
76
152
  }
77
153
  }
78
154
  updateDOM(e) {
79
- e.has("readonly") && this.$inner && (this.$inner.readOnly = this._state.readonly), (e.has("readonly") || e.has("clearable")) && this.#e(), e.has("clearable") && (this._state.clearable ? s(this, "l-input--clearable") : d(this, "l-input--clearable")), e.has("error") && this._updateError(this._state.error != null), e.has("maxlength") && this._updateAttr("maxlength", this._state.maxlength), e.has("minlength") && this._updateAttr("minlength", this._state.minlength), e.has("inputmode") && this._updateAttr("inputmode", this._state.inputmode), e.has("block") && this.innerBlockChange(this._state.block), e.has("placeholder") && this.$inner && (this.$inner.placeholder = this._state.placeholder);
155
+ e.has("readonly") && this.$inner && (this.$inner.readOnly = this._state.readonly), (e.has("readonly") || e.has("clearable")) && this.#t(), e.has("clearable") && (this._state.clearable ? s(this, "l-input--clearable") : d(this, "l-input--clearable")), e.has("error") && this._updateError(this._state.error != null || this.$inner?.getAttribute("aria-invalid") === "true"), e.has("maxlength") && this._updateAttr("maxlength", this._state.maxlength), e.has("minlength") && this._updateAttr("minlength", this._state.minlength), e.has("inputmode") && this._updateAttr("inputmode", this._state.inputmode), e.has("block") && this.updateBlock(), e.has("placeholder") && this.$inner && (this.$inner.placeholder = this._state.placeholder);
80
156
  }
81
157
  _updateAttr(e, t) {
82
158
  this.$inner && (t ? this.$inner.setAttribute(e, t) : this.$inner.removeAttribute(e));
@@ -99,7 +175,6 @@ var f = class extends n {
99
175
  let t = a("input", {
100
176
  class: "l-input__inner",
101
177
  value: this.value,
102
- name: this.getName(),
103
178
  placeholder: this._state.placeholder,
104
179
  part: "default",
105
180
  type: this._state.type,
@@ -122,44 +197,61 @@ var f = class extends n {
122
197
  }
123
198
  _calcCurosorPosition(e, t) {
124
199
  let n = e.selectionStart || 0, r = e.selectionEnd || 0, i = e.value, a = n, o = r;
125
- t.length < i.length ? (a = Math.max(0, n - (i.length - t.length)), o = a) : t.length > i.length ? (a = Math.min(t.length, n + (t.length - i.length)), o = a) : (a = Math.min(t.length, n), o = a), e.value = t, e.setSelectionRange(a, o);
200
+ t.length < i.length ? (a = Math.max(0, n - (i.length - t.length)), o = a) : t.length > i.length ? (a = Math.min(t.length, n + (t.length - i.length)), o = a) : (a = Math.min(t.length, n), o = a), e.value = t, [
201
+ "text",
202
+ "search",
203
+ "url",
204
+ "tel",
205
+ "password"
206
+ ].includes(e.type) && e.setSelectionRange(a, o);
126
207
  }
127
208
  _input = (e) => {
128
- let t = e.target, n = t.value, r = n;
209
+ let t = e.target;
210
+ if (this.readOnly || this.isDisabled()) {
211
+ t.value = String(this.getValue() ?? ""), e.stopImmediatePropagation();
212
+ return;
213
+ }
214
+ let n = t.validity.badInput, r = t.value, i = r;
129
215
  if (this._state.allowInput != null) {
130
216
  let e = this._state.allowInput.indexOf("."), t = e === -1 ? e : parseInt(this._state.allowInput.substring(e + 1));
131
- r = this._numberInputParse(n, {
217
+ i = this._numberInputParse(r, {
132
218
  integer: this._state.allowInput.includes("integer"),
133
219
  negative: this._state.allowInput.startsWith("-"),
134
220
  precision: t
135
- }), r = String(r);
221
+ }), i = String(i);
136
222
  }
137
- this.parser != null && (r = this.parser(r));
223
+ this.parser != null && (i = this.parser(i));
138
224
  try {
139
- this._calcCurosorPosition(t, r);
225
+ this._calcCurosorPosition(t, i);
140
226
  } catch (e) {
141
227
  console.warn(e);
142
228
  }
143
- this.setValue(r), this.#e();
229
+ this.setValue(i), this.userBadInput = n, this.syncNativeValue(), this.#t(), this.validateInput();
144
230
  };
145
- #e() {
231
+ #t() {
146
232
  let e = o(".l-clearable", this.root);
147
- if (this._state.clearable && !this.readOnly && !this.isDisabled() && this.value?.length > 0) {
233
+ if (this._state.clearable && !this.readOnly && !this.isDisabled() && String(this.value ?? "").length > 0) {
148
234
  if (e == null) {
149
- e = a("span", { class: "l-input__suffix l-clearable" });
150
- let t = a("l-close-filled-icon");
151
- e.appendChild(t), this.root.appendChild(e), u(e, "click", this.#t);
235
+ e = a("button", {
236
+ class: "l-input__suffix l-clearable",
237
+ type: "button",
238
+ "aria-label": "清空输入",
239
+ part: "clear"
240
+ });
241
+ let t = a("l-close-filled-icon", { "aria-hidden": "true" });
242
+ e.appendChild(t), this.root.appendChild(e), u(e, "click", this.#n);
152
243
  }
153
- } else e && (l(e, "click", this.#t), e.remove());
244
+ } else e && (l(e, "click", this.#n), e.remove());
154
245
  }
155
- #t = () => {
156
- this.readOnly || this.isDisabled() || (this.value = "", this.dispatchEvent(new CustomEvent("input", {
246
+ #n = () => {
247
+ this.readOnly || this.isDisabled() || (this.value = "", this.validateInput(), this.focus(), this.dispatchEvent(new CustomEvent("input", {
157
248
  bubbles: !0,
249
+ composed: !0,
158
250
  detail: { value: this.value }
159
- })), this.#e());
251
+ })), this.#t());
160
252
  };
161
253
  disabledChange() {
162
- this.isDisabled() ? this.classList.add("is-disabled") : this.classList.remove("is-disabled"), this.$inner && (this.$inner.disabled = this.isDisabled(), this.#e());
254
+ this.isDisabled() ? this.classList.add("is-disabled") : this.classList.remove("is-disabled"), this.$inner && (this.$inner.disabled = this.isDisabled(), this.#t());
163
255
  }
164
256
  _numberInputParse(e, t) {
165
257
  let n = e.trim();
@@ -173,7 +265,10 @@ var f = class extends n {
173
265
  return n.length > 1 && (n = n.replace(/^0+(\d)/, "$1")), r ? "-" + n : n;
174
266
  }
175
267
  innerBlockChange(e) {
176
- e ? s(this, "is-block") : d(this, "is-block");
268
+ this.formInnerBlock = e, this.updateBlock();
269
+ }
270
+ updateBlock() {
271
+ this.classList.toggle("is-block", this._state.block || this.formInnerBlock);
177
272
  }
178
273
  _getStyleObj() {
179
274
  let e = {};
@@ -183,9 +278,10 @@ var f = class extends n {
183
278
  e ? s(this, "is-error") : d(this, "is-error");
184
279
  }
185
280
  validResult(e) {
186
- this._updateError(e != null);
281
+ super.validResult(e), this._updateError(!!e || !!this._state.error);
187
282
  }
188
- #n = (e) => {
283
+ #r = (e) => {
284
+ if (e.stopPropagation(), this.readOnly || this.isDisabled()) return;
189
285
  let t = e.target;
190
286
  this.dispatchEvent(new CustomEvent("change", {
191
287
  bubbles: !0,
@@ -197,5 +293,4 @@ var f = class extends n {
197
293
  }));
198
294
  };
199
295
  };
200
- //#endregion
201
296
  export { f as default };
@@ -1,4 +1,3 @@
1
- //#region src/components/input/index.less?inline
2
- var e = ":host{--l-input-border-color:var(--l-border-color,#dedede);width:var(--l-input-width,170px);height:var(--l-form-control-height,32px);border:1px solid var(--l-input-border-color,#dedede);border-radius:var(--l-border-radius,3px);vertical-align:middle;box-sizing:border-box;background-color:#0000;align-items:center;padding:0 7px;transition:border-color .3s,box-shadow .3s;display:inline-flex}:host(:focus){--l-input-border-color:var(--l-primary-color,#722ed1);box-shadow:0 0 0 3px var(--l-primary-color-light5)}:host(.is-block){width:100%}:host(.is-disabled){background-color:var(--l-disabled-color,#f5f7fa)}:host(.is-error){--l-input-border-color:var(--l-error-color)}:host(.is-error:focus){box-shadow:0 0 0 3px var(--l-error-color-light5)}.l-input__prefix,.l-input__suffix{color:#a8abb2;flex-shrink:0;font-size:14px;display:inline-flex}.l-input__prefix{margin-right:5px}.l-input__suffix{margin-left:5px}.l-clearable{cursor:pointer}.l-clearable:hover{color:#999}";
3
- //#endregion
1
+ // src/components/input/index.less?inline
2
+ var e = ".l-input__inner{box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:inherit;font-size:inherit;background-color:#0000;border:none;outline:none;flex-grow:1}.l-input__inner:disabled{background-color:#0000}:host{--l-input-border-color:var(--l-border-color,#dedede);width:var(--l-input-width,170px);height:var(--l-form-control-height,32px);border:1px solid var(--l-input-border-color,#dedede);border-radius:var(--l-border-radius,3px);vertical-align:middle;box-sizing:border-box;background-color:#0000;align-items:center;padding:0 7px;transition:border-color .3s,box-shadow .3s;display:inline-flex}:host(:focus){--l-input-border-color:var(--l-primary-color,#722ed1);box-shadow:0 0 0 3px var(--l-primary-color-light5)}:host(.is-block){width:100%}:host(.is-disabled){background-color:var(--l-disabled-color,#f5f7fa)}:host(.is-error){--l-input-border-color:var(--l-error-color)}:host(.is-error:focus){box-shadow:0 0 0 3px var(--l-error-color-light5)}.l-input__prefix,.l-input__suffix{color:#a8abb2;flex-shrink:0;font-size:14px;display:inline-flex}.l-input__prefix{margin-right:5px}.l-input__suffix{margin-left:5px}.l-clearable{cursor:pointer;font:inherit;background:0 0;border:0;padding:0}.l-clearable:focus-visible{outline:2px solid var(--l-primary-color,#722ed1);outline-offset:2px}.l-clearable:hover{color:#999}";
4
3
  export { e as default };
@@ -1,4 +1,3 @@
1
- //#region src/components/input/input_inner.less?inline
1
+ // src/components/input/input_inner.less?inline
2
2
  var e = ".l-input__inner{box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:inherit;font-size:inherit;background-color:#0000;border:none;outline:none;flex-grow:1}.l-input__inner:disabled{background-color:#0000}";
3
- //#endregion
4
3
  export { e as default };
@@ -1,2 +1,3 @@
1
+ /** 与 Button 一致:模块级构造一次,由所有 Input 的 ShadowRoot 共享。 */
1
2
  declare const inputSheet: CSSStyleSheet;
2
3
  export default inputSheet;
@@ -1,9 +1,7 @@
1
1
  import e from "./index.less_inline.js";
2
- import t from "./input_inner.less_inline.js";
3
- //#region src/components/input/style.ts
4
- var n = /* @__PURE__ */ (() => {
5
- let n = new CSSStyleSheet();
6
- return n.replaceSync(`${e}\n${t}`), n;
2
+ // src/components/input/style.ts
3
+ var t = /* @__PURE__ */ (() => {
4
+ let t = new CSSStyleSheet();
5
+ return t.replaceSync(e), t;
7
6
  })();
8
- //#endregion
9
- export { n as default };
7
+ export { t as default };
@@ -33,12 +33,18 @@ export default class InputNumber extends FormInner<InputNumberState> {
33
33
  render(): DocumentFragment;
34
34
  afterInit(): void;
35
35
  beforeDestroy(): void;
36
+ protected get intrinsicDefaultValue(): undefined;
37
+ protected parseDefaultValue(value: string | null): number | undefined;
38
+ protected serializeFormValue(): string;
39
+ protected get nativeConstraintValues(): readonly unknown[];
40
+ setValue(value: any): void;
36
41
  set value(value: any);
37
42
  get value(): any;
38
43
  disabledChange(): void;
39
44
  focus(): void;
40
45
  /** 将值限制在 min/max 范围内并格式化精度 */
41
46
  private _clamp;
47
+ private _parseNumber;
42
48
  private _formatValue;
43
49
  private _getCurrentNum;
44
50
  private _commitValue;
@@ -50,6 +56,7 @@ export default class InputNumber extends FormInner<InputNumberState> {
50
56
  private _handlePlus;
51
57
  private _stepUp;
52
58
  private _stepDown;
59
+ private _step;
53
60
  private _updateBtnState;
54
61
  private _updateWidth;
55
62
  private _updateControls;
@@ -2,7 +2,7 @@ import { parseAttrValue as e, unitNumberStr as t } from "../utils/index.js";
2
2
  import n from "../form/form_inner.js";
3
3
  import r from "./style.js";
4
4
  import { $$ as i, $one as a, addClass as o, off as s, on as c, removeClass as l } from "utilane/browser";
5
- //#region src/components/input_number/index.ts
5
+ // src/components/input_number/index.ts
6
6
  var u = class extends n {
7
7
  static baseName = "input-number";
8
8
  $input;
@@ -17,7 +17,8 @@ var u = class extends n {
17
17
  };
18
18
  }
19
19
  static get observedAttributes() {
20
- return [
20
+ return [.../* @__PURE__ */ new Set([
21
+ ...n.observedAttributes,
21
22
  "disabled",
22
23
  "value",
23
24
  "name",
@@ -30,23 +31,25 @@ var u = class extends n {
30
31
  "size",
31
32
  "width",
32
33
  "controls-disabled"
33
- ];
34
+ ])];
34
35
  }
35
36
  attributeChange(n, r, i) {
36
37
  switch (n) {
37
38
  case "min":
38
39
  case "max":
40
+ this._state[n] = this._parseNumber(i);
41
+ break;
39
42
  case "precision":
40
- let r = Number(i);
41
- this._state[n] = Number.isFinite(r) ? r : void 0;
43
+ let r = this._parseNumber(i);
44
+ this._state.precision = r != null && Number.isInteger(r) && r >= 0 && r <= 100 ? r : void 0;
42
45
  break;
43
46
  case "step":
44
47
  let a = Number(i);
45
- this._state.step = Number.isFinite(a) ? a : 1;
48
+ this._state.step = Number.isFinite(a) && a > 0 ? a : 1;
46
49
  break;
47
50
  case "placeholder":
48
51
  case "size":
49
- this._state[n] = i.trim();
52
+ this._state[n] = (i ?? "").trim();
50
53
  break;
51
54
  case "width":
52
55
  this._state.width = t(i);
@@ -55,7 +58,12 @@ var u = class extends n {
55
58
  }
56
59
  }
57
60
  updateDOM(e) {
58
- e.has("placeholder") && this.$input && (this.$input.placeholder = this._state.placeholder), e.has("width") && this._updateWidth(), e.has("controls-disabled") && this._updateControls(), (e.has("step") || e.has("min") || e.has("max")) && this._updateBtnState();
61
+ e.has("placeholder") && this.$input && (this.$input.placeholder = this._state.placeholder), e.has("width") && this._updateWidth(), e.has("controls-disabled") && this._updateControls(), e.has("precision") && this.$input && (this.$input.value = this._formatValue(this.value), this.$input.inputMode = this._state.precision == null ? "numeric" : "decimal"), [
62
+ "step",
63
+ "min",
64
+ "max",
65
+ "readonly"
66
+ ].some((t) => e.has(t)) && this._updateBtnState();
59
67
  }
60
68
  render_v2() {
61
69
  return {
@@ -73,7 +81,6 @@ var u = class extends n {
73
81
  let n = i("input", {
74
82
  class: "l-input-number__inner",
75
83
  value: this._formatValue(this.value),
76
- name: this.getName(),
77
84
  placeholder: this._state.placeholder,
78
85
  part: "default",
79
86
  type: "text",
@@ -94,39 +101,55 @@ var u = class extends n {
94
101
  beforeDestroy() {
95
102
  this.$input && (s(this.$input, "input", this._handleInput), s(this.$input, "change", this._handleChange), s(this.$input, "blur", this._handleBlur), s(this.$input, "keydown", this._handleKeydown)), this.$minusBtn && s(this.$minusBtn, "click", this._handleMinus), this.$plusBtn && s(this.$plusBtn, "click", this._handlePlus), this.$input = void 0, this.$minusBtn = void 0, this.$plusBtn = void 0;
96
103
  }
104
+ get intrinsicDefaultValue() {}
105
+ parseDefaultValue(e) {
106
+ return this._parseNumber(e);
107
+ }
108
+ serializeFormValue() {
109
+ return String(this._parseNumber(this.value) ?? "");
110
+ }
111
+ get nativeConstraintValues() {
112
+ return [this._parseNumber(this.value)];
113
+ }
114
+ setValue(e) {
115
+ let t = this._parseNumber(e), n = t != null && typeof e == "string" ? e.trim() : t;
116
+ super.setValue(n), this.$input && (this.$input.value = this._formatValue(n)), this._updateBtnState(), this.syncNativeValue();
117
+ }
97
118
  set value(e) {
98
- this.setValue(e), this.$input && (this.$input.value = this._formatValue(e)), this._updateBtnState();
119
+ this.setValue(e);
99
120
  }
100
121
  get value() {
101
122
  return this.getValue();
102
123
  }
103
124
  disabledChange() {
104
- this.isDisabled() ? o(this, "is-disabled") : l(this, "is-disabled"), this.$input && (this.$input.disabled = this.isDisabled()), this.$minusBtn && (this.$minusBtn.disabled = this.isDisabled()), this.$plusBtn && (this.$plusBtn.disabled = this.isDisabled());
125
+ this.isDisabled() ? o(this, "is-disabled") : l(this, "is-disabled"), this.$input && (this.$input.disabled = this.isDisabled()), this.$minusBtn && (this.$minusBtn.disabled = this.isDisabled()), this.$plusBtn && (this.$plusBtn.disabled = this.isDisabled()), this._updateBtnState();
105
126
  }
106
127
  focus() {
107
128
  this.$input?.focus();
108
129
  }
109
130
  _clamp(e) {
110
131
  let { min: t, max: n, precision: r } = this._state;
111
- return t != null && e < t && (e = t), n != null && e > n && (e = n), r != null && (e = parseFloat(e.toFixed(r))), e;
132
+ return r != null && (e = Number(e.toFixed(r))), t != null && e < t && (e = t), n != null && e > n && (e = n), e;
112
133
  }
113
- _formatValue(e) {
114
- if (e == null || e === "") return "";
134
+ _parseNumber(e) {
135
+ if (typeof e == "string" && !/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i.test(e.trim()) || typeof e != "number" && typeof e != "string") return;
115
136
  let t = Number(e);
116
- if (isNaN(t)) return "";
137
+ return Number.isFinite(t) ? t : void 0;
138
+ }
139
+ _formatValue(e) {
140
+ let t = this._parseNumber(e);
141
+ if (t == null) return "";
117
142
  let { precision: n } = this._state;
118
143
  return n == null ? String(t) : t.toFixed(n);
119
144
  }
120
145
  _getCurrentNum() {
121
- let e = this.$input?.value ?? this.value;
122
- if (e == null || e === "") return 0;
123
- let t = Number(e);
124
- return isNaN(t) ? 0 : t;
146
+ return this._parseNumber(this.$input?.value ?? this.value) ?? 0;
125
147
  }
126
148
  _commitValue(e) {
127
149
  let t = this._clamp(e);
128
- this.value = t, this.$input && (this.$input.value = this._formatValue(t)), this.emit("input", {
150
+ this.value = t, this.validateInput(), this.emit("input", {
129
151
  bubbles: !0,
152
+ composed: !0,
130
153
  detail: {
131
154
  value: t,
132
155
  name: this.getName()
@@ -134,11 +157,11 @@ var u = class extends n {
134
157
  }), this._updateBtnState();
135
158
  }
136
159
  _handleInput = (e) => {
137
- let t = e.target.value;
138
- if (t === "-" || t === "." || t === "-.") return;
139
- let n = Number(t);
140
- Number.isFinite(n) && (this.setValue(n), this.emit("input", {
160
+ e.stopPropagation();
161
+ let t = e.target.value, n = this._parseNumber(t);
162
+ (n != null || t.trim() === "") && (super.setValue(n), this._updateBtnState(), this.validateInput(), this.emit("input", {
141
163
  bubbles: !0,
164
+ composed: !0,
142
165
  detail: {
143
166
  value: n,
144
167
  name: this.getName()
@@ -146,45 +169,45 @@ var u = class extends n {
146
169
  }));
147
170
  };
148
171
  _handleChange = (e) => {
149
- let t = e.target, n = Number(t.value);
150
- if (Number.isFinite(n)) {
151
- let e = this._clamp(n);
152
- this.value = e, this.$input && (this.$input.value = this._formatValue(e)), this.emit("change", { detail: {
153
- value: e,
154
- name: this.getName()
155
- } });
156
- }
172
+ e.stopPropagation();
173
+ let t = e.target, n = this._parseNumber(t.value), r = this.value;
174
+ this.value = n == null ? void 0 : this._clamp(n), Object.is(r, this.value) || this.validateInput(), n != null && this.emit("change", { detail: {
175
+ value: this.value,
176
+ name: this.getName()
177
+ } });
157
178
  };
158
179
  _handleBlur = () => {
159
180
  if (this.$input) {
160
- let e = this.$input.value, t = parseFloat(e);
161
- if (Number.isFinite(t)) {
162
- let e = this._clamp(t);
163
- this.value = e, this.$input.value = this._formatValue(e);
164
- } else this.value = void 0, this.$input.value = "";
181
+ let e = this._parseNumber(this.$input.value), t = this.value;
182
+ this.value = e == null ? void 0 : this._clamp(e), Object.is(t, this.value) || this.validateInput();
165
183
  }
166
184
  };
167
185
  _handleKeydown = (e) => {
168
186
  let t = e;
169
- this.isDisabled() || (t.key === "ArrowUp" ? (t.preventDefault(), this._stepUp()) : t.key === "ArrowDown" && (t.preventDefault(), this._stepDown()));
187
+ this.isDisabled() || this.$input?.readOnly || (t.key === "ArrowUp" ? (t.preventDefault(), this._stepUp()) : t.key === "ArrowDown" && (t.preventDefault(), this._stepDown()));
170
188
  };
171
189
  _handleMinus = () => {
172
- this.isDisabled() || (this._stepDown(), this.focus());
190
+ this.isDisabled() || this.$input?.readOnly || (this._stepDown(), this.focus());
173
191
  };
174
192
  _handlePlus = () => {
175
- this.isDisabled() || (this._stepUp(), this.focus());
193
+ this.isDisabled() || this.$input?.readOnly || (this._stepUp(), this.focus());
176
194
  };
177
195
  _stepUp() {
178
- let e = this._getCurrentNum();
179
- this._commitValue(e + this._state.step);
196
+ this._step(1);
180
197
  }
181
198
  _stepDown() {
182
- let e = this._getCurrentNum();
183
- this._commitValue(e - this._state.step);
199
+ this._step(-1);
200
+ }
201
+ _step(e) {
202
+ let t = this._getCurrentNum(), n = this._state.step, r = (e) => {
203
+ let [t, n = "0"] = String(e).split("e");
204
+ return (t.split(".")[1]?.length ?? 0) - Number(n);
205
+ }, i = Math.max(0, r(t), r(n)), a = t + e * n;
206
+ Number.isFinite(a) && this._commitValue(Number(a.toFixed(Math.min(i, 100))));
184
207
  }
185
208
  _updateBtnState() {
186
- let e = this._getCurrentNum(), { min: t, max: n } = this._state;
187
- this.$minusBtn && t != null && (this.$minusBtn.disabled = this.isDisabled() || e <= t), this.$plusBtn && n != null && (this.$plusBtn.disabled = this.isDisabled() || e >= n);
209
+ let e = this._getCurrentNum(), { min: t, max: n } = this._state, r = this.isDisabled() || !!this.$input?.readOnly;
210
+ this.$minusBtn && (this.$minusBtn.disabled = r || t != null && e <= t), this.$plusBtn && (this.$plusBtn.disabled = r || n != null && e >= n);
188
211
  }
189
212
  _updateWidth() {
190
213
  this._state.width ? this.style.setProperty("--l-input-number-width", this._state.width) : this.style.removeProperty("--l-input-number-width");
@@ -196,8 +219,7 @@ var u = class extends n {
196
219
  e ? o(this, "is-block") : l(this, "is-block");
197
220
  }
198
221
  validResult(e) {
199
- e == null ? l(this, "is-error") : o(this, "is-error");
222
+ super.validResult(e), e == null ? l(this, "is-error") : o(this, "is-error");
200
223
  }
201
224
  };
202
- //#endregion
203
225
  export { u as default };
@@ -1,4 +1,3 @@
1
- //#region src/components/input_number/index.less?inline
1
+ // src/components/input_number/index.less?inline
2
2
  var e = ":host{--l-input-number-border-color:var(--l-border-color,#d9d9d9);--l-input-number-btn-color:#606266;--l-input-number-btn-hover-color:var(--l-primary-color,#722ed1);--l-input-number-btn-disabled-color:#c0c4cc;--l-input-number-bg:#fff;--l-input-number-btn-bg:#f5f7fa;--l-input-number-btn-hover-bg:var(--l-primary-color-light5,#f3e8ff);--l-input-number-width:170px;width:var(--l-input-number-width);height:var(--l-form-control-height,32px);border:1px solid var(--l-input-number-border-color);border-radius:var(--l-border-radius,3px);box-sizing:border-box;vertical-align:middle;background-color:var(--l-input-number-bg);align-items:center;transition:border-color .3s,box-shadow .3s;display:inline-flex;overflow:hidden}:host(:focus-within){--l-input-number-border-color:var(--l-primary-color,#722ed1);box-shadow:0 0 0 3px var(--l-primary-color-light5)}:host(.is-block){width:100%}:host(.is-disabled){background-color:var(--l-disabled-color,#f5f7fa);cursor:not-allowed}:host(.is-disabled) .l-input-number__btn{color:var(--l-input-number-btn-disabled-color);cursor:not-allowed}:host(.is-disabled) .l-input-number__btn:hover{background-color:var(--l-input-number-btn-bg)}:host(.is-error){--l-input-number-border-color:var(--l-error-color)}:host(.is-error:focus-within){box-shadow:0 0 0 3px var(--l-error-color-light5)}:host(.l-input-number--small){--l-form-control-height:24px;font-size:12px}:host(.l-input-number--large){--l-form-control-height:40px;--l-border-radius:6px;font-size:16px}.l-input-number__btn{background:var(--l-input-number-btn-bg);width:32px;height:100%;color:var(--l-input-number-btn-color);cursor:pointer;-webkit-user-select:none;user-select:none;font-size:inherit;border:none;outline:none;flex-shrink:0;justify-content:center;align-items:center;padding:0;transition:background-color .25s,color .25s;display:inline-flex}.l-input-number__btn:hover:not(:disabled){background:var(--l-input-number-btn-hover-bg);color:var(--l-input-number-btn-hover-color)}.l-input-number__btn:active:not(:disabled){background:var(--l-primary-color-light4,#e2d3fa);color:var(--l-primary-color-dark1,#531dab)}.l-input-number__btn:disabled{color:var(--l-input-number-btn-disabled-color);cursor:not-allowed}:host(.l-input-number--no-controls) .l-input-number__inner{text-align:left}.l-input-number__inner{text-align:center;width:100%;height:100%;font-size:inherit;color:var(--l-input-number-btn-color);box-sizing:border-box;-moz-appearance:textfield;background:0 0;border:none;outline:none;flex:1;padding:0 8px}.l-input-number__inner::-webkit-outer-spin-button,.l-input-number__inner::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.l-input-number__inner::placeholder{color:#c0c4cc}html.dark :host{--l-input-number-bg:#ffffff0f;--l-input-number-btn-bg:#ffffff14;--l-input-number-btn-color:#ffffffa6;--l-input-number-btn-hover-bg:var(--l-primary-color-light5);--l-input-number-btn-disabled-color:#ffffff40}html.dark :host(.is-disabled){background-color:#ffffff14}html.dark .l-input-number__inner::placeholder{color:#ffffff4d}";
3
- //#endregion
4
3
  export { e as default };
@@ -1,8 +1,7 @@
1
1
  import e from "./index.less_inline.js";
2
- //#region src/components/input_number/style.ts
2
+ // src/components/input_number/style.ts
3
3
  var t = /* @__PURE__ */ (() => {
4
4
  let t = new CSSStyleSheet();
5
5
  return t.replaceSync(e), t;
6
6
  })();
7
- //#endregion
8
7
  export { t as default };
package/lib/list/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import e from "../base.js";
2
2
  import { parseAttrValue as t } from "../utils/index.js";
3
- import n from "../styles/animation/index.js";
4
- import r from "./index.less_inline.js";
3
+ import n from "./index.less_inline.js";
4
+ import r from "../styles/animation/index.js";
5
5
  import { $one as i } from "utilane/browser";
6
- //#region src/components/list/index.ts
6
+ // src/components/list/index.ts
7
7
  var a = class extends e {
8
8
  static baseName = "list";
9
9
  finish = !1;
@@ -24,7 +24,7 @@ var a = class extends e {
24
24
  }
25
25
  }
26
26
  connectedCallback() {
27
- this.loadStyleText([r]), this.root.adoptedStyleSheets = [n], super.connectedCallback(), this.infinite && (this.observer = new IntersectionObserver((e) => {
27
+ this.loadStyleText([n]), this.root.adoptedStyleSheets = [r], super.connectedCallback(), this.infinite && (this.observer = new IntersectionObserver((e) => {
28
28
  e[0].isIntersecting && !this.finish && (this._page++, this.setAttribute("loading", ""), this.emit("load", { detail: { page: this._page } }));
29
29
  }), this.$more = i(".l-list-loadmore", this.root), !this.finish && this.$more && this.observer.observe(this.$more));
30
30
  }
@@ -48,5 +48,4 @@ var a = class extends e {
48
48
  }
49
49
  }
50
50
  };
51
- //#endregion
52
51
  export { a as default };
@@ -1,4 +1,3 @@
1
- //#region src/components/list/index.less?inline
1
+ // src/components/list/index.less?inline
2
2
  var e = ":host{-webkit-overflow-scrolling:touch;height:100%;display:block;position:relative;overflow:auto}.l-list-loadmore{color:#999;justify-content:center;align-items:center;padding:10px;display:flex}.l-list-icon{margin-right:10px;font-size:24px;transform:rotate(80deg)}";
3
- //#endregion
4
3
  export { e as default };
@@ -1,5 +1,5 @@
1
1
  import { $ as e, $$ as t, $one as n, addClass as r, hasClass as i, iterate as a } from "utilane/browser";
2
- //#region src/components/loading/index.ts
2
+ // src/components/loading/index.ts
3
3
  function o(e, a) {
4
4
  if (i(e, "l-loading")) return;
5
5
  let o;
@@ -112,5 +112,4 @@ var u = {
112
112
  },
113
113
  LoadingInstance: c
114
114
  };
115
- //#endregion
116
115
  export { c as LoadingInstance, u as default };
package/lib/mask/index.js CHANGED
@@ -2,7 +2,7 @@ import e from "../base.js";
2
2
  import { kebabToCamel as t, parseAttrValue as n } from "../utils/index.js";
3
3
  import r from "./index.less_inline.js";
4
4
  import { $$ as i, $one as a, addClass as o, hasClass as s, off as c, on as l, removeClass as u, shouldEventNext as d, transition as f } from "utilane/browser";
5
- //#region src/components/mask/index.ts
5
+ // src/components/mask/index.ts
6
6
  var p = class extends e {
7
7
  static baseName = "mask";
8
8
  #e = !1;
@@ -93,11 +93,7 @@ var p = class extends e {
93
93
  }
94
94
  #r = (e) => {
95
95
  let [t, n] = d(e, "data-action", e.currentTarget);
96
- if (!t) {
97
- this.maskClosable && (this.open = !1);
98
- return;
99
- }
100
- this.onAction(n) || this.emit("action", { detail: n });
96
+ t ? this.onAction(n) || this.emit("action", { detail: n }) : this.maskClosable && (this.open = !1);
101
97
  };
102
98
  afterOpened() {}
103
99
  afterClosed() {}
@@ -105,5 +101,4 @@ var p = class extends e {
105
101
  return !1;
106
102
  }
107
103
  };
108
- //#endregion
109
104
  export { p as default };