@qingwu-ui/select 0.9.0-beta.3 → 0.9.0-beta.5

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
@@ -65,6 +65,8 @@ React / Vue 集成时在 `useEffect` / `onMounted` 中实例化,卸载时调
65
65
  | `maxStagger` | `number` | `12` | 超过该选项数降级为整体淡入,`0` 不降级 |
66
66
  | `frosted` | `boolean` | `true` | 面板半透明磨砂质感(半透明底 + backdrop-filter 毛玻璃);`false` 回退不透明实体面板 |
67
67
  | `ariaLabel` | `string` | `placeholder` | 触发器无障碍标签 |
68
+ | `hoverCloseDelay` | `number` | `3000` | 鼠标从触发器与面板同时移出后自动关闭的延迟 ms;`0` 不自动关闭。移出后面板底部显示倒计时进度条,重新移入取消 |
69
+ | `activeIndex` | `number \| null` | `null` | 活动项索引,对应选项呈现黛青高亮(呼吸动画),区别于选中态;支持 `update({ activeIndex })` 动态更新 |
68
70
  | `onOpenChange` | `(open) => void` | `-` | 展开状态变化回调 |
69
71
  | `onChange` | `(value, option) => void` | `-` | 选中值变化回调(取消为 `null`) |
70
72
 
package/dist/index.cjs CHANGED
@@ -91,6 +91,18 @@ function el(tag, cls, html) {
91
91
  return n;
92
92
  }
93
93
  let UID = 0;
