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

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.
@@ -53,7 +53,7 @@ interface CardProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
53
53
  * @defaultValue true
54
54
  */
55
55
  bordered?: boolean;
56
- /** 标题内容,可传入文本或 React 节点。 */
56
+ /** 标题内容,可传入文本或 React 节点;标题分割线在浅色主题下减淡,深色主题下保留边框对比度,卡片收起时隐藏。可通过 --sia-card-header-border-color 覆盖颜色。 */
57
57
  title?: ReactNode;
58
58
  /** 补充说明内容。 */
59
59
  description?: ReactNode;
@@ -53,7 +53,7 @@ interface CardProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
53
53
  * @defaultValue true
54
54
  */
55
55
  bordered?: boolean;
56
- /** 标题内容,可传入文本或 React 节点。 */
56
+ /** 标题内容,可传入文本或 React 节点;标题分割线在浅色主题下减淡,深色主题下保留边框对比度,卡片收起时隐藏。可通过 --sia-card-header-border-color 覆盖颜色。 */
57
57
  title?: ReactNode;
58
58
  /** 补充说明内容。 */
59
59
  description?: ReactNode;
package/dist/core.css CHANGED
@@ -414,6 +414,7 @@ fieldset:disabled .sia-input-number__floating-placeholder {
414
414
  --sia-color-background: #f5f7fa;
415
415
  --sia-color-surface: #ffffff;
416
416
  --sia-color-border: #d9d9d9;
417
+ --sia-card-header-border-color: color-mix(in srgb, var(--sia-color-border) 40%, var(--sia-color-surface));
417
418
  --sia-color-control-hover: #fafafa;
418
419
  --sia-color-control-active: #f0f0f0;
419
420
  --sia-color-focus-ring: rgb(22 119 255 / 22%);
@@ -449,6 +450,7 @@ fieldset:disabled .sia-input-number__floating-placeholder {
449
450
  --sia-color-background: #141414;
450
451
  --sia-color-surface: #1f1f1f;
451
452
  --sia-color-border: #424242;
453
+ --sia-card-header-border-color: var(--sia-color-border);
452
454
  --sia-color-control-hover: #2d2d2d;
453
455
  --sia-color-control-active: #383838;
454
456
  --sia-color-focus-ring: rgb(60 135 230 / 28%);
@@ -2527,7 +2529,7 @@ fieldset:disabled .sia-input-number__floating-placeholder {
2527
2529
  gap: 16px;
2528
2530
  min-height: 40px;
2529
2531
  margin-inline: 16px;
2530
- border-bottom: 1px solid var(--sia-color-border);
2532
+ border-bottom: 1px solid var(--sia-card-header-border-color);
2531
2533
  }
2532
2534
  .sia-card__heading {
2533
2535
  display: flex;
@@ -8002,7 +8004,7 @@ body:has(.sia-window-frame[data-sia-text-selectable=false]) img {
8002
8004
  display: grid;
8003
8005
  grid-template-columns: var(--sia-form-label-width, var(--sia-form-auto-label-width, 0px)) minmax(0, 1fr);
8004
8006
  gap: 8px 14px;
8005
- margin-bottom: 6px;
8007
+ margin-bottom: 8px;
8006
8008
  color: var(--sia-color-text);
8007
8009
  }
8008
8010
  .sia-form-item__label-content {
package/dist/core.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, at as TabItem, au as Tabs, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, T as TagStatus, aD as TagVariant, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, 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, b4 as UploadProps, b8 as UploadRequestOptions, bc as message } from './core-lGT-8jSj.cjs';
1
+ export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, at as TabItem, au as Tabs, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, T as TagStatus, aD as TagVariant, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, 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, b4 as UploadProps, b8 as UploadRequestOptions, bc as message } from './core-CUF63Lgw.cjs';
2
2
  export { b as Button, B as ButtonProps, a as ButtonSize, c as ButtonVariant } from './Button-O_pNB3SQ.cjs';
3
3
  export { e as Modal, d as ModalActionResult, M as ModalOpenConfig, f as ModalProps, g as ModalType, a as OverlayApiHandle, h as Select, S as SelectOption, c as SelectProps, j as SelectValue } from './Select-Cf0xz1Tg.cjs';
4
4
  import 'react';
package/dist/core.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, at as TabItem, au as Tabs, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, T as TagStatus, aD as TagVariant, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, 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, b4 as UploadProps, b8 as UploadRequestOptions, bc as message } from './core-gI4QB_Nz.js';
1
+ export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, at as TabItem, au as Tabs, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, T as TagStatus, aD as TagVariant, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, 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, b4 as UploadProps, b8 as UploadRequestOptions, bc as message } from './core-Ce07FS2N.js';
2
2
  export { b as Button, B as ButtonProps, a as ButtonSize, c as ButtonVariant } from './Button-BiL3Wjsd.js';
