litos-ui 0.23.0 → 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 (312) hide show
  1. package/README.md +2 -2
  2. package/README.zh-CN.md +2 -2
  3. package/lib/base.d.ts +3 -2
  4. package/lib/base.js +11 -8
  5. package/lib/button/index.d.ts +21 -5
  6. package/lib/button/index.js +115 -62
  7. package/lib/button/index.less_inline.js +2 -3
  8. package/lib/button/style.js +1 -2
  9. package/lib/calendar/index.d.ts +1 -0
  10. package/lib/calendar/index.js +19 -17
  11. package/lib/calendar/index.less_inline.js +1 -2
  12. package/lib/calendar/langs.js +21 -11
  13. package/lib/card/index.js +8 -9
  14. package/lib/card/index.less_inline.js +1 -2
  15. package/lib/carousel/index.js +10 -11
  16. package/lib/carousel/index.less_inline.js +1 -2
  17. package/lib/carousel/item.js +1 -2
  18. package/lib/carousel/item.less_inline.js +1 -2
  19. package/lib/carousel/timer.js +1 -2
  20. package/lib/check/check.d.ts +40 -8
  21. package/lib/check/check.js +200 -65
  22. package/lib/check/check.less_inline.js +2 -3
  23. package/lib/check/checkbox.js +2 -3
  24. package/lib/check/checkbox.less_inline.js +2 -3
  25. package/lib/check/checkbox_group.js +1 -2
  26. package/lib/check/index.d.ts +28 -8
  27. package/lib/check/index.js +151 -46
  28. package/lib/check/index.less_inline.js +1 -2
  29. package/lib/check/radio.js +2 -3
  30. package/lib/check/radio.less_inline.js +1 -2
  31. package/lib/check/radio_group.js +2 -3
  32. package/lib/collapse/index.d.ts +12 -4
  33. package/lib/collapse/index.js +80 -46
  34. package/lib/collapse/index.less_inline.js +2 -3
  35. package/lib/collapse/item.d.ts +35 -9
  36. package/lib/collapse/item.js +219 -57
  37. package/lib/collapse/item.less_inline.js +2 -3
  38. package/lib/collapse/types.d.ts +17 -3
  39. package/lib/color_picker/index.d.ts +4 -2
  40. package/lib/color_picker/index.js +26 -17
  41. package/lib/color_picker/index.less_inline.js +1 -2
  42. package/lib/date_picker/index.d.ts +5 -1
  43. package/lib/date_picker/index.js +39 -23
  44. package/lib/date_picker/index.less_inline.js +1 -2
  45. package/lib/date_picker_ori/index.d.ts +7 -2
  46. package/lib/date_picker_ori/index.js +123 -47
  47. package/lib/date_picker_ori/index.less_inline.js +1 -2
  48. package/lib/description_panel/index.js +2 -10
  49. package/lib/description_panel/index.less_inline.js +1 -2
  50. package/lib/dialog/dialog_box.js +28 -29
  51. package/lib/dialog/dialog_container.css_inline.js +1 -2
  52. package/lib/dialog/dialog_container.js +13 -14
  53. package/lib/dialog/dialog_container_style.js +1 -2
  54. package/lib/dialog/index.d.ts +2 -0
  55. package/lib/dialog/index.js +11 -9
  56. package/lib/dropdown/index.d.ts +39 -0
  57. package/lib/dropdown/index.js +98 -0
  58. package/lib/entries/base.js +1 -2
  59. package/lib/entries/button.js +5 -6
  60. package/lib/entries/calendar.js +5 -6
  61. package/lib/entries/card.js +5 -6
  62. package/lib/entries/carousel-item.js +5 -6
  63. package/lib/entries/carousel.js +5 -6
  64. package/lib/entries/checkbox-group.js +5 -6
  65. package/lib/entries/checkbox.js +5 -6
  66. package/lib/entries/collapse-item.d.ts +0 -1
  67. package/lib/entries/collapse-item.js +6 -6
  68. package/lib/entries/collapse.d.ts +0 -1
  69. package/lib/entries/collapse.js +11 -6
  70. package/lib/entries/color-picker.js +5 -6
  71. package/lib/entries/date-picker-ori.js +5 -6
  72. package/lib/entries/date-picker.js +5 -6
  73. package/lib/entries/description-panel.js +5 -6
  74. package/lib/entries/dialog-box.js +1 -2
  75. package/lib/entries/dialog-container.js +5 -6
  76. package/lib/entries/dialog.js +1 -2
  77. package/lib/entries/dropdown.d.ts +2 -0
  78. package/lib/entries/dropdown.js +1 -0
  79. package/lib/entries/form-item.js +5 -6
  80. package/lib/entries/form.js +5 -6
  81. package/lib/entries/icon-arrow-down.js +5 -6
  82. package/lib/entries/icon-arrow-left.js +5 -6
  83. package/lib/entries/icon-arrow-right.js +5 -6
  84. package/lib/entries/icon-arrow-up.js +5 -6
  85. package/lib/entries/icon-base.js +5 -6
  86. package/lib/entries/icon-calendar.js +5 -6
  87. package/lib/entries/icon-caret-bottom.js +5 -6
  88. package/lib/entries/icon-caret-top.js +5 -6
  89. package/lib/entries/icon-close-filled.js +5 -6
  90. package/lib/entries/icon-close.js +5 -6
  91. package/lib/entries/icon-copy.js +5 -6
  92. package/lib/entries/icon-d-arrow-left.js +5 -6
  93. package/lib/entries/icon-d-arrow-right.js +5 -6
  94. package/lib/entries/icon-delete.js +5 -6
  95. package/lib/entries/icon-eye-outline.js +5 -6
  96. package/lib/entries/icon-font-icon.js +5 -6
  97. package/lib/entries/icon-info.js +5 -6
  98. package/lib/entries/icon-loading.js +5 -6
  99. package/lib/entries/icon-minus.js +5 -6
  100. package/lib/entries/icon-moon.js +5 -6
  101. package/lib/entries/icon-more.js +5 -6
  102. package/lib/entries/icon-picture.js +5 -6
  103. package/lib/entries/icon-plus.js +5 -6
  104. package/lib/entries/icon-reduction.js +5 -6
  105. package/lib/entries/icon-refresh-left.js +5 -6
  106. package/lib/entries/icon-refresh-right.js +5 -6
  107. package/lib/entries/icon-refresh.js +5 -6
  108. package/lib/entries/icon-search.js +5 -6
  109. package/lib/entries/icon-select.js +5 -6
  110. package/lib/entries/icon-sort.js +5 -6
  111. package/lib/entries/icon-success.js +5 -6
  112. package/lib/entries/icon-sun.js +5 -6
  113. package/lib/entries/icon-theme-default.js +5 -6
  114. package/lib/entries/icon-warn.js +5 -6
  115. package/lib/entries/icon-zoom-in.js +5 -6
  116. package/lib/entries/icon-zoom-out.js +5 -6
  117. package/lib/entries/image-preview.js +5 -6
  118. package/lib/entries/image.js +5 -6
  119. package/lib/entries/input-number.js +5 -6
  120. package/lib/entries/input.js +5 -6
  121. package/lib/entries/list.js +5 -6
  122. package/lib/entries/loading.js +1 -2
  123. package/lib/entries/mask.js +5 -6
  124. package/lib/entries/md-input.js +5 -6
  125. package/lib/entries/menu.js +5 -6
  126. package/lib/entries/message.js +1 -2
  127. package/lib/entries/modal-box.js +1 -2
  128. package/lib/entries/modal.js +5 -6
  129. package/lib/entries/notification-box.js +1 -2
  130. package/lib/entries/notification.js +1 -2
  131. package/lib/entries/page-header.js +5 -6
  132. package/lib/entries/pagination.js +5 -6
  133. package/lib/entries/polygon.js +5 -6
  134. package/lib/entries/popconfirm.js +1 -2
  135. package/lib/entries/popover.js +1 -2
  136. package/lib/entries/qrcode.js +5 -6
  137. package/lib/entries/radio-group.js +5 -6
  138. package/lib/entries/radio.js +5 -6
  139. package/lib/entries/select-ori.js +5 -6
  140. package/lib/entries/select.js +5 -6
  141. package/lib/entries/space.js +5 -6
  142. package/lib/entries/switch.js +5 -6
  143. package/lib/entries/tabbar-item.js +5 -6
  144. package/lib/entries/tabbar.js +5 -6
  145. package/lib/entries/table.js +5 -6
  146. package/lib/entries/tabs.js +1 -2
  147. package/lib/entries/tag.js +5 -6
  148. package/lib/entries/theme-color.js +5 -6
  149. package/lib/entries/theme.js +5 -6
  150. package/lib/entries/transition.js +1 -2
  151. package/lib/entries/upload.js +5 -6
  152. package/lib/entries/utils.js +1 -2
  153. package/lib/form/accessibility.d.ts +15 -0
  154. package/lib/form/accessibility.js +56 -0
  155. package/lib/form/autocomplete.d.ts +21 -0
  156. package/lib/form/autocomplete.js +59 -0
  157. package/lib/form/context.d.ts +157 -0
  158. package/lib/form/context.js +88 -0
  159. package/lib/form/form_inner.d.ts +99 -24
  160. package/lib/form/form_inner.js +424 -72
  161. package/lib/form/form_item.d.ts +35 -11
  162. package/lib/form/form_item.js +210 -78
  163. package/lib/form/form_item.less_inline.js +2 -3
  164. package/lib/form/form_item_style.d.ts +3 -0
  165. package/lib/form/form_item_style.js +7 -0
  166. package/lib/form/index.d.ts +69 -15
  167. package/lib/form/index.js +501 -101
  168. package/lib/form/index.less_inline.js +1 -2
  169. package/lib/form/owner.d.ts +78 -0
  170. package/lib/form/owner.js +138 -0
  171. package/lib/form/style.d.ts +3 -0
  172. package/lib/form/style.js +7 -0
  173. package/lib/icon/arrow_down.js +1 -2
  174. package/lib/icon/arrow_left.js +1 -2
  175. package/lib/icon/arrow_right.js +1 -2
  176. package/lib/icon/arrow_up.js +1 -2
  177. package/lib/icon/base.js +1 -2
  178. package/lib/icon/calendar.js +1 -2
  179. package/lib/icon/caret_bottom.js +1 -2
  180. package/lib/icon/caret_top.js +1 -2
  181. package/lib/icon/close.js +1 -2
  182. package/lib/icon/close_filled.js +1 -2
  183. package/lib/icon/copy.js +1 -2
  184. package/lib/icon/d_arrow_left.js +1 -2
  185. package/lib/icon/d_arrow_right.js +1 -2
  186. package/lib/icon/delete.js +1 -2
  187. package/lib/icon/eye_outline.js +1 -2
  188. package/lib/icon/font_icon.js +1 -2
  189. package/lib/icon/icon_style.js +1 -2
  190. package/lib/icon/index.less_inline.js +1 -2
  191. package/lib/icon/info.js +1 -2
  192. package/lib/icon/loading.js +1 -2
  193. package/lib/icon/minus.js +1 -2
  194. package/lib/icon/moon.js +1 -2
  195. package/lib/icon/more.js +1 -2
  196. package/lib/icon/picture.js +1 -2
  197. package/lib/icon/plus.js +1 -2
  198. package/lib/icon/reduction.js +1 -2
  199. package/lib/icon/refresh.js +1 -2
  200. package/lib/icon/refresh_left.js +1 -2
  201. package/lib/icon/refresh_right.js +1 -2
  202. package/lib/icon/search.js +1 -2
  203. package/lib/icon/select.js +1 -2
  204. package/lib/icon/sort.js +1 -2
  205. package/lib/icon/success.js +1 -2
  206. package/lib/icon/sun.js +1 -2
  207. package/lib/icon/theme_default.js +1 -2
  208. package/lib/icon/warn.js +1 -2
  209. package/lib/icon/zoom_in.js +1 -2
  210. package/lib/icon/zoom_out.js +1 -2
  211. package/lib/image/image_preview.js +1 -2
  212. package/lib/image/image_preview.less_inline.js +1 -2
  213. package/lib/image/index.js +1 -2
  214. package/lib/image/index.less_inline.js +1 -2
  215. package/lib/index.d.ts +2 -1
  216. package/lib/index.js +88 -87
  217. package/lib/input/index.d.ts +18 -1
  218. package/lib/input/index.js +151 -48
  219. package/lib/input/index.less_inline.js +2 -3
  220. package/lib/input/input_inner.less_inline.js +1 -2
  221. package/lib/input/style.d.ts +3 -0
  222. package/lib/input/style.js +7 -0
  223. package/lib/input_number/index.d.ts +7 -0
  224. package/lib/input_number/index.js +70 -48
  225. package/lib/input_number/index.less_inline.js +1 -2
  226. package/lib/input_number/style.js +1 -2
  227. package/lib/list/index.js +4 -5
  228. package/lib/list/index.less_inline.js +1 -2
  229. package/lib/loading/index.js +1 -2
  230. package/lib/mask/index.js +2 -7
  231. package/lib/mask/index.less_inline.js +1 -2
  232. package/lib/md_input/index.d.ts +11 -2
  233. package/lib/md_input/index.js +63 -27
  234. package/lib/md_input/index.less_inline.js +2 -3
  235. package/lib/menu/index.js +2 -7
  236. package/lib/menu/index.less_inline.js +1 -2
  237. package/lib/message/index.js +1 -2
  238. package/lib/modal/index.js +15 -16
  239. package/lib/modal/index.less_inline.js +1 -2
  240. package/lib/modal/modal_box.js +24 -25
  241. package/lib/notification/index.js +15 -29
  242. package/lib/notification/index.less_inline.js +1 -2
  243. package/lib/notification/notification_box.js +2 -3
  244. package/lib/notification/placement.js +1 -2
  245. package/lib/notification/style.js +1 -2
  246. package/lib/page_header/index.js +1 -2
  247. package/lib/page_header/index.less_inline.js +1 -2
  248. package/lib/pagination/index.js +26 -25
  249. package/lib/pagination/index.less_inline.js +2 -3
  250. package/lib/polygon/index.js +1 -2
  251. package/lib/polygon/index.less_inline.js +1 -2
  252. package/lib/qrcode/index.js +1 -2
  253. package/lib/qrcode/index.less_inline.js +1 -2
  254. package/lib/select/index.d.ts +21 -2
  255. package/lib/select/index.js +138 -77
  256. package/lib/select/index.less_inline.js +1 -2
  257. package/lib/select_ori/index.d.ts +9 -1
  258. package/lib/select_ori/index.js +36 -24
  259. package/lib/select_ori/index.less_inline.js +1 -2
  260. package/lib/space/index.js +1 -2
  261. package/lib/space/index.less_inline.js +1 -2
  262. package/lib/styles/animation/index.css_inline.js +1 -2
  263. package/lib/styles/animation/index.js +1 -2
  264. package/lib/styles/mask/index.css_inline.js +1 -2
  265. package/lib/styles/mask/index.js +1 -2
  266. package/lib/switch/index.d.ts +6 -0
  267. package/lib/switch/index.js +31 -16
  268. package/lib/switch/index.less_inline.js +1 -2
  269. package/lib/tabbar/index.js +1 -2
  270. package/lib/tabbar/index.less_inline.js +1 -2
  271. package/lib/tabbar/item.js +1 -2
  272. package/lib/tabbar/item.less_inline.js +1 -2
  273. package/lib/table/index.d.ts +2 -0
  274. package/lib/table/index.js +12 -4
  275. package/lib/table/index.less_inline.js +1 -2
  276. package/lib/tabs/index.js +1 -2
  277. package/lib/tag/index.d.ts +11 -3
  278. package/lib/tag/index.js +25 -24
  279. package/lib/tag/index.less_inline.js +2 -3
  280. package/lib/theme/appearance.d.ts +5 -0
  281. package/lib/theme/appearance.js +34 -0
  282. package/lib/theme/index.js +83 -39
  283. package/lib/theme/index.less_inline.js +1 -2
  284. package/lib/theme/theme_color.js +1 -2
  285. package/lib/upload/index.js +28 -41
  286. package/lib/upload/index.less_inline.js +2 -3
  287. package/lib/upload/style.js +1 -2
  288. package/lib/utils/clickoutside.js +1 -2
  289. package/lib/utils/event.js +1 -2
  290. package/lib/utils/index.d.ts +27 -5
  291. package/lib/utils/index.js +43 -22
  292. package/lib/utils/popover.js +7 -16
  293. package/lib/utils/transition.js +1 -2
  294. package/package.json +16 -13
  295. package/styles/dark.css +10 -2
  296. package/styles/dropdown.css +46 -0
  297. package/styles/reset.css +0 -1
  298. package/styles/select.css +5 -0
  299. package/styles/themes/apple.css +47 -0
  300. package/styles/{theme-coral.css → themes/coral.css} +5 -3
  301. package/styles/themes/deep-sea-blue.css +12 -0
  302. package/styles/themes/gamboge.css +15 -0
  303. package/styles/{theme-jade.css → themes/jade.css} +5 -3
  304. package/styles/themes/lotus-seed.css +12 -0
  305. package/styles/{theme-tangerine.css → themes/tangerine.css} +5 -3
  306. package/styles/themes.css +8 -0
  307. package/styles/vars.css +8 -2
  308. package/types/preact.d.ts +43 -0
  309. package/lib/form/types.d.ts +0 -7
  310. package/lib/utils/context_provide.d.ts +0 -10
  311. package/lib/utils/context_provide.js +0 -22
  312. 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 };
