@sia.soul/sia-react-ui 0.1.125 → 0.1.127
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-D3CROVS2.js → chunk-EWEDQ3VJ.js} +1 -1
- package/dist/{chunk-PUNKAJBB.js → chunk-J3RX7GCZ.js} +2 -2
- package/dist/{chunk-OYBMDSTC.js → chunk-MQ6SYFJW.js} +3 -3
- package/dist/{chunk-WA3LO3LY.js → chunk-NYU3DJVZ.js} +2 -2
- package/dist/{chunk-33FOEIXI.js → chunk-PQBCD54U.js} +8 -6
- package/dist/{chunk-B333SUKG.js → chunk-RC5MXFLI.js} +2 -2
- package/dist/core.cjs +8 -6
- package/dist/core.css +4 -0
- package/dist/core.js +4 -4
- package/dist/game.cjs +8 -6
- package/dist/game.js +1 -1
- package/dist/index.cjs +1625 -974
- package/dist/index.css +29 -0
- package/dist/index.d.cts +99 -3
- package/dist/index.d.ts +99 -3
- package/dist/index.js +728 -80
- package/dist/rich-text-editor.cjs +8 -6
- package/dist/rich-text-editor.js +3 -3
- package/dist/select-date-range.cjs +8 -6
- package/dist/select-date-range.js +4 -4
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -8095,6 +8095,10 @@ body:has(.sia-window-frame[data-sia-text-selectable=false]) img {
|
|
|
8095
8095
|
font-size: 12px;
|
|
8096
8096
|
line-height: 1.45;
|
|
8097
8097
|
}
|
|
8098
|
+
.sia-floating__overlay.sia-form-item__error-popover--obscured {
|
|
8099
|
+
opacity: 0;
|
|
8100
|
+
animation: none;
|
|
8101
|
+
}
|
|
8098
8102
|
.sia-form-item__error-content {
|
|
8099
8103
|
display: flex;
|
|
8100
8104
|
align-items: center;
|
|
@@ -11156,6 +11160,31 @@ body > .sia-title-tooltip[data-sia-popup-layer] {
|
|
|
11156
11160
|
z-index: 5;
|
|
11157
11161
|
}
|
|
11158
11162
|
|
|
11163
|
+
/* src/components/Table/worksheet.css */
|
|
11164
|
+
.sia-table__worksheet-cell:not(.sia-table__cell--fixed) {
|
|
11165
|
+
position: relative;
|
|
11166
|
+
}
|
|
11167
|
+
.sia-table__worksheet-handle {
|
|
11168
|
+
position: absolute;
|
|
11169
|
+
right: 1px;
|
|
11170
|
+
bottom: 1px;
|
|
11171
|
+
width: 8px;
|
|
11172
|
+
height: 8px;
|
|
11173
|
+
padding: 0;
|
|
11174
|
+
border: 1px solid var(--sia-color-surface);
|
|
11175
|
+
background: var(--sia-color-primary);
|
|
11176
|
+
cursor: crosshair;
|
|
11177
|
+
z-index: 2;
|
|
11178
|
+
}
|
|
11179
|
+
.sia-table__worksheet-fill-preview {
|
|
11180
|
+
box-shadow: inset 0 0 0 1px var(--sia-color-primary);
|
|
11181
|
+
}
|
|
11182
|
+
.sia-table__worksheet-tools {
|
|
11183
|
+
display: inline-flex;
|
|
11184
|
+
align-items: center;
|
|
11185
|
+
gap: 2px;
|
|
11186
|
+
}
|
|
11187
|
+
|
|
11159
11188
|
/* src/breadcrumb.css */
|
|
11160
11189
|
.sia-breadcrumb {
|
|
11161
11190
|
color: var(--sia-color-text-secondary);
|
package/dist/index.d.cts
CHANGED
|
@@ -868,7 +868,7 @@ interface FormProps extends Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit"
|
|
|
868
868
|
onValuesChange?: (changedValues: FormValues, values: FormValues) => void;
|
|
869
869
|
}
|
|
870
870
|
declare function FormRoot({ fill, form, initialValues, layout, size: sizeProp, placeholderMode, disabled, requiredMark, className, onFinish, onFinishFailed, onValuesChange, children, ...props }: FormProps): react.JSX.Element;
|
|
871
|
-
/**
|
|
871
|
+
/** 表单项的字段绑定、标签、校验及内容配置;错误气泡不占布局空间,指针进入覆盖区域或被遮挡控件获得焦点时暂时隐藏。默认保留 8px 下外边距,noStyle 不生成布局容器或间距。 */
|
|
872
872
|
interface FormItemProps {
|
|
873
873
|
/** 绑定到表单值的字段名或嵌套路径,例如 ["user", "name"]。 */
|
|
874
874
|
name?: NamePath;
|
|
@@ -887,7 +887,7 @@ interface FormItemProps {
|
|
|
887
887
|
required?: boolean;
|
|
888
888
|
/** 主体之外的补充内容或操作区。 */
|
|
889
889
|
extra?: ReactNode;
|
|
890
|
-
/**
|
|
890
|
+
/** 字段下方的辅助说明或校验提示;错误气泡默认位于下方,指针进入覆盖区域或其他被遮挡控件获得焦点时暂时透明,移出且焦点离开后恢复。保留错误文本和无障碍关联,视口空间不足时沿用浮层防溢出规则。 */
|
|
891
891
|
help?: ReactNode;
|
|
892
892
|
/** 手动指定字段校验状态。 */
|
|
893
893
|
validateStatus?: "success" | "warning" | "error" | "validating";
|
|
@@ -2988,6 +2988,102 @@ interface TableExportApi<T> {
|
|
|
2988
2988
|
/** 创建表格数据导出插件。将返回值加入 Table 的 plugins 后生效。 */
|
|
2989
2989
|
declare function createExportPlugin<T extends Record<string, unknown>>(options?: TableExportPluginOptions<T>): TablePlugin<T, undefined, TableExportApi<T>>;
|
|
2990
2990
|
|
|
2991
|
+
/** 工作表一次数据变更的来源;行操作通过 replaceData 纳入同一历史。 */
|
|
2992
|
+
type TableWorksheetReason = "edit" | "paste" | "fill" | "replace" | "undo" | "redo";
|
|
2993
|
+
/** 单个单元格变更;只包含本次确实写入的单元格。 */
|
|
2994
|
+
interface TableWorksheetChange {
|
|
2995
|
+
/** 稳定行标识,与 Table.rowKey 一致。 */
|
|
2996
|
+
rowKey: TableKey;
|
|
2997
|
+
/** 目标列的 key。 */
|
|
2998
|
+
columnKey: string;
|
|
2999
|
+
/** 写入前的原始值。 */
|
|
3000
|
+
previousValue: unknown;
|
|
3001
|
+
/** 写入后的原始值。 */
|
|
3002
|
+
value: unknown;
|
|
3003
|
+
}
|
|
3004
|
+
/** 批量写入前的业务兼容检查上下文。 */
|
|
3005
|
+
interface TableWorksheetValueContext<T> {
|
|
3006
|
+
/** 当前目标记录;不要原地修改。 */
|
|
3007
|
+
record: T;
|
|
3008
|
+
/** 目标列,包含 editable.canEdit 等语义配置。 */
|
|
3009
|
+
column: TableColumn<T>;
|
|
3010
|
+
/** 待写入值;文本列保持原始字符串。 */
|
|
3011
|
+
value: unknown;
|
|
3012
|
+
/** 内部复制或填充的来源列 key;外部文本粘贴时未提供。 */
|
|
3013
|
+
sourceColumnKey?: string;
|
|
3014
|
+
/** 内部复制或填充时的来源记录快照;用于分类、属性组等业务兼容判断。外部粘贴未提供。 */
|
|
3015
|
+
sourceRecord?: T;
|
|
3016
|
+
}
|
|
3017
|
+
/** 一次操作的通知;新增编辑会清空恢复栈。 */
|
|
3018
|
+
interface TableWorksheetOperation {
|
|
3019
|
+
/** 触发本次数据变更的操作。 */
|
|
3020
|
+
reason: TableWorksheetReason;
|
|
3021
|
+
/** 本次变更的单元格;整表替换及撤销恢复时为空数组。 */
|
|
3022
|
+
changes: readonly TableWorksheetChange[];
|
|
3023
|
+
/** 本次因只读、禁用、类型或业务兼容限制跳过的单元格数量。 */
|
|
3024
|
+
skipped: number;
|
|
3025
|
+
}
|
|
3026
|
+
/** 工作表插件配置;每个 Table 实例通过 useMemo 创建独立插件。 */
|
|
3027
|
+
interface TableWorksheetPluginOptions<T> {
|
|
3028
|
+
/** 同步接收新的不可变数据数组并更新 Table.dataSource;返回 false 拒绝整次操作。禁止原地修改数据或返回 Promise。 */
|
|
3029
|
+
onChange: (data: T[], operation: TableWorksheetOperation) => void | boolean;
|
|
3030
|
+
/** 业务兼容检查;在框架只读和类型检查通过后执行,返回 false 跳过单元格,不改变其余单元格的位置。 */
|
|
3031
|
+
canWrite?: (context: TableWorksheetValueContext<T>) => boolean;
|
|
3032
|
+
/** 自定义不可变写回,适用于组合属性;默认按 column.dataIndex 路径复制嵌套对象。 */
|
|
3033
|
+
setValue?: (record: T, column: TableColumn<T>, value: unknown) => T;
|
|
3034
|
+
/** 历史记录上限,单位为整次操作;默认 100,最小 1。 */
|
|
3035
|
+
historyLimit?: number;
|
|
3036
|
+
/** 是否显示撤销和恢复按钮,默认 true;关闭后仍可通过快捷键与 API 操作。 */
|
|
3037
|
+
toolbar?: boolean;
|
|
3038
|
+
/** 单格编辑、批量粘贴或填充完成后通知,包括全部跳过的情况;业务拒绝或抛错时不通知,不自动弹出消息。 */
|
|
3039
|
+
onOperation?: (operation: TableWorksheetOperation) => void;
|
|
3040
|
+
/** 同步业务回调抛错时通知;该次操作不写入历史,不提交部分数据。 */
|
|
3041
|
+
onError?: (error: unknown) => void;
|
|
3042
|
+
}
|
|
3043
|
+
/** 工作表历史状态。 */
|
|
3044
|
+
interface TableWorksheetHistory {
|
|
3045
|
+
/** 是否存在可撤销的整次操作。 */
|
|
3046
|
+
canUndo: boolean;
|
|
3047
|
+
/** 是否存在可恢复的整次操作。 */
|
|
3048
|
+
canRedo: boolean;
|
|
3049
|
+
}
|
|
3050
|
+
/** 工作表公开操作句柄,通过 TableRef.getPluginApi("worksheet") 获取。 */
|
|
3051
|
+
interface TableWorksheetApi<T> {
|
|
3052
|
+
/** 撤销最近整次操作,包括一次批量粘贴或填充;没有历史或业务拒绝时返回 false。 */
|
|
3053
|
+
undo: () => boolean;
|
|
3054
|
+
/** 恢复最近撤销的操作;新编辑后恢复栈清空。 */
|
|
3055
|
+
redo: () => boolean;
|
|
3056
|
+
/** 读取当前撤销和恢复可用状态。 */
|
|
3057
|
+
getHistory: () => TableWorksheetHistory;
|
|
3058
|
+
/** 清空历史并取消编辑和填充;重新导入后可调用。外部替换 dataSource 时也自动清空历史。 */
|
|
3059
|
+
clearHistory: () => void;
|
|
3060
|
+
/** 从当前选区左上角粘贴 TSV;单值铺满选区,矩阵保持原列位置,越界部分截断,不自动新增行。 */
|
|
3061
|
+
paste: (text: string) => boolean;
|
|
3062
|
+
/** 将当前选区沿原列向上或向下填充到目标行;increment=true 按行距离递增末尾数字。 */
|
|
3063
|
+
fillTo: (rowKey: TableKey, increment?: boolean) => boolean;
|
|
3064
|
+
/** 向下填充连续空单元格,遇到第一行已有可编辑值时停止,不覆盖已有内容。 */
|
|
3065
|
+
fillDown: () => boolean;
|
|
3066
|
+
/** 写入单个可编辑单元格并纳入历史;只读、禁用及不兼容值返回 false。 */
|
|
3067
|
+
editCell: (address: TableCellAddress, value: unknown) => boolean;
|
|
3068
|
+
/** 将行复制、删除等业务操作产生的不可变数组纳入同一历史;不执行服务端写入。 */
|
|
3069
|
+
replaceData: (data: T[]) => boolean;
|
|
3070
|
+
}
|
|
3071
|
+
|
|
3072
|
+
/** 工作表内部视图状态,数据和历史由插件实例独立持有。 */
|
|
3073
|
+
interface WorksheetState {
|
|
3074
|
+
/** 当前编辑单元格;null 表示浏览状态。 */
|
|
3075
|
+
editing: TableCellAddress | null;
|
|
3076
|
+
/** 历史或拖拽预览变化时递增。 */
|
|
3077
|
+
revision: number;
|
|
3078
|
+
}
|
|
3079
|
+
/**
|
|
3080
|
+
* 创建 Excel 式工作表插件,内含双击编辑、选区批量粘贴、上下填充和整次撤销恢复。
|
|
3081
|
+
* 与 Table 默认单元格选择配合,勿再同时安装 createEditablePlugin;使用稳定 rowKey。
|
|
3082
|
+
* 每个表格用 useMemo 创建独立实例,onChange 必须同步更新不可变 dataSource;外部换表自动清空历史。
|
|
3083
|
+
* 输入框中的原生复制、粘贴和撤销保留;快捷键只在当前工作表内生效,不发送网络请求。
|
|
3084
|
+
*/
|
|
3085
|
+
declare function createWorksheetPlugin<T extends Record<string, unknown>>(options: TableWorksheetPluginOptions<T>): TablePlugin<T, WorksheetState, TableWorksheetApi<T>>;
|
|
3086
|
+
|
|
2991
3087
|
/** 主题切换的属性配置。 */
|
|
2992
3088
|
interface ThemeSwitchProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> {
|
|
2993
3089
|
/** 当前是否勾选;作为受控属性时通过回调更新。 */
|
|
@@ -3424,4 +3520,4 @@ interface NumberRangeProps extends Omit<HTMLAttributes<HTMLSpanElement>, "onChan
|
|
|
3424
3520
|
/** 日期区间风格的双数字输入框,使用波浪线分隔;可直接绑定 Form.Item。 */
|
|
3425
3521
|
declare const NumberRange: react.ForwardRefExoticComponent<NumberRangeProps & react.RefAttributes<HTMLSpanElement>>;
|
|
3426
3522
|
|
|
3427
|
-
export { Alert, type AlertProps, type AlertStatus, type AnyTablePlugin, AutoSizer, type AutoSizerProps, type AutoSizerSize, BadgeProps, ButtonProps, ButtonSize, Cascader, type CascaderFieldNames, type CascaderOption, type CascaderProps, type CascaderValue, Checkbox, type CheckboxGroupProps, type CheckboxOption, type CheckboxProps, type CheckboxValue, Col, type ColProps, type ColSize, ColorPicker, type ColorPickerMode, type ColorPickerPreset, type ColorPickerProps, ControlSize, ControlStatus, CursorPreview, type CursorPreviewFrame, type CursorPreviewProps, DEFAULT_PAGE_SIZE_OPTIONS, Divider, type DividerProps, Drawer, type DrawerOpenConfig, type DrawerPlacement, type DrawerProps, type DrawerPush, type DrawerPushConfig, Editor, type EditorCommand, type EditorCompletionContext, type EditorCompletionItem, type EditorCompletionItemKind, type EditorCompletionProvider, type EditorContextMenuItem, type EditorHandle, type EditorKeyDownEvent, type EditorLanguage, type EditorMarker, type EditorProps, type EditorRange, type EditorSelectionChange, type EditorTheme, type FlatTreeNode, type FlatTreeOptions, Flex, type FlexProps, FloatingPanel, type FloatingPanelProps, FloatingScrollbarProvider, type FloatingScrollbarProviderProps, Form, type FormErrorField, type FormFieldData, type FormInstance, type FormItemProps, type FormListField, type FormListOperation, type FormListProps, type FormProps, type FormRule, type FormValues, type GridBreakpoint, InputNumber, type InputNumberProps, InputPlaceholderMode, InputSelect, type InputSelectProps, type LayoutGap, Markdown, type MarkdownProps, ModalActionResult, ModalOpenConfig, type NamePath, NumberRange, type NumberRangeProps, type NumberRangeValue, OverlayApiHandle, Pagination, type PaginationProps, QueryForm, type QueryFormField, type QueryFormFieldSetting, type QueryFormProps, type QueryFormSearchInfo, type QueryFormSettingsConfig, type QueryFormSettingsSnapshot, type QueryFormShortcut, Radio, type RadioGroupProps, type RadioOption, type RadioProps, type RadioValue, Row, type RowProps, SIA_THEME, SelectChangeValue, type SelectModalConfig, SelectOption, SelectProps, type SelectionOption, SelectionPanel, type SelectionPanelProps, type SelectionValue, type SiaThemeMode, Slider, type SliderMark, type SliderProps, type SliderValue, type SortableKey, SortableList, type SortableListProps, Space, type SpaceCompactProps, type SpaceProps, Splitter, type SplitterPanelProps, type SplitterProps, Switch, type SwitchProps, type SwitchVariant, Table, type TableAlign, type TableCanvasCell, type TableCellAddress, type TableCellRange, type TableCellRenderInfo, type TableCellSelectionApi, type TableCellSelectionPluginOptions, type TableColumn, type TableColumnSettingApi, type TableColumnSettingItem, type TableColumnSettingPluginOptions, type TableColumnTransformPluginOptions, type TableEditableApi, type TableEditableCellConfig, type TableEditableCellType, type TableEditablePluginOptions, type TableExportApi, type TableExportPluginOptions, type TableExportScope, type TableFilterApi, type TableFilterPluginOptions, type TableFilterValues, type TableFixed, type TableHighlightPluginOptions, type TableHighlightValue, type TableIndexPluginOptions, type TableKey, type TableMergeStickyConfig, type TablePageParams, type TablePaginationApi, type TablePaginationPluginOptions, type TablePlugin, type TablePluginCellProps, type TablePluginContext, type TablePluginEvent, type TableProps, type TableRef, type TableResizeApi, type TableResizePluginOptions, type TableRow, type TableRowSpanPluginOptions, type TableSelectedCell, type TableSelectionApi, type TableSelectionMode, type TableSelectionPluginOptions, type TableSettingsAdapter, type TableSettingsSnapshot, type TableSize, type TableSortApi, type TableSortInfo, type TableSortPluginOptions, type TableSummaryPluginOptions, type TableSummaryRow, type TableToolbarItem, type TableToolbarPluginOptions, type TableTreeApi, type TableTreePluginOptions, TagStatus, TextArea, type TextAreaProps, ThemeSwitch, type ThemeSwitchProps, TimePicker, type TimePickerProps, type TimeRangePickerProps, ToolPanel, type ToolPanelItem, type ToolPanelPlacement, type ToolPanelProps, TreeSelect, type TreeSelectNode, type TreeSelectProps, type TreeSelectValue, Treemap, type TreemapNode, type TreemapNodeClickInfo, type TreemapNodeKind, type TreemapProps, type WindowAction, type WindowActionHandler, type WindowControlAction, type WindowControlLabels, WindowControls, type WindowControlsProps, WindowFrame, type WindowFrameProps, WindowTitleBar, type WindowTitleBarActionsAlign, type WindowTitleBarProps, applySiaTheme, buildFlatTree, createCellSelectionPlugin, createColumnSettingPlugin, createColumnTransformPlugin, createEditablePlugin, createExportPlugin, createFilterPlugin, createHighlightPlugin, createIndexPlugin, createLocalStorageTableSettingsAdapter, createPaginationPlugin, createResizePlugin, createRowSpanPlugin, createSelectionPlugin, createSortPlugin, createSummaryPlugin, createToolbarPlugin, createTreePlugin, openSelectModal, useForm };
|
|
3523
|
+
export { Alert, type AlertProps, type AlertStatus, type AnyTablePlugin, AutoSizer, type AutoSizerProps, type AutoSizerSize, BadgeProps, ButtonProps, ButtonSize, Cascader, type CascaderFieldNames, type CascaderOption, type CascaderProps, type CascaderValue, Checkbox, type CheckboxGroupProps, type CheckboxOption, type CheckboxProps, type CheckboxValue, Col, type ColProps, type ColSize, ColorPicker, type ColorPickerMode, type ColorPickerPreset, type ColorPickerProps, ControlSize, ControlStatus, CursorPreview, type CursorPreviewFrame, type CursorPreviewProps, DEFAULT_PAGE_SIZE_OPTIONS, Divider, type DividerProps, Drawer, type DrawerOpenConfig, type DrawerPlacement, type DrawerProps, type DrawerPush, type DrawerPushConfig, Editor, type EditorCommand, type EditorCompletionContext, type EditorCompletionItem, type EditorCompletionItemKind, type EditorCompletionProvider, type EditorContextMenuItem, type EditorHandle, type EditorKeyDownEvent, type EditorLanguage, type EditorMarker, type EditorProps, type EditorRange, type EditorSelectionChange, type EditorTheme, type FlatTreeNode, type FlatTreeOptions, Flex, type FlexProps, FloatingPanel, type FloatingPanelProps, FloatingScrollbarProvider, type FloatingScrollbarProviderProps, Form, type FormErrorField, type FormFieldData, type FormInstance, type FormItemProps, type FormListField, type FormListOperation, type FormListProps, type FormProps, type FormRule, type FormValues, type GridBreakpoint, InputNumber, type InputNumberProps, InputPlaceholderMode, InputSelect, type InputSelectProps, type LayoutGap, Markdown, type MarkdownProps, ModalActionResult, ModalOpenConfig, type NamePath, NumberRange, type NumberRangeProps, type NumberRangeValue, OverlayApiHandle, Pagination, type PaginationProps, QueryForm, type QueryFormField, type QueryFormFieldSetting, type QueryFormProps, type QueryFormSearchInfo, type QueryFormSettingsConfig, type QueryFormSettingsSnapshot, type QueryFormShortcut, Radio, type RadioGroupProps, type RadioOption, type RadioProps, type RadioValue, Row, type RowProps, SIA_THEME, SelectChangeValue, type SelectModalConfig, SelectOption, SelectProps, type SelectionOption, SelectionPanel, type SelectionPanelProps, type SelectionValue, type SiaThemeMode, Slider, type SliderMark, type SliderProps, type SliderValue, type SortableKey, SortableList, type SortableListProps, Space, type SpaceCompactProps, type SpaceProps, Splitter, type SplitterPanelProps, type SplitterProps, Switch, type SwitchProps, type SwitchVariant, Table, type TableAlign, type TableCanvasCell, type TableCellAddress, type TableCellRange, type TableCellRenderInfo, type TableCellSelectionApi, type TableCellSelectionPluginOptions, type TableColumn, type TableColumnSettingApi, type TableColumnSettingItem, type TableColumnSettingPluginOptions, type TableColumnTransformPluginOptions, type TableEditableApi, type TableEditableCellConfig, type TableEditableCellType, type TableEditablePluginOptions, type TableExportApi, type TableExportPluginOptions, type TableExportScope, type TableFilterApi, type TableFilterPluginOptions, type TableFilterValues, type TableFixed, type TableHighlightPluginOptions, type TableHighlightValue, type TableIndexPluginOptions, type TableKey, type TableMergeStickyConfig, type TablePageParams, type TablePaginationApi, type TablePaginationPluginOptions, type TablePlugin, type TablePluginCellProps, type TablePluginContext, type TablePluginEvent, type TableProps, type TableRef, type TableResizeApi, type TableResizePluginOptions, type TableRow, type TableRowSpanPluginOptions, type TableSelectedCell, type TableSelectionApi, type TableSelectionMode, type TableSelectionPluginOptions, type TableSettingsAdapter, type TableSettingsSnapshot, type TableSize, type TableSortApi, type TableSortInfo, type TableSortPluginOptions, type TableSummaryPluginOptions, type TableSummaryRow, type TableToolbarItem, type TableToolbarPluginOptions, type TableTreeApi, type TableTreePluginOptions, type TableWorksheetApi, type TableWorksheetChange, type TableWorksheetHistory, type TableWorksheetOperation, type TableWorksheetPluginOptions, type TableWorksheetReason, type TableWorksheetValueContext, TagStatus, TextArea, type TextAreaProps, ThemeSwitch, type ThemeSwitchProps, TimePicker, type TimePickerProps, type TimeRangePickerProps, ToolPanel, type ToolPanelItem, type ToolPanelPlacement, type ToolPanelProps, TreeSelect, type TreeSelectNode, type TreeSelectProps, type TreeSelectValue, Treemap, type TreemapNode, type TreemapNodeClickInfo, type TreemapNodeKind, type TreemapProps, type WindowAction, type WindowActionHandler, type WindowControlAction, type WindowControlLabels, WindowControls, type WindowControlsProps, WindowFrame, type WindowFrameProps, WindowTitleBar, type WindowTitleBarActionsAlign, type WindowTitleBarProps, applySiaTheme, buildFlatTree, createCellSelectionPlugin, createColumnSettingPlugin, createColumnTransformPlugin, createEditablePlugin, createExportPlugin, createFilterPlugin, createHighlightPlugin, createIndexPlugin, createLocalStorageTableSettingsAdapter, createPaginationPlugin, createResizePlugin, createRowSpanPlugin, createSelectionPlugin, createSortPlugin, createSummaryPlugin, createToolbarPlugin, createTreePlugin, createWorksheetPlugin, openSelectModal, useForm };
|
package/dist/index.d.ts
CHANGED
|
@@ -868,7 +868,7 @@ interface FormProps extends Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit"
|
|
|
868
868
|
onValuesChange?: (changedValues: FormValues, values: FormValues) => void;
|
|
869
869
|
}
|
|
870
870
|
declare function FormRoot({ fill, form, initialValues, layout, size: sizeProp, placeholderMode, disabled, requiredMark, className, onFinish, onFinishFailed, onValuesChange, children, ...props }: FormProps): react.JSX.Element;
|
|
871
|
-
/**
|
|
871
|
+
/** 表单项的字段绑定、标签、校验及内容配置;错误气泡不占布局空间,指针进入覆盖区域或被遮挡控件获得焦点时暂时隐藏。默认保留 8px 下外边距,noStyle 不生成布局容器或间距。 */
|
|
872
872
|
interface FormItemProps {
|
|
873
873
|
/** 绑定到表单值的字段名或嵌套路径,例如 ["user", "name"]。 */
|
|
874
874
|
name?: NamePath;
|
|
@@ -887,7 +887,7 @@ interface FormItemProps {
|
|
|
887
887
|
required?: boolean;
|
|
888
888
|
/** 主体之外的补充内容或操作区。 */
|
|
889
889
|
extra?: ReactNode;
|
|
890
|
-
/**
|
|
890
|
+
/** 字段下方的辅助说明或校验提示;错误气泡默认位于下方,指针进入覆盖区域或其他被遮挡控件获得焦点时暂时透明,移出且焦点离开后恢复。保留错误文本和无障碍关联,视口空间不足时沿用浮层防溢出规则。 */
|
|
891
891
|
help?: ReactNode;
|
|
892
892
|
/** 手动指定字段校验状态。 */
|
|
893
893
|
validateStatus?: "success" | "warning" | "error" | "validating";
|
|
@@ -2988,6 +2988,102 @@ interface TableExportApi<T> {
|
|
|
2988
2988
|
/** 创建表格数据导出插件。将返回值加入 Table 的 plugins 后生效。 */
|
|
2989
2989
|
declare function createExportPlugin<T extends Record<string, unknown>>(options?: TableExportPluginOptions<T>): TablePlugin<T, undefined, TableExportApi<T>>;
|
|
2990
2990
|
|
|
2991
|
+
/** 工作表一次数据变更的来源;行操作通过 replaceData 纳入同一历史。 */
|
|
2992
|
+
type TableWorksheetReason = "edit" | "paste" | "fill" | "replace" | "undo" | "redo";
|
|
2993
|
+
/** 单个单元格变更;只包含本次确实写入的单元格。 */
|
|
2994
|
+
interface TableWorksheetChange {
|
|
2995
|
+
/** 稳定行标识,与 Table.rowKey 一致。 */
|
|
2996
|
+
rowKey: TableKey;
|
|
2997
|
+
/** 目标列的 key。 */
|
|
2998
|
+
columnKey: string;
|
|
2999
|
+
/** 写入前的原始值。 */
|
|
3000
|
+
previousValue: unknown;
|
|
3001
|
+
/** 写入后的原始值。 */
|
|
3002
|
+
value: unknown;
|
|
3003
|
+
}
|
|
3004
|
+
/** 批量写入前的业务兼容检查上下文。 */
|
|
3005
|
+
interface TableWorksheetValueContext<T> {
|
|
3006
|
+
/** 当前目标记录;不要原地修改。 */
|
|
3007
|
+
record: T;
|
|
3008
|
+
/** 目标列,包含 editable.canEdit 等语义配置。 */
|
|
3009
|
+
column: TableColumn<T>;
|
|
3010
|
+
/** 待写入值;文本列保持原始字符串。 */
|
|
3011
|
+
value: unknown;
|
|
3012
|
+
/** 内部复制或填充的来源列 key;外部文本粘贴时未提供。 */
|
|
3013
|
+
sourceColumnKey?: string;
|
|
3014
|
+
/** 内部复制或填充时的来源记录快照;用于分类、属性组等业务兼容判断。外部粘贴未提供。 */
|
|
3015
|
+
sourceRecord?: T;
|
|
3016
|
+
}
|
|
3017
|
+
/** 一次操作的通知;新增编辑会清空恢复栈。 */
|
|
3018
|
+
interface TableWorksheetOperation {
|
|
3019
|
+
/** 触发本次数据变更的操作。 */
|
|
3020
|
+
reason: TableWorksheetReason;
|
|
3021
|
+
/** 本次变更的单元格;整表替换及撤销恢复时为空数组。 */
|
|
3022
|
+
changes: readonly TableWorksheetChange[];
|
|
3023
|
+
/** 本次因只读、禁用、类型或业务兼容限制跳过的单元格数量。 */
|
|
3024
|
+
skipped: number;
|
|
3025
|
+
}
|
|
3026
|
+
/** 工作表插件配置;每个 Table 实例通过 useMemo 创建独立插件。 */
|
|
3027
|
+
interface TableWorksheetPluginOptions<T> {
|
|
3028
|
+
/** 同步接收新的不可变数据数组并更新 Table.dataSource;返回 false 拒绝整次操作。禁止原地修改数据或返回 Promise。 */
|
|
3029
|
+
onChange: (data: T[], operation: TableWorksheetOperation) => void | boolean;
|
|
3030
|
+
/** 业务兼容检查;在框架只读和类型检查通过后执行,返回 false 跳过单元格,不改变其余单元格的位置。 */
|
|
3031
|
+
canWrite?: (context: TableWorksheetValueContext<T>) => boolean;
|
|
3032
|
+
/** 自定义不可变写回,适用于组合属性;默认按 column.dataIndex 路径复制嵌套对象。 */
|
|
3033
|
+
setValue?: (record: T, column: TableColumn<T>, value: unknown) => T;
|
|
3034
|
+
/** 历史记录上限,单位为整次操作;默认 100,最小 1。 */
|
|
3035
|
+
historyLimit?: number;
|
|
3036
|
+
/** 是否显示撤销和恢复按钮,默认 true;关闭后仍可通过快捷键与 API 操作。 */
|
|
3037
|
+
toolbar?: boolean;
|
|
3038
|
+
/** 单格编辑、批量粘贴或填充完成后通知,包括全部跳过的情况;业务拒绝或抛错时不通知,不自动弹出消息。 */
|
|
3039
|
+
onOperation?: (operation: TableWorksheetOperation) => void;
|
|
3040
|
+
/** 同步业务回调抛错时通知;该次操作不写入历史,不提交部分数据。 */
|
|
3041
|
+
onError?: (error: unknown) => void;
|
|
3042
|
+
}
|
|
3043
|
+
/** 工作表历史状态。 */
|
|
3044
|
+
interface TableWorksheetHistory {
|
|
3045
|
+
/** 是否存在可撤销的整次操作。 */
|
|
3046
|
+
canUndo: boolean;
|
|
3047
|
+
/** 是否存在可恢复的整次操作。 */
|
|
3048
|
+
canRedo: boolean;
|
|
3049
|
+
}
|
|
3050
|
+
/** 工作表公开操作句柄,通过 TableRef.getPluginApi("worksheet") 获取。 */
|
|
3051
|
+
interface TableWorksheetApi<T> {
|
|
3052
|
+
/** 撤销最近整次操作,包括一次批量粘贴或填充;没有历史或业务拒绝时返回 false。 */
|
|
3053
|
+
undo: () => boolean;
|
|
3054
|
+
/** 恢复最近撤销的操作;新编辑后恢复栈清空。 */
|
|
3055
|
+
redo: () => boolean;
|
|
3056
|
+
/** 读取当前撤销和恢复可用状态。 */
|
|
3057
|
+
getHistory: () => TableWorksheetHistory;
|
|
3058
|
+
/** 清空历史并取消编辑和填充;重新导入后可调用。外部替换 dataSource 时也自动清空历史。 */
|
|
3059
|
+
clearHistory: () => void;
|
|
3060
|
+
/** 从当前选区左上角粘贴 TSV;单值铺满选区,矩阵保持原列位置,越界部分截断,不自动新增行。 */
|
|
3061
|
+
paste: (text: string) => boolean;
|
|
3062
|
+
/** 将当前选区沿原列向上或向下填充到目标行;increment=true 按行距离递增末尾数字。 */
|
|
3063
|
+
fillTo: (rowKey: TableKey, increment?: boolean) => boolean;
|
|
3064
|
+
/** 向下填充连续空单元格,遇到第一行已有可编辑值时停止,不覆盖已有内容。 */
|
|
3065
|
+
fillDown: () => boolean;
|
|
3066
|
+
/** 写入单个可编辑单元格并纳入历史;只读、禁用及不兼容值返回 false。 */
|
|
3067
|
+
editCell: (address: TableCellAddress, value: unknown) => boolean;
|
|
3068
|
+
/** 将行复制、删除等业务操作产生的不可变数组纳入同一历史;不执行服务端写入。 */
|
|
3069
|
+
replaceData: (data: T[]) => boolean;
|
|
3070
|
+
}
|
|
3071
|
+
|
|
3072
|
+
/** 工作表内部视图状态,数据和历史由插件实例独立持有。 */
|
|
3073
|
+
interface WorksheetState {
|
|
3074
|
+
/** 当前编辑单元格;null 表示浏览状态。 */
|
|
3075
|
+
editing: TableCellAddress | null;
|
|
3076
|
+
/** 历史或拖拽预览变化时递增。 */
|
|
3077
|
+
revision: number;
|
|
3078
|
+
}
|
|
3079
|
+
/**
|
|
3080
|
+
* 创建 Excel 式工作表插件,内含双击编辑、选区批量粘贴、上下填充和整次撤销恢复。
|
|
3081
|
+
* 与 Table 默认单元格选择配合,勿再同时安装 createEditablePlugin;使用稳定 rowKey。
|
|
3082
|
+
* 每个表格用 useMemo 创建独立实例,onChange 必须同步更新不可变 dataSource;外部换表自动清空历史。
|
|
3083
|
+
* 输入框中的原生复制、粘贴和撤销保留;快捷键只在当前工作表内生效,不发送网络请求。
|
|
3084
|
+
*/
|
|
3085
|
+
declare function createWorksheetPlugin<T extends Record<string, unknown>>(options: TableWorksheetPluginOptions<T>): TablePlugin<T, WorksheetState, TableWorksheetApi<T>>;
|
|
3086
|
+
|
|
2991
3087
|
/** 主题切换的属性配置。 */
|
|
2992
3088
|
interface ThemeSwitchProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> {
|
|
2993
3089
|
/** 当前是否勾选;作为受控属性时通过回调更新。 */
|
|
@@ -3424,4 +3520,4 @@ interface NumberRangeProps extends Omit<HTMLAttributes<HTMLSpanElement>, "onChan
|
|
|
3424
3520
|
/** 日期区间风格的双数字输入框,使用波浪线分隔;可直接绑定 Form.Item。 */
|
|
3425
3521
|
declare const NumberRange: react.ForwardRefExoticComponent<NumberRangeProps & react.RefAttributes<HTMLSpanElement>>;
|
|
3426
3522
|
|
|
3427
|
-
export { Alert, type AlertProps, type AlertStatus, type AnyTablePlugin, AutoSizer, type AutoSizerProps, type AutoSizerSize, BadgeProps, ButtonProps, ButtonSize, Cascader, type CascaderFieldNames, type CascaderOption, type CascaderProps, type CascaderValue, Checkbox, type CheckboxGroupProps, type CheckboxOption, type CheckboxProps, type CheckboxValue, Col, type ColProps, type ColSize, ColorPicker, type ColorPickerMode, type ColorPickerPreset, type ColorPickerProps, ControlSize, ControlStatus, CursorPreview, type CursorPreviewFrame, type CursorPreviewProps, DEFAULT_PAGE_SIZE_OPTIONS, Divider, type DividerProps, Drawer, type DrawerOpenConfig, type DrawerPlacement, type DrawerProps, type DrawerPush, type DrawerPushConfig, Editor, type EditorCommand, type EditorCompletionContext, type EditorCompletionItem, type EditorCompletionItemKind, type EditorCompletionProvider, type EditorContextMenuItem, type EditorHandle, type EditorKeyDownEvent, type EditorLanguage, type EditorMarker, type EditorProps, type EditorRange, type EditorSelectionChange, type EditorTheme, type FlatTreeNode, type FlatTreeOptions, Flex, type FlexProps, FloatingPanel, type FloatingPanelProps, FloatingScrollbarProvider, type FloatingScrollbarProviderProps, Form, type FormErrorField, type FormFieldData, type FormInstance, type FormItemProps, type FormListField, type FormListOperation, type FormListProps, type FormProps, type FormRule, type FormValues, type GridBreakpoint, InputNumber, type InputNumberProps, InputPlaceholderMode, InputSelect, type InputSelectProps, type LayoutGap, Markdown, type MarkdownProps, ModalActionResult, ModalOpenConfig, type NamePath, NumberRange, type NumberRangeProps, type NumberRangeValue, OverlayApiHandle, Pagination, type PaginationProps, QueryForm, type QueryFormField, type QueryFormFieldSetting, type QueryFormProps, type QueryFormSearchInfo, type QueryFormSettingsConfig, type QueryFormSettingsSnapshot, type QueryFormShortcut, Radio, type RadioGroupProps, type RadioOption, type RadioProps, type RadioValue, Row, type RowProps, SIA_THEME, SelectChangeValue, type SelectModalConfig, SelectOption, SelectProps, type SelectionOption, SelectionPanel, type SelectionPanelProps, type SelectionValue, type SiaThemeMode, Slider, type SliderMark, type SliderProps, type SliderValue, type SortableKey, SortableList, type SortableListProps, Space, type SpaceCompactProps, type SpaceProps, Splitter, type SplitterPanelProps, type SplitterProps, Switch, type SwitchProps, type SwitchVariant, Table, type TableAlign, type TableCanvasCell, type TableCellAddress, type TableCellRange, type TableCellRenderInfo, type TableCellSelectionApi, type TableCellSelectionPluginOptions, type TableColumn, type TableColumnSettingApi, type TableColumnSettingItem, type TableColumnSettingPluginOptions, type TableColumnTransformPluginOptions, type TableEditableApi, type TableEditableCellConfig, type TableEditableCellType, type TableEditablePluginOptions, type TableExportApi, type TableExportPluginOptions, type TableExportScope, type TableFilterApi, type TableFilterPluginOptions, type TableFilterValues, type TableFixed, type TableHighlightPluginOptions, type TableHighlightValue, type TableIndexPluginOptions, type TableKey, type TableMergeStickyConfig, type TablePageParams, type TablePaginationApi, type TablePaginationPluginOptions, type TablePlugin, type TablePluginCellProps, type TablePluginContext, type TablePluginEvent, type TableProps, type TableRef, type TableResizeApi, type TableResizePluginOptions, type TableRow, type TableRowSpanPluginOptions, type TableSelectedCell, type TableSelectionApi, type TableSelectionMode, type TableSelectionPluginOptions, type TableSettingsAdapter, type TableSettingsSnapshot, type TableSize, type TableSortApi, type TableSortInfo, type TableSortPluginOptions, type TableSummaryPluginOptions, type TableSummaryRow, type TableToolbarItem, type TableToolbarPluginOptions, type TableTreeApi, type TableTreePluginOptions, TagStatus, TextArea, type TextAreaProps, ThemeSwitch, type ThemeSwitchProps, TimePicker, type TimePickerProps, type TimeRangePickerProps, ToolPanel, type ToolPanelItem, type ToolPanelPlacement, type ToolPanelProps, TreeSelect, type TreeSelectNode, type TreeSelectProps, type TreeSelectValue, Treemap, type TreemapNode, type TreemapNodeClickInfo, type TreemapNodeKind, type TreemapProps, type WindowAction, type WindowActionHandler, type WindowControlAction, type WindowControlLabels, WindowControls, type WindowControlsProps, WindowFrame, type WindowFrameProps, WindowTitleBar, type WindowTitleBarActionsAlign, type WindowTitleBarProps, applySiaTheme, buildFlatTree, createCellSelectionPlugin, createColumnSettingPlugin, createColumnTransformPlugin, createEditablePlugin, createExportPlugin, createFilterPlugin, createHighlightPlugin, createIndexPlugin, createLocalStorageTableSettingsAdapter, createPaginationPlugin, createResizePlugin, createRowSpanPlugin, createSelectionPlugin, createSortPlugin, createSummaryPlugin, createToolbarPlugin, createTreePlugin, openSelectModal, useForm };
|
|
3523
|
+
export { Alert, type AlertProps, type AlertStatus, type AnyTablePlugin, AutoSizer, type AutoSizerProps, type AutoSizerSize, BadgeProps, ButtonProps, ButtonSize, Cascader, type CascaderFieldNames, type CascaderOption, type CascaderProps, type CascaderValue, Checkbox, type CheckboxGroupProps, type CheckboxOption, type CheckboxProps, type CheckboxValue, Col, type ColProps, type ColSize, ColorPicker, type ColorPickerMode, type ColorPickerPreset, type ColorPickerProps, ControlSize, ControlStatus, CursorPreview, type CursorPreviewFrame, type CursorPreviewProps, DEFAULT_PAGE_SIZE_OPTIONS, Divider, type DividerProps, Drawer, type DrawerOpenConfig, type DrawerPlacement, type DrawerProps, type DrawerPush, type DrawerPushConfig, Editor, type EditorCommand, type EditorCompletionContext, type EditorCompletionItem, type EditorCompletionItemKind, type EditorCompletionProvider, type EditorContextMenuItem, type EditorHandle, type EditorKeyDownEvent, type EditorLanguage, type EditorMarker, type EditorProps, type EditorRange, type EditorSelectionChange, type EditorTheme, type FlatTreeNode, type FlatTreeOptions, Flex, type FlexProps, FloatingPanel, type FloatingPanelProps, FloatingScrollbarProvider, type FloatingScrollbarProviderProps, Form, type FormErrorField, type FormFieldData, type FormInstance, type FormItemProps, type FormListField, type FormListOperation, type FormListProps, type FormProps, type FormRule, type FormValues, type GridBreakpoint, InputNumber, type InputNumberProps, InputPlaceholderMode, InputSelect, type InputSelectProps, type LayoutGap, Markdown, type MarkdownProps, ModalActionResult, ModalOpenConfig, type NamePath, NumberRange, type NumberRangeProps, type NumberRangeValue, OverlayApiHandle, Pagination, type PaginationProps, QueryForm, type QueryFormField, type QueryFormFieldSetting, type QueryFormProps, type QueryFormSearchInfo, type QueryFormSettingsConfig, type QueryFormSettingsSnapshot, type QueryFormShortcut, Radio, type RadioGroupProps, type RadioOption, type RadioProps, type RadioValue, Row, type RowProps, SIA_THEME, SelectChangeValue, type SelectModalConfig, SelectOption, SelectProps, type SelectionOption, SelectionPanel, type SelectionPanelProps, type SelectionValue, type SiaThemeMode, Slider, type SliderMark, type SliderProps, type SliderValue, type SortableKey, SortableList, type SortableListProps, Space, type SpaceCompactProps, type SpaceProps, Splitter, type SplitterPanelProps, type SplitterProps, Switch, type SwitchProps, type SwitchVariant, Table, type TableAlign, type TableCanvasCell, type TableCellAddress, type TableCellRange, type TableCellRenderInfo, type TableCellSelectionApi, type TableCellSelectionPluginOptions, type TableColumn, type TableColumnSettingApi, type TableColumnSettingItem, type TableColumnSettingPluginOptions, type TableColumnTransformPluginOptions, type TableEditableApi, type TableEditableCellConfig, type TableEditableCellType, type TableEditablePluginOptions, type TableExportApi, type TableExportPluginOptions, type TableExportScope, type TableFilterApi, type TableFilterPluginOptions, type TableFilterValues, type TableFixed, type TableHighlightPluginOptions, type TableHighlightValue, type TableIndexPluginOptions, type TableKey, type TableMergeStickyConfig, type TablePageParams, type TablePaginationApi, type TablePaginationPluginOptions, type TablePlugin, type TablePluginCellProps, type TablePluginContext, type TablePluginEvent, type TableProps, type TableRef, type TableResizeApi, type TableResizePluginOptions, type TableRow, type TableRowSpanPluginOptions, type TableSelectedCell, type TableSelectionApi, type TableSelectionMode, type TableSelectionPluginOptions, type TableSettingsAdapter, type TableSettingsSnapshot, type TableSize, type TableSortApi, type TableSortInfo, type TableSortPluginOptions, type TableSummaryPluginOptions, type TableSummaryRow, type TableToolbarItem, type TableToolbarPluginOptions, type TableTreeApi, type TableTreePluginOptions, type TableWorksheetApi, type TableWorksheetChange, type TableWorksheetHistory, type TableWorksheetOperation, type TableWorksheetPluginOptions, type TableWorksheetReason, type TableWorksheetValueContext, TagStatus, TextArea, type TextAreaProps, ThemeSwitch, type ThemeSwitchProps, TimePicker, type TimePickerProps, type TimeRangePickerProps, ToolPanel, type ToolPanelItem, type ToolPanelPlacement, type ToolPanelProps, TreeSelect, type TreeSelectNode, type TreeSelectProps, type TreeSelectValue, Treemap, type TreemapNode, type TreemapNodeClickInfo, type TreemapNodeKind, type TreemapProps, type WindowAction, type WindowActionHandler, type WindowControlAction, type WindowControlLabels, WindowControls, type WindowControlsProps, WindowFrame, type WindowFrameProps, WindowTitleBar, type WindowTitleBarActionsAlign, type WindowTitleBarProps, applySiaTheme, buildFlatTree, createCellSelectionPlugin, createColumnSettingPlugin, createColumnTransformPlugin, createEditablePlugin, createExportPlugin, createFilterPlugin, createHighlightPlugin, createIndexPlugin, createLocalStorageTableSettingsAdapter, createPaginationPlugin, createResizePlugin, createRowSpanPlugin, createSelectionPlugin, createSortPlugin, createSummaryPlugin, createToolbarPlugin, createTreePlugin, createWorksheetPlugin, openSelectModal, useForm };
|