litos-ui 0.23.1 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (309) hide show
  1. package/lib/base.d.ts +3 -2
  2. package/lib/base.js +11 -8
  3. package/lib/button/index.d.ts +21 -5
  4. package/lib/button/index.js +115 -62
  5. package/lib/button/index.less_inline.js +2 -3
  6. package/lib/button/style.js +1 -2
  7. package/lib/calendar/index.js +22 -24
  8. package/lib/calendar/index.less_inline.js +1 -2
  9. package/lib/calendar/langs.js +1 -2
  10. package/lib/card/index.js +8 -9
  11. package/lib/card/index.less_inline.js +1 -2
  12. package/lib/carousel/index.js +10 -11
  13. package/lib/carousel/index.less_inline.js +1 -2
  14. package/lib/carousel/item.js +1 -2
  15. package/lib/carousel/item.less_inline.js +1 -2
  16. package/lib/carousel/timer.js +1 -2
  17. package/lib/check/check.d.ts +40 -8
  18. package/lib/check/check.js +200 -65
  19. package/lib/check/check.less_inline.js +2 -3
  20. package/lib/check/checkbox.js +2 -3
  21. package/lib/check/checkbox.less_inline.js +2 -3
  22. package/lib/check/checkbox_group.js +1 -2
  23. package/lib/check/index.d.ts +28 -8
  24. package/lib/check/index.js +151 -46
  25. package/lib/check/index.less_inline.js +1 -2
  26. package/lib/check/radio.js +2 -3
  27. package/lib/check/radio.less_inline.js +1 -2
  28. package/lib/check/radio_group.js +2 -3
  29. package/lib/collapse/index.d.ts +12 -4
  30. package/lib/collapse/index.js +80 -46
  31. package/lib/collapse/index.less_inline.js +2 -3
  32. package/lib/collapse/item.d.ts +35 -9
  33. package/lib/collapse/item.js +219 -57
  34. package/lib/collapse/item.less_inline.js +2 -3
  35. package/lib/collapse/types.d.ts +17 -3
  36. package/lib/color_picker/index.d.ts +4 -2
  37. package/lib/color_picker/index.js +26 -17
  38. package/lib/color_picker/index.less_inline.js +1 -2
  39. package/lib/date_picker/index.d.ts +5 -1
  40. package/lib/date_picker/index.js +39 -23
  41. package/lib/date_picker/index.less_inline.js +1 -2
  42. package/lib/date_picker_ori/index.d.ts +7 -2
  43. package/lib/date_picker_ori/index.js +123 -47
  44. package/lib/date_picker_ori/index.less_inline.js +1 -2
  45. package/lib/description_panel/index.js +2 -10
  46. package/lib/description_panel/index.less_inline.js +1 -2
  47. package/lib/dialog/dialog_box.js +28 -29
  48. package/lib/dialog/dialog_container.css_inline.js +1 -2
  49. package/lib/dialog/dialog_container.js +13 -14
  50. package/lib/dialog/dialog_container_style.js +1 -2
  51. package/lib/dialog/index.js +1 -2
  52. package/lib/dropdown/index.d.ts +39 -0
  53. package/lib/dropdown/index.js +98 -0
  54. package/lib/entries/base.js +1 -2
  55. package/lib/entries/button.js +5 -6
  56. package/lib/entries/calendar.js +5 -6
  57. package/lib/entries/card.js +5 -6
  58. package/lib/entries/carousel-item.js +5 -6
  59. package/lib/entries/carousel.js +5 -6
  60. package/lib/entries/checkbox-group.js +5 -6
  61. package/lib/entries/checkbox.js +5 -6
  62. package/lib/entries/collapse-item.d.ts +0 -1
  63. package/lib/entries/collapse-item.js +6 -6
  64. package/lib/entries/collapse.d.ts +0 -1
  65. package/lib/entries/collapse.js +11 -6
  66. package/lib/entries/color-picker.js +5 -6
  67. package/lib/entries/date-picker-ori.js +5 -6
  68. package/lib/entries/date-picker.js +5 -6
  69. package/lib/entries/description-panel.js +5 -6
  70. package/lib/entries/dialog-box.js +1 -2
  71. package/lib/entries/dialog-container.js +5 -6
  72. package/lib/entries/dialog.js +1 -2
  73. package/lib/entries/dropdown.d.ts +2 -0
  74. package/lib/entries/dropdown.js +1 -0
  75. package/lib/entries/form-item.js +5 -6
  76. package/lib/entries/form.js +5 -6
  77. package/lib/entries/icon-arrow-down.js +5 -6
  78. package/lib/entries/icon-arrow-left.js +5 -6
  79. package/lib/entries/icon-arrow-right.js +5 -6
  80. package/lib/entries/icon-arrow-up.js +5 -6
  81. package/lib/entries/icon-base.js +5 -6
  82. package/lib/entries/icon-calendar.js +5 -6
  83. package/lib/entries/icon-caret-bottom.js +5 -6
  84. package/lib/entries/icon-caret-top.js +5 -6
  85. package/lib/entries/icon-close-filled.js +5 -6
  86. package/lib/entries/icon-close.js +5 -6
  87. package/lib/entries/icon-copy.js +5 -6
  88. package/lib/entries/icon-d-arrow-left.js +5 -6
  89. package/lib/entries/icon-d-arrow-right.js +5 -6
  90. package/lib/entries/icon-delete.js +5 -6
  91. package/lib/entries/icon-eye-outline.js +5 -6
  92. package/lib/entries/icon-font-icon.js +5 -6
  93. package/lib/entries/icon-info.js +5 -6
  94. package/lib/entries/icon-loading.js +5 -6
  95. package/lib/entries/icon-minus.js +5 -6
  96. package/lib/entries/icon-moon.js +5 -6
  97. package/lib/entries/icon-more.js +5 -6
  98. package/lib/entries/icon-picture.js +5 -6
  99. package/lib/entries/icon-plus.js +5 -6
  100. package/lib/entries/icon-reduction.js +5 -6
  101. package/lib/entries/icon-refresh-left.js +5 -6
  102. package/lib/entries/icon-refresh-right.js +5 -6
  103. package/lib/entries/icon-refresh.js +5 -6
  104. package/lib/entries/icon-search.js +5 -6
  105. package/lib/entries/icon-select.js +5 -6
  106. package/lib/entries/icon-sort.js +5 -6
  107. package/lib/entries/icon-success.js +5 -6
  108. package/lib/entries/icon-sun.js +5 -6
  109. package/lib/entries/icon-theme-default.js +5 -6
  110. package/lib/entries/icon-warn.js +5 -6
  111. package/lib/entries/icon-zoom-in.js +5 -6
  112. package/lib/entries/icon-zoom-out.js +5 -6
  113. package/lib/entries/image-preview.js +5 -6
  114. package/lib/entries/image.js +5 -6
  115. package/lib/entries/input-number.js +5 -6
  116. package/lib/entries/input.js +5 -6
  117. package/lib/entries/list.js +5 -6
  118. package/lib/entries/loading.js +1 -2
  119. package/lib/entries/mask.js +5 -6
  120. package/lib/entries/md-input.js +5 -6
  121. package/lib/entries/menu.js +5 -6
  122. package/lib/entries/message.js +1 -2
  123. package/lib/entries/modal-box.js +1 -2
  124. package/lib/entries/modal.js +5 -6
  125. package/lib/entries/notification-box.js +1 -2
  126. package/lib/entries/notification.js +1 -2
  127. package/lib/entries/page-header.js +5 -6
  128. package/lib/entries/pagination.js +5 -6
  129. package/lib/entries/polygon.js +5 -6
  130. package/lib/entries/popconfirm.js +1 -2
  131. package/lib/entries/popover.js +1 -2
  132. package/lib/entries/qrcode.js +5 -6
  133. package/lib/entries/radio-group.js +5 -6
  134. package/lib/entries/radio.js +5 -6
  135. package/lib/entries/select-ori.js +5 -6
  136. package/lib/entries/select.js +5 -6
  137. package/lib/entries/space.js +5 -6
  138. package/lib/entries/switch.js +5 -6
  139. package/lib/entries/tabbar-item.js +5 -6
  140. package/lib/entries/tabbar.js +5 -6
  141. package/lib/entries/table.js +5 -6
  142. package/lib/entries/tabs.js +1 -2
  143. package/lib/entries/tag.js +5 -6
  144. package/lib/entries/theme-color.js +5 -6
  145. package/lib/entries/theme.js +5 -6
  146. package/lib/entries/transition.js +1 -2
  147. package/lib/entries/upload.js +5 -6
  148. package/lib/entries/utils.js +1 -3
  149. package/lib/form/accessibility.d.ts +15 -0
  150. package/lib/form/accessibility.js +56 -0
  151. package/lib/form/autocomplete.d.ts +21 -0
  152. package/lib/form/autocomplete.js +59 -0
  153. package/lib/form/context.d.ts +157 -0
  154. package/lib/form/context.js +88 -0
  155. package/lib/form/form_inner.d.ts +99 -24
  156. package/lib/form/form_inner.js +424 -72
  157. package/lib/form/form_item.d.ts +35 -11
  158. package/lib/form/form_item.js +210 -78
  159. package/lib/form/form_item.less_inline.js +2 -3
  160. package/lib/form/form_item_style.d.ts +3 -0
  161. package/lib/form/form_item_style.js +7 -0
  162. package/lib/form/index.d.ts +69 -15
  163. package/lib/form/index.js +501 -101
  164. package/lib/form/index.less_inline.js +1 -2
  165. package/lib/form/owner.d.ts +78 -0
  166. package/lib/form/owner.js +138 -0
  167. package/lib/form/style.d.ts +3 -0
  168. package/lib/form/style.js +7 -0
  169. package/lib/icon/arrow_down.js +1 -2
  170. package/lib/icon/arrow_left.js +1 -2
  171. package/lib/icon/arrow_right.js +1 -2
  172. package/lib/icon/arrow_up.js +1 -2
  173. package/lib/icon/base.js +1 -2
  174. package/lib/icon/calendar.js +1 -2
  175. package/lib/icon/caret_bottom.js +1 -2
  176. package/lib/icon/caret_top.js +1 -2
  177. package/lib/icon/close.js +1 -2
  178. package/lib/icon/close_filled.js +1 -2
  179. package/lib/icon/copy.js +1 -2
  180. package/lib/icon/d_arrow_left.js +1 -2
  181. package/lib/icon/d_arrow_right.js +1 -2
  182. package/lib/icon/delete.js +1 -2
  183. package/lib/icon/eye_outline.js +1 -2
  184. package/lib/icon/font_icon.js +1 -2
  185. package/lib/icon/icon_style.js +1 -2
  186. package/lib/icon/index.less_inline.js +1 -2
  187. package/lib/icon/info.js +1 -2
  188. package/lib/icon/loading.js +1 -2
  189. package/lib/icon/minus.js +1 -2
  190. package/lib/icon/moon.js +1 -2
  191. package/lib/icon/more.js +1 -2
  192. package/lib/icon/picture.js +1 -2
  193. package/lib/icon/plus.js +1 -2
  194. package/lib/icon/reduction.js +1 -2
  195. package/lib/icon/refresh.js +1 -2
  196. package/lib/icon/refresh_left.js +1 -2
  197. package/lib/icon/refresh_right.js +1 -2
  198. package/lib/icon/search.js +1 -2
  199. package/lib/icon/select.js +1 -2
  200. package/lib/icon/sort.js +1 -2
  201. package/lib/icon/success.js +1 -2
  202. package/lib/icon/sun.js +1 -2
  203. package/lib/icon/theme_default.js +1 -2
  204. package/lib/icon/warn.js +1 -2
  205. package/lib/icon/zoom_in.js +1 -2
  206. package/lib/icon/zoom_out.js +1 -2
  207. package/lib/image/image_preview.js +1 -2
  208. package/lib/image/image_preview.less_inline.js +1 -2
  209. package/lib/image/index.js +1 -2
  210. package/lib/image/index.less_inline.js +1 -2
  211. package/lib/index.d.ts +2 -1
  212. package/lib/index.js +91 -91
  213. package/lib/input/index.d.ts +14 -0
  214. package/lib/input/index.js +126 -31
  215. package/lib/input/index.less_inline.js +2 -3
  216. package/lib/input/input_inner.less_inline.js +1 -2
  217. package/lib/input/style.d.ts +1 -0
  218. package/lib/input/style.js +5 -7
  219. package/lib/input_number/index.d.ts +7 -0
  220. package/lib/input_number/index.js +70 -48
  221. package/lib/input_number/index.less_inline.js +1 -2
  222. package/lib/input_number/style.js +1 -2
  223. package/lib/list/index.js +4 -5
  224. package/lib/list/index.less_inline.js +1 -2
  225. package/lib/loading/index.js +1 -2
  226. package/lib/mask/index.js +2 -7
  227. package/lib/mask/index.less_inline.js +1 -2
  228. package/lib/md_input/index.d.ts +11 -2
  229. package/lib/md_input/index.js +63 -27
  230. package/lib/md_input/index.less_inline.js +2 -3
  231. package/lib/menu/index.js +2 -7
  232. package/lib/menu/index.less_inline.js +1 -2
  233. package/lib/message/index.js +1 -2
  234. package/lib/modal/index.js +15 -16
  235. package/lib/modal/index.less_inline.js +1 -2
  236. package/lib/modal/modal_box.js +24 -25
  237. package/lib/notification/index.js +15 -29
  238. package/lib/notification/index.less_inline.js +1 -2
  239. package/lib/notification/notification_box.js +2 -3
  240. package/lib/notification/placement.js +1 -2
  241. package/lib/notification/style.js +1 -2
  242. package/lib/page_header/index.js +1 -2
  243. package/lib/page_header/index.less_inline.js +1 -2
  244. package/lib/pagination/index.js +2 -7
  245. package/lib/pagination/index.less_inline.js +1 -2
  246. package/lib/polygon/index.js +1 -2
  247. package/lib/polygon/index.less_inline.js +1 -2
  248. package/lib/qrcode/index.js +1 -2
  249. package/lib/qrcode/index.less_inline.js +1 -2
  250. package/lib/select/index.d.ts +19 -2
  251. package/lib/select/index.js +128 -74
  252. package/lib/select/index.less_inline.js +1 -2
  253. package/lib/select_ori/index.d.ts +9 -1
  254. package/lib/select_ori/index.js +36 -24
  255. package/lib/select_ori/index.less_inline.js +1 -2
  256. package/lib/space/index.js +1 -2
  257. package/lib/space/index.less_inline.js +1 -2
  258. package/lib/styles/animation/index.css_inline.js +1 -2
  259. package/lib/styles/animation/index.js +1 -2
  260. package/lib/styles/mask/index.css_inline.js +1 -2
  261. package/lib/styles/mask/index.js +1 -2
  262. package/lib/switch/index.d.ts +6 -0
  263. package/lib/switch/index.js +31 -16
  264. package/lib/switch/index.less_inline.js +1 -2
  265. package/lib/tabbar/index.js +1 -2
  266. package/lib/tabbar/index.less_inline.js +1 -2
  267. package/lib/tabbar/item.js +1 -2
  268. package/lib/tabbar/item.less_inline.js +1 -2
  269. package/lib/table/index.js +1 -2
  270. package/lib/table/index.less_inline.js +1 -2
  271. package/lib/tabs/index.js +1 -2
  272. package/lib/tag/index.d.ts +11 -3
  273. package/lib/tag/index.js +25 -24
  274. package/lib/tag/index.less_inline.js +2 -3
  275. package/lib/theme/appearance.d.ts +5 -0
  276. package/lib/theme/appearance.js +34 -0
  277. package/lib/theme/index.js +83 -39
  278. package/lib/theme/index.less_inline.js +1 -2
  279. package/lib/theme/theme_color.js +1 -2
  280. package/lib/upload/index.js +28 -41
  281. package/lib/upload/index.less_inline.js +2 -3
  282. package/lib/upload/style.js +1 -2
  283. package/lib/utils/clickoutside.js +1 -2
  284. package/lib/utils/event.js +1 -2
  285. package/lib/utils/index.d.ts +27 -6
  286. package/lib/utils/index.js +26 -6
  287. package/lib/utils/popover.js +7 -16
  288. package/lib/utils/transition.js +1 -2
  289. package/package.json +16 -13
  290. package/styles/dark.css +10 -2
  291. package/styles/dropdown.css +46 -0
  292. package/styles/reset.css +0 -1
  293. package/styles/select.css +5 -0
  294. package/styles/themes/apple.css +47 -0
  295. package/styles/{theme-coral.css → themes/coral.css} +5 -3
  296. package/styles/themes/deep-sea-blue.css +12 -0
  297. package/styles/themes/gamboge.css +15 -0
  298. package/styles/{theme-jade.css → themes/jade.css} +5 -3
  299. package/styles/themes/lotus-seed.css +12 -0
  300. package/styles/{theme-tangerine.css → themes/tangerine.css} +5 -3
  301. package/styles/themes.css +8 -0
  302. package/styles/vars.css +8 -2
  303. package/types/preact.d.ts +42 -0
  304. package/lib/form/types.d.ts +0 -7
  305. package/lib/utils/context_provide.d.ts +0 -10
  306. package/lib/utils/context_provide.js +0 -22
  307. package/lib/utils/locale.d.ts +0 -6
  308. package/lib/utils/locale.js +0 -34
  309. package/lib/utils/signal_types.d.ts +0 -5