@@ -26,8 +26,10 @@ export default class Dialog {
26
26
  private finishClose?;
27
27
  constructor(option?: DialogInitialParams);
28
28
  private handleKeydown;
29
+ private handleCancel;
29
30
  private handleClick;
30
31
  private handleContainerAction;
32
+ private applyClose;
31
33
  /**
32
34
  * 初始化对话框
33
35
  * @param option 配置项
@@ -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;
@@ -9,7 +9,10 @@ var s = class {
9
9
  e != null && this.init(e);
10
10
  }
11
11
  handleKeydown = (e) => {
12
- e.code === "Escape" && (e.preventDefault(), this.close());
12
+ (e.key === "Escape" || e.code === "Escape") && this.handleCancel(e);
13
+ };
14
+ handleCancel = (e) => {
15
+ e.preventDefault(), this.config.escClose !== !1 && this.close();
13
16
  };
14
17
  handleClick = (e) => {
15
18
  this.$dialog.isSameNode(e.target) && this.config && this.config.maskClosable && this.close();
@@ -18,13 +21,15 @@ var s = class {
18
21
  let t = e.detail.action;
19
22
  t === "ok" && this.$container?.hasAttribute("confirm-loading") || this.config.onAction != null && this.config.onAction(t, () => this.close());
20
23
  };
24
+ applyClose(e) {
25
+ e !== void 0 && (e === 2 ? t(this.$dialog, "l-dialog-close-outside") : o(this.$dialog, "l-dialog-close-outside"), this.$container?.setAttribute("close", `${e}`));
26
+ }
21
27
  init(i) {
22
28
  if (!this.config) {
23
29
  let o = {
24
30
  escClose: !0,
25
31
  verticalAlign: "top",
26
32
  maskClosable: !0,
27
- close: 1,
28
33
  ...i
29
34
  };
30
35
  if (this.$dialog = e(i.el), this.$dialog) {
@@ -32,9 +37,7 @@ var s = class {
32
37
  let i = n(this.$dialog, "translate") || o.translate;
33
38
  i && this.$dialog.style.setProperty("--l-dialog-translate", `translate3d(${i})`);
34
39
  let s = n(this.$dialog, "width") || o.width;
35
- s && this.$dialog.style.setProperty("--l-dialog-width", s);
36
- let c = n(this.$dialog, "close", 1);
37
- c === 2 && t(this.$dialog, "l-dialog-close-outside"), this.$container && this.$container.setAttribute("close", `${c}`), o.close = c, a(this.$dialog, "keydown", this.handleKeydown), a(this.$dialog, "click", this.handleClick), this.$container && a(this.$container, "dialogAction", this.handleContainerAction);
40
+ s && this.$dialog.style.setProperty("--l-dialog-width", s), this.applyClose(o.close), a(this.$dialog, "keydown", this.handleKeydown), a(this.$dialog, "cancel", this.handleCancel), a(this.$dialog, "click", this.handleClick), this.$container && a(this.$container, "dialogAction", this.handleContainerAction);
38
41
  }
39
42
  this.config = o;
40
43
  }
@@ -52,14 +55,14 @@ var s = class {
52
55
  }
53
56
  }
54
57
  destroy() {
55
- this.$dialog &&= (this.close(), this.finishClose?.(), i(this.$dialog, "keydown", this.handleKeydown), i(this.$dialog, "click", this.handleClick), this.$container && i(this.$container, "dialogAction", this.handleContainerAction), this.$container = void 0, void 0);
58
+ this.$dialog &&= (this.close(), this.finishClose?.(), i(this.$dialog, "keydown", this.handleKeydown), i(this.$dialog, "cancel", this.handleCancel), i(this.$dialog, "click", this.handleClick), this.$container && i(this.$container, "dialogAction", this.handleContainerAction), this.$container = void 0, void 0);
56
59
  }
57
60
  setProp(e, t) {
58
61
  if (this.config && (this.config[e] = t, this.$dialog)) {
59
62
  if (e === "verticalAlign") {
60
63
  let e = this.$dialog.className.replace(/l-dialog--vertical-\w+/g, () => `l-dialog--vertical-${t || "top"}`);
61
64
  this.$dialog.className = e;
62
- } else e === "translate" ? t ? this.$dialog.style.setProperty("--l-dialog-translate", `translate3d(${t})`) : this.$dialog.style.removeProperty("--l-dialog-translate") : e === "width" ? t ? this.$dialog.style.setProperty("--l-dialog-width", t) : this.$dialog.style.removeProperty("--l-dialog-width") : e === "close" && this.$container && this.$container.setAttribute("close", `${t}`);
65
+ } else e === "translate" ? t ? this.$dialog.style.setProperty("--l-dialog-translate", `translate3d(${t})`) : this.$dialog.style.removeProperty("--l-dialog-translate") : e === "width" ? t ? this.$dialog.style.setProperty("--l-dialog-width", t) : this.$dialog.style.removeProperty("--l-dialog-width") : e === "close" && this.applyClose(t);
63
66
  }
64
67
  }
65
68
  setProps(e) {
@@ -69,5 +72,4 @@ var s = class {
69
72
  this.$container && (e ? this.$container.setAttribute("confirm-loading", "") : this.$container.removeAttribute("confirm-loading"));
70
73
  }
71
74
  };
72
- //#endregion
73
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;