@sia.soul/sia-react-ui 0.1.127 → 0.1.128
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/core.css +2 -2
- package/dist/game.css +2 -2
- package/dist/index.cjs +8 -3
- package/dist/index.css +13 -6
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8 -3
- package/package.json +1 -1
package/dist/core.css
CHANGED
|
@@ -4255,12 +4255,12 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
4255
4255
|
overflow: hidden;
|
|
4256
4256
|
text-overflow: ellipsis;
|
|
4257
4257
|
}
|
|
4258
|
-
.sia-table__editable-display .sia-icon {
|
|
4258
|
+
.sia-table__editable-display > .sia-icon {
|
|
4259
4259
|
flex: 0 0 auto;
|
|
4260
4260
|
color: var(--sia-color-primary-text);
|
|
4261
4261
|
opacity: 0;
|
|
4262
4262
|
}
|
|
4263
|
-
.sia-table__editable-display:hover .sia-icon {
|
|
4263
|
+
.sia-table__editable-display:hover > .sia-icon {
|
|
4264
4264
|
opacity: 1;
|
|
4265
4265
|
}
|
|
4266
4266
|
.sia-table__cell-content:has(> .sia-table__editor) {
|
package/dist/game.css
CHANGED
|
@@ -4264,12 +4264,12 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
4264
4264
|
overflow: hidden;
|
|
4265
4265
|
text-overflow: ellipsis;
|
|
4266
4266
|
}
|
|
4267
|
-
.sia-table__editable-display .sia-icon {
|
|
4267
|
+
.sia-table__editable-display > .sia-icon {
|
|
4268
4268
|
flex: 0 0 auto;
|
|
4269
4269
|
color: var(--sia-color-primary-text);
|
|
4270
4270
|
opacity: 0;
|
|
4271
4271
|
}
|
|
4272
|
-
.sia-table__editable-display:hover .sia-icon {
|
|
4272
|
+
.sia-table__editable-display:hover > .sia-icon {
|
|
4273
4273
|
opacity: 1;
|
|
4274
4274
|
}
|
|
4275
4275
|
.sia-table__cell-content:has(> .sia-table__editor) {
|
package/dist/index.cjs
CHANGED
|
@@ -15327,7 +15327,8 @@ function EditableTableCell({
|
|
|
15327
15327
|
onStart,
|
|
15328
15328
|
onSave,
|
|
15329
15329
|
onCancel,
|
|
15330
|
-
trigger
|
|
15330
|
+
trigger,
|
|
15331
|
+
showEditIcon
|
|
15331
15332
|
}) {
|
|
15332
15333
|
const config = typeof editable === "object" ? editable : { type: "input" };
|
|
15333
15334
|
const [editValue, setEditValue] = (0, import_react56.useState)(value);
|
|
@@ -15395,7 +15396,7 @@ function EditableTableCell({
|
|
|
15395
15396
|
onDoubleClick: trigger === "doubleClick" ? onStart : void 0,
|
|
15396
15397
|
children: [
|
|
15397
15398
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { children: content }),
|
|
15398
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Icon, { name: "edit", size: 13 })
|
|
15399
|
+
showEditIcon && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Icon, { name: "edit", size: 13 })
|
|
15399
15400
|
]
|
|
15400
15401
|
}
|
|
15401
15402
|
);
|
|
@@ -15484,6 +15485,7 @@ function createEditablePlugin(options = {}) {
|
|
|
15484
15485
|
record,
|
|
15485
15486
|
content,
|
|
15486
15487
|
trigger,
|
|
15488
|
+
showEditIcon: options.showEditIcon ?? true,
|
|
15487
15489
|
onStart: () => context.setState({
|
|
15488
15490
|
editing: { rowKey: info.row.key, columnKey: column.key }
|
|
15489
15491
|
}),
|
|
@@ -17586,6 +17588,8 @@ function createWorksheetPlugin(options) {
|
|
|
17586
17588
|
const epoch = editEpoch;
|
|
17587
17589
|
const editPlugin = createEditablePlugin({
|
|
17588
17590
|
trigger: "doubleClick",
|
|
17591
|
+
// 工作表由选区和填充柄提示操作,不额外展示容易被误认作清理按钮的铅笔。
|
|
17592
|
+
showEditIcon: false,
|
|
17589
17593
|
onCellChange: (columnKey, record, value) => {
|
|
17590
17594
|
if (epoch !== editEpoch) return false;
|
|
17591
17595
|
const row = context.rows.find((item) => item.record === record);
|
|
@@ -17657,8 +17661,9 @@ function createWorksheetPlugin(options) {
|
|
|
17657
17661
|
remember(current);
|
|
17658
17662
|
const r = current.rows.indexOf(row), c = columns().findIndex((item) => item.key === column.key);
|
|
17659
17663
|
const preview = drag && c >= drag.bounds.left && c <= drag.bounds.right && r >= Math.min(drag.target, drag.bounds.top) && r <= Math.max(drag.target, drag.bounds.bottom);
|
|
17664
|
+
const readonly = !column.meta?.plugin && !editable(row.record, column);
|
|
17660
17665
|
return {
|
|
17661
|
-
className: `sia-table__worksheet-cell${preview ? " sia-table__worksheet-fill-preview" : ""}`
|
|
17666
|
+
className: `sia-table__worksheet-cell${preview ? " sia-table__worksheet-fill-preview" : ""}${readonly ? " sia-table__worksheet-cell--readonly" : ""}`
|
|
17662
17667
|
};
|
|
17663
17668
|
},
|
|
17664
17669
|
renderToolbarStart(current) {
|
package/dist/index.css
CHANGED
|
@@ -4255,12 +4255,12 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
4255
4255
|
overflow: hidden;
|
|
4256
4256
|
text-overflow: ellipsis;
|
|
4257
4257
|
}
|
|
4258
|
-
.sia-table__editable-display .sia-icon {
|
|
4258
|
+
.sia-table__editable-display > .sia-icon {
|
|
4259
4259
|
flex: 0 0 auto;
|
|
4260
4260
|
color: var(--sia-color-primary-text);
|
|
4261
4261
|
opacity: 0;
|
|
4262
4262
|
}
|
|
4263
|
-
.sia-table__editable-display:hover .sia-icon {
|
|
4263
|
+
.sia-table__editable-display:hover > .sia-icon {
|
|
4264
4264
|
opacity: 1;
|
|
4265
4265
|
}
|
|
4266
4266
|
.sia-table__cell-content:has(> .sia-table__editor) {
|
|
@@ -11164,12 +11164,19 @@ body > .sia-title-tooltip[data-sia-popup-layer] {
|
|
|
11164
11164
|
.sia-table__worksheet-cell:not(.sia-table__cell--fixed) {
|
|
11165
11165
|
position: relative;
|
|
11166
11166
|
}
|
|
11167
|
+
.sia-table__cell.sia-table__worksheet-cell > .sia-table__cell-content:not(:has(> .sia-table__editor)) {
|
|
11168
|
+
position: static;
|
|
11169
|
+
}
|
|
11170
|
+
.sia-table .sia-table__row .sia-table__cell.sia-table__worksheet-cell--readonly {
|
|
11171
|
+
background: var(--sia-color-background);
|
|
11172
|
+
}
|
|
11167
11173
|
.sia-table__worksheet-handle {
|
|
11168
11174
|
position: absolute;
|
|
11169
|
-
right:
|
|
11170
|
-
bottom:
|
|
11171
|
-
width:
|
|
11172
|
-
height:
|
|
11175
|
+
right: 0;
|
|
11176
|
+
bottom: 0;
|
|
11177
|
+
width: 12px;
|
|
11178
|
+
height: 12px;
|
|
11179
|
+
box-sizing: border-box;
|
|
11173
11180
|
padding: 0;
|
|
11174
11181
|
border: 1px solid var(--sia-color-surface);
|
|
11175
11182
|
background: var(--sia-color-primary);
|
package/dist/index.d.cts
CHANGED
|
@@ -2828,6 +2828,8 @@ interface TableEditablePluginOptions<T> {
|
|
|
2828
2828
|
onCellChange?: (columnKey: string, record: T, newValue: unknown) => boolean | Promise<boolean>;
|
|
2829
2829
|
/** 触发显示的交互方式。 */
|
|
2830
2830
|
trigger?: "click" | "doubleClick";
|
|
2831
|
+
/** 非编辑状态是否显示铅笔提示,默认 true;关闭后仍保留原点击或双击编辑交互。 */
|
|
2832
|
+
showEditIcon?: boolean;
|
|
2831
2833
|
}
|
|
2832
2834
|
/** TableEditable的操作接口。 */
|
|
2833
2835
|
interface TableEditableApi {
|
package/dist/index.d.ts
CHANGED
|
@@ -2828,6 +2828,8 @@ interface TableEditablePluginOptions<T> {
|
|
|
2828
2828
|
onCellChange?: (columnKey: string, record: T, newValue: unknown) => boolean | Promise<boolean>;
|
|
2829
2829
|
/** 触发显示的交互方式。 */
|
|
2830
2830
|
trigger?: "click" | "doubleClick";
|
|
2831
|
+
/** 非编辑状态是否显示铅笔提示,默认 true;关闭后仍保留原点击或双击编辑交互。 */
|
|
2832
|
+
showEditIcon?: boolean;
|
|
2831
2833
|
}
|
|
2832
2834
|
/** TableEditable的操作接口。 */
|
|
2833
2835
|
interface TableEditableApi {
|
package/dist/index.js
CHANGED
|
@@ -7259,7 +7259,8 @@ function EditableTableCell({
|
|
|
7259
7259
|
onStart,
|
|
7260
7260
|
onSave,
|
|
7261
7261
|
onCancel,
|
|
7262
|
-
trigger
|
|
7262
|
+
trigger,
|
|
7263
|
+
showEditIcon
|
|
7263
7264
|
}) {
|
|
7264
7265
|
const config = typeof editable === "object" ? editable : { type: "input" };
|
|
7265
7266
|
const [editValue, setEditValue] = useState21(value);
|
|
@@ -7327,7 +7328,7 @@ function EditableTableCell({
|
|
|
7327
7328
|
onDoubleClick: trigger === "doubleClick" ? onStart : void 0,
|
|
7328
7329
|
children: [
|
|
7329
7330
|
/* @__PURE__ */ jsx24("span", { children: content }),
|
|
7330
|
-
/* @__PURE__ */ jsx24(Icon, { name: "edit", size: 13 })
|
|
7331
|
+
showEditIcon && /* @__PURE__ */ jsx24(Icon, { name: "edit", size: 13 })
|
|
7331
7332
|
]
|
|
7332
7333
|
}
|
|
7333
7334
|
);
|
|
@@ -7416,6 +7417,7 @@ function createEditablePlugin(options = {}) {
|
|
|
7416
7417
|
record,
|
|
7417
7418
|
content,
|
|
7418
7419
|
trigger,
|
|
7420
|
+
showEditIcon: options.showEditIcon ?? true,
|
|
7419
7421
|
onStart: () => context.setState({
|
|
7420
7422
|
editing: { rowKey: info.row.key, columnKey: column.key }
|
|
7421
7423
|
}),
|
|
@@ -9518,6 +9520,8 @@ function createWorksheetPlugin(options) {
|
|
|
9518
9520
|
const epoch = editEpoch;
|
|
9519
9521
|
const editPlugin = createEditablePlugin({
|
|
9520
9522
|
trigger: "doubleClick",
|
|
9523
|
+
// 工作表由选区和填充柄提示操作,不额外展示容易被误认作清理按钮的铅笔。
|
|
9524
|
+
showEditIcon: false,
|
|
9521
9525
|
onCellChange: (columnKey, record, value) => {
|
|
9522
9526
|
if (epoch !== editEpoch) return false;
|
|
9523
9527
|
const row = context.rows.find((item) => item.record === record);
|
|
@@ -9589,8 +9593,9 @@ function createWorksheetPlugin(options) {
|
|
|
9589
9593
|
remember(current);
|
|
9590
9594
|
const r = current.rows.indexOf(row), c = columns().findIndex((item) => item.key === column.key);
|
|
9591
9595
|
const preview = drag && c >= drag.bounds.left && c <= drag.bounds.right && r >= Math.min(drag.target, drag.bounds.top) && r <= Math.max(drag.target, drag.bounds.bottom);
|
|
9596
|
+
const readonly = !column.meta?.plugin && !editable(row.record, column);
|
|
9592
9597
|
return {
|
|
9593
|
-
className: `sia-table__worksheet-cell${preview ? " sia-table__worksheet-fill-preview" : ""}`
|
|
9598
|
+
className: `sia-table__worksheet-cell${preview ? " sia-table__worksheet-fill-preview" : ""}${readonly ? " sia-table__worksheet-cell--readonly" : ""}`
|
|
9594
9599
|
};
|
|
9595
9600
|
},
|
|
9596
9601
|
renderToolbarStart(current) {
|