@sia.soul/sia-react-ui 0.1.108 → 0.1.110
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/{chunk-GPCUD6FA.js → chunk-XRHL56EV.js} +2 -1
- package/dist/{core-OuydQbFN.d.ts → core-gI4QB_Nz.d.ts} +3 -1
- package/dist/{core-KJBvQlUc.d.cts → core-lGT-8jSj.d.cts} +3 -1
- package/dist/core.cjs +2 -1
- package/dist/core.css +19 -0
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/game.cjs +1649 -1193
- package/dist/game.css +186 -0
- package/dist/game.d.cts +77 -8
- package/dist/game.d.ts +77 -8
- package/dist/game.js +819 -367
- package/dist/index.cjs +17 -10
- package/dist/index.css +19 -0
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +16 -10
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5868,6 +5868,7 @@ function Card({
|
|
|
5868
5868
|
defaultCollapsed = false,
|
|
5869
5869
|
onCollapsedChange,
|
|
5870
5870
|
bodyHeight,
|
|
5871
|
+
fill = false,
|
|
5871
5872
|
bodyClassName = "",
|
|
5872
5873
|
bodyStyle,
|
|
5873
5874
|
className = "",
|
|
@@ -5903,7 +5904,7 @@ function Card({
|
|
|
5903
5904
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
5904
5905
|
"section",
|
|
5905
5906
|
{
|
|
5906
|
-
className: `sia-card${!bordered ? " sia-card--borderless" : ""}${isCollapsed ? " sia-card--collapsed" : ""}${selectable ? " sia-card--selectable" : ""}${actionable ? " sia-card--actionable" : ""}${selectable && isSelected ? " sia-card--selected" : ""}${hoverActions ? " sia-card--hover-actions" : ""} ${className}`.trim(),
|
|
5907
|
+
className: `sia-card${fill ? " sia-card--fill" : ""}${fill && bodyHeight !== void 0 ? " sia-card--body-height" : ""}${!bordered ? " sia-card--borderless" : ""}${isCollapsed ? " sia-card--collapsed" : ""}${selectable ? " sia-card--selectable" : ""}${actionable ? " sia-card--actionable" : ""}${selectable && isSelected ? " sia-card--selected" : ""}${hoverActions ? " sia-card--hover-actions" : ""} ${className}`.trim(),
|
|
5907
5908
|
style: mergedStyle,
|
|
5908
5909
|
role: selectable ? "checkbox" : actionable ? "button" : void 0,
|
|
5909
5910
|
"aria-checked": selectable ? isSelected : void 0,
|
|
@@ -7475,7 +7476,10 @@ function Slider({
|
|
|
7475
7476
|
onPointerDown: () => setActiveThumb(index),
|
|
7476
7477
|
onChange: (event) => update(index, Number(event.currentTarget.value)),
|
|
7477
7478
|
onMouseUp: finish,
|
|
7478
|
-
onTouchEnd: finish
|
|
7479
|
+
onTouchEnd: finish,
|
|
7480
|
+
onKeyUp: (event) => {
|
|
7481
|
+
if (["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End", "PageUp", "PageDown"].includes(event.key)) finish();
|
|
7482
|
+
}
|
|
7479
7483
|
}
|
|
7480
7484
|
),
|
|
7481
7485
|
tooltip?.open || activeThumb === index ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
@@ -24675,11 +24679,11 @@ function useQueryFieldSort(keys, enabled, onCommit) {
|
|
|
24675
24679
|
}
|
|
24676
24680
|
|
|
24677
24681
|
// src/components/queryFormSettingsUtils.ts
|
|
24678
|
-
function reconcileQueryFields(keys, saved = []) {
|
|
24682
|
+
function reconcileQueryFields(keys, saved = [], hideDisabledKeys = []) {
|
|
24679
24683
|
const stored = new Map(saved.map((item) => [item.key, item]));
|
|
24680
24684
|
return keys.map((key, index) => ({
|
|
24681
24685
|
key,
|
|
24682
|
-
visible: stored.get(key)?.visible !== false,
|
|
24686
|
+
visible: hideDisabledKeys.includes(key) || stored.get(key)?.visible !== false,
|
|
24683
24687
|
order: Number.isFinite(stored.get(key)?.order) ? stored.get(key).order : Infinity,
|
|
24684
24688
|
index
|
|
24685
24689
|
})).sort((a, b) => a.order - b.order || a.index - b.index).map(({ key, visible }, order) => ({ key, visible, order }));
|
|
@@ -24725,7 +24729,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
|
|
|
24725
24729
|
if (request !== token.current) return;
|
|
24726
24730
|
const next = stored ?? { fields: [], defaultCollapsed: current.defaultCollapsed ?? false };
|
|
24727
24731
|
setSnapshot(next);
|
|
24728
|
-
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)) });
|
|
24729
24733
|
if (!edit) latest.current.applyCollapsed(stored?.defaultCollapsed ?? latest.current.defaultCollapsed);
|
|
24730
24734
|
} catch (reason) {
|
|
24731
24735
|
if (request !== token.current) return;
|
|
@@ -24757,7 +24761,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
|
|
|
24757
24761
|
setSaving(true);
|
|
24758
24762
|
setError("");
|
|
24759
24763
|
const request = token.current;
|
|
24760
|
-
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));
|
|
24761
24765
|
const next = { ...draft, fields: mergeQueryFields(snapshot?.fields ?? [], active) };
|
|
24762
24766
|
try {
|
|
24763
24767
|
await saveSettingsPatch(current.config.adapter, current.config.scope, { queryForm: next });
|
|
@@ -24778,7 +24782,8 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
|
|
|
24778
24782
|
}
|
|
24779
24783
|
}
|
|
24780
24784
|
}
|
|
24781
|
-
const
|
|
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]);
|
|
24782
24787
|
const labels = new Map(fields.map((field) => [field.key, field.label]));
|
|
24783
24788
|
const locked = loading || saving || loadFailed || disabled;
|
|
24784
24789
|
const move = (from, to) => {
|
|
@@ -24839,7 +24844,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
|
|
|
24839
24844
|
onPointerDown: (event) => sort.start(event, item.key),
|
|
24840
24845
|
children: [
|
|
24841
24846
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Icon, { name: "menu", size: 15 }),
|
|
24842
|
-
/* @__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) })) }),
|
|
24843
24848
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { className: "sia-query-settings__name", children: labels.get(item.key) ?? item.key }),
|
|
24844
24849
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: "sia-query-settings__order", children: [
|
|
24845
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) }),
|
|
@@ -24916,19 +24921,21 @@ function QueryForm({
|
|
|
24916
24921
|
if (!(0, import_react99.isValidElement)(content)) return void 0;
|
|
24917
24922
|
return content.props.label ?? content.props.placeholder ?? fieldLabel(content.props.children);
|
|
24918
24923
|
};
|
|
24919
|
-
const sourceEntries = fields ? fields.map(({ key, width, settingsLabel, ...item }) => ({
|
|
24924
|
+
const sourceEntries = fields ? fields.map(({ key, width, settingsLabel, settingsHideDisabled, ...item }) => ({
|
|
24920
24925
|
key,
|
|
24921
24926
|
width,
|
|
24927
|
+
hideDisabled: settingsHideDisabled,
|
|
24922
24928
|
label: settingsLabel ?? item.label ?? (typeof item.children === "function" ? void 0 : fieldLabel(item.children)) ?? key,
|
|
24923
24929
|
content: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Form.Item, { noStyle: true, ...item })
|
|
24924
24930
|
})) : import_react99.Children.toArray(children).map((content, index) => ({
|
|
24925
24931
|
key: (0, import_react99.isValidElement)(content) && content.key != null ? String(content.key) : String(index),
|
|
24926
24932
|
width: void 0,
|
|
24933
|
+
hideDisabled: false,
|
|
24927
24934
|
label: fieldLabel(content) ?? `\u6761\u4EF6 ${index + 1}`,
|
|
24928
24935
|
content
|
|
24929
24936
|
}));
|
|
24930
24937
|
const cloudSettings = useQueryFormSettings(settings, sourceEntries, defaultCollapsed, setInternalCollapsed, disabled);
|
|
24931
|
-
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));
|
|
24932
24939
|
const entriesByKey = new Map(sourceEntries.map((entry) => [entry.key, entry]));
|
|
24933
24940
|
let visibleIndex = 0;
|
|
24934
24941
|
const entries = configured.map((item) => ({ ...entriesByKey.get(item.key), visible: item.visible, visibleIndex: item.visible ? visibleIndex++ : -1 }));
|
package/dist/index.css
CHANGED
|
@@ -2607,6 +2607,25 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
2607
2607
|
outline: 2px solid var(--sia-color-primary);
|
|
2608
2608
|
outline-offset: 2px;
|
|
2609
2609
|
}
|
|
2610
|
+
.sia-card--fill {
|
|
2611
|
+
height: 100%;
|
|
2612
|
+
min-height: 0;
|
|
2613
|
+
min-width: 0;
|
|
2614
|
+
display: flex;
|
|
2615
|
+
flex-direction: column;
|
|
2616
|
+
}
|
|
2617
|
+
.sia-card--fill > .sia-card__header,
|
|
2618
|
+
.sia-card--fill > .sia-card__description {
|
|
2619
|
+
flex-shrink: 0;
|
|
2620
|
+
}
|
|
2621
|
+
.sia-card--fill > .sia-card__body {
|
|
2622
|
+
flex: 1;
|
|
2623
|
+
min-height: 0;
|
|
2624
|
+
min-width: 0;
|
|
2625
|
+
}
|
|
2626
|
+
.sia-card--fill.sia-card--body-height > .sia-card__body {
|
|
2627
|
+
flex: 0 0 auto;
|
|
2628
|
+
}
|
|
2610
2629
|
.sia-card__selected-corner {
|
|
2611
2630
|
position: absolute;
|
|
2612
2631
|
top: 0;
|
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-
|
|
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-
|
|
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';
|
|
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';
|
|
@@ -1135,7 +1135,7 @@ interface SliderProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue
|
|
|
1135
1135
|
};
|
|
1136
1136
|
/** 值发生变化时调用;参数为新值及类型声明中列出的关联信息。 */
|
|
1137
1137
|
onChange?: (value: SliderValue) => void;
|
|
1138
|
-
/**
|
|
1138
|
+
/** 鼠标或触摸拖动结束、方向键等调整键松开时调用,参数为当前值;用于保存最终设置。 */
|
|
1139
1139
|
onChangeComplete?: (value: SliderValue) => void;
|
|
1140
1140
|
}
|
|
1141
1141
|
/** 滑块组件。 */
|
|
@@ -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-
|
|
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-
|
|
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';
|
|
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';
|
|
@@ -1135,7 +1135,7 @@ interface SliderProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue
|
|
|
1135
1135
|
};
|
|
1136
1136
|
/** 值发生变化时调用;参数为新值及类型声明中列出的关联信息。 */
|
|
1137
1137
|
onChange?: (value: SliderValue) => void;
|
|
1138
|
-
/**
|
|
1138
|
+
/** 鼠标或触摸拖动结束、方向键等调整键松开时调用,参数为当前值;用于保存最终设置。 */
|
|
1139
1139
|
onChangeComplete?: (value: SliderValue) => void;
|
|
1140
1140
|
}
|
|
1141
1141
|
/** 滑块组件。 */
|
|
@@ -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
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
Watermark,
|
|
82
82
|
message,
|
|
83
83
|
notification
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-XRHL56EV.js";
|
|
85
85
|
import "./chunk-RX242MUO.js";
|
|
86
86
|
import {
|
|
87
87
|
MarkdownEditor
|
|
@@ -2181,7 +2181,10 @@ function Slider({
|
|
|
2181
2181
|
onPointerDown: () => setActiveThumb(index),
|
|
2182
2182
|
onChange: (event) => update(index, Number(event.currentTarget.value)),
|
|
2183
2183
|
onMouseUp: finish,
|
|
2184
|
-
onTouchEnd: finish
|
|
2184
|
+
onTouchEnd: finish,
|
|
2185
|
+
onKeyUp: (event) => {
|
|
2186
|
+
if (["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End", "PageUp", "PageDown"].includes(event.key)) finish();
|
|
2187
|
+
}
|
|
2185
2188
|
}
|
|
2186
2189
|
),
|
|
2187
2190
|
tooltip?.open || activeThumb === index ? /* @__PURE__ */ jsx13(
|
|
@@ -9273,11 +9276,11 @@ function useQueryFieldSort(keys, enabled, onCommit) {
|
|
|
9273
9276
|
}
|
|
9274
9277
|
|
|
9275
9278
|
// src/components/queryFormSettingsUtils.ts
|
|
9276
|
-
function reconcileQueryFields(keys, saved = []) {
|
|
9279
|
+
function reconcileQueryFields(keys, saved = [], hideDisabledKeys = []) {
|
|
9277
9280
|
const stored = new Map(saved.map((item) => [item.key, item]));
|
|
9278
9281
|
return keys.map((key, index) => ({
|
|
9279
9282
|
key,
|
|
9280
|
-
visible: stored.get(key)?.visible !== false,
|
|
9283
|
+
visible: hideDisabledKeys.includes(key) || stored.get(key)?.visible !== false,
|
|
9281
9284
|
order: Number.isFinite(stored.get(key)?.order) ? stored.get(key).order : Infinity,
|
|
9282
9285
|
index
|
|
9283
9286
|
})).sort((a, b) => a.order - b.order || a.index - b.index).map(({ key, visible }, order) => ({ key, visible, order }));
|
|
@@ -9323,7 +9326,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
|
|
|
9323
9326
|
if (request !== token.current) return;
|
|
9324
9327
|
const next = stored ?? { fields: [], defaultCollapsed: current.defaultCollapsed ?? false };
|
|
9325
9328
|
setSnapshot(next);
|
|
9326
|
-
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)) });
|
|
9327
9330
|
if (!edit) latest.current.applyCollapsed(stored?.defaultCollapsed ?? latest.current.defaultCollapsed);
|
|
9328
9331
|
} catch (reason) {
|
|
9329
9332
|
if (request !== token.current) return;
|
|
@@ -9355,7 +9358,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
|
|
|
9355
9358
|
setSaving(true);
|
|
9356
9359
|
setError("");
|
|
9357
9360
|
const request = token.current;
|
|
9358
|
-
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));
|
|
9359
9362
|
const next = { ...draft, fields: mergeQueryFields(snapshot?.fields ?? [], active) };
|
|
9360
9363
|
try {
|
|
9361
9364
|
await saveSettingsPatch(current.config.adapter, current.config.scope, { queryForm: next });
|
|
@@ -9376,7 +9379,8 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
|
|
|
9376
9379
|
}
|
|
9377
9380
|
}
|
|
9378
9381
|
}
|
|
9379
|
-
const
|
|
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]);
|
|
9380
9384
|
const labels = new Map(fields.map((field) => [field.key, field.label]));
|
|
9381
9385
|
const locked = loading || saving || loadFailed || disabled;
|
|
9382
9386
|
const move = (from, to) => {
|
|
@@ -9437,7 +9441,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
|
|
|
9437
9441
|
onPointerDown: (event) => sort.start(event, item.key),
|
|
9438
9442
|
children: [
|
|
9439
9443
|
/* @__PURE__ */ jsx28(Icon, { name: "menu", size: 15 }),
|
|
9440
|
-
/* @__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) })) }),
|
|
9441
9445
|
/* @__PURE__ */ jsx28("span", { className: "sia-query-settings__name", children: labels.get(item.key) ?? item.key }),
|
|
9442
9446
|
/* @__PURE__ */ jsxs26("div", { className: "sia-query-settings__order", children: [
|
|
9443
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) }),
|
|
@@ -9514,19 +9518,21 @@ function QueryForm({
|
|
|
9514
9518
|
if (!isValidElement5(content)) return void 0;
|
|
9515
9519
|
return content.props.label ?? content.props.placeholder ?? fieldLabel(content.props.children);
|
|
9516
9520
|
};
|
|
9517
|
-
const sourceEntries = fields ? fields.map(({ key, width, settingsLabel, ...item }) => ({
|
|
9521
|
+
const sourceEntries = fields ? fields.map(({ key, width, settingsLabel, settingsHideDisabled, ...item }) => ({
|
|
9518
9522
|
key,
|
|
9519
9523
|
width,
|
|
9524
|
+
hideDisabled: settingsHideDisabled,
|
|
9520
9525
|
label: settingsLabel ?? item.label ?? (typeof item.children === "function" ? void 0 : fieldLabel(item.children)) ?? key,
|
|
9521
9526
|
content: /* @__PURE__ */ jsx29(Form.Item, { noStyle: true, ...item })
|
|
9522
9527
|
})) : Children4.toArray(children).map((content, index) => ({
|
|
9523
9528
|
key: isValidElement5(content) && content.key != null ? String(content.key) : String(index),
|
|
9524
9529
|
width: void 0,
|
|
9530
|
+
hideDisabled: false,
|
|
9525
9531
|
label: fieldLabel(content) ?? `\u6761\u4EF6 ${index + 1}`,
|
|
9526
9532
|
content
|
|
9527
9533
|
}));
|
|
9528
9534
|
const cloudSettings = useQueryFormSettings(settings, sourceEntries, defaultCollapsed, setInternalCollapsed, disabled);
|
|
9529
|
-
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));
|
|
9530
9536
|
const entriesByKey = new Map(sourceEntries.map((entry) => [entry.key, entry]));
|
|
9531
9537
|
let visibleIndex = 0;
|
|
9532
9538
|
const entries = configured.map((item) => ({ ...entriesByKey.get(item.key), visible: item.visible, visibleIndex: item.visible ? visibleIndex++ : -1 }));
|