@sia.soul/sia-react-ui 0.1.164 → 0.1.166

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
@@ -5815,6 +5815,9 @@ fieldset:disabled .sia-input-number__floating-placeholder {
5815
5815
  align-self: inherit;
5816
5816
  gap: inherit;
5817
5817
  }
5818
+ .sia-space__item:empty {
5819
+ display: none;
5820
+ }
5818
5821
  .sia-space--vertical > .sia-space__item {
5819
5822
  align-items: stretch;
5820
5823
  flex-direction: column;
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, VideoHTMLAttributes } from 'react';
3
- import { T as TagStatus, B as BadgeProps } from './core-r-smfiNN.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 FloatingScrollbarProvider, J as FloatingScrollbarProviderProps, K as FloatingTrigger, L as ICON_NAMES, M as Icon, N as IconName, O as IconProps, P as IconVariant, Q as Image, R as ImagePreview, S as ImagePreviewConfig, U as ImagePreviewGroup, V as ImagePreviewGroupProps, W as ImagePreviewProps, X as ImageProps, Y as Input, Z as InputProps, _ as Menu, $ as MenuClickInfo, a0 as MenuItem, a1 as MenuMode, a2 as MenuProps, a3 as MenuTheme, a4 as MessageConfig, a5 as MessageHandle, a6 as MessageKey, a7 as MessageType, a8 as NotificationConfig, a9 as NotificationPlacement, aa as NotificationType, ab as Popconfirm, ac as PopconfirmProps, ad as Popover, ae as PopoverProps, af as Progress, ag as ProgressProps, ah as ProgressStatus, ai as Rate, aj as RateProps, ak as Result, al as ResultProps, am as ResultStatus, an as Segmented, ao as SegmentedOption, ap as SegmentedProps, aq as SegmentedValue, ar as Skeleton, as as SkeletonProps, at as Spin, au as SpinProps, av as StepItem, aw as StepStatus, ax as Steps, ay as StepsProps, az as TabItem, aA as Tabs, aB as TabsContextMenuClickInfo, aC as TabsOrientation, aD as TabsPosition, aE as TabsProps, aF as TabsType, aG as Tag, aH as TagProps, aI as TagSize, aJ as TagVariant, aK as Timeline, aL as TimelineItem, aM as TimelineProps, aN as Toolbar, aO as ToolbarItem, aP as ToolbarProps, aQ as Tooltip, aR as TooltipProps, aS as Tour, aT as TourProps, aU as TourStep, aV as Tree, aW as TreeDropPosition, aX as TreeKey, aY as TreeNode, aZ as TreeProps, a_ as Typography, a$ as TypographyLinkProps, b0 as TypographyProps, b1 as TypographyTitleProps, b2 as TypographyType, b3 as Upload, b4 as UploadChangeInfo, b5 as UploadDraggerProps, b6 as UploadFile, b7 as UploadFileStatus, b8 as UploadHttpRequest, b9 as UploadItemActions, ba as UploadProps, bb as UploadRef, bc as UploadRejectInfo, bd as UploadRequestHandle, be as UploadRequestOptions, bf as Watermark, bg as WatermarkFont, bh as WatermarkProps, bi as message, bj as notification } from './core-r-smfiNN.cjs';
3
+ import { T as TagStatus, B as BadgeProps } from './core-Cnt8r6pj.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 FloatingScrollbarProvider, J as FloatingScrollbarProviderProps, K as FloatingTrigger, L as ICON_NAMES, M as Icon, N as IconName, O as IconProps, P as IconVariant, Q as Image, R as ImagePreview, S as ImagePreviewConfig, U as ImagePreviewGroup, V as ImagePreviewGroupProps, W as ImagePreviewProps, X as ImageProps, Y as Input, Z as InputProps, _ as Menu, $ as MenuClickInfo, a0 as MenuItem, a1 as MenuMode, a2 as MenuProps, a3 as MenuTheme, a4 as MessageConfig, a5 as MessageHandle, a6 as MessageKey, a7 as MessageType, a8 as NotificationConfig, a9 as NotificationPlacement, aa as NotificationType, ab as Popconfirm, ac as PopconfirmProps, ad as Popover, ae as PopoverProps, af as Progress, ag as ProgressProps, ah as ProgressStatus, ai as Rate, aj as RateProps, ak as Result, al as ResultProps, am as ResultStatus, an as Segmented, ao as SegmentedOption, ap as SegmentedProps, aq as SegmentedValue, ar as Skeleton, as as SkeletonProps, at as Spin, au as SpinProps, av as StepItem, aw as StepStatus, ax as Steps, ay as StepsProps, az as TabItem, aA as Tabs, aB as TabsContextMenuClickInfo, aC as TabsOrientation, aD as TabsPosition, aE as TabsProps, aF as TabsType, aG as Tag, aH as TagProps, aI as TagSize, aJ as TagVariant, aK as Timeline, aL as TimelineItem, aM as TimelineProps, aN as Toolbar, aO as ToolbarItem, aP as ToolbarProps, aQ as Tooltip, aR as TooltipProps, aS as Tour, aT as TourProps, aU as TourStep, aV as Tree, aW as TreeDropPosition, aX as TreeKey, aY as TreeNode, aZ as TreeProps, a_ as Typography, a$ as TypographyLinkProps, b0 as TypographyProps, b1 as TypographyTitleProps, b2 as TypographyType, b3 as Upload, b4 as UploadChangeInfo, b5 as UploadDraggerProps, b6 as UploadFile, b7 as UploadFileStatus, b8 as UploadHttpRequest, b9 as UploadItemActions, ba as UploadProps, bb as UploadRef, bc as UploadRejectInfo, bd as UploadRequestHandle, be as UploadRequestOptions, bf as Watermark, bg as WatermarkFont, bh as WatermarkProps, bi as message, bj as notification } from './core-Cnt8r6pj.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-xLR4Yt57.cjs';
7
7
  export { b as Button, c as ButtonVariant } from './Button-xLR4Yt57.cjs';
