litos-ui 0.7.0 → 0.9.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 (81) hide show
  1. package/lib/{animation-QfX4RtqD.js → animation-DttknHkX.js} +2 -2
  2. package/lib/base.d.ts +1 -3
  3. package/lib/base.js +26 -58
  4. package/lib/button/index.js +58 -62
  5. package/lib/color_picker/index.js +18 -20
  6. package/lib/form/form_events.js +15 -17
  7. package/lib/form/form_inner.js +43 -47
  8. package/lib/form/form_item.d.ts +1 -1
  9. package/lib/form/form_item.js +49 -53
  10. package/lib/form/index.d.ts +1 -1
  11. package/lib/form/index.js +58 -61
  12. package/lib/icon/arrow_down.js +4 -7
  13. package/lib/icon/arrow_left.js +4 -7
  14. package/lib/icon/arrow_right.js +4 -7
  15. package/lib/icon/arrow_up.js +4 -7
  16. package/lib/icon/base.js +21 -24
  17. package/lib/icon/caret_bottom.js +4 -7
  18. package/lib/icon/caret_top.js +4 -7
  19. package/lib/icon/font_icon.js +13 -17
  20. package/lib/icon/info.js +4 -7
  21. package/lib/icon/loading.js +4 -7
  22. package/lib/icon/mask_close.js +4 -7
  23. package/lib/icon/moon.js +4 -7
  24. package/lib/icon/reduction.js +4 -7
  25. package/lib/icon/refresh_left.js +4 -7
  26. package/lib/icon/refresh_right.js +4 -7
  27. package/lib/icon/search.js +4 -7
  28. package/lib/icon/sort.js +4 -7
  29. package/lib/icon/success.js +4 -7
  30. package/lib/icon/sun.js +4 -7
  31. package/lib/icon/theme_default.js +4 -7
  32. package/lib/icon/warn.js +4 -7
  33. package/lib/{index-B_9rPBWp.js → index-391POYEJ.js} +1 -1
  34. package/lib/index.d.ts +2 -10
  35. package/lib/index.js +62 -70
  36. package/lib/input/index.d.ts +1 -1
  37. package/lib/input/index.js +66 -70
  38. package/lib/list/index.d.ts +1 -1
  39. package/lib/list/index.js +26 -30
  40. package/lib/litos-ui.css +1 -1
  41. package/lib/litos-ui.min.js +1 -1
  42. package/lib/message/index.js +35 -33
  43. package/lib/polygon/index.d.ts +1 -1
  44. package/lib/polygon/index.js +14 -17
  45. package/lib/popconfirm/index.js +11 -17
  46. package/lib/popover/index.js +115 -120
  47. package/lib/radio/index.d.ts +2 -2
  48. package/lib/radio/index.js +65 -68
  49. package/lib/select_ori/index.d.ts +1 -1
  50. package/lib/select_ori/index.js +25 -29
  51. package/lib/switch/index.js +39 -48
  52. package/lib/tabbar/index.js +115 -123
  53. package/lib/theme/index.js +71 -74
  54. package/lib/theme/theme_color.js +17 -27
  55. package/lib/utils/event.js +16 -18
  56. package/lib/utils/index.js +48 -51
  57. package/lib/utils/transition.js +24 -34
  58. package/package.json +4 -1
  59. package/lib/browser.d.ts +0 -17
  60. package/lib/button/regist.d.ts +0 -2
  61. package/lib/button/regist.js +0 -7
  62. package/lib/form/types.js +0 -1
  63. package/lib/index-116dRdDj.js +0 -4
  64. package/lib/index-BUyxD_nH.js +0 -4
  65. package/lib/index-BeOxuMd4.js +0 -4
  66. package/lib/index-Bl8lRTJd.js +0 -4
  67. package/lib/index-BxlGVrX3.js +0 -4
  68. package/lib/index-C2D4YsFw.js +0 -4
  69. package/lib/index-C98Kx857.js +0 -4
  70. package/lib/index-CCcVpk6U.js +0 -4
  71. package/lib/index-CMz7GCCH.js +0 -4
  72. package/lib/index-D-Ikkdx0.js +0 -4
  73. package/lib/index-DJ70Xyma.js +0 -4
  74. package/lib/index-DKvzJmsR.js +0 -4
  75. package/lib/index-oNjb_IVt.js +0 -4
  76. package/lib/popconfirm/regist.d.ts +0 -2
  77. package/lib/popconfirm/regist.js +0 -7
  78. package/lib/popover/regist.d.ts +0 -2
  79. package/lib/popover/regist.js +0 -7
  80. package/lib/tabbar/regist.d.ts +0 -2
  81. package/lib/tabbar/regist.js +0 -7
