@sia.soul/sia-react-ui 0.1.24 → 0.1.25
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/chart.cjs +1 -1
- package/dist/chart.js +4 -4
- package/dist/{chunk-LRPQ5FGE.js → chunk-27ZYAKII.js} +2 -2
- package/dist/{chunk-6WBABNAX.js → chunk-IYNS423D.js} +1 -1
- package/dist/{chunk-T2QIW4OO.js → chunk-IYO2JSGQ.js} +3 -3
- package/dist/{chunk-LA7O3PN4.js → chunk-PXHBIRQW.js} +1 -1
- package/dist/{chunk-6R7JY7IY.js → chunk-QCBKT5FV.js} +3 -3
- package/dist/{chunk-NSSPGXNM.js → chunk-RAO3JHDL.js} +1 -1
- package/dist/{chunk-RGXVPS37.js → chunk-RWODH2LW.js} +3 -3
- package/dist/{chunk-GUXAWU63.js → chunk-TZROBD65.js} +3 -3
- package/dist/{chunk-LIYCU2GU.js → chunk-W52CNNWW.js} +5 -5
- package/dist/{chunk-OH6YILJW.js → chunk-YQDHCORW.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.css +1 -0
- package/dist/core.js +6 -6
- package/dist/index.cjs +17 -3
- package/dist/index.css +1 -0
- package/dist/index.d.cts +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.js +26 -12
- package/dist/markdown-editor.cjs +1 -1
- package/dist/markdown-editor.js +2 -2
- package/dist/rich-text-editor.cjs +1 -1
- package/dist/rich-text-editor.js +4 -4
- package/dist/select-date-range.cjs +1 -1
- package/dist/select-date-range.js +5 -5
- package/package.json +1 -1
package/dist/chart.cjs
CHANGED
|
@@ -317,7 +317,7 @@ function installTitleTooltips(doc) {
|
|
|
317
317
|
else if (active.getAttribute("data-sia-title") !== doc.getElementById(tooltipId)?.textContent) render();
|
|
318
318
|
});
|
|
319
319
|
observer.observe(doc.body, { childList: true, subtree: true, attributes: true, attributeFilter: ["data-sia-title"] });
|
|
320
|
-
},
|
|
320
|
+
}, 600);
|
|
321
321
|
};
|
|
322
322
|
doc.addEventListener("pointerover", (event) => {
|
|
323
323
|
if (event.pointerType === "touch") return;
|
package/dist/chart.js
CHANGED
|
@@ -56,10 +56,10 @@ import {
|
|
|
56
56
|
smoothSvgPath,
|
|
57
57
|
svgArcPath,
|
|
58
58
|
transferCompositeValue
|
|
59
|
-
} from "./chunk-
|
|
60
|
-
import "./chunk-
|
|
61
|
-
import "./chunk-
|
|
62
|
-
import "./chunk-
|
|
59
|
+
} from "./chunk-TZROBD65.js";
|
|
60
|
+
import "./chunk-YQDHCORW.js";
|
|
61
|
+
import "./chunk-IYNS423D.js";
|
|
62
|
+
import "./chunk-RAO3JHDL.js";
|
|
63
63
|
export {
|
|
64
64
|
BarChart,
|
|
65
65
|
CHART_VIEWBOX_HEIGHT,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Button
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IYNS423D.js";
|
|
4
4
|
import {
|
|
5
5
|
PopupPortal,
|
|
6
6
|
useControlSize,
|
|
7
7
|
useControllableState,
|
|
8
8
|
usePlaceholderMode,
|
|
9
9
|
withTitleTooltip
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RAO3JHDL.js";
|
|
11
11
|
|
|
12
12
|
// src/components/Icon.tsx
|
|
13
13
|
import { forwardRef } from "react";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Select
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QCBKT5FV.js";
|
|
4
4
|
import {
|
|
5
5
|
Icon
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-27ZYAKII.js";
|
|
7
7
|
import {
|
|
8
8
|
PopupPortal,
|
|
9
9
|
useControlSize,
|
|
10
10
|
useControllableState,
|
|
11
11
|
useFloatingPlaceholder,
|
|
12
12
|
withTitleTooltip
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-RAO3JHDL.js";
|
|
14
14
|
|
|
15
15
|
// src/components/DatePicker.tsx
|
|
16
16
|
import { useEffect, useId, useMemo, useRef as useRef2, useState } from "react";
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
Dropdown,
|
|
3
3
|
Icon,
|
|
4
4
|
Input
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-27ZYAKII.js";
|
|
6
6
|
import {
|
|
7
7
|
Button
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IYNS423D.js";
|
|
9
9
|
import {
|
|
10
10
|
ControlSizeContext,
|
|
11
11
|
PopupPortal,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
useControllableState,
|
|
14
14
|
useFloatingPlaceholder,
|
|
15
15
|
withTitleTooltip
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-RAO3JHDL.js";
|
|
17
17
|
|
|
18
18
|
// src/components/Checkbox.tsx
|
|
19
19
|
import { createContext, forwardRef, useContext, useEffect, useId, useMemo, useRef } from "react";
|
|
@@ -83,7 +83,7 @@ function installTitleTooltips(doc) {
|
|
|
83
83
|
else if (active.getAttribute("data-sia-title") !== doc.getElementById(tooltipId)?.textContent) render();
|
|
84
84
|
});
|
|
85
85
|
observer.observe(doc.body, { childList: true, subtree: true, attributes: true, attributeFilter: ["data-sia-title"] });
|
|
86
|
-
},
|
|
86
|
+
}, 600);
|
|
87
87
|
};
|
|
88
88
|
doc.addEventListener("pointerover", (event) => {
|
|
89
89
|
if (event.pointerType === "touch") return;
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
Dropdown,
|
|
3
3
|
Icon,
|
|
4
4
|
Input
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-27ZYAKII.js";
|
|
6
6
|
import {
|
|
7
7
|
Button
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IYNS423D.js";
|
|
9
9
|
import {
|
|
10
10
|
useFloatingPlaceholder,
|
|
11
11
|
withTitleTooltip
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-RAO3JHDL.js";
|
|
13
13
|
|
|
14
14
|
// src/components/RichTextEditor.tsx
|
|
15
15
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TextArea
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YQDHCORW.js";
|
|
4
4
|
import {
|
|
5
5
|
Button
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-IYNS423D.js";
|
|
7
7
|
import {
|
|
8
8
|
withTitleTooltip
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RAO3JHDL.js";
|
|
10
10
|
|
|
11
11
|
// src/components/ChartWhirlingLoading.tsx
|
|
12
12
|
import { useEffect, useState } from "react";
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TextArea
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YQDHCORW.js";
|
|
4
4
|
import {
|
|
5
5
|
Popover,
|
|
6
6
|
Tooltip,
|
|
7
7
|
useOverlayLifecycle
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QCBKT5FV.js";
|
|
9
9
|
import {
|
|
10
10
|
Dropdown,
|
|
11
11
|
Icon
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-27ZYAKII.js";
|
|
13
13
|
import {
|
|
14
14
|
Button
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-IYNS423D.js";
|
|
16
16
|
import {
|
|
17
17
|
useControlSize,
|
|
18
18
|
useControllableState,
|
|
19
19
|
withTitleTooltip
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-RAO3JHDL.js";
|
|
21
21
|
|
|
22
22
|
// src/components/Toolbar.tsx
|
|
23
23
|
import { useLayoutEffect, useRef, useState } from "react";
|
package/dist/core.cjs
CHANGED
|
@@ -245,7 +245,7 @@ function installTitleTooltips(doc) {
|
|
|
245
245
|
else if (active.getAttribute("data-sia-title") !== doc.getElementById(tooltipId)?.textContent) render();
|
|
246
246
|
});
|
|
247
247
|
observer.observe(doc.body, { childList: true, subtree: true, attributes: true, attributeFilter: ["data-sia-title"] });
|
|
248
|
-
},
|
|
248
|
+
}, 600);
|
|
249
249
|
};
|
|
250
250
|
doc.addEventListener("pointerover", (event) => {
|
|
251
251
|
if (event.pointerType === "touch") return;
|
package/dist/core.css
CHANGED
package/dist/core.js
CHANGED
|
@@ -10,21 +10,21 @@ import {
|
|
|
10
10
|
Typography,
|
|
11
11
|
Upload,
|
|
12
12
|
message
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-W52CNNWW.js";
|
|
14
|
+
import "./chunk-YQDHCORW.js";
|
|
15
15
|
import {
|
|
16
16
|
Modal,
|
|
17
17
|
Select
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-QCBKT5FV.js";
|
|
19
19
|
import {
|
|
20
20
|
Icon,
|
|
21
21
|
Input,
|
|
22
22
|
Segmented
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-27ZYAKII.js";
|
|
24
24
|
import {
|
|
25
25
|
Button
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-IYNS423D.js";
|
|
27
|
+
import "./chunk-RAO3JHDL.js";
|
|
28
28
|
export {
|
|
29
29
|
Breadcrumb,
|
|
30
30
|
Button,
|
package/dist/index.cjs
CHANGED
|
@@ -393,7 +393,7 @@ function installTitleTooltips(doc) {
|
|
|
393
393
|
else if (active.getAttribute("data-sia-title") !== doc.getElementById(tooltipId)?.textContent) render();
|
|
394
394
|
});
|
|
395
395
|
observer.observe(doc.body, { childList: true, subtree: true, attributes: true, attributeFilter: ["data-sia-title"] });
|
|
396
|
-
},
|
|
396
|
+
}, 600);
|
|
397
397
|
};
|
|
398
398
|
doc.addEventListener("pointerover", (event) => {
|
|
399
399
|
if (event.pointerType === "touch") return;
|
|
@@ -11676,6 +11676,16 @@ function createCellSelectionPlugin(options = {}) {
|
|
|
11676
11676
|
event.clipboardData?.setData("text/plain", text);
|
|
11677
11677
|
options.onCopy?.(text, selectedCells(context));
|
|
11678
11678
|
};
|
|
11679
|
+
const clearOnOutsidePointerDown = (event) => {
|
|
11680
|
+
const context = latestContext;
|
|
11681
|
+
if (event.button !== 0 || !context?.state.range || !activeRoot) return;
|
|
11682
|
+
const target = event.target instanceof Element ? event.target : null;
|
|
11683
|
+
const cell = target?.closest("td[data-column-key], th[data-column-key]");
|
|
11684
|
+
if (cell?.closest(".sia-table") === activeRoot) return;
|
|
11685
|
+
stopDragging();
|
|
11686
|
+
setSelection(context, null);
|
|
11687
|
+
};
|
|
11688
|
+
document.addEventListener("pointerdown", clearOnOutsidePointerDown, true);
|
|
11679
11689
|
window.addEventListener("pointerup", stopDragging);
|
|
11680
11690
|
window.addEventListener("pointercancel", stopDragging);
|
|
11681
11691
|
window.addEventListener("blur", stopDragging);
|
|
@@ -11684,6 +11694,7 @@ function createCellSelectionPlugin(options = {}) {
|
|
|
11684
11694
|
document.addEventListener("copy", handleCopy);
|
|
11685
11695
|
return () => {
|
|
11686
11696
|
stopDragging();
|
|
11697
|
+
document.removeEventListener("pointerdown", clearOnOutsidePointerDown, true);
|
|
11687
11698
|
window.removeEventListener("pointerup", stopDragging);
|
|
11688
11699
|
window.removeEventListener("pointercancel", stopDragging);
|
|
11689
11700
|
window.removeEventListener("blur", stopDragging);
|
|
@@ -13765,6 +13776,7 @@ function TableInner(props, ref) {
|
|
|
13765
13776
|
stickyHeader = true,
|
|
13766
13777
|
resizable = true,
|
|
13767
13778
|
cellSelection = true,
|
|
13779
|
+
showIndex = true,
|
|
13768
13780
|
onRowClick,
|
|
13769
13781
|
onRowDoubleClick,
|
|
13770
13782
|
onCellContextMenu,
|
|
@@ -13788,13 +13800,15 @@ function TableInner(props, ref) {
|
|
|
13788
13800
|
const builtInResizePlugin = (0, import_react50.useMemo)(() => createResizePlugin(), []);
|
|
13789
13801
|
const builtInHighlightPlugin = (0, import_react50.useMemo)(() => createHighlightPlugin(), []);
|
|
13790
13802
|
const builtInCellSelectionPlugin = (0, import_react50.useMemo)(() => createCellSelectionPlugin(), []);
|
|
13803
|
+
const builtInIndexPlugin = (0, import_react50.useMemo)(() => createIndexPlugin(), []);
|
|
13791
13804
|
const activePlugins = (0, import_react50.useMemo)(() => {
|
|
13792
|
-
const plugins = providedPlugins.filter((plugin) => (resizable || plugin.id !== "resize") && (cellSelection || plugin.id !== "cellSelection"));
|
|
13805
|
+
const plugins = providedPlugins.filter((plugin) => (resizable || plugin.id !== "resize") && (cellSelection || plugin.id !== "cellSelection") && (showIndex || plugin.id !== "index"));
|
|
13793
13806
|
if (!plugins.some((plugin) => plugin.id === "highlight")) plugins.push(builtInHighlightPlugin);
|
|
13794
13807
|
if (resizable && !plugins.some((plugin) => plugin.id === "resize")) plugins.push(builtInResizePlugin);
|
|
13795
13808
|
if (cellSelection && !plugins.some((plugin) => plugin.id === "cellSelection")) plugins.push(builtInCellSelectionPlugin);
|
|
13809
|
+
if (showIndex && !plugins.some((plugin) => plugin.id === "index")) plugins.push(builtInIndexPlugin);
|
|
13796
13810
|
return plugins;
|
|
13797
|
-
}, [builtInHighlightPlugin, builtInResizePlugin, builtInCellSelectionPlugin, providedPlugins, resizable, cellSelection]);
|
|
13811
|
+
}, [builtInHighlightPlugin, builtInResizePlugin, builtInCellSelectionPlugin, builtInIndexPlugin, providedPlugins, resizable, cellSelection, showIndex]);
|
|
13798
13812
|
const sortedPlugins = (0, import_react50.useMemo)(() => [...activePlugins].sort((a, b) => (a.order ?? 100) - (b.order ?? 100)), [activePlugins]);
|
|
13799
13813
|
const pluginsByIdRef = (0, import_react50.useRef)(/* @__PURE__ */ new Map());
|
|
13800
13814
|
pluginsByIdRef.current = new Map(sortedPlugins.map((plugin) => [plugin.id, plugin]));
|
package/dist/index.css
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -2118,9 +2118,15 @@ interface TableProps<T extends Record<string, unknown> = Record<string, unknown>
|
|
|
2118
2118
|
stickyHeader?: boolean;
|
|
2119
2119
|
/** 是否允许拖拽表头边界调整列宽;默认启用内置列宽调整插件。 */
|
|
2120
2120
|
resizable?: boolean;
|
|
2121
|
-
/**
|
|
2121
|
+
/** 是否启用单元格选择;点击表格空白处或表格外部清除单元格选区,不影响行勾选。false 时禁用(包括显式传入的插件)。启用时显式传入的单元格选择插件优先于内置默认插件。
|
|
2122
2122
|
* @defaultValue true */
|
|
2123
2123
|
cellSelection?: boolean;
|
|
2124
|
+
/**
|
|
2125
|
+
* 是否显示序号列,默认从 1 开始;搭配分页插件时按页码连续编号,存在勾选列时放在其后。
|
|
2126
|
+
* 显式传入 createIndexPlugin 可自定义标题、宽度和起始编号,不会重复生成序号列;false 时禁用序号插件(包括显式传入的插件)。
|
|
2127
|
+
* @defaultValue true
|
|
2128
|
+
*/
|
|
2129
|
+
showIndex?: boolean;
|
|
2124
2130
|
/** 点击行时调用。 */
|
|
2125
2131
|
onRowClick?: (record: T, index: number) => void;
|
|
2126
2132
|
/** 双击行时调用。 */
|
|
@@ -2341,7 +2347,7 @@ interface TableCellSelectionApi<T> {
|
|
|
2341
2347
|
/** 将当前选区转换为可复制文本。 */
|
|
2342
2348
|
getCopyText: () => string;
|
|
2343
2349
|
}
|
|
2344
|
-
/**
|
|
2350
|
+
/** 创建表格单元格区域选择插件。Table 默认内置;点击表格空白处或表格外部时清除单元格选区,不改变行勾选状态。显式传入 plugins 可自定义选择和复制行为。 */
|
|
2345
2351
|
declare function createCellSelectionPlugin<T extends Record<string, unknown>>(options?: TableCellSelectionPluginOptions<T>): TablePlugin<T, CellSelectionState, TableCellSelectionApi<T>>;
|
|
2346
2352
|
/** TableRowSpan的插件配置。 */
|
|
2347
2353
|
interface TableRowSpanPluginOptions<T> {
|
|
@@ -2539,7 +2545,7 @@ interface TableIndexPluginOptions {
|
|
|
2539
2545
|
/** 序号列的起始编号。 */
|
|
2540
2546
|
startIndex?: number;
|
|
2541
2547
|
}
|
|
2542
|
-
/**
|
|
2548
|
+
/** 创建表格序号列插件。Table 默认内置;显式加入 plugins 可覆盖标题、宽度和起始编号,不重复加载。Table 的 showIndex=false 时禁用。 */
|
|
2543
2549
|
declare function createIndexPlugin<T extends Record<string, unknown>>(options?: TableIndexPluginOptions): TablePlugin<T, undefined>;
|
|
2544
2550
|
/** TableTree的插件配置。 */
|
|
2545
2551
|
interface TableTreePluginOptions<T> {
|
package/dist/index.d.ts
CHANGED
|
@@ -2118,9 +2118,15 @@ interface TableProps<T extends Record<string, unknown> = Record<string, unknown>
|
|
|
2118
2118
|
stickyHeader?: boolean;
|
|
2119
2119
|
/** 是否允许拖拽表头边界调整列宽;默认启用内置列宽调整插件。 */
|
|
2120
2120
|
resizable?: boolean;
|
|
2121
|
-
/**
|
|
2121
|
+
/** 是否启用单元格选择;点击表格空白处或表格外部清除单元格选区,不影响行勾选。false 时禁用(包括显式传入的插件)。启用时显式传入的单元格选择插件优先于内置默认插件。
|
|
2122
2122
|
* @defaultValue true */
|
|
2123
2123
|
cellSelection?: boolean;
|
|
2124
|
+
/**
|
|
2125
|
+
* 是否显示序号列,默认从 1 开始;搭配分页插件时按页码连续编号,存在勾选列时放在其后。
|
|
2126
|
+
* 显式传入 createIndexPlugin 可自定义标题、宽度和起始编号,不会重复生成序号列;false 时禁用序号插件(包括显式传入的插件)。
|
|
2127
|
+
* @defaultValue true
|
|
2128
|
+
*/
|
|
2129
|
+
showIndex?: boolean;
|
|
2124
2130
|
/** 点击行时调用。 */
|
|
2125
2131
|
onRowClick?: (record: T, index: number) => void;
|
|
2126
2132
|
/** 双击行时调用。 */
|
|
@@ -2341,7 +2347,7 @@ interface TableCellSelectionApi<T> {
|
|
|
2341
2347
|
/** 将当前选区转换为可复制文本。 */
|
|
2342
2348
|
getCopyText: () => string;
|
|
2343
2349
|
}
|
|
2344
|
-
/**
|
|
2350
|
+
/** 创建表格单元格区域选择插件。Table 默认内置;点击表格空白处或表格外部时清除单元格选区,不改变行勾选状态。显式传入 plugins 可自定义选择和复制行为。 */
|
|
2345
2351
|
declare function createCellSelectionPlugin<T extends Record<string, unknown>>(options?: TableCellSelectionPluginOptions<T>): TablePlugin<T, CellSelectionState, TableCellSelectionApi<T>>;
|
|
2346
2352
|
/** TableRowSpan的插件配置。 */
|
|
2347
2353
|
interface TableRowSpanPluginOptions<T> {
|
|
@@ -2539,7 +2545,7 @@ interface TableIndexPluginOptions {
|
|
|
2539
2545
|
/** 序号列的起始编号。 */
|
|
2540
2546
|
startIndex?: number;
|
|
2541
2547
|
}
|
|
2542
|
-
/**
|
|
2548
|
+
/** 创建表格序号列插件。Table 默认内置;显式加入 plugins 可覆盖标题、宽度和起始编号,不重复加载。Table 的 showIndex=false 时禁用。 */
|
|
2543
2549
|
declare function createIndexPlugin<T extends Record<string, unknown>>(options?: TableIndexPluginOptions): TablePlugin<T, undefined>;
|
|
2544
2550
|
/** TableTree的插件配置。 */
|
|
2545
2551
|
interface TableTreePluginOptions<T> {
|
package/dist/index.js
CHANGED
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
smoothSvgPath,
|
|
57
57
|
svgArcPath,
|
|
58
58
|
transferCompositeValue
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-TZROBD65.js";
|
|
60
60
|
import {
|
|
61
61
|
Badge,
|
|
62
62
|
Breadcrumb,
|
|
@@ -80,22 +80,22 @@ import {
|
|
|
80
80
|
Watermark,
|
|
81
81
|
message,
|
|
82
82
|
notification
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-W52CNNWW.js";
|
|
84
84
|
import {
|
|
85
85
|
TextArea
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-YQDHCORW.js";
|
|
87
87
|
import {
|
|
88
88
|
MarkdownEditor
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-PXHBIRQW.js";
|
|
90
90
|
import {
|
|
91
91
|
RichTextContent,
|
|
92
92
|
RichTextEditor
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-RWODH2LW.js";
|
|
94
94
|
import {
|
|
95
95
|
DatePicker,
|
|
96
96
|
SelectDateRange,
|
|
97
97
|
TimePanel
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-IYO2JSGQ.js";
|
|
99
99
|
import {
|
|
100
100
|
Checkbox,
|
|
101
101
|
FloatingScrollbarProvider,
|
|
@@ -110,7 +110,7 @@ import {
|
|
|
110
110
|
Tree,
|
|
111
111
|
useOverlayLifecycle,
|
|
112
112
|
useScrollbarProximity
|
|
113
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-QCBKT5FV.js";
|
|
114
114
|
import {
|
|
115
115
|
Dropdown,
|
|
116
116
|
FILLED_ICON_NAMES,
|
|
@@ -120,10 +120,10 @@ import {
|
|
|
120
120
|
Menu,
|
|
121
121
|
Segmented,
|
|
122
122
|
Steps
|
|
123
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-27ZYAKII.js";
|
|
124
124
|
import {
|
|
125
125
|
Button
|
|
126
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-IYNS423D.js";
|
|
127
127
|
import {
|
|
128
128
|
ControlSizeContext,
|
|
129
129
|
PlaceholderModeContext,
|
|
@@ -133,7 +133,7 @@ import {
|
|
|
133
133
|
useFloatingPlaceholder,
|
|
134
134
|
usePlaceholderMode,
|
|
135
135
|
withTitleTooltip
|
|
136
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-RAO3JHDL.js";
|
|
137
137
|
|
|
138
138
|
// src/components/Alert.tsx
|
|
139
139
|
import { useState } from "react";
|
|
@@ -5241,6 +5241,16 @@ function createCellSelectionPlugin(options = {}) {
|
|
|
5241
5241
|
event.clipboardData?.setData("text/plain", text);
|
|
5242
5242
|
options.onCopy?.(text, selectedCells(context));
|
|
5243
5243
|
};
|
|
5244
|
+
const clearOnOutsidePointerDown = (event) => {
|
|
5245
|
+
const context = latestContext;
|
|
5246
|
+
if (event.button !== 0 || !context?.state.range || !activeRoot) return;
|
|
5247
|
+
const target = event.target instanceof Element ? event.target : null;
|
|
5248
|
+
const cell = target?.closest("td[data-column-key], th[data-column-key]");
|
|
5249
|
+
if (cell?.closest(".sia-table") === activeRoot) return;
|
|
5250
|
+
stopDragging();
|
|
5251
|
+
setSelection(context, null);
|
|
5252
|
+
};
|
|
5253
|
+
document.addEventListener("pointerdown", clearOnOutsidePointerDown, true);
|
|
5244
5254
|
window.addEventListener("pointerup", stopDragging);
|
|
5245
5255
|
window.addEventListener("pointercancel", stopDragging);
|
|
5246
5256
|
window.addEventListener("blur", stopDragging);
|
|
@@ -5249,6 +5259,7 @@ function createCellSelectionPlugin(options = {}) {
|
|
|
5249
5259
|
document.addEventListener("copy", handleCopy);
|
|
5250
5260
|
return () => {
|
|
5251
5261
|
stopDragging();
|
|
5262
|
+
document.removeEventListener("pointerdown", clearOnOutsidePointerDown, true);
|
|
5252
5263
|
window.removeEventListener("pointerup", stopDragging);
|
|
5253
5264
|
window.removeEventListener("pointercancel", stopDragging);
|
|
5254
5265
|
window.removeEventListener("blur", stopDragging);
|
|
@@ -7330,6 +7341,7 @@ function TableInner(props, ref) {
|
|
|
7330
7341
|
stickyHeader = true,
|
|
7331
7342
|
resizable = true,
|
|
7332
7343
|
cellSelection = true,
|
|
7344
|
+
showIndex = true,
|
|
7333
7345
|
onRowClick,
|
|
7334
7346
|
onRowDoubleClick,
|
|
7335
7347
|
onCellContextMenu,
|
|
@@ -7353,13 +7365,15 @@ function TableInner(props, ref) {
|
|
|
7353
7365
|
const builtInResizePlugin = useMemo9(() => createResizePlugin(), []);
|
|
7354
7366
|
const builtInHighlightPlugin = useMemo9(() => createHighlightPlugin(), []);
|
|
7355
7367
|
const builtInCellSelectionPlugin = useMemo9(() => createCellSelectionPlugin(), []);
|
|
7368
|
+
const builtInIndexPlugin = useMemo9(() => createIndexPlugin(), []);
|
|
7356
7369
|
const activePlugins = useMemo9(() => {
|
|
7357
|
-
const plugins = providedPlugins.filter((plugin) => (resizable || plugin.id !== "resize") && (cellSelection || plugin.id !== "cellSelection"));
|
|
7370
|
+
const plugins = providedPlugins.filter((plugin) => (resizable || plugin.id !== "resize") && (cellSelection || plugin.id !== "cellSelection") && (showIndex || plugin.id !== "index"));
|
|
7358
7371
|
if (!plugins.some((plugin) => plugin.id === "highlight")) plugins.push(builtInHighlightPlugin);
|
|
7359
7372
|
if (resizable && !plugins.some((plugin) => plugin.id === "resize")) plugins.push(builtInResizePlugin);
|
|
7360
7373
|
if (cellSelection && !plugins.some((plugin) => plugin.id === "cellSelection")) plugins.push(builtInCellSelectionPlugin);
|
|
7374
|
+
if (showIndex && !plugins.some((plugin) => plugin.id === "index")) plugins.push(builtInIndexPlugin);
|
|
7361
7375
|
return plugins;
|
|
7362
|
-
}, [builtInHighlightPlugin, builtInResizePlugin, builtInCellSelectionPlugin, providedPlugins, resizable, cellSelection]);
|
|
7376
|
+
}, [builtInHighlightPlugin, builtInResizePlugin, builtInCellSelectionPlugin, builtInIndexPlugin, providedPlugins, resizable, cellSelection, showIndex]);
|
|
7363
7377
|
const sortedPlugins = useMemo9(() => [...activePlugins].sort((a, b) => (a.order ?? 100) - (b.order ?? 100)), [activePlugins]);
|
|
7364
7378
|
const pluginsByIdRef = useRef15(/* @__PURE__ */ new Map());
|
|
7365
7379
|
pluginsByIdRef.current = new Map(sortedPlugins.map((plugin) => [plugin.id, plugin]));
|
package/dist/markdown-editor.cjs
CHANGED
|
@@ -236,7 +236,7 @@ function installTitleTooltips(doc) {
|
|
|
236
236
|
else if (active.getAttribute("data-sia-title") !== doc.getElementById(tooltipId)?.textContent) render();
|
|
237
237
|
});
|
|
238
238
|
observer.observe(doc.body, { childList: true, subtree: true, attributes: true, attributeFilter: ["data-sia-title"] });
|
|
239
|
-
},
|
|
239
|
+
}, 600);
|
|
240
240
|
};
|
|
241
241
|
doc.addEventListener("pointerover", (event) => {
|
|
242
242
|
if (event.pointerType === "touch") return;
|
package/dist/markdown-editor.js
CHANGED
|
@@ -237,7 +237,7 @@ function installTitleTooltips(doc) {
|
|
|
237
237
|
else if (active.getAttribute("data-sia-title") !== doc.getElementById(tooltipId)?.textContent) render();
|
|
238
238
|
});
|
|
239
239
|
observer.observe(doc.body, { childList: true, subtree: true, attributes: true, attributeFilter: ["data-sia-title"] });
|
|
240
|
-
},
|
|
240
|
+
}, 600);
|
|
241
241
|
};
|
|
242
242
|
doc.addEventListener("pointerover", (event) => {
|
|
243
243
|
if (event.pointerType === "touch") return;
|
package/dist/rich-text-editor.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RichTextContent,
|
|
3
3
|
RichTextEditor
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-RWODH2LW.js";
|
|
5
|
+
import "./chunk-27ZYAKII.js";
|
|
6
|
+
import "./chunk-IYNS423D.js";
|
|
7
|
+
import "./chunk-RAO3JHDL.js";
|
|
8
8
|
export {
|
|
9
9
|
RichTextContent,
|
|
10
10
|
RichTextEditor
|
|
@@ -226,7 +226,7 @@ function installTitleTooltips(doc) {
|
|
|
226
226
|
else if (active.getAttribute("data-sia-title") !== doc.getElementById(tooltipId)?.textContent) render();
|
|
227
227
|
});
|
|
228
228
|
observer.observe(doc.body, { childList: true, subtree: true, attributes: true, attributeFilter: ["data-sia-title"] });
|
|
229
|
-
},
|
|
229
|
+
}, 600);
|
|
230
230
|
};
|
|
231
231
|
doc.addEventListener("pointerover", (event) => {
|
|
232
232
|
if (event.pointerType === "touch") return;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SelectDateRange
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-IYO2JSGQ.js";
|
|
4
|
+
import "./chunk-QCBKT5FV.js";
|
|
5
|
+
import "./chunk-27ZYAKII.js";
|
|
6
|
+
import "./chunk-IYNS423D.js";
|
|
7
|
+
import "./chunk-RAO3JHDL.js";
|
|
8
8
|
export {
|
|
9
9
|
SelectDateRange
|
|
10
10
|
};
|