Skip to content

Commit 6fdf8ee

Browse files
committed
change name
isEditingCell -> isCellEditing
1 parent c3dd374 commit 6fdf8ee

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

packages/ve-table/src/editor/edit-input.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default {
4949
required: true,
5050
},
5151
// is editing cell
52-
isEditingCell: {
52+
isCellEditing: {
5353
type: Boolean,
5454
required: true,
5555
},
@@ -218,7 +218,7 @@ export default {
218218
immediate: true,
219219
},
220220
// is editing cell
221-
isEditingCell: {
221+
isCellEditing: {
222222
handler: function (val) {
223223
if (val) {
224224
this.showTextarea();
@@ -385,9 +385,9 @@ export default {
385385

386386
// textarea add new line
387387
textareaAddNewLine() {
388-
const { isEditingCell, editingCell } = this;
388+
const { isCellEditing, editingCell } = this;
389389

390-
if (isEditingCell) {
390+
if (isCellEditing) {
391391
const textareaInputEl = this.$refs[this.textareaInputRef];
392392

393393
const caretPosition = getCaretPosition(textareaInputEl);
@@ -426,7 +426,7 @@ export default {
426426
containerStyle,
427427
textareaClass,
428428
rawCellValue,
429-
isEditingCell,
429+
isCellEditing,
430430
} = this;
431431

432432
const containerProps = {
@@ -451,7 +451,7 @@ export default {
451451
},
452452
on: {
453453
input: (e) => {
454-
if (isEditingCell) {
454+
if (isCellEditing) {
455455
this.textareaValueChange(e.target.value);
456456
this.rawCellValue = e.target.value;
457457
}

packages/ve-table/src/index.jsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ export default {
430430
[clsName("virtual-scroll")]: isVirtualScroll,
431431
[clsName("container-left-scrolling")]: isLeftScrolling,
432432
[clsName("container-right-scrolling")]: isRightScrolling,
433-
[clsName("is-cell-editing")]: this.isEditingCell,
433+
[clsName("is-cell-editing")]: this.isCellEditing,
434434
};
435435
},
436436
// table body class
@@ -477,7 +477,7 @@ export default {
477477
return this.colgroups.some((x) => x.fixed === "right");
478478
},
479479
// is editing cell
480-
isEditingCell() {
480+
isCellEditing() {
481481
const { editingCell } = this;
482482

483483
return (
@@ -697,7 +697,7 @@ export default {
697697
colgroups,
698698
cellSelectionKeyData,
699699
enableStopEditing,
700-
isEditingCell,
700+
isCellEditing,
701701
} = this;
702702

703703
const { keyCode, ctrlKey, shiftKey, altKey } = event;
@@ -809,7 +809,7 @@ export default {
809809
break;
810810
}
811811
case KEY_CODES.SPACE: {
812-
if (!isEditingCell) {
812+
if (!isCellEditing) {
813813
// start editing and enter a space
814814
this[INSTANCE_METHODS.START_EDITING_CELL]({
815815
rowKey,
@@ -822,7 +822,7 @@ export default {
822822
break;
823823
}
824824
case KEY_CODES.BACK_SPACE: {
825-
if (!isEditingCell) {
825+
if (!isCellEditing) {
826826
// start editing and clear value
827827
this[INSTANCE_METHODS.START_EDITING_CELL]({
828828
rowKey,
@@ -835,7 +835,7 @@ export default {
835835
break;
836836
}
837837
case KEY_CODES.DELETE: {
838-
if (!isEditingCell) {
838+
if (!isCellEditing) {
839839
// delete selection cell value
840840
this.deleteCellValue();
841841
event.preventDefault();
@@ -844,7 +844,7 @@ export default {
844844
break;
845845
}
846846
case KEY_CODES.F2: {
847-
if (!isEditingCell) {
847+
if (!isCellEditing) {
848848
if (currentColumn.edit) {
849849
// start editing cell and don't allow stop eidting by direction key
850850
this.enableStopEditing = false;
@@ -1470,12 +1470,12 @@ export default {
14701470
rowKeyFieldName,
14711471
editOption,
14721472
editingCell,
1473-
isEditingCell,
1473+
isCellEditing,
14741474
} = this;
14751475

14761476
const { cellValueChange } = editOption;
14771477

1478-
if (isEditingCell) {
1478+
if (isCellEditing) {
14791479
const { rowKey, colKey } = editingCell;
14801480

14811481
let currentRow = this.tableData.find(
@@ -1560,7 +1560,7 @@ export default {
15601560
editCellByClick({ isDblclick }) {
15611561
const {
15621562
editOption,
1563-
isEditingCell,
1563+
isCellEditing,
15641564
hasEditColumn,
15651565
editingCell,
15661566
cellSelectionKeyData,
@@ -1589,7 +1589,7 @@ export default {
15891589
return false;
15901590
}
15911591

1592-
if (isEditingCell) {
1592+
if (isCellEditing) {
15931593
this[INSTANCE_METHODS.STOP_EDITING_CELL]();
15941594
}
15951595

@@ -1788,13 +1788,13 @@ export default {
17881788
},
17891789
// stop editing cell
17901790
[INSTANCE_METHODS.STOP_EDITING_CELL]() {
1791-
const { editOption, isEditingCell } = this;
1791+
const { editOption, isCellEditing } = this;
17921792

17931793
if (!editOption) {
17941794
return false;
17951795
}
17961796

1797-
if (isEditingCell) {
1797+
if (isCellEditing) {
17981798
this.saveCellWhenStopEditing();
17991799
}
18001800
},
@@ -2058,7 +2058,7 @@ export default {
20582058
cellSelectionKeyData,
20592059
colgroups,
20602060
editingCell: this.editingCell,
2061-
isEditingCell: this.isEditingCell,
2061+
isCellEditing: this.isCellEditing,
20622062
allRowKeys: this.allRowKeys,
20632063
hasXScrollBar: this.hasXScrollBar,
20642064
hasYScrollBar: this.hasYScrollBar,

tests/unit/specs/ve-table-cell-edit.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ describe("veTable cell edit", () => {
159159

160160
await later();
161161

162-
expect(wrapper.vm.isEditingCell).toEqual(true);
162+
expect(wrapper.vm.isCellEditing).toEqual(true);
163163

164164
expect(wrapper.vm.editingCell.rowKey).toEqual(1);
165165
expect(wrapper.vm.editingCell.colKey).toEqual("date");

0 commit comments

Comments
 (0)