@sia.soul/sia-react-ui 0.1.111 → 0.1.113

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/dist/index.cjs CHANGED
@@ -468,6 +468,44 @@ var import_react3 = require("react");
468
468
  // src/components/IconCatalog.tsx
469
469
  var import_jsx_runtime3 = require("react/jsx-runtime");
470
470
  var extendedIconPaths = {
471
+ /** 商品资料:立体包装箱,适用于商品与规格数据入口。 */
472
+ package: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "m12 3 9 5v8l-9 5-9-5V8l9-5ZM3 8l9 5 9-5M12 13v8M7.5 5.5l9 5v4" }) }),
473
+ /** 订单:带商品明细的订单单据。 */
474
+ "order-receipt": /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M5 3h14v18l-3-2-4 2-4-2-3 2V3ZM8 7h8M8 11h8M8 15h4" }) }),
475
+ /** 售后单:退回箭头与售后单据,区别于告警文档。 */
476
+ "after-sales": /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M13 21H5V3h10l4 4v4M14 3v5h5M8 7h3M8 11h3M14 15h4a3 3 0 0 1 0 6h-2m-2-6 3-3m-3 3 3 3" }) }),
477
+ /** 库存:仓库及内部货位。 */
478
+ warehouse: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "m3 8 9-5 9 5v13H3V8ZM7 21V11h10v10M7 15h10M7 18h10" }) }),
479
+ /** 店铺商品资料:店铺橱窗中的商品。 */
480
+ "shop-products": /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M3 3h18l-2 5H5L3 3ZM4 8v13h16V8M8 21v-9h8v9M8 16h8M12 12v9" }) }),
481
+ /** 合作方商品:商品资料与合作关系。 */
482
+ "partner-products": /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "m10 3 7 4-7 4-7-4 7-4ZM3 7v8l7 4M10 11v4M17 7v4M14 16h5a2 2 0 0 1 0 4h-2M17 16h-3a2 2 0 0 0 0 4h1" }) }),
483
+ /** 采购退货:采购单与退出箭头。 */
484
+ "purchase-return": /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M11 21H5V3h14v9M8 7h8M8 11h5M8 15h3M14 17h7m-7 0 3-3m-3 3 3 3" }) }),
485
+ /** 采购入库:采购单与进入箭头。 */
486
+ "purchase-inbound": /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M11 21H5V3h14v9M8 7h8M8 11h5M8 15h3M14 17h7m0 0-3-3m3 3-3 3" }) }),
487
+ /** 其它出入库:仓储流入与流出。 */
488
+ "stock-movement": /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "m3 8 9-5 9 5M4 8v13h16V8M7 12h9m0 0-2-2m2 2-2 2M17 17H8m0 0 2-2m-2 2 2 2" }) }),
489
+ /** 库存盘点:库存清单与核对标记。 */
490
+ stocktaking: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M9 4H5v17h14V4h-4M9 3h6v4H9V3ZM8 11h8M8 15h3m2 3 2 2 6-7" }) }),
491
+ /** 平台报文:平台窗口中的结构化数据。 */
492
+ "platform-message": /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
493
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
494
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M3 8h18M6 5.5h.1M9 5.5h.1m0 6.5-3 3 3 3m6-6 3 3-3 3" })
495
+ ] }),
496
+ /** 分析报文:报表窗口中的统计数据,可用于胜算等分析系统。 */
497
+ "analytics-message": /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
498
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
499
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M3 8h18M6 5.5h.1M9 5.5h.1M7 17v-3M12 17v-6M17 17v-4" })
500
+ ] }),
501
+ /** 销售退仓:货物退回仓储。 */
502
+ "sales-return": /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "m3 7 7-4 7 4-7 4-7-4ZM3 7v9l7 5V11M17 7v4M14 15h4a3 3 0 0 1 0 6h-2m-2-6 3-3m-3 3 3 3" }) }),
503
+ /** 销售出库:货物及向外发货箭头。 */
504
+ "sales-outbound": /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "m3 7 7-4 7 4-7 4-7-4ZM3 7v9l7 5V11M17 7v4M13 17h8m0 0-3-3m3 3-3 3" }) }),
505
+ /** 调拨出库:仓库及向外调拨箭头。 */
506
+ "transfer-outbound": /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "m3 8 9-5 9 5M4 8v13h7M20 8v4M8 21V11h8M13 17h8m0 0-3-3m3 3-3 3" }) }),
507
+ /** 调拨入库:仓库及向内调拨箭头。 */
508
+ "transfer-inbound": /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "m3 8 9-5 9 5M4 8v13h7M20 8v4M8 21V11h8M13 17h8m-8 0 3-3m-3 3 3 3" }) }),
471
509
  "notepad-file": /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("g", { transform: "scale(0.0234375)", fill: "currentColor", stroke: "none", children: [
472
510
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M752 80H272c-70.4 0-128 57.6-128 128v608c0 70.4 57.6 128 128 128h353.6c33.6 0 65.6-12.8 91.2-36.8l126.4-126.4c24-24 36.8-56 36.8-91.2V208c0-70.4-57.6-128-128-128zM208 816V208c0-35.2 28.8-64 64-64h480c35.2 0 64 28.8 64 64v464h-96c-70.4 0-128 57.6-128 128v80H272c-35.2 0-64-28.8-64-64z m462.4 44.8c-4.8 4.8-9.6 8-14.4 11.2v-72c0-35.2 28.8-64 64-64h75.2L670.4 860.8z" }),
473
511
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M368 352h288c17.6 0 32-14.4 32-32s-14.4-32-32-32H368c-17.6 0-32 14.4-32 32s14.4 32 32 32z m128 256H368c-17.6 0-32 14.4-32 32s14.4 32 32 32h128c17.6 0 32-14.4 32-32s-14.4-32-32-32z m-128-96h288c17.6 0 32-14.4 32-32s-14.4-32-32-32H368c-17.6 0-32 14.4-32 32s14.4 32 32 32z" })
@@ -950,6 +988,23 @@ var extendedIconPaths = {
950
988
 
951
989
  // src/components/iconBounds.ts
952
990
  var outlineIconBounds = {
991
+ // 业务单据与库存图标原始边界;与目录路径同步,由图标组件统一归一化到 18 单位。
992
+ "package": [3, 3, 18, 18],
993
+ "order-receipt": [5, 3, 14, 18],
994
+ "after-sales": [5, 3, 16, 18],
995
+ "warehouse": [3, 3, 18, 18],
996
+ "shop-products": [3, 3, 18, 18],
997
+ "partner-products": [3, 3, 18, 17],
998
+ "purchase-return": [5, 3, 16, 18],
999
+ "purchase-inbound": [5, 3, 16, 18],
1000
+ "stock-movement": [3, 3, 18, 18],
1001
+ "stocktaking": [5, 3, 16, 18],
1002
+ "platform-message": [3, 3, 18, 18],
1003
+ "analytics-message": [3, 3, 18, 18],
1004
+ "sales-return": [3, 3, 18, 18],
1005
+ "sales-outbound": [3, 3, 18, 18],
1006
+ "transfer-outbound": [3, 3, 18, 18],
1007
+ "transfer-inbound": [3, 3, 18, 18],
953
1008
  "activity": [3, 6, 18, 13],
954
1009
  "align-center": [4, 6, 16, 12],
955
1010
  "align-justify": [4, 6, 16, 12],
@@ -2127,7 +2182,7 @@ function FloatingPanel({ open, title, children, placement = "bottomRight" }) {
2127
2182
  children
2128
2183
  ] }), document.body);
2129
2184
  }
2130
- function SortableList({ items, renderItem, onOrderChange, direction = "horizontal", disabled = false }) {
2185
+ function SortableList({ items, renderItem, onOrderChange, direction = "horizontal", disabled = false, handlePlacement = "before", handleContent }) {
2131
2186
  const [dragging, setDragging] = (0, import_react9.useState)(null);
2132
2187
  const [target, setTarget] = (0, import_react9.useState)(null);
2133
2188
  const clear = () => {
@@ -2149,60 +2204,63 @@ function SortableList({ items, renderItem, onOrderChange, direction = "horizonta
2149
2204
  }, [disabled, dragging, items]);
2150
2205
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `sia-sortable-list sia-sortable-list--${direction}`, role: "list", onDragLeave: (event) => {
2151
2206
  if (!event.currentTarget.contains(event.relatedTarget)) setTarget(null);
2152
- }, children: items.map((key, index) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2153
- "div",
2154
- {
2155
- role: "listitem",
2156
- className: `sia-sortable-list__item${dragging === key ? " is-dragging" : ""}${target === index ? " is-drop-before" : ""}${target === items.length && index === items.length - 1 ? " is-drop-after" : ""}`,
2157
- onDragOver: (event) => {
2158
- if (disabled || dragging === null) return;
2159
- event.preventDefault();
2160
- event.dataTransfer.dropEffect = "move";
2161
- const rect = event.currentTarget.getBoundingClientRect();
2162
- setTarget(index + (direction === "horizontal" ? Number(event.clientX > rect.left + rect.width / 2) : Number(event.clientY > rect.top + rect.height / 2)));
2163
- },
2164
- onDrop: (event) => {
2165
- if (dragging === null || disabled) return;
2166
- event.preventDefault();
2167
- if (target !== null) move(dragging, target);
2168
- clear();
2169
- },
2170
- children: [
2171
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2172
- "button",
2173
- {
2174
- type: "button",
2175
- className: "sia-sortable-list__handle",
2176
- draggable: !disabled,
2177
- disabled,
2178
- "aria-label": `\u8C03\u6574\u7B2C ${index + 1} \u9879\u987A\u5E8F`,
2179
- title: "\u62D6\u52A8\u6392\u5E8F\uFF0C\u6216\u4F7F\u7528\u65B9\u5411\u952E\u79FB\u52A8",
2180
- onDragStart: (event) => {
2181
- if (disabled) {
2182
- event.preventDefault();
2183
- return;
2184
- }
2185
- setDragging(key);
2186
- event.dataTransfer.effectAllowed = "move";
2187
- event.dataTransfer.setData("text/plain", String(key));
2188
- },
2189
- onDragEnd: clear,
2190
- onKeyDown: (event) => {
2191
- const previous = direction === "horizontal" ? "ArrowLeft" : "ArrowUp";
2192
- const next = direction === "horizontal" ? "ArrowRight" : "ArrowDown";
2193
- if (event.key === previous || event.key === next) {
2194
- event.preventDefault();
2195
- move(key, event.key === previous ? index - 1 : index + 2);
2196
- }
2197
- },
2198
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { name: "menu", size: 16 })
2207
+ }, children: items.map((key, index) => {
2208
+ const handle = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2209
+ "button",
2210
+ {
2211
+ type: "button",
2212
+ className: `sia-sortable-list__handle${handlePlacement === "custom" ? " sia-sortable-list__handle--custom" : ""}`,
2213
+ draggable: !disabled,
2214
+ disabled,
2215
+ "aria-label": `\u8C03\u6574\u7B2C ${index + 1} \u9879\u987A\u5E8F`,
2216
+ title: "\u62D6\u52A8\u6392\u5E8F\uFF0C\u6216\u4F7F\u7528\u65B9\u5411\u952E\u79FB\u52A8",
2217
+ onDragStart: (event) => {
2218
+ if (disabled) {
2219
+ event.preventDefault();
2220
+ return;
2199
2221
  }
2200
- ),
2201
- renderItem(key, index)
2202
- ]
2203
- },
2204
- key
2205
- )) });
2222
+ setDragging(key);
2223
+ event.dataTransfer.effectAllowed = "move";
2224
+ event.dataTransfer.setData("text/plain", String(key));
2225
+ },
2226
+ onDragEnd: clear,
2227
+ onKeyDown: (event) => {
2228
+ const previous = direction === "horizontal" ? "ArrowLeft" : "ArrowUp";
2229
+ const next = direction === "horizontal" ? "ArrowRight" : "ArrowDown";
2230
+ if (event.key === previous || event.key === next) {
2231
+ event.preventDefault();
2232
+ move(key, event.key === previous ? index - 1 : index + 2);
2233
+ }
2234
+ },
2235
+ children: handleContent ? handleContent(key, index) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { name: "menu", size: 16 })
2236
+ }
2237
+ );
2238
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2239
+ "div",
2240
+ {
2241
+ role: "listitem",
2242
+ className: `sia-sortable-list__item${dragging === key ? " is-dragging" : ""}${target === index ? " is-drop-before" : ""}${target === items.length && index === items.length - 1 ? " is-drop-after" : ""}`,
2243
+ onDragOver: (event) => {
2244
+ if (disabled || dragging === null) return;
2245
+ event.preventDefault();
2246
+ event.dataTransfer.dropEffect = "move";
2247
+ const rect = event.currentTarget.getBoundingClientRect();
2248
+ setTarget(index + (direction === "horizontal" ? Number(event.clientX > rect.left + rect.width / 2) : Number(event.clientY > rect.top + rect.height / 2)));
2249
+ },
2250
+ onDrop: (event) => {
2251
+ if (dragging === null || disabled) return;
2252
+ event.preventDefault();
2253
+ if (target !== null) move(dragging, target);
2254
+ clear();
2255
+ },
2256
+ children: [
2257
+ handlePlacement === "before" ? handle : null,
2258
+ renderItem(key, index, handle)
2259
+ ]
2260
+ },
2261
+ key
2262
+ );
2263
+ }) });
2206
2264
  }
