flowcloudai-ui 0.1.6 → 0.1.7

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.css CHANGED
@@ -1894,6 +1894,9 @@
1894
1894
  flex: 1;
1895
1895
  min-width: 0;
1896
1896
  }
1897
+ .fc-tab-bar__nav-outer[data-tauri-drag-region] {
1898
+ -webkit-app-region: drag;
1899
+ }
1897
1900
  .fc-tab-bar__nav-wrap {
1898
1901
  display: flex;
1899
1902
  align-items: stretch;
@@ -1906,7 +1909,7 @@
1906
1909
  display: none;
1907
1910
  }
1908
1911
  .fc-tab-bar__tab {
1909
- flex: 1 1 0;
1912
+ flex: var(--tab-fill-width, 1) 1 0;
1910
1913
  min-width: var(--tab-min-width, 80px);
1911
1914
  max-width: var(--tab-max-width, 200px);
1912
1915
  position: relative;
package/dist/index.d.ts CHANGED
@@ -455,17 +455,25 @@ interface TabBarProps {
455
455
  /** 是否启用拖拽排序 */
456
456
  draggable?: boolean;
457
457
  /**
458
- * Tab 最小宽度(rem 单位)。
458
+ * Tab 最小宽度比例(相对 screen.width)。
459
459
  * Tab 压缩至此宽度后触发横向滚动。
460
- * @default '7rem'
460
+ * @default 0.07
461
461
  */
462
- minWidth?: string;
462
+ minWidthRatio?: number;
463
463
  /**
464
- * Tab 最大宽度(rem 单位)。
464
+ * Tab 最大宽度比例(相对 screen.width)。
465
465
  * Tab 较少时不超过此宽度。
466
- * @default '15rem'
466
+ * @default 0.15
467
467
  */
468
- maxTabWidth?: string;
468
+ maxTabWidthRatio?: number;
469
+ /**
470
+ * 控制 Tab 是否自动填充容器宽度。
471
+ * - true: flex: 1 1 0,Tab 会自动拉伸填满导航栏(默认行为)
472
+ * - false: flex: 0 1 auto,Tab 只占内容宽度,剩余空间留白
473
+ * 当 tauriDragRegion 为 true 且 fillWidth 为 false 时,空白区域可作为窗口拖拽区。
474
+ * @default true
475
+ */
476
+ fillWidth?: boolean;
469
477
  onChange: (activeKey: string) => void;
470
478
  onClose?: (key: string) => void;
471
479
  onAdd?: () => void;
package/dist/index.js CHANGED
@@ -2098,8 +2098,9 @@ var TabBar = memo4(({
2098
2098
  closable = false,
2099
2099
  addable = false,
2100
2100
  draggable = false,
2101
- minWidth = "7rem",
2102
- maxTabWidth = "15rem",
2101
+ minWidthRatio = 0.07,
2102
+ maxTabWidthRatio = 0.15,
2103
+ fillWidth = true,
2103
2104
  onChange,
2104
2105
  onClose,
2105
2106
  onAdd,
@@ -2212,8 +2213,9 @@ var TabBar = memo4(({
2212
2213
  className
2213
2214
  ].filter(Boolean).join(" ");
2214
2215
  const navWrapStyle = {
2215
- "--tab-min-width": minWidth,
2216
- "--tab-max-width": maxTabWidth
2216
+ "--tab-min-width": `${Math.round(screen.width * minWidthRatio)}px`,
2217
+ "--tab-max-width": `${Math.round(screen.width * maxTabWidthRatio)}px`,
2218
+ "--tab-fill-width": fillWidth ? "1" : "0"
2217
2219
  };
2218
2220
  const dragRegion = tauriDragRegion ? { "data-tauri-drag-region": "" } : {};
2219
2221
  return /* @__PURE__ */ jsx18("div", { className: rootClasses, style: mergedStyle, role: "tablist", ...dragRegion, children: /* @__PURE__ */ jsx18("div", { className: "fc-tab-bar__nav-outer", ...dragRegion, children: /* @__PURE__ */ jsxs13("div", { className: "fc-tab-bar__nav-wrap", ref: navRef, style: navWrapStyle, children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowcloudai-ui",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "type": "module",
5
5
  "author": "flowcloudai",
6
6
  "module": "dist/index.js",