litos-ui 0.19.0 → 0.20.1

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 (155) hide show
  1. package/lib/{animation-DStAHzod.js → animation-Bo4jbSGK.js} +4 -3
  2. package/lib/{base-LvfO4mmL.js → base-Dyj1rzaK.js} +11 -12
  3. package/lib/base.d.ts +5 -4
  4. package/lib/base.js +19 -15
  5. package/lib/button/index.d.ts +2 -2
  6. package/lib/button/index.js +152 -2
  7. package/lib/button/style.d.ts +2 -0
  8. package/lib/button/style.js +2 -0
  9. package/lib/calendar/index.d.ts +2 -2
  10. package/lib/calendar/index.js +1 -1
  11. package/lib/{calendar-Clbg3qot.js → calendar-CvlUsN6w.js} +20 -23
  12. package/lib/card/index.d.ts +23 -0
  13. package/lib/card/index.js +2 -0
  14. package/lib/card-3DM-lJQV.js +63 -0
  15. package/lib/carousel/index.js +1 -1
  16. package/lib/carousel/item.js +1 -1
  17. package/lib/{carousel-Dgirxwzb.js → carousel-DvkZ1YXq.js} +23 -19
  18. package/lib/check/checkbox.js +1 -1
  19. package/lib/check/checkbox_group.js +1 -1
  20. package/lib/check/radio.js +1 -1
  21. package/lib/check/radio_group.js +1 -1
  22. package/lib/{check-BDOpD_0-.js → check-DFlwStH9.js} +10 -13
  23. package/lib/{check-CrlZ7zVL.js → check-doQ2ZpQj.js} +10 -10
  24. package/lib/{checkbox-D_bZGoUD.js → checkbox-DhGHJXwI.js} +1 -1
  25. package/lib/collapse/index.js +1 -1
  26. package/lib/collapse/item.js +1 -1
  27. package/lib/{collapse-BRxYoeJx.js → collapse-B6-Rn05A.js} +8 -10
  28. package/lib/color_picker/index.js +1 -1
  29. package/lib/{color_picker-AaFcIczZ.js → color_picker-0a-IGZY9.js} +3 -3
  30. package/lib/date_picker/index.d.ts +2 -2
  31. package/lib/date_picker/index.js +1 -1
  32. package/lib/{date_picker-HjkRma9j.js → date_picker-BDN2PAz5.js} +3 -7
  33. package/lib/date_picker_ori/index.js +1 -1
  34. package/lib/{date_picker_ori-1IOHZsan.js → date_picker_ori-BXFs1eET.js} +4 -6
  35. package/lib/description_panel/index.js +1 -1
  36. package/lib/{description_panel-DaqVcA6-.js → description_panel--AKXBzLL.js} +2 -6
  37. package/lib/dialog/dialog_box.d.ts +22 -0
  38. package/lib/dialog/dialog_box.js +98 -0
  39. package/lib/dialog/dialog_container.d.ts +7 -3
  40. package/lib/dialog/dialog_container.js +1 -1
  41. package/lib/dialog/index.d.ts +33 -11
  42. package/lib/dialog/index.js +48 -48
  43. package/lib/{dialog_container-CcTyfoaD.js → dialog_container-BNPQ9n0V.js} +34 -15
  44. package/lib/{esm-Cir9D6cn.js → esm-DAha108i.js} +67 -67
  45. package/lib/form/form_item.d.ts +3 -3
  46. package/lib/form/form_item.js +1 -1
  47. package/lib/form/index.d.ts +3 -3
  48. package/lib/form/index.js +1 -1
  49. package/lib/{form-BvZHaqAt.js → form-DJxvBiLy.js} +30 -32
  50. package/lib/{form_inner-52DR1IPu.js → form_inner-Cnwb6f_Q.js} +3 -5
  51. package/lib/{form_item-DtqChzc3.js → form_item-BqPMRABd.js} +7 -9
  52. package/lib/icon/arrow_down.js +1 -1
  53. package/lib/icon/arrow_left.js +1 -1
  54. package/lib/icon/arrow_right.js +1 -1
  55. package/lib/icon/arrow_up.js +1 -1
  56. package/lib/icon/base.d.ts +2 -2
  57. package/lib/icon/base.js +1 -1
  58. package/lib/icon/calendar.js +1 -1
  59. package/lib/icon/caret_bottom.js +1 -1
  60. package/lib/icon/caret_top.js +1 -1
  61. package/lib/icon/close.js +1 -1
  62. package/lib/icon/close_filled.js +1 -1
  63. package/lib/icon/d_arrow_left.js +1 -1
  64. package/lib/icon/d_arrow_right.js +1 -1
  65. package/lib/icon/font_icon.js +1 -1
  66. package/lib/icon/info.js +1 -1
  67. package/lib/icon/loading.js +1 -1
  68. package/lib/icon/moon.js +1 -1
  69. package/lib/icon/more.js +1 -1
  70. package/lib/icon/reduction.js +1 -1
  71. package/lib/icon/refresh.js +1 -1
  72. package/lib/icon/refresh_left.js +1 -1
  73. package/lib/icon/refresh_right.js +1 -1
  74. package/lib/icon/search.js +1 -1
  75. package/lib/icon/select.js +1 -1
  76. package/lib/icon/sort.js +1 -1
  77. package/lib/icon/success.js +1 -1
  78. package/lib/icon/sun.js +1 -1
  79. package/lib/icon/theme_default.js +1 -1
  80. package/lib/icon/warn.js +1 -1
  81. package/lib/icon/zoom_in.js +1 -1
  82. package/lib/icon/zoom_out.js +1 -1
  83. package/lib/image/image_preview.js +1 -1
  84. package/lib/image/index.js +1 -1
  85. package/lib/{image-BCUhVAFo.js → image-CVQai6NX.js} +19 -19
  86. package/lib/{image_preview-BeJzfEoF.js → image_preview-DfQAKSJH.js} +3 -5
  87. package/lib/index.d.ts +2 -0
  88. package/lib/index.js +71 -69
  89. package/lib/input/index.d.ts +2 -2
  90. package/lib/input/index.js +3 -5
  91. package/lib/{item-42bYhAkZ.js → item-CQ2Sknbz.js} +1 -1
  92. package/lib/{item-Dq6M7lxw.js → item-DI6mQXtB.js} +5 -7
  93. package/lib/{item-CX8C9X57.js → item-D_ZOPXuE.js} +1 -1
  94. package/lib/list/index.js +1 -1
  95. package/lib/{list-Dz1Ya118.js → list-MG8PRzos.js} +3 -3
  96. package/lib/loading/index.js +6 -4
  97. package/lib/mask/index.js +1 -1
  98. package/lib/{mask-BlDl9u8F.js → mask-Bx-yNIJv.js} +2 -6
  99. package/lib/mask-Ox6CoyFB.js +5 -0
  100. package/lib/md_input/index.js +1 -1
  101. package/lib/{md_input-DN3ceqsw.js → md_input-BX3bujz8.js} +2 -2
  102. package/lib/menu/index.d.ts +12 -4
  103. package/lib/menu/index.js +1 -1
  104. package/lib/menu-DKscK5mw.js +274 -0
  105. package/lib/message/index.js +1 -1
  106. package/lib/modal/index.d.ts +2 -2
  107. package/lib/modal/index.js +1 -1
  108. package/lib/modal/modal_box.js +13 -13
  109. package/lib/{modal-cjj3Nw1B.js → modal-Cwi3qlEf.js} +39 -33
  110. package/lib/page_header/index.js +1 -1
  111. package/lib/{page_header-BfuWJIdd.js → page_header-ujV3pncE.js} +2 -4
  112. package/lib/pagination/index.d.ts +25 -18
  113. package/lib/pagination/index.js +1 -1
  114. package/lib/{pagination-DpOSOFwl.js → pagination-aRbGd3Rf.js} +86 -83
  115. package/lib/polygon/index.js +1 -1
  116. package/lib/{polygon-BY1FAACc.js → polygon-DhhovlrG.js} +1 -1
  117. package/lib/qrcode/index.d.ts +2 -2
  118. package/lib/qrcode/index.js +1 -1
  119. package/lib/{qrcode-Bgr8gJzA.js → qrcode-Dip8uLSA.js} +1 -1
  120. package/lib/{radio-C7dkhgwc.js → radio-C9NPQWGI.js} +1 -1
  121. package/lib/select/index.d.ts +2 -2
  122. package/lib/select/index.js +1 -1
  123. package/lib/{select-Cis6kRjQ.js → select-BZMDj5VE.js} +33 -30
  124. package/lib/select_ori/index.d.ts +2 -2
  125. package/lib/select_ori/index.js +1 -1
  126. package/lib/{select_ori-DcJbNYYr.js → select_ori-C7sUZxen.js} +3 -3
  127. package/lib/space/index.js +1 -1
  128. package/lib/{space-BT_dVhhv.js → space-CKuTk0YB.js} +6 -5
  129. package/lib/style-gKR_qwzm.js +5 -0
  130. package/lib/styles/animation/index.d.ts +2 -0
  131. package/lib/styles/animation/index.js +2 -0
  132. package/lib/styles/mask/index.d.ts +2 -0
  133. package/lib/styles/mask/index.js +2 -0
  134. package/lib/switch/index.js +1 -1
  135. package/lib/{switch-UyhlgW7F.js → switch-wh2-ivty.js} +11 -9
  136. package/lib/tabbar/index.js +1 -1
  137. package/lib/tabbar/item.js +1 -1
  138. package/lib/{tabbar-DO0kB58Y.js → tabbar-CBXK-_AV.js} +1 -1
  139. package/lib/table/index.d.ts +7 -3
  140. package/lib/table/index.js +1 -1
  141. package/lib/{table-saZMryiV.js → table-BQxMD2Ae.js} +32 -33
  142. package/lib/tabs/index.js +4 -2
  143. package/lib/tag/index.js +1 -1
  144. package/lib/{tag-BtDcKdxo.js → tag-Di1z9PoZ.js} +3 -5
  145. package/lib/theme/index.js +1 -1
  146. package/lib/theme/theme_color.d.ts +1 -2
  147. package/lib/theme/theme_color.js +4 -5
  148. package/lib/{theme-Barcq234.js → theme-CLbBS-in.js} +9 -10
  149. package/lib/utils/context_provide.js +1 -1
  150. package/lib/utils/index.d.ts +1 -1
  151. package/lib/utils/popover.js +1 -1
  152. package/lib/utils/transition.js +1 -1
  153. package/package.json +11 -11
  154. package/lib/button-CC5NBWtI.js +0 -152
  155. package/lib/menu-BOmVa4xN.js +0 -224
