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
@@ -1,33 +1,30 @@
1
- import { regist as a, useId as y } from "../utils/index.js";
2
- import { transition as m } from "ph-utils/dom";
3
- import g from "../icon/mask_close.js";
4
- import p from "../icon/success.js";
5
- import h from "../icon/warn.js";
6
- import $ from "../icon/info.js";
7
- a(g);
8
- a(p);
9
- a(h);
10
- a($);
11
- const i = [], d = [
1
+ import { regist as y, useId as p } from "../utils/index.js";
2
+ import { transition as d } from "ph-utils/dom";
3
+ import h from "../icon/mask_close.js";
4
+ import $ from "../icon/success.js";
5
+ import v from "../icon/warn.js";
6
+ import w from "../icon/info.js";
7
+ const c = [], u = [
12
8
  ["opacity", "0", "0.3s"],
13
9
  ["transform", "translate3d(-50%, -100%, 0)", "0.3s"]
14
10
  ];
15
- function u(e) {
16
- const t = i.findIndex((o) => o.id === e);
11
+ let m = !0;
12
+ function g(e) {
13
+ const t = c.findIndex((o) => o.id === e);
17
14
  if (t === -1) return;
18
- const s = i.splice(t, 1)[0];
15
+ const s = c.splice(t, 1)[0];
19
16
  if (s == null) return;
20
- m(s, d, "leave", () => {
17
+ d(s, u, "leave", () => {
21
18
  s.remove();
22
19
  });
23
- const r = 15 + s.offsetHeight, n = i.length;
20
+ const r = 15 + s.offsetHeight, n = c.length;
24
21
  if (n !== 0)
25
22
  for (let o = t; o < n; o++) {
26
- const c = i[o], f = parseInt(c.style.top, 10) - r;
27
- c.style.setProperty("top", `${f}px`);
23
+ const f = c[o], l = parseInt(f.style.top, 10) - r;
24
+ f.style.setProperty("top", `${l}px`);
28
25
  }
29
26
  }
30
- function v(e) {
27
+ function x(e) {
31
28
  const t = document.createElement("div");
32
29
  t.id = e.id;
33
30
  const s = e.type || "info";
@@ -41,25 +38,30 @@ function v(e) {
41
38
  "</div>"
42
39
  ].join(""), t;
43
40
  }
44
- const l = (e) => {
45
- const t = i.reduce(
46
- (c, f) => c + f.offsetHeight + 15,
41
+ const i = (e) => {
42
+ m && (y([h, $, v, w]), m = !1);
43
+ const t = c.reduce(
44
+ (f, l) => f + l.offsetHeight + 15,
47
45
  15
48
- ), s = y(), r = typeof e == "string" ? { message: e } : e;
46
+ ), s = p(), r = typeof e == "string" ? { message: e } : e;
49
47
  r.id = s, r.offset = t;
50
- const n = v(r);
51
- i.push(n), document.body.appendChild(n), m(n, d, "enter");
48
+ const n = x(r);
49
+ c.push(n), document.body.appendChild(n), d(n, u, "enter");
52
50
  let o = r.duration;
53
51
  return o == null && (o = 3e3), o !== 0 && setTimeout(() => {
54
- u(s);
52
+ g(s);
55
53
  }, o), s;
56
54
  };
57
- for (const e of ["info", "success", "error", "warn", "show"])
58
- l[e] = (t) => {
59
- const s = typeof t == "string" ? { message: t } : t;
60
- return e !== "show" ? s.type = e : s.type == null && (s.type = "info"), l(s);
61
- };
62
- l.close = u;
55
+ function a(e, t = "info") {
56
+ const s = typeof e == "string" ? { message: e } : e;
57
+ return s.type || (s.type = t), i(s);
58
+ }
59
+ i.info = (e) => a(e, "info");
60
+ i.success = (e) => a(e, "success");
61
+ i.error = (e) => a(e, "error");
62
+ i.warn = (e) => a(e, "warn");
63
+ i.show = (e) => a(e);
64
+ i.close = g;
63
65
  export {
64
- l as default
66
+ i as default
65
67
  };
@@ -5,5 +5,5 @@ export default class Polygon extends BaseComponent {
5
5
  background?: string;
6
6
  constructor();
7
7
  connectedCallback(): void;
8
- render(): void;
8
+ render(): string;
9
9
  }
@@ -1,30 +1,27 @@
1
- var r = Object.defineProperty;
2
- var l = (o, t, s) => t in o ? r(o, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : o[t] = s;
3
- var a = (o, t, s) => l(o, typeof t != "symbol" ? t + "" : t, s);
4
- import { formatClass as n, formatStyle as c } from "ph-utils/dom";
5
- import i from "../base.js";
6
- import { initAttr as p } from "../utils/index.js";
7
- class d extends i {
1
+ import { formatClass as t, formatStyle as e } from "ph-utils/dom";
2
+ import g from "../base.js";
3
+ import { initAttr as n } from "../utils/index.js";
4
+ const p = ".l-polygon{--l-polygen-size: 10px;--l-polygen-width: var(--l-polygen-size);--l-polygen-height: var(--l-polygen-size);--l-polygen-background: #666;display:inline-block;width:var(--l-polygen-width);height:var(--l-polygen-height);background:var(--l-polygen-background);transition:background .3s ease-in-out}.l-polygon-triangle-top{clip-path:polygon(calc(var(--l-polygen-width) / 2) 0,var(--l-polygen-width) var(--l-polygen-height),0 var(--l-polygen-height))}.l-polygon-triangle-top-left{clip-path:polygon(0 0,var(--l-polygen-width) 0,0 var(--l-polygen-height))}.l-polygon-triangle-top-right{clip-path:polygon(0 0,var(--l-polygen-width) 0,var(--l-polygen-width) var(--l-polygen-height))}.l-polygon-triangle-right{clip-path:polygon(0 0,var(--l-polygen-width) calc(var(--l-polygen-height) / 2),0 var(--l-polygen-height))}.l-polygon-triangle-left{clip-path:polygon(var(--l-polygen-width) 0,var(--l-polygen-width) var(--l-polygen-height),0 calc(var(--l-polygen-height) / 2))}.l-polygon-triangle-bottom{clip-path:polygon(0 0,var(--l-polygen-width) 0,calc(var(--l-polygen-width) / 2) var(--l-polygen-height))}.l-polygon-triangle-bottom-left{clip-path:polygon(0 0,0 var(--l-polygen-height),var(--l-polygen-width) var(--l-polygen-height))}.l-polygon-triangle-bottom-right{clip-path:polygon(var(--l-polygen-width) 0,var(--l-polygen-width) var(--l-polygen-height),0 var(--l-polygen-height))}";
5
+ class y extends g {
6
+ static baseName = "polygon";
7
+ shape = "triangle-top";
8
+ background;
8
9
  constructor() {
9
- super();
10
- a(this, "shape", "triangle-top");
11
- a(this, "background");
12
- p(this);
10
+ super(), n(this);
13
11
  }
14
12
  connectedCallback() {
15
- this.loadStyle(["polygon"]), super.connectedCallback();
13
+ this.loadStyleText(p), super.connectedCallback();
16
14
  }
17
15
  render() {
18
- const s = n([
16
+ const l = t([
19
17
  "l-polygon",
20
18
  this.shape ? `l-polygon-${this.shape}` : ""
21
- ]), e = c([
19
+ ]), o = e([
22
20
  this.background ? `--l-polygen-background: ${this.background}` : ""
23
21
  ]);
24
- this.root.innerHTML = `<div part="default" class="${s}" style="${e}"></div>`;
22
+ return `<div part="default" class="${l}" style="${o}"></div>`;
25
23
  }
26
24
  }
27
- a(d, "baseName", "polygon");
28
25
  export {
29
- d as default
26
+ y as default
30
27
  };
@@ -1,36 +1,30 @@
1
- var s = Object.defineProperty;
2
- var r = (n, t, o) => t in n ? s(n, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[t] = o;
3
- var c = (n, t, o) => r(n, typeof t != "symbol" ? t + "" : t, o);
4
- import { regist as e } from "../utils/index.js";
5
- import p from "../button/index.js";
6
- import l from "../popover/index.js";
7
- import a from "../icon/warn.js";
8
- import { on as h, shouldEventNext as m, $one as u } from "ph-utils/dom";
9
- e([p, a]);
10
- class d extends l {
1
+ import i from "../popover/index.js";
2
+ import { on as e, shouldEventNext as p, $one as c } from "ph-utils/dom";
3
+ const r = ".l-popover-popconfirm{min-width:200px}.l-popconfirm-container{display:flex;align-items:center}.l-popconfirm-icon-wrapper{margin-right:10px;display:inline-flex;color:var(--nt-warn-color, #f90)}.l-popconfirm-footer{display:flex;align-items:center;justify-content:flex-end;margin-top:7px;gap:5px}.l-popconfirm-footer l-button::part(default){height:24px;padding:0 6px;font-size:13px}";
4
+ class f extends i {
5
+ static baseName = "popconfirm";
11
6
  constructor() {
12
7
  super();
13
8
  }
14
9
  connectedCallback() {
15
- this.loadStyle(["popconfirm"]), this.trigger = "click", this.theme = "popconfirm", super.connectedCallback(), h(this.root, "click", (t) => {
16
- const [o, i] = m(t, "l-action", this);
10
+ this.loadStyleText(r), this.trigger = "click", this.theme = "popconfirm", super.connectedCallback(), e(this.root, "click", (t) => {
11
+ const [o, n] = p(t, "l-action", this);
17
12
  o && (this.dispatchEvent(
18
- new CustomEvent(i, {
13
+ new CustomEvent(n, {
19
14
  detail: {
20
- action: i
15
+ action: n
21
16
  }
22
17
  })
23
18
  ), this.hide());
24
19
  });
25
20
  }
26
21
  contentHTML() {
27
- const t = u('[slot="icon"]', this), o = [];
22
+ const t = c('[slot="icon"]', this), o = [];
28
23
  return o.push('<div class="l-popconfirm-container">'), o.push('<div class="l-popconfirm-icon-wrapper">'), o.push(
29
24
  t ? '<slot name="icon"></slot>' : "<l-warn-icon></l-warn-icon>"
30
25
  ), o.push(`</div>${super.contentHTML()}</div>`), o.push('<div class="l-popconfirm-footer">'), o.push('<l-button l-action="cancel">取消</l-button>'), o.push('<l-button type="primary" l-action="ok">确定</l-button>'), o.push("</div>"), o.join("");
31
26
  }
32
27
  }
33
- c(d, "baseName", "popconfirm");
34
28
  export {
35
- d as default
29
+ f as default
36
30
  };
@@ -1,98 +1,101 @@
1
- var N = Object.defineProperty;
2
- var L = (e) => {
3
- throw TypeError(e);
4
- };
5
- var j = (e, i, t) => i in e ? N(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t;
6
- var s = (e, i, t) => j(e, typeof i != "symbol" ? i + "" : i, t), O = (e, i, t) => i.has(e) || L("Cannot " + t);
7
- var o = (e, i, t) => (O(e, i, "read from private field"), t ? t.call(e) : i.get(e)), d = (e, i, t) => i.has(e) ? L("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, t);
8
- var f = (e, i, t) => (O(e, i, "access private method"), t);
9
- import D from "../base.js";
10
- import { initAttr as X, useId as Y, getPopoverOffsetY as q, getPopoverOffsetX as z, impactDetect as F } from "../utils/index.js";
11
- import { set as G, remove as J } from "../utils/clickoutside.js";
12
- import { $one as p, $$ as P, on as u, off as m } from "ph-utils/dom";
13
- var r, S, x, H, C, l, c, v, E, M;
14
- class K extends D {
1
+ import x from "../base.js";
2
+ import { initAttr as k, useId as $, getPopoverOffsetY as C, getPopoverOffsetX as y, impactDetect as z } from "../utils/index.js";
3
+ import { set as T, remove as A } from "../utils/clickoutside.js";
4
+ import { $one as p, $$ as g, on as s, off as i } from "ph-utils/dom";
5
+ const P = ':host{width:max-content;position:relative}.l-popover--content{--l-popover-border-color: #e4e4e4;--l-popover-color: #666666;--l-popover-box-shadow: 0 4px 8px rgba(0, 0, 0, .12);--l-popover-background: #ffffff;--l-popover-arrow-size: 8px;--l-popover-offset: 10px;position:absolute;width:max-content;box-shadow:var(--l-popover-box-shadow);background:var(--l-popover-background);border:1px solid var(--l-popover-border-color);border-radius:4px;padding:10px;z-index:30;color:var(--l-popover-color);box-sizing:border-box}.l-popover-tooltip{--l-popover-color: #fff;--l-popover-box-shadow: 4px 4px 8px rgba(0, 0, 0, .3);--l-popover-background: #383838;--l-popover-arrow-size: 6px;border-radius:5px;padding:8px;font-size:12px;line-height:1}.l-popover--arrow{position:absolute;width:var(--l-popover-arrow-size, 8px);height:var(--l-popover-arrow-size, 8px);z-index:-1}.l-popover--arrow:before{content:"";position:absolute;width:var(--l-popover-arrow-size, 8px);height:var(--l-popover-arrow-size, 8px);transform:rotate3d(0,0,1,45deg);background-color:var(--l-popover-background);border-width:1px;border-style:solid}.l-popover-top,.l-popover-top-start,.l-popover-top-end{bottom:calc(100% + var(--l-popover-offset, 10px))}.l-popover-bottom,.l-popover-bottom-start,.l-popover-bottom-end{top:calc(100% + var(--l-popover-offset, 10px))}.l-popover-top-start,.l-popover-bottom-start{left:0}.l-popover-top-end,.l-popover-bottom-end{right:0}.l-popover-bottom,.l-popover-top{left:50%;transform:translate3d(-50%,0,0)}.l-popover-left-start,.l-popover-left,.l-popover-left-end{right:calc(100% + var(--l-popover-offset, 10px))}.l-popover-left-start,.l-popover-right-start{top:0}.l-popover-left-end,.l-popover-right-end{bottom:0}.l-popover-left,.l-popover-right{top:50%;transform:translate3d(0,-50%,0)}.l-popover-right-start,.l-popover-right,.l-popover-right-end{left:calc(100% + var(--l-popover-offset, 10px))}.l-popover-top .l-popover--arrow,.l-popover-bottom .l-popover--arrow{left:50%;margin-left:-4px}.l-popover-top .l-popover--arrow:before,.l-popover-top-start .l-popover--arrow:before,.l-popover-top-end .l-popover--arrow:before{border-color:transparent var(--l-popover-border-color) var(--l-popover-border-color) transparent}.l-popover-bottom .l-popover--arrow:before,.l-popover-bottom-start .l-popover--arrow:before,.l-popover-bottom-end .l-popover--arrow:before{border-color:var(--l-popover-border-color) transparent transparent var(--l-popover-border-color)}.l-popover-top .l-popover--arrow,.l-popover-top-start .l-popover--arrow,.l-popover-top-end .l-popover--arrow{bottom:calc((var(--l-popover-arrow-size, 8px) / -2) + 1px)}.l-popover-top-start .l-popover--arrow,.l-popover-bottom-start .l-popover--arrow{left:10px}.l-popover-top-end .l-popover--arrow,.l-popover-bottom-end .l-popover--arrow{right:10px}.l-popover-bottom .l-popover--arrow,.l-popover-bottom-start .l-popover--arrow,.l-popover-bottom-end .l-popover--arrow{top:calc((var(--l-popover-arrow-size, 8px) / -2) - 1px)}.l-popover-left .l-popover--arrow,.l-popover-left-start .l-popover--arrow,.l-popover-left-end .l-popover--arrow{margin-top:-4px;right:-4px}.l-popover-left-start .l-popover--arrow:before,.l-popover-left .l-popover--arrow:before,.l-popover-left-end .l-popover--arrow:before{border-color:var(--l-popover-border-color) var(--l-popover-border-color) transparent transparent}.l-popover-right .l-popover--arrow,.l-popover-right-start .l-popover--arrow,.l-popover-right-end .l-popover--arrow{margin-top:-4px;left:-4px}.l-popover-right-start .l-popover--arrow:before,.l-popover-right .l-popover--arrow:before,.l-popover-right-end .l-popover--arrow:before{border-color:transparent transparent var(--l-popover-border-color) var(--l-popover-border-color)}.l-popover-left .l-popover--arrow,.l-popover-right .l-popover--arrow{top:50%}.l-popover-left-start .l-popover--arrow,.l-popover-right-start .l-popover--arrow{top:10px}.l-popover-left-end .l-popover--arrow,.l-popover-right-end .l-popover--arrow{bottom:10px}';
6
+ class M extends x {
7
+ static baseName = "popover";
8
+ placement = "top";
9
+ content;
10
+ showArrow = !0;
11
+ trigger = "hover";
12
+ disabled = !1;
13
+ isShow = !1;
14
+ /** 宽度, 'trigger' 表示 popover 的宽度会和它的触发元素一致 */
15
+ width;
16
+ /** 隐藏时销毁 DOM 结构 */
17
+ destroyOnHide = !1;
18
+ /** 浮层偏移量 */
19
+ offset;
20
+ /** 浮层定位方式 */
21
+ position = "absolute";
22
+ theme = "default";
23
+ /**
24
+ * @property inline = false
25
+ */
26
+ _t;
15
27
  constructor() {
16
- super();
17
- d(this, r);
18
- s(this, "placement", "top");
19
- s(this, "content");
20
- s(this, "showArrow", !0);
21
- s(this, "trigger", "hover");
22
- s(this, "disabled", !1);
23
- s(this, "isShow", !1);
24
- /** 宽度, 'trigger' 表示 popover 的宽度会和它的触发元素一致 */
25
- s(this, "width");
26
- /** 隐藏时销毁 DOM 结构 */
27
- s(this, "destroyOnHide", !1);
28
- /** 浮层偏移量 */
29
- s(this, "offset");
30
- /** 浮层定位方式 */
31
- s(this, "position", "absolute");
32
- s(this, "theme", "default");
33
- /**
34
- * @property inline = false
35
- */
36
- s(this, "_t");
37
- d(this, C, (t) => {
38
- t.target.id !== this.id && this.hide();
39
- });
40
- d(this, l, (t) => {
41
- this.show(t.target);
42
- });
43
- d(this, c, () => {
44
- this.hide();
45
- });
46
- d(this, v, (t) => {
47
- this.trigger === "click" ? this.toggle(t.target) : this.trigger === "focus" && this.show(t.target);
48
- });
49
- X(this);
28
+ super(), k(this);
50
29
  }
51
30
  connectedCallback() {
52
- this.loadStyle(["popover"]), f(this, r, S).call(this), super.connectedCallback(), this.renderContent(), f(this, r, x).call(this);
31
+ this.loadStyleText(P), this.#t(), super.connectedCallback(), this.renderContent(), this.#p();
53
32
  }
54
33
  disconnectedCallback() {
55
- super.disconnectedCallback(), f(this, r, H).call(this);
34
+ super.disconnectedCallback(), this.#l();
56
35
  }
57
36
  render() {
58
- const t = document.createElement("slot");
59
- return t.setAttribute("name", "trigger"), t;
37
+ const o = document.createElement("slot");
38
+ return o.setAttribute("name", "trigger"), o;
60
39
  }
61
40
  renderContent() {
62
41
  if (!this.isShow) return;
63
- let t = p(".l-popover--content", this.root);
64
- if (t) {
65
- t.style.removeProperty("display");
42
+ let o = p(".l-popover--content", this.root);
43
+ if (o) {
44
+ o.style.removeProperty("display");
66
45
  return;
67
46
  }
68
- if (t = P("div", {
47
+ if (o = g("div", {
69
48
  class: [
70
49
  "l-popover--content",
71
50
  `l-popover-${this.placement}`,
72
51
  this.theme === "default" ? void 0 : `l-popover-${this.theme}`
73
52
  ]
74
- }), this.offset && (t.style.cssText = "--l-popover-offset: ${this.offset}px;"), t.part = "content", t.innerHTML = this.contentHTML(), this.showArrow) {
75
- const n = P("div", {
53
+ }), this.offset && (o.style.cssText = "--l-popover-offset: ${this.offset}px;"), o.part = "content", o.innerHTML = this.contentHTML(), this.showArrow) {
54
+ const r = g("div", {
76
55
  class: "l-popover--arrow"
77
56
  });
78
- t.appendChild(n);
57
+ o.appendChild(r);
79
58
  }
80
- this.trigger === "hover" && (u(t, "mouseenter", o(this, l)), u(t, "mouseleave", o(this, c))), this.root.appendChild(t);
59
+ this.trigger === "hover" && (s(o, "mouseenter", this.#o), s(o, "mouseleave", this.#r)), this.root.appendChild(o);
81
60
  }
82
61
  contentHTML() {
83
62
  return this.content ? `<span>${this.content}</span>` : "<slot></slot>";
84
63
  }
64
+ #t() {
65
+ const o = this.getAttr("inline", !1);
66
+ this.style.display = o ? "inline-block" : "block", this.id || (this.id = `${$()}-popover`);
67
+ }
85
68
  hideContent() {
86
- const t = p(".l-popover--content", this.root);
87
- t && (this.destroyOnHide ? (this.trigger === "hover" && (m(t, "mouseenter", o(this, l)), m(t, "mouseleave", o(this, c))), this.root.removeChild(t)) : t.style.display = "none");
69
+ const o = p(".l-popover--content", this.root);
70
+ o && (this.destroyOnHide ? (this.trigger === "hover" && (i(o, "mouseenter", this.#o), i(o, "mouseleave", this.#r)), this.root.removeChild(o)) : o.style.display = "none");
71
+ }
72
+ #p() {
73
+ const o = p('[slot="trigger"]', this);
74
+ o && (this.trigger === "hover" ? (s(o, "mouseenter", this.#o), s(o, "mouseleave", this.#r)) : (this.trigger === "click" || this.trigger === "focus") && (s(o, "click", this.#e), T(o, this.#s)));
75
+ }
76
+ #l() {
77
+ const o = p('[slot="trigger"]', this);
78
+ o && (this.trigger === "hover" ? (i(o, "mouseenter", this.#o), i(o, "mouseleave", this.#r)) : (this.trigger === "click" || this.trigger === "focus") && (i(o, "click", this.#e), A(o)));
88
79
  }
89
- show(t) {
80
+ #s = (o) => {
81
+ o.target.id !== this.id && this.hide();
82
+ };
83
+ #o = (o) => {
84
+ this.show(o.target);
85
+ };
86
+ #r = () => {
87
+ this.hide();
88
+ };
89
+ #e = (o) => {
90
+ this.trigger === "click" ? this.toggle(o.target) : this.trigger === "focus" && this.show(o.target);
91
+ };
92
+ show(o) {
90
93
  if (!this.disabled) {
91
94
  if (this.isShow) {
92
- f(this, r, E).call(this);
95
+ this.#i();
93
96
  return;
94
97
  }
95
- this.isShow = !0, this.renderContent(), f(this, r, M).call(this, t);
98
+ this.isShow = !0, this.renderContent(), this.#a(o);
96
99
  }
97
100
  }
98
101
  hide() {
@@ -100,62 +103,54 @@ class K extends D {
100
103
  this.isShow = !1, this.hideContent();
101
104
  }, 50);
102
105
  }
103
- toggle(t) {
104
- this.isShow ? this.hide() : this.show(t);
106
+ toggle(o) {
107
+ this.isShow ? this.hide() : this.show(o);
105
108
  }
106
- }
107
- r = new WeakSet(), S = function() {
108
- const t = this.getAttr("inline", !1);
109
- this.style.display = t ? "inline-block" : "block", this.id || (this.id = `${Y()}-popover`);
110
- }, x = function() {
111
- const t = p('[slot="trigger"]', this);
112
- t && (this.trigger === "hover" ? (u(t, "mouseenter", o(this, l)), u(t, "mouseleave", o(this, c))) : (this.trigger === "click" || this.trigger === "focus") && (u(t, "click", o(this, v)), G(t, o(this, C))));
113
- }, H = function() {
114
- const t = p('[slot="trigger"]', this);
115
- t && (this.trigger === "hover" ? (m(t, "mouseenter", o(this, l)), m(t, "mouseleave", o(this, c))) : (this.trigger === "click" || this.trigger === "focus") && (m(t, "click", o(this, v)), J(t)));
116
- }, C = new WeakMap(), l = new WeakMap(), c = new WeakMap(), v = new WeakMap(), E = function() {
117
- this._t && (clearTimeout(this._t), this._t = void 0);
118
- }, M = function(t) {
119
- let n = "bottom", h = "";
120
- const y = this.placement.split("-");
121
- y != null && (n = y[0], h = y[1] || "");
122
- let a;
123
- t == null && (t = p('[slot="trigger"]', this));
124
- const g = p(".l-popover--content", this.root);
125
- if (g) {
126
- let w = g.getBoundingClientRect();
127
- const $ = t.getBoundingClientRect();
128
- let k = document.documentElement;
129
- const R = k.scrollLeft, _ = k.scrollTop;
130
- this.width != null && (this.width === "trigger" ? a = $.width : a = this.width), a != null && (w.width = a);
131
- const B = q(
132
- $,
133
- w,
134
- n,
135
- h,
136
- this.offset
137
- ), I = z(
138
- $,
139
- w,
140
- n,
141
- h,
142
- this.offset
143
- ), T = F(
144
- $,
145
- w,
146
- n,
147
- h,
148
- R,
149
- _,
150
- I,
151
- B,
152
- this.offset
153
- );
154
- n = T.mainAlign, h = T.crossAlign, a != null && g.style.setProperty("width", `${a}px`);
155
- const A = `l-popover-${n}${h === "" ? "" : "-" + h}`, b = g.className.split(" ");
156
- b[1] !== A && (b[1] = `${A}`, g.className = b.join(" "));
109
+ #i() {
110
+ this._t && (clearTimeout(this._t), this._t = void 0);
111
+ }
112
+ #a(o) {
113
+ let r = "bottom", e = "";
114
+ const v = this.placement.split("-");
115
+ v != null && (r = v[0], e = v[1] || "");
116
+ let t;
117
+ o == null && (o = p('[slot="trigger"]', this));
118
+ const l = p(".l-popover--content", this.root);
119
+ if (l) {
120
+ let a = l.getBoundingClientRect();
121
+ const n = o.getBoundingClientRect();
122
+ let d = document.documentElement;
123
+ const b = d.scrollLeft, w = d.scrollTop;
124
+ this.width != null && (this.width === "trigger" ? t = n.width : t = this.width), t != null && (a.width = t);
125
+ const m = C(
126
+ n,
127
+ a,
128
+ r,
129
+ e,
130
+ this.offset
131
+ ), u = y(
132
+ n,
133
+ a,
134
+ r,
135
+ e,
136
+ this.offset
137
+ ), c = z(
138
+ n,
139
+ a,
140
+ r,
141
+ e,
142
+ b,
143
+ w,
144
+ u,
145
+ m,
146
+ this.offset
147
+ );
148
+ r = c.mainAlign, e = c.crossAlign, t != null && l.style.setProperty("width", `${t}px`);
149
+ const f = `l-popover-${r}${e === "" ? "" : "-" + e}`, h = l.className.split(" ");
150
+ h[1] !== f && (h[1] = `${f}`, l.className = h.join(" "));
151
+ }
157
152
  }
158
- }, s(K, "baseName", "popover");
153
+ }
159
154
  export {
160
- K as default
155
+ M as default
161
156
  };
@@ -10,13 +10,13 @@ export default class Radio extends FormInner {
10
10
  type?: "button";
11
11
  label?: string;
12
12
  checked: boolean;
13
- private _changeEvent;
13
+ private _ignoreInitAttrs;
14
14
  setItems(items: RadioItem[]): void;
15
15
  constructor();
16
16
  connectedCallback(): void;
17
17
  disconnectedCallback(): void;
18
18
  protected attributeChange(name: string, oldValue: string, newValue: string): void;
19
- render(): void;
19
+ render(): string;
20
20
  setValue(value: any): void;
21
21
  private _renderItems;
22
22
  private _renderItem;