@@ -365,7 +365,7 @@ interface SpaceCompactProps extends HTMLAttributes<HTMLDivElement> {
365
365
  }
366
366
  declare function SpaceCompact({ direction, block, className, ...props }: SpaceCompactProps): react.JSX.Element;
367
367
  declare function SpaceRoot({ direction, size, align, wrap, split, className, style, children, ...props }: SpaceProps): react.JSX.Element;
368
- /** 间距布局组件。 */
368
+ /** 间距布局组件;没有渲染任何 DOM 内容的子项不占间距,含分隔内容的子项沿用原布局。 */
369
369
  declare const Space: typeof SpaceRoot & {
370
370
  /** 紧凑布局容器,将相邻控件组合为连续的按钮或输入组。 */
371
371
  Compact: typeof SpaceCompact;
@@ -3508,12 +3508,12 @@ interface QueryFormSearchInfo {
3508
3508
  interface QueryFormProps<T extends FormValues = FormValues> extends Omit<FormProps, "onFinish" | "children" | "onError"> {
3509
3509
  /** 查询字段配置,每项包含稳定 key、可选宽度以及 Form.Item 属性;提供后优先于 children。 */
3510
3510
  fields?: readonly QueryFormField[];
3511
- /** 云设置入口,在查询操作按钮组末尾显示竖向三点图标;复用表格 adapter 和 scope,读写共用快照的 queryForm 属性。未提供时不显示入口;入口显隐由 showSettings 控制。隐藏字段保留挂载和值;children 模式需提供稳定 React key。 */
3511
+ /** 云设置入口,在查询操作按钮组末尾显示竖向三点图标;复用表格 adapter 和 scope,读写共用快照的 queryForm 属性。未提供时使用仅在当前组件挂载期间保留的本地设置;入口显隐由 showSettings 控制。隐藏字段保留挂载和值;children 模式需提供稳定 React key。 */
3512
3512
  settings?: QueryFormSettingsConfig;
3513
3513
  /**
3514
- * 是否显示查询设置入口,需同时提供 settings。true 始终显示,false 始终隐藏;未指定时,全部条件在当前宽度下展开超过两行才显示。
3515
- * 行数不包含操作按钮和快捷查询;按未隐藏条件前的完整字段测量,收起或保存字段显隐后仍可恢复设置。
3516
- * @defaultValue undefined
3514
+ * 是否显示查询设置入口。默认始终显示,不受字段数量、行数、展开收起或是否配置云存储影响;显式 false 隐藏。
3515
+ * 未提供 settings 时可调整当前组件的字段显隐、顺序和默认收起状态,卸载后恢复默认;提供 settings 后沿用该适配器和业务作用域持久化。
3516
+ * @defaultValue true
3517
3517
  */
3518
3518
  showSettings?: boolean;
3519
3519
  /** 也可直接放入 Form.Item 或 Space.Compact,每个直接子项视为一个查询字段。横向 Space.Compact 仅包含左侧 Select 和右侧 Input 时,默认按 40% / 60% 分配宽度;Form.Item noStyle 包裹时同样适用。 */
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, VideoHTMLAttributes } from 'react';
3
- import { T as TagStatus, B as BadgeProps } from './core-XtqUDbbD.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 FloatingScrollbarProvider, J as FloatingScrollbarProviderProps, K as FloatingTrigger, L as ICON_NAMES, M as Icon, N as IconName, O as IconProps, P as IconVariant, Q as Image, R as ImagePreview, S as ImagePreviewConfig, U as ImagePreviewGroup, V as ImagePreviewGroupProps, W as ImagePreviewProps, X as ImageProps, Y as Input, Z as InputProps, _ as Menu, $ as MenuClickInfo, a0 as MenuItem, a1 as MenuMode, a2 as MenuProps, a3 as MenuTheme, a4 as MessageConfig, a5 as MessageHandle, a6 as MessageKey, a7 as MessageType, a8 as NotificationConfig, a9 as NotificationPlacement, aa as NotificationType, ab as Popconfirm, ac as PopconfirmProps, ad as Popover, ae as PopoverProps, af as Progress, ag as ProgressProps, ah as ProgressStatus, ai as Rate, aj as RateProps, ak as Result, al as ResultProps, am as ResultStatus, an as Segmented, ao as SegmentedOption, ap as SegmentedProps, aq as SegmentedValue, ar as Skeleton, as as SkeletonProps, at as Spin, au as SpinProps, av as StepItem, aw as StepStatus, ax as Steps, ay as StepsProps, az as TabItem, aA as Tabs, aB as TabsContextMenuClickInfo, aC as TabsOrientation, aD as TabsPosition, aE as TabsProps, aF as TabsType, aG as Tag, aH as TagProps, aI as TagSize, aJ as TagVariant, aK as Timeline, aL as TimelineItem, aM as TimelineProps, aN as Toolbar, aO as ToolbarItem, aP as ToolbarProps, aQ as Tooltip, aR as TooltipProps, aS as Tour, aT as TourProps, aU as TourStep, aV as Tree, aW as TreeDropPosition, aX as TreeKey, aY as TreeNode, aZ as TreeProps, a_ as Typography, a$ as TypographyLinkProps, b0 as TypographyProps, b1 as TypographyTitleProps, b2 as TypographyType, b3 as Upload, b4 as UploadChangeInfo, b5 as UploadDraggerProps, b6 as UploadFile, b7 as UploadFileStatus, b8 as UploadHttpRequest, b9 as UploadItemActions, ba as UploadProps, bb as UploadRef, bc as UploadRejectInfo, bd as UploadRequestHandle, be as UploadRequestOptions, bf as Watermark, bg as WatermarkFont, bh as WatermarkProps, bi as message, bj as notification } from './core-XtqUDbbD.js';
3
+ import { T as TagStatus, B as BadgeProps } from './core-Dy8NWJ1b.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 FloatingScrollbarProvider, J as FloatingScrollbarProviderProps, K as FloatingTrigger, L as ICON_NAMES, M as Icon, N as IconName, O as IconProps, P as IconVariant, Q as Image, R as ImagePreview, S as ImagePreviewConfig, U as ImagePreviewGroup, V as ImagePreviewGroupProps, W as ImagePreviewProps, X as ImageProps, Y as Input, Z as InputProps, _ as Menu, $ as MenuClickInfo, a0 as MenuItem, a1 as MenuMode, a2 as MenuProps, a3 as MenuTheme, a4 as MessageConfig, a5 as MessageHandle, a6 as MessageKey, a7 as MessageType, a8 as NotificationConfig, a9 as NotificationPlacement, aa as NotificationType, ab as Popconfirm, ac as PopconfirmProps, ad as Popover, ae as PopoverProps, af as Progress, ag as ProgressProps, ah as ProgressStatus, ai as Rate, aj as RateProps, ak as Result, al as ResultProps, am as ResultStatus, an as Segmented, ao as SegmentedOption, ap as SegmentedProps, aq as SegmentedValue, ar as Skeleton, as as SkeletonProps, at as Spin, au as SpinProps, av as StepItem, aw as StepStatus, ax as Steps, ay as StepsProps, az as TabItem, aA as Tabs, aB as TabsContextMenuClickInfo, aC as TabsOrientation, aD as TabsPosition, aE as TabsProps, aF as TabsType, aG as Tag, aH as TagProps, aI as TagSize, aJ as TagVariant, aK as Timeline, aL as TimelineItem, aM as TimelineProps, aN as Toolbar, aO as ToolbarItem, aP as ToolbarProps, aQ as Tooltip, aR as TooltipProps, aS as Tour, aT as TourProps, aU as TourStep, aV as Tree, aW as TreeDropPosition, aX as TreeKey, aY as TreeNode, aZ as TreeProps, a_ as Typography, a$ as TypographyLinkProps, b0 as TypographyProps, b1 as TypographyTitleProps, b2 as TypographyType, b3 as Upload, b4 as UploadChangeInfo, b5 as UploadDraggerProps, b6 as UploadFile, b7 as UploadFileStatus, b8 as UploadHttpRequest, b9 as UploadItemActions, ba as UploadProps, bb as UploadRef, bc as UploadRejectInfo, bd as UploadRequestHandle, be as UploadRequestOptions, bf as Watermark, bg as WatermarkFont, bh as WatermarkProps, bi as message, bj as notification } from './core-Dy8NWJ1b.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-B59TIes7.js';
7
7
  export { b as Button, c as ButtonVariant } from './Button-B59TIes7.js';
@@ -365,7 +365,7 @@ interface SpaceCompactProps extends HTMLAttributes<HTMLDivElement> {
365
365
  }
366
366
  declare function SpaceCompact({ direction, block, className, ...props }: SpaceCompactProps): react.JSX.Element;
367
367
  declare function SpaceRoot({ direction, size, align, wrap, split, className, style, children, ...props }: SpaceProps): react.JSX.Element;
368
- /** 间距布局组件。 */
368
+ /** 间距布局组件;没有渲染任何 DOM 内容的子项不占间距,含分隔内容的子项沿用原布局。 */
369
369
  declare const Space: typeof SpaceRoot & {
370
370
  /** 紧凑布局容器,将相邻控件组合为连续的按钮或输入组。 */
371
371
  Compact: typeof SpaceCompact;
@@ -3508,12 +3508,12 @@ interface QueryFormSearchInfo {
3508
3508
  interface QueryFormProps<T extends FormValues = FormValues> extends Omit<FormProps, "onFinish" | "children" | "onError"> {
3509
3509
  /** 查询字段配置,每项包含稳定 key、可选宽度以及 Form.Item 属性;提供后优先于 children。 */
3510
3510
  fields?: readonly QueryFormField[];
3511
- /** 云设置入口,在查询操作按钮组末尾显示竖向三点图标;复用表格 adapter 和 scope,读写共用快照的 queryForm 属性。未提供时不显示入口;入口显隐由 showSettings 控制。隐藏字段保留挂载和值;children 模式需提供稳定 React key。 */
3511
+ /** 云设置入口,在查询操作按钮组末尾显示竖向三点图标;复用表格 adapter 和 scope,读写共用快照的 queryForm 属性。未提供时使用仅在当前组件挂载期间保留的本地设置;入口显隐由 showSettings 控制。隐藏字段保留挂载和值;children 模式需提供稳定 React key。 */
3512
3512
  settings?: QueryFormSettingsConfig;
3513
3513
  /**
3514
- * 是否显示查询设置入口,需同时提供 settings。true 始终显示,false 始终隐藏;未指定时,全部条件在当前宽度下展开超过两行才显示。
3515
- * 行数不包含操作按钮和快捷查询;按未隐藏条件前的完整字段测量,收起或保存字段显隐后仍可恢复设置。
3516
- * @defaultValue undefined
3514
+ * 是否显示查询设置入口。默认始终显示,不受字段数量、行数、展开收起或是否配置云存储影响;显式 false 隐藏。
3515
+ * 未提供 settings 时可调整当前组件的字段显隐、顺序和默认收起状态,卸载后恢复默认;提供 settings 后沿用该适配器和业务作用域持久化。
3516
+ * @defaultValue true
3517
3517
  */
3518
3518
  showSettings?: boolean;
3519
3519
  /** 也可直接放入 Form.Item 或 Space.Compact,每个直接子项视为一个查询字段。横向 Space.Compact 仅包含左侧 Select 和右侧 Input 时,默认按 40% / 60% 分配宽度;Form.Item noStyle 包裹时同样适用。 */
package/dist/index.js CHANGED
@@ -82,7 +82,7 @@ import {
82
82
  Watermark,
83
83
  message,
84
84
  notification
85
- } from "./chunk-WR5YBY2A.js";
85
+ } from "./chunk-T2F6X3LA.js";
86
86
  import "./chunk-RX242MUO.js";
87
87
  import {
88
88
  MarkdownEditor
@@ -11436,7 +11436,11 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
11436
11436
  const adapter = config?.adapter;
11437
11437
  async function load(edit) {
11438
11438
  const current = latest.current;
11439
- if (!current.config) return;
11439
+ if (!current.config) {
11440
+ const next = snapshot ?? { fields: [], defaultCollapsed: current.defaultCollapsed ?? false };
11441
+ setDraft({ ...next, fields: reconcileQueryFields(current.fields.map((field) => field.key), next.fields, current.fields.filter((field) => field.hideDisabled).map((field) => field.key)) });
11442
+ return;
11443
+ }
11440
11444
  const request = ++token.current;
11441
11445
  setLoading(true);
11442
11446
  setError("");
@@ -11474,7 +11478,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
11474
11478
  }, [adapter, moduleName, businessKey]);
11475
11479
  async function save() {
11476
11480
  const current = latest.current;
11477
- if (!current.config || loading || loadFailed || disabled || saveLock.current) return false;
11481
+ if (loading || loadFailed || disabled || saveLock.current) return false;
11478
11482
  saveLock.current = true;
11479
11483
  setSaving(true);
11480
11484
  setError("");
@@ -11482,7 +11486,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
11482
11486
  const active = reconcileQueryFields(current.fields.map((field) => field.key), draft.fields, current.fields.filter((field) => field.hideDisabled).map((field) => field.key));
11483
11487
  const next = { ...draft, fields: mergeQueryFields(snapshot?.fields ?? [], active) };
11484
11488
  try {
11485
- await saveSettingsPatch(current.config.adapter, current.config.scope, { queryForm: next });
11489
+ if (current.config) await saveSettingsPatch(current.config.adapter, current.config.scope, { queryForm: next });
11486
11490
  if (request !== token.current) return false;
11487
11491
  setSnapshot(next);
11488
11492
  current.applyCollapsed(next.defaultCollapsed);
@@ -11491,7 +11495,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
11491
11495
  } catch (reason) {
11492
11496
  if (request !== token.current) return false;
11493
11497
  setError(reason instanceof Error ? reason.message : "\u4FDD\u5B58\u67E5\u8BE2\u8BBE\u7F6E\u5931\u8D25");
11494
- current.config.onError?.(reason, "save");
11498
+ current.config?.onError?.(reason, "save");
11495
11499
  return false;
11496
11500
  } finally {
11497
11501
  if (request === token.current) {
@@ -11514,7 +11518,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
11514
11518
  const items = new Map(visibleDraft.map((item) => [item.key, item]));
11515
11519
  setDraft((current) => ({ ...current, fields: keys.map((key, order) => ({ ...items.get(key), order })) }));
11516
11520
  });
11517
- const control = config ? /* @__PURE__ */ jsx33(
11521
+ const control = /* @__PURE__ */ jsx33(
11518
11522
  Button,
11519
11523
  {
11520
11524
  type: "button",
@@ -11529,8 +11533,8 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
11529
11533
  void load(true);
11530
11534
  }
11531
11535
  }
11532
- ) : null;
11533
- const panel = config ? /* @__PURE__ */ jsx33(Fragment11, { children: /* @__PURE__ */ jsx33(
11536
+ );
11537
+ const panel = /* @__PURE__ */ jsx33(Fragment11, { children: /* @__PURE__ */ jsx33(
11534
11538
  Modal,
11535
11539
  {
11536
11540
  title: "\u67E5\u8BE2\u8BBE\u7F6E",
@@ -11573,7 +11577,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
11573
11577
  /* @__PURE__ */ jsx33(Button, { type: "button", disabled: locked, onClick: () => setDraft({ fields: reconcileQueryFields(fields.map((field) => field.key)), defaultCollapsed: defaultCollapsed ?? false }), children: "\u6062\u590D\u9ED8\u8BA4" })
11574
11578
  ] })
11575
11579
  }
11576
- ) }) : null;
11580
+ ) });
11577
11581
  return { snapshot, control, panel };
11578
11582
  }