@@ -1,15 +1,17 @@
1
- import { kebabToCamel as e, parseAttrValue as t, unitNumberStr as n } from "../utils/index.js";
2
- import r from "../form/form_inner.js";
3
- import i from "./index.less_inline.js";
4
- import { $ as a, $$ as o, iterate as s, off as c, on as l } from "utilane/browser";
5
- import { parse as u } from "utilane";
6
- //#region src/components/date_picker_ori/index.ts
7
- var d = class extends r {
1
+ import e from "./index.less_inline.js";
2
+ import t from "../form/form_inner.js";
3
+ import { parseAttrValue as n, unitNumberStr as r } from "../utils/index.js";
4
+ import { readFormBooleanAttribute as i } from "../form/context.js";
5
+ import { $ as a, $$ as o, off as s, on as c } from "utilane/browser";
6
+ import { parse as l } from "utilane";
7
+ // src/components/date_picker_ori/index.ts
8
+ var u = class extends t {
8
9
  static baseName = "date-picker-ori";
9
- #e;
10
+ #e = [];
10
11
  #t;
11
- #n;
12
+ #n = !1;
12
13
  #r;
14
+ #i = !1;
13
15
  _state;
14
16
  constructor() {
15
17
  super(), this._state = {
@@ -17,16 +19,48 @@ var d = class extends r {
17
19
  delay: 300,
18
20
  type: "date",
19
21
  allowEmpty: !0
20
- }, this.#t = [], this.#r = !1;
22
+ }, this.#t = [];
23
+ }
24
+ parseDefaultValue(e) {
25
+ return this.#s(this.#o(e).dates);
26
+ }
27
+ #a() {
28
+ let e = this.ownerDocument.createElement("input");
29
+ return e.type = this.getAttribute("type") || this._state.type, e;
30
+ }
31
+ #o(e) {
32
+ let [t, r = ""] = String(e ?? "").split(",", 2), i = this.#a();
33
+ i.value = t;
34
+ let a = i.value;
35
+ if (!n(this.getAttribute("range"), !1, "range")) return {
36
+ dates: [a],
37
+ reversed: !1
38
+ };
39
+ let o = i.valueAsNumber;
40
+ return i.value = r, {
41
+ dates: [a, i.value],
42
+ reversed: o > i.valueAsNumber
43
+ };
44
+ }
45
+ #s(e) {
46
+ return e.some(Boolean) ? e.join(",") : "";
21
47
  }