@@ -1,202 +1,205 @@
1
1
  import e from "./base.js";
2
2
  import { kebabToCamel as t, parseAttrValue as n, tagAttr as r } from "./utils/index.js";
3
- import { $one as i, formatClass as a, off as o, on as s, shouldEventNext as c } from "ph-utils/dom";
3
+ import { $one as i, clsx as a, off as o, on as s, shouldEventNext as c } from "ph-utils/browser";
4
4
  //#region src/components/pagination/index.less?inline
5
5
  var l = ":host{white-space:nowrap;color:#333;font-size:14px;line-height:1}.l-pagination{align-items:center;justify-content:var(--l-pagination-justify-content,flex-start);display:flex}.l-pagination-item{box-sizing:border-box;width:30px;height:30px}.l-pagination-item+.l-pagination-item{margin-left:5px}.l-pagination--btn{--l-btn-padding:0}.l-pagination--link{color:#666;cursor:pointer;border:1px solid #0000;border-radius:3px;justify-content:center;align-items:center;text-decoration:none;transition:color .3s,border-color .3s;display:inline-flex}.l-pagination--link.active{color:var(--l-primary-color,#722ed1);border-color:var(--l-primary-color,#722ed1)}.darrow-icon{display:none}.more-icon{display:inline-block}.l-pagination--link:hover{color:var(--l-primary-color-light1,#9254de)}.l-pagination--link:hover .darrow-icon{display:inline-block}.l-pagination--link:hover .more-icon{display:none}.l-pagination--link:active{color:var(--l-primary-color-light1,#9254de)}.l-pagination-simple-layout{align-items:center;width:auto;display:inline-flex}.l-pagination-simple-input{--l-form-control-height:30px;box-sizing:border-box;text-align:center;width:60px}.l-pagination-simple-divide{margin:0 5px}", u = class extends e {
6
6
  static baseName = "pagination";
7
- total;
8
- pageCount;
9
- pageSize = 10;
10
- align;
11
- simple = !1;
12
- hideOnSinglePage = !1;
13
- #e = 1;
14
- #t = 0;
15
- get current() {
16
- return this.#e;
17
- }
18
- set current(e) {
19
- this.setCurrent(e);
20
- }
21
- setCurrent(e) {
22
- e !== this.#e && (this.#e = e, this.rerender());
23
- }
24
- connectedCallback() {
25
- this.loadStyleText(l), super.connectedCallback();
7
+ constructor() {
8
+ super(), this.version = 2, this._state = {
9
+ total: 0,
10
+ pageCount: 0,
11
+ pageSize: 10,
12
+ align: "start",
13
+ simple: !1,
14
+ hideOnSinglePage: !1,
15
+ currentPage: 1
16
+ };
26
17
  }
27
18
  static get observedAttributes() {
28
19
  return [
29
20
  "align",
30
- "current",
21
+ "current-page",
31
22
  "page-count",
32
23
  "total",
33
24
  "hide-on-single-page",
34
- "simple"
25
+ "simple",
26
+ "page-size"
35
27
  ];
36
28
  }
37
- attributeChangedCallback(e, r, i) {
38
- e = t(e);
39
- let a = n(i, this[e], e);
40
- if (a !== this[e]) switch (this[e] = a, e) {
29
+ attributeChanged(e, r, i) {
30
+ switch (e) {
41
31
  case "align":
42
- this.style.setProperty("--l-pagination-justify-content", a === "center" ? a : `flex-${a}`);
32
+ this._state.align = i || "start";
43
33
  break;
44
34
  case "total":
45
35
  case "page-count":
46
- this.#t = this.#r();
36
+ case "page-size":
37
+ case "current-page":
38
+ let r = n(i, this._state[e]);
39
+ this._state[t(e)] = r, (e === "total" || e === "page-count") && (this._state.pageCount = this.#t());
47
40
  break;
48
41
  case "simple":
49
- case "hide-on-single-page":
50
- this.rendered && this.rerender();
51
- break;
42
+ case "hide-on-single-page": this._state[t(e)] = n(i, !1, e);
52
43
  }
53
44
  }
45
+ updateDOM(e) {
46
+ if (e.has("align")) {
47
+ let e = this._state.align === "center" ? this._state.align : `flex-${this._state.align}`;
48
+ this.style.setProperty("--l-pagination-justify-content", e);
49
+ } else this.rerender(), e.clear();
50
+ }
54
51
  rerender() {
55
52
  let e = i(".l-pagination", this.root);
56
- e && (this.#o(), e.innerHTML = this.#i(), this.#a());
53
+ e && (this.#i(), e.innerHTML = this.#n(), this.#r());
57
54
  }
58
55
  render() {
59
- return `<div class="l-pagination">${this.#i()}</div>`;
56
+ return `<div class="l-pagination">${this.#n()}</div>`;
57
+ }
58
+ render_v2() {
59
+ return {
60
+ template: this.render(),
61
+ style: l
62
+ };
60
63
  }
61
64
  afterInit() {
62
- s(this.root, "click", this.#n), this.#a();
65
+ s(this.root, "click", this.#e), this.#r();
63
66
  }
64
67
  beforeDestroy() {
65
- o(this.root, "click", this.#n), this.#o();
68
+ o(this.root, "click", this.#e), this.#i();
66
69
  }
67
- #n = (e) => {
70
+ #e = (e) => {
68
71
  let [t, n] = c(e, "data-page", this.root);
69
72
  if (t) {
70
73
  let e = Number(n);
71
- e = Math.min(this.#t, Math.max(1, e)), e !== this.current && (this.setCurrent(e), this.emit("change", { detail: {
74
+ e = Math.min(this._state.pageCount, Math.max(1, e)), e !== this._state.currentPage && (this._state.currentPage = e, this.rerender(), this.emit("change", { detail: {
72
75
  current: e,
73
- pageSize: this.pageSize || 10,
74
- totalPage: this.#t
76
+ pageSize: this._state.pageSize || 10,
77
+ totalPage: this._state.pageCount
75
78
  } }));
76
79
  }
77
80
  };
78
- #r() {
79
- let e = this.pageCount;
80
- return e == null && this.total != null && (e = Math.ceil(this.total / (this.pageSize || 10))), (e == null || e <= 0) && (e = 1), e;
81
+ #t() {
82
+ let e = this._state.pageCount, t = this._state.total;
83
+ return e === 0 && t > 0 && (e = Math.ceil(t / (this._state.pageSize || 10))), e;
81
84
  }
82
- #i() {
83
- if (this.#t <= 1) return "";
85
+ #n() {
86
+ if (this._state.pageCount <= 1) return "";
84
87
  let e = [];
85
- if (e.push(this.#u("l-button", {
88
+ if (e.push(this.#c("l-button", {
86
89
  title: "上一页",
87
- disabled: this.current === 1,
88
- "data-page": this.current - 1,
90
+ disabled: this._state.currentPage === 1,
91
+ "data-page": this._state.currentPage - 1,
89
92
  innerHTML: "<l-arrow-left-icon></l-arrow-left-icon>",
90
93
  class: [
91
94
  "l-pagination-item",
92
95
  "l-pagination--btn",
93
96
  "prev-btn"
94
97
  ]
95
- })), this.simple) e.push(this.#u("div", {
98
+ })), this._state.simple) e.push(this.#c("div", {
96
99
  class: ["l-pagination-item", "l-pagination-simple-layout"],
97
100
  innerHTML: [
98
- this.#u("l-input", {
101
+ this.#c("l-input", {
99
102
  inputmode: "numeric",
100
- value: `${this.current}`,
103
+ value: `${this._state.currentPage}`,
101
104
  class: ["l-pagination-simple-input"],
102
105
  "allow-input": "integer"
103
106
  }),
104
107
  "<span class=\"l-pagination-simple-divide\">/</span>",
105
- `<span>${this.#t}</span>`
108
+ `<span>${this._state.pageCount}</span>`
106
109
  ]
107
110
  }));
108
111
  else {
109
- e.push(this.#u("a", {
112
+ e.push(this.#c("a", {
110
113
  title: "1",
111
114
  innerHTML: "1",
112
115
  class: [
113
116
  "l-pagination-item",
114
117
  "l-pagination--link",
115
- this.current === 1 ? "active" : ""
118
+ this._state.currentPage === 1 ? "active" : ""
116
119
  ],
117
120
  "data-page": "1"
118
- })), this.current > 4 && e.push(this.#u("a", {
121
+ })), this._state.currentPage > 4 && e.push(this.#c("a", {
119
122
  title: "上5页",
120
123
  innerHTML: ["<l-d-arrow-left-icon class='darrow-icon'></l-d-arrow-left-icon>", "<l-more-icon class='more-icon'></l-more-icon>"],
121
124
  class: ["l-pagination-item", "l-pagination--link"],
122
- "data-page": `${this.current - 5}`
125
+ "data-page": `${this._state.currentPage - 5}`
123
126
  }));