2207
2265
 
2208
2266
  // src/components/Toolbar.tsx
@@ -6611,6 +6669,7 @@ function WindowTitleBar({
6611
6669
  controls = true,
6612
6670
  maximized = false,
6613
6671
  draggable = true,
6672
+ dragMode = "callback",
6614
6673
  disabledActions,
6615
6674
  controlLabels,
6616
6675
  onWindowAction,
@@ -6621,7 +6680,7 @@ function WindowTitleBar({
6621
6680
  }) {
6622
6681
  function handleMouseDown(event) {
6623
6682
  onMouseDown?.(event);
6624
- if (event.defaultPrevented || !draggable || !onWindowAction || event.button !== 0) return;
6683
+ if (event.defaultPrevented || !draggable || dragMode === "native" || !onWindowAction || event.button !== 0) return;
6625
6684
  const target = event.target;
6626
6685
  if (!(target instanceof Element) || target.closest(NON_DRAG_SELECTOR)) return;
6627
6686
  event.preventDefault();
@@ -6642,6 +6701,7 @@ function WindowTitleBar({
6642
6701
  {
6643
6702
  className: `sia-window-titlebar ${className}`.trim(),
6644
6703
  "data-actions-align": actionsAlign,
6704
+ "data-drag-mode": draggable ? dragMode : void 0,
6645
6705
  onMouseDown: handleMouseDown,
6646
6706
  ...withTitleTooltip(props),
6647
6707
  children: [
package/dist/index.css CHANGED
@@ -2650,6 +2650,7 @@ fieldset:disabled .sia-input-number__floating-placeholder {
2650
2650
  cursor: default;
2651
2651
  }
2652
2652
  .sia-card.sia-card--selected {
2653
+ background: color-mix(in srgb, var(--sia-color-primary) 10%, var(--sia-color-surface));
2653
2654
  border-color: var(--sia-color-primary);
2654
2655
  box-shadow: inset 0 0 0 1px var(--sia-color-primary);
2655
2656
  }
@@ -5555,6 +5556,14 @@ fieldset:disabled .sia-input-number__floating-placeholder {
5555
5556
  cursor: not-allowed;
5556
5557
  opacity: .5;
5557
5558
  }
5559
+ .sia-sortable-list__handle--custom {
5560
+ justify-content: flex-start;
5561
+ padding: 0;
5562
+ font: inherit;
5563
+ color: inherit;
5564
+ background: transparent;
5565
+ text-align: start;
5566
+ }
5558
5567
  .sia-sortable-list__item.is-drop-before::before,
5559
5568
  .sia-sortable-list__item.is-drop-after::after {
5560
5569
  content: "";
@@ -5910,6 +5919,14 @@ body:has(.sia-window-frame[data-sia-text-selectable=false]) img {
5910
5919
  flex: 1 1 auto;
5911
5920
  cursor: default;
5912
5921
  }
5922
+ .sia-window-titlebar[data-drag-mode=native],
5923
+ .sia-window-titlebar[data-drag-mode=native] * {
5924
+ app-region: drag;
5925
+ }
5926
+ .sia-window-titlebar[data-drag-mode=native] :is(button, input, textarea, select, a, label, summary, [contenteditable=true], [tabindex]:not([tabindex="-1"]), [role=button], [role=link], [role=menuitem], [role=tab], [data-sia-window-no-drag]),
5927
+ .sia-window-titlebar[data-drag-mode=native] :is(button, input, textarea, select, a, label, summary, [contenteditable=true], [tabindex]:not([tabindex="-1"]), [role=button], [role=link], [role=menuitem], [role=tab], [data-sia-window-no-drag]) * {
5928
+ app-region: no-drag;
5929
+ }
5913
5930
  .sia-window-controls {
5914
5931
  box-sizing: border-box;
5915
5932
  display: flex;
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { HTMLAttributes, ReactNode, CSSProperties, ElementType, FormHTMLAttributes, InputHTMLAttributes, ChangeEvent, TextareaHTMLAttributes, MouseEvent, Key, PointerEvent, Ref, ReactElement, ButtonHTMLAttributes, RefObject } from 'react';
3
- import { T as TagStatus, B as BadgeProps } from './core-CUF63Lgw.cjs';
4
- export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, an as Spin, ao as SpinProps, ap as StepItem, aq as StepStatus, ar as Steps, as as StepsProps, at as TabItem, au as Tabs, av as TabsContextMenuClickInfo, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, aD as TagVariant, aE as Timeline, aF as TimelineItem, aG as TimelineProps, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, aK as Tooltip, aL as TooltipProps, aM as Tour, aN as TourProps, aO as TourStep, aP as Tree, aQ as TreeDropPosition, aR as TreeKey, aS as TreeNode, aT as TreeProps, aU as Typography, aV as TypographyLinkProps, aW as TypographyProps, aX as TypographyTitleProps, aY as TypographyType, aZ as Upload, a_ as UploadChangeInfo, a$ as UploadDraggerProps, b0 as UploadFile, b1 as UploadFileStatus, b2 as UploadHttpRequest, b3 as UploadItemActions, b4 as UploadProps, b5 as UploadRef, b6 as UploadRejectInfo, b7 as UploadRequestHandle, b8 as UploadRequestOptions, b9 as Watermark, ba as WatermarkFont, bb as WatermarkProps, bc as message, bd as notification } from './core-CUF63Lgw.cjs';
3
+ import { T as TagStatus, B as BadgeProps } from './core-CEaTbhWd.cjs';
4
+ export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, an as Spin, ao as SpinProps, ap as StepItem, aq as StepStatus, ar as Steps, as as StepsProps, at as TabItem, au as Tabs, av as TabsContextMenuClickInfo, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, aD as TagVariant, aE as Timeline, aF as TimelineItem, aG as TimelineProps, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, aK as Tooltip, aL as TooltipProps, aM as Tour, aN as TourProps, aO as TourStep, aP as Tree, aQ as TreeDropPosition, aR as TreeKey, aS as TreeNode, aT as TreeProps, aU as Typography, aV as TypographyLinkProps, aW as TypographyProps, aX as TypographyTitleProps, aY as TypographyType, aZ as Upload, a_ as UploadChangeInfo, a$ as UploadDraggerProps, b0 as UploadFile, b1 as UploadFileStatus, b2 as UploadHttpRequest, b3 as UploadItemActions, b4 as UploadProps, b5 as UploadRef, b6 as UploadRejectInfo, b7 as UploadRequestHandle, b8 as UploadRequestOptions, b9 as Watermark, ba as WatermarkFont, bb as WatermarkProps, bc as message, bd as notification } from './core-CEaTbhWd.cjs';
5
5
  import { C as ControlSize, I as InputPlaceholderMode, a as ControlStatus } from './shared-Bx4B28Wh.cjs';
6
6
  import { B as ButtonProps, a as ButtonSize } from './Button-O_pNB3SQ.cjs';
7
7
  export { b as Button, c as ButtonVariant } from './Button-O_pNB3SQ.cjs';
@@ -78,8 +78,12 @@ type SortableKey = string | number;
78
78
  interface SortableListProps {
79
79
  /** 按当前顺序排列的唯一稳定标识,不允许重复。 */
80
80
  items: readonly SortableKey[];
81
- /** 根据标识渲染条目内容;拖动仅由框架手柄发起,内容输入控件保持原生操作。 */
82
- renderItem: (key: SortableKey, index: number) => ReactNode;
81
+ /** 根据标识渲染条目内容;第三个参数为框架手柄,handlePlacement="custom" 时须将其放入标题等位置;拖动和键盘排序仅由该手柄发起。 */
82
+ renderItem: (key: SortableKey, index: number, handle: ReactNode) => ReactNode;
83
+ /** 手柄位置;before 在条目前独占一行,custom 由 renderItem 放置框架提供的手柄。@defaultValue "before" */
84
+ handlePlacement?: "before" | "custom";
85
+ /** 手柄的内容,接收稳定标识和当前位置;未指定时显示拖动图标,可返回卡片标题文字。 */
86
+ handleContent?: (key: SortableKey, index: number) => ReactNode;
83
87
  /** 拖放或手柄方向键完成移动时返回新顺序;无变化、取消、禁用时不触发。 */
84
88
  onOrderChange: (items: SortableKey[]) => void;
85
89
  /** 排列方向;横向内容超出时在列表内滚动。@defaultValue "horizontal" */
@@ -88,7 +92,7 @@ interface SortableListProps {
88
92
  disabled?: boolean;
89
93
  }
90
94
  /** 拖放与键盘共用受控顺序,输入控件无需参与拖动事件。 */
91
- declare function SortableList({ items, renderItem, onOrderChange, direction, disabled }: SortableListProps): react.JSX.Element;
95
+ declare function SortableList({ items, renderItem, onOrderChange, direction, disabled, handlePlacement, handleContent }: SortableListProps): react.JSX.Element;
92
96
 
93
97
  /** 警告提示的状态类型。 */
94
98
  type AlertStatus = "info" | "success" | "warning" | "error";
@@ -636,6 +640,13 @@ interface WindowTitleBarProps extends HTMLAttributes<HTMLElement> {
636
640
  * @defaultValue true
637
641
  */
638
642
  draggable?: boolean;
643
+ /**
644
+ * 标题栏拖动方式,默认 callback:鼠标按下时通过 onWindowAction 通知宿主拖动或双击最大化。
645
+ * native 使用 app-region CSS,由支持该能力的桌面宿主管理移动、双击和系统菜单,不发送拖动或双击回调;
646
+ * WebView2 宿主须在导航前启用 IsNonClientRegionSupportEnabled,普通浏览器不支持原生拖动。
647
+ * draggable=false 时两种方式均禁用;标题栏按钮、操作区和 data-sia-window-no-drag 区域始终排除。
648
+ */
649
+ dragMode?: "callback" | "native";
639
650
  /** 不允许执行的窗口操作集合。 */
640
651
  disabledActions?: readonly WindowControlAction[];
641
652
  /** 窗口控制按钮的文案。 */
@@ -648,7 +659,7 @@ declare function WindowFrame({ titleBar, textSelectable, className, children, ..
648
659
  /** 窗口控制按钮组件。 */
649
660
  declare function WindowControls({ maximized, showMinimize, showMaximize, showClose, disabledActions, labels, onAction, className, ...props }: WindowControlsProps): react.JSX.Element;
650
661
  /** 窗口标题栏组件。 */
651
- declare function WindowTitleBar({ leading, actions, actionsAlign, controls, maximized, draggable, disabledActions, controlLabels, onWindowAction, className, children, onMouseDown, ...props }: WindowTitleBarProps): react.JSX.Element;
662
+ declare function WindowTitleBar({ leading, actions, actionsAlign, controls, maximized, draggable, dragMode, disabledActions, controlLabels, onWindowAction, className, children, onMouseDown, ...props }: WindowTitleBarProps): react.JSX.Element;
652
663
 
653
664
  /** 抽屉的位置类型。 */
654
665
  type DrawerPlacement = "left" | "right" | "top" | "bottom";
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { HTMLAttributes, ReactNode, CSSProperties, ElementType, FormHTMLAttributes, InputHTMLAttributes, ChangeEvent, TextareaHTMLAttributes, MouseEvent, Key, PointerEvent, Ref, ReactElement, ButtonHTMLAttributes, RefObject } from 'react';
3
- import { T as TagStatus, B as BadgeProps } from './core-Ce07FS2N.js';
4
- export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, an as Spin, ao as SpinProps, ap as StepItem, aq as StepStatus, ar as Steps, as as StepsProps, at as TabItem, au as Tabs, av as TabsContextMenuClickInfo, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, aD as TagVariant, aE as Timeline, aF as TimelineItem, aG as TimelineProps, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, aK as Tooltip, aL as TooltipProps, aM as Tour, aN as TourProps, aO as TourStep, aP as Tree, aQ as TreeDropPosition, aR as TreeKey, aS as TreeNode, aT as TreeProps, aU as Typography, aV as TypographyLinkProps, aW as TypographyProps, aX as TypographyTitleProps, aY as TypographyType, aZ as Upload, a_ as UploadChangeInfo, a$ as UploadDraggerProps, b0 as UploadFile, b1 as UploadFileStatus, b2 as UploadHttpRequest, b3 as UploadItemActions, b4 as UploadProps, b5 as UploadRef, b6 as UploadRejectInfo, b7 as UploadRequestHandle, b8 as UploadRequestOptions, b9 as Watermark, ba as WatermarkFont, bb as WatermarkProps, bc as message, bd as notification } from './core-Ce07FS2N.js';
3
+ import { T as TagStatus, B as BadgeProps } from './core-C6muCCSS.js';
4
+ export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, an as Spin, ao as SpinProps, ap as StepItem, aq as StepStatus, ar as Steps, as as StepsProps, at as TabItem, au as Tabs, av as TabsContextMenuClickInfo, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, aD as TagVariant, aE as Timeline, aF as TimelineItem, aG as TimelineProps, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, aK as Tooltip, aL as TooltipProps, aM as Tour, aN as TourProps, aO as TourStep, aP as Tree, aQ as TreeDropPosition, aR as TreeKey, aS as TreeNode, aT as TreeProps, aU as Typography, aV as TypographyLinkProps, aW as TypographyProps, aX as TypographyTitleProps, aY as TypographyType, aZ as Upload, a_ as UploadChangeInfo, a$ as UploadDraggerProps, b0 as UploadFile, b1 as UploadFileStatus, b2 as UploadHttpRequest, b3 as UploadItemActions, b4 as UploadProps, b5 as UploadRef, b6 as UploadRejectInfo, b7 as UploadRequestHandle, b8 as UploadRequestOptions, b9 as Watermark, ba as WatermarkFont, bb as WatermarkProps, bc as message, bd as notification } from './core-C6muCCSS.js';
5
5
  import { C as ControlSize, I as InputPlaceholderMode, a as ControlStatus } from './shared-Bx4B28Wh.js';
6
6
  import { B as ButtonProps, a as ButtonSize } from './Button-BiL3Wjsd.js';
7
7
  export { b as Button, c as ButtonVariant } from './Button-BiL3Wjsd.js';
@@ -78,8 +78,12 @@ type SortableKey = string | number;
78
78
  interface SortableListProps {
79
79
  /** 按当前顺序排列的唯一稳定标识,不允许重复。 */
80
80
  items: readonly SortableKey[];
81
- /** 根据标识渲染条目内容;拖动仅由框架手柄发起,内容输入控件保持原生操作。 */
82
- renderItem: (key: SortableKey, index: number) => ReactNode;
81
+ /** 根据标识渲染条目内容;第三个参数为框架手柄,handlePlacement="custom" 时须将其放入标题等位置;拖动和键盘排序仅由该手柄发起。 */
82
+ renderItem: (key: SortableKey, index: number, handle: ReactNode) => ReactNode;
83
+ /** 手柄位置;before 在条目前独占一行,custom 由 renderItem 放置框架提供的手柄。@defaultValue "before" */
84
+ handlePlacement?: "before" | "custom";
85
+ /** 手柄的内容,接收稳定标识和当前位置;未指定时显示拖动图标,可返回卡片标题文字。 */
86
+ handleContent?: (key: SortableKey, index: number) => ReactNode;
83
87
  /** 拖放或手柄方向键完成移动时返回新顺序;无变化、取消、禁用时不触发。 */
84
88
  onOrderChange: (items: SortableKey[]) => void;
85
89
  /** 排列方向;横向内容超出时在列表内滚动。@defaultValue "horizontal" */
@@ -88,7 +92,7 @@ interface SortableListProps {
88
92
  disabled?: boolean;
89
93
  }
90
94
  /** 拖放与键盘共用受控顺序,输入控件无需参与拖动事件。 */
91
- declare function SortableList({ items, renderItem, onOrderChange, direction, disabled }: SortableListProps): react.JSX.Element;
95
+ declare function SortableList({ items, renderItem, onOrderChange, direction, disabled, handlePlacement, handleContent }: SortableListProps): react.JSX.Element;
92
96
 
93
97
  /** 警告提示的状态类型。 */
94
98
  type AlertStatus = "info" | "success" | "warning" | "error";
@@ -636,6 +640,13 @@ interface WindowTitleBarProps extends HTMLAttributes<HTMLElement> {
636
640
  * @defaultValue true
637
641
  */
638
642
  draggable?: boolean;
643
+ /**
644
+ * 标题栏拖动方式,默认 callback:鼠标按下时通过 onWindowAction 通知宿主拖动或双击最大化。
645
+ * native 使用 app-region CSS,由支持该能力的桌面宿主管理移动、双击和系统菜单,不发送拖动或双击回调;
646
+ * WebView2 宿主须在导航前启用 IsNonClientRegionSupportEnabled,普通浏览器不支持原生拖动。
647
+ * draggable=false 时两种方式均禁用;标题栏按钮、操作区和 data-sia-window-no-drag 区域始终排除。
648
+ */
649
+ dragMode?: "callback" | "native";
639
650
  /** 不允许执行的窗口操作集合。 */
640
651
  disabledActions?: readonly WindowControlAction[];
641
652
  /** 窗口控制按钮的文案。 */
@@ -648,7 +659,7 @@ declare function WindowFrame({ titleBar, textSelectable, className, children, ..
648
659
  /** 窗口控制按钮组件。 */
649
660
  declare function WindowControls({ maximized, showMinimize, showMaximize, showClose, disabledActions, labels, onAction, className, ...props }: WindowControlsProps): react.JSX.Element;
650
661
  /** 窗口标题栏组件。 */
651
- declare function WindowTitleBar({ leading, actions, actionsAlign, controls, maximized, draggable, disabledActions, controlLabels, onWindowAction, className, children, onMouseDown, ...props }: WindowTitleBarProps): react.JSX.Element;
662
+ declare function WindowTitleBar({ leading, actions, actionsAlign, controls, maximized, draggable, dragMode, disabledActions, controlLabels, onWindowAction, className, children, onMouseDown, ...props }: WindowTitleBarProps): react.JSX.Element;
652
663
 
653
664
  /** 抽屉的位置类型。 */
654
665
  type DrawerPlacement = "left" | "right" | "top" | "bottom";
package/dist/index.js CHANGED
@@ -81,7 +81,7 @@ import {
81
81
  Watermark,
82
82
  message,
83
83
  notification
84
- } from "./chunk-XRHL56EV.js";
84
+ } from "./chunk-KJWE5H3S.js";
85
85
  import "./chunk-RX242MUO.js";
86
86
  import {
87
87
  MarkdownEditor
@@ -89,12 +89,12 @@ import {
89
89
  import {
90
90
  RichTextContent,
91
91
  RichTextEditor
92
- } from "./chunk-MMSYWDTR.js";
92
+ } from "./chunk-SVAC7ZJP.js";
93
93
  import {
94
94
  DatePicker,
95
95
  SelectDateRange,
96
96
  TimePanel
97
- } from "./chunk-OJ2WDC66.js";
97
+ } from "./chunk-74LRPSE7.js";
98
98
  import {
99
99
  Checkbox,
100
100
  FloatingScrollbarProvider,
@@ -106,14 +106,14 @@ import {
106
106
  Tooltip,
107
107
  Tree,
108
108
  useScrollbarProximity
109
- } from "./chunk-D3HXXEEZ.js";
109
+ } from "./chunk-TENCZ54M.js";
110
110
  import {
111
111
  Dropdown,
112
112
  Input,
113
113
  Menu,
114
114
  Segmented,
115
115
  Steps
116
- } from "./chunk-4TTHKFJ7.js";
116
+ } from "./chunk-NOBJVU2S.js";
117
117
  import {
118
118
  TextArea
119
119
  } from "./chunk-SCEHVGKV.js";
@@ -124,7 +124,7 @@ import {
124
124
  Modal,
125
125
  OverlayPortal,
126
126
  useOverlayLifecycle
127
- } from "./chunk-QV3AP6A2.js";
127
+ } from "./chunk-VFGQLRS6.js";
128
128
  import {
129
129
  Button
130
130
  } from "./chunk-CZ2ITBRW.js";
@@ -209,7 +209,7 @@ function FloatingPanel({ open, title, children, placement = "bottomRight" }) {
209
209
  children
210
210
  ] }), document.body);
211
211
  }
212
- function SortableList({ items, renderItem, onOrderChange, direction = "horizontal", disabled = false }) {
212
+ function SortableList({ items, renderItem, onOrderChange, direction = "horizontal", disabled = false, handlePlacement = "before", handleContent }) {
213
213
  const [dragging, setDragging] = useState2(null);
214
214
  const [target, setTarget] = useState2(null);
215
215
  const clear = () => {
@@ -231,60 +231,63 @@ function SortableList({ items, renderItem, onOrderChange, direction = "horizonta
231
231
  }, [disabled, dragging, items]);
232
232
  return /* @__PURE__ */ jsx2("div", { className: `sia-sortable-list sia-sortable-list--${direction}`, role: "list", onDragLeave: (event) => {
233
233
  if (!event.currentTarget.contains(event.relatedTarget)) setTarget(null);
234
- }, children: items.map((key, index) => /* @__PURE__ */ jsxs2(
235
- "div",
236
- {
237
- role: "listitem",
238
- className: `sia-sortable-list__item${dragging === key ? " is-dragging" : ""}${target === index ? " is-drop-before" : ""}${target === items.length && index === items.length - 1 ? " is-drop-after" : ""}`,
239
- onDragOver: (event) => {
240
- if (disabled || dragging === null) return;
241
- event.preventDefault();
242
- event.dataTransfer.dropEffect = "move";
243
- const rect = event.currentTarget.getBoundingClientRect();
244
- setTarget(index + (direction === "horizontal" ? Number(event.clientX > rect.left + rect.width / 2) : Number(event.clientY > rect.top + rect.height / 2)));
245
- },
246
- onDrop: (event) => {
247
- if (dragging === null || disabled) return;
248
- event.preventDefault();
249
- if (target !== null) move(dragging, target);
250
- clear();
251
- },
252
- children: [
253
- /* @__PURE__ */ jsx2(
254
- "button",
255
- {
256
- type: "button",
257
- className: "sia-sortable-list__handle",
258
- draggable: !disabled,
259
- disabled,
260
- "aria-label": `\u8C03\u6574\u7B2C ${index + 1} \u9879\u987A\u5E8F`,
261
- title: "\u62D6\u52A8\u6392\u5E8F\uFF0C\u6216\u4F7F\u7528\u65B9\u5411\u952E\u79FB\u52A8",
262
- onDragStart: (event) => {
263
- if (disabled) {
264
- event.preventDefault();
265
- return;
266
- }
267
- setDragging(key);
268
- event.dataTransfer.effectAllowed = "move";
269
- event.dataTransfer.setData("text/plain", String(key));
270
- },
271
- onDragEnd: clear,
272
- onKeyDown: (event) => {
273
- const previous = direction === "horizontal" ? "ArrowLeft" : "ArrowUp";
274
- const next = direction === "horizontal" ? "ArrowRight" : "ArrowDown";
275
- if (event.key === previous || event.key === next) {
276
- event.preventDefault();
277
- move(key, event.key === previous ? index - 1 : index + 2);
278
- }
279
- },
280
- children: /* @__PURE__ */ jsx2(Icon, { name: "menu", size: 16 })
234
+ }, children: items.map((key, index) => {
235
+ const handle = /* @__PURE__ */ jsx2(
236
+ "button",
237
+ {
238
+ type: "button",
239
+ className: `sia-sortable-list__handle${handlePlacement === "custom" ? " sia-sortable-list__handle--custom" : ""}`,
240
+ draggable: !disabled,
241
+ disabled,
242
+ "aria-label": `\u8C03\u6574\u7B2C ${index + 1} \u9879\u987A\u5E8F`,
243
+ title: "\u62D6\u52A8\u6392\u5E8F\uFF0C\u6216\u4F7F\u7528\u65B9\u5411\u952E\u79FB\u52A8",
244
+ onDragStart: (event) => {
245
+ if (disabled) {
246
+ event.preventDefault();
247
+ return;
281
248
  }
282
- ),
283
- renderItem(key, index)
284
- ]
285
- },
286
- key
287
- )) });
249
+ setDragging(key);
250
+ event.dataTransfer.effectAllowed = "move";
251
+ event.dataTransfer.setData("text/plain", String(key));
252
+ },
253
+ onDragEnd: clear,
254
+ onKeyDown: (event) => {
255
+ const previous = direction === "horizontal" ? "ArrowLeft" : "ArrowUp";
256
+ const next = direction === "horizontal" ? "ArrowRight" : "ArrowDown";
257
+ if (event.key === previous || event.key === next) {
258
+ event.preventDefault();
259
+ move(key, event.key === previous ? index - 1 : index + 2);
260
+ }
261
+ },
262
+ children: handleContent ? handleContent(key, index) : /* @__PURE__ */ jsx2(Icon, { name: "menu", size: 16 })
263
+ }
264
+ );
265
+ return /* @__PURE__ */ jsxs2(
266
+ "div",
267
+ {
268
+ role: "listitem",
269
+ className: `sia-sortable-list__item${dragging === key ? " is-dragging" : ""}${target === index ? " is-drop-before" : ""}${target === items.length && index === items.length - 1 ? " is-drop-after" : ""}`,
270
+ onDragOver: (event) => {
271
+ if (disabled || dragging === null) return;
272
+ event.preventDefault();
273
+ event.dataTransfer.dropEffect = "move";
274
+ const rect = event.currentTarget.getBoundingClientRect();
275
+ setTarget(index + (direction === "horizontal" ? Number(event.clientX > rect.left + rect.width / 2) : Number(event.clientY > rect.top + rect.height / 2)));
276
+ },
277
+ onDrop: (event) => {
278
+ if (dragging === null || disabled) return;
279
+ event.preventDefault();
280
+ if (target !== null) move(dragging, target);
281
+ clear();
282
+ },
283
+ children: [
284
+ handlePlacement === "before" ? handle : null,
285
+ renderItem(key, index, handle)
286
+ ]
287
+ },
288
+ key
289
+ );
290
+ }) });
288
291
  }
289
292
 
290
293
  // src/components/Alert.tsx
@@ -1316,6 +1319,7 @@ function WindowTitleBar({
1316
1319
  controls = true,
1317
1320
  maximized = false,
1318
1321
  draggable = true,
1322
+ dragMode = "callback",
1319
1323
  disabledActions,
1320
1324
  controlLabels,
1321
1325
  onWindowAction,
@@ -1326,7 +1330,7 @@ function WindowTitleBar({
1326
1330
  }) {
1327
1331
  function handleMouseDown(event) {
1328
1332
  onMouseDown?.(event);
1329
- if (event.defaultPrevented || !draggable || !onWindowAction || event.button !== 0) return;
1333
+ if (event.defaultPrevented || !draggable || dragMode === "native" || !onWindowAction || event.button !== 0) return;
1330
1334
  const target = event.target;
1331
1335
  if (!(target instanceof Element) || target.closest(NON_DRAG_SELECTOR)) return;
1332
1336
  event.preventDefault();
@@ -1347,6 +1351,7 @@ function WindowTitleBar({
1347
1351
  {
1348
1352
  className: `sia-window-titlebar ${className}`.trim(),
1349
1353
  "data-actions-align": actionsAlign,
1354
+ "data-drag-mode": draggable ? dragMode : void 0,
1350
1355
  onMouseDown: handleMouseDown,
1351
1356
  ...withTitleTooltip(props),
1352
1357
  children: [