22
48
  setValue(e) {
23
- super.setValue(e), this.#t = e.split(","), this.rendered && s(this.#e, (e, t) => {
24
- e.value = this.#t[t];
25
- });
49
+ let { dates: t, reversed: n } = this.#o(e);
50
+ this.#f(), this.#i = !1, this.#t = t, this.#n = n, this.#l(), super.setValue(this.#s(t));
51
+ }
52
+ get nativeConstraintValues() {
53
+ return this._state.range ? [this.#t[0] ?? "", this.#t[1] ?? ""] : [this.#t[0] ?? ""];
54
+ }
55
+ get nativeBadInput() {
56
+ return this.#n;
57
+ }
58
+ disabledChange() {
59
+ for (let e of this.#e ?? []) e.disabled = this.isDisabled();
26
60
  }
27
61
  static get observedAttributes() {
28
- return [
29
- ...r.observedAttributes,
62
+ return [.../* @__PURE__ */ new Set([
63
+ ...t.observedAttributes,
30
64
  "range",
31
65
  "delay",
32
66
  "type",
@@ -34,56 +68,85 @@ var d = class extends r {
34
68
  "min",
35
69
  "max",
36
70
  "allow-empty"
37
- ];
71
+ ])];
38
72
  }
39
73
  connectedCallback() {
40
- this.loadStyleText(i), this._updateWidth(), super.connectedCallback();
74
+ this.loadStyleText(e), this._updateWidth(), super.connectedCallback();
41
75
  }
42
76
  afterInit() {
43
- this.#e = a(".l-date-inner", this.root), l(this.#e, "change", this.#a), this._state.range && (l(this.#e, "focus", this.#c), l(this.#e, "blur", this.#l));
77
+ this.#e = a(".l-date-inner", this.root), c(this.#e, "change", this.#d), this._state.range && (c(this.#e, "focus", this.#m), c(this.#e, "blur", this.#h)), this.#l();
44
78
  }
45
79
  beforeDestroy() {
46
- c(this.#e, "change", this.#a), this._state.range && (c(this.#e, "focus", this.#c), c(this.#e, "blur", this.#l)), this.#o();
80
+ s(this.#e, "change", this.#d), s(this.#e, "focus", this.#m), s(this.#e, "blur", this.#h), this.#f(), this.#i = !1, this.#e = [];
47
81
  }
48
- attributeChange(r, i, a) {
49
- switch (r) {
82
+ attributeChange(e, t, i) {
83
+ switch (e) {
50
84
  case "type":
85
+ this._state.type = i || "date", this.#c();
86
+ break;
51
87
  case "min":
52
88
  case "max":
53
- this._state[r] = a;
89
+ this._state[e] = i;
54
90
  break;
55
91
  case "range":
92
+ this._state.range = n(i, !1, e), this.#c();
93
+ break;
56
94
  case "allow-empty":
57
- this._state[e(r)] = t(a, !1, r);
95
+ this._state.allowEmpty = n(i, !0, e);
58
96
  break;
59
97
  case "delay":
60
- this._state.delay = t(a, 300);
98
+ this._state.delay = n(i, 300);
61
99
  break;
62
- case "width": this._state.width = n(a);
100
+ case "width": this._state.width = r(i);
63
101
  }
64
102
  }
65
103
  updateDOM(e) {
66
- e.has("width") && this._updateWidth();
104
+ if (e.has("width") && this._updateWidth(), e.has("range") && this.#e.length !== (this._state.range ? 2 : 1)) {
105
+ this.beforeDestroy();
106
+ for (let e of this.root.querySelectorAll(".l-date-inner,.l-date-range-divider")) e.remove();
107
+ this.root.appendChild(this.render()), this.afterInit();
108
+ }
109
+ this.#l(), this.syncNativeValue();
110
+ }
111
+ #c() {
112
+ this.dirtyValue ? this.setValue(this.value) : this.applyDefaultValue();
113
+ }
114
+ #l() {
115
+ for (let [e, t] of this.#e.entries()) {
116
+ t.type = this._state.type || "date";
117
+ let n = this.#t[e] ?? "";
118
+ t.value !== n && (t.value = n);
119
+ for (let e of [
120
+ "min",
121
+ "max",
122
+ "step"
123
+ ]) {
124
+ let n = this.getAttribute(e);
125
+ n == null ? t.removeAttribute(e) : t.setAttribute(e, n);
126
+ }
127
+ t.readOnly = i(this.getAttribute("readonly")) ?? !1, t.disabled = this.isDisabled();
128
+ }
129
+ let [e, t] = this.#e;
130
+ e && t && (t.value && (!e.max || t.value < e.max) && (e.max = t.value), e.value && (!t.min || e.value > t.min) && (t.min = e.value));
67
131
  }
68
132
  _updateWidth() {
69
133
  this._state.width ? this.style.setProperty("--l-date-picker-width", this._state.width) : this.style.removeProperty("--l-date-picker-width");
70
134
  }
71
135
  render() {
72
136
  let e = document.createDocumentFragment();
73
- if (e.appendChild(this.#i(0)), this._state.range) {
137
+ if (e.appendChild(this.#u(0)), this._state.range) {
74
138
  let t = o("span", {
75
139
  class: "l-date-range-divider",
76
140
  textContent: "-"
77
141
  });
78
- e.appendChild(t), e.appendChild(this.#i(1));
142
+ e.appendChild(t), e.appendChild(this.#u(1));
79
143
  }
80
144
  return e;
81
145
  }
82
- #i(e = 0) {
146
+ #u(e = 0) {
83
147
  return o("input", {
84
148
  type: this._state.type,
85
149
  class: `l-date-inner l-date-inner${e}`,
86
- name: this.getName(),
87
150
  value: this.#t[e],
88
151
  "l-datepicker": `${e}`,
89
152
  disabled: this.isDisabled() ? !0 : void 0,
@@ -91,31 +154,44 @@ var d = class extends r {
91
154
  max: this._state.max
92
155
  });
93
156
  }
94
- #a = (e) => {
95
- let t = e.target, n = Number(t.getAttribute("l-datepicker")), r = t.value;
96
- !r && !this._state.allowEmpty && (r = this._resetValue || "", r = r.split(",")[n], t.value = r), this.#t[n] = r, this.#t.join(",") !== this._value && (this.setValue(this.#t.join(",")), this.#r = !0), n === 0 && this.#e.length > 1 ? this.#e[1].min = r : n === 1 && (this.#e[0].max = r), this._state.range ? this.#s() : this.#u();
157
+ #d = (e) => {
158
+ let t = e.target;
159
+ if (this.isDisabled() || t.readOnly) return;
160
+ let n = Number(t.getAttribute("l-datepicker"));
161
+ if (n >= this.#t.length) return;
162
+ let r = t.value;
163
+ !r && !this._state.allowEmpty && (r = this.defaultValue, r = String(r).split(",")[n] ?? "", t.value = r);
164
+ let i = [...this.#t];
165
+ i[n] = r;
166
+ let a = this.#s(this.#o(i.join(",")).dates);
167
+ a !== this.value && (this.setValue(a), this.validateInput(), this._state.range ? (this.#i = !0, this.#p()) : this.#_());
97
168
  };
98
- #o() {
99
- this.#n !== -1 && (clearTimeout(this.#n), this.#n = -1);
169
+ #f() {
170
+ this.#r !== void 0 && (clearTimeout(this.#r), this.#r = void 0);
100
171
  }
101
- #s() {
102
- this.#r && (this.#o(), this.#n = setTimeout(() => {
103
- this.#u(), this.#r = !1;
172
+ #p() {
173
+ this.#i && (this.#f(), this.#r = setTimeout(() => {
174
+ this.#r = void 0, this.#i = !1, this.#_();
104
175
  }, this._state.delay));
105
176
  }
106
- #c = () => {
107
- this.#o();
177
+ #m = () => {
178
+ this.#f();
108
179
  };
109
- #l = () => {
110
- this.#s();
180
+ #h = () => {
181
+ this.#p();
111
182
  };
112
- #u() {
183
+ #g() {
184
+ let e = this._state.type.toLowerCase();
185
+ if (e !== "time" && e !== "week") return this.#t.map((e) => l(e));
186
+ let t = this.#a();
187
+ return this.#t.map((e) => (t.value = e, t.valueAsDate ?? l(e)));
188
+ }
189
+ #_() {
113
190
  this.dispatchEvent(new CustomEvent("change", { detail: {
114
191
  value: this.getValue(),
115
- dateStr: this.#t,
116
- dates: this.#t.map((e) => u(e))
192
+ dateStr: [...this.#t],
193
+ dates: this.#g()
117
194
  } }));
118
195
  }
119
196
  };
120
- //#endregion
121
- export { d as default };
197
+ export { u as default };
@@ -1,4 +1,3 @@
1
- //#region src/components/date_picker_ori/index.less?inline
1
+ // src/components/date_picker_ori/index.less?inline
2
2
  var e = ":host{width:var(--l-date-picker-width,auto);align-items:center;display:inline-flex}.l-date-inner{height:var(--l-form-control-height,32px);border:1px solid var(--l-border-color,#dedede);cursor:text;border-radius:3px;outline:none;flex-grow:1;padding:0 5px;transition:border-color .3s}.l-date-inner:hover{border-color:var(--l-primary-color-light1,#9254de)}.l-date-inner:focus{border-color:var(--l-primary-color,#722ed1)}.l-date-range-divider{margin:0 10px}";
3
- //#endregion
4
3
  export { e as default };
@@ -2,7 +2,7 @@ import e from "../base.js";
2
2
  import { kebabToCamel as t, parseAttrValue as n } from "../utils/index.js";
3
3
  import r from "./index.less_inline.js";
4
4
  import { $one as i, addClass as a, hasClass as o, on as s, removeClass as c, shouldEventNext as l } from "utilane/browser";
5
- //#region src/components/description_panel/index.ts
5
+ // src/components/description_panel/index.ts
6
6
  var u = class extends e {
7
7
  static baseName = "description-panel";
8
8
  collapseHeight = 100;
@@ -18,14 +18,7 @@ var u = class extends e {
18
18
  this.loadStyleText(r), super.connectedCallback();
19
19
  }
20
20
  render() {
21
- return [
22
- "<div class=\"content\"><slot></slot></div>",
23
- "<div class=\"l-desc-panel-operator\">",
24
- "<l-button type=\"primary\" data-action=\"collapse\" class=\"l-desc-panel-btnmore\" text>",
25
- "<span>查看更多</span>",
26
- "<l-arrow-down-icon class=\"l-desc-panel-arrow\"></l-arrow-down-icon>",
27
- "</l-button></div>"
28
- ].join("");
21
+ return "<div class=\"content\"><slot></slot></div><div class=\"l-desc-panel-operator\"><l-button type=\"primary\" data-action=\"collapse\" class=\"l-desc-panel-btnmore\" text><span>查看更多</span><l-arrow-down-icon class=\"l-desc-panel-arrow\"></l-arrow-down-icon></l-button></div>";
29
22
  }
30
23
  afterInit() {
31
24
  this.classList.add("collapse");
@@ -50,5 +43,4 @@ var u = class extends e {
50
43
  }
51
44
  };
52
45
  };
53
- //#endregion
54
46
  export { u as default };
@@ -1,4 +1,3 @@
1
- //#region src/components/description_panel/index.less?inline
1
+ // src/components/description_panel/index.less?inline
2
2
  var e = ":host{--l-desc-panel-min-height:100px;--l-desc-panel-font-size:14px;--l-desc-panel-textindent:calc(var(--l-desc-panel-font-size) * 2);max-height:var(--l-desc-panel-max-height,max-content);color:#1f2937;font-size:var(--l-desc-panel-font-size);text-indent:var(--l-desc-panel-textindent);box-sizing:border-box;transition:all .15s linear;display:block;position:relative}.content{box-sizing:border-box;border:1px solid #0000}.l-desc-panel-operator{z-index:2;box-sizing:border-box;background:0 0;justify-content:center;width:100%;padding-top:0;padding-bottom:0;display:flex}.l-desc-panel-btnmore{font-size:var(--nt-desc-panel-font-size)}.l-desc-panel-btnmore:before{content:attr(data-text)}.l-desc-panel-arrow{transition:transform .3s ease-in-out;transform:rotate(180deg)}:host(.collapse){max-height:var(--l-desc-panel-min-height);overflow-y:hidden}:host(.collapse) .l-desc-panel-operator{background:linear-gradient(-180deg,#fff0 0%,#fff 80%);padding-top:65px;position:absolute;bottom:0;left:0}:host(.collapse) .l-desc-panel-arrow{transform:rotateX(0)}";
3
- //#endregion
4
3
  export { e as default };
@@ -1,24 +1,24 @@
1
- import { regist as e } from "../utils/index.js";
2
- import t from "../icon/info.js";
3
- import n from "./index.js";
4
- import r from "./dialog_container.js";
5
- import i from "../button/index.js";
6
- import a from "../icon/close.js";
1
+ import e from "./index.js";
2
+ import { regist as t } from "../utils/index.js";
3
+ import n from "./dialog_container.js";
4
+ import r from "../button/index.js";
5
+ import i from "../icon/close.js";
6
+ import a from "../icon/info.js";
7
7
  import o from "../form/form_item.js";
8
8
  import s from "../input/index.js";
9
9
  import { $$ as c, $one as l } from "utilane/browser";
10
- //#region src/components/dialog/dialog_box.ts
11
- function u(e, t, r, i = "alert") {
10
+ // src/components/dialog/dialog_box.ts
11
+ function u(t, n, r, i = "alert") {
12
12
  return new Promise((a) => {
13
13
  let o = [];
14
14
  if (r.icon) {
15
15
  let e = r.icon();
16
16
  e.setAttribute("slot", "header"), o.push(e.outerHTML);
17
17
  }
18
- o.push(`<span slot="header">${e}</span>`), i === "prompt" ? (o.push(`<l-form-item label="${t}" label-position="top" inner-block>`), o.push(`<l-input placeholder="${r.placeholder || ""}"></l-input>`), o.push("</l-form-item>")) : o.push(`<span>${t}</span>`);
18
+ o.push(`<span slot="header">${t}</span>`), i === "prompt" ? (o.push(`<l-form-item label="${n}" label-position="top" inner-block>`), o.push(`<l-input placeholder="${r.placeholder || ""}"></l-input>`), o.push("</l-form-item>")) : o.push(`<span>${n}</span>`);
19
19
  let s = document.createElement("dialog"), c = document.createElement("l-dialog-container");
20
- c.setAttribute("header", e), c.setAttribute("close", `${r.close}`), c.setAttribute("show-cancel", `${r.showCancel}`), c.innerHTML = o.join(""), s.appendChild(c), document.body.appendChild(s);
21
- let u = new n({
20
+ c.setAttribute("header", t), c.setAttribute("close", `${r.close}`), c.setAttribute("show-cancel", `${r.showCancel}`), c.innerHTML = o.join(""), s.appendChild(c), document.body.appendChild(s);
21
+ let u = new e({
22
22
  el: s,
23
23
  maskClosable: r.maskClosable,
24
24
  close: r.close,
@@ -39,11 +39,11 @@ function u(e, t, r, i = "alert") {
39
39
  u.open();
40
40
  });
41
41
  }
42
- function d(t, n, o) {
43
- e([
44
- a,
42
+ function d(e, a, o) {
43
+ t([
45
44
  i,
46
- r
45
+ r,
46
+ n
47
47
  ]);
48
48
  let s = {
49
49
  showCancel: !1,
@@ -52,14 +52,14 @@ function d(t, n, o) {
52
52
  icon: void 0,
53
53
  ...o
54
54
  };
55
- return u(n || "提示", t, s, "alert");
55
+ return u(a || "提示", e, s, "alert");
56
56
  }
57
- function f(n, o, s) {
58
- e([
59
- a,
60
- t,
57
+ function f(e, o, s) {
58
+ t([
61
59
  i,
62
- r
60
+ a,
61
+ r,
62
+ n
63
63
  ]);
64
64
  let l = {
65
65
  showCancel: !0,
@@ -68,16 +68,16 @@ function f(n, o, s) {
68
68
  icon: () => c("l-info-icon", { style: "color:#1890ff;" }),
69
69
  ...s
70
70
  };
71
- return u(o || "提示", n, l, "confirm");
71
+ return u(o || "提示", e, l, "confirm");
72
72
  }
73
- function p(n, c, l) {
74
- e([
73
+ function p(e, c, l) {
74
+ t([
75
+ i,
75
76
  a,
76
- t,
77
77
  o,
78
78
  s,
79
- i,
80
- r
79
+ r,
80
+ n
81
81
  ]);
82
82
  let d = {
83
83
  showCancel: !0,
@@ -87,12 +87,11 @@ function p(n, c, l) {
87
87
  icon: void 0,
88
88
  ...l
89
89
  };
90
- return u(c || "提示", n, d, "prompt");
90
+ return u(c || "提示", e, d, "prompt");
91
91
  }
92
92
  var m = {
93
93
  alert: d,
94
94
  confirm: f,
95
95
  prompt: p
96
96
  };
97
- //#endregion
98
97
  export { m as default };
@@ -1,4 +1,3 @@
1
- //#region src/components/dialog/dialog_container.css?inline
1
+ // src/components/dialog/dialog_container.css?inline
2
2
  var e = ":host{display:block;position:relative}:host(.l-container-close-outside){padding-top:10px;padding-right:10px}.l-dialog-main{padding:var(--l-dialog-main-padding,0);background-color:#fff;border-radius:5px;box-shadow:0 0 8px #0000001a}.l-dialog-header{padding:var(--l-dialog-header-padding,10px);border-bottom:1px solid var(--l-dialog-line-color,#0000000f);align-items:center;gap:5px;font-size:16px;font-weight:600;display:flex}.l-dialog-footer{padding:var(--l-dialog-footer-padding,10px);border-top:1px solid var(--l-dialog-line-color,#0000000f);justify-content:flex-end;gap:10px;display:flex}.l-dialog-container{padding:var(--l-dialog-container-padding,15px 10px);font-size:14px}.l-btn-dialog-close{--l-form-control-height:auto;position:absolute}.l-dialog-close1{right:var(--l-dialog-close-right,5px);top:var(--l-dialog-close-top,6px)}.l-dialog-close1::part(default){border:none;width:auto;height:auto;padding:5px;font-size:16px}.l-dialog-close2{right:var(--l-dialog-close-right,0);top:var(--l-dialog-close-top,0)}.l-dialog-close2::part(default){background-color:#fff;width:20px;height:20px;padding:0}.l-dialog-main--mobile{border-radius:10px}.l-dialog-main--mobile .l-dialog-header{text-align:center;border-bottom-color:#0000;justify-content:center;padding:20px 10px 5px;display:flex}.l-dialog-main--mobile .l-dialog-container{text-align:center;padding:5px 15px 20px}.l-dialog-main--mobile .l-dialog-footer{text-align:center;justify-content:stretch;align-items:stretch;gap:0;height:50px;padding:0;display:flex}.l-dialog-main--mobile .l-dialog-footer l-button{flex-grow:1;height:100%}.l-dialog-main--mobile .l-dialog-footer l-button+l-button{border-left:1px solid var(--l-dialog-line-color,#0000000f)}";
3
- //#endregion
4
3
  export { e as default };
@@ -1,8 +1,8 @@
1
1
  import e from "../base.js";
2
- import { parseAttrValue as t } from "../utils/index.js";
3
- import n from "./dialog_container_style.js";
2
+ import t from "./dialog_container_style.js";
3
+ import { parseAttrValue as n } from "../utils/index.js";
4
4
  import { $ as r, $$ as i, $one as a, formatClass as o, iterate as s, off as c, on as l, shouldEventNext as u } from "utilane/browser";
5
- //#region src/components/dialog/dialog_container.ts
5
+ // src/components/dialog/dialog_container.ts
6
6
  var d = class extends e {
7
7
  static baseName = "dialog-container";
8
8
  constructor() {
@@ -50,42 +50,42 @@ var d = class extends e {
50
50
  "confirm-loading"
51
51
  ];
52
52
  }
53
- attributeChanged(e, n, r) {
53
+ attributeChanged(e, t, r) {
54
54
  switch (e) {
55
55
  case "show-header":
56
- this._state.showHeader = t(r, !0, e), this.connectedCallback();
56
+ this._state.showHeader = n(r, !0, e), this.connectedCallback();
57
57
  break;
58
58
  case "header":
59
59
  this._state.header = r || void 0, this.connectedCallback();
60
60
  break;
61
61
  case "show-footer":
62
- this._state.showFooter = t(r, !0, e);
62
+ this._state.showFooter = n(r, !0, e);
63
63
  break;
64
64
  case "show-cancel":
65
- this._state.showCancel = t(r, !0, e), this.connectedCallback();
65
+ this._state.showCancel = n(r, !0, e), this.connectedCallback();
66
66
  break;
67
67
  case "cancel-text":
68
68
  this._state.cancelText = r || "取消", this.connectedCallback();
69
69
  break;
70
70
  case "show-ok":
71
- this._state.showOk = t(r, !0, e), this.connectedCallback();
71
+ this._state.showOk = n(r, !0, e), this.connectedCallback();
72
72
  break;
73
73
  case "ok-text":
74
74
  this._state.okText = r || "确定", this.connectedCallback();
75
75
  break;
76
76
  case "close":
77
77
  this._state.close = Number(r), this._state.close === 2 ? this.classList.add("l-container-close-outside") : this.classList.remove("l-container-close-outside");
78
- let n = a(".l-btn-dialog-close", this.root);
79
- this._state.close === 0 && n ? (c(n, "click", this.#e), n.remove()) : n ? n.className = this.#t() : (n = this.#n(), l(n, "click", this.#e), this.root.appendChild(n));
78
+ let t = a(".l-btn-dialog-close", this.root);
79
+ this._state.close === 0 && t ? (c(t, "click", this.#e), t.remove()) : t ? t.className = this.#t() : (t = this.#n(), l(t, "click", this.#e), this.root.appendChild(t));
80
80
  break;
81
81
  case "container-class":
82
82
  this._state.containerClass = r || void 0, this.connectedCallback();
83
83
  break;
84
84
  case "mobile":
85
- this._state.mobile = t(r, !1, e), this.connectedCallback();
85
+ this._state.mobile = n(r, !1, e), this.connectedCallback();
86
86
  break;
87
87
  case "confirm-loading":
88
- this._state.confirmLoading = t(r, !1, e);
88
+ this._state.confirmLoading = n(r, !1, e);
89
89
  let i = a("[data-action=\"ok\"]", this.root);
90
90
  i && i.setAttribute("loading", this._state.confirmLoading.toString());
91
91
  }
@@ -139,7 +139,7 @@ var d = class extends e {
139
139
  render_v2() {
140
140
  return {
141
141
  template: this.render(),
142
- styleSheets: [n]
142
+ styleSheets: [t]
143
143
  };
144
144
  }
145
145
  render() {
@@ -163,5 +163,4 @@ var d = class extends e {
163
163
  return n.appendChild(r), t.appendChild(n), this._state.showFooter && t.appendChild(this.#r()), e.appendChild(t), e;
164
164
  }
165
165
  };
166
- //#endregion
167
166
  export { d as default };
@@ -1,8 +1,7 @@
1
1
  import e from "./dialog_container.css_inline.js";
2
- //#region src/components/dialog/dialog_container_style.ts
2
+ // src/components/dialog/dialog_container_style.ts
3
3
  var t = /* @__PURE__ */ (() => {
4
4
  let t = new CSSStyleSheet();
5
5
  return t.replaceSync(e), t;
6
6
  })();
7
- //#endregion
8
7
  export { t as default };
@@ -1,5 +1,5 @@
1
1
  import { $one as e, addClass as t, getAttr as n, hasClass as r, off as i, on as a, removeClass as o } from "utilane/browser";
2
- //#region src/components/dialog/index.ts
2
+ // src/components/dialog/index.ts
3
3
  var s = class {
4
4
  $dialog;
5
5
  $container;
@@ -72,5 +72,4 @@ var s = class {
72
72
  this.$container && (e ? this.$container.setAttribute("confirm-loading", "") : this.$container.removeAttribute("confirm-loading"));
73
73
  }
74
74
  };
75
- //#endregion
76
75
  export { s as default };
@@ -0,0 +1,39 @@
1
+ import { Popover } from "../utils/popover";
2
+ export interface DropdownItem {
3
+ key: string;
4
+ label: string;
5
+ disabled?: boolean;
6
+ danger?: boolean;
7
+ divider?: boolean;
8
+ }
9
+ export type DropdownPlacement = "bottom-start" | "bottom" | "bottom-end" | "top-start" | "top" | "top-end";
10
+ export interface DropdownOptions {
11
+ reference: HTMLElement | HTMLElement[] | string;
12
+ items?: DropdownItem[];
13
+ /** Custom menu contents. Takes effect when items is omitted; the caller retains ownership. */
14
+ content?: HTMLElement;
15
+ trigger?: "click" | "hover" | "manual";
16
+ placement?: DropdownPlacement;
17
+ disabled?: boolean;
18
+ closeOnSelect?: boolean;
19
+ onSelect?: (detail: {
20
+ key: string;
21
+ item: DropdownItem;
22
+ index: number;
23
+ reference: HTMLElement | undefined;
24
+ }) => void;
25
+ onOpenChange?: (open: boolean) => void;
26
+ }
27
+ export interface DropdownInstance {
28
+ readonly popover: Popover;
29
+ readonly menu: HTMLElement;
30
+ show(reference?: HTMLElement): void;
31
+ hide(): void;
32
+ isOpen(): boolean;
33
+ setItems(items: DropdownItem[]): void;
34
+ setDisabled(disabled: boolean): void;
35
+ destroy(): void;
36
+ }
37
+ /** Creates a browser-only dropdown using the existing Popover display and positioning. */
38
+ export declare function createDropdown(options: DropdownOptions): DropdownInstance;
39
+ export default createDropdown;
@@ -0,0 +1,98 @@
1
+ import { Popover as e } from "../utils/popover.js";
2
+ // src/components/dropdown/index.ts
3
+ function t(t) {
4
+ let n = typeof t.reference == "string" ? Array.from(document.querySelectorAll(t.reference)) : Array.isArray(t.reference) ? [...t.reference] : [t.reference];
5
+ if (!n.length || n.some((e) => !(e instanceof HTMLElement))) throw TypeError("Dropdown requires at least one valid reference element");
6
+ let r = document.createElement("div");
7
+ r.className = "l-popover l-dropdown-menu", r.setAttribute("role", t.items === void 0 && t.content ? "group" : "menu"), r.style.display = "none";
8
+ let i = [], a, o = !1, s = !1, c = n.map((e) => ({
9
+ reference: e,
10
+ expanded: e.getAttribute("aria-expanded"),
11
+ popup: e.getAttribute("aria-haspopup")
12
+ })), l = t.items === void 0 ? t.content : void 0, u = l?.parentNode, d = l?.nextSibling;
13
+ l && r.append(l), document.body.append(r);
14
+ function f(e) {
15
+ i = Array.isArray(e) ? e.filter((e) => e && typeof e == "object").map((e) => ({
16
+ key: String(e.key ?? ""),
17
+ label: String(e.label ?? ""),
18
+ disabled: !!e.disabled,
19
+ danger: !!e.danger,
20
+ divider: !!e.divider
21
+ })) : [], r.replaceChildren(), r.setAttribute("role", "menu"), i.forEach((e, t) => {
22
+ if (e.divider) {
23
+ let e = document.createElement("div");
24
+ e.setAttribute("role", "separator"), r.append(e);
25
+ return;
26
+ }
27
+ let n = document.createElement("button");
28
+ n.type = "button", n.setAttribute("role", "menuitem"), n.disabled = !!e.disabled, n.setAttribute("aria-disabled", String(!!e.disabled)), n.dataset.dropdownIndex = String(t), n.className = e.danger ? "l-dropdown-item l-dropdown-item--danger" : "l-dropdown-item", n.textContent = e.label, r.append(n);
29
+ });
30
+ }
31
+ l || f(t.items || []);
32
+ let p;
33
+ p = new e({
34
+ reference: n,
35
+ popover: r,
36
+ trigger: t.trigger || "click",
37
+ placement: t.placement || "bottom-start",
38
+ arrow: !1,
39
+ offset: 6,
40
+ disabled: !!t.disabled,
41
+ updateContent: () => {},
42
+ onOpenChange: (e) => {
43
+ n.forEach((t) => t.setAttribute("aria-expanded", String(e && t === a))), o !== e && (o = e, t.onOpenChange?.(e));
44
+ },
45
+ onOutsideTap: (e, t, n) => {
46
+ !t && !n && p.hide();
47
+ }
48
+ });
49
+ let m = (e) => {
50
+ a = e.currentTarget;
51
+ };
52
+ n.forEach((e) => {
53
+ e.setAttribute("aria-haspopup", l ? "true" : "menu"), e.setAttribute("aria-expanded", "false"), e.addEventListener("click", m, !0), e.addEventListener("mouseenter", m, !0);
54
+ });
55
+ let h = (e) => {
56
+ let n = e.target.closest("button[data-dropdown-index]");
57
+ if (!n || !r.contains(n) || n.disabled || p.options.disabled) return;
58
+ let o = Number(n.dataset.dropdownIndex), s = i[o];
59
+ if (!s) return;
60
+ let c = a;
61
+ t.closeOnSelect !== !1 && p.hide(), t.onSelect?.({
62
+ key: s.key,
63
+ item: { ...s },
64
+ index: o,
65
+ reference: c
66
+ });
67
+ };
68
+ return r.addEventListener("click", h), {
69
+ popover: p,
70
+ menu: r,
71
+ show(e = n[0]) {
72
+ if (!s) {
73
+ if (!n.includes(e)) throw TypeError("Unknown Dropdown reference");
74
+ a = e, p.show(e);
75
+ }
76
+ },
77
+ hide() {
78
+ s || p.hide();
79
+ },
80
+ isOpen() {
81
+ return !s && p.isShow();
82
+ },
83
+ setItems(e) {
84
+ s || (l && r.contains(l) && (u ? u.insertBefore(l, d?.parentNode === u ? d : null) : l.remove()), f(e), n.forEach((e) => e.setAttribute("aria-haspopup", "menu")), o && a && (p.hide(), p.show(a)));
85
+ },
86
+ setDisabled(e) {
87
+ s || (p.setOption("disabled", !!e), e && p.hide());
88
+ },
89
+ destroy() {
90
+ s || (s = !0, r.removeEventListener("click", h), n.forEach((e) => {
91
+ e.removeEventListener("click", m, !0), e.removeEventListener("mouseenter", m, !0);
92
+ }), p.destroy(), l && r.contains(l) && (u ? u.insertBefore(l, d?.parentNode === u ? d : null) : l.remove()), c.forEach(({ reference: e, expanded: t, popup: n }) => {
93
+ t === null ? e.removeAttribute("aria-expanded") : e.setAttribute("aria-expanded", t), n === null ? e.removeAttribute("aria-haspopup") : e.setAttribute("aria-haspopup", n);
94
+ }));
95
+ }
96
+ };
97
+ }
98
+ export { t as createDropdown, t as default };
@@ -1,2 +1 @@
1
- import e from "../base.js";
2
- export { e as default };
1
+ export { default } from "../base.js";