@sia.soul/sia-react-ui 0.1.134 → 0.1.137
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.cjs +13 -11
- package/dist/index.css +25 -19
- package/dist/index.d.cts +14 -6
- package/dist/index.d.ts +14 -6
- package/dist/index.js +13 -11
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -13844,19 +13844,19 @@ function createRowIdentity() {
|
|
|
13844
13844
|
}
|
|
13845
13845
|
|
|
13846
13846
|
// src/components/Table/cellFocus.ts
|
|
13847
|
-
function playCellFocusGlow(cell, isVisible, onFinish) {
|
|
13847
|
+
function playCellFocusGlow(cell, isVisible, onFinish, options) {
|
|
13848
13848
|
const namespace = "http://www.w3.org/2000/svg";
|
|
13849
13849
|
const glow = document.createElementNS(namespace, "svg");
|
|
13850
13850
|
glow.classList.add("sia-table__cell-focus-glow");
|
|
13851
13851
|
glow.setAttribute("aria-hidden", "true");
|
|
13852
|
-
|
|
13853
|
-
|
|
13854
|
-
|
|
13855
|
-
|
|
13856
|
-
|
|
13857
|
-
|
|
13858
|
-
|
|
13859
|
-
|
|
13852
|
+
if (options?.color) glow.style.color = options.color;
|
|
13853
|
+
const requestedSpeed = options?.speed, requestedWidth = options?.lineWidth;
|
|
13854
|
+
const speed = typeof requestedSpeed === "number" && Number.isFinite(requestedSpeed) && requestedSpeed > 0 ? Math.min(10, Math.max(0.1, requestedSpeed)) : 1;
|
|
13855
|
+
const lineWidth = typeof requestedWidth === "number" && Number.isFinite(requestedWidth) && requestedWidth > 0 ? Math.min(12, Math.max(1, requestedWidth)) : 4;
|
|
13856
|
+
glow.style.setProperty("--sia-cell-focus-duration", `${750 / speed}ms`);
|
|
13857
|
+
const path = document.createElementNS(namespace, "path");
|
|
13858
|
+
path.setAttribute("pathLength", "100");
|
|
13859
|
+
glow.appendChild(path);
|
|
13860
13860
|
let frame = 0, disposed = false;
|
|
13861
13861
|
const cleanup2 = () => {
|
|
13862
13862
|
if (disposed) return;
|
|
@@ -13872,7 +13872,9 @@ function playCellFocusGlow(cell, isVisible, onFinish) {
|
|
|
13872
13872
|
}
|
|
13873
13873
|
const rect = cell.getBoundingClientRect();
|
|
13874
13874
|
Object.assign(glow.style, { left: `${rect.left}px`, top: `${rect.top}px`, width: `${rect.width}px`, height: `${rect.height}px` });
|
|
13875
|
-
|
|
13875
|
+
const actualWidth = Math.min(lineWidth, rect.width, rect.height), inset = actualWidth / 2;
|
|
13876
|
+
path.style.strokeWidth = `${actualWidth}px`;
|
|
13877
|
+
path.setAttribute("d", `M ${inset} ${inset} H ${rect.width - inset} V ${rect.height - inset} H ${inset} Z`);
|
|
13876
13878
|
frame = requestAnimationFrame(position);
|
|
13877
13879
|
};
|
|
13878
13880
|
position();
|
|
@@ -17060,7 +17062,7 @@ function TableInner(props, ref) {
|
|
|
17060
17062
|
if (options?.highlight !== false) {
|
|
17061
17063
|
const cleanup2 = playCellFocusGlow(cell, visible, () => {
|
|
17062
17064
|
cellGlow.current = null;
|
|
17063
|
-
});
|
|
17065
|
+
}, options);
|
|
17064
17066
|
cellGlow.current = cleanup2;
|
|
17065
17067
|
}
|
|
17066
17068
|
return true;
|
package/dist/index.css
CHANGED
|
@@ -11193,32 +11193,41 @@ body > .sia-title-tooltip[data-sia-popup-layer] {
|
|
|
11193
11193
|
overflow: visible;
|
|
11194
11194
|
pointer-events: none;
|
|
11195
11195
|
fill: none;
|
|
11196
|
-
|
|
11196
|
+
color: #ff303b;
|
|
11197
|
+
animation: sia-table-cell-focus-lifetime var(--sia-cell-focus-duration, 750ms) linear forwards;
|
|
11197
11198
|
}
|
|
11198
11199
|
.sia-table__cell-focus-glow path {
|
|
11199
|
-
stroke:
|
|
11200
|
-
stroke-width:
|
|
11200
|
+
stroke: currentColor;
|
|
11201
|
+
stroke-width: 4px;
|
|
11201
11202
|
stroke-linecap: round;
|
|
11202
|
-
|
|
11203
|
-
filter: drop-shadow(0 0 3px
|
|
11204
|
-
animation: sia-table-cell-focus-
|
|
11205
|
-
}
|
|
11206
|
-
.sia-table__cell-focus-glow path:nth-child(2) {
|
|
11207
|
-
opacity: .6;
|
|
11203
|
+
stroke-dashoffset: 0;
|
|
11204
|
+
filter: drop-shadow(0 0 3px color-mix(in srgb, currentColor 55%, transparent));
|
|
11205
|
+
animation: sia-table-cell-focus-grow-retract var(--sia-cell-focus-duration, 750ms) linear forwards;
|
|
11208
11206
|
}
|
|
11209
|
-
|
|
11210
|
-
|
|
11207
|
+
@keyframes sia-table-cell-focus-grow-retract {
|
|
11208
|
+
0% {
|
|
11209
|
+
stroke-dasharray: 0px 100px;
|
|
11210
|
+
stroke-dashoffset: 0px;
|
|
11211
|
+
}
|
|
11212
|
+
60% {
|
|
11213
|
+
stroke-dasharray: 100px 0px;
|
|
11214
|
+
stroke-dashoffset: 0px;
|
|
11215
|
+
}
|
|
11216
|
+
100% {
|
|
11217
|
+
stroke-dasharray: 0px 100px;
|
|
11218
|
+
stroke-dashoffset: -100px;
|
|
11219
|
+
}
|
|
11211
11220
|
}
|
|
11212
|
-
@keyframes sia-table-cell-focus-
|
|
11221
|
+
@keyframes sia-table-cell-focus-lifetime {
|
|
11213
11222
|
from {
|
|
11214
|
-
|
|
11223
|
+
opacity: 1;
|
|
11215
11224
|
}
|
|
11216
11225
|
to {
|
|
11217
|
-
|
|
11226
|
+
opacity: 1;
|
|
11218
11227
|
}
|
|
11219
11228
|
}
|
|
11220
11229
|
@keyframes sia-table-cell-focus-fade {
|
|
11221
|
-
0
|
|
11230
|
+
0% {
|
|
11222
11231
|
opacity: 1;
|
|
11223
11232
|
}
|
|
11224
11233
|
100% {
|
|
@@ -11227,15 +11236,12 @@ body > .sia-title-tooltip[data-sia-popup-layer] {
|
|
|
11227
11236
|
}
|
|
11228
11237
|
@media (prefers-reduced-motion: reduce) {
|
|
11229
11238
|
.sia-table__cell-focus-glow {
|
|
11230
|
-
animation
|
|
11239
|
+
animation: sia-table-cell-focus-fade 200ms linear forwards;
|
|
11231
11240
|
}
|
|
11232
11241
|
.sia-table__cell-focus-glow path {
|
|
11233
11242
|
animation: none;
|
|
11234
11243
|
stroke-dasharray: none;
|
|
11235
11244
|
}
|
|
11236
|
-
.sia-table__cell-focus-glow path:not(:last-child) {
|
|
11237
|
-
display: none;
|
|
11238
|
-
}
|
|
11239
11245
|
}
|
|
11240
11246
|
|
|
11241
11247
|
/* src/components/Table/worksheet.css */
|
package/dist/index.d.cts
CHANGED
|
@@ -2349,6 +2349,17 @@ interface TableProps<T extends Record<string, unknown> = Record<string, unknown>
|
|
|
2349
2349
|
/** 表格元素的内联样式。 */
|
|
2350
2350
|
tableStyle?: CSSProperties;
|
|
2351
2351
|
}
|
|
2352
|
+
/** 单元格定位时的一次性视觉反馈配置;每次调用独立生效,不改变表格数据或全局默认值。 */
|
|
2353
|
+
interface TableCellFocusOptions {
|
|
2354
|
+
/** 是否在目标可见后播放先增长一圈、再由尾部收拢消失的边框光线,默认 true;false 仅滚动、选中和聚焦。 */
|
|
2355
|
+
highlight?: boolean;
|
|
2356
|
+
/** 描边和柔光共用的 CSS 颜色,默认红色 #ff303b;例如 #fa8c16 为橙色。无效颜色回退默认值;CSS 变量需在页面根层可用。 */
|
|
2357
|
+
color?: string;
|
|
2358
|
+
/** 动效速度倍率,默认 1,即增长 450ms、收缩 300ms;2 为双倍速度、0.5 为半速。有限正数限制在 0.1~10,零、负数或非有限值回退 1;减少动态效果时忽略此倍率,统一 200ms 淡出。 */
|
|
2359
|
+
speed?: number;
|
|
2360
|
+
/** 描边线宽,单位 CSS px,默认 4;有限正数限制在 1~12,零、负数或非有限值回退 4。极窄单元格会按可容纳宽度缩小,柔光颜色跟随 color。 */
|
|
2361
|
+
lineWidth?: number;
|
|
2362
|
+
}
|
|
2352
2363
|
/** 表格的实例引用接口。 */
|
|
2353
2364
|
interface TableRef<T> {
|
|
2354
2365
|
/** 读取插件当前处理的行数据。 */
|
|
@@ -2361,11 +2372,8 @@ interface TableRef<T> {
|
|
|
2361
2372
|
scrollTo: (options: ScrollToOptions) => void;
|
|
2362
2373
|
/** 按 rowKey 定位当前筛选、排序、分页及树展开后列表中的行,仅在该行被遮挡时立即纵向滚动,使其避开吸顶表头和合计行;支持虚拟列表,不改变横向位置或焦点。返回是否找到目标且视口可见;目标被筛掉、位于其他页、表格隐藏或未挂载时返回 false,不自动切页。应在数据提交和弹框显示后调用。 */
|
|
2363
2374
|
scrollToRow: (key: TableKey) => boolean;
|
|
2364
|
-
/**
|
|
2365
|
-
focusCell: (rowKey: TableKey, columnKey: string, options?:
|
|
2366
|
-
/** 是否在目标可见后播放一圈红色边框流光渐隐,默认 true;false 仅滚动、选中和聚焦。 */
|
|
2367
|
-
highlight?: boolean;
|
|
2368
|
-
}) => Promise<boolean>;
|
|
2375
|
+
/** 按稳定行键和叶子列键定位单元格,横纵滚动避开吸顶表头、固定列及合计行,选中并聚焦但不进入编辑。等待虚拟行挂载、位置稳定且整格在可视区后返回成功,再由顶层浮层从左上角沿边框顺时针增长光线:尾端固定,默认速度下 450 毫秒围满一圈,再用 300 毫秒从尾部收拢至头部后消失;不拦截操作,减少动态效果时仅同色边框淡出。隐藏列、其它页、无法完整显示的单元格、不可见表格或被后续定位取代时返回 false,不自动切页或显示隐藏列。应在数据更新及弹框关闭动画完成后调用;再次定位、目标滚出可视区或卸载会清理动效。 */
|
|
2376
|
+
focusCell: (rowKey: TableKey, columnKey: string, options?: TableCellFocusOptions) => Promise<boolean>;
|
|
2369
2377
|
/** 切换加载状态。 */
|
|
2370
2378
|
setLoading: (loading: boolean) => void;
|
|
2371
2379
|
/** 读取当前分页状态。 */
|
|
@@ -3534,4 +3542,4 @@ interface NumberRangeProps extends Omit<HTMLAttributes<HTMLSpanElement>, "onChan
|
|
|
3534
3542
|
/** 日期区间风格的双数字输入框,使用波浪线分隔;可直接绑定 Form.Item。 */
|
|
3535
3543
|
declare const NumberRange: react.ForwardRefExoticComponent<NumberRangeProps & react.RefAttributes<HTMLSpanElement>>;
|
|
3536
3544
|
|
|
3537
|
-
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 };
|
|
3545
|
+
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 TableCellFocusOptions, 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
|
@@ -2349,6 +2349,17 @@ interface TableProps<T extends Record<string, unknown> = Record<string, unknown>
|
|
|
2349
2349
|
/** 表格元素的内联样式。 */
|
|
2350
2350
|
tableStyle?: CSSProperties;
|
|
2351
2351
|
}
|
|
2352
|
+
/** 单元格定位时的一次性视觉反馈配置;每次调用独立生效,不改变表格数据或全局默认值。 */
|
|
2353
|
+
interface TableCellFocusOptions {
|
|
2354
|
+
/** 是否在目标可见后播放先增长一圈、再由尾部收拢消失的边框光线,默认 true;false 仅滚动、选中和聚焦。 */
|
|
2355
|
+
highlight?: boolean;
|
|
2356
|
+
/** 描边和柔光共用的 CSS 颜色,默认红色 #ff303b;例如 #fa8c16 为橙色。无效颜色回退默认值;CSS 变量需在页面根层可用。 */
|
|
2357
|
+
color?: string;
|
|
2358
|
+
/** 动效速度倍率,默认 1,即增长 450ms、收缩 300ms;2 为双倍速度、0.5 为半速。有限正数限制在 0.1~10,零、负数或非有限值回退 1;减少动态效果时忽略此倍率,统一 200ms 淡出。 */
|
|
2359
|
+
speed?: number;
|
|
2360
|
+
/** 描边线宽,单位 CSS px,默认 4;有限正数限制在 1~12,零、负数或非有限值回退 4。极窄单元格会按可容纳宽度缩小,柔光颜色跟随 color。 */
|
|
2361
|
+
lineWidth?: number;
|
|
2362
|
+
}
|
|
2352
2363
|
/** 表格的实例引用接口。 */
|
|
2353
2364
|
interface TableRef<T> {
|
|
2354
2365
|
/** 读取插件当前处理的行数据。 */
|
|
@@ -2361,11 +2372,8 @@ interface TableRef<T> {
|
|
|
2361
2372
|
scrollTo: (options: ScrollToOptions) => void;
|
|
2362
2373
|
/** 按 rowKey 定位当前筛选、排序、分页及树展开后列表中的行,仅在该行被遮挡时立即纵向滚动,使其避开吸顶表头和合计行;支持虚拟列表,不改变横向位置或焦点。返回是否找到目标且视口可见;目标被筛掉、位于其他页、表格隐藏或未挂载时返回 false,不自动切页。应在数据提交和弹框显示后调用。 */
|
|
2363
2374
|
scrollToRow: (key: TableKey) => boolean;
|
|
2364
|
-
/**
|
|
2365
|
-
focusCell: (rowKey: TableKey, columnKey: string, options?:
|
|
2366
|
-
/** 是否在目标可见后播放一圈红色边框流光渐隐,默认 true;false 仅滚动、选中和聚焦。 */
|
|
2367
|
-
highlight?: boolean;
|
|
2368
|
-
}) => Promise<boolean>;
|
|
2375
|
+
/** 按稳定行键和叶子列键定位单元格,横纵滚动避开吸顶表头、固定列及合计行,选中并聚焦但不进入编辑。等待虚拟行挂载、位置稳定且整格在可视区后返回成功,再由顶层浮层从左上角沿边框顺时针增长光线:尾端固定,默认速度下 450 毫秒围满一圈,再用 300 毫秒从尾部收拢至头部后消失;不拦截操作,减少动态效果时仅同色边框淡出。隐藏列、其它页、无法完整显示的单元格、不可见表格或被后续定位取代时返回 false,不自动切页或显示隐藏列。应在数据更新及弹框关闭动画完成后调用;再次定位、目标滚出可视区或卸载会清理动效。 */
|
|
2376
|
+
focusCell: (rowKey: TableKey, columnKey: string, options?: TableCellFocusOptions) => Promise<boolean>;
|
|
2369
2377
|
/** 切换加载状态。 */
|
|
2370
2378
|
setLoading: (loading: boolean) => void;
|
|
2371
2379
|
/** 读取当前分页状态。 */
|
|
@@ -3534,4 +3542,4 @@ interface NumberRangeProps extends Omit<HTMLAttributes<HTMLSpanElement>, "onChan
|
|
|
3534
3542
|
/** 日期区间风格的双数字输入框,使用波浪线分隔;可直接绑定 Form.Item。 */
|
|
3535
3543
|
declare const NumberRange: react.ForwardRefExoticComponent<NumberRangeProps & react.RefAttributes<HTMLSpanElement>>;
|
|
3536
3544
|
|
|
3537
|
-
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 };
|
|
3545
|
+
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 TableCellFocusOptions, 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.js
CHANGED
|
@@ -5699,19 +5699,19 @@ function createRowIdentity() {
|
|
|
5699
5699
|
}
|
|
5700
5700
|
|
|
5701
5701
|
// src/components/Table/cellFocus.ts
|
|
5702
|
-
function playCellFocusGlow(cell, isVisible, onFinish) {
|
|
5702
|
+
function playCellFocusGlow(cell, isVisible, onFinish, options) {
|
|
5703
5703
|
const namespace = "http://www.w3.org/2000/svg";
|
|
5704
5704
|
const glow = document.createElementNS(namespace, "svg");
|
|
5705
5705
|
glow.classList.add("sia-table__cell-focus-glow");
|
|
5706
5706
|
glow.setAttribute("aria-hidden", "true");
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5707
|
+
if (options?.color) glow.style.color = options.color;
|
|
5708
|
+
const requestedSpeed = options?.speed, requestedWidth = options?.lineWidth;
|
|
5709
|
+
const speed = typeof requestedSpeed === "number" && Number.isFinite(requestedSpeed) && requestedSpeed > 0 ? Math.min(10, Math.max(0.1, requestedSpeed)) : 1;
|
|
5710
|
+
const lineWidth = typeof requestedWidth === "number" && Number.isFinite(requestedWidth) && requestedWidth > 0 ? Math.min(12, Math.max(1, requestedWidth)) : 4;
|
|
5711
|
+
glow.style.setProperty("--sia-cell-focus-duration", `${750 / speed}ms`);
|
|
5712
|
+
const path = document.createElementNS(namespace, "path");
|
|
5713
|
+
path.setAttribute("pathLength", "100");
|
|
5714
|
+
glow.appendChild(path);
|
|
5715
5715
|
let frame = 0, disposed = false;
|
|
5716
5716
|
const cleanup = () => {
|
|
5717
5717
|
if (disposed) return;
|
|
@@ -5727,7 +5727,9 @@ function playCellFocusGlow(cell, isVisible, onFinish) {
|
|
|
5727
5727
|
}
|
|
5728
5728
|
const rect = cell.getBoundingClientRect();
|
|
5729
5729
|
Object.assign(glow.style, { left: `${rect.left}px`, top: `${rect.top}px`, width: `${rect.width}px`, height: `${rect.height}px` });
|
|
5730
|
-
|
|
5730
|
+
const actualWidth = Math.min(lineWidth, rect.width, rect.height), inset = actualWidth / 2;
|
|
5731
|
+
path.style.strokeWidth = `${actualWidth}px`;
|
|
5732
|
+
path.setAttribute("d", `M ${inset} ${inset} H ${rect.width - inset} V ${rect.height - inset} H ${inset} Z`);
|
|
5731
5733
|
frame = requestAnimationFrame(position);
|
|
5732
5734
|
};
|
|
5733
5735
|
position();
|
|
@@ -8915,7 +8917,7 @@ function TableInner(props, ref) {
|
|
|
8915
8917
|
if (options?.highlight !== false) {
|
|
8916
8918
|
const cleanup = playCellFocusGlow(cell, visible, () => {
|
|
8917
8919
|
cellGlow.current = null;
|
|
8918
|
-
});
|
|
8920
|
+
}, options);
|
|
8919
8921
|
cellGlow.current = cleanup;
|
|
8920
8922
|
}
|
|
8921
8923
|
return true;
|