94
+ /** 活动项索引归一化:越界 / 负数 → null */
95
+ function normalizeIndex(v, len) {
96
+ if (v == null || v < 0) return null;
97
+ if (len !== void 0 && v >= len) return null;
98
+ return v;
99
+ }
100
+ /** 同步活动项高亮类名(不重建列表) */
101
+ function applyHighlightClass(list, idx) {
102
+ list.querySelectorAll(".qsel-opt").forEach((o, i) => {
103
+ o.classList.toggle("is-highlight", i === idx);
104
+ });
105
+ }
94
106
  var Select = class {
95
107
  root;
96
108
  options;
@@ -102,6 +114,8 @@ var Select = class {
102
114
  animate;
103
115
  maxStagger;
104
116
  frosted;
117
+ hoverCloseDelay;
118
+ activeIndex;
105
119
  onOpenChangeCb;
106
120
  onChangeCb;
107
121
  controlledValue;
@@ -111,6 +125,7 @@ var Select = class {
111
125
  active = -1;
112
126
  dir = "down";
113
127
  closeTimer = null;
128
+ hoverTimer = null;
114
129
  trigger;
115
130
  valueEl;
116
131
  list;
@@ -128,6 +143,8 @@ var Select = class {
128
143
  this.animate = opts.animate !== false;
129
144
  this.maxStagger = opts.maxStagger ?? 12;
130
145
  this.frosted = opts.frosted !== false;
146
+ this.hoverCloseDelay = opts.hoverCloseDelay ?? 3e3;
147
+ this.activeIndex = normalizeIndex(opts.activeIndex ?? null);
131
148
  this.onOpenChangeCb = opts.onOpenChange;
132
149
  this.onChangeCb = opts.onChange;
133
150
  this.controlledValue = "value" in opts;
@@ -161,6 +178,9 @@ var Select = class {
161
178
  this.panel.setAttribute("aria-label", ariaLabel);
162
179
  this.list = el("ul", "qsel-list");
163
180
  this.panel.append(this.list);
181
+ const hoverBar = el("div", "qsel-hover-bar");
182
+ hoverBar.setAttribute("aria-hidden", "true");
183
+ this.panel.append(hoverBar);
164
184
  document.body.append(this.panel);
165
185
  this.syncValue();
166
186
  this.renderOptions();
@@ -169,6 +189,14 @@ var Select = class {
169
189
  this.isOpen ? this.close() : this.open();
170
190
  });
171
191
  this.trigger.addEventListener("keydown", (e) => this.onTriggerKey(e));
192
+ this.root.addEventListener("mouseenter", () => this.cancelHoverClose());
193
+ this.panel.addEventListener("mouseenter", () => this.cancelHoverClose());
194
+ this.root.addEventListener("mouseleave", (e) => {
195
+ if (!this.panel.contains(e.relatedTarget)) this.scheduleHoverClose();
196
+ });
197
+ this.panel.addEventListener("mouseleave", (e) => {
198
+ if (!this.root.contains(e.relatedTarget)) this.scheduleHoverClose();
199
+ });
172
200
  this.list.addEventListener("pointerdown", (e) => e.preventDefault());
173
201
  this.list.addEventListener("click", (e) => {
174
202
  const opt = e.target.closest(".qsel-opt");
@@ -190,6 +218,7 @@ var Select = class {
190
218
  li.setAttribute("aria-disabled", "true");
191
219
  }
192
220
  if (shouldStagger) li.classList.add("is-enter");
221
+ if (i === this.activeIndex) li.classList.add("is-highlight");
193
222
  li.innerHTML = `<span class="qsel-opt-ico">${escapeHTML(opt.glyph ?? opt.label.slice(0, 1))}</span><span class="qsel-opt-main"><span class="qsel-opt-label">${escapeHTML(opt.label)}</span>` + (opt.hint ? `<span class="qsel-opt-hint">${escapeHTML(opt.hint)}</span>` : "") + `</span><span class="qsel-check" aria-hidden="true">${ICON_CHECK}</span>`;
194
223
  frag.append(li);
195
224
  });
@@ -212,6 +241,11 @@ var Select = class {
212
241
  if (this.isOpen || this.isDisabled) return;
213
242
  this.isOpen = true;
214
243
  this.renderOptions();
244
+ if (this.closeTimer !== null) {
245
+ clearTimeout(this.closeTimer);
246
+ this.closeTimer = null;
247
+ }
248
+ this.panel.classList.remove("is-closing");
215
249
  this.panel.hidden = false;
216
250
  this.root.classList.add("is-open");
217
251
  this.trigger.setAttribute("aria-expanded", "true");
@@ -232,8 +266,10 @@ var Select = class {
232
266
  close() {
233
267
  if (!this.isOpen) return;
234
268
  this.isOpen = false;
269
+ this.cancelHoverClose();
235
270
  this.root.classList.remove("is-open");
236
271
  this.panel.classList.remove("is-open");
272
+ this.panel.classList.add("is-closing");
237
273
  this.trigger.setAttribute("aria-expanded", "false");
238
274
  this.trigger.removeAttribute("aria-activedescendant");
239
275
  this.active = -1;
@@ -248,7 +284,10 @@ var Select = class {
248
284
  }
249
285
  if (this.closeTimer !== null) clearTimeout(this.closeTimer);
250
286
  this.closeTimer = setTimeout(() => {
251
- if (!this.isOpen) this.panel.hidden = true;
287
+ if (!this.isOpen) {
288
+ this.panel.hidden = true;
289
+ this.panel.classList.remove("is-closing");
290
+ }
252
291
  }, PREFERS_REDUCED ? 0 : this.duration);
253
292
  this.onOpenChangeCb?.(false);
254
293
  }
@@ -256,6 +295,25 @@ var Select = class {
256
295
  toggle() {
257
296
  this.isOpen ? this.close() : this.open();
258
297
  }
298
+ /** 鼠标移出后调度自动关闭(同步启动倒计时进度条动画) */
299
+ scheduleHoverClose() {
300
+ if (!this.isOpen || this.hoverCloseDelay <= 0) return;
301
+ if (this.hoverTimer !== null) clearTimeout(this.hoverTimer);
302
+ this.panel.classList.add("is-hover-closing");
303
+ this.panel.style.setProperty("--qsel-hover-ms", `${this.hoverCloseDelay}ms`);
304
+ this.hoverTimer = setTimeout(() => this.close(), this.hoverCloseDelay);
305
+ }
306
+ /** 重新移入触发器或面板时取消自动关闭(进度条动画反向收起) */
307
+ cancelHoverClose() {
308
+ if (this.hoverTimer !== null) {
309
+ clearTimeout(this.hoverTimer);
310
+ this.hoverTimer = null;
311
+ }
312
+ if (this.panel) {
313
+ this.panel.classList.remove("is-hover-closing");
314
+ this.panel.style.removeProperty("--qsel-hover-ms");
315
+ }
316
+ }
259
317
  /** 计算面板位置:宽度跟随触发器、向上/向下翻转、高度钳制到视口可用空间 */
260
318
  position() {
261
319
  const tr = this.trigger.getBoundingClientRect();
@@ -265,9 +323,10 @@ var Select = class {
265
323
  this.panel.style.width = this.width === "auto" ? "max-content" : `${tr.width}px`;
266
324
  if (this.width === "auto") this.panel.style.minWidth = `${tr.width}px`;
267
325
  this.panel.style.visibility = "hidden";
268
- this.list.style.maxHeight = "";
326
+ const listNaturalH = this.list.scrollHeight;
327
+ const listClientH = this.list.clientHeight;
269
328
  const panelH = this.panel.offsetHeight;
270
- const listH = this.list.offsetHeight;
329
+ const chrome = panelH - listClientH;
271
330
  const panelW = this.panel.offsetWidth;
272
331
  const availBelow = window.innerHeight - tr.bottom - gap;
273
332
  const availAbove = tr.top - gap;
@@ -275,11 +334,10 @@ var Select = class {
275
334
  this.dir = flipUp ? "up" : "down";
276
335
  this.panel.classList.toggle("is-up", flipUp);
277
336
  const avail = flipUp ? availAbove : availBelow;
278
- if (avail < panelH) {
279
- const chrome = panelH - listH;
280
- const listMax = Math.max(minPanelH - chrome, Math.min(listH, avail - chrome));
337
+ if (avail < chrome + listNaturalH) {
338
+ const listMax = Math.max(minPanelH - chrome, Math.min(listNaturalH, avail - chrome));
281
339
  this.list.style.maxHeight = `${Math.max(0, listMax)}px`;
282
- }
340
+ } else this.list.style.maxHeight = "";
283
341
  let left = tr.left;
284
342
  if (this.width === "auto" && panelW > window.innerWidth - 16) left = Math.max(8, window.innerWidth - panelW - 8);
285
343
  this.panel.style.left = `${Math.max(8, left)}px`;
@@ -421,9 +479,14 @@ var Select = class {
421
479
  update(patch) {
422
480
  if ("options" in patch && patch.options) {
423
481
  this.options = patch.options;
482
+ this.activeIndex = normalizeIndex(this.activeIndex, this.options.length);
424
483
  this.renderOptions();
425
484
  this.syncValue();
426
485
  }
486
+ if ("activeIndex" in patch) {
487
+ this.activeIndex = normalizeIndex(patch.activeIndex, this.options.length);
488
+ applyHighlightClass(this.list, this.activeIndex);
489
+ }
427
490
  if ("value" in patch) {
428
491
  this.displayValue = patch.value ?? null;
429
492
  this.syncValue();
@@ -455,6 +518,7 @@ var Select = class {
455
518
  /** 销毁组件,清空宿主容器并移除 body 上的面板 */
456
519
  destroy() {
457
520
  if (this.closeTimer !== null) clearTimeout(this.closeTimer);
521
+ this.cancelHoverClose();
458
522
  this.close();
459
523
  this.panel.remove();
460
524
  this.root.classList.remove("qsel", "is-open", "is-disabled");
package/dist/index.d.cts CHANGED
@@ -45,6 +45,10 @@ interface SelectOptions {
45
45
  frosted?: boolean;
46
46
  /** 无障碍标签(trigger aria-label),缺省取 placeholder */
47
47
  ariaLabel?: string;
48
+ /** 鼠标从触发器与面板同时移出后,自动关闭的延迟 ms,默认 3000;0 表示不自动关闭 */
49
+ hoverCloseDelay?: number;
50
+ /** 活动项索引:对应选项标签呈现高亮样式(区别于选中态),null/-1 表示无,默认 null */
51
+ activeIndex?: number | null;
48
52
  /** 展开状态变化回调 */
49
53
  onOpenChange?: (open: boolean) => void;
50
54
  /** 选中值变化回调(取消为 null) */
@@ -63,6 +67,8 @@ declare class Select {
63
67
  private readonly animate;
64
68
  private readonly maxStagger;
65
69
  private frosted;
70
+ private readonly hoverCloseDelay;
71
+ private activeIndex;
66
72
  private readonly onOpenChangeCb?;
67
73
  private readonly onChangeCb?;
68
74
  private readonly controlledValue;
@@ -72,6 +78,7 @@ declare class Select {
72
78
  private active;
73
79
  private dir;
74
80
  private closeTimer;
81
+ private hoverTimer;
75
82
  private trigger;
76
83
  private valueEl;
77
84
  private list;
@@ -91,6 +98,10 @@ declare class Select {
91
98
  close(): void;
92
99
  /** 切换展开状态 */
93
100
  toggle(): void;
101
+ /** 鼠标移出后调度自动关闭(同步启动倒计时进度条动画) */
102
+ private scheduleHoverClose;
103
+ /** 重新移入触发器或面板时取消自动关闭(进度条动画反向收起) */
104
+ private cancelHoverClose;
94
105
  /** 计算面板位置:宽度跟随触发器、向上/向下翻转、高度钳制到视口可用空间 */
95
106
  private position;
96
107
  /** 错峰动画:按展开方向给每个选项设置递增 / 递减延迟 */
@@ -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,gBAAgB;;EAEhB,YAAY,sBAAsB,QAAQ;;;;cCrB/B;UACH;UACA;UACA;UACA;mBACS;mBACA;mBACA;mBACA;mBACA;UACT;mBACS;mBACA;mBAEA;UACT;UAEA;UACA;UACA;UACA;UACA;UAEA;UACA;UACA;UACA;UAEA;UACA;EAER,YAAY,MAAM,aAAa,OAAM;UA0B7B;UAiDA;;UA8BA;UAIA;cAMI;;EAKZ;;EA2BA;;EA+BA;;UAKQ;;UAkDA;UAWA;UAYA;UAeA;;UA+CA;UAWA;UAIA;UAQA;UAKA;;MAiBJ;;MAKA;;EAKJ,OAAO,OAAO,QAAQ;;EA+BtB,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;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"}
package/dist/index.d.mts CHANGED
@@ -45,6 +45,10 @@ interface SelectOptions {
45
45
  frosted?: boolean;
46
46
  /** 无障碍标签(trigger aria-label),缺省取 placeholder */
47
47
  ariaLabel?: string;
48
+ /** 鼠标从触发器与面板同时移出后,自动关闭的延迟 ms,默认 3000;0 表示不自动关闭 */
49
+ hoverCloseDelay?: number;
50
+ /** 活动项索引:对应选项标签呈现高亮样式(区别于选中态),null/-1 表示无,默认 null */
51
+ activeIndex?: number | null;
48
52
  /** 展开状态变化回调 */
49
53
  onOpenChange?: (open: boolean) => void;
50
54
  /** 选中值变化回调(取消为 null) */
@@ -63,6 +67,8 @@ declare class Select {
63
67
  private readonly animate;
64
68
  private readonly maxStagger;
65
69
  private frosted;
70
+ private readonly hoverCloseDelay;
71
+ private activeIndex;
66
72
  private readonly onOpenChangeCb?;
67
73
  private readonly onChangeCb?;
68
74
  private readonly controlledValue;
@@ -72,6 +78,7 @@ declare class Select {
72
78
  private active;
73
79
  private dir;
74
80
  private closeTimer;
81
+ private hoverTimer;
75
82
  private trigger;
76
83
  private valueEl;
77
84
  private list;
@@ -91,6 +98,10 @@ declare class Select {
91
98
  close(): void;
92
99
  /** 切换展开状态 */
93
100
  toggle(): void;
101
+ /** 鼠标移出后调度自动关闭(同步启动倒计时进度条动画) */
102
+ private scheduleHoverClose;
103
+ /** 重新移入触发器或面板时取消自动关闭(进度条动画反向收起) */
104
+ private cancelHoverClose;
94
105
  /** 计算面板位置:宽度跟随触发器、向上/向下翻转、高度钳制到视口可用空间 */
95
106
  private position;
96
107
  /** 错峰动画:按展开方向给每个选项设置递增 / 递减延迟 */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","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,gBAAgB;;EAEhB,YAAY,sBAAsB,QAAQ;;;;cCrB/B;UACH;UACA;UACA;UACA;mBACS;mBACA;mBACA;mBACA;mBACA;UACT;mBACS;mBACA;mBAEA;UACT;UAEA;UACA;UACA;UACA;UACA;UAEA;UACA;UACA;UACA;UAEA;UACA;EAER,YAAY,MAAM,aAAa,OAAM;UA0B7B;UAiDA;;UA8BA;UAIA;cAMI;;EAKZ;;EA2BA;;EA+BA;;UAKQ;;UAkDA;UAWA;UAYA;UAeA;;UA+CA;UAWA;UAIA;UAQA;UAKA;;MAiBJ;;MAKA;;EAKJ,OAAO,OAAO,QAAQ;;EA+BtB,SAAS;;EAKT,YAAY;;EAQZ"}
1
+ {"version":3,"file":"index.d.mts","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"}
package/dist/index.mjs CHANGED
@@ -90,6 +90,18 @@ function el(tag, cls, html) {
90
90
  return n;
91
91
  }
92
92
  let UID = 0;
93
+ /** 活动项索引归一化:越界 / 负数 → null */
94
+ function normalizeIndex(v, len) {
95
+ if (v == null || v < 0) return null;
96
+ if (len !== void 0 && v >= len) return null;
97
+ return v;
98
+ }
99
+ /** 同步活动项高亮类名(不重建列表) */
100
+ function applyHighlightClass(list, idx) {
101
+ list.querySelectorAll(".qsel-opt").forEach((o, i) => {
102
+ o.classList.toggle("is-highlight", i === idx);
103
+ });
104
+ }
93
105
  var Select = class {
94
106
  root;
95
107
  options;
@@ -101,6 +113,8 @@ var Select = class {
101
113
  animate;
102
114
  maxStagger;
103
115
  frosted;
116
+ hoverCloseDelay;
117
+ activeIndex;
104
118
  onOpenChangeCb;
105
119
  onChangeCb;
106
120
  controlledValue;
@@ -110,6 +124,7 @@ var Select = class {
110
124
  active = -1;
111
125
  dir = "down";
112
126
  closeTimer = null;
127
+ hoverTimer = null;
113
128
  trigger;
114
129
  valueEl;
115
130
  list;
@@ -127,6 +142,8 @@ var Select = class {
127
142
  this.animate = opts.animate !== false;
128
143
  this.maxStagger = opts.maxStagger ?? 12;
129
144
  this.frosted = opts.frosted !== false;
145
+ this.hoverCloseDelay = opts.hoverCloseDelay ?? 3e3;
146
+ this.activeIndex = normalizeIndex(opts.activeIndex ?? null);
130
147
  this.onOpenChangeCb = opts.onOpenChange;
131
148
  this.onChangeCb = opts.onChange;
132
149
  this.controlledValue = "value" in opts;
@@ -160,6 +177,9 @@ var Select = class {
160
177
  this.panel.setAttribute("aria-label", ariaLabel);
161
178
  this.list = el("ul", "qsel-list");
162
179
  this.panel.append(this.list);
180
+ const hoverBar = el("div", "qsel-hover-bar");
181
+ hoverBar.setAttribute("aria-hidden", "true");
182
+ this.panel.append(hoverBar);
163
183
  document.body.append(this.panel);
164
184
  this.syncValue();
165
185
  this.renderOptions();
@@ -168,6 +188,14 @@ var Select = class {
168
188
  this.isOpen ? this.close() : this.open();
169
189
  });
170
190
  this.trigger.addEventListener("keydown", (e) => this.onTriggerKey(e));
191
+ this.root.addEventListener("mouseenter", () => this.cancelHoverClose());
192
+ this.panel.addEventListener("mouseenter", () => this.cancelHoverClose());
193
+ this.root.addEventListener("mouseleave", (e) => {
194
+ if (!this.panel.contains(e.relatedTarget)) this.scheduleHoverClose();
195
+ });
196
+ this.panel.addEventListener("mouseleave", (e) => {
197
+ if (!this.root.contains(e.relatedTarget)) this.scheduleHoverClose();
198
+ });
171
199
  this.list.addEventListener("pointerdown", (e) => e.preventDefault());
172
200
  this.list.addEventListener("click", (e) => {
173
201
  const opt = e.target.closest(".qsel-opt");
@@ -189,6 +217,7 @@ var Select = class {
189
217
  li.setAttribute("aria-disabled", "true");
190
218
  }
191
219
  if (shouldStagger) li.classList.add("is-enter");
220
+ if (i === this.activeIndex) li.classList.add("is-highlight");
192
221
  li.innerHTML = `<span class="qsel-opt-ico">${escapeHTML(opt.glyph ?? opt.label.slice(0, 1))}</span><span class="qsel-opt-main"><span class="qsel-opt-label">${escapeHTML(opt.label)}</span>` + (opt.hint ? `<span class="qsel-opt-hint">${escapeHTML(opt.hint)}</span>` : "") + `</span><span class="qsel-check" aria-hidden="true">${ICON_CHECK}</span>`;
193
222
  frag.append(li);
194
223
  });
@@ -211,6 +240,11 @@ var Select = class {
211
240
  if (this.isOpen || this.isDisabled) return;
212
241
  this.isOpen = true;
213
242
  this.renderOptions();
243
+ if (this.closeTimer !== null) {
244
+ clearTimeout(this.closeTimer);
245
+ this.closeTimer = null;
246
+ }
247
+ this.panel.classList.remove("is-closing");
214
248
  this.panel.hidden = false;
215
249
  this.root.classList.add("is-open");
216
250
  this.trigger.setAttribute("aria-expanded", "true");
@@ -231,8 +265,10 @@ var Select = class {
231
265
  close() {
232
266
  if (!this.isOpen) return;
233
267
  this.isOpen = false;
268
+ this.cancelHoverClose();
234
269
  this.root.classList.remove("is-open");
235
270
  this.panel.classList.remove("is-open");
271
+ this.panel.classList.add("is-closing");
236
272
  this.trigger.setAttribute("aria-expanded", "false");
237
273
  this.trigger.removeAttribute("aria-activedescendant");
238
274
  this.active = -1;
@@ -247,7 +283,10 @@ var Select = class {
247
283
  }
248
284
  if (this.closeTimer !== null) clearTimeout(this.closeTimer);
249
285
  this.closeTimer = setTimeout(() => {
250
- if (!this.isOpen) this.panel.hidden = true;
286
+ if (!this.isOpen) {
287
+ this.panel.hidden = true;
288
+ this.panel.classList.remove("is-closing");
289
+ }
251
290
  }, PREFERS_REDUCED ? 0 : this.duration);
252
291
  this.onOpenChangeCb?.(false);
253
292
  }
@@ -255,6 +294,25 @@ var Select = class {
255
294
  toggle() {
256
295
  this.isOpen ? this.close() : this.open();
257
296
  }
297
+ /** 鼠标移出后调度自动关闭(同步启动倒计时进度条动画) */
298
+ scheduleHoverClose() {
299
+ if (!this.isOpen || this.hoverCloseDelay <= 0) return;
300
+ if (this.hoverTimer !== null) clearTimeout(this.hoverTimer);
301
+ this.panel.classList.add("is-hover-closing");
302
+ this.panel.style.setProperty("--qsel-hover-ms", `${this.hoverCloseDelay}ms`);
303
+ this.hoverTimer = setTimeout(() => this.close(), this.hoverCloseDelay);
304
+ }
305
+ /** 重新移入触发器或面板时取消自动关闭(进度条动画反向收起) */
306
+ cancelHoverClose() {
307
+ if (this.hoverTimer !== null) {
308
+ clearTimeout(this.hoverTimer);
309
+ this.hoverTimer = null;
310
+ }
311
+ if (this.panel) {
312
+ this.panel.classList.remove("is-hover-closing");
313
+ this.panel.style.removeProperty("--qsel-hover-ms");
314
+ }
315
+ }
258
316
  /** 计算面板位置:宽度跟随触发器、向上/向下翻转、高度钳制到视口可用空间 */
259
317
  position() {
260
318
  const tr = this.trigger.getBoundingClientRect();
@@ -264,9 +322,10 @@ var Select = class {
264
322
  this.panel.style.width = this.width === "auto" ? "max-content" : `${tr.width}px`;
265
323
  if (this.width === "auto") this.panel.style.minWidth = `${tr.width}px`;
266
324
  this.panel.style.visibility = "hidden";
267
- this.list.style.maxHeight = "";
325
+ const listNaturalH = this.list.scrollHeight;
326
+ const listClientH = this.list.clientHeight;
268
327
  const panelH = this.panel.offsetHeight;
269
- const listH = this.list.offsetHeight;
328
+ const chrome = panelH - listClientH;
270
329
  const panelW = this.panel.offsetWidth;
271
330
  const availBelow = window.innerHeight - tr.bottom - gap;
272
331
  const availAbove = tr.top - gap;
@@ -274,11 +333,10 @@ var Select = class {
274
333
  this.dir = flipUp ? "up" : "down";
275
334
  this.panel.classList.toggle("is-up", flipUp);
276
335
  const avail = flipUp ? availAbove : availBelow;
277
- if (avail < panelH) {
278
- const chrome = panelH - listH;
279
- const listMax = Math.max(minPanelH - chrome, Math.min(listH, avail - chrome));
336
+ if (avail < chrome + listNaturalH) {
337
+ const listMax = Math.max(minPanelH - chrome, Math.min(listNaturalH, avail - chrome));
280
338
  this.list.style.maxHeight = `${Math.max(0, listMax)}px`;
281
- }
339
+ } else this.list.style.maxHeight = "";
282
340
  let left = tr.left;
283
341
  if (this.width === "auto" && panelW > window.innerWidth - 16) left = Math.max(8, window.innerWidth - panelW - 8);
284
342
  this.panel.style.left = `${Math.max(8, left)}px`;
@@ -420,9 +478,14 @@ var Select = class {
420
478
  update(patch) {
421
479
  if ("options" in patch && patch.options) {
422
480
  this.options = patch.options;
481
+ this.activeIndex = normalizeIndex(this.activeIndex, this.options.length);
423
482
  this.renderOptions();
424
483
  this.syncValue();
425
484
  }
485
+ if ("activeIndex" in patch) {
486
+ this.activeIndex = normalizeIndex(patch.activeIndex, this.options.length);
487
+ applyHighlightClass(this.list, this.activeIndex);
488
+ }
426
489
  if ("value" in patch) {
427
490
  this.displayValue = patch.value ?? null;
428
491
  this.syncValue();
@@ -454,6 +517,7 @@ var Select = class {
454
517
  /** 销毁组件,清空宿主容器并移除 body 上的面板 */
455
518
  destroy() {
456
519
  if (this.closeTimer !== null) clearTimeout(this.closeTimer);
520
+ this.cancelHoverClose();
457
521
  this.close();
458
522
  this.panel.remove();
459
523
  this.root.classList.remove("qsel", "is-open", "is-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\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 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\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.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 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 /* 阻止 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\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 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.root.classList.remove(\"is-open\");\n this.panel.classList.remove(\"is-open\");\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) this.panel.hidden = true;\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 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 this.panel.style.visibility = \"hidden\";\n this.list.style.maxHeight = \"\"; // 复位 CSS 默认高度,测量自然尺寸\n const panelH = this.panel.offsetHeight;\n const listH = this.list.offsetHeight;\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 < panelH) {\n const chrome = panelH - listH; // 面板边框等非列表高度\n const listMax = Math.max(minPanelH - chrome, Math.min(listH, avail - chrome));\n this.list.style.maxHeight = `${Math.max(0, listMax)}px`;\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.renderOptions();\n this.syncValue();\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.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,EACtB,yIACF;AAEyB,EACvB,+IACF;AAEyB,EACvB,+GACF;AAE2B,EACzB,2FACF;AAEyB,EACvB,uIACF;AAE4B,EAC1B,wMACF;AAE0B,EACxB,+NACF;AAE6B,EAC3B,8IACF;AAEyB,EACvB,2IACF;AAEwB,EACtB,iGACF;AAEyB,EACvB,sHACF;AAI6B,EAAE,iEAA+D;AAE5D,EAChC,2JACF;AAC2B,EACzB,2SACF;AAIiC,IAAI,8BAA4B;AAC/B,IAAI,6BAA2B;AAClC,EAAE,wCAAsC;AACvE,MAAa,oBAAoB,EAAE,uCAA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,KAAK,UAAU;EAC1D,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.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,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,EACtB,yIACF;AAEyB,EACvB,+IACF;AAEyB,EACvB,+GACF;AAE2B,EACzB,2FACF;AAEyB,EACvB,uIACF;AAE4B,EAC1B,wMACF;AAE0B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AW;EACjD;EACA,IAAI,WAAW,OAAO;GACpB,KAAK,eAAe,MAAM,SAAS;GACnC,KAAK,UAAU;GACf,IAAI,KAAK,QAAQ,KAAK,cAAc;EACtC;EACA,IAAI,cAAc,SAAS,MAAM,aAAa,KAAA,GAC5C,KAAK,YAAY,MAAM,QAAQ;EAEjC,IAAI,UAAU,SAAS,MAAM,SAAS,KAAA,GACpC,MAAM,OAAO,KAAK,KAAK,IAAI,KAAK,MAAM;EAExC,IAAI,iBAAiB,SAAS,MAAM,gBAAgB,KAAA,GAAW;GAC7D,KAAK,cAAc,MAAM;GACzB,KAAK,UAAU;EACjB;EACA,IAAI,eAAe,SAAS,MAAM,cAAc,KAAA,GAC9C,KAAK,QAAQ,aAAa,cAAc,MAAM,SAAS;EAEzD,IAAI,aAAa,SAAS,MAAM,YAAY,KAAA,GAAW;GACrD,KAAK,UAAU,MAAM;GACrB,KAAK,MAAM,UAAU,OAAO,cAAc,KAAK,OAAO;EACxD;CACF;;CAGA,SAAS,OAA4B;EACnC,KAAK,OAAO,EAAE,MAAM,CAAC;CACvB;;CAGA,YAAY,GAAkB;EAC5B,KAAK,aAAa;EAClB,KAAK,KAAK,UAAU,OAAO,eAAe,CAAC;EAC3C,KAAK,QAAQ,WAAW;EACxB,IAAI,GAAG,KAAK,MAAM;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"}
package/dist/style.css CHANGED
@@ -1,18 +1,57 @@
1
- /* ============================================================
2
- 青梧UI · 下拉选择器样式(Select)
3
- 零依赖 · CSS 自定义属性驱动 · 明暗双主题 · reduced-motion 友好
1
+ /*
2
+ * 青梧 UI · 尺寸变量
3
+ *
4
+ * rem:布局尺寸、字号、间距(跟随浏览器字号设置)
5
+ * px:边框、阴影、图标等固定像素细节
6
+ * clamp:大标题、大区块留白,随屏幕宽度平滑缩放
7
+ * svh:保底高度,在浏览器工具栏出现时也不被遮挡
8
+ * dvh:跟随浏览器工具栏伸缩的容器高度
9
+ *
10
+ * 断点(媒体查询里只能写字面量):
11
+ * 40rem(640) 48rem(768) 64rem(1024) 80rem(1280)
12
+ *
13
+ * 贴边元素用 env(safe-area-inset-*) 避开刘海与底部横条,
14
+ * 需要页面 meta 设置 viewport-fit=cover。
15
+ */
4
16
 
5
- 使用方式:
6
- import "@qingwu-ui/select/style.css"
17
+ :root {
18
+ /* 间距 */
19
+ --qw-space-1: 0.25rem; /* 4px */
20
+ --qw-space-2: 0.5rem; /* 8px */
21
+ --qw-space-3: 0.75rem; /* 12px */
22
+ --qw-space-4: 1rem; /* 16px */
23
+ --qw-space-5: 1.5rem; /* 24px */
24
+ --qw-space-6: 2rem; /* 32px */
25
+ --qw-space-7: 3rem; /* 48px */
26
+ --qw-space-8: 4rem; /* 64px */
27
+ --qw-space-9: 6rem; /* 96px */
28
+ --qw-space-10: 8rem; /* 128px */
29
+
30
+ /* 圆角,胶囊形状直接写 999px */
31
+ --qw-radius-sm: 0.25rem; /* 4px */
32
+ --qw-radius-md: 0.5rem; /* 8px */
33
+ --qw-radius-lg: 0.75rem; /* 12px */
34
+ --qw-radius-xl: 1rem; /* 16px */
35
+ --qw-radius-2xl: 1.25rem; /* 20px */
36
+
37
+ /* 常规字号,大标题用 clamp 单独写 */
38
+ --qw-text-xs: 0.75rem; /* 12px */
39
+ --qw-text-sm: 0.8125rem; /* 13px */
40
+ --qw-text-md: 0.875rem; /* 14px */
41
+ --qw-text-base: 1rem; /* 16px */
42
+ --qw-text-lg: 1.125rem; /* 18px */
43
+ --qw-text-xl: 1.25rem; /* 20px */
44
+ --qw-text-2xl: 1.5rem; /* 24px */
45
+ }
7
46
 
8
- 令牌覆盖:--qsel-* 可被宿主覆盖;复用宿主已定义的
9
- --paper / --card / --ink / --teal / --vermilion / --amber / --line
10
- 若宿主未提供则使用本文件默认值。
11
- ============================================================ */
47
+ /*
48
+ * 青梧 UI · 下拉选择器样式(Select)
49
+ * 零依赖 · 明暗双主题 · reduced-motion 友好
50
+ * 使用:import "@qingwu-ui/select/style.css"
51
+ * --qsel-* 可在宿主层覆盖;宿主已定义的 --card/--ink 等变量会被自动复用。
52
+ */
12
53
 
13
- /* ============================================================
14
- ① 设计令牌(可在宿主层覆盖)
15
- ============================================================ */
54
+ /* 设计令牌 */
16
55
  :root {
17
56
  --qsel-card: var(--card, #fdfdfb);
18
57
  --qsel-ink: var(--ink, #1d2b2c);
@@ -29,7 +68,7 @@
29
68
  --qsel-font-kai: var(--font-kai, KaiTi, "STKaiti", "Kaiti SC", serif);
30
69
  }
31
70
 
32
- /* 暗色主题:兼容 <html data-theme="dark"> 与 .dark 类两种宿主约定 */
71
+ /* 暗色主题 */
33
72
  .dark,
34
73
  [data-theme="dark"] {
35
74
  --qsel-card: #1a2022;
@@ -45,9 +84,7 @@
45
84
  --qsel-shadow-pop: 0 24px 60px -28px rgba(0, 0, 0, 0.7);
46
85
  }
47
86
 
48
- /* ============================================================
49
- ② 基础复位(限定在组件范围内,不污染宿主)
50
- ============================================================ */
87
+ /* 基础复位 */
51
88
  .qsel,
52
89
  .qsel *,
53
90
  .qsel-panel,
@@ -76,21 +113,19 @@
76
113
  outline-offset: 2px;
77
114
  }
78
115
 
79
- /* ============================================================
80
- ③ 触发器
81
- ============================================================ */
116
+ /* 触发器 */
82
117
  .qsel-trigger {
83
118
  display: flex;
84
119
  align-items: center;
85
- gap: 10px;
120
+ gap: var(--qw-space-2);
86
121
  width: 100%;
87
- height: 46px;
88
- padding: 0 14px;
122
+ height: 3rem;
123
+ padding: 0 var(--qw-space-4);
89
124
  border: 1.5px solid var(--qsel-line);
90
- border-radius: 12px;
125
+ border-radius: var(--qw-radius-lg);
91
126
  background: var(--qsel-card);
92
127
  color: var(--qsel-ink);
93
- font-size: 14.5px;
128
+ font-size: var(--qw-text-md);
94
129
  text-align: left;
95
130
  cursor: pointer;
96
131
  box-shadow: var(--qsel-shadow);
@@ -136,19 +171,17 @@
136
171
  height: 16px;
137
172
  }
138
173
 
139
- /* ============================================================
140
- ④ 面板(position: fixed 挂 body,向上/向下自适应)
141
- ============================================================ */
174
+ /* 面板:fixed 定位,向上或向下自适应展开 */
142
175
  .qsel-panel {
143
176
  position: fixed;
144
177
  z-index: 300;
145
178
  background: var(--qsel-card);
146
179
  border: 1px solid var(--qsel-line);
147
- border-radius: 14px;
180
+ border-radius: var(--qw-radius-xl);
148
181
  box-shadow: var(--qsel-shadow-pop);
149
182
  overflow: hidden;
150
183
  opacity: 0;
151
- transform: translateY(-8px) scale(0.98);
184
+ transform: translateY(-0.5rem) scale(0.98);
152
185
  transform-origin: top center;
153
186
  transition:
154
187
  opacity 0.16s ease,
@@ -161,31 +194,83 @@
161
194
  opacity: 1;
162
195
  transform: translateY(0) scale(1);
163
196
  }
197
+ /* 关闭:缩小下沉并淡出 */
198
+ .qsel-panel.is-closing {
199
+ opacity: 0;
200
+ transform: translateY(0.5rem) scale(0.95);
201
+ transition:
202
+ opacity 0.26s ease,
203
+ transform 0.3s cubic-bezier(0.5, 0, 0.75, 0);
204
+ }
205
+ .qsel-panel.is-up.is-closing {
206
+ transform: translateY(-0.5rem) scale(0.95);
207
+ }
164
208
  .qsel-panel.is-up {
165
- transform: translateY(8px) scale(0.98);
209
+ transform: translateY(0.5rem) scale(0.98);
166
210
  transform-origin: bottom center;
167
211
  }
168
212
  .qsel-panel.is-up.is-open {
169
213
  transform: translateY(0) scale(1);
170
214
  }
171
- /* 半透明磨砂:默认开启(构造时挂 is-frosted)。关闭时回退为上方不透明实体面板 */
215
+ /* 磨砂半透明面板;无此类时为不透明实体面板 */
172
216
  .qsel-panel.is-frosted {
173
217
  background: color-mix(in srgb, var(--qsel-card) 72%, transparent);
174
218
  -webkit-backdrop-filter: blur(20px) saturate(140%);
175
219
  backdrop-filter: blur(20px) saturate(140%);
176
220
  }
177
221
 
178
- /* ============================================================
179
- ⑤ 选项列表
180
- ============================================================ */
222
+ /* 悬停移出倒计时进度条 */
223
+ .qsel-hover-bar {
224
+ position: absolute;
225
+ left: 0;
226
+ bottom: 0;
227
+ z-index: 1;
228
+ width: 100%;
229
+ height: 3px;
230
+ background: color-mix(in srgb, var(--qsel-teal) 22%, transparent);
231
+ opacity: 0;
232
+ pointer-events: none;
233
+ }
234
+ .qsel-hover-bar::after {
235
+ content: "";
236
+ position: absolute;
237
+ inset: 0;
238
+ background: var(--qsel-teal);
239
+ transform-origin: left center;
240
+ transform: scaleX(1);
241
+ }
242
+ /* 移出后进度条在延时时间内收缩归零 */
243
+ .qsel-panel.is-hover-closing .qsel-hover-bar {
244
+ opacity: 1;
245
+ transition: opacity 0.15s ease;
246
+ }
247
+ .qsel-panel.is-hover-closing .qsel-hover-bar::after {
248
+ animation: qsel-hover-countdown var(--qsel-hover-ms, 3000ms) linear forwards;
249
+ }
250
+ /* 向上展开时进度条贴顶部,从右向左收缩 */
251
+ .qsel-panel.is-up .qsel-hover-bar {
252
+ bottom: auto;
253
+ top: 0;
254
+ }
255
+ .qsel-panel.is-up .qsel-hover-bar::after {
256
+ transform-origin: right center;
257
+ }
258
+ @keyframes qsel-hover-countdown {
259
+ from {
260
+ transform: scaleX(1);
261
+ }
262
+ to {
263
+ transform: scaleX(0);
264
+ }
265
+ }
266
+
267
+ /* 选项列表 */
181
268
  .qsel-list {
182
- padding: 6px;
183
- max-height: 320px;
269
+ padding: var(--qw-space-2);
270
+ max-height: 20rem;
184
271
  overflow-y: auto;
185
272
  overscroll-behavior: contain;
186
- /* 滚动条默认隐藏:面板开/关的 scale+opacity 动画期,滚动条在真实 GPU 合成
187
- 会闪一下(headless 软件渲染测不到)。隐藏后动画期无滚动条渲染;hover /
188
- 键盘聚焦时显示细滚动条,滚轮/触摸滚动不受影响。 */
273
+ /* 默认隐藏滚动条:面板缩放淡入淡出时滚动条会闪一下;悬停或键盘聚焦时再显示细滚动条 */
189
274
  scrollbar-width: none;
190
275
  }
191
276
  .qsel-list:hover,
@@ -212,9 +297,9 @@
212
297
  position: relative;
213
298
  display: flex;
214
299
  align-items: center;
215
- gap: 10px;
216
- padding: 9px 10px;
217
- border-radius: 10px;
300
+ gap: var(--qw-space-2);
301
+ padding: var(--qw-space-2) var(--qw-space-3);
302
+ border-radius: var(--qw-radius-md);
218
303
  cursor: pointer;
219
304
  color: var(--qsel-ink);
220
305
  transition:
@@ -224,12 +309,12 @@
224
309
  .qsel-opt + .qsel-opt {
225
310
  margin-top: 1px;
226
311
  }
227
- /* 悬浮反馈:底色 + 轻微上浮 + 右侧箭头(纯 :hover,跟手不粘滞) */
312
+ /* 悬浮反馈:底色与轻微上浮 */
228
313
  .qsel-opt:hover {
229
314
  background: var(--qsel-hover);
230
315
  transform: translateY(-1px);
231
316
  }
232
- /* 键盘焦点态:左侧黛青色条 */
317
+ /* 左侧色条,焦点或高亮时展开 */
233
318
  .qsel-opt::before {
234
319
  content: "";
235
320
  position: absolute;
@@ -248,14 +333,59 @@
248
333
  .qsel-opt.is-active::before {
249
334
  transform: translateY(-50%) scaleY(1);
250
335
  }
251
- /* 悬浮箭头:非选中项 hover 时浮现(选中项 hover 改为放大对勾,避免双指示器) */
336
+ /* 活动项高亮(由外部 activeIndex 指定,区别于选中态) */
337
+ .qsel-opt.is-highlight {
338
+ background: color-mix(in srgb, var(--qsel-teal) 12%, transparent);
339
+ }
340
+ .qsel-opt.is-highlight::before {
341
+ transform: translateY(-50%) scaleY(1);
342
+ }
343
+ .qsel-opt.is-highlight .qsel-opt-label {
344
+ font-weight: 600;
345
+ color: var(--qsel-teal);
346
+ }
347
+ .qsel-opt.is-highlight .qsel-opt-ico {
348
+ background: var(--qsel-teal);
349
+ color: #fff;
350
+ }
351
+ .qsel-opt.is-highlight:hover {
352
+ background: color-mix(in srgb, var(--qsel-teal) 18%, transparent);
353
+ }
354
+ /* 活动项呼吸脉冲:图标光环与标签明暗交替 */
355
+ .qsel-opt.is-highlight .qsel-opt-ico {
356
+ animation: qsel-breathe-ico 2s ease-in-out infinite;
357
+ }
358
+ .qsel-opt.is-highlight .qsel-opt-label {
359
+ animation: qsel-breathe-label 2s ease-in-out infinite;
360
+ }
361
+ @keyframes qsel-breathe-ico {
362
+ 0%,
363
+ 100% {
364
+ box-shadow: 0 0 0 0 color-mix(in srgb, var(--qsel-teal) 35%, transparent);
365
+ transform: scale(1);
366
+ }
367
+ 50% {
368
+ box-shadow: 0 0 0 4px color-mix(in srgb, var(--qsel-teal) 12%, transparent);
369
+ transform: scale(1.08);
370
+ }
371
+ }
372
+ @keyframes qsel-breathe-label {
373
+ 0%,
374
+ 100% {
375
+ opacity: 1;
376
+ }
377
+ 50% {
378
+ opacity: 0.62;
379
+ }
380
+ }
381
+ /* 非选中项悬停时显示右侧箭头 */
252
382
  .qsel-opt::after {
253
383
  content: "›";
254
384
  position: absolute;
255
- right: 12px;
385
+ right: var(--qw-space-3);
256
386
  top: 50%;
257
- transform: translateY(-50%) translateX(-4px);
258
- font-size: 17px;
387
+ transform: translateY(-50%) translateX(-0.25rem);
388
+ font-size: 1.0625rem;
259
389
  line-height: 1;
260
390
  color: var(--qsel-teal);
261
391
  opacity: 0;
@@ -283,13 +413,13 @@
283
413
  }
284
414
  .qsel-opt-ico {
285
415
  flex: none;
286
- width: 28px;
287
- height: 28px;
416
+ width: 1.75rem;
417
+ height: 1.75rem;
288
418
  display: grid;
289
419
  place-items: center;
290
- border-radius: 8px;
420
+ border-radius: var(--qw-radius-md);
291
421
  font-family: var(--qsel-font-kai);
292
- font-size: 14px;
422
+ font-size: var(--qw-text-md);
293
423
  background: color-mix(in srgb, var(--qsel-ink) 5%, transparent);
294
424
  color: var(--qsel-ink-2);
295
425
  }
@@ -299,7 +429,7 @@
299
429
  }
300
430
  .qsel-opt-label {
301
431
  display: block;
302
- font-size: 13.5px;
432
+ font-size: var(--qw-text-sm);
303
433
  color: var(--qsel-ink);
304
434
  white-space: nowrap;
305
435
  overflow: hidden;
@@ -307,7 +437,7 @@
307
437
  }
308
438
  .qsel-opt-hint {
309
439
  display: block;
310
- font-size: 11px;
440
+ font-size: 0.6875rem;
311
441
  color: var(--qsel-ink-3);
312
442
  margin-top: 1px;
313
443
  white-space: nowrap;
@@ -332,7 +462,7 @@
332
462
  opacity: 1;
333
463
  transform: scale(1);
334
464
  }
335
- /* 选中项悬浮:放大对勾作为反馈(置于本段末尾,保持特异性递增) */
465
+ /* 选中项悬停时放大对勾 */
336
466
  .qsel-opt[aria-selected="true"]:hover .qsel-check {
337
467
  transform: scale(1.2);
338
468
  }
@@ -341,13 +471,11 @@
341
471
  height: 15px;
342
472
  }
343
473
 
344
- /* ============================================================
345
- ⑥ 手风琴错峰关键帧(琴键逐项按下)
346
- ============================================================ */
474
+ /* 入场错峰关键帧:选项逐项按下 */
347
475
  @keyframes qsel-press {
348
476
  from {
349
477
  opacity: 0;
350
- transform: translateY(-14px) scaleY(0.96);
478
+ transform: translateY(-1rem) scaleY(0.96);
351
479
  }
352
480
  to {
353
481
  opacity: 1;
@@ -356,7 +484,7 @@
356
484
  @keyframes qsel-press-up {
357
485
  from {
358
486
  opacity: 0;
359
- transform: translateY(14px) scaleY(0.96);
487
+ transform: translateY(1rem) scaleY(0.96);
360
488
  }
361
489
  to {
362
490
  opacity: 1;
@@ -369,9 +497,7 @@
369
497
  animation-name: qsel-press-up;
370
498
  }
371
499
 
372
- /* ============================================================
373
- ⑦ prefers-reduced-motion:全部动画熔断
374
- ============================================================ */
500
+ /* reduced-motion:关闭全部动画 */
375
501
  @media (prefers-reduced-motion: reduce) {
376
502
  .qsel *,
377
503
  .qsel *::before,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qingwu-ui/select",
3
- "version": "0.9.0-beta.3",
4
- "description": "Framework-agnostic dropdown select for Qingwu UI — single-select, accordion stagger open animation, disabled options, zero dependencies",
3
+ "version": "0.9.0-beta.5",
4
+ "description": "青梧 UI 下拉选择 —— 单选、手风琴错展开合动画、禁用项、零依赖",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
7
7
  "sideEffects": [
@@ -23,7 +23,7 @@
23
23
  "dist"
24
24
  ],
25
25
  "scripts": {
26
- "build": "tsdown && node -e \"require('fs').cpSync('src/style.css','dist/style.css')\"",
26
+ "build": "tsdown && node ../../tooling/build-css.mjs 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",