124
- let t = Math.max(this.current - 2, 1), n = Math.min(this.current + 2, this.#t), r = n - t;
125
- r < 4 && (n = Math.min(this.#t, n + r)), r = n - t, r < 4 && (t = Math.max(1, t - r));
127
+ let t = Math.max(this._state.currentPage - 2, 1), n = Math.min(this._state.currentPage + 2, this._state.pageCount), r = n - t;
128
+ r < 4 && (n = Math.min(this._state.pageCount, n + (4 - r))), r = n - t, r < 4 && (t = Math.max(1, t - (4 - r)));
126
129
  for (let r = t; r <= n; r++) if (!(r <= 1)) {
127
- if (r >= this.#t) break;
128
- e.push(this.#u("a", {
130
+ if (r >= this._state.pageCount) break;
131
+ e.push(this.#c("a", {
129
132
  title: `${r}`,
130
133
  innerHTML: `${r}`,
131
134
  class: [
132
135
  "l-pagination-item",
133
136
  "l-pagination--link",
134
- this.current === r ? "active" : ""
137
+ this._state.currentPage === r ? "active" : ""
135
138
  ],
136
139
  "data-page": `${r}`
137
140
  }));
138
141
  }
139
- this.current < this.#t - 3 && e.push(this.#u("a", {
142
+ this._state.currentPage < this._state.pageCount - 3 && e.push(this.#c("a", {
140
143
  title: "下5页",
141
144
  innerHTML: ["<l-d-arrow-right-icon class='darrow-icon'></l-d-arrow-right-icon>", "<l-more-icon class='more-icon'></l-more-icon>"],
142
145
  class: ["l-pagination-item", "l-pagination--link"],
143
- "data-page": `${this.current + 5}`
144
- })), this.#t > 1 && e.push(this.#u("a", {
145
- title: `${this.#t}`,
146
- innerHTML: `${this.#t}`,
146
+ "data-page": `${this._state.currentPage + 5}`
147
+ })), this._state.pageCount > 1 && e.push(this.#c("a", {
148
+ title: `${this._state.pageCount}`,
149
+ innerHTML: `${this._state.pageCount}`,
147
150
  class: [
148
151
  "l-pagination-item",
149
152
  "l-pagination--link",
150
- this.current === this.#t ? "active" : ""
153
+ this._state.currentPage === this._state.pageCount ? "active" : ""
151
154
  ],
152
- "data-page": `${this.#t}`
155
+ "data-page": `${this._state.pageCount}`
153
156
  }));