3
3
  export { e as Modal, d as ModalActionResult, M as ModalOpenConfig, f as ModalProps, g as ModalType, a as OverlayApiHandle, h as Select, S as SelectOption, c as SelectProps, j as SelectValue } from './Select-BddM4uXC.js';
4
4
  import 'react';
package/dist/game.cjs CHANGED
@@ -876,7 +876,7 @@ function GameHexBattlefield({ engine, state, event, sequence = 0 }) {
876
876
  const replay = event?.playback;
877
877
  const idleUnits = fight?.units.map((u) => ({ ...u })) ?? [{ id: "hero", side: "hero", q: 0, r: 0, hp: engine.stats(state).hp, maxHp: engine.stats(state).hp }, { id: "pet", side: "pet", q: -1, r: 1, hp: 1, maxHp: 1 }];
878
878
  const roster = (unit) => unit.side === "hero" ? { name: state.name, asset: engine.definition.hero, color: "#8bdcff" } : unit.side === "pet" ? { name: pet.name, asset: pet.art, color: "#8ae2b9" } : { name: boss ? map.boss : map.enemy, asset: boss ? map.bossArt : map.enemyArt, color: boss ? "#efb779" : "#e69386" };
879
- const assets = [engine.definition.hero.src, pet.art.src, (boss ? map.bossArt : map.enemyArt).src];
879
+ const assets = [map.scene, engine.definition.hero.src, pet.art.src, (boss ? map.bossArt : map.enemyArt).src];
880
880
  assets.forEach(bitmap);
881
881
  const fit = () => {
882
882
  const dpr = Math.min(devicePixelRatio || 1, 2);
@@ -902,15 +902,13 @@ function GameHexBattlefield({ engine, state, event, sequence = 0 }) {
902
902
  ctx.clearRect(0, 0, 900, 580);
903
903
  ctx.fillStyle = "#111d2a";
904
904
  ctx.fillRect(0, 0, 900, 580);
905
- polygon(ctx, [[0, 100], [92, 62], [145, 113], [178, 79], [235, 130], [0, 215]], "#1a3040", "#253c4c");
906
- polygon(ctx, [[900, 80], [803, 112], [751, 60], [720, 136], [665, 161], [900, 202]], "#1b3240", "#2b4654");
907
- polygon(ctx, [[0, 499], [122, 447], [173, 494], [236, 475], [282, 580], [0, 580]], "#1a2c38", "#2a4250");
908
- polygon(ctx, [[900, 459], [824, 428], [778, 474], [716, 465], [663, 580], [900, 580]], "#192c39", "#2b4253");
905
+ const scene = bitmap(map.scene);
906
+ if (scene) ctx.drawImage(scene, 0, 0, 900, 580);
909
907
  const cells = gameHexCells().sort((a, b) => point(a).y - point(b).y);
910
908
  for (const cell of cells) {
911
909
  const p = point(cell), edge = hexDistance(cell, { q: 0, r: 0 }) === 3, occupied = visual.units.find((u) => u.hp > 0 && hexDistance(u, cell) < 0.1);
912
- const color = occupied?.side === "hero" ? "#314b61" : occupied?.side === "enemy" ? "#493b3b" : (cell.q - cell.r + 12) % 3 === 0 ? "#304554" : "#2a3c4b";
913
- tile(ctx, p.x, p.y, 50, 8, color, edge ? "#53666c" : "#465d70");
910
+ const color = occupied?.side === "hero" ? "#314b61d9" : occupied?.side === "enemy" ? "#493b3bd9" : (cell.q - cell.r + 12) % 3 === 0 ? "#30455480" : "#2a3c4b70";
911
+ tile(ctx, p.x, p.y, 50, 3, color, edge ? "#82918b" : "#637579");
914
912
  if (edge) {
915
913
  text(ctx, "\xB7", p.x, p.y, "#9caa91", 20);
916
914
  }
@@ -1047,8 +1045,8 @@ function GameHexBattlefield({ engine, state, event, sequence = 0 }) {
1047
1045
  plate(ctx, `+${cue.value} \u94DC\u94B1`, p.x, p.y + 25, "#f4d18c");
1048
1046
  text(ctx, cue.label ?? "", p.x, p.y + 47, "#d6dbe0", 11);
1049
1047
  }
1050
- text(ctx, `${map.name} \xB7 \u68CB\u5883`, 100, 31, "#c6bb95", 17);
1051
- text(ctx, "\u516D\u65B9\u6765\u654C \xB7 \u81EA\u52A8\u8FCE\u6218", 777, 31, "#8aa7bd", 12);
1048
+ plate(ctx, `${map.name} \xB7 \u68CB\u5883`, 100, 31, "#e1d4b3");
1049
+ plate(ctx, "\u516D\u65B9\u6765\u654C \xB7 \u81EA\u52A8\u8FCE\u6218", 777, 31, "#bad2df");
1052
1050
  if (t < 1 || assets.some((src) => !images.get(src)?.complete)) frame = requestAnimationFrame(draw);
1053
1051
  };
1054
1052
  frame = requestAnimationFrame(draw);
package/dist/game.css CHANGED
@@ -423,6 +423,7 @@ fieldset:disabled .sia-input-number__floating-placeholder {
423
423
  --sia-color-background: #f5f7fa;
424
424
  --sia-color-surface: #ffffff;
425
425
  --sia-color-border: #d9d9d9;
426
+ --sia-card-header-border-color: color-mix(in srgb, var(--sia-color-border) 40%, var(--sia-color-surface));
426
427
  --sia-color-control-hover: #fafafa;
427
428
  --sia-color-control-active: #f0f0f0;
428
429
  --sia-color-focus-ring: rgb(22 119 255 / 22%);
@@ -458,6 +459,7 @@ fieldset:disabled .sia-input-number__floating-placeholder {
458
459
  --sia-color-background: #141414;
459
460
  --sia-color-surface: #1f1f1f;
460
461
  --sia-color-border: #424242;
462
+ --sia-card-header-border-color: var(--sia-color-border);
461
463
  --sia-color-control-hover: #2d2d2d;
462
464
  --sia-color-control-active: #383838;
463
465
  --sia-color-focus-ring: rgb(60 135 230 / 28%);
@@ -2536,7 +2538,7 @@ fieldset:disabled .sia-input-number__floating-placeholder {
2536
2538
  gap: 16px;
2537
2539
  min-height: 40px;
2538
2540
  margin-inline: 16px;
2539
- border-bottom: 1px solid var(--sia-color-border);
2541
+ border-bottom: 1px solid var(--sia-card-header-border-color);
2540
2542
  }
2541
2543
  .sia-card__heading {
2542
2544
  display: flex;
package/dist/game.d.cts CHANGED
@@ -61,7 +61,7 @@ interface IdleMapDefinition {
61
61
  rewardSlot: string;
62
62
  /** 地图说明。 */
63
63
  desc: string;
64
- /** 不含角色和 UI 的背景位图路径。 */
64
+ /** 不含角色、格线和 UI 的俯视背景位图路径;建议宽高比 900:580,中央留空供棋盘覆盖。六边形战场完整铺满该图,加载失败时使用暗色底板。 */
65
65
  scene: string;
66
66
  /** 普通怪物位图及身份。 */
67
67
  enemyArt: GameUnitAsset;
@@ -484,7 +484,7 @@ declare function IdleGameApp({ definition, className, style, onStateChange }: Id
484
484
  /** 六边形战场输入;共享宿主状态和回合事件,不单独结算伤害或奖励。 */
485
485
  interface GameHexBattlefieldProps extends GameBattleStageProps {
486
486
  }
487
- /** 45° 俯视六边形棋盘;Canvas 绘制平涂地块,PNG/WebP 贴在棋子顶面,所有动效作用于整枚棋子。 */
487
+ /** 45° 俯视六边形棋盘;地图 scene 位图铺在半透明地格下方,PNG/WebP 单位贴在棋子顶面。背景加载失败时保留暗色底板,所有动效作用于整枚棋子。 */
488
488
  declare function GameHexBattlefield({ engine, state, event, sequence }: GameHexBattlefieldProps): react.JSX.Element;
489
489
 
490
490
  /** 能力装配面板;每类单选,选择后通过 configure 命令提交,首领战中只读。 */
package/dist/game.d.ts CHANGED
@@ -61,7 +61,7 @@ interface IdleMapDefinition {
61
61
  rewardSlot: string;
62
62
  /** 地图说明。 */
63
63
  desc: string;
64
- /** 不含角色和 UI 的背景位图路径。 */
64
+ /** 不含角色、格线和 UI 的俯视背景位图路径;建议宽高比 900:580,中央留空供棋盘覆盖。六边形战场完整铺满该图,加载失败时使用暗色底板。 */
65
65
  scene: string;
66
66
  /** 普通怪物位图及身份。 */
67
67
  enemyArt: GameUnitAsset;
@@ -484,7 +484,7 @@ declare function IdleGameApp({ definition, className, style, onStateChange }: Id
484
484
  /** 六边形战场输入;共享宿主状态和回合事件,不单独结算伤害或奖励。 */
485
485
  interface GameHexBattlefieldProps extends GameBattleStageProps {
486
486
  }
487
- /** 45° 俯视六边形棋盘;Canvas 绘制平涂地块,PNG/WebP 贴在棋子顶面,所有动效作用于整枚棋子。 */
487
+ /** 45° 俯视六边形棋盘;地图 scene 位图铺在半透明地格下方,PNG/WebP 单位贴在棋子顶面。背景加载失败时保留暗色底板,所有动效作用于整枚棋子。 */
488
488
  declare function GameHexBattlefield({ engine, state, event, sequence }: GameHexBattlefieldProps): react.JSX.Element;
489
489
 
490
490
  /** 能力装配面板;每类单选,选择后通过 configure 命令提交,首领战中只读。 */
package/dist/game.js CHANGED
@@ -511,7 +511,7 @@ function GameHexBattlefield({ engine, state, event, sequence = 0 }) {
511
511
  const replay = event?.playback;
512
512
  const idleUnits = fight?.units.map((u) => ({ ...u })) ?? [{ id: "hero", side: "hero", q: 0, r: 0, hp: engine.stats(state).hp, maxHp: engine.stats(state).hp }, { id: "pet", side: "pet", q: -1, r: 1, hp: 1, maxHp: 1 }];
513
513
  const roster = (unit) => unit.side === "hero" ? { name: state.name, asset: engine.definition.hero, color: "#8bdcff" } : unit.side === "pet" ? { name: pet.name, asset: pet.art, color: "#8ae2b9" } : { name: boss ? map.boss : map.enemy, asset: boss ? map.bossArt : map.enemyArt, color: boss ? "#efb779" : "#e69386" };
514
- const assets = [engine.definition.hero.src, pet.art.src, (boss ? map.bossArt : map.enemyArt).src];
514
+ const assets = [map.scene, engine.definition.hero.src, pet.art.src, (boss ? map.bossArt : map.enemyArt).src];
515
515
  assets.forEach(bitmap);
516
516
  const fit = () => {
517
517
  const dpr = Math.min(devicePixelRatio || 1, 2);
@@ -537,15 +537,13 @@ function GameHexBattlefield({ engine, state, event, sequence = 0 }) {
537
537
  ctx.clearRect(0, 0, 900, 580);
538
538
  ctx.fillStyle = "#111d2a";
539
539
  ctx.fillRect(0, 0, 900, 580);
540
- polygon(ctx, [[0, 100], [92, 62], [145, 113], [178, 79], [235, 130], [0, 215]], "#1a3040", "#253c4c");
541
- polygon(ctx, [[900, 80], [803, 112], [751, 60], [720, 136], [665, 161], [900, 202]], "#1b3240", "#2b4654");
542
- polygon(ctx, [[0, 499], [122, 447], [173, 494], [236, 475], [282, 580], [0, 580]], "#1a2c38", "#2a4250");
543
- polygon(ctx, [[900, 459], [824, 428], [778, 474], [716, 465], [663, 580], [900, 580]], "#192c39", "#2b4253");
540
+ const scene = bitmap(map.scene);
541
+ if (scene) ctx.drawImage(scene, 0, 0, 900, 580);
544
542
  const cells = gameHexCells().sort((a, b) => point(a).y - point(b).y);
545
543
  for (const cell of cells) {
546
544
  const p = point(cell), edge = hexDistance(cell, { q: 0, r: 0 }) === 3, occupied = visual.units.find((u) => u.hp > 0 && hexDistance(u, cell) < 0.1);
547
- const color = occupied?.side === "hero" ? "#314b61" : occupied?.side === "enemy" ? "#493b3b" : (cell.q - cell.r + 12) % 3 === 0 ? "#304554" : "#2a3c4b";
548
- tile(ctx, p.x, p.y, 50, 8, color, edge ? "#53666c" : "#465d70");
545
+ const color = occupied?.side === "hero" ? "#314b61d9" : occupied?.side === "enemy" ? "#493b3bd9" : (cell.q - cell.r + 12) % 3 === 0 ? "#30455480" : "#2a3c4b70";
546
+ tile(ctx, p.x, p.y, 50, 3, color, edge ? "#82918b" : "#637579");
549
547
  if (edge) {
550
548
  text(ctx, "\xB7", p.x, p.y, "#9caa91", 20);
551
549
  }
@@ -682,8 +680,8 @@ function GameHexBattlefield({ engine, state, event, sequence = 0 }) {
682
680
  plate(ctx, `+${cue.value} \u94DC\u94B1`, p.x, p.y + 25, "#f4d18c");
683
681
  text(ctx, cue.label ?? "", p.x, p.y + 47, "#d6dbe0", 11);
684
682
  }
685
- text(ctx, `${map.name} \xB7 \u68CB\u5883`, 100, 31, "#c6bb95", 17);
686
- text(ctx, "\u516D\u65B9\u6765\u654C \xB7 \u81EA\u52A8\u8FCE\u6218", 777, 31, "#8aa7bd", 12);
683
+ plate(ctx, `${map.name} \xB7 \u68CB\u5883`, 100, 31, "#e1d4b3");
684
+ plate(ctx, "\u516D\u65B9\u6765\u654C \xB7 \u81EA\u52A8\u8FCE\u6218", 777, 31, "#bad2df");
687
685
  if (t < 1 || assets.some((src) => !images.get(src)?.complete)) frame = requestAnimationFrame(draw);
688
686
  };
689
687
  frame = requestAnimationFrame(draw);
package/dist/index.cjs CHANGED
@@ -24679,11 +24679,11 @@ function useQueryFieldSort(keys, enabled, onCommit) {
24679
24679
  }
24680
24680
 
24681
24681
  // src/components/queryFormSettingsUtils.ts
24682
- function reconcileQueryFields(keys, saved = []) {
24682
+ function reconcileQueryFields(keys, saved = [], hideDisabledKeys = []) {
24683
24683
  const stored = new Map(saved.map((item) => [item.key, item]));
24684
24684
  return keys.map((key, index) => ({
24685
24685
  key,
24686
- visible: stored.get(key)?.visible !== false,
24686
+ visible: hideDisabledKeys.includes(key) || stored.get(key)?.visible !== false,
24687
24687
  order: Number.isFinite(stored.get(key)?.order) ? stored.get(key).order : Infinity,
24688
24688
  index
24689
24689
  })).sort((a, b) => a.order - b.order || a.index - b.index).map(({ key, visible }, order) => ({ key, visible, order }));
@@ -24729,7 +24729,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
24729
24729
  if (request !== token.current) return;
24730
24730
  const next = stored ?? { fields: [], defaultCollapsed: current.defaultCollapsed ?? false };
24731
24731
  setSnapshot(next);
24732
- setDraft({ ...next, fields: reconcileQueryFields(latest.current.fields.map((field) => field.key), next.fields) });
24732
+ setDraft({ ...next, fields: reconcileQueryFields(latest.current.fields.map((field) => field.key), next.fields, latest.current.fields.filter((field) => field.hideDisabled).map((field) => field.key)) });
24733
24733
  if (!edit) latest.current.applyCollapsed(stored?.defaultCollapsed ?? latest.current.defaultCollapsed);
24734
24734
  } catch (reason) {
24735
24735
  if (request !== token.current) return;
@@ -24761,7 +24761,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
24761
24761
  setSaving(true);
24762
24762
  setError("");
24763
24763
  const request = token.current;
24764
- const active = reconcileQueryFields(current.fields.map((field) => field.key), draft.fields);
24764
+ const active = reconcileQueryFields(current.fields.map((field) => field.key), draft.fields, current.fields.filter((field) => field.hideDisabled).map((field) => field.key));
24765
24765
  const next = { ...draft, fields: mergeQueryFields(snapshot?.fields ?? [], active) };
24766
24766
  try {
24767
24767
  await saveSettingsPatch(current.config.adapter, current.config.scope, { queryForm: next });
@@ -24782,7 +24782,8 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
24782
24782
  }
24783
24783
  }
24784
24784
  }
24785
- const visibleDraft = reconcileQueryFields(fields.map((field) => field.key), draft.fields);
24785
+ const hideDisabledKeys = new Set(fields.filter((field) => field.hideDisabled).map((field) => field.key));
24786
+ const visibleDraft = reconcileQueryFields(fields.map((field) => field.key), draft.fields, [...hideDisabledKeys]);
24786
24787
  const labels = new Map(fields.map((field) => [field.key, field.label]));
24787
24788
  const locked = loading || saving || loadFailed || disabled;
24788
24789
  const move = (from, to) => {
@@ -24843,7 +24844,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
24843
24844
  onPointerDown: (event) => sort.start(event, item.key),
24844
24845
  children: [
24845
24846
  /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Icon, { name: "menu", size: 15 }),
24846
- /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Checkbox2, { "aria-label": `\u663E\u793A ${item.key}`, checked: item.visible, disabled: locked, onChange: (checked) => setDraft((current) => ({ ...current, fields: visibleDraft.map((field) => field.key === item.key ? { ...field, visible: checked } : field) })) }),
24847
+ /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Checkbox2, { "aria-label": `\u663E\u793A ${item.key}`, checked: item.visible, disabled: locked || hideDisabledKeys.has(item.key), onChange: (checked) => setDraft((current) => ({ ...current, fields: visibleDraft.map((field) => field.key === item.key ? { ...field, visible: checked } : field) })) }),
24847
24848
  /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { className: "sia-query-settings__name", children: labels.get(item.key) ?? item.key }),
24848
24849
  /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: "sia-query-settings__order", children: [
24849
24850
  /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Button, { type: "button", size: "small", variant: "text", "aria-label": `\u4E0A\u79FB ${item.key}`, disabled: locked || index === 0, icon: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Icon, { name: "chevron-up" }), onClick: () => move(index, index - 1) }),
@@ -24920,19 +24921,21 @@ function QueryForm({
24920
24921
  if (!(0, import_react99.isValidElement)(content)) return void 0;
24921
24922
  return content.props.label ?? content.props.placeholder ?? fieldLabel(content.props.children);
24922
24923
  };
24923
- const sourceEntries = fields ? fields.map(({ key, width, settingsLabel, ...item }) => ({
24924
+ const sourceEntries = fields ? fields.map(({ key, width, settingsLabel, settingsHideDisabled, ...item }) => ({
24924
24925
  key,
24925
24926
  width,
24927
+ hideDisabled: settingsHideDisabled,
24926
24928
  label: settingsLabel ?? item.label ?? (typeof item.children === "function" ? void 0 : fieldLabel(item.children)) ?? key,
24927
24929
  content: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Form.Item, { noStyle: true, ...item })
24928
24930
  })) : import_react99.Children.toArray(children).map((content, index) => ({
24929
24931
  key: (0, import_react99.isValidElement)(content) && content.key != null ? String(content.key) : String(index),
24930
24932
  width: void 0,
24933
+ hideDisabled: false,
24931
24934
  label: fieldLabel(content) ?? `\u6761\u4EF6 ${index + 1}`,
24932
24935
  content
24933
24936
  }));
24934
24937
  const cloudSettings = useQueryFormSettings(settings, sourceEntries, defaultCollapsed, setInternalCollapsed, disabled);
24935
- const configured = reconcileQueryFields(sourceEntries.map((entry) => entry.key), cloudSettings.snapshot?.fields);
24938
+ const configured = reconcileQueryFields(sourceEntries.map((entry) => entry.key), cloudSettings.snapshot?.fields, sourceEntries.filter((entry) => entry.hideDisabled).map((entry) => entry.key));
24936
24939
  const entriesByKey = new Map(sourceEntries.map((entry) => [entry.key, entry]));
24937
24940
  let visibleIndex = 0;
24938
24941
  const entries = configured.map((item) => ({ ...entriesByKey.get(item.key), visible: item.visible, visibleIndex: item.visible ? visibleIndex++ : -1 }));
package/dist/index.css CHANGED
@@ -414,6 +414,7 @@ fieldset:disabled .sia-input-number__floating-placeholder {
414
414
  --sia-color-background: #f5f7fa;
415
415
  --sia-color-surface: #ffffff;
416
416
  --sia-color-border: #d9d9d9;
417
+ --sia-card-header-border-color: color-mix(in srgb, var(--sia-color-border) 40%, var(--sia-color-surface));
417
418
  --sia-color-control-hover: #fafafa;
418
419
  --sia-color-control-active: #f0f0f0;
419
420
  --sia-color-focus-ring: rgb(22 119 255 / 22%);
@@ -449,6 +450,7 @@ fieldset:disabled .sia-input-number__floating-placeholder {
449
450
  --sia-color-background: #141414;
450
451
  --sia-color-surface: #1f1f1f;
451
452
  --sia-color-border: #424242;
453
+ --sia-card-header-border-color: var(--sia-color-border);
452
454
  --sia-color-control-hover: #2d2d2d;
453
455
  --sia-color-control-active: #383838;
454
456
  --sia-color-focus-ring: rgb(60 135 230 / 28%);
@@ -2527,7 +2529,7 @@ fieldset:disabled .sia-input-number__floating-placeholder {
2527
2529
  gap: 16px;
2528
2530
  min-height: 40px;
2529
2531
  margin-inline: 16px;
2530
- border-bottom: 1px solid var(--sia-color-border);
2532
+ border-bottom: 1px solid var(--sia-card-header-border-color);
2531
2533
  }
2532
2534
  .sia-card__heading {
2533
2535
  display: flex;
@@ -8002,7 +8004,7 @@ body:has(.sia-window-frame[data-sia-text-selectable=false]) img {
8002
8004
  display: grid;
8003
8005
  grid-template-columns: var(--sia-form-label-width, var(--sia-form-auto-label-width, 0px)) minmax(0, 1fr);
8004
8006
  gap: 8px 14px;
8005
- margin-bottom: 6px;
8007
+ margin-bottom: 8px;
8006
8008
  color: var(--sia-color-text);
8007
8009
  }
8008
8010
  .sia-form-item__label-content {
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-lGT-8jSj.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-lGT-8jSj.cjs';
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';
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';
@@ -845,7 +845,7 @@ interface FormProps extends Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit"
845
845
  onValuesChange?: (changedValues: FormValues, values: FormValues) => void;
846
846
  }
847
847
  declare function FormRoot({ form, initialValues, layout, size: sizeProp, placeholderMode, disabled, requiredMark, className, onFinish, onFinishFailed, onValuesChange, children, ...props }: FormProps): react.JSX.Element;
848
- /** 表单项的字段绑定、标签、校验及内容配置。 */
848
+ /** 表单项的字段绑定、标签、校验及内容配置;默认保留 8px 下外边距,noStyle 不生成布局容器或间距。 */
849
849
  interface FormItemProps {
850
850
  /** 绑定到表单值的字段名或嵌套路径,例如 ["user", "name"]。 */
851
851
  name?: NamePath;
@@ -3223,6 +3223,8 @@ interface QueryFormField extends FormItemProps {
3223
3223
  key: string;
3224
3224
  /** 查询设置面板中的名称;默认取 label、控件 placeholder,最后回退为 key,不影响表单标签。 */
3225
3225
  settingsLabel?: ReactNode;
3226
+ /** 是否禁止在查询设置中隐藏该字段,默认 false。为 true 时忽略云端的隐藏值,设置面板保持勾选且不可取消;仍允许调整顺序,不改变表单必填校验。 */
3227
+ settingsHideDisabled?: boolean;
3226
3228
  /** 字段占用宽度,优先于自动布局。未指定时普通控件占一列,日期/时间区间及横向组合控件占两列,SelectDateRange 占三列,均包含跨列间距。 */
3227
3229
  width?: number | string;
3228
3230
  }
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-gI4QB_Nz.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-gI4QB_Nz.js';
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';
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';
@@ -845,7 +845,7 @@ interface FormProps extends Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit"
845
845
  onValuesChange?: (changedValues: FormValues, values: FormValues) => void;
846
846
  }
847
847
  declare function FormRoot({ form, initialValues, layout, size: sizeProp, placeholderMode, disabled, requiredMark, className, onFinish, onFinishFailed, onValuesChange, children, ...props }: FormProps): react.JSX.Element;
848
- /** 表单项的字段绑定、标签、校验及内容配置。 */
848
+ /** 表单项的字段绑定、标签、校验及内容配置;默认保留 8px 下外边距,noStyle 不生成布局容器或间距。 */
849
849
  interface FormItemProps {
850
850
  /** 绑定到表单值的字段名或嵌套路径,例如 ["user", "name"]。 */
851
851
  name?: NamePath;
@@ -3223,6 +3223,8 @@ interface QueryFormField extends FormItemProps {
3223
3223
  key: string;
3224
3224
  /** 查询设置面板中的名称;默认取 label、控件 placeholder,最后回退为 key,不影响表单标签。 */
3225
3225
  settingsLabel?: ReactNode;
3226
+ /** 是否禁止在查询设置中隐藏该字段,默认 false。为 true 时忽略云端的隐藏值,设置面板保持勾选且不可取消;仍允许调整顺序,不改变表单必填校验。 */
3227
+ settingsHideDisabled?: boolean;
3226
3228
  /** 字段占用宽度,优先于自动布局。未指定时普通控件占一列,日期/时间区间及横向组合控件占两列,SelectDateRange 占三列,均包含跨列间距。 */
3227
3229
  width?: number | string;
3228
3230
  }
package/dist/index.js CHANGED
@@ -9276,11 +9276,11 @@ function useQueryFieldSort(keys, enabled, onCommit) {
9276
9276
  }
9277
9277
 
9278
9278
  // src/components/queryFormSettingsUtils.ts
9279
- function reconcileQueryFields(keys, saved = []) {
9279
+ function reconcileQueryFields(keys, saved = [], hideDisabledKeys = []) {
9280
9280
  const stored = new Map(saved.map((item) => [item.key, item]));
9281
9281
  return keys.map((key, index) => ({
9282
9282
  key,
9283
- visible: stored.get(key)?.visible !== false,
9283
+ visible: hideDisabledKeys.includes(key) || stored.get(key)?.visible !== false,
9284
9284
  order: Number.isFinite(stored.get(key)?.order) ? stored.get(key).order : Infinity,
9285
9285
  index
9286
9286
  })).sort((a, b) => a.order - b.order || a.index - b.index).map(({ key, visible }, order) => ({ key, visible, order }));
@@ -9326,7 +9326,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
9326
9326
  if (request !== token.current) return;
9327
9327
  const next = stored ?? { fields: [], defaultCollapsed: current.defaultCollapsed ?? false };
9328
9328
  setSnapshot(next);
9329
- setDraft({ ...next, fields: reconcileQueryFields(latest.current.fields.map((field) => field.key), next.fields) });
9329
+ setDraft({ ...next, fields: reconcileQueryFields(latest.current.fields.map((field) => field.key), next.fields, latest.current.fields.filter((field) => field.hideDisabled).map((field) => field.key)) });
9330
9330
  if (!edit) latest.current.applyCollapsed(stored?.defaultCollapsed ?? latest.current.defaultCollapsed);
9331
9331
  } catch (reason) {
9332
9332
  if (request !== token.current) return;
@@ -9358,7 +9358,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
9358
9358
  setSaving(true);
9359
9359
  setError("");
9360
9360
  const request = token.current;
9361
- const active = reconcileQueryFields(current.fields.map((field) => field.key), draft.fields);
9361
+ const active = reconcileQueryFields(current.fields.map((field) => field.key), draft.fields, current.fields.filter((field) => field.hideDisabled).map((field) => field.key));
9362
9362
  const next = { ...draft, fields: mergeQueryFields(snapshot?.fields ?? [], active) };
9363
9363
  try {
9364
9364
  await saveSettingsPatch(current.config.adapter, current.config.scope, { queryForm: next });
@@ -9379,7 +9379,8 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
9379
9379
  }
9380
9380
  }
9381
9381
  }
9382
- const visibleDraft = reconcileQueryFields(fields.map((field) => field.key), draft.fields);
9382
+ const hideDisabledKeys = new Set(fields.filter((field) => field.hideDisabled).map((field) => field.key));
9383
+ const visibleDraft = reconcileQueryFields(fields.map((field) => field.key), draft.fields, [...hideDisabledKeys]);
9383
9384
  const labels = new Map(fields.map((field) => [field.key, field.label]));
9384
9385
  const locked = loading || saving || loadFailed || disabled;
9385
9386
  const move = (from, to) => {
@@ -9440,7 +9441,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
9440
9441
  onPointerDown: (event) => sort.start(event, item.key),
9441
9442
  children: [
9442
9443
  /* @__PURE__ */ jsx28(Icon, { name: "menu", size: 15 }),
9443
- /* @__PURE__ */ jsx28(Checkbox, { "aria-label": `\u663E\u793A ${item.key}`, checked: item.visible, disabled: locked, onChange: (checked) => setDraft((current) => ({ ...current, fields: visibleDraft.map((field) => field.key === item.key ? { ...field, visible: checked } : field) })) }),
9444
+ /* @__PURE__ */ jsx28(Checkbox, { "aria-label": `\u663E\u793A ${item.key}`, checked: item.visible, disabled: locked || hideDisabledKeys.has(item.key), onChange: (checked) => setDraft((current) => ({ ...current, fields: visibleDraft.map((field) => field.key === item.key ? { ...field, visible: checked } : field) })) }),
9444
9445
  /* @__PURE__ */ jsx28("span", { className: "sia-query-settings__name", children: labels.get(item.key) ?? item.key }),
9445
9446
  /* @__PURE__ */ jsxs26("div", { className: "sia-query-settings__order", children: [
9446
9447
  /* @__PURE__ */ jsx28(Button, { type: "button", size: "small", variant: "text", "aria-label": `\u4E0A\u79FB ${item.key}`, disabled: locked || index === 0, icon: /* @__PURE__ */ jsx28(Icon, { name: "chevron-up" }), onClick: () => move(index, index - 1) }),
@@ -9517,19 +9518,21 @@ function QueryForm({
9517
9518
  if (!isValidElement5(content)) return void 0;
9518
9519
  return content.props.label ?? content.props.placeholder ?? fieldLabel(content.props.children);
9519
9520
  };
9520
- const sourceEntries = fields ? fields.map(({ key, width, settingsLabel, ...item }) => ({
9521
+ const sourceEntries = fields ? fields.map(({ key, width, settingsLabel, settingsHideDisabled, ...item }) => ({
9521
9522
  key,
9522
9523
  width,
9524
+ hideDisabled: settingsHideDisabled,
9523
9525
  label: settingsLabel ?? item.label ?? (typeof item.children === "function" ? void 0 : fieldLabel(item.children)) ?? key,
9524
9526
  content: /* @__PURE__ */ jsx29(Form.Item, { noStyle: true, ...item })
9525
9527
  })) : Children4.toArray(children).map((content, index) => ({
9526
9528
  key: isValidElement5(content) && content.key != null ? String(content.key) : String(index),
9527
9529
  width: void 0,
9530
+ hideDisabled: false,
9528
9531
  label: fieldLabel(content) ?? `\u6761\u4EF6 ${index + 1}`,
9529
9532
  content
9530
9533
  }));
9531
9534
  const cloudSettings = useQueryFormSettings(settings, sourceEntries, defaultCollapsed, setInternalCollapsed, disabled);
9532
- const configured = reconcileQueryFields(sourceEntries.map((entry) => entry.key), cloudSettings.snapshot?.fields);
9535
+ const configured = reconcileQueryFields(sourceEntries.map((entry) => entry.key), cloudSettings.snapshot?.fields, sourceEntries.filter((entry) => entry.hideDisabled).map((entry) => entry.key));
9533
9536
  const entriesByKey = new Map(sourceEntries.map((entry) => [entry.key, entry]));
9534
9537
  let visibleIndex = 0;
9535
9538
  const entries = configured.map((item) => ({ ...entriesByKey.get(item.key), visible: item.visible, visibleIndex: item.visible ? visibleIndex++ : -1 }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sia.soul/sia-react-ui",
3
- "version": "0.1.109",
3
+ "version": "0.1.111",
4
4
  "description": "Sia Design components and tokens for React",
5
5
  "publishConfig": {
6
6
  "access": "public",