litos-ui 0.6.3 → 0.8.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 (50) 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 +12 -40
  4. package/lib/button/index.js +49 -49
  5. package/lib/color_picker/index.js +6 -4
  6. package/lib/form/form_item.d.ts +1 -1
  7. package/lib/form/form_item.js +26 -25
  8. package/lib/form/index.d.ts +1 -1
  9. package/lib/form/index.js +42 -41
  10. package/lib/icon/base.js +19 -18
  11. package/lib/{index-B_9rPBWp.js → index-391POYEJ.js} +1 -1
  12. package/lib/index.d.ts +2 -0
  13. package/lib/index.js +64 -62
  14. package/lib/input/index.d.ts +1 -1
  15. package/lib/input/index.js +16 -15
  16. package/lib/list/index.d.ts +1 -1
  17. package/lib/list/index.js +13 -13
  18. package/lib/litos-ui.css +1 -1
  19. package/lib/litos-ui.min.js +1 -1
  20. package/lib/message/index.js +35 -33
  21. package/lib/polygon/index.d.ts +1 -1
  22. package/lib/polygon/index.js +17 -16
  23. package/lib/popconfirm/index.d.ts +7 -0
  24. package/lib/popconfirm/index.js +33 -0
  25. package/lib/popover/index.d.ts +5 -2
  26. package/lib/popover/index.js +106 -97
  27. package/lib/radio/index.d.ts +2 -2
  28. package/lib/radio/index.js +69 -68
  29. package/lib/select_ori/index.d.ts +1 -1
  30. package/lib/select_ori/index.js +8 -8
  31. package/lib/switch/index.js +42 -41
  32. package/lib/tabbar/index.js +94 -92
  33. package/lib/theme/index.js +39 -39
  34. package/lib/utils/index.js +54 -54
  35. package/lib/utils/transition.js +5 -6
  36. package/package.json +4 -1
  37. package/lib/browser.d.ts +0 -16
  38. package/lib/form/types.js +0 -1
  39. package/lib/index-116dRdDj.js +0 -4
  40. package/lib/index-BUyxD_nH.js +0 -4
  41. package/lib/index-BeOxuMd4.js +0 -4
  42. package/lib/index-Bl8lRTJd.js +0 -4
  43. package/lib/index-BxlGVrX3.js +0 -4
  44. package/lib/index-C98Kx857.js +0 -4
  45. package/lib/index-CCcVpk6U.js +0 -4
  46. package/lib/index-CMz7GCCH.js +0 -4
  47. package/lib/index-D-Ikkdx0.js +0 -4
  48. package/lib/index-DJ70Xyma.js +0 -4
  49. package/lib/index-DKvzJmsR.js +0 -4
  50. package/lib/index-oNjb_IVt.js +0 -4