154
157
  }
155
- return e.push(this.#u("l-button", {
156
- title: `${this.current + 1}`,
158
+ return e.push(this.#c("l-button", {
159
+ title: `${this._state.currentPage + 1}`,
157
160
  innerHTML: "<l-arrow-right-icon></l-arrow-right-icon>",
158
161
  class: [
159
162
  "l-pagination-item",
160
163
  "l-pagination--btn",
161
164
  "next-btn"
162
165
  ],
163
- disabled: this.current === this.#t,
164
- "data-page": `${this.current + 1}`
166
+ disabled: this._state.currentPage === this._state.pageCount,
167
+ "data-page": `${this._state.currentPage + 1}`
165
168
  })), e.join("");
166
169
  }
167
- #a() {
170
+ #r() {
168
171
  let e = i(".l-pagination-simple-input", this.root);
169
- e && (e.setParser(this.#l), s(e, "keyup", this.#c), s(e, "blur", this.#s));
172
+ e && (e.setParser(this.#s), s(e, "keyup", this.#o), s(e, "blur", this.#a));
170
173
  }
171
- #o() {
174
+ #i() {
172
175
  let e = i(".l-pagination-simple-input", this.root);
173
- e && (e.setParser(void 0), o(e, "keyup", this.#c), o(e, "blur", this.#s));
176
+ e && (e.setParser(void 0), o(e, "keyup", this.#o), o(e, "blur", this.#a));
174
177
  }
175
- #s = (e) => {
178
+ #a = (e) => {
176
179
  let t = e.target, n = t.value;
177
180
  if (!n) {
178
- t.value = `${this.current}`;
181
+ t.value = `${this._state.currentPage}`;
179
182
  return;
180
183
  }
181
- this.setCurrent(Number(n));
184
+ this._state.currentPage = Number(n), this.rerender();
182
185
  };
183
- #c = (e) => {
186
+ #o = (e) => {
184
187
  if (e.key === "Enter") {
185
188
  let t = e.target.value;
186
189
  if (t) {
187
190
  let e = Number(t);
188
- this.setCurrent(e);
191
+ this._state.currentPage = e, this.rerender();
189
192
  }
190
193
  }
191
194
  };
192
- #l = (e) => {
195
+ #s = (e) => {
193
196
  if (e) {
194
197
  let t = Number(e);
195
- t = Math.max(1, Math.min(this.#t, t)), e = String(t);
198
+ t = Math.max(1, Math.min(this._state.pageCount, t)), e = String(t);
196
199
  }
197
200
  return e;
198
201
  };
199
- #u(e = "a", t) {
202
+ #c(e = "a", t) {
200
203
  let n = [], i = "";
201
204
  for (let e in t) if (e === "innerHTML") i = t[e], Array.isArray(i) && (i = i.join(""));
202
205
  else if (e === "class") {
@@ -1,2 +1,2 @@
1
- import { t as e } from "../polygon-BY1FAACc.js";
1
+ import { t as e } from "../polygon-DhhovlrG.js";
2
2
  export { e as default };
@@ -1,6 +1,6 @@
1
1
  import e from "./base.js";
2
2
  import { initAttr as t } from "./utils/index.js";
3
- import { formatClass as n, formatStyle as r } from "ph-utils/dom";
3
+ import { formatClass as n, formatStyle as r } from "ph-utils/browser";
4
4
  //#region src/components/polygon/index.less?inline
5
5
  var i = ".l-polygon{--l-polygen-size:10px;--l-polygen-width:var(--l-polygen-size);--l-polygen-height:var(--l-polygen-size);--l-polygen-background:#666;width:var(--l-polygen-width);height:var(--l-polygen-height);background:var(--l-polygen-background);transition:background .3s ease-in-out;display:inline-block}.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))}", a = class extends e {
6
6
  static baseName = "polygon";
@@ -23,8 +23,8 @@ export default class Qrcode extends BaseComponent<QrcodeState> {
23
23
  afterInit(): void;
24
24
  beforeDestroy(): void;
25
25
  render_v2(): {
26
- template?: string | HTMLElement | DocumentFragment;
27
- style?: string | string[];
26
+ template: string;
27
+ style: string;
28
28
  };
29
29
  render(): string;
30
30
  }
@@ -1,2 +1,2 @@
1
- import { t as e } from "../qrcode-Bgr8gJzA.js";
1
+ import { t as e } from "../qrcode-Dip8uLSA.js";
2
2
  export { e as default };
@@ -1,5 +1,5 @@
1
1
  import e from "./base.js";
2
- import { $one as t } from "ph-utils/dom";
2
+ import { $one as t } from "ph-utils/browser";
3
3
  import { QRCodeRender as n, renderToCanvas as r } from "qrcode-generator-es";
4
4
  //#region src/components/qrcode/index.less?inline
5
5
  var i = ":host,.renderer-el{display:inline-flex}", a = class extends e {
@@ -1,4 +1,4 @@
1
- import { n as e, t } from "./check-CrlZ7zVL.js";
1
+ import { n as e, t } from "./check-doQ2ZpQj.js";
2
2
  //#region src/components/check/radio.less?inline
3
3
  var n = ".l-check__inner{border-radius:50%}.l-check__inner:after{content:\"\";background-color:#0000;border-radius:50%;width:60%;height:60%;transition:background-color .3s ease-in-out;display:block}:host(.is-checked) .l-check__inner:after{background-color:var(--l-primary-color,#722ed1)}:host(.is-disabled) .l-check__inner{border-color:var(--l-disabled-color,#e6e6e6)}:host(.is-disabled) .l-check__inner:after{background-color:var(--l-disabled-color,#e6e6e6)}", r = class extends e {
4
4
  static baseName = "radio";
@@ -75,8 +75,8 @@ export default class Select extends FormInner<SelectState> {
75
75
  afterInit(): void;
76
76
  beforeDestroy(): void;
77
77
  render_v2(): {
78
- template?: string | HTMLElement | DocumentFragment;
79
- style?: string | string[];
78
+ template: DocumentFragment;
79
+ style: string[];
80
80
  };
81
81
  render(): DocumentFragment;
82
82
  protected disabledChange(): void;
@@ -1,3 +1,3 @@
1
- import { t as e } from "../select-Cis6kRjQ.js";
1
+ import { t as e } from "../select-BZMDj5VE.js";
2
2
  import "../utils/popover.js";
3
3
  export { e as default };
@@ -1,8 +1,7 @@
1
1
  import { kebabToCamel as e, parseAttrValue as t, unitNumberStr as n } from "./utils/index.js";
2
- import { t as r } from "./form_inner-52DR1IPu.js";
2
+ import { t as r } from "./form_inner-Cnwb6f_Q.js";
3
3
  import { Popover as i } from "./utils/popover.js";
4
- import { $ as a, $$ as o, $one as s, iterate as c, off as l, on as u, shouldEventNext as d } from "ph-utils/dom";
5
- import { debounce as f } from "ph-utils/web";
4
+ import { $ as a, $$ as o, $one as s, debounce as c, iterate as l, off as u, on as d, shouldEventNext as f } from "ph-utils/browser";
6
5
  //#region src/components/select/index.less?inline
7
6
  var p = ":host{--l-select-width:100%;min-height:var(--l-form-control-height,32px);width:var(--l-select-width);border:1px solid var(--l-border-color,#d9d9d9);cursor:pointer;box-sizing:border-box;border-radius:4px;justify-content:space-between;align-items:center;gap:5px;padding:4px 10px;font-size:14px;line-height:1;transition:border-color .3s;display:inline-flex;position:relative}:host(:hover){border-color:silver}:host(.l-select--disabled){background-color:var(--l-disabled-color,#f5f7fa);cursor:not-allowed}:host(.l-select--expand),:host(.l-select--active){border-color:var(--l-primary-color,#722ed1)}:host(.l-select--expand) .l-select-arrow{transform:rotate(180deg)}:host(.l-select--loading) .l-select-arrow{opacity:.2}:host(.l-select--clearable) .l-select-arrow{opacity:0}.l-select-main{box-sizing:border-box;flex-flow:wrap;flex-grow:1;gap:5px;display:flex;overflow:hidden}.l-selected-item{flex-shrink:0}.l-select-placeholder{flex-grow:1}.l-select-placeholder,.l-select-arrow{color:#a8abb2}.l-select-filter{background-color:#0000;border:none;outline:none;flex-grow:1;flex-shrink:0;width:0;min-width:15px;max-width:100%}.l-select-filter::placeholder{color:#a8abb2}.l-select-arrow{flex-shrink:0;transition:transform .3s,opacity .3s;transform:rotate(0)}.l-select-tag-close{box-sizing:border-box;cursor:pointer;border-radius:50%;justify-content:center;align-items:center;width:14px;height:14px;margin-left:3px;font-size:12px;transition:color .3s,background-color .3s;display:inline-flex}.l-select-tag-close:hover{color:#fff;background-color:#999}.l-select-clear,.l-select-loading{position:absolute;top:50%;right:10px;transform:translateY(-50%)}.l-select-loading{color:var(--l-primary-color,#722ed1);z-index:2;animation:1.5s linear infinite l-select-loading}.l-select-clear{color:#afafaf;z-index:1}@keyframes l-select-loading{0%{transform:translateY(-50%)rotate(0)}to{transform:translateY(-50%)rotate(360deg)}}", m = class extends r {
8
7
  static baseName = "select";
@@ -89,9 +88,7 @@ var p = ":host{--l-select-width:100%;min-height:var(--l-form-control-height,32px
89
88
  case "remote":
90
89
  this._state[e(r)] = t(a, !1, r);
91
90
  break;
92
- case "loading":
93
- this.setLoading(t(a, !1, r));
94
- break;
91
+ case "loading": this.setLoading(t(a, !1, r));
95
92
  }
96
93
  }
97
94
  updateDOM(e) {
@@ -182,7 +179,7 @@ var p = ":host{--l-select-width:100%;min-height:var(--l-form-control-height,32px
182
179
  }
183
180
  _onRootTap = (e) => {
184
181
  e.stopPropagation();
185
- let [t, n, r] = d(e, "data-action", e.currentTarget);
182
+ let [t, n, r] = f(e, "data-action", e.currentTarget);
186
183
  if (t) {
187
184
  if (n === "clear") this.value = this._state.multiple ? [] : "", this.selectedLabels = [], this._toggleClearable(!0), this._reRenderLabels(), this._updatePopoverContent();
188
185
  else {
@@ -217,7 +214,7 @@ var p = ":host{--l-select-width:100%;min-height:var(--l-form-control-height,32px
217
214
  return this._backOptions && (t = this._backOptions.filter((t) => e ? this.filter ? this.filter(e, t) : t[this._state.labelField].includes(e) : !0)), t;
218
215
  }
219
216
  afterInit() {
220
- u(this, "mouseenter", this._onMouseEnter), u(this, "mouseleave", this._onMouseLeave), u(this.root, "click", this._onRootTap), u(this, "click", this._onTap), this._searchEl = s(".l-select-filter", this.root), this._searchEl && (this.inputHandler = f(this._handleFilte, 300), u(this._searchEl, "input", this._onSearchInput), u(this._searchEl, "blur", this._onSearchBlur)), this.disabledChange(), this._popover ||= new i({
217
+ d(this, "mouseenter", this._onMouseEnter), d(this, "mouseleave", this._onMouseLeave), d(this.root, "click", this._onRootTap), d(this, "click", this._onTap), this._searchEl = s(".l-select-filter", this.root), this._searchEl && (this.inputHandler = c(this._handleFilte, 300), d(this._searchEl, "input", this._onSearchInput), d(this._searchEl, "blur", this._onSearchBlur)), this.disabledChange(), this._popover ||= new i({
221
218
  arrow: !1,
222
219
  offset: 2,
223
220
  placement: "bottom",
@@ -241,28 +238,33 @@ var p = ":host{--l-select-width:100%;min-height:var(--l-form-control-height,32px
241
238
  },
242
239
  onPopoverAction: (e, t) => {
243
240
  if (e && this._options) {
244
- let n = Number(e), r = this._options[n], i = r[this._state.valueField], o = r[this._state.labelField], s = this.value, l = this.selectedLabels;
245
- if (this._state.multiple === !0) if (!s) s = [i], l = [o];
246
- else if (Array.isArray(s)) {
247
- let e = s.indexOf(i);
248
- e === -1 ? (s.push(i), l.push(o)) : (s.splice(e, 1), l.splice(e, 1));
249
- } else s != i && (s = [s, i], l = [l, o]);
250
- else s = i, l = [o];
241
+ let n = Number(e), r = this._options[n], i = r[this._state.valueField], o = r[this._state.labelField], s = this.value, c = this.selectedLabels;
242
+ if (this._state.multiple === !0) {
243
+ if (!s) s = [i], c = [o];
244
+ else if (Array.isArray(s)) {
245
+ let e = s.indexOf(i);
246
+ e === -1 ? (s.push(i), c.push(o)) : (s.splice(e, 1), c.splice(e, 1));
247
+ } else s != i && (s = [s, i], c = [c, o]);
248
+ } else s = i, c = [o];
251
249
  this._value != s && this.emit("change", { detail: {
252
250
  value: s,
253
- labels: l
254
- } }), this._value = s, this.selectedLabels = l;
251
+ labels: c
252
+ } }), this._value = s, this.selectedLabels = c;
255
253
  let u = this._isOptionSelect(i);
256
- this._state.multiple || c(a(".l-select-option--selected", t.parentElement), (e) => {
257
- this._updateOptionSelect(e, !1);
258
- }), this._updateOptionSelect(t, u), this._reRenderLabels(), !this._state.multiple && this._popover && this._popover.hide(), this._searchEl && this._state.multiple && this._searchEl.focus();
254
+ if (!this._state.multiple) {
255
+ let e = a(".l-select-option--selected", t.parentElement);
256
+ l(e, (e) => {
257
+ this._updateOptionSelect(e, !1);
258
+ });
259
+ }
260
+ this._updateOptionSelect(t, u), this._reRenderLabels(), !this._state.multiple && this._popover && this._popover.hide(), this._searchEl && this._state.multiple && this._searchEl.focus();
259
261
  }
260
262
  }
261
263
  });
262
264
  }
263
265
  beforeDestroy() {
264
- if (l(this, "mouseenter", this._onMouseEnter), l(this, "mouseleave", this._onMouseLeave), l(this.root, "click", this._onRootTap), l(this, "click", this._onTap), this._options = void 0, this._popover &&= (this._popover.destroy(), void 0), this._searchEl) {
265
- if (l(this._searchEl, "blur", this._onSearchBlur), l(this._searchEl, "input", this._onSearchInput), this.inputHandler) {
266
+ if (u(this, "mouseenter", this._onMouseEnter), u(this, "mouseleave", this._onMouseLeave), u(this.root, "click", this._onRootTap), u(this, "click", this._onTap), this._options = void 0, this._popover &&= (this._popover.destroy(), void 0), this._searchEl) {
267
+ if (u(this._searchEl, "blur", this._onSearchBlur), u(this._searchEl, "input", this._onSearchInput), this.inputHandler) {
266
268
  try {
267
269
  this.inputHandler.cancel();
268
270
  } catch {}
@@ -318,7 +320,7 @@ var p = ":host{--l-select-width:100%;min-height:var(--l-form-control-height,32px
318
320
  let e = s(".l-select-main", this.root);
319
321
  if (e) {
320
322
  let t = a(".l-selected-item", e);
321
- t.length > 0 && c(t, (e) => {
323
+ t.length > 0 && l(t, (e) => {
322
324
  e && e != this._searchEl && e.remove();
323
325
  });
324
326
  let n = this._renderSelectedLabels();
@@ -334,13 +336,14 @@ var p = ":host{--l-select-width:100%;min-height:var(--l-form-control-height,32px
334
336
  }
335
337
  _renderSelectedLabels() {
336
338
  let e = document.createDocumentFragment(), t = this.selectedLabels.length;
337
- if (t > 0) if (!this._state.multiple) this._state.filterable || e.appendChild(o("span", {
338
- class: "l-selected-item",
339
- textContent: this.selectedLabels[0]
340
- }));
341
- else if (this._state.collapseTags) e.appendChild(this._renderTag(this.selectedLabels[0])), t > 1 && e.appendChild(this._renderTag(`+${t - 1}`, -1, !1));
342
- else for (let n = 0; n < t; n++) e.appendChild(this._renderTag(this.selectedLabels[n], n));
343
- else this._state.filterable || e.appendChild(o("span", {
339
+ if (t > 0) {
340
+ if (!this._state.multiple) this._state.filterable || e.appendChild(o("span", {
341
+ class: "l-selected-item",
342
+ textContent: this.selectedLabels[0]
343
+ }));
344
+ else if (this._state.collapseTags) e.appendChild(this._renderTag(this.selectedLabels[0])), t > 1 && e.appendChild(this._renderTag(`+${t - 1}`, -1, !1));
345
+ else for (let n = 0; n < t; n++) e.appendChild(this._renderTag(this.selectedLabels[n], n));
346
+ } else this._state.filterable || e.appendChild(o("span", {
344
347
  class: "l-selected-item l-select-placeholder",
345
348
  textContent: this._state.placeholder
346
349
  }));
@@ -10,8 +10,8 @@ export default class SelectOri extends FormInner {
10
10
  connectedCallback(): void;
11
11
  disconnectedCallback(): void;
12
12
  render_v2(): {
13
- template?: string | HTMLElement | DocumentFragment;
14
- style?: string | string[];
13
+ template: string;
14
+ style: string[];
15
15
  };
16
16
  render(): string;
17
17
  protected disabledChange(): void;
@@ -1,2 +1,2 @@
1
- import { t as e } from "../select_ori-DcJbNYYr.js";
1
+ import { t as e } from "../select_ori-C7sUZxen.js";
2
2
  export { e as default };
@@ -1,7 +1,7 @@
1
1
  import { tagAttrs as e } from "./utils/index.js";
2
- import { t } from "./form_inner-52DR1IPu.js";
2
+ import { t } from "./form_inner-Cnwb6f_Q.js";
3
3
  import { t as n } from "./input_inner-x4GfLGjj.js";
4
- import { $one as r, off as i, on as a } from "ph-utils/dom";
4
+ import { $one as r, off as i, on as a } from "ph-utils/browser";
5
5
  //#region src/components/select_ori/index.less?inline
6
6
  var o = ":host{height:var(--l-form-control-height,32px);display:inline-flex}.l-input__inner{border:1px solid var(--l-border-color,#dedede);border-radius:var(--l-border-radius,3px);transition:border-color .3s}.l-input__inner:hover{border-color:var(--l-primary-color-light1,#c6c6c6)}.l-input__inner:focus{border-color:var(--l-primary-color,#1890ff);box-shadow:0 0 0 3px var(--l-primary-color-light5)}", s = class extends t {
7
7
  static baseName = "select-ori";
@@ -50,7 +50,7 @@ var o = ":host{height:var(--l-form-control-height,32px);display:inline-flex}.l-i
50
50
  }
51
51
  _handleChange = (e) => {
52
52
  let t = e.target.value;
53
- super.setValue(t), this.dispatchEvent(new CustomEvent("change", { detail: t }));
53
+ super.setValue(t), this.emit("change", { detail: t });
54
54
  };
55
55
  };
56
56
  //#endregion
@@ -1,2 +1,2 @@
1
- import { t as e } from "../space-BT_dVhhv.js";
1
+ import { t as e } from "../space-CKuTk0YB.js";
2
2
  export { e as default };
@@ -21,11 +21,12 @@ var i = ":host{box-sizing:border-box;display:var(--l-space-display,flex);align-i
21
21
  e = t(e);
22
22
  let o = n(a, this[e], e);
23
23
  if (e === "inline") n(a, !1, "inline") ? this.style.setProperty("--l-space-display", "inline-flex") : this.style.removeProperty("--l-space-display");
24
- else if (e === "gap") if (o) {
25
- let e = o.split(",").map((e) => r(e) ? `${e}px` : e);
26
- this.style.setProperty("--l-space-gap", e.join(" "));
27
- } else this.style.removeProperty("--l-space-gap");
28
- else {
24
+ else if (e === "gap") {
25
+ if (o) {
26
+ let e = o.split(",").map((e) => r(e) ? `${e}px` : e);
27
+ this.style.setProperty("--l-space-gap", e.join(" "));
28
+ } else this.style.removeProperty("--l-space-gap");
29
+ } else {
29
30
  let t = `--l-space-${e}`;
30
31
  o ? this.style.setProperty(t, o) : this.style.removeProperty(t);
31
32
  }
@@ -0,0 +1,5 @@
1
+ //#region src/components/button/index.less?inline
2
+ var e = ":host{--l-btn-padding:0 15px;--l-btn-text-color:#fff;--l-btn-hover-text-color:var(--l-btn-text-color);--l-btn-active-text-color:var(--l-btn-text-color);--l-btn-border-color:var(--l-primary-color,#722ed1);--l-btn-background:var(--l-btn-border-color);--l-btn-hover-border-color:var(--l-primary-color-light1,#9254de);--l-btn-hover-background:var(--l-btn-hover-border-color);--l-btn-active-border-color:var(--l-primary-color-dark1,#531dab);--l-btn-active-background:var(--l-btn-active-border-color);--l-btn-disabled-color:#c9c9c9;--l-btn-disabled-background:#fbfbfb;--l-btn-disabled-border-color:#e6e6e6;--l-btn-height:var(--l-form-control-height,32px);width:auto;height:var(--l-btn-height);text-indent:0;box-sizing:border-box;border-radius:var(--l-border-radius,3px);display:inline-flex}:host([block]){width:100%}:host(.l-btn-small){--l-btn-height:24px;--l-btn-padding:0 7px}:host(.l-btn-large){--l-border-radius:6px;--l-btn-height:40px;--l-btn-padding:0 15px;font-size:16px}.l-btn{cursor:pointer;box-sizing:border-box;vertical-align:middle;width:100%;padding:var(--l-btn-padding);border-radius:inherit;height:100%;color:var(--l-btn-text-color);background:var(--l-btn-background);border:1px solid var(--l-btn-border-color);justify-content:center;align-items:center;gap:var(--l-btn-gap,5px);line-height:1;font-size:inherit;outline:none;transition:border-color .3s,background-color .3s,color .3s;display:inline-flex;position:relative}.l-btn:hover{border-color:var(--l-btn-hover-border-color,var(--l-btn-hover-background));color:var(--l-btn-hover-text-color);background:var(--l-btn-hover-background)}.l-btn-box-shadow:hover{box-shadow:0 4px 12px var(--l-primary-color-light4)}.l-btn:active{border-color:var(--l-btn-active-border-color,var(--l-btn-active-background));color:var(--l-btn-active-text-color);background:var(--l-btn-active-background)}.l-btn-normal,.l-btn-normal-v2{--l-btn-text-color:auto;--l-btn-background:transparent;--l-btn-border-color:#d9d9d9;--l-btn-hover-text-color:var(--l-primary-color-light1,#9254de);--l-btn-active-text-color:var(--l-primary-color-dark1,#531dab);--l-btn-hover-background:transparent;--l-btn-active-background:transparent;--l-btn-hover-border-color:var(--l-btn-hover-text-color);--l-btn-active-border-color:var(--l-btn-active-text-color)}.l-btn-normal-v2{--l-btn-hover-background:var(--l-primary-color-light5);--l-btn-active-background:var(--l-primary-color-light4)}.l-btn-primary{--l-btn-background:var(--l-primary-color,#722ed1);--l-btn-hover-background:var(--l-primary-color-light1,#9254de);--l-btn-active-background:var(--l-primary-color-dark1,#531dab);--l-btn-disabled-border-color:var(--l-primary-color-light2,#b37feb);--l-btn-disabled-background:var(--l-primary-color-light2,#b37feb);--l-btn-disabled-color:#fff}.l-btn:disabled{border-color:var(--l-btn-disabled-border-color);background:var(--l-btn-disabled-background);color:var(--l-btn-disabled-color);cursor:not-allowed;opacity:1}.l-btn.l-btn-loading{cursor:default}.l-btn-text{--l-btn-background:transparent;--l-btn-border-color:transparent;--l-btn-hover-border-color:transparent;--l-btn-active-border-color:transparent;--l-btn-disabled-background:transparent;--l-btn-disabled-border-color:transparent;--l-btn-hover-background:transparent;--l-btn-active-background:transparent;--l-btn-padding:5px}.l-btn-primary.l-btn-text{--l-btn-text-color:var(--l-primary-color,#722ed1);--l-btn-hover-text-color:var(--l-primary-color-light1,#9254de);--l-btn-active-text-color:var(--l-primary-color-dark1,#531dab)}.l-btn-ghost{--l-btn-text-color:var(--l-btn-border-color);--l-btn-background:transparent;--l-btn-hover-background:transparent;--l-btn-active-background:transparent;--l-btn-hover-text-color:var(--l-btn-hover-border-color);--l-btn-active-text-color:var(--l-btn-active-border-color)}.l-btn-round{border-radius:calc(var(--l-form-control-height,32px) / 2)}.l-btn-circle{width:var(--l-form-control-height,32px);border-radius:50%;padding:0}.l-btn:not(.l-btn-text)+.l-btn{margin-left:10px}html.dark .l-btn:disabled{--l-btn-disabled-background:#ffffff14;--l-btn-disabled-color:#ffffff4d;--l-btn-disabled-border-color:#ffffff4d}", t = new CSSStyleSheet();
3
+ t.replaceSync(e);
4
+ //#endregion
5
+ export { t };
@@ -0,0 +1,2 @@
1
+ declare const sheet: CSSStyleSheet;
2
+ export default sheet;
@@ -0,0 +1,2 @@
1
+ import { t as e } from "../../animation-Bo4jbSGK.js";
2
+ export { e as default };
@@ -0,0 +1,2 @@
1
+ declare const sheet: CSSStyleSheet;
2
+ export default sheet;
@@ -0,0 +1,2 @@
1
+ import { t as e } from "../../mask-Ox6CoyFB.js";
2
+ export { e as default };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../switch-UyhlgW7F.js";
1
+ import { t as e } from "../switch-wh2-ivty.js";
2
2
  export { e as default };
@@ -1,6 +1,6 @@
1
1
  import { initAttr as e } from "./utils/index.js";
2
- import { t } from "./form_inner-52DR1IPu.js";
3
- import { $one as n, addClass as r, off as i, on as a, removeClass as o } from "ph-utils/dom";
2
+ import { t } from "./form_inner-Cnwb6f_Q.js";
3
+ import { $one as n, addClass as r, off as i, on as a, removeClass as o } from "ph-utils/browser";
4
4
  //#region src/components/switch/index.less?inline
5
5
  var s = ":host{box-sizing:border-box;--l-switch-height:22px;--l-switch-width:40px;width:auto;width:var(--l-switch-width);height:var(--l-switch-height);border-radius:calc(var(--l-switch-height) / 2);cursor:pointer;vertical-align:middle;background-color:#dcdfe6;border:1px solid #c2c2c2;justify-content:flex-start;align-items:center;padding:2px;transition:all .3s ease-in-out;display:inline-flex;position:relative}:host(:hover),:host(.l-switch--checked):hover{border-color:var(--l-primary-color,#722ed1)}:host(.l-switch--checked){background-color:var(--l-primary-color,#722ed1);border-color:var(--l-primary-color,#722ed1)}.l-switch-action{width:calc(var(--l-switch-height) - 6px);box-sizing:border-box;background-color:#fff;border-radius:50%;justify-content:center;align-items:center;padding:2px;font-size:12px;transition:all .3s ease-in-out;display:flex;position:absolute;top:2px;bottom:2px;left:2px}.l-switch-text{color:#fff;padding-left:calc(var(--l-switch-width) - 20px);transition:padding-left .3s ease-in-out}:host(.l-switch--checked) .l-switch-action{left:calc(var(--l-switch-width) - var(--l-switch-height) + 3px)}:host(.l-switch--checked) .l-switch-text{padding-left:5px}", c = class extends t {
6
6
  static baseName = "switch";
@@ -23,7 +23,7 @@ var s = ":host{box-sizing:border-box;--l-switch-height:22px;--l-switch-width:40p
23
23
  return e.join("");
24
24
  }
25
25
  #e = (e) => {
26
- this.isDisabled() || (this.setValue(!this.value), this.dispatchEvent(new CustomEvent("change")));
26
+ this.isDisabled() || (this.setValue(!this.value), this.emit("change"));
27
27
  };
28
28
  setValue(e) {
29
29
  super.setValue(e), e ? r(this, "l-switch--checked") : o(this, "l-switch--checked");
@@ -35,12 +35,14 @@ var s = ":host{box-sizing:border-box;--l-switch-height:22px;--l-switch-width:40p
35
35
  }
36
36
  #t() {
37
37
  let e = n(".l-switch-action", this.root);
38
- if (e) if (this.actionRender) {
39
- let t = this.actionRender({ checked: this.value });
40
- typeof t == "string" ? e.innerHTML = t : e.innerHTML = t.outerHTML;
41
- } else {
42
- let t = n("[slot=\"checked-action\"]", this), r = n("[slot=\"unchecked-action\"]", this);
43
- this.value && t ? e.innerHTML = "<slot name=\"checked-action\"></slot>" : !this.value && r && (e.innerHTML = "<slot name=\"unchecked-action\"></slot>");
38
+ if (e) {
39
+ if (this.actionRender) {
40
+ let t = this.actionRender({ checked: this.value });
41
+ e.innerHTML = typeof t == "string" ? t : t.outerHTML;
42
+ } else {
43
+ let t = n("[slot=\"checked-action\"]", this), r = n("[slot=\"unchecked-action\"]", this);
44
+ this.value && t ? e.innerHTML = "<slot name=\"checked-action\"></slot>" : !this.value && r && (e.innerHTML = "<slot name=\"unchecked-action\"></slot>");
45
+ }
44
46
  }
45
47
  }
46
48
  };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../tabbar-DO0kB58Y.js";
1
+ import { t as e } from "../tabbar-CBXK-_AV.js";
2
2
  export { e as default };