@qingwu-ui/select 0.9.0-beta.5 → 1.0.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.
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @qingwu-ui/select
2
2
 
3
+ 查看源码、反馈问题或参与贡献。 [GitHub](https://github.com/apricotdream/qingwu-ui) · [Gitee](https://gitee.com/apricotdream/qingwu-ui)
4
+
3
5
  [青梧UI](https://github.com/apricotdream/qingwu-ui) 的 **下拉选择器组件** —— 框架无关,纯 DOM + CSS,零依赖。
4
6
 
5
7
  - **手风琴错峰动画**:打开面板时选项像琴键一样逐项按下(stagger 级联 + 弹性回弹),向上展开时反向级联
package/dist/index.cjs CHANGED
@@ -176,6 +176,7 @@ var Select = class {
176
176
  this.panel.id = `qsel-panel-${++UID}`;
177
177
  this.panel.setAttribute("role", "listbox");
178
178
  this.panel.setAttribute("aria-label", ariaLabel);
179
+ this.trigger.setAttribute("aria-controls", this.panel.id);
179
180
  this.list = el("ul", "qsel-list");
180
181
  this.panel.append(this.list);
181
182
  const hoverBar = el("div", "qsel-hover-bar");
@@ -210,7 +211,7 @@ var Select = class {
210
211
  this.options.forEach((opt, i) => {
211
212
  const li = el("li", "qsel-opt");
212
213
  li.dataset.index = String(i);
213
- li.id = `qsel-opt-${i}`;
214
+ li.id = `${this.panel.id}-opt-${i}`;
214
215
  li.setAttribute("role", "option");
215
216
  li.setAttribute("aria-selected", String(opt.value === this.displayValue));
216
217
  if (opt.disabled) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/select.ts"],"mappings":";;;UAGiB;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;;UAIe;;EAEf,UAAU;;EAEV;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA,gBAAgB;;EAEhB,YAAY,sBAAsB,QAAQ;;;;cCX/B;UACH;UACA;UACA;UACA;mBACS;mBACA;mBACA;mBACA;mBACA;UACT;mBACS;UACT;mBACS;mBACA;mBAEA;UACT;UAEA;UACA;UACA;UACA;UACA;UACA;UAEA;UACA;UACA;UACA;UAEA;UACA;EAER,YAAY,MAAM,aAAa,OAAM;UA4B7B;UAiEA;;UA+BA;UAIA;cAMI;;EAKZ;;EAgCA;;EAoCA;;UAKQ;;UASA;;UAYA;;UAuDA;UAWA;UAYA;UAeA;;UA+CA;UAWA;UAIA;UAQA;UAKA;;MAiBJ;;MAKA;;EAKJ,OAAO,OAAO,QAAQ;;EAoCtB,SAAS;;EAKT,YAAY;;EAQZ"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/select.ts"],"mappings":";;;UAGiB;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;;UAIe;;EAEf,UAAU;;EAEV;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA,gBAAgB;;EAEhB,YAAY,sBAAsB,QAAQ;;;;cCX/B;UACH;UACA;UACA;UACA;mBACS;mBACA;mBACA;mBACA;mBACA;UACT;mBACS;UACT;mBACS;mBACA;mBAEA;UACT;UAEA;UACA;UACA;UACA;UACA;UACA;UAEA;UACA;UACA;UACA;UAEA;UACA;EAER,YAAY,MAAM,aAAa,OAAM;UA4B7B;UAkEA;;UA+BA;UAIA;cAMI;;EAKZ;;EAgCA;;EAoCA;;UAKQ;;UASA;;UAYA;;UAuDA;UAWA;UAYA;UAeA;;UA+CA;UAWA;UAIA;UAQA;UAKA;;MAiBJ;;MAKA;;EAKJ,OAAO,OAAO,QAAQ;;EAoCtB,SAAS;;EAKT,YAAY;;EAQZ"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/select.ts"],"mappings":";;;UAGiB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+CA;UAWA;UAIA;UAQA;UAKA;;MAiBJ;;MAKA;;EAKJ,OAAO,OAAO,QAAQ;;EAoCtB,SAAS;;EAKT,YAAY;;EAQZ"}
package/dist/index.mjs CHANGED
@@ -175,6 +175,7 @@ var Select = class {
175
175
  this.panel.id = `qsel-panel-${++UID}`;
176
176
  this.panel.setAttribute("role", "listbox");
177
177
  this.panel.setAttribute("aria-label", ariaLabel);
178
+ this.trigger.setAttribute("aria-controls", this.panel.id);
178
179
  this.list = el("ul", "qsel-list");
179
180
  this.panel.append(this.list);
180
181
  const hoverBar = el("div", "qsel-hover-bar");
@@ -209,7 +210,7 @@ var Select = class {
209
210
  this.options.forEach((opt, i) => {
210
211
  const li = el("li", "qsel-opt");
211
212
  li.dataset.index = String(i);
212
- li.id = `qsel-opt-${i}`;
213
+ li.id = `${this.panel.id}-opt-${i}`;
213
214
  li.setAttribute("role", "option");
214
215
  li.setAttribute("aria-selected", String(opt.value === this.displayValue));
215
216
  if (opt.disabled) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../icon/icons.ts","../src/select.ts"],"sourcesContent":["/* ============================================================\n 青梧 UI · 图标库\n ============================================================\n 零依赖 · 纯字符串常量 · tree-shakeable named exports\n 所有图标统一使用:viewBox=\"0 0 24 24\", stroke=\"currentColor\",\n stroke-width=\"2\", stroke-linecap=\"round\", stroke-linejoin=\"round\".\n\n 使用方式:\n import { ICON_CALENDAR, ICON_SEARCH } from \"@/icon/icons\";\n element.innerHTML = ICON_CALENDAR;\n 或者通过 dangerouslySetInnerHTML 渲染。\n ============================================================ */\n\nconst S = (d: string) =>\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">${d}</svg>`;\n\nconst S16 = (d: string) =>\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">${d}</svg>`;\n\nconst S18 = (d: string) =>\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">${d}</svg>`;\n\nconst S20 = (d: string) =>\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">${d}</svg>`;\n\nconst S36 = (d: string) =>\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">${d}</svg>`;\n\n/* ---- 通用 UI 图标 ---- */\n\nexport const ICON_CALENDAR = S(\n '<rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\"/><path d=\"M8 2v4M16 2v4M3 10h18\"/>',\n);\n\nexport const ICON_CALENDAR_DOT = S(\n '<rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\"/><line x1=\"16\" y1=\"2\" x2=\"16\" y2=\"6\"/><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"6\"/><line x1=\"3\" y1=\"10\" x2=\"21\" y2=\"10\"/><line x1=\"8\" y1=\"14\" x2=\"8.01\" y2=\"14\"/>',\n);\n\nexport const ICON_SEARCH = S('<circle cx=\"11\" cy=\"11\" r=\"8\"/><path d=\"m21 21-4.35-4.35\"/>');\n\nexport const ICON_UPLOAD = S(\n '<path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"/><polyline points=\"17 8 12 3 7 8\"/><line x1=\"12\" y1=\"3\" x2=\"12\" y2=\"15\"/>',\n);\n\nexport const ICON_UPLOAD_ARROW = S(\n '<path d=\"M12 16V4\"/><path d=\"m6 9 6-5 6 5\"/><path d=\"M4 20h16\"/>',\n);\n\nexport const ICON_MENU = S('<path d=\"M3 7h18M3 12h18M3 17h18\"/>');\n\nexport const ICON_BELL = S(\n '<path d=\"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9\"/><path d=\"M10.3 21a1.94 1.94 0 0 0 3.4 0\"/>',\n);\n\nexport const ICON_CLOSE = S(\n '<line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"/><line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"/>',\n);\n\nexport const ICON_CHECK = S('<polyline points=\"20 6 9 17 4 12\"/>');\n\nexport const ICON_PLUS = S(\n '<line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"/><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/>',\n);\n\nexport const ICON_MINUS = S('<line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/>');\n\nexport const ICON_BOX = S(\n '<path d=\"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z\"/>',\n);\n\nexport const ICON_EDIT = S(\n '<path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"/><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"/>',\n);\n\nexport const ICON_FILE = S(\n '<path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"/><polyline points=\"14 2 14 8 20 8\"/>',\n);\n\nexport const ICON_FOLDER = S(\n '<path d=\"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z\"/>',\n);\n\nexport const ICON_INFO = S(\n '<circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"12\" y1=\"16\" x2=\"12\" y2=\"12\"/><line x1=\"12\" y1=\"8\" x2=\"12.01\" y2=\"8\"/>',\n);\n\nexport const ICON_WARNING = S(\n '<path d=\"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\"/><line x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\"/><line x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\"/>',\n);\n\nexport const ICON_TRASH = S(\n '<polyline points=\"3 6 5 6 21 6\"/><path d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\"/><line x1=\"10\" y1=\"11\" x2=\"10\" y2=\"17\"/><line x1=\"14\" y1=\"11\" x2=\"14\" y2=\"17\"/>',\n);\n\nexport const ICON_DOWNLOAD = S(\n '<path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"/><polyline points=\"7 10 12 15 17 10\"/><line x1=\"12\" y1=\"15\" x2=\"12\" y2=\"3\"/>',\n);\n\nexport const ICON_COPY = S(\n '<rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\"/><path d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\"/>',\n);\n\nexport const ICON_EYE = S(\n '<path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/>',\n);\n\nexport const ICON_STAR = S(\n '<polygon points=\"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2\"/>',\n);\n\nexport const ICON_STAR_FILLED = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\" stroke=\"none\" aria-hidden=\"true\"><polygon points=\"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2\"/></svg>`;\n\nexport const ICON_BOOKMARK = S('<path d=\"M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z\"/>');\n\nexport const ICON_EXTERNAL_LINK = S(\n '<path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\"/><polyline points=\"15 3 21 3 21 9\"/><line x1=\"10\" y1=\"14\" x2=\"21\" y2=\"3\"/>',\n);\nexport const ICON_GITHUB = S(\n '<path d=\"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4\"/><path d=\"M9 18c-4.51 2-5-2-7-2\"/>',\n);\n\n/* ---- 导航箭头 ---- */\n\nexport const ICON_CHEVRON_LEFT = S16('<path d=\"m15 18-6-6 6-6\"/>');\nexport const ICON_CHEVRON_RIGHT = S16('<path d=\"m9 18 6-6-6-6\"/>');\nexport const ICON_CHEVRON_UP = S('<polyline points=\"18 15 12 9 6 15\"/>');\nexport const ICON_CHEVRON_DOWN = S('<polyline points=\"6 9 12 15 18 9\"/>');\nexport const ICON_CODE = S(\n '<polyline points=\"16 18 22 12 16 6\"/><polyline points=\"8 6 2 12 8 18\"/>',\n);\n\n/* ---- 全屏 ---- */\n\nexport const ICON_FULLSCREEN = S(\n '<polyline points=\"15 3 21 3 21 9\"/><polyline points=\"9 21 3 21 3 15\"/><line x1=\"21\" y1=\"3\" x2=\"14\" y2=\"10\"/><line x1=\"3\" y1=\"21\" x2=\"10\" y2=\"14\"/>',\n);\nexport const ICON_FULLSCREEN_EXIT = S(\n '<polyline points=\"4 8 4 3 9 3\"/><polyline points=\"20 16 20 21 15 21\"/><line x1=\"4\" y1=\"3\" x2=\"11\" y2=\"10\"/><line x1=\"20\" y1=\"21\" x2=\"13\" y2=\"14\"/>',\n);\n\n/* ---- 功能图标 ---- */\n\nexport const ICON_CLOCK = S('<circle cx=\"12\" cy=\"12\" r=\"10\"/><path d=\"M12 6v6l4 2\"/>');\nexport const ICON_TYPE = S(\n '<polyline points=\"4 7 4 4 20 4 20 7\"/><line x1=\"9\" y1=\"20\" x2=\"15\" y2=\"20\"/><line x1=\"12\" y1=\"4\" x2=\"12\" y2=\"20\"/>',\n);\nexport const ICON_USERS = S(\n '<path d=\"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2\"/><circle cx=\"9\" cy=\"7\" r=\"4\"/><path d=\"M23 21v-2a4 4 0 0 0-3-3.87\"/><path d=\"M16 3.13a4 4 0 0 1 0 7.75\"/>',\n);\nexport const ICON_MICROPHONE = S(\n '<path d=\"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z\"/><path d=\"M19 10v2a7 7 0 0 1-14 0v-2\"/><line x1=\"12\" y1=\"19\" x2=\"12\" y2=\"23\"/><line x1=\"8\" y1=\"23\" x2=\"16\" y2=\"23\"/>',\n);\nexport const ICON_MUSIC = S(\n '<path d=\"M9 18V5l12-2v13\"/><circle cx=\"6\" cy=\"18\" r=\"3\"/><circle cx=\"18\" cy=\"16\" r=\"3\"/>',\n);\nexport const ICON_VIDEO = S(\n '<polygon points=\"23 7 16 12 23 17 23 7\"/><rect x=\"1\" y=\"5\" width=\"15\" height=\"14\" rx=\"2\" ry=\"2\"/>',\n);\nexport const ICON_IMAGE = S(\n '<rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\"/><circle cx=\"8.5\" cy=\"8.5\" r=\"1.5\"/><polyline points=\"21 15 16 10 5 21\"/>',\n);\n\n/* ---- 主题 ---- */\n\nexport const ICON_SUN = S(\n '<circle cx=\"12\" cy=\"12\" r=\"5\"/><line x1=\"12\" y1=\"1\" x2=\"12\" y2=\"3\"/><line x1=\"12\" y1=\"21\" x2=\"12\" y2=\"23\"/><line x1=\"4.22\" y1=\"4.22\" x2=\"5.64\" y2=\"5.64\"/><line x1=\"18.36\" y1=\"18.36\" x2=\"19.78\" y2=\"19.78\"/><line x1=\"1\" y1=\"12\" x2=\"3\" y2=\"12\"/><line x1=\"21\" y1=\"12\" x2=\"23\" y2=\"12\"/><line x1=\"4.22\" y1=\"19.78\" x2=\"5.64\" y2=\"18.36\"/><line x1=\"18.36\" y1=\"5.64\" x2=\"19.78\" y2=\"4.22\"/>',\n);\nexport const ICON_MOON = S('<path d=\"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z\"/>');\n\n/* ---- 侧边栏 ---- */\n\nexport const ICON_SIDEBAR_TOGGLE = S(\n '<rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\"/><path d=\"M9 3v18\"/><path d=\"m14 9-3 3 3 3\"/>',\n);\n\n/* ---- 编辑器图标 ---- */\n\nexport const ICON_LIST = S(\n '<line x1=\"8\" y1=\"6\" x2=\"21\" y2=\"6\"/><line x1=\"8\" y1=\"12\" x2=\"21\" y2=\"12\"/><line x1=\"8\" y1=\"18\" x2=\"21\" y2=\"18\"/><line x1=\"3\" y1=\"6\" x2=\"3.01\" y2=\"6\"/><line x1=\"3\" y1=\"12\" x2=\"3.01\" y2=\"12\"/><line x1=\"3\" y1=\"18\" x2=\"3.01\" y2=\"18\"/>',\n);\nexport const ICON_AI = S(\n '<path d=\"M12 2l2.4 7.2h7.6l-6 4.8 2.4 7.2-6.4-4.8-6.4 4.8 2.4-7.2-6-4.8h7.6z\"/>',\n);\nexport const ICON_BOLT = S('<polygon points=\"13 2 3 14 12 14 11 22 21 10 12 10 13 2\"/>');\nexport const ICON_REFRESH = S(\n '<polyline points=\"23 4 23 10 17 10\"/><polyline points=\"1 20 1 14 7 14\"/><path d=\"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15\"/>',\n);\nexport const ICON_RETRY = S(\n '<polyline points=\"1 4 1 10 7 10\"/><path d=\"M3.51 15a9 9 0 1 0 2.13-9.36L1 10\"/>',\n);\nexport const ICON_SETTINGS = S(\n '<circle cx=\"12\" cy=\"12\" r=\"3\"/><path d=\"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z\"/>',\n);\nexport const ICON_HISTORY = S(\n '<path d=\"M3 3v5h5\"/><path d=\"M3.05 13A9 9 0 1 0 6.11 6.11L3 8\"/><path d=\"M12 7v5l4 2\"/>',\n);\nexport const ICON_PUSH = S(\n '<line x1=\"22\" y1=\"2\" x2=\"11\" y2=\"13\"/><polygon points=\"22 2 15 22 11 13 2 9 22 2\"/>',\n);\nexport const ICON_TRANSLATE = S(\n '<path d=\"M5 8l6 6\"/><path d=\"M4 14l6-6 2-3\"/><path d=\"M2 5h12\"/><path d=\"M7 2h1\"/><path d=\"M22 22l-5-10-5 10\"/><path d=\"M14 18h6\"/>',\n);\nexport const ICON_SUMMARY = S(\n '<path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"/><polyline points=\"14 2 14 8 20 8\"/><line x1=\"16\" y1=\"13\" x2=\"8\" y2=\"13\"/><line x1=\"16\" y1=\"17\" x2=\"8\" y2=\"17\"/><polyline points=\"10 9 9 9 8 9\"/>',\n);\nexport const ICON_RENAME = S('<path d=\"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z\"/>');\nexport const ICON_SELECTION = S(\n '<circle cx=\"12\" cy=\"12\" r=\"1\"/><path d=\"M20 12a8 8 0 1 1-8-8\"/><path d=\"m16 2 4 4-4 4\"/>',\n);\nexport const ICON_TAG = S(\n '<path d=\"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z\"/><line x1=\"7\" y1=\"7\" x2=\"7.01\" y2=\"7\"/>',\n);\nexport const ICON_GRIP = S(\n '<circle cx=\"9\" cy=\"12\" r=\"1\"/><circle cx=\"15\" cy=\"12\" r=\"1\"/><circle cx=\"9\" cy=\"6\" r=\"1\"/><circle cx=\"15\" cy=\"6\" r=\"1\"/><circle cx=\"9\" cy=\"18\" r=\"1\"/><circle cx=\"15\" cy=\"18\" r=\"1\"/>',\n);\nexport const ICON_DIAGRAM = S(\n '<rect x=\"2\" y=\"2\" width=\"8\" height=\"8\" rx=\"1\"/><rect x=\"14\" y=\"2\" width=\"8\" height=\"8\" rx=\"1\"/><rect x=\"2\" y=\"14\" width=\"8\" height=\"8\" rx=\"1\"/><rect x=\"14\" y=\"14\" width=\"8\" height=\"8\" rx=\"1\"/>',\n);\nexport const ICON_LANGUAGE = S(\n '<circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"2\" y1=\"12\" x2=\"22\" y2=\"12\"/><path d=\"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z\"/>',\n);\nexport const ICON_PAPERCLIP = S(\n '<path d=\"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48\"/>',\n);\nexport const ICON_BROKEN_IMAGE =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><rect x=\"2\" y=\"2\" width=\"20\" height=\"20\" rx=\"2\"/><path d=\"M2 14l4-4 4 4 4-4 4 4 4-4\"/><path d=\"M6 6h.01M18 6h.01\"/></svg>';\n\n/* ---- 包级别图标(用于 upload/search/calendar 包) ---- */\n\nexport const ICO_UPLOAD = S36('<path d=\"M12 16V4\"/><path d=\"m6 9 6-5 6 5\"/><path d=\"M4 20h16\"/>');\nconst S18c = (d: string) =>\n `<svg class=\"qs-ico\" xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">${d}</svg>`;\n\nconst S20c = (d: string) =>\n `<svg class=\"qw-cal-svg\" xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">${d}</svg>`;\n\nexport const ICO_SEARCH = S18c('<circle cx=\"11\" cy=\"11\" r=\"7\"/><path d=\"m20 20-3.2-3.2\"/>');\nexport const ICO_MENU = S18('<path d=\"M4 7h16M4 12h16M4 17h16\"/>');\nexport const ICO_CALENDAR = S20c(\n '<rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\"/><path d=\"M8 2v4M16 2v4M3 10h18\"/>',\n);\nexport const ICO_ARROW_LEFT = S16('<path d=\"m15 18-6-6 6-6\"/>');\nexport const ICO_ARROW_RIGHT = S16('<path d=\"m9 18 6-6-6-6\"/>');\n\n/* ---- 搜索插图(大尺寸 art) ---- */\n\nexport const SEARCH_ART =\n '<svg viewBox=\"0 0 160 140\" role=\"img\" aria-label=\"Search illustration\">' +\n '<ellipse class=\"qs-art-shadow\" cx=\"80\" cy=\"124\" rx=\"46\" ry=\"6\"/>' +\n '<g class=\"qs-art-float\">' +\n '<rect class=\"qs-art-paper\" x=\"40\" y=\"20\" width=\"80\" height=\"82\" rx=\"13\"/>' +\n '<line class=\"qs-art-row-accent\" x1=\"54\" y1=\"42\" x2=\"92\" y2=\"42\"/>' +\n '<line class=\"qs-art-row\" x1=\"54\" y1=\"56\" x2=\"106\" y2=\"56\"/>' +\n '<line class=\"qs-art-row\" x1=\"54\" y1=\"70\" x2=\"84\" y2=\"70\"/>' +\n '<circle class=\"qs-art-glass\" cx=\"96\" cy=\"86\" r=\"23\"/>' +\n '<line class=\"qs-art-handle\" x1=\"113\" y1=\"103\" x2=\"129\" y2=\"119\"/>' +\n '<text class=\"qs-art-seal\" x=\"96\" y=\"94\" text-anchor=\"middle\" font-size=\"24\">寻</text>' +\n \"</g>\" +\n '<circle class=\"qs-art-dot-a qs-art-twinkle\" cx=\"34\" cy=\"32\" r=\"3\"/>' +\n '<circle class=\"qs-art-dot-b qs-art-twinkle\" cx=\"126\" cy=\"40\" r=\"2.6\" style=\"animation-delay:.8s\"/>' +\n '<circle class=\"qs-art-dot-c qs-art-twinkle\" cx=\"30\" cy=\"98\" r=\"2.4\" style=\"animation-delay:1.5s\"/>' +\n \"</svg>\";\n","/** 青梧UI 下拉选择器:单选 · 错峰动画 · 自适应翻转 · 零依赖纯 DOM + ARIA */\n\nimport { ICON_CHECK, ICON_CHEVRON_DOWN } from \"../../../icon/icons\";\nimport type { SelectOption, SelectOptions } from \"./types\";\n\nconst PREFERS_REDUCED =\n typeof window !== \"undefined\" && typeof window.matchMedia === \"function\"\n ? window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches\n : false;\n\nconst HTML_ESCAPES: Record<string, string> = {\n \"&\": \"&amp;\",\n \"<\": \"&lt;\",\n \">\": \"&gt;\",\n '\"': \"&quot;\",\n};\n\nfunction escapeHTML(s: string): string {\n return s.replace(/[&<>\"]/g, (c) => HTML_ESCAPES[c] ?? c);\n}\n\nfunction el(tag: string, cls?: string, html?: string): HTMLElement {\n const n = document.createElement(tag);\n if (cls) n.className = cls;\n if (html != null) n.innerHTML = html;\n return n;\n}\n\nlet UID = 0;\n\n/** 活动项索引归一化:越界 / 负数 → null */\nfunction normalizeIndex(v: number | null | undefined, len?: number): number | null {\n if (v == null || v < 0) return null;\n if (len !== undefined && v >= len) return null;\n return v;\n}\n\n/** 同步活动项高亮类名(不重建列表) */\nfunction applyHighlightClass(list: HTMLUListElement, idx: number | null): void {\n list.querySelectorAll<HTMLElement>(\".qsel-opt\").forEach((o, i) => {\n o.classList.toggle(\"is-highlight\", i === idx);\n });\n}\n\nexport class Select {\n private root: HTMLElement;\n private options: SelectOption[];\n private placeholder: string;\n private customClass: string;\n private readonly width: \"trigger\" | \"auto\";\n private readonly duration: number;\n private readonly stagger: number;\n private readonly animate: boolean;\n private readonly maxStagger: number;\n private frosted: boolean;\n private readonly hoverCloseDelay: number;\n private activeIndex: number | null;\n private readonly onOpenChangeCb?: (open: boolean) => void;\n private readonly onChangeCb?: (value: string | null, option: SelectOption | null) => void;\n\n private readonly controlledValue: boolean;\n private displayValue: string | null;\n\n private isOpen = false;\n private isDisabled = false;\n private active = -1;\n private dir: \"down\" | \"up\" = \"down\";\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n private hoverTimer: ReturnType<typeof setTimeout> | null = null;\n\n private trigger!: HTMLButtonElement;\n private valueEl!: HTMLElement;\n private list!: HTMLUListElement;\n private panel!: HTMLElement;\n\n private onDocPointerDown: ((e: PointerEvent) => void) | null = null;\n private onWinScroll: (() => void) | null = null;\n\n constructor(root: HTMLElement, opts: SelectOptions = {}) {\n this.root = root;\n this.options = opts.options ?? [];\n this.placeholder = opts.placeholder ?? \"\";\n this.customClass = opts.className ?? \"\";\n this.width = opts.width ?? \"trigger\";\n this.duration = opts.duration ?? 380;\n this.stagger = opts.stagger ?? 28;\n this.animate = opts.animate !== false;\n this.maxStagger = opts.maxStagger ?? 12;\n this.frosted = opts.frosted !== false;\n this.hoverCloseDelay = opts.hoverCloseDelay ?? 3000;\n this.activeIndex = normalizeIndex(opts.activeIndex ?? null);\n this.onOpenChangeCb = opts.onOpenChange;\n this.onChangeCb = opts.onChange;\n\n this.controlledValue = \"value\" in opts;\n this.displayValue = opts.value ?? opts.defaultValue ?? null;\n this.isDisabled = opts.disabled === true;\n\n this.build(opts);\n\n if (opts.open === true || (opts.defaultOpen === true && opts.open == null)) {\n this.open();\n }\n }\n\n /* 一次性创建全部 DOM */\n private build(opts: SelectOptions): void {\n const ariaLabel = opts.ariaLabel ?? (this.placeholder || \"请选择\");\n\n this.root.classList.add(\"qsel\");\n if (this.customClass) this.root.classList.add(this.customClass);\n this.root.classList.toggle(\"is-disabled\", this.isDisabled);\n\n this.trigger = el(\"button\", \"qsel-trigger\") as HTMLButtonElement;\n this.trigger.type = \"button\";\n this.trigger.setAttribute(\"role\", \"combobox\");\n this.trigger.setAttribute(\"aria-haspopup\", \"listbox\");\n this.trigger.setAttribute(\"aria-expanded\", \"false\");\n this.trigger.setAttribute(\"aria-label\", ariaLabel);\n this.trigger.disabled = this.isDisabled;\n\n this.valueEl = el(\"span\", \"qsel-value\");\n const chev = el(\"span\", \"qsel-chevron\", ICON_CHEVRON_DOWN);\n chev.setAttribute(\"aria-hidden\", \"true\");\n this.trigger.append(this.valueEl, chev);\n this.root.append(this.trigger);\n\n /* 面板(挂 body,避免宿主 transform/filter/overflow 裁剪) */\n this.panel = el(\"div\", \"qsel-panel\");\n this.panel.classList.toggle(\"is-frosted\", this.frosted);\n this.panel.hidden = true;\n this.panel.id = `qsel-panel-${++UID}`;\n this.panel.setAttribute(\"role\", \"listbox\");\n this.panel.setAttribute(\"aria-label\", ariaLabel);\n this.list = el(\"ul\", \"qsel-list\") as HTMLUListElement;\n this.panel.append(this.list);\n\n /* 悬停移出后的自动关闭倒计时进度条 */\n const hoverBar = el(\"div\", \"qsel-hover-bar\");\n hoverBar.setAttribute(\"aria-hidden\", \"true\");\n this.panel.append(hoverBar);\n\n document.body.append(this.panel);\n\n this.syncValue();\n this.renderOptions();\n\n this.trigger.addEventListener(\"click\", () => {\n if (this.isDisabled) return;\n this.isOpen ? this.close() : this.open();\n });\n this.trigger.addEventListener(\"keydown\", (e) => this.onTriggerKey(e));\n\n /* 鼠标移出触发器与面板后延迟自动关闭(relatedTarget 判断,跨元素移动不计时) */\n this.root.addEventListener(\"mouseenter\", () => this.cancelHoverClose());\n this.panel.addEventListener(\"mouseenter\", () => this.cancelHoverClose());\n this.root.addEventListener(\"mouseleave\", (e) => {\n if (!this.panel.contains(e.relatedTarget as Node)) this.scheduleHoverClose();\n });\n this.panel.addEventListener(\"mouseleave\", (e) => {\n if (!this.root.contains(e.relatedTarget as Node)) this.scheduleHoverClose();\n });\n\n /* 阻止 pointerdown,避免列表抢占焦点破坏 aria-activedescendant */\n this.list.addEventListener(\"pointerdown\", (e) => e.preventDefault());\n this.list.addEventListener(\"click\", (e) => {\n const opt = (e.target as HTMLElement).closest<HTMLElement>(\".qsel-opt\");\n if (opt) this.select(Number(opt.dataset.index));\n });\n }\n\n private renderOptions(): void {\n this.list.textContent = \"\";\n const frag = document.createDocumentFragment();\n const shouldStagger = this.shouldStagger();\n\n this.options.forEach((opt, i) => {\n const li = el(\"li\", \"qsel-opt\");\n li.dataset.index = String(i);\n li.id = `qsel-opt-${i}`;\n li.setAttribute(\"role\", \"option\");\n li.setAttribute(\"aria-selected\", String(opt.value === this.displayValue));\n if (opt.disabled) {\n li.classList.add(\"is-disabled\");\n li.setAttribute(\"aria-disabled\", \"true\");\n }\n if (shouldStagger) li.classList.add(\"is-enter\");\n if (i === this.activeIndex) li.classList.add(\"is-highlight\");\n\n const glyph = opt.glyph ?? opt.label.slice(0, 1);\n li.innerHTML =\n `<span class=\"qsel-opt-ico\">${escapeHTML(glyph)}</span>` +\n `<span class=\"qsel-opt-main\"><span class=\"qsel-opt-label\">${escapeHTML(opt.label)}</span>` +\n (opt.hint ? `<span class=\"qsel-opt-hint\">${escapeHTML(opt.hint)}</span>` : \"\") +\n `</span>` +\n `<span class=\"qsel-check\" aria-hidden=\"true\">${ICON_CHECK}</span>`;\n frag.append(li);\n });\n this.list.append(frag);\n }\n\n /** 是否启用逐项错峰动画(尊重 reduced-motion 与超大列表降级) */\n private shouldStagger(): boolean {\n return this.animate && !PREFERS_REDUCED && this.options.length <= this.maxStagger;\n }\n\n private syncValue(): void {\n const opt = this.currentOption;\n this.valueEl.textContent = opt ? opt.label : this.placeholder;\n this.valueEl.classList.toggle(\"is-placeholder\", !opt);\n }\n\n private get currentOption(): SelectOption | null {\n return this.options.find((o) => o.value === this.displayValue) ?? null;\n }\n\n /** 打开下拉面板 */\n open(): void {\n if (this.isOpen || this.isDisabled) return;\n this.isOpen = true;\n this.renderOptions();\n\n if (this.closeTimer !== null) {\n clearTimeout(this.closeTimer);\n this.closeTimer = null;\n }\n this.panel.classList.remove(\"is-closing\");\n this.panel.hidden = false;\n this.root.classList.add(\"is-open\");\n this.trigger.setAttribute(\"aria-expanded\", \"true\");\n\n this.position();\n this.setActive(this.startIndex(), false);\n this.applyStagger();\n\n requestAnimationFrame(() => this.panel.classList.add(\"is-open\"));\n\n this.onDocPointerDown = (e) => {\n if (this.isOpen && !this.root.contains(e.target as Node)) this.close();\n };\n document.addEventListener(\"pointerdown\", this.onDocPointerDown);\n this.onWinScroll = () => this.position();\n window.addEventListener(\"scroll\", this.onWinScroll, true);\n window.addEventListener(\"resize\", this.onWinScroll);\n\n this.onOpenChangeCb?.(true);\n }\n\n /** 关闭下拉面板 */\n close(): void {\n if (!this.isOpen) return;\n this.isOpen = false;\n this.cancelHoverClose();\n this.root.classList.remove(\"is-open\");\n this.panel.classList.remove(\"is-open\");\n this.panel.classList.add(\"is-closing\");\n this.trigger.setAttribute(\"aria-expanded\", \"false\");\n this.trigger.removeAttribute(\"aria-activedescendant\");\n this.active = -1;\n\n if (this.onDocPointerDown) {\n document.removeEventListener(\"pointerdown\", this.onDocPointerDown);\n this.onDocPointerDown = null;\n }\n if (this.onWinScroll) {\n window.removeEventListener(\"scroll\", this.onWinScroll, true);\n window.removeEventListener(\"resize\", this.onWinScroll);\n this.onWinScroll = null;\n }\n\n if (this.closeTimer !== null) clearTimeout(this.closeTimer);\n this.closeTimer = setTimeout(\n () => {\n if (!this.isOpen) {\n this.panel.hidden = true;\n this.panel.classList.remove(\"is-closing\");\n }\n },\n PREFERS_REDUCED ? 0 : this.duration,\n );\n\n this.onOpenChangeCb?.(false);\n }\n\n /** 切换展开状态 */\n toggle(): void {\n this.isOpen ? this.close() : this.open();\n }\n\n /** 鼠标移出后调度自动关闭(同步启动倒计时进度条动画) */\n private scheduleHoverClose(): void {\n if (!this.isOpen || this.hoverCloseDelay <= 0) return;\n if (this.hoverTimer !== null) clearTimeout(this.hoverTimer);\n this.panel.classList.add(\"is-hover-closing\");\n this.panel.style.setProperty(\"--qsel-hover-ms\", `${this.hoverCloseDelay}ms`);\n this.hoverTimer = setTimeout(() => this.close(), this.hoverCloseDelay);\n }\n\n /** 重新移入触发器或面板时取消自动关闭(进度条动画反向收起) */\n private cancelHoverClose(): void {\n if (this.hoverTimer !== null) {\n clearTimeout(this.hoverTimer);\n this.hoverTimer = null;\n }\n if (this.panel) {\n this.panel.classList.remove(\"is-hover-closing\");\n this.panel.style.removeProperty(\"--qsel-hover-ms\");\n }\n }\n\n /** 计算面板位置:宽度跟随触发器、向上/向下翻转、高度钳制到视口可用空间 */\n private position(): void {\n const tr = this.trigger.getBoundingClientRect();\n const gap = 8;\n /** 两侧空间都极度不足时,面板保留的最小高度(略溢出也比无法使用强) */\n const minPanelH = 120;\n\n this.panel.style.width = this.width === \"auto\" ? \"max-content\" : `${tr.width}px`;\n if (this.width === \"auto\") {\n this.panel.style.minWidth = `${tr.width}px`;\n }\n\n /* 隐藏态测量:决定展开方向与可用高度(不闪烁)。\n 列表自然高度取 scrollHeight——它返回内容全高,不受 CSS max-height(320px) 钳制影响\n (切勿临时把 maxHeight 置 none:position() 挂在 window scroll 捕获监听上,列表内滚动\n 会反复触发,瞬时展开会把 scrollTop 钳回 0,列表将永远滚不动) */\n this.panel.style.visibility = \"hidden\";\n const listNaturalH = this.list.scrollHeight;\n const listClientH = this.list.clientHeight;\n const panelH = this.panel.offsetHeight;\n const chrome = panelH - listClientH; // 面板边框等非列表高度(钳制前后不变)\n const panelW = this.panel.offsetWidth;\n const availBelow = window.innerHeight - tr.bottom - gap;\n const availAbove = tr.top - gap;\n\n const flipUp = availBelow < panelH && availAbove > availBelow;\n this.dir = flipUp ? \"up\" : \"down\";\n this.panel.classList.toggle(\"is-up\", flipUp);\n\n /* 展开方向也放不下时,把列表钳制到可用空间,由列表内部滚动承接,\n 保证长列表(如 24 小时选项)末项在矮视口下依然可达 */\n const avail = flipUp ? availAbove : availBelow;\n if (avail < chrome + listNaturalH) {\n const listMax = Math.max(minPanelH - chrome, Math.min(listNaturalH, avail - chrome));\n this.list.style.maxHeight = `${Math.max(0, listMax)}px`;\n } else {\n this.list.style.maxHeight = \"\";\n }\n\n let left = tr.left;\n if (this.width === \"auto\" && panelW > window.innerWidth - 16) {\n left = Math.max(8, window.innerWidth - panelW - 8);\n }\n this.panel.style.left = `${Math.max(8, left)}px`;\n\n if (flipUp) {\n this.panel.style.top = \"auto\";\n this.panel.style.bottom = `${Math.max(8, window.innerHeight - tr.top + gap)}px`;\n } else {\n this.panel.style.top = `${tr.bottom + gap}px`;\n this.panel.style.bottom = \"auto\";\n }\n this.panel.style.visibility = \"\";\n }\n\n /** 错峰动画:按展开方向给每个选项设置递增 / 递减延迟 */\n private applyStagger(): void {\n if (!this.shouldStagger()) return;\n const opts = this.list.querySelectorAll<HTMLElement>(\".qsel-opt.is-enter\");\n const n = opts.length;\n opts.forEach((o, i) => {\n const delay = this.dir === \"up\" ? (n - 1 - i) * this.stagger : i * this.stagger;\n o.style.animationDelay = `${delay}ms`;\n o.style.animationDuration = `${this.duration}ms`;\n });\n }\n\n private select(index: number): void {\n const opt = this.options[index];\n if (!opt || opt.disabled) return;\n\n if (!this.controlledValue) {\n this.displayValue = opt.value;\n this.syncValue();\n }\n this.onChangeCb?.(opt.value, opt);\n this.close();\n }\n\n private setActive(idx: number, scroll = true): void {\n const opts = this.list.querySelectorAll<HTMLElement>(\".qsel-opt\");\n if (!opts.length) return;\n this.active = Math.max(0, Math.min(idx, opts.length - 1));\n opts.forEach((o, i) => {\n const on = i === this.active;\n o.classList.toggle(\"is-active\", on);\n if (on) {\n this.trigger.setAttribute(\"aria-activedescendant\", o.id);\n if (scroll) o.scrollIntoView({ block: \"nearest\" });\n }\n });\n }\n\n /* 键盘导航(焦点保持在触发器,aria-activedescendant 指向列表) */\n private onTriggerKey(e: KeyboardEvent): void {\n if (this.isDisabled) return;\n switch (e.key) {\n case \"ArrowDown\":\n e.preventDefault();\n if (!this.isOpen) this.open();\n else this.moveActive(1);\n break;\n case \"ArrowUp\":\n e.preventDefault();\n if (!this.isOpen) this.open();\n else this.moveActive(-1);\n break;\n case \"Home\":\n if (this.isOpen) {\n e.preventDefault();\n this.moveActive(Number.MIN_SAFE_INTEGER);\n }\n break;\n case \"End\":\n if (this.isOpen) {\n e.preventDefault();\n this.moveActive(Number.MAX_SAFE_INTEGER);\n }\n break;\n case \"Enter\":\n case \" \":\n e.preventDefault();\n if (this.isOpen) {\n if (this.active >= 0) this.select(this.active);\n } else {\n this.open();\n }\n break;\n case \"Escape\":\n if (this.isOpen) {\n e.preventDefault();\n this.close();\n }\n break;\n case \"Tab\":\n if (this.isOpen) this.close();\n break;\n }\n }\n\n /** 在可用选项中移动(跳过禁用项,支持环绕) */\n private nextEnabled(from: number, dir: 1 | -1): number {\n const n = this.options.length;\n if (!n) return -1;\n for (let step = 1; step <= n; step++) {\n const i = (from + dir * step + n) % n;\n const o = this.options[i];\n if (o && !o.disabled) return i;\n }\n return -1;\n }\n\n private firstEnabled(): number {\n return this.options.findIndex((o) => !o.disabled);\n }\n\n private lastEnabled(): number {\n for (let i = this.options.length - 1; i >= 0; i--) {\n const o = this.options[i];\n if (o && !o.disabled) return i;\n }\n return -1;\n }\n\n private startIndex(): number {\n const idx = this.options.findIndex((o) => o.value === this.displayValue && !o.disabled);\n return idx >= 0 ? idx : this.firstEnabled();\n }\n\n private moveActive(delta: number): void {\n if (delta === Number.MIN_SAFE_INTEGER) {\n const i = this.firstEnabled();\n if (i >= 0) this.setActive(i);\n return;\n }\n if (delta === Number.MAX_SAFE_INTEGER) {\n const i = this.lastEnabled();\n if (i >= 0) this.setActive(i);\n return;\n }\n const from = this.active < 0 ? this.startIndex() : this.active;\n const next = this.nextEnabled(from, delta > 0 ? 1 : -1);\n if (next >= 0) this.setActive(next);\n }\n\n /** 当前选中值(无选中为 null) */\n get value(): string | null {\n return this.displayValue;\n }\n\n /** 是否展开 */\n get expanded(): boolean {\n return this.isOpen;\n }\n\n /** 外部同步 / 更新配置。value 同步显示但不触发 onChange(UI 选择才会回调) */\n update(patch: Partial<SelectOptions>): void {\n if (\"options\" in patch && patch.options) {\n this.options = patch.options;\n this.activeIndex = normalizeIndex(this.activeIndex, this.options.length);\n this.renderOptions();\n this.syncValue();\n }\n if (\"activeIndex\" in patch) {\n this.activeIndex = normalizeIndex(patch.activeIndex, this.options.length);\n applyHighlightClass(this.list, this.activeIndex);\n }\n if (\"value\" in patch) {\n this.displayValue = patch.value ?? null;\n this.syncValue();\n if (this.isOpen) this.renderOptions();\n }\n if (\"disabled\" in patch && patch.disabled !== undefined) {\n this.setDisabled(patch.disabled);\n }\n if (\"open\" in patch && patch.open !== undefined) {\n patch.open ? this.open() : this.close();\n }\n if (\"placeholder\" in patch && patch.placeholder !== undefined) {\n this.placeholder = patch.placeholder;\n this.syncValue();\n }\n if (\"ariaLabel\" in patch && patch.ariaLabel !== undefined) {\n this.trigger.setAttribute(\"aria-label\", patch.ariaLabel);\n }\n if (\"frosted\" in patch && patch.frosted !== undefined) {\n this.frosted = patch.frosted;\n this.panel.classList.toggle(\"is-frosted\", this.frosted);\n }\n }\n\n /** 程序化选中(等价 update({ value })) */\n setValue(value: string | null): void {\n this.update({ value });\n }\n\n /** 动态切换整体禁用 */\n setDisabled(v: boolean): void {\n this.isDisabled = v;\n this.root.classList.toggle(\"is-disabled\", v);\n this.trigger.disabled = v;\n if (v) this.close();\n }\n\n /** 销毁组件,清空宿主容器并移除 body 上的面板 */\n destroy(): void {\n if (this.closeTimer !== null) clearTimeout(this.closeTimer);\n this.cancelHoverClose();\n this.close();\n this.panel.remove();\n this.root.classList.remove(\"qsel\", \"is-open\", \"is-disabled\");\n if (this.customClass) this.root.classList.remove(this.customClass);\n this.root.textContent = \"\";\n }\n}\n"],"mappings":";AAaA,MAAM,KAAK,MACT,2MAA2M,EAAE;AAE/M,MAAM,OAAO,MACX,2MAA2M,EAAE;AAE/M,MAA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CACpB;;CAGA,UAAgB;EACd,IAAI,KAAK,eAAe,MAAM,aAAa,KAAK,UAAU;EAC1D,KAAK,iBAAiB;EACtB,KAAK,MAAM;EACX,KAAK,MAAM,OAAO;EAClB,KAAK,KAAK,UAAU,OAAO,QAAQ,WAAW,aAAa;EAC3D,IAAI,KAAK,aAAa,KAAK,KAAK,UAAU,OAAO,KAAK,WAAW;EACjE,KAAK,KAAK,cAAc;CAC1B;AACF"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../icon/icons.ts","../src/select.ts"],"sourcesContent":["/* ============================================================\n 青梧 UI · 图标库\n ============================================================\n 零依赖 · 纯字符串常量 · tree-shakeable named exports\n 所有图标统一使用:viewBox=\"0 0 24 24\", stroke=\"currentColor\",\n stroke-width=\"2\", stroke-linecap=\"round\", stroke-linejoin=\"round\".\n\n 使用方式:\n import { ICON_CALENDAR, ICON_SEARCH } from \"@/icon/icons\";\n element.innerHTML = ICON_CALENDAR;\n 或者通过 dangerouslySetInnerHTML 渲染。\n ============================================================ */\n\nconst S = (d: string) =>\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">${d}</svg>`;\n\nconst S16 = (d: string) =>\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">${d}</svg>`;\n\nconst S18 = (d: string) =>\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">${d}</svg>`;\n\nconst S20 = (d: string) =>\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">${d}</svg>`;\n\nconst S36 = (d: string) =>\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">${d}</svg>`;\n\n/* ---- 通用 UI 图标 ---- */\n\nexport const ICON_CALENDAR = S(\n '<rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\"/><path d=\"M8 2v4M16 2v4M3 10h18\"/>',\n);\n\nexport const ICON_CALENDAR_DOT = S(\n '<rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\"/><line x1=\"16\" y1=\"2\" x2=\"16\" y2=\"6\"/><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"6\"/><line x1=\"3\" y1=\"10\" x2=\"21\" y2=\"10\"/><line x1=\"8\" y1=\"14\" x2=\"8.01\" y2=\"14\"/>',\n);\n\nexport const ICON_SEARCH = S('<circle cx=\"11\" cy=\"11\" r=\"8\"/><path d=\"m21 21-4.35-4.35\"/>');\n\nexport const ICON_UPLOAD = S(\n '<path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"/><polyline points=\"17 8 12 3 7 8\"/><line x1=\"12\" y1=\"3\" x2=\"12\" y2=\"15\"/>',\n);\n\nexport const ICON_UPLOAD_ARROW = S(\n '<path d=\"M12 16V4\"/><path d=\"m6 9 6-5 6 5\"/><path d=\"M4 20h16\"/>',\n);\n\nexport const ICON_MENU = S('<path d=\"M3 7h18M3 12h18M3 17h18\"/>');\n\nexport const ICON_BELL = S(\n '<path d=\"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9\"/><path d=\"M10.3 21a1.94 1.94 0 0 0 3.4 0\"/>',\n);\n\nexport const ICON_CLOSE = S(\n '<line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"/><line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"/>',\n);\n\nexport const ICON_CHECK = S('<polyline points=\"20 6 9 17 4 12\"/>');\n\nexport const ICON_PLUS = S(\n '<line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"/><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/>',\n);\n\nexport const ICON_MINUS = S('<line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/>');\n\nexport const ICON_BOX = S(\n '<path d=\"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z\"/>',\n);\n\nexport const ICON_EDIT = S(\n '<path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"/><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"/>',\n);\n\nexport const ICON_FILE = S(\n '<path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"/><polyline points=\"14 2 14 8 20 8\"/>',\n);\n\nexport const ICON_FOLDER = S(\n '<path d=\"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z\"/>',\n);\n\nexport const ICON_INFO = S(\n '<circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"12\" y1=\"16\" x2=\"12\" y2=\"12\"/><line x1=\"12\" y1=\"8\" x2=\"12.01\" y2=\"8\"/>',\n);\n\nexport const ICON_WARNING = S(\n '<path d=\"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\"/><line x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\"/><line x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\"/>',\n);\n\nexport const ICON_TRASH = S(\n '<polyline points=\"3 6 5 6 21 6\"/><path d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\"/><line x1=\"10\" y1=\"11\" x2=\"10\" y2=\"17\"/><line x1=\"14\" y1=\"11\" x2=\"14\" y2=\"17\"/>',\n);\n\nexport const ICON_DOWNLOAD = S(\n '<path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"/><polyline points=\"7 10 12 15 17 10\"/><line x1=\"12\" y1=\"15\" x2=\"12\" y2=\"3\"/>',\n);\n\nexport const ICON_COPY = S(\n '<rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\"/><path d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\"/>',\n);\n\nexport const ICON_EYE = S(\n '<path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/>',\n);\n\nexport const ICON_STAR = S(\n '<polygon points=\"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2\"/>',\n);\n\nexport const ICON_STAR_FILLED = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\" stroke=\"none\" aria-hidden=\"true\"><polygon points=\"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2\"/></svg>`;\n\nexport const ICON_BOOKMARK = S('<path d=\"M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z\"/>');\n\nexport const ICON_EXTERNAL_LINK = S(\n '<path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\"/><polyline points=\"15 3 21 3 21 9\"/><line x1=\"10\" y1=\"14\" x2=\"21\" y2=\"3\"/>',\n);\nexport const ICON_GITHUB = S(\n '<path d=\"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4\"/><path d=\"M9 18c-4.51 2-5-2-7-2\"/>',\n);\n\n/* ---- 导航箭头 ---- */\n\nexport const ICON_CHEVRON_LEFT = S16('<path d=\"m15 18-6-6 6-6\"/>');\nexport const ICON_CHEVRON_RIGHT = S16('<path d=\"m9 18 6-6-6-6\"/>');\nexport const ICON_CHEVRON_UP = S('<polyline points=\"18 15 12 9 6 15\"/>');\nexport const ICON_CHEVRON_DOWN = S('<polyline points=\"6 9 12 15 18 9\"/>');\nexport const ICON_CODE = S(\n '<polyline points=\"16 18 22 12 16 6\"/><polyline points=\"8 6 2 12 8 18\"/>',\n);\n\n/* ---- 全屏 ---- */\n\nexport const ICON_FULLSCREEN = S(\n '<polyline points=\"15 3 21 3 21 9\"/><polyline points=\"9 21 3 21 3 15\"/><line x1=\"21\" y1=\"3\" x2=\"14\" y2=\"10\"/><line x1=\"3\" y1=\"21\" x2=\"10\" y2=\"14\"/>',\n);\nexport const ICON_FULLSCREEN_EXIT = S(\n '<polyline points=\"4 8 4 3 9 3\"/><polyline points=\"20 16 20 21 15 21\"/><line x1=\"4\" y1=\"3\" x2=\"11\" y2=\"10\"/><line x1=\"20\" y1=\"21\" x2=\"13\" y2=\"14\"/>',\n);\n\n/* ---- 功能图标 ---- */\n\nexport const ICON_CLOCK = S('<circle cx=\"12\" cy=\"12\" r=\"10\"/><path d=\"M12 6v6l4 2\"/>');\nexport const ICON_TYPE = S(\n '<polyline points=\"4 7 4 4 20 4 20 7\"/><line x1=\"9\" y1=\"20\" x2=\"15\" y2=\"20\"/><line x1=\"12\" y1=\"4\" x2=\"12\" y2=\"20\"/>',\n);\nexport const ICON_USERS = S(\n '<path d=\"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2\"/><circle cx=\"9\" cy=\"7\" r=\"4\"/><path d=\"M23 21v-2a4 4 0 0 0-3-3.87\"/><path d=\"M16 3.13a4 4 0 0 1 0 7.75\"/>',\n);\nexport const ICON_MICROPHONE = S(\n '<path d=\"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z\"/><path d=\"M19 10v2a7 7 0 0 1-14 0v-2\"/><line x1=\"12\" y1=\"19\" x2=\"12\" y2=\"23\"/><line x1=\"8\" y1=\"23\" x2=\"16\" y2=\"23\"/>',\n);\nexport const ICON_MUSIC = S(\n '<path d=\"M9 18V5l12-2v13\"/><circle cx=\"6\" cy=\"18\" r=\"3\"/><circle cx=\"18\" cy=\"16\" r=\"3\"/>',\n);\nexport const ICON_VIDEO = S(\n '<polygon points=\"23 7 16 12 23 17 23 7\"/><rect x=\"1\" y=\"5\" width=\"15\" height=\"14\" rx=\"2\" ry=\"2\"/>',\n);\nexport const ICON_IMAGE = S(\n '<rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\"/><circle cx=\"8.5\" cy=\"8.5\" r=\"1.5\"/><polyline points=\"21 15 16 10 5 21\"/>',\n);\n\n/* ---- 主题 ---- */\n\nexport const ICON_SUN = S(\n '<circle cx=\"12\" cy=\"12\" r=\"5\"/><line x1=\"12\" y1=\"1\" x2=\"12\" y2=\"3\"/><line x1=\"12\" y1=\"21\" x2=\"12\" y2=\"23\"/><line x1=\"4.22\" y1=\"4.22\" x2=\"5.64\" y2=\"5.64\"/><line x1=\"18.36\" y1=\"18.36\" x2=\"19.78\" y2=\"19.78\"/><line x1=\"1\" y1=\"12\" x2=\"3\" y2=\"12\"/><line x1=\"21\" y1=\"12\" x2=\"23\" y2=\"12\"/><line x1=\"4.22\" y1=\"19.78\" x2=\"5.64\" y2=\"18.36\"/><line x1=\"18.36\" y1=\"5.64\" x2=\"19.78\" y2=\"4.22\"/>',\n);\nexport const ICON_MOON = S('<path d=\"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z\"/>');\n\n/* ---- 侧边栏 ---- */\n\nexport const ICON_SIDEBAR_TOGGLE = S(\n '<rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\"/><path d=\"M9 3v18\"/><path d=\"m14 9-3 3 3 3\"/>',\n);\n\n/* ---- 编辑器图标 ---- */\n\nexport const ICON_LIST = S(\n '<line x1=\"8\" y1=\"6\" x2=\"21\" y2=\"6\"/><line x1=\"8\" y1=\"12\" x2=\"21\" y2=\"12\"/><line x1=\"8\" y1=\"18\" x2=\"21\" y2=\"18\"/><line x1=\"3\" y1=\"6\" x2=\"3.01\" y2=\"6\"/><line x1=\"3\" y1=\"12\" x2=\"3.01\" y2=\"12\"/><line x1=\"3\" y1=\"18\" x2=\"3.01\" y2=\"18\"/>',\n);\nexport const ICON_AI = S(\n '<path d=\"M12 2l2.4 7.2h7.6l-6 4.8 2.4 7.2-6.4-4.8-6.4 4.8 2.4-7.2-6-4.8h7.6z\"/>',\n);\nexport const ICON_BOLT = S('<polygon points=\"13 2 3 14 12 14 11 22 21 10 12 10 13 2\"/>');\nexport const ICON_REFRESH = S(\n '<polyline points=\"23 4 23 10 17 10\"/><polyline points=\"1 20 1 14 7 14\"/><path d=\"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15\"/>',\n);\nexport const ICON_RETRY = S(\n '<polyline points=\"1 4 1 10 7 10\"/><path d=\"M3.51 15a9 9 0 1 0 2.13-9.36L1 10\"/>',\n);\nexport const ICON_SETTINGS = S(\n '<circle cx=\"12\" cy=\"12\" r=\"3\"/><path d=\"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z\"/>',\n);\nexport const ICON_HISTORY = S(\n '<path d=\"M3 3v5h5\"/><path d=\"M3.05 13A9 9 0 1 0 6.11 6.11L3 8\"/><path d=\"M12 7v5l4 2\"/>',\n);\nexport const ICON_PUSH = S(\n '<line x1=\"22\" y1=\"2\" x2=\"11\" y2=\"13\"/><polygon points=\"22 2 15 22 11 13 2 9 22 2\"/>',\n);\nexport const ICON_TRANSLATE = S(\n '<path d=\"M5 8l6 6\"/><path d=\"M4 14l6-6 2-3\"/><path d=\"M2 5h12\"/><path d=\"M7 2h1\"/><path d=\"M22 22l-5-10-5 10\"/><path d=\"M14 18h6\"/>',\n);\nexport const ICON_SUMMARY = S(\n '<path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"/><polyline points=\"14 2 14 8 20 8\"/><line x1=\"16\" y1=\"13\" x2=\"8\" y2=\"13\"/><line x1=\"16\" y1=\"17\" x2=\"8\" y2=\"17\"/><polyline points=\"10 9 9 9 8 9\"/>',\n);\nexport const ICON_RENAME = S('<path d=\"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z\"/>');\nexport const ICON_SELECTION = S(\n '<circle cx=\"12\" cy=\"12\" r=\"1\"/><path d=\"M20 12a8 8 0 1 1-8-8\"/><path d=\"m16 2 4 4-4 4\"/>',\n);\nexport const ICON_TAG = S(\n '<path d=\"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z\"/><line x1=\"7\" y1=\"7\" x2=\"7.01\" y2=\"7\"/>',\n);\nexport const ICON_GRIP = S(\n '<circle cx=\"9\" cy=\"12\" r=\"1\"/><circle cx=\"15\" cy=\"12\" r=\"1\"/><circle cx=\"9\" cy=\"6\" r=\"1\"/><circle cx=\"15\" cy=\"6\" r=\"1\"/><circle cx=\"9\" cy=\"18\" r=\"1\"/><circle cx=\"15\" cy=\"18\" r=\"1\"/>',\n);\nexport const ICON_DIAGRAM = S(\n '<rect x=\"2\" y=\"2\" width=\"8\" height=\"8\" rx=\"1\"/><rect x=\"14\" y=\"2\" width=\"8\" height=\"8\" rx=\"1\"/><rect x=\"2\" y=\"14\" width=\"8\" height=\"8\" rx=\"1\"/><rect x=\"14\" y=\"14\" width=\"8\" height=\"8\" rx=\"1\"/>',\n);\nexport const ICON_LANGUAGE = S(\n '<circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"2\" y1=\"12\" x2=\"22\" y2=\"12\"/><path d=\"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z\"/>',\n);\nexport const ICON_PAPERCLIP = S(\n '<path d=\"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48\"/>',\n);\nexport const ICON_BROKEN_IMAGE =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><rect x=\"2\" y=\"2\" width=\"20\" height=\"20\" rx=\"2\"/><path d=\"M2 14l4-4 4 4 4-4 4 4 4-4\"/><path d=\"M6 6h.01M18 6h.01\"/></svg>';\n\n/* ---- 包级别图标(用于 upload/search/calendar 包) ---- */\n\nexport const ICO_UPLOAD = S36('<path d=\"M12 16V4\"/><path d=\"m6 9 6-5 6 5\"/><path d=\"M4 20h16\"/>');\nconst S18c = (d: string) =>\n `<svg class=\"qs-ico\" xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">${d}</svg>`;\n\nconst S20c = (d: string) =>\n `<svg class=\"qw-cal-svg\" xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">${d}</svg>`;\n\nexport const ICO_SEARCH = S18c('<circle cx=\"11\" cy=\"11\" r=\"7\"/><path d=\"m20 20-3.2-3.2\"/>');\nexport const ICO_MENU = S18('<path d=\"M4 7h16M4 12h16M4 17h16\"/>');\nexport const ICO_CALENDAR = S20c(\n '<rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\"/><path d=\"M8 2v4M16 2v4M3 10h18\"/>',\n);\nexport const ICO_ARROW_LEFT = S16('<path d=\"m15 18-6-6 6-6\"/>');\nexport const ICO_ARROW_RIGHT = S16('<path d=\"m9 18 6-6-6-6\"/>');\n\n/* ---- 搜索插图(大尺寸 art) ---- */\n\nexport const SEARCH_ART =\n '<svg viewBox=\"0 0 160 140\" role=\"img\" aria-label=\"Search illustration\">' +\n '<ellipse class=\"qs-art-shadow\" cx=\"80\" cy=\"124\" rx=\"46\" ry=\"6\"/>' +\n '<g class=\"qs-art-float\">' +\n '<rect class=\"qs-art-paper\" x=\"40\" y=\"20\" width=\"80\" height=\"82\" rx=\"13\"/>' +\n '<line class=\"qs-art-row-accent\" x1=\"54\" y1=\"42\" x2=\"92\" y2=\"42\"/>' +\n '<line class=\"qs-art-row\" x1=\"54\" y1=\"56\" x2=\"106\" y2=\"56\"/>' +\n '<line class=\"qs-art-row\" x1=\"54\" y1=\"70\" x2=\"84\" y2=\"70\"/>' +\n '<circle class=\"qs-art-glass\" cx=\"96\" cy=\"86\" r=\"23\"/>' +\n '<line class=\"qs-art-handle\" x1=\"113\" y1=\"103\" x2=\"129\" y2=\"119\"/>' +\n '<text class=\"qs-art-seal\" x=\"96\" y=\"94\" text-anchor=\"middle\" font-size=\"24\">寻</text>' +\n \"</g>\" +\n '<circle class=\"qs-art-dot-a qs-art-twinkle\" cx=\"34\" cy=\"32\" r=\"3\"/>' +\n '<circle class=\"qs-art-dot-b qs-art-twinkle\" cx=\"126\" cy=\"40\" r=\"2.6\" style=\"animation-delay:.8s\"/>' +\n '<circle class=\"qs-art-dot-c qs-art-twinkle\" cx=\"30\" cy=\"98\" r=\"2.4\" style=\"animation-delay:1.5s\"/>' +\n \"</svg>\";\n","/** 青梧UI 下拉选择器:单选 · 错峰动画 · 自适应翻转 · 零依赖纯 DOM + ARIA */\n\nimport { ICON_CHECK, ICON_CHEVRON_DOWN } from \"../../../icon/icons\";\nimport type { SelectOption, SelectOptions } from \"./types\";\n\nconst PREFERS_REDUCED =\n typeof window !== \"undefined\" && typeof window.matchMedia === \"function\"\n ? window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches\n : false;\n\nconst HTML_ESCAPES: Record<string, string> = {\n \"&\": \"&amp;\",\n \"<\": \"&lt;\",\n \">\": \"&gt;\",\n '\"': \"&quot;\",\n};\n\nfunction escapeHTML(s: string): string {\n return s.replace(/[&<>\"]/g, (c) => HTML_ESCAPES[c] ?? c);\n}\n\nfunction el(tag: string, cls?: string, html?: string): HTMLElement {\n const n = document.createElement(tag);\n if (cls) n.className = cls;\n if (html != null) n.innerHTML = html;\n return n;\n}\n\nlet UID = 0;\n\n/** 活动项索引归一化:越界 / 负数 → null */\nfunction normalizeIndex(v: number | null | undefined, len?: number): number | null {\n if (v == null || v < 0) return null;\n if (len !== undefined && v >= len) return null;\n return v;\n}\n\n/** 同步活动项高亮类名(不重建列表) */\nfunction applyHighlightClass(list: HTMLUListElement, idx: number | null): void {\n list.querySelectorAll<HTMLElement>(\".qsel-opt\").forEach((o, i) => {\n o.classList.toggle(\"is-highlight\", i === idx);\n });\n}\n\nexport class Select {\n private root: HTMLElement;\n private options: SelectOption[];\n private placeholder: string;\n private customClass: string;\n private readonly width: \"trigger\" | \"auto\";\n private readonly duration: number;\n private readonly stagger: number;\n private readonly animate: boolean;\n private readonly maxStagger: number;\n private frosted: boolean;\n private readonly hoverCloseDelay: number;\n private activeIndex: number | null;\n private readonly onOpenChangeCb?: (open: boolean) => void;\n private readonly onChangeCb?: (value: string | null, option: SelectOption | null) => void;\n\n private readonly controlledValue: boolean;\n private displayValue: string | null;\n\n private isOpen = false;\n private isDisabled = false;\n private active = -1;\n private dir: \"down\" | \"up\" = \"down\";\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n private hoverTimer: ReturnType<typeof setTimeout> | null = null;\n\n private trigger!: HTMLButtonElement;\n private valueEl!: HTMLElement;\n private list!: HTMLUListElement;\n private panel!: HTMLElement;\n\n private onDocPointerDown: ((e: PointerEvent) => void) | null = null;\n private onWinScroll: (() => void) | null = null;\n\n constructor(root: HTMLElement, opts: SelectOptions = {}) {\n this.root = root;\n this.options = opts.options ?? [];\n this.placeholder = opts.placeholder ?? \"\";\n this.customClass = opts.className ?? \"\";\n this.width = opts.width ?? \"trigger\";\n this.duration = opts.duration ?? 380;\n this.stagger = opts.stagger ?? 28;\n this.animate = opts.animate !== false;\n this.maxStagger = opts.maxStagger ?? 12;\n this.frosted = opts.frosted !== false;\n this.hoverCloseDelay = opts.hoverCloseDelay ?? 3000;\n this.activeIndex = normalizeIndex(opts.activeIndex ?? null);\n this.onOpenChangeCb = opts.onOpenChange;\n this.onChangeCb = opts.onChange;\n\n this.controlledValue = \"value\" in opts;\n this.displayValue = opts.value ?? opts.defaultValue ?? null;\n this.isDisabled = opts.disabled === true;\n\n this.build(opts);\n\n if (opts.open === true || (opts.defaultOpen === true && opts.open == null)) {\n this.open();\n }\n }\n\n /* 一次性创建全部 DOM */\n private build(opts: SelectOptions): void {\n const ariaLabel = opts.ariaLabel ?? (this.placeholder || \"请选择\");\n\n this.root.classList.add(\"qsel\");\n if (this.customClass) this.root.classList.add(this.customClass);\n this.root.classList.toggle(\"is-disabled\", this.isDisabled);\n\n this.trigger = el(\"button\", \"qsel-trigger\") as HTMLButtonElement;\n this.trigger.type = \"button\";\n this.trigger.setAttribute(\"role\", \"combobox\");\n this.trigger.setAttribute(\"aria-haspopup\", \"listbox\");\n this.trigger.setAttribute(\"aria-expanded\", \"false\");\n this.trigger.setAttribute(\"aria-label\", ariaLabel);\n this.trigger.disabled = this.isDisabled;\n\n this.valueEl = el(\"span\", \"qsel-value\");\n const chev = el(\"span\", \"qsel-chevron\", ICON_CHEVRON_DOWN);\n chev.setAttribute(\"aria-hidden\", \"true\");\n this.trigger.append(this.valueEl, chev);\n this.root.append(this.trigger);\n\n /* 面板(挂 body,避免宿主 transform/filter/overflow 裁剪) */\n this.panel = el(\"div\", \"qsel-panel\");\n this.panel.classList.toggle(\"is-frosted\", this.frosted);\n this.panel.hidden = true;\n this.panel.id = `qsel-panel-${++UID}`;\n this.panel.setAttribute(\"role\", \"listbox\");\n this.panel.setAttribute(\"aria-label\", ariaLabel);\n this.trigger.setAttribute(\"aria-controls\", this.panel.id);\n this.list = el(\"ul\", \"qsel-list\") as HTMLUListElement;\n this.panel.append(this.list);\n\n /* 悬停移出后的自动关闭倒计时进度条 */\n const hoverBar = el(\"div\", \"qsel-hover-bar\");\n hoverBar.setAttribute(\"aria-hidden\", \"true\");\n this.panel.append(hoverBar);\n\n document.body.append(this.panel);\n\n this.syncValue();\n this.renderOptions();\n\n this.trigger.addEventListener(\"click\", () => {\n if (this.isDisabled) return;\n this.isOpen ? this.close() : this.open();\n });\n this.trigger.addEventListener(\"keydown\", (e) => this.onTriggerKey(e));\n\n /* 鼠标移出触发器与面板后延迟自动关闭(relatedTarget 判断,跨元素移动不计时) */\n this.root.addEventListener(\"mouseenter\", () => this.cancelHoverClose());\n this.panel.addEventListener(\"mouseenter\", () => this.cancelHoverClose());\n this.root.addEventListener(\"mouseleave\", (e) => {\n if (!this.panel.contains(e.relatedTarget as Node)) this.scheduleHoverClose();\n });\n this.panel.addEventListener(\"mouseleave\", (e) => {\n if (!this.root.contains(e.relatedTarget as Node)) this.scheduleHoverClose();\n });\n\n /* 阻止 pointerdown,避免列表抢占焦点破坏 aria-activedescendant */\n this.list.addEventListener(\"pointerdown\", (e) => e.preventDefault());\n this.list.addEventListener(\"click\", (e) => {\n const opt = (e.target as HTMLElement).closest<HTMLElement>(\".qsel-opt\");\n if (opt) this.select(Number(opt.dataset.index));\n });\n }\n\n private renderOptions(): void {\n this.list.textContent = \"\";\n const frag = document.createDocumentFragment();\n const shouldStagger = this.shouldStagger();\n\n this.options.forEach((opt, i) => {\n const li = el(\"li\", \"qsel-opt\");\n li.dataset.index = String(i);\n li.id = `${this.panel.id}-opt-${i}`;\n li.setAttribute(\"role\", \"option\");\n li.setAttribute(\"aria-selected\", String(opt.value === this.displayValue));\n if (opt.disabled) {\n li.classList.add(\"is-disabled\");\n li.setAttribute(\"aria-disabled\", \"true\");\n }\n if (shouldStagger) li.classList.add(\"is-enter\");\n if (i === this.activeIndex) li.classList.add(\"is-highlight\");\n\n const glyph = opt.glyph ?? opt.label.slice(0, 1);\n li.innerHTML =\n `<span class=\"qsel-opt-ico\">${escapeHTML(glyph)}</span>` +\n `<span class=\"qsel-opt-main\"><span class=\"qsel-opt-label\">${escapeHTML(opt.label)}</span>` +\n (opt.hint ? `<span class=\"qsel-opt-hint\">${escapeHTML(opt.hint)}</span>` : \"\") +\n `</span>` +\n `<span class=\"qsel-check\" aria-hidden=\"true\">${ICON_CHECK}</span>`;\n frag.append(li);\n });\n this.list.append(frag);\n }\n\n /** 是否启用逐项错峰动画(尊重 reduced-motion 与超大列表降级) */\n private shouldStagger(): boolean {\n return this.animate && !PREFERS_REDUCED && this.options.length <= this.maxStagger;\n }\n\n private syncValue(): void {\n const opt = this.currentOption;\n this.valueEl.textContent = opt ? opt.label : this.placeholder;\n this.valueEl.classList.toggle(\"is-placeholder\", !opt);\n }\n\n private get currentOption(): SelectOption | null {\n return this.options.find((o) => o.value === this.displayValue) ?? null;\n }\n\n /** 打开下拉面板 */\n open(): void {\n if (this.isOpen || this.isDisabled) return;\n this.isOpen = true;\n this.renderOptions();\n\n if (this.closeTimer !== null) {\n clearTimeout(this.closeTimer);\n this.closeTimer = null;\n }\n this.panel.classList.remove(\"is-closing\");\n this.panel.hidden = false;\n this.root.classList.add(\"is-open\");\n this.trigger.setAttribute(\"aria-expanded\", \"true\");\n\n this.position();\n this.setActive(this.startIndex(), false);\n this.applyStagger();\n\n requestAnimationFrame(() => this.panel.classList.add(\"is-open\"));\n\n this.onDocPointerDown = (e) => {\n if (this.isOpen && !this.root.contains(e.target as Node)) this.close();\n };\n document.addEventListener(\"pointerdown\", this.onDocPointerDown);\n this.onWinScroll = () => this.position();\n window.addEventListener(\"scroll\", this.onWinScroll, true);\n window.addEventListener(\"resize\", this.onWinScroll);\n\n this.onOpenChangeCb?.(true);\n }\n\n /** 关闭下拉面板 */\n close(): void {\n if (!this.isOpen) return;\n this.isOpen = false;\n this.cancelHoverClose();\n this.root.classList.remove(\"is-open\");\n this.panel.classList.remove(\"is-open\");\n this.panel.classList.add(\"is-closing\");\n this.trigger.setAttribute(\"aria-expanded\", \"false\");\n this.trigger.removeAttribute(\"aria-activedescendant\");\n this.active = -1;\n\n if (this.onDocPointerDown) {\n document.removeEventListener(\"pointerdown\", this.onDocPointerDown);\n this.onDocPointerDown = null;\n }\n if (this.onWinScroll) {\n window.removeEventListener(\"scroll\", this.onWinScroll, true);\n window.removeEventListener(\"resize\", this.onWinScroll);\n this.onWinScroll = null;\n }\n\n if (this.closeTimer !== null) clearTimeout(this.closeTimer);\n this.closeTimer = setTimeout(\n () => {\n if (!this.isOpen) {\n this.panel.hidden = true;\n this.panel.classList.remove(\"is-closing\");\n }\n },\n PREFERS_REDUCED ? 0 : this.duration,\n );\n\n this.onOpenChangeCb?.(false);\n }\n\n /** 切换展开状态 */\n toggle(): void {\n this.isOpen ? this.close() : this.open();\n }\n\n /** 鼠标移出后调度自动关闭(同步启动倒计时进度条动画) */\n private scheduleHoverClose(): void {\n if (!this.isOpen || this.hoverCloseDelay <= 0) return;\n if (this.hoverTimer !== null) clearTimeout(this.hoverTimer);\n this.panel.classList.add(\"is-hover-closing\");\n this.panel.style.setProperty(\"--qsel-hover-ms\", `${this.hoverCloseDelay}ms`);\n this.hoverTimer = setTimeout(() => this.close(), this.hoverCloseDelay);\n }\n\n /** 重新移入触发器或面板时取消自动关闭(进度条动画反向收起) */\n private cancelHoverClose(): void {\n if (this.hoverTimer !== null) {\n clearTimeout(this.hoverTimer);\n this.hoverTimer = null;\n }\n if (this.panel) {\n this.panel.classList.remove(\"is-hover-closing\");\n this.panel.style.removeProperty(\"--qsel-hover-ms\");\n }\n }\n\n /** 计算面板位置:宽度跟随触发器、向上/向下翻转、高度钳制到视口可用空间 */\n private position(): void {\n const tr = this.trigger.getBoundingClientRect();\n const gap = 8;\n /** 两侧空间都极度不足时,面板保留的最小高度(略溢出也比无法使用强) */\n const minPanelH = 120;\n\n this.panel.style.width = this.width === \"auto\" ? \"max-content\" : `${tr.width}px`;\n if (this.width === \"auto\") {\n this.panel.style.minWidth = `${tr.width}px`;\n }\n\n /* 隐藏态测量:决定展开方向与可用高度(不闪烁)。\n 列表自然高度取 scrollHeight——它返回内容全高,不受 CSS max-height(320px) 钳制影响\n (切勿临时把 maxHeight 置 none:position() 挂在 window scroll 捕获监听上,列表内滚动\n 会反复触发,瞬时展开会把 scrollTop 钳回 0,列表将永远滚不动) */\n this.panel.style.visibility = \"hidden\";\n const listNaturalH = this.list.scrollHeight;\n const listClientH = this.list.clientHeight;\n const panelH = this.panel.offsetHeight;\n const chrome = panelH - listClientH; // 面板边框等非列表高度(钳制前后不变)\n const panelW = this.panel.offsetWidth;\n const availBelow = window.innerHeight - tr.bottom - gap;\n const availAbove = tr.top - gap;\n\n const flipUp = availBelow < panelH && availAbove > availBelow;\n this.dir = flipUp ? \"up\" : \"down\";\n this.panel.classList.toggle(\"is-up\", flipUp);\n\n /* 展开方向也放不下时,把列表钳制到可用空间,由列表内部滚动承接,\n 保证长列表(如 24 小时选项)末项在矮视口下依然可达 */\n const avail = flipUp ? availAbove : availBelow;\n if (avail < chrome + listNaturalH) {\n const listMax = Math.max(minPanelH - chrome, Math.min(listNaturalH, avail - chrome));\n this.list.style.maxHeight = `${Math.max(0, listMax)}px`;\n } else {\n this.list.style.maxHeight = \"\";\n }\n\n let left = tr.left;\n if (this.width === \"auto\" && panelW > window.innerWidth - 16) {\n left = Math.max(8, window.innerWidth - panelW - 8);\n }\n this.panel.style.left = `${Math.max(8, left)}px`;\n\n if (flipUp) {\n this.panel.style.top = \"auto\";\n this.panel.style.bottom = `${Math.max(8, window.innerHeight - tr.top + gap)}px`;\n } else {\n this.panel.style.top = `${tr.bottom + gap}px`;\n this.panel.style.bottom = \"auto\";\n }\n this.panel.style.visibility = \"\";\n }\n\n /** 错峰动画:按展开方向给每个选项设置递增 / 递减延迟 */\n private applyStagger(): void {\n if (!this.shouldStagger()) return;\n const opts = this.list.querySelectorAll<HTMLElement>(\".qsel-opt.is-enter\");\n const n = opts.length;\n opts.forEach((o, i) => {\n const delay = this.dir === \"up\" ? (n - 1 - i) * this.stagger : i * this.stagger;\n o.style.animationDelay = `${delay}ms`;\n o.style.animationDuration = `${this.duration}ms`;\n });\n }\n\n private select(index: number): void {\n const opt = this.options[index];\n if (!opt || opt.disabled) return;\n\n if (!this.controlledValue) {\n this.displayValue = opt.value;\n this.syncValue();\n }\n this.onChangeCb?.(opt.value, opt);\n this.close();\n }\n\n private setActive(idx: number, scroll = true): void {\n const opts = this.list.querySelectorAll<HTMLElement>(\".qsel-opt\");\n if (!opts.length) return;\n this.active = Math.max(0, Math.min(idx, opts.length - 1));\n opts.forEach((o, i) => {\n const on = i === this.active;\n o.classList.toggle(\"is-active\", on);\n if (on) {\n this.trigger.setAttribute(\"aria-activedescendant\", o.id);\n if (scroll) o.scrollIntoView({ block: \"nearest\" });\n }\n });\n }\n\n /* 键盘导航(焦点保持在触发器,aria-activedescendant 指向列表) */\n private onTriggerKey(e: KeyboardEvent): void {\n if (this.isDisabled) return;\n switch (e.key) {\n case \"ArrowDown\":\n e.preventDefault();\n if (!this.isOpen) this.open();\n else this.moveActive(1);\n break;\n case \"ArrowUp\":\n e.preventDefault();\n if (!this.isOpen) this.open();\n else this.moveActive(-1);\n break;\n case \"Home\":\n if (this.isOpen) {\n e.preventDefault();\n this.moveActive(Number.MIN_SAFE_INTEGER);\n }\n break;\n case \"End\":\n if (this.isOpen) {\n e.preventDefault();\n this.moveActive(Number.MAX_SAFE_INTEGER);\n }\n break;\n case \"Enter\":\n case \" \":\n e.preventDefault();\n if (this.isOpen) {\n if (this.active >= 0) this.select(this.active);\n } else {\n this.open();\n }\n break;\n case \"Escape\":\n if (this.isOpen) {\n e.preventDefault();\n this.close();\n }\n break;\n case \"Tab\":\n if (this.isOpen) this.close();\n break;\n }\n }\n\n /** 在可用选项中移动(跳过禁用项,支持环绕) */\n private nextEnabled(from: number, dir: 1 | -1): number {\n const n = this.options.length;\n if (!n) return -1;\n for (let step = 1; step <= n; step++) {\n const i = (from + dir * step + n) % n;\n const o = this.options[i];\n if (o && !o.disabled) return i;\n }\n return -1;\n }\n\n private firstEnabled(): number {\n return this.options.findIndex((o) => !o.disabled);\n }\n\n private lastEnabled(): number {\n for (let i = this.options.length - 1; i >= 0; i--) {\n const o = this.options[i];\n if (o && !o.disabled) return i;\n }\n return -1;\n }\n\n private startIndex(): number {\n const idx = this.options.findIndex((o) => o.value === this.displayValue && !o.disabled);\n return idx >= 0 ? idx : this.firstEnabled();\n }\n\n private moveActive(delta: number): void {\n if (delta === Number.MIN_SAFE_INTEGER) {\n const i = this.firstEnabled();\n if (i >= 0) this.setActive(i);\n return;\n }\n if (delta === Number.MAX_SAFE_INTEGER) {\n const i = this.lastEnabled();\n if (i >= 0) this.setActive(i);\n return;\n }\n const from = this.active < 0 ? this.startIndex() : this.active;\n const next = this.nextEnabled(from, delta > 0 ? 1 : -1);\n if (next >= 0) this.setActive(next);\n }\n\n /** 当前选中值(无选中为 null) */\n get value(): string | null {\n return this.displayValue;\n }\n\n /** 是否展开 */\n get expanded(): boolean {\n return this.isOpen;\n }\n\n /** 外部同步 / 更新配置。value 同步显示但不触发 onChange(UI 选择才会回调) */\n update(patch: Partial<SelectOptions>): void {\n if (\"options\" in patch && patch.options) {\n this.options = patch.options;\n this.activeIndex = normalizeIndex(this.activeIndex, this.options.length);\n this.renderOptions();\n this.syncValue();\n }\n if (\"activeIndex\" in patch) {\n this.activeIndex = normalizeIndex(patch.activeIndex, this.options.length);\n applyHighlightClass(this.list, this.activeIndex);\n }\n if (\"value\" in patch) {\n this.displayValue = patch.value ?? null;\n this.syncValue();\n if (this.isOpen) this.renderOptions();\n }\n if (\"disabled\" in patch && patch.disabled !== undefined) {\n this.setDisabled(patch.disabled);\n }\n if (\"open\" in patch && patch.open !== undefined) {\n patch.open ? this.open() : this.close();\n }\n if (\"placeholder\" in patch && patch.placeholder !== undefined) {\n this.placeholder = patch.placeholder;\n this.syncValue();\n }\n if (\"ariaLabel\" in patch && patch.ariaLabel !== undefined) {\n this.trigger.setAttribute(\"aria-label\", patch.ariaLabel);\n }\n if (\"frosted\" in patch && patch.frosted !== undefined) {\n this.frosted = patch.frosted;\n this.panel.classList.toggle(\"is-frosted\", this.frosted);\n }\n }\n\n /** 程序化选中(等价 update({ value })) */\n setValue(value: string | null): void {\n this.update({ value });\n }\n\n /** 动态切换整体禁用 */\n setDisabled(v: boolean): void {\n this.isDisabled = v;\n this.root.classList.toggle(\"is-disabled\", v);\n this.trigger.disabled = v;\n if (v) this.close();\n }\n\n /** 销毁组件,清空宿主容器并移除 body 上的面板 */\n destroy(): void {\n if (this.closeTimer !== null) clearTimeout(this.closeTimer);\n this.cancelHoverClose();\n this.close();\n this.panel.remove();\n this.root.classList.remove(\"qsel\", \"is-open\", \"is-disabled\");\n if (this.customClass) this.root.classList.remove(this.customClass);\n this.root.textContent = \"\";\n }\n}\n"],"mappings":";AAaA,MAAM,KAAK,MACT,2MAA2M,EAAE;AAE/M,MAAM,OAAO,MACX,2MAA2M,EAAE;AAE/M,MAAM,OAAO,MACX,2MAA2M,EAAE;AAK/M,MAAM,OAAO,MACX,6MAA6M,EAAE;AAIpL,EAC3B,gGACF;AAEiC,EAC/B,4PACF;AAE2B,EAAE,qEAA6D;AAE/D,EACzB,2IACF;AAEiC,EAC/B,wEACF;AAEyB,EAAE,uCAAqC;AAEvC,EACvB,qGACF;AAE0B,EACxB,4FACF;AAEA,MAAa,aAAa,EAAE,uCAAqC;AAExC,EACvB,8FACF;AAE0B,EAAE,gDAAwC;AAE5C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AK,WAAW;EACjE,KAAK,KAAK,cAAc;CAC1B;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qingwu-ui/select",
3
- "version": "0.9.0-beta.5",
3
+ "version": "1.0.1",
4
4
  "description": "青梧 UI 下拉选择 —— 单选、手风琴错展开合动画、禁用项、零依赖",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -23,7 +23,7 @@
23
23
  "dist"
24
24
  ],
25
25
  "scripts": {
26
- "build": "tsdown && node ../../tooling/build-css.mjs dist/style.css src/style.css",
26
+ "build": "tsdown && bun ../../tooling/build-css.ts dist/style.css src/style.css",
27
27
  "build:browser": "bun build src/demo-entry.ts --outdir=dist/browser --format=iife",
28
28
  "typecheck": "tsc --noEmit",
29
29
  "test": "vitest run",
@@ -33,11 +33,11 @@
33
33
  "devDependencies": {
34
34
  "@qingwu-ui/tsconfig": "workspace:*",
35
35
  "@size-limit/preset-small-lib": "^13.0.1",
36
- "happy-dom": "^20.11.1",
36
+ "happy-dom": "^21.0.4",
37
37
  "size-limit": "^13.0.1",
38
38
  "tsdown": "^0.22.14",
39
39
  "typescript": "^7.0.2",
40
- "vitest": "^4.1.10"
40
+ "vitest": "^4.1.12"
41
41
  },
42
42
  "size-limit": [
43
43
  {