11579
11583
 
@@ -11582,7 +11586,7 @@ import { jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
11582
11586
  function QueryForm({
11583
11587
  fields,
11584
11588
  settings,
11585
- showSettings,
11589
+ showSettings = true,
11586
11590
  children,
11587
11591
  form: providedForm,
11588
11592
  onSearch,
@@ -11659,7 +11663,6 @@ function QueryForm({
11659
11663
  const actionsRef = useRef29(null);
11660
11664
  const toggleRef = useRef29(null);
11661
11665
  const [fittingCount, setFittingCount] = useState28(limit);
11662
- const [settingsRows, setSettingsRows] = useState28(0);
11663
11666
  useLayoutEffect9(() => {
11664
11667
  const row = rowRef.current;
11665
11668
  const actions = actionsRef.current;
@@ -11667,21 +11670,6 @@ function QueryForm({
11667
11670
  function measure() {
11668
11671
  if (!row || !actions || row.dataset.queryMotion === "true") return;
11669
11672
  const gap = parseFloat(getComputedStyle(row).columnGap) || 0;
11670
- const sourceFields = Array.from(row.querySelectorAll(":scope > .sia-query-form__field"));
11671
- const sourceHidden = sourceFields.map((field) => field.hidden);
11672
- const sourceCollapsed = row.classList.contains("is-collapsed");
11673
- row.classList.remove("is-collapsed");
11674
- sourceFields.forEach((field) => {
11675
- field.hidden = false;
11676
- });
11677
- if (row.clientWidth > 0) setSettingsRows(countQueryFieldRows(sourceFields.map((field) => {
11678
- const rect = field.getBoundingClientRect();
11679
- return rect.top + rect.height / 2;
11680
- })));
11681
- sourceFields.forEach((field, index) => {
11682
- field.hidden = sourceHidden[index];
11683
- });
11684
- row.classList.toggle("is-collapsed", sourceCollapsed);
11685
11673
  const allFields = Array.from(
11686
11674
  row.querySelectorAll(":scope > .sia-query-form__field:not([data-settings-hidden])")
11687
11675
  );
@@ -11910,7 +11898,7 @@ function QueryForm({
11910
11898
  children: saveText
11911
11899
  }
11912
11900
  ) : null,
11913
- showSettings ?? settingsRows > 2 ? cloudSettings.control : null
11901
+ showSettings ? cloudSettings.control : null
11914
11902
  ] }),
11915
11903
  collapsible && entries.length > 0 ? /* @__PURE__ */ jsx34("span", { ref: toggleRef, hidden: !needsCollapse, children: /* @__PURE__ */ jsx34(
11916
11904
  Button,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sia.soul/sia-react-ui",
3
- "version": "0.1.164",
3
+ "version": "0.1.166",
4
4
  "description": "Sia Design components and tokens for React",
5
5
  "publishConfig": {
6
6
  "access": "public",