@textbus/xnote 0.2.2 → 0.2.3
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/bundles/index.esm.js +7 -3
- package/bundles/index.js +7 -3
- package/package.json +1 -1
package/bundles/index.esm.js
CHANGED
|
@@ -2613,7 +2613,7 @@ class TableComponent extends Component {
|
|
|
2613
2613
|
};
|
|
2614
2614
|
const start = getSelfSlot(this.selection.startSlot);
|
|
2615
2615
|
const end = getSelfSlot(this.selection.endSlot);
|
|
2616
|
-
if (start && end
|
|
2616
|
+
if (start && end) {
|
|
2617
2617
|
return this.getMaxRectangle(start, end);
|
|
2618
2618
|
}
|
|
2619
2619
|
return null;
|
|
@@ -6783,8 +6783,10 @@ function SelectionMask(props) {
|
|
|
6783
6783
|
watch(props.component.tableSelection, update);
|
|
6784
6784
|
function update() {
|
|
6785
6785
|
const selection = props.component.tableSelection();
|
|
6786
|
+
const selectedSlots = props.component.getSelectedNormalizedSlots();
|
|
6787
|
+
const slotCount = selectedSlots ? selectedSlots.map(i => i.cells.filter(i => i.visible)).flat().length : 0;
|
|
6786
6788
|
const state = props.component.state;
|
|
6787
|
-
if (selection) {
|
|
6789
|
+
if (selection && slotCount > 1) {
|
|
6788
6790
|
let topCompensation = 0.5;
|
|
6789
6791
|
let heightCompensation = -1;
|
|
6790
6792
|
if (selection.startRow === 0) {
|
|
@@ -6984,10 +6986,12 @@ const TableComponentView = withAnnotation({
|
|
|
6984
6986
|
}) }, rowMapping.get(row.row)));
|
|
6985
6987
|
}) })] }) }) }) }));
|
|
6986
6988
|
}
|
|
6989
|
+
const selectedSlots = props.component.getSelectedNormalizedSlots();
|
|
6990
|
+
const slotCount = selectedSlots ? selectedSlots.map(i => i.cells.filter(i => i.visible)).flat().length : 0;
|
|
6987
6991
|
return (jsx("div", { class: "xnote-table", "data-component": props.component.name, "data-layout-width": `[${state.columnsConfig.join(',')}]`, children: jsxs("div", { class: "xnote-table-inner", ref: props.rootRef, children: [jsx(TopBar, { isFocus: isFocus, layoutWidth: layoutWidth, component: props.component }), jsx(LeftBar, { tableRef: tableRef, isFocus: isFocus, component: props.component }), jsx(Scroll, { isFocus: isFocus, children: jsxs("div", { class: "xnote-table-container", children: [jsxs("table", { ref: tableRef, class: [
|
|
6988
6992
|
'xnote-table-content',
|
|
6989
6993
|
{
|
|
6990
|
-
'hide-selection': props.component.tableSelection()
|
|
6994
|
+
'hide-selection': props.component.tableSelection() && slotCount > 1
|
|
6991
6995
|
}
|
|
6992
6996
|
], children: [jsx("colgroup", { children: layoutWidth().map(w => {
|
|
6993
6997
|
return jsx("col", { style: { width: w + 'px', minWidth: w + 'px' } });
|
package/bundles/index.js
CHANGED
|
@@ -2615,7 +2615,7 @@ class TableComponent extends core$1.Component {
|
|
|
2615
2615
|
};
|
|
2616
2616
|
const start = getSelfSlot(this.selection.startSlot);
|
|
2617
2617
|
const end = getSelfSlot(this.selection.endSlot);
|
|
2618
|
-
if (start && end
|
|
2618
|
+
if (start && end) {
|
|
2619
2619
|
return this.getMaxRectangle(start, end);
|
|
2620
2620
|
}
|
|
2621
2621
|
return null;
|
|
@@ -6785,8 +6785,10 @@ function SelectionMask(props) {
|
|
|
6785
6785
|
core.watch(props.component.tableSelection, update);
|
|
6786
6786
|
function update() {
|
|
6787
6787
|
const selection = props.component.tableSelection();
|
|
6788
|
+
const selectedSlots = props.component.getSelectedNormalizedSlots();
|
|
6789
|
+
const slotCount = selectedSlots ? selectedSlots.map(i => i.cells.filter(i => i.visible)).flat().length : 0;
|
|
6788
6790
|
const state = props.component.state;
|
|
6789
|
-
if (selection) {
|
|
6791
|
+
if (selection && slotCount > 1) {
|
|
6790
6792
|
let topCompensation = 0.5;
|
|
6791
6793
|
let heightCompensation = -1;
|
|
6792
6794
|
if (selection.startRow === 0) {
|
|
@@ -6986,10 +6988,12 @@ const TableComponentView = core.withAnnotation({
|
|
|
6986
6988
|
}) }, rowMapping.get(row.row)));
|
|
6987
6989
|
}) })] }) }) }) }));
|
|
6988
6990
|
}
|
|
6991
|
+
const selectedSlots = props.component.getSelectedNormalizedSlots();
|
|
6992
|
+
const slotCount = selectedSlots ? selectedSlots.map(i => i.cells.filter(i => i.visible)).flat().length : 0;
|
|
6989
6993
|
return (jsxRuntime.jsx("div", { class: "xnote-table", "data-component": props.component.name, "data-layout-width": `[${state.columnsConfig.join(',')}]`, children: jsxRuntime.jsxs("div", { class: "xnote-table-inner", ref: props.rootRef, children: [jsxRuntime.jsx(TopBar, { isFocus: isFocus, layoutWidth: layoutWidth, component: props.component }), jsxRuntime.jsx(LeftBar, { tableRef: tableRef, isFocus: isFocus, component: props.component }), jsxRuntime.jsx(Scroll, { isFocus: isFocus, children: jsxRuntime.jsxs("div", { class: "xnote-table-container", children: [jsxRuntime.jsxs("table", { ref: tableRef, class: [
|
|
6990
6994
|
'xnote-table-content',
|
|
6991
6995
|
{
|
|
6992
|
-
'hide-selection': props.component.tableSelection()
|
|
6996
|
+
'hide-selection': props.component.tableSelection() && slotCount > 1
|
|
6993
6997
|
}
|
|
6994
6998
|
], children: [jsxRuntime.jsx("colgroup", { children: layoutWidth().map(w => {
|
|
6995
6999
|
return jsxRuntime.jsx("col", { style: { width: w + 'px', minWidth: w + 'px' } });
|
package/package.json
CHANGED