@@ -1,93 +1,99 @@
1
- var M = Object.defineProperty;
2
- var S = (e) => {
3
- throw TypeError(e);
1
+ var I = Object.defineProperty;
2
+ var T = (r) => {
3
+ throw TypeError(r);
4
4
  };
5
- var N = (e, i, t) => i in e ? M(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t;
6
- var s = (e, i, t) => N(e, typeof i != "symbol" ? i + "" : i, t), T = (e, i, t) => i.has(e) || S("Cannot " + t);
7
- var o = (e, i, t) => (T(e, i, "read from private field"), t ? t.call(e) : i.get(e)), d = (e, i, t) => i.has(e) ? S("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, t);
8
- var g = (e, i, t) => (T(e, i, "access private method"), t);
5
+ var N = (r, e, o) => e in r ? I(r, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[e] = o;
6
+ var t = (r, e, o) => N(r, typeof e != "symbol" ? e + "" : e, o), A = (r, e, o) => e.has(r) || T("Cannot " + o);
7
+ var p = (r, e, o) => (A(r, e, "read from private field"), o ? o.call(r) : e.get(r)), h = (r, e, o) => e.has(r) ? T("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, o);
8
+ var d = (r, e, o) => (A(r, e, "access private method"), o);
9
9
  import j from "../base.js";
10
- import { initAttr as D, useId as X, getPopoverOffsetY as Y, getPopoverOffsetX as q, impactDetect as z } from "../utils/index.js";
11
- import { set as F, remove as G } from "../utils/clickoutside.js";
12
- import { $one as f, $$ as x, on as m, off as u } from "ph-utils/dom";
13
- var r, A, E, $, h, c, v, L, R;
14
- class J extends j {
10
+ import { initAttr as D, useId as X, getPopoverOffsetY as Y, getPopoverOffsetX as q, impactDetect as F } from "../utils/index.js";
11
+ import { set as G, remove as J } from "../utils/clickoutside.js";
12
+ import { $one as c, $$ as L, on as g, off as b } from "ph-utils/dom";
13
+ const K = ':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}';
14
+ var l, O, P, S, x, a, n, w, H, E;
15
+ class Q extends j {
15
16
  constructor() {
16
17
  super();
17
- d(this, r);
18
- s(this, "inline", !1);
19
- s(this, "placement", "top");
20
- s(this, "content");
21
- s(this, "showArrow", !0);
22
- s(this, "trigger", "hover");
23
- s(this, "disabled", !1);
24
- s(this, "isShow", !1);
18
+ h(this, l);
19
+ t(this, "placement", "top");
20
+ t(this, "content");
21
+ t(this, "showArrow", !0);
22
+ t(this, "trigger", "hover");
23
+ t(this, "disabled", !1);
24
+ t(this, "isShow", !1);
25
25
  /** 宽度, 'trigger' 表示 popover 的宽度会和它的触发元素一致 */
26
- s(this, "width");
26
+ t(this, "width");
27
27
  /** 隐藏时销毁 DOM 结构 */
28
- s(this, "destroyOnHide", !1);
28
+ t(this, "destroyOnHide", !1);
29
29
  /** 浮层偏移量 */
30
- s(this, "offset");
30
+ t(this, "offset");
31
31
  /** 浮层定位方式 */
32
- s(this, "position", "absolute");
33
- s(this, "theme", "default");
34
- s(this, "_t");
35
- d(this, $, (t) => {
36
- t.target.id !== this.id && this.hide();
32
+ t(this, "position", "absolute");
33
+ t(this, "theme", "default");
34
+ /**
35
+ * @property inline = false
36
+ */
37
+ t(this, "_t");
38
+ h(this, x, (o) => {
39
+ o.target.id !== this.id && this.hide();
37
40
  });
38
- d(this, h, (t) => {
39
- this.show(t.target);
41
+ h(this, a, (o) => {
42
+ this.show(o.target);
40
43
  });
41
- d(this, c, () => {
44
+ h(this, n, () => {
42
45
  this.hide();
43
46
  });
44
- d(this, v, (t) => {
45
- this.trigger === "click" ? this.toggle(t.target) : this.trigger === "focus" && this.show(t.target);
47
+ h(this, w, (o) => {
48
+ this.trigger === "click" ? this.toggle(o.target) : this.trigger === "focus" && this.show(o.target);
46
49
  });
47
- D(this), this.id || (this.id = `${X()}-popover`), this.style.display = this.inline ? "inline-block" : "block";
50
+ D(this);
48
51
  }
49
52
  connectedCallback() {
50
- this.loadStyle(["popover"]), super.connectedCallback(), this.renderContent(), g(this, r, A).call(this);
53
+ this.loadStyleText(K), d(this, l, O).call(this), super.connectedCallback(), this.renderContent(), d(this, l, P).call(this);
51
54
  }
52
55
  disconnectedCallback() {
53
- super.disconnectedCallback(), g(this, r, E).call(this);
56
+ super.disconnectedCallback(), d(this, l, S).call(this);
54
57
  }
55
58
  render() {
56
- const t = document.createElement("slot");
57
- return t.setAttribute("name", "trigger"), t;
59
+ const o = document.createElement("slot");
60
+ return o.setAttribute("name", "trigger"), o;
58
61
  }
59
62
  renderContent() {
60
63
  if (!this.isShow) return;
61
- let t = f(".l-popover--content", this.root);
62
- if (t) {
63
- t.style.removeProperty("display");
64
+ let o = c(".l-popover--content", this.root);
65
+ if (o) {
66
+ o.style.removeProperty("display");
64
67
  return;
65
68
  }
66
- if (t = x("div", {
69
+ if (o = L("div", {
67
70
  class: [
68
71
  "l-popover--content",
69
72
  `l-popover-${this.placement}`,
70
- this.theme === "tooltip" ? "l-popover-tooltip" : void 0
73
+ this.theme === "default" ? void 0 : `l-popover-${this.theme}`
71
74
  ]
72
- }), this.offset && (t.style.cssText = "--l-popover-offset: ${this.offset}px;"), t.part = "content", t.innerHTML = this.content ? this.content : "<slot></slot>", this.showArrow) {
73
- const n = x("div", {
75
+ }), this.offset && (o.style.cssText = "--l-popover-offset: ${this.offset}px;"), o.part = "content", o.innerHTML = this.contentHTML(), this.showArrow) {
76
+ const s = L("div", {
74
77
  class: "l-popover--arrow"
75
78
  });
76
- t.appendChild(n);
79
+ o.appendChild(s);
77
80
  }
78
- this.trigger === "hover" && (m(t, "mouseenter", o(this, h)), m(t, "mouseleave", o(this, c))), this.root.appendChild(t);
81
+ this.trigger === "hover" && (g(o, "mouseenter", p(this, a)), g(o, "mouseleave", p(this, n))), this.root.appendChild(o);
82
+ }
83
+ contentHTML() {
84
+ return this.content ? `<span>${this.content}</span>` : "<slot></slot>";
79
85
  }
80
86
  hideContent() {
81
- const t = f(".l-popover--content", this.root);
82
- t && (this.destroyOnHide ? (this.trigger === "hover" && (u(t, "mouseenter", o(this, h)), u(t, "mouseleave", o(this, c))), this.root.removeChild(t)) : t.style.display = "none");
87
+ const o = c(".l-popover--content", this.root);
88
+ o && (this.destroyOnHide ? (this.trigger === "hover" && (b(o, "mouseenter", p(this, a)), b(o, "mouseleave", p(this, n))), this.root.removeChild(o)) : o.style.display = "none");
83
89
  }
84
- show(t) {
90
+ show(o) {
85
91
  if (!this.disabled) {
86
92
  if (this.isShow) {
87
- g(this, r, L).call(this);
93
+ d(this, l, H).call(this);
88
94
  return;
89
95
  }
90
- this.isShow = !0, this.renderContent(), g(this, r, R).call(this, t);
96
+ this.isShow = !0, this.renderContent(), d(this, l, E).call(this, o);
91
97
  }
92
98
  }
93
99
  hide() {
@@ -95,59 +101,62 @@ class J extends j {
95
101
  this.isShow = !1, this.hideContent();
96
102
  }, 50);
97
103
  }
98
- toggle(t) {
99
- this.isShow ? this.hide() : this.show(t);
104
+ toggle(o) {
105
+ this.isShow ? this.hide() : this.show(o);
100
106
  }
101
107
  }
102
- r = new WeakSet(), A = function() {
103
- const t = f('[slot="trigger"]', this);
104
- t && (this.trigger === "hover" ? (m(t, "mouseenter", o(this, h)), m(t, "mouseleave", o(this, c))) : (this.trigger === "click" || this.trigger === "focus") && (m(t, "click", o(this, v)), F(t, o(this, $))));
105
- }, E = function() {
106
- const t = f('[slot="trigger"]', this);
107
- t && (this.trigger === "hover" ? (u(t, "mouseenter", o(this, h)), u(t, "mouseleave", o(this, c))) : (this.trigger === "click" || this.trigger === "focus") && (u(t, "click", o(this, v)), G(t)));
108
- }, $ = new WeakMap(), h = new WeakMap(), c = new WeakMap(), v = new WeakMap(), L = function() {
108
+ l = new WeakSet(), O = function() {
109
+ const o = this.getAttr("inline", !1);
110
+ this.style.display = o ? "inline-block" : "block", this.id || (this.id = `${X()}-popover`);
111
+ }, P = function() {
112
+ const o = c('[slot="trigger"]', this);
113
+ o && (this.trigger === "hover" ? (g(o, "mouseenter", p(this, a)), g(o, "mouseleave", p(this, n))) : (this.trigger === "click" || this.trigger === "focus") && (g(o, "click", p(this, w)), G(o, p(this, x))));
114
+ }, S = function() {
115
+ const o = c('[slot="trigger"]', this);
116
+ o && (this.trigger === "hover" ? (b(o, "mouseenter", p(this, a)), b(o, "mouseleave", p(this, n))) : (this.trigger === "click" || this.trigger === "focus") && (b(o, "click", p(this, w)), J(o)));
117
+ }, x = new WeakMap(), a = new WeakMap(), n = new WeakMap(), w = new WeakMap(), H = function() {
109
118
  this._t && (clearTimeout(this._t), this._t = void 0);
110
- }, R = function(t) {
111
- let n = "bottom", l = "";
112
- const y = this.placement.split("-");
113
- y != null && (n = y[0], l = y[1] || "");
114
- let a;
115
- t == null && (t = f('[slot="trigger"]', this));
116
- const p = f(".l-popover--content", this.root);
117
- if (p) {
118
- let w = p.getBoundingClientRect();
119
- const C = t.getBoundingClientRect();
120
- let k = document.documentElement;
121
- const _ = k.scrollLeft, H = k.scrollTop;
122
- this.width != null && (this.width === "trigger" ? a = C.width : a = this.width), a != null && (w.width = a);
123
- const B = Y(
124
- C,
125
- w,
126
- n,
127
- l,
119
+ }, E = function(o) {
120
+ let s = "bottom", i = "";
121
+ const k = this.placement.split("-");
122
+ k != null && (s = k[0], i = k[1] || "");
123
+ let v;
124
+ o == null && (o = c('[slot="trigger"]', this));
125
+ const f = c(".l-popover--content", this.root);
126
+ if (f) {
127
+ let m = f.getBoundingClientRect();
128
+ const u = o.getBoundingClientRect();
129
+ let C = document.documentElement;
130
+ const M = C.scrollLeft, R = C.scrollTop;
131
+ this.width != null && (this.width === "trigger" ? v = u.width : v = this.width), v != null && (m.width = v);
132
+ const _ = Y(
133
+ u,
134
+ m,
135
+ s,
136
+ i,
128
137
  this.offset
129
- ), I = q(
130
- C,
131
- w,
132
- n,
133
- l,
138
+ ), B = q(
139
+ u,
140
+ m,
141
+ s,
142
+ i,
134
143
  this.offset
135
- ), O = z(
136
- C,
137
- w,
138
- n,
139
- l,
140
- _,
141
- H,
142
- I,
144
+ ), y = F(
145
+ u,
146
+ m,
147
+ s,
148
+ i,
149
+ M,
150
+ R,
143
151
  B,
152
+ _,
144
153
  this.offset
145
154
  );
146
- n = O.mainAlign, l = O.crossAlign, a != null && p.style.setProperty("width", `${a}px`);
147
- const P = `l-popover-${n}${l === "" ? "" : "-" + l}`, b = p.className.split(" ");
148
- b[1] !== P && (b[1] = `${P}`, p.className = b.join(" "));
155
+ s = y.mainAlign, i = y.crossAlign, v != null && f.style.setProperty("width", `${v}px`);
156
+ const z = `l-popover-${s}${i === "" ? "" : "-" + i}`, $ = f.className.split(" ");
157
+ $[1] !== z && ($[1] = `${z}`, f.className = $.join(" "));
149
158
  }
150
- }, s(J, "baseName", "popover");
159
+ }, t(Q, "baseName", "popover");
151
160
  export {
152
- J as default
161
+ Q as default
153
162
  };
@@ -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;
@@ -1,52 +1,53 @@
1
- var A = Object.defineProperty;
2
- var I = (c, n, e) => n in c ? A(c, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[n] = e;
3
- var o = (c, n, e) => I(c, typeof n != "symbol" ? n + "" : n, e);
4
- import { initAttr as y, tagAttr as h, parseAttrValue as N } from "../utils/index.js";
5
- import V from "../form/form_inner.js";
6
- import { $one as r, hasClass as f, addClass as u, $ as p, iterate as m, getAttr as S, removeClass as b, formatClass as j, on as D, off as H } from "ph-utils/dom";
7
- import { random as v } from "ph-utils";
8
- class L extends V {
1
+ var C = Object.defineProperty;
2
+ var A = (n, l, e) => l in n ? C(n, l, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[l] = e;
3
+ var s = (n, l, e) => A(n, typeof l != "symbol" ? l + "" : l, e);
4
+ import { initAttr as E, tagAttr as c, parseAttrValue as I } from "../utils/index.js";
5
+ import w from "../form/form_inner.js";
6
+ import { $one as d, hasClass as m, addClass as b, $ as u, iterate as p, getAttr as N, removeClass as f, formatClass as V, on as j, off as z } from "ph-utils/dom";
7
+ import { random as _ } from "ph-utils";
8
+ const S = ':host{display:flex;align-items:center}.l-radio{--l-radio-size: 16px;--l-radio-label-color: #333;--l-radio-disabled-color: #e6e6e6;--l-radio-disabled-label-color: var(--l-disabled-color, #c0c4cc);--l-radio-checked-color: var(--l-primary-color, #722ed1);--l-radio-item-margin: 10px;display:inline-flex;align-items:center;position:relative;cursor:pointer}.l-radio__label{transition:color .3s ease-in-out;margin-left:5px}.l-radio__input{position:absolute;z-index:-1;width:0;height:0;opacity:0}.l-radio__inner{display:flex;justify-content:center;align-items:center;width:var(--l-radio-size);height:var(--l-radio-size);border:1px solid #dcddd9;border-radius:50%;box-sizing:border-box;transition:border-color .3s ease-in-out}.l-radio__inner:before{content:"";display:block;width:60%;height:60%;background-color:transparent;border-radius:50%;transition:background-color .3s ease-in-out}.l-radio.is-checked .l-radio__inner{border-color:var(--l-primary-color, #722ed1)}.l-radio.is-checked .l-radio__inner:before{background-color:var(--l-primary-color, #722ed1)}.l-radio.is-checked .l-radio__label{color:var(--l-primary-color, #722ed1)}.l-radio--disabled{cursor:not-allowed}.l-radio--disabledd .l-radio__inner{border-color:var(--l-radio-disabled-color)}.l-radio--disabled .l-radio__label{color:var(--l-radio-disabled-label-color)}.l-radio:not(:first-child){margin-left:var(--l-radio-item-margin)}.l-radio--button .l-radio__label{display:inline-flex;height:var(--l-form-edit-height, 32px);justify-content:center;align-items:center;padding:0 15px;border:1px solid #c0c4cc;border-left-width:0;margin-left:0}.l-radio--button:not(:first-of-type){margin-left:0}.l-radio--button:first-of-type .l-radio__label{border-left-width:1px;border-top-left-radius:3px;border-bottom-left-radius:3px}.l-radio--button:last-of-type .l-radio__label{border-top-right-radius:3px;border-bottom-right-radius:3px}.is-checked.l-radio--button .l-radio__label{background-color:var(--l-radio-checked-color);color:#fff;border-color:var(--l-radio-checked-color)}';
9
+ class D extends w {
9
10
  constructor() {
10
11
  super(!1);
11
- o(this, "type");
12
- o(this, "label");
13
- o(this, "checked", !1);
14
- o(this, "_changeEvent");
15
- o(this, "_radioChange", (e) => {
16
- const a = e.target;
17
- let t = a.parentElement;
18
- for (; t != null && !f(t, "l-radio"); )
12
+ s(this, "type");
13
+ s(this, "label");
14
+ s(this, "checked", !1);
15
+ s(this, "_ignoreInitAttrs", []);
16
+ s(this, "_radioChange", (e) => {
17
+ const o = e.target;
18
+ let t = o.parentElement;
19
+ for (; t != null && !m(t, "l-radio"); )
19
20
  t = t.parentElement;
20
- const s = r(".is-checked", this.root);
21
- s && b(s, "is-checked"), this.value = a.value, t && u(t, "is-checked"), this.dispatchEvent(this._changeEvent);
21
+ const i = d(".is-checked", this.root);
22
+ i && f(i, "is-checked"), this.value = o.value, t && b(t, "is-checked"), this.dispatchEvent(new CustomEvent("change"));
22
23
  });
23
- y(this), this._changeEvent = new CustomEvent("change");
24
+ console.log(), E(this);
24
25
  }
25
26
  setItems(e) {
26
27
  this._removeEvents(), this.root.innerHTML = this._renderItems(e), this._initEvents();
27
28
  }
28
29
  connectedCallback() {
29
- super.connectedCallback(), this.loadStyle(["radio"]), this._initEvents();
30
+ super.connectedCallback(), this.loadStyleText(S), this._initEvents();
30
31
  }
31
32
  disconnectedCallback() {
32
33
  super.disconnectedCallback(), this._removeEvents();
33
34
  }
34
- attributeChange(e, a, t) {
35
+ attributeChange(e, o, t) {
35
36
  if (e === "checked") {
36
- const s = N(t, !1, e);
37
- this.checked = s, this.value = s;
38
- const i = r(".l-radio", this.root);
39
- if (i && !f(i, "is-checked")) {
40
- u(i, "is-checked");
41
- const l = r("input", i);
42
- l && (l.checked = !0);
37
+ const i = I(t, !1, e);
38
+ this.checked = i, this.value = i;
39
+ const r = d(".l-radio", this.root);
40
+ if (r && !m(r, "is-checked")) {
41
+ b(r, "is-checked");
42
+ const a = d("input", r);
43
+ a && (a.checked = !0);
43
44
  }
44
45
  }
45
46
  }
46
47
  render() {
47
- this.getName() || (this.name = `la${v(3)}_${v(6)}`);
48
- const e = [], a = r('[slot="label"]', this), t = p("[radio-value]", this);
49
- a != null || this.label ? (this.value = this._isChecked(), a ? e.push(
48
+ this.getName() || (this.name = `la${_(3)}_${_(6)}`);
49
+ const e = [], o = d('[slot="label"]', this), t = u("[radio-value]", this);
50
+ return o != null || this.label ? (this.value = this._isChecked(), o ? e.push(
50
51
  this._renderItem("slot", void 0, this._isChecked(), "label")
51
52
  ) : e.push(
52
53
  this._renderItem(
@@ -55,71 +56,71 @@ class L extends V {
55
56
  this._isChecked(),
56
57
  "label"
57
58
  )
58
- )) : t.length > 0 && (m(t, (s) => {
59
- const i = s.cloneNode(!0), l = S(s, "radio-value");
59
+ )) : t.length > 0 && (p(t, (i) => {
60
+ const r = i.cloneNode(!0), a = N(i, "radio-value");
60
61
  e.push(
61
- this._renderItem(i.outerHTML, l, this.value === l)
62
+ this._renderItem(r.outerHTML, a, this.value === a)
62
63
  );
63
- }), this.pushValueChange()), this.root.innerHTML = e.join("");
64
+ }), this.pushValueChange()), e.join("");
64
65
  }
65
66
  setValue(e) {
66
67
  super.setValue(e);
67
- let a = "";
68
- typeof e != "boolean" && (a = `[l-value="${e}"]`);
69
- const t = r(".is-checked", this.root);
70
- t && b(t, "is-checked");
71
- const s = r(`label${a}`, this.root);
72
- if (s) {
73
- const i = r("input", s);
74
- typeof e == "boolean" ? (e ? u(s, "is-checked") : b(s, "is-checked"), i.checked = e) : (u(s, "is-checked"), i.checked = !0);
68
+ let o = "";
69
+ typeof e != "boolean" && (o = `[l-value="${e}"]`);
70
+ const t = d(".is-checked", this.root);
71
+ t && f(t, "is-checked");
72
+ const i = d(`label${o}`, this.root);
73
+ if (i) {
74
+ const r = d("input", i);
75
+ typeof e == "boolean" ? (e ? b(i, "is-checked") : f(i, "is-checked"), r.checked = e) : (b(i, "is-checked"), r.checked = !0);
75
76
  }
76
77
  }
77
78
  _renderItems(e) {
78
- const a = [];
79
- for (let t = 0, s = e.length; t < s; t++) {
80
- const i = e[t];
81
- a.push(
79
+ const o = [];
80
+ for (let t = 0, i = e.length; t < i; t++) {
81
+ const r = e[t];
82
+ o.push(
82
83
  this._renderItem(
83
- i.label,
84
- i.value,
85
- this.value === i.value,
86
- i.labelPart
84
+ r.label,
85
+ r.value,
86
+ this.value === r.value,
87
+ r.labelPart
87
88
  )
88
89
  );
89
90
  }
90
- return a.join("");
91
+ return o.join("");
91
92
  }
92
- _renderItem(e, a, t = !1, s = void 0) {
93
- const i = j({
93
+ _renderItem(e, o, t = !1, i = void 0) {
94
+ const r = V({
94
95
  "l-radio": !0,
95
96
  "l-radio--disabled": this.isDisabled(),
96
97
  "l-radio--button": this.type === "button",
97
98
  "is-checked": t
98
- }), l = h("disabled", this.isDisabled()), _ = h("checked", t), k = h("value", a), $ = `${h("name", this.getName())}${k}${l}${_}`, g = h("part", s), C = h("l-value", a), d = [
99
- `<label class="${i}"${C}>`,
100
- `<input type="radio" class="l-radio__input"${$} />`
99
+ }), a = c("disabled", this.isDisabled()), v = c("checked", t), g = c("value", o), k = `${c("name", this.getName())}${g}${a}${v}`, $ = c("part", i), x = c("l-value", o), h = [
100
+ `<label class="${r}"${x}>`,
101
+ `<input type="radio" class="l-radio__input"${k} />`
101
102
  ];
102
- this.type !== "button" && d.push('<span class="l-radio__inner"></span>');
103
- let E = e === "slot" ? '<slot name="label"></slot>' : e;
104
- return d.push(
105
- `<div class="l-radio__label"${g}>${E}</div>`
106
- ), d.push("</label>"), d.join("");
103
+ this.type !== "button" && h.push('<span class="l-radio__inner"></span>');
104
+ let y = e === "slot" ? '<slot name="label"></slot>' : e;
105
+ return h.push(
106
+ `<div class="l-radio__label"${$}>${y}</div>`
107
+ ), h.push("</label>"), h.join("");
107
108
  }
108
109
  _isChecked() {
109
110
  return this.checked;
110
111
  }
111
112
  _initEvents() {
112
- m(p("input", this.root), (e) => {
113
- D(e, "change", this._radioChange);
113
+ p(u("input", this.root), (e) => {
114
+ j(e, "change", this._radioChange);
114
115
  });
115
116
  }
116
117
  _removeEvents() {
117
- m(p("input", this.root), (e) => {
118
- H(e, "change", this._radioChange);
118
+ p(u("input", this.root), (e) => {
119
+ z(e, "change", this._radioChange);
119
120
  });
120
121
  }
121
122
  }
122
- o(L, "baseName", "radio");
123
+ s(D, "baseName", "radio");
123
124
  export {
124
- L as default
125
+ D as default
125
126
  };
@@ -10,7 +10,7 @@ export default class SelectOri extends FormInner {
10
10
  constructor();
11
11
  connectedCallback(): void;
12
12
  disconnectedCallback(): void;
13
- render(): void;
13
+ render(): string;
14
14
  protected _changeDisabled(): void;
15
15
  setOptions(options: Option[]): void;
16
16
  appendOptions(options: Option[]): void;
@@ -3,8 +3,9 @@ var o = (i, t, e) => t in i ? r(i, t, { enumerable: !0, configurable: !0, writab
3
3
  var n = (i, t, e) => o(i, typeof t != "symbol" ? t + "" : t, e);
4
4
  import u from "../form/form_inner.js";
5
5
  import { initAttr as d, tagAttrs as p } from "../utils/index.js";
6
- import { $one as $, on as m, off as g } from "ph-utils/dom";
7
- class v extends u {
6
+ import { $one as m, on as $, off as g } from "ph-utils/dom";
7
+ import { i as v } from "../index-391POYEJ.js";
8
+ class f extends u {
8
9
  constructor() {
9
10
  super();
10
11
  n(this, "$select");
@@ -16,18 +17,17 @@ class v extends u {
16
17
  d(this), this.changeEmit = new CustomEvent("change");
17
18
  }
18
19
  connectedCallback() {
19
- this.loadStyle(["input"]), super.connectedCallback(), this.$select = $("select", this.root), this.value && (this.$select.value = this.value), m(this.$select, "change", this._handleChange);
20
+ this.loadStyleText(v), super.connectedCallback(), this.$select = m("select", this.root), this.value && (this.$select.value = this.value), $(this.$select, "change", this._handleChange);
20
21
  }
21
22
  disconnectedCallback() {
22
23
  super.disconnectedCallback(), this.$select && g(this.$select, "change", this._handleChange), this.changeEmit = void 0, this.$select = void 0;
23
24
  }
24
25
  render() {
25
26
  let e = this.innerHTML.trim();
26
- const s = p([
27
+ return `<select class="l-input"${p([
27
28
  ["name", this.getName()],
28
29
  ["disabled", this.isDisabled()]
29
- ]);
30
- this.root.innerHTML = `<select class="l-input"${s}>${e}</select>`;
30
+ ])}>${e}</select>`;
31
31
  }
32
32
  _changeDisabled() {
33
33
  this.$select && (this.$select.disabled = this.isDisabled());
@@ -53,7 +53,7 @@ class v extends u {
53
53
  super.setValue(e), this.$select && (this.$select.value = this.value);
54
54
  }
55
55
  }
56
- n(v, "baseName", "select-ori");
56
+ n(f, "baseName", "select-ori");
57
57
  export {
58
- v as default
58
+ f as default
59
59
  };