package/lib/icon/moon.js CHANGED
@@ -1,8 +1,6 @@
1
- var s = Object.defineProperty;
2
- var a = (t, e, r) => e in t ? s(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var o = (t, e, r) => a(t, typeof e != "symbol" ? e + "" : e, r);
4
- import c from "./base.js";
5
- class n extends c {
1
+ import e from "./base.js";
2
+ class r extends e {
3
+ static baseName = "moon-icon";
6
4
  constructor() {
7
5
  super(), this.viewBox = "0 0 24 24";
8
6
  }
@@ -10,7 +8,6 @@ class n extends c {
10
8
  return '<path d="M12.1 22h-.9c-5.5-.5-9.5-5.4-9-10.9.4-4.8 4.2-8.6 9-9 .4 0 .8.2 1 .5.2.3.2.8-.1 1.1-2 2.7-1.4 6.4 1.3 8.4 2.1 1.6 5 1.6 7.1 0 .3-.2.7-.3 1.1-.1.3.2.5.6.5 1-.2 2.7-1.5 5.1-3.6 6.8-1.9 1.4-4.1 2.2-6.4 2.2zM9.3 4.4c-2.9 1-5 3.6-5.2 6.8-.4 4.4 2.8 8.3 7.2 8.7 2.1.2 4.2-.4 5.8-1.8 1.1-.9 1.9-2.1 2.4-3.4-2.5.9-5.3.5-7.5-1.1-2.8-2.2-3.9-5.9-2.7-9.2z"></path>';
11
9
  }
12
10
  }
13
- o(n, "baseName", "moon-icon");
14
11
  export {
15
- n as default
12
+ r as default
16
13
  };
@@ -1,8 +1,6 @@
1
- var r = Object.defineProperty;
2
- var c = (e, a, t) => a in e ? r(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t;
3
- var l = (e, a, t) => c(e, typeof a != "symbol" ? a + "" : a, t);
4
- import L from "./base.js";
5
- class s extends L {
1
+ import a from "./base.js";
2
+ class l extends a {
3
+ static baseName = "reduction-icon";
6
4
  constructor() {
7
5
  super();
8
6
  }
@@ -10,7 +8,6 @@ class s extends L {
10
8
  return '<path d="M1039.92888889 967.11111111L1039.92888889 56.88888889c0-40.15900445-32.65877333-72.81777778-72.81777778-72.81777778l-910.22222222 0c-40.15900445 0-72.81777778 32.65877333-72.81777778 72.81777778l0 910.22222222c0 40.15900445 32.65877333 72.81777778 72.81777778 72.81777778L967.11111111 1039.92888889c40.15900445 0 72.81777778-32.65877333 72.81777778-72.81777778zM56.88888889 56.88888889L967.11111111 56.88888889l0 910.22222222-910.22222221 0.07281778L56.88888889 56.88888889z"></path><path d="M876.08888889 349.17944888a36.40888889 36.40888889 0 0 0-36.40888889-36.40888889l-120.47701333 1e-8L719.20298668 184.32a36.40888889 36.40888889 0 0 0-72.81777779 0l0 164.85944889a36.40888889 36.40888889 0 0 0 36.40888889 36.40888889L839.68 385.58833778a36.40888889 36.40888889 0 0 0 36.40888889-36.4088889z m-156.88590221 473.27914667L719.20298667 694.04444445 839.68 694.04444445a36.40888889 36.40888889 0 1 0 0-72.81777778l-156.88590222 0a36.40888889 36.40888889 0 0 0-36.40888889 36.40888888l0 164.82304a36.40888889 36.40888889 0 1 0 72.81777779 0zM366.36444445 349.17944888L366.36444445 184.32a36.40888889 36.40888889 0 1 0-72.81777778 0l0 128.45055999-120.51342222 1e-8a36.40888889 36.40888889 0 1 0 0 72.81777778L329.95555555 385.58833778a36.40888889 36.40888889 0 0 0 36.4088889-36.4088889z m0 473.27914667L366.36444445 657.63555555a36.40888889 36.40888889 0 0 0-36.4088889-36.40888888l-156.9223111-1e-8a36.40888889 36.40888889 0 1 0 0 72.81777779L293.54666667 694.04444445l0 128.4141511a36.40888889 36.40888889 0 1 0 72.81777778 0z"></path>';
11
9
  }
12
10
  }
13
- l(s, "baseName", "reduction-icon");
14
11
  export {
15
- s as default
12
+ l as default
16
13
  };
@@ -1,8 +1,6 @@
1
- var s = Object.defineProperty;
2
- var n = (a, e, r) => e in a ? s(a, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[e] = r;
3
- var t = (a, e, r) => n(a, typeof e != "symbol" ? e + "" : e, r);
4
- import o from "./base.js";
5
- class c extends o {
1
+ import e from "./base.js";
2
+ class t extends e {
3
+ static baseName = "refresh-left-icon";
6
4
  constructor() {
7
5
  super();
8
6
  }
@@ -10,7 +8,6 @@ class c extends o {
10
8
  return '<path d="M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z"></path>';
11
9
  }
12
10
  }
13
- t(c, "baseName", "refresh-left-icon");
14
11
  export {
15
- c as default
12
+ t as default
16
13
  };
@@ -1,13 +1,10 @@
1
- var s = Object.defineProperty;
2
- var h = (e, a, r) => a in e ? s(e, a, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[a] = r;
3
- var t = (e, a, r) => h(e, typeof a != "symbol" ? a + "" : a, r);
4
- import n from "./base.js";
5
- class d extends n {
1
+ import e from "./base.js";
2
+ class t extends e {
3
+ static baseName = "refresh-right-icon";
6
4
  renderChildren() {
7
5
  return '<path d="M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88z"></path>';
8
6
  }
9
7
  }
10
- t(d, "baseName", "refresh-right-icon");
11
8
  export {
12
- d as default
9
+ t as default
13
10
  };
@@ -1,13 +1,10 @@
1
- var s = Object.defineProperty;
2
- var n = (e, a, r) => a in e ? s(e, a, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[a] = r;
3
- var t = (e, a, r) => n(e, typeof a != "symbol" ? a + "" : a, r);
4
- import o from "./base.js";
5
- class c extends o {
1
+ import a from "./base.js";
2
+ class t extends a {
3
+ static baseName = "search-icon";
6
4
  renderChildren() {
7
5
  return '<path fill="currentColor" d="m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"></path>';
8
6
  }
9
7
  }
10
- t(c, "baseName", "search-icon");
11
8
  export {
12
- c as default
9
+ t as default
13
10
  };
package/lib/icon/sort.js CHANGED
@@ -1,13 +1,10 @@
1
- var s = Object.defineProperty;
2
- var n = (e, a, t) => a in e ? s(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t;
3
- var r = (e, a, t) => n(e, typeof a != "symbol" ? a + "" : a, t);
4
- import o from "./base.js";
5
- class d extends o {
1
+ import a from "./base.js";
2
+ class r extends a {
3
+ static baseName = "sort-icon";
6
4
  renderChildren() {
7
5
  return '<path d="M384 96a32 32 0 0 1 64 0v786.752a32 32 0 0 1-54.592 22.656L95.936 608a32 32 0 0 1 0-45.312h.128a32 32 0 0 1 45.184 0L384 805.632zm192 45.248a32 32 0 0 1 54.592-22.592L928.064 416a32 32 0 0 1 0 45.312h-.128a32 32 0 0 1-45.184 0L640 218.496V928a32 32 0 1 1-64 0V141.248z"></path>';
8
6
  }
9
7
  }
10
- r(d, "baseName", "sort-icon");
11
8
  export {
12
- d as default
9
+ r as default
13
10
  };
@@ -1,8 +1,6 @@
1
- var r = Object.defineProperty;
2
- var s = (c, e, a) => e in c ? r(c, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : c[e] = a;
3
- var l = (c, e, a) => s(c, typeof e != "symbol" ? e + "" : e, a);
4
- import t from "./base.js";
5
- class n extends t {
1
+ import e from "./base.js";
2
+ class a extends e {
3
+ static baseName = "success-icon";
6
4
  connectedCallback() {
7
5
  super.connectedCallback();
8
6
  }
@@ -10,7 +8,6 @@ class n extends t {
10
8
  return '<path fill="currentColor" d="M512 0C228.693333 0 0 228.693333 0 512s228.693333 512 512 512 512-228.693333 512-512S795.306667 0 512 0z m307.2 368.64L467.626667 730.453333c0 3.413333-3.413333 3.413333-3.413334 6.826667-13.653333 13.653333-37.546667 13.653333-51.2 0l-177.493333-177.493333c-13.653333-13.653333-13.653333-37.546667 0-51.2 13.653333-13.653333 37.546667-13.653333 51.2 0l150.186667 153.6 334.506666-341.333334c13.653333-13.653333 37.546667-13.653333 51.2 0 10.24 10.24 10.24 34.133333-3.413333 47.786667z m0 0"></path>';
11
9
  }
12
10
  }
13
- l(n, "baseName", "success-icon");
14
11
  export {
15
- n as default
12
+ a as default
16
13
  };
package/lib/icon/sun.js CHANGED
@@ -1,8 +1,6 @@
1
- var r = Object.defineProperty;
2
- var l = (s, c, e) => c in s ? r(s, c, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[c] = e;
3
- var t = (s, c, e) => l(s, typeof c != "symbol" ? c + "" : c, e);
4
- import z from "./base.js";
5
- class a extends z {
1
+ import c from "./base.js";
2
+ class t extends c {
3
+ static baseName = "sun-icon";
6
4
  constructor() {
7
5
  super(), this.viewBox = "0 0 24 24";
8
6
  }
@@ -10,7 +8,6 @@ class a extends z {
10
8
  return '<path d="M12 18c-3.3 0-6-2.7-6-6s2.7-6 6-6 6 2.7 6 6-2.7 6-6 6zm0-10c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zM12 4c-.6 0-1-.4-1-1V1c0-.6.4-1 1-1s1 .4 1 1v2c0 .6-.4 1-1 1zM12 24c-.6 0-1-.4-1-1v-2c0-.6.4-1 1-1s1 .4 1 1v2c0 .6-.4 1-1 1zM5.6 6.6c-.3 0-.5-.1-.7-.3L3.5 4.9c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l1.4 1.4c.4.4.4 1 0 1.4-.1.2-.4.3-.7.3zM19.8 20.8c-.3 0-.5-.1-.7-.3l-1.4-1.4c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l1.4 1.4c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3zM3 13H1c-.6 0-1-.4-1-1s.4-1 1-1h2c.6 0 1 .4 1 1s-.4 1-1 1zM23 13h-2c-.6 0-1-.4-1-1s.4-1 1-1h2c.6 0 1 .4 1 1s-.4 1-1 1zM4.2 20.8c-.3 0-.5-.1-.7-.3-.4-.4-.4-1 0-1.4l1.4-1.4c.4-.4 1-.4 1.4 0s.4 1 0 1.4l-1.4 1.4c-.2.2-.4.3-.7.3zM18.4 6.6c-.3 0-.5-.1-.7-.3-.4-.4-.4-1 0-1.4l1.4-1.4c.4-.4 1-.4 1.4 0s.4 1 0 1.4l-1.4 1.4c-.2.2-.5.3-.7.3z"></path>';
11
9
  }
12
10
  }
13
- t(a, "baseName", "sun-icon");
14
11
  export {
15
- a as default
12
+ t as default
16
13
  };
@@ -1,8 +1,6 @@
1
- var a = Object.defineProperty;
2
- var o = (t, e, r) => e in t ? a(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var s = (t, e, r) => o(t, typeof e != "symbol" ? e + "" : e, r);
4
- import c from "./base.js";
5
- class n extends c {
1
+ import e from "./base.js";
2
+ class r extends e {
3
+ static baseName = "theme-default-icon";
6
4
  constructor() {
7
5
  super(), this.viewBox = "0 0 24 24";
8
6
  }
@@ -10,7 +8,6 @@ class n extends c {
10
8
  return '<path d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2S2 6.477 2 12s4.477 10 10 10m0-1.5v-17a8.5 8.5 0 0 1 0 17"/>';
11
9
  }
12
10
  }
13
- s(n, "baseName", "theme-default-icon");
14
11
  export {
15
- n as default
12
+ r as default
16
13
  };
package/lib/icon/warn.js CHANGED
@@ -1,8 +1,6 @@
1
- var l = Object.defineProperty;
2
- var n = (a, e, c) => e in a ? l(a, e, { enumerable: !0, configurable: !0, writable: !0, value: c }) : a[e] = c;
3
- var r = (a, e, c) => n(a, typeof e != "symbol" ? e + "" : e, c);
4
- import t from "./base.js";
5
- class o extends t {
1
+ import e from "./base.js";
2
+ class r extends e {
3
+ static baseName = "warn-icon";
6
4
  connectedCallback() {
7
5
  super.connectedCallback();
8
6
  }
@@ -10,7 +8,6 @@ class o extends t {
10
8
  return '<path fill="currentColor" d="M512 1024C229.234 1024 0 794.766 0 512S229.234 0 512 0s512 229.234 512 512-229.234 512-512 512z m-64.853-734.52l19.484 244.906 1.309 16.156c1.251 15.93 15.018 28.644 30.72 28.644h25.571c15.56 0 29.298-12.601 30.663-28.132l1.422-16.668 21.334-244.907c3.214-36.978-24.434-66.844-61.725-66.844h-6.627c-37.462 0-65.138 29.923-62.18 66.844zM512 801.393a66.788 66.788 0 1 0 0-133.575 66.788 66.788 0 0 0 0 133.575z"></path>';
11
9
  }
12
10
  }
13
- r(o, "baseName", "warn-icon");
14
11
  export {
15
- o as default
12
+ r as default
16
13
  };
@@ -1,4 +1,4 @@
1
1
  const r = ":host{display:inline-block;width:var(--l-input-width, auto)}.l-input{outline:none;box-sizing:border-box;width:100%;max-width:100%;height:var(--l-form-edit-height, 32px);border:1px solid var(--l-border-color, #dedede);transition:border-color .3s;text-align:inherit;padding:0 5px;border-radius:3px;vertical-align:middle}.l-input.is-error{--l-border-color: var(--nt-error-color, #ed3f13)}.l-input:not(.is-error):focus{border-color:var(--l-primary-color, #722ed1)}.l-input:disabled{cursor:not-allowed;background:var(--l-disabled-color, #f5f7fa)}";
2
2
  export {
3
- r as default
3
+ r as i
4
4
  };
package/lib/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export { set as addClickOutside, remove as removeClickOutside, } from "./utils/c
3
3
  export { default as BaseComponent } from "./base";
4
4
  export { default as Message } from "./message";
5
5
  export { default as Popover } from "./popover";
6
+ export { default as Popconfirm } from "./popconfirm";
6
7
  export { default as BaseIcon } from "./icon/base";
7
8
  export { default as ArrowDownIcon } from "./icon/arrow_down";
8
9
  export { default as ArrowLeftIcon } from "./icon/arrow_left";
@@ -33,16 +34,12 @@ export { default as ColorPicker } from "./color_picker";
33
34
  export { default as Tabbar } from "./tabbar";
34
35
  export { default as Theme } from "./theme";
35
36
  export { default as ThemeColor } from "./theme/theme_color";
36
- export { default as registButton } from "./button/regist";
37
- export { default as registTabbar } from "./tabbar/regist";
38
- export { default as registPopover } from "./popover/regist";
39
- export { default as Popconfirm } from "./popconfirm";
40
- export { default as registPopconfirm } from "./popconfirm/regist";
41
37
 
42
38
  declare global {
43
39
  interface HTMLElementTagNameMap {
44
40
  "l-base-component": import("./base").default
45
41
  "l-popover": import("./popover").default
42
+ "l-popconfirm": import("./popconfirm").default
46
43
  "l-base-icon": import("./icon/base").default
47
44
  "l-arrow-down-icon": import("./icon/arrow_down").default
48
45
  "l-arrow-left-icon": import("./icon/arrow_left").default
@@ -73,10 +70,5 @@ declare global {
73
70
  "l-tabbar": import("./tabbar").default
74
71
  "l-theme": import("./theme").default
75
72
  "l-theme-color": import("./theme/theme_color").default
76
- "l-regist-button": import("./button/regist").default
77
- "l-regist-tabbar": import("./tabbar/regist").default
78
- "l-regist-popover": import("./popover/regist").default
79
- "l-popconfirm": import("./popconfirm").default
80
- "l-regist-popconfirm": import("./popconfirm/regist").default
81
73
  }
82
74
  }
package/lib/index.js CHANGED
@@ -1,78 +1,74 @@
1
1
  import { config as t, createTransition as r, getPopoverOffsetX as a, getPopoverOffsetY as f, impactDetect as s, initAttr as m, parseAttrValue as p, regist as u, setAttrs as d, tagAttr as l, tagAttrs as x, useId as n } from "./utils/index.js";
2
2
  import { set as i, remove as I } from "./utils/clickoutside.js";
3
3
  import { default as h } from "./base.js";
4
- import { default as P } from "./message/index.js";
5
- import { default as T } from "./popover/index.js";
6
- import { default as w } from "./icon/base.js";
4
+ import { default as C } from "./message/index.js";
5
+ import { default as P } from "./popover/index.js";
6
+ import { default as T } from "./popconfirm/index.js";
7
+ import { default as O } from "./icon/base.js";
7
8
  import { default as B } from "./icon/arrow_down.js";
8
- import { default as S } from "./icon/arrow_left.js";
9
- import { default as L } from "./icon/arrow_right.js";
10
- import { default as D } from "./icon/arrow_up.js";
11
- import { default as M } from "./icon/caret_top.js";
12
- import { default as U } from "./icon/caret_bottom.js";
13
- import { default as X } from "./icon/font_icon.js";
14
- import { default as j } from "./icon/loading.js";
15
- import { default as z } from "./icon/search.js";
16
- import { default as G } from "./icon/sun.js";
17
- import { default as J } from "./icon/moon.js";
18
- import { default as N } from "./icon/reduction.js";
19
- import { default as W } from "./icon/refresh_left.js";
20
- import { default as _ } from "./icon/refresh_right.js";
21
- import { default as oo } from "./icon/sort.js";
22
- import { default as to } from "./icon/theme_default.js";
23
- import { default as ao } from "./form/index.js";
24
- import { default as so } from "./form/form_item.js";
25
- import { default as po } from "./radio/index.js";
26
- import { default as lo } from "./button/index.js";
27
- import { default as no } from "./input/index.js";
28
- import { default as io } from "./select_ori/index.js";
29
- import { default as go } from "./switch/index.js";
30
- import { default as Ao } from "./list/index.js";
31
- import { default as Co } from "./polygon/index.js";
9
+ import { default as k } from "./icon/arrow_left.js";
10
+ import { default as F } from "./icon/arrow_right.js";
11
+ import { default as M } from "./icon/arrow_up.js";
12
+ import { default as U } from "./icon/caret_top.js";
13
+ import { default as X } from "./icon/caret_bottom.js";
14
+ import { default as j } from "./icon/font_icon.js";
15
+ import { default as z } from "./icon/loading.js";
16
+ import { default as G } from "./icon/search.js";
17
+ import { default as J } from "./icon/sun.js";
18
+ import { default as N } from "./icon/moon.js";
19
+ import { default as W } from "./icon/reduction.js";
20
+ import { default as _ } from "./icon/refresh_left.js";
21
+ import { default as oo } from "./icon/refresh_right.js";
22
+ import { default as to } from "./icon/sort.js";
23
+ import { default as ao } from "./icon/theme_default.js";
24
+ import { default as so } from "./form/index.js";
25
+ import { default as po } from "./form/form_item.js";
26
+ import { default as lo } from "./radio/index.js";
27
+ import { default as no } from "./button/index.js";
28
+ import { default as io } from "./input/index.js";
29
+ import { default as go } from "./select_ori/index.js";
30
+ import { default as Ao } from "./switch/index.js";
31
+ import { default as wo } from "./list/index.js";
32
+ import { default as Ro } from "./polygon/index.js";
32
33
  import { default as vo } from "./color_picker/index.js";
33
- import { default as Ro } from "./tabbar/index.js";
34
- import { default as Oo } from "./theme/index.js";
35
- import { default as bo } from "./theme/theme_color.js";
36
- import { default as ko } from "./button/regist.js";
37
- import { default as Fo } from "./tabbar/regist.js";
38
- import { default as yo } from "./popover/regist.js";
39
- import { default as Vo } from "./popconfirm/index.js";
40
- import { default as Yo } from "./popconfirm/regist.js";
34
+ import { default as So } from "./tabbar/index.js";
35
+ import { default as Lo } from "./theme/index.js";
36
+ import { default as Do } from "./theme/theme_color.js";
41
37
  export {
42
38
  B as ArrowDownIcon,
43
- S as ArrowLeftIcon,
44
- L as ArrowRightIcon,
45
- D as ArrowUpIcon,
39
+ k as ArrowLeftIcon,
40
+ F as ArrowRightIcon,
41
+ M as ArrowUpIcon,
46
42
  h as BaseComponent,
47
- w as BaseIcon,
48
- lo as Button,
49
- U as CaretBottomIcon,
50
- M as CaretTopIcon,
43
+ O as BaseIcon,
44
+ no as Button,
45
+ X as CaretBottomIcon,
46
+ U as CaretTopIcon,
51
47
  vo as ColorPicker,
52
- X as FontIcon,
53
- ao as Form,
54
- so as FormItem,
55
- no as Input,
56
- Ao as List,
57
- j as LoadingIcon,
58
- P as Message,
59
- J as MoonIcon,
60
- Co as Polygon,
61
- Vo as Popconfirm,
62
- T as Popover,
63
- po as Radio,
64
- N as ReductionIcon,
65
- W as RefreshLeftIcon,
66
- _ as RefreshRightIcon,
67
- z as SearchIcon,
68
- io as SelectOri,
69
- oo as SortIcon,
70
- G as SunIcon,
71
- go as Switch,
72
- Ro as Tabbar,
73
- Oo as Theme,
74
- bo as ThemeColor,
75
- to as ThemeDefaultIcon,
48
+ j as FontIcon,
49
+ so as Form,
50
+ po as FormItem,
51
+ io as Input,
52
+ wo as List,
53
+ z as LoadingIcon,
54
+ C as Message,
55
+ N as MoonIcon,
56
+ Ro as Polygon,
57
+ T as Popconfirm,
58
+ P as Popover,
59
+ lo as Radio,
60
+ W as ReductionIcon,
61
+ _ as RefreshLeftIcon,
62
+ oo as RefreshRightIcon,
63
+ G as SearchIcon,
64
+ go as SelectOri,
65
+ to as SortIcon,
66
+ J as SunIcon,
67
+ Ao as Switch,
68
+ So as Tabbar,
69
+ Lo as Theme,
70
+ Do as ThemeColor,
71
+ ao as ThemeDefaultIcon,
76
72
  i as addClickOutside,
77
73
  t as config,
78
74
  r as createTransition,
@@ -82,10 +78,6 @@ export {
82
78
  m as initAttr,
83
79
  p as parseAttrValue,
84
80
  u as regist,
85
- ko as registButton,
86
- Yo as registPopconfirm,
87
- yo as registPopover,
88
- Fo as registTabbar,
89
81
  I as removeClickOutside,
90
82
  d as setAttrs,
91
83
  l as tagAttr,
@@ -13,7 +13,7 @@ import FormInner from "../form/form_inner";
13
13
  * @method focus - 输入框获取焦点
14
14
  */
15
15
  export default class Input extends FormInner {
16
- static componentName: string;
16
+ static baseName: string;
17
17
  /** 原生 input 的 type */
18
18
  type: string;
19
19
  placeholder: string | undefined;
@@ -1,51 +1,29 @@
1
- var p = Object.defineProperty;
2
- var d = (l, a, t) => a in l ? p(l, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[a] = t;
3
- var r = (l, a, t) => d(l, typeof a != "symbol" ? a + "" : a, t);
4
- import { off as c, formatClass as f, $one as m, on as g, formatStyle as v, addClass as $, removeClass as b } from "ph-utils/dom";
5
- import { initAttr as _, tagAttr as u, parseAttrValue as w } from "../utils/index.js";
6
- import k from "../form/form_inner.js";
7
- import { remove as y, add as C } from "../form/form_events.js";
8
- class I extends k {
1
+ import { off as u, formatClass as o, $one as h, on as p, formatStyle as d, addClass as c, removeClass as f } from "ph-utils/dom";
2
+ import { initAttr as m, tagAttr as n, parseAttrValue as g } from "../utils/index.js";
3
+ import v from "../form/form_inner.js";
4
+ import { remove as $, add as b } from "../form/form_events.js";
5
+ import { i as _ } from "../index-391POYEJ.js";
6
+ class S extends v {
7
+ static baseName = "input";
8
+ /** 原生 input 的 type */
9
+ type = "text";
10
+ placeholder = void 0;
11
+ autosize = !1;
12
+ /** 限制输入类型, number, integer */
13
+ allowInput = void 0;
14
+ /** 自定义输入解析器 */
15
+ parser;
16
+ /** 宽度 */
17
+ width;
18
+ /** 宽度铺满 */
19
+ block = !1;
20
+ error = !1;
21
+ $input = void 0;
9
22
  constructor() {
10
- super();
11
- /** 原生 input 的 type */
12
- r(this, "type", "text");
13
- r(this, "placeholder");
14
- r(this, "autosize", !1);
15
- /** 限制输入类型, number, integer */
16
- r(this, "allowInput");
17
- /** 自定义输入解析器 */
18
- r(this, "parser");
19
- /** 宽度 */
20
- r(this, "width");
21
- /** 宽度铺满 */
22
- r(this, "block", !1);
23
- r(this, "error", !1);
24
- r(this, "$input");
25
- r(this, "_input", (t) => {
26
- const s = t.target;
27
- let e = s.value;
28
- if (this.allowInput != null) {
29
- let i = this.allowInput.indexOf("."), n = i === -1 ? i : parseInt(this.allowInput.substring(i + 1));
30
- e = this._numberInputParse(e, {
31
- integer: this.allowInput.includes("integer"),
32
- negative: this.allowInput.startsWith("-"),
33
- precition: n
34
- }), e = String(e), s.value = e;
35
- }
36
- this.parser != null && (e = this.parser(e), s.value = e), this.setValue(e);
37
- });
38
- r(this, "_validateChange", (t, s) => {
39
- const e = this.getName();
40
- if (e) {
41
- const i = t === !0 ? !1 : t[e] != null;
42
- (s == null || s === e && this.error != i) && (this.error = i, this._updateError()), Object.keys(t)[0] === e && this.focus();
43
- }
44
- });
45
- _(this);
23
+ super(), m(this);
46
24
  }
47
- set value(t) {
48
- this.setValue(t), this.$input != null && (this.$input.value = this.value);
25
+ set value(e) {
26
+ this.setValue(e), this.$input != null && (this.$input.value = this.value);
49
27
  }
50
28
  get value() {
51
29
  return this.getValue();
@@ -54,65 +32,83 @@ class I extends k {
54
32
  return ["disabled", "error"];
55
33
  }
56
34
  connectedCallback() {
57
- super.connectedCallback(), this.loadStyle(["input"]);
35
+ super.connectedCallback(), this.loadStyleText([_]);
58
36
  }
59
37
  disconnectedCallback() {
60
- super.disconnectedCallback(), this.formAttrs.id && y(this.formAttrs.id, "validateChange", this._validateChange), c(this.$input, "input", this._input), this.$input = void 0;
38
+ super.disconnectedCallback(), this.formAttrs.id && $(this.formAttrs.id, "validateChange", this._validateChange), u(this.$input, "input", this._input), this.$input = void 0;
61
39
  }
62
- attributeChange(t, s, e) {
63
- if (t === "error") {
64
- const i = w(e, !1, t);
40
+ attributeChange(e, s, t) {
41
+ if (e === "error") {
42
+ const i = g(t, !1, e);
65
43
  i !== this.error && (this.error = i, this._updateError());
66
44
  }
67
45
  }
68
46
  render() {
69
- let t = u("value", this.value);
70
- const s = u("placeholder", this.placeholder), e = u("disabled", this.isDisabled()), i = f({
47
+ let e = n("value", this.value);
48
+ const s = n("placeholder", this.placeholder), t = n("disabled", this.isDisabled()), i = o({
71
49
  "l-input": !0,
72
50
  "is-autosize": this.autosize,
73
51
  "is-error": this.error
74
- }), n = this.getName(), o = u("name", n), h = `${t}${o}${s}${e}`;
75
- this.shadow.innerHTML = `<input part="default" type="${this.type}" class="${i}"${h}></input>`, this.$input = m("input", this.root), g(this.$input, "input", this._input), this.style.cssText = v(this._getStyleObj()) + this.getAttr("style", ""), n && this.formAttrs.id && C(this.formAttrs.id, "validateChange", this._validateChange);
52
+ }), r = this.getName(), a = n("name", r), l = `${e}${a}${s}${t}`;
53
+ this.shadow.innerHTML = `<input part="default" type="${this.type}" class="${i}"${l}></input>`, this.$input = h("input", this.root), p(this.$input, "input", this._input), this.style.cssText = d(this._getStyleObj()) + this.getAttr("style", ""), r && this.formAttrs.id && b(this.formAttrs.id, "validateChange", this._validateChange);
76
54
  }
77
55
  /**
78
56
  * 设置自定义的输入解析器
79
57
  * @param cb
80
58
  */
81
- setParser(t) {
82
- this.parser = t;
59
+ setParser(e) {
60
+ this.parser = e;
83
61
  }
84
62
  focus() {
85
- var t;
86
- (t = this.$input) == null || t.focus();
63
+ this.$input?.focus();
87
64
  }
65
+ _input = (e) => {
66
+ const s = e.target;
67
+ let t = s.value;
68
+ if (this.allowInput != null) {
69
+ let i = this.allowInput.indexOf("."), r = i === -1 ? i : parseInt(this.allowInput.substring(i + 1));
70
+ t = this._numberInputParse(t, {
71
+ integer: this.allowInput.includes("integer"),
72
+ negative: this.allowInput.startsWith("-"),
73
+ precition: r
74
+ }), t = String(t), s.value = t;
75
+ }
76
+ this.parser != null && (t = this.parser(t), s.value = t), this.setValue(t);
77
+ };
88
78
  _changeDisabled() {
89
79
  this.$input != null && (this.$input.disabled = this.isDisabled());
90
80
  }
91
- _numberInputParse(t, s) {
92
- let e = t, i = s.negative ? "-?" : "";
81
+ _numberInputParse(e, s) {
82
+ let t = e, i = s.negative ? "-?" : "";
93
83
  if (s.integer) {
94
- const o = e.match(new RegExp(`^(${i}\\d*)`));
95
- return o != null ? o[1] : e.substring(0, e.length - 1);
84
+ const a = t.match(new RegExp(`^(${i}\\d*)`));
85
+ return a != null ? a[1] : t.substring(0, t.length - 1);
96
86
  }
97
- const n = e.match(
87
+ const r = t.match(
98
88
  new RegExp(
99
89
  `(${i}\\d+\\.\\d{0,${s.precition}})|(${i}\\d*)`
100
90
  )
101
91
  );
102
- return n != null ? e = n[1] || n[2] : e = "", n != null ? n[1] || n[2] : "";
92
+ return r != null ? t = r[1] || r[2] : t = "", r != null ? r[1] || r[2] : "";
103
93
  }
104
94
  _getStyleObj() {
105
- const t = {};
106
- return this._isBlock() && (t["--l-input-width"] = "100%"), this.width && (t["--l-input-width"] = this.width), t;
95
+ const e = {};
96
+ return this._isBlock() && (e["--l-input-width"] = "100%"), this.width && (e["--l-input-width"] = this.width), e;
107
97
  }
108
98
  _isBlock() {
109
99
  if (this.block === !0 || this.formItemAttrs.innerBlock === !0 || this.formAttrs.innerBlock === !0) return !0;
110
100
  }
111
101
  _updateError() {
112
- this.$input && (this.error ? $(this.$input, "is-error") : b(this.$input, "is-error"));
102
+ this.$input && (this.error ? c(this.$input, "is-error") : f(this.$input, "is-error"));
113
103
  }
104
+ _validateChange = (e, s) => {
105
+ const t = this.getName();
106
+ if (t) {
107
+ const i = e === !0 ? !1 : e[t] != null;
108
+ (s == null || s === t && this.error != i) && (this.error = i, this._updateError()), Object.keys(e)[0] === t && this.focus();
109
+ }
110
+ };
114
111
  }
115
- r(I, "componentName", "input");
116
112
  export {
117
- I as default
113
+ S as default
118
114
  };
@@ -13,7 +13,7 @@ export default class List extends BaseComponent {
13
13
  attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
14
14
  connectedCallback(): void;
15
15
  disconnectedCallback(): void;
16
- render(): void;
16
+ render(): string;
17
17
  _loadingText(): "已经到底啦!" | "加载中……";
18
18
  _finishChange(): void;
19
19
  }