dtable-ui-component 6.0.4 → 6.0.6
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/lib/DTableFiltersPopover/index.js +1 -1
- package/lib/RowExpandDialog/body/index.js +3 -2
- package/lib/RowExpandDialog/index.js +2 -1
- package/lib/RowExpandEditor/RowExpandDepartmentEditor/index.js +2 -2
- package/lib/RowExpandEditor/RowExpandEmailEditor/index.js +7 -7
- package/lib/RowExpandEditor/RowExpandTextEditor/index.js +10 -1
- package/lib/RowExpandEditor/RowExpandUrlEditor/index.js +7 -7
- package/package.json +1 -1
|
@@ -176,7 +176,7 @@ class DTableFiltersPopover extends _react.Component {
|
|
|
176
176
|
boundariesElement: document.body
|
|
177
177
|
}, _ref => {
|
|
178
178
|
let {
|
|
179
|
-
scheduleUpdate
|
|
179
|
+
update: scheduleUpdate
|
|
180
180
|
} = _ref;
|
|
181
181
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
182
182
|
ref: ref => this.dtablePopoverRef = ref,
|
|
@@ -62,7 +62,8 @@ class Body extends _react.default.Component {
|
|
|
62
62
|
this.onHotKey = event => {
|
|
63
63
|
const {
|
|
64
64
|
columns,
|
|
65
|
-
onKeyDown
|
|
65
|
+
onKeyDown,
|
|
66
|
+
onToggle
|
|
66
67
|
} = this.props;
|
|
67
68
|
const readonly = Array.isArray(columns) && columns.length > 0 ? !columns.some(c => c.editable) : true;
|
|
68
69
|
const keyCode = event.keyCode;
|
|
@@ -71,7 +72,7 @@ class Body extends _react.default.Component {
|
|
|
71
72
|
return;
|
|
72
73
|
}
|
|
73
74
|
if (keyCode === _constants.KeyCodes.Esc) {
|
|
74
|
-
|
|
75
|
+
onToggle && onToggle();
|
|
75
76
|
return;
|
|
76
77
|
}
|
|
77
78
|
onKeyDown && onKeyDown(event);
|
|
@@ -224,7 +224,8 @@ const RowExpandDialog = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
224
224
|
columns: columns,
|
|
225
225
|
valueKey: valueKey,
|
|
226
226
|
onChange: onChange,
|
|
227
|
-
uploadFile: uploadFile
|
|
227
|
+
uploadFile: uploadFile,
|
|
228
|
+
onToggle: onToggle
|
|
228
229
|
}), children[1]), (!saveImmediately || isInsertingRow) && /*#__PURE__*/_react.default.createElement(_reactstrap.ModalFooter, null, /*#__PURE__*/_react.default.createElement(_reactstrap.Button, {
|
|
229
230
|
onClick: toggle,
|
|
230
231
|
color: "secondary"
|
|
@@ -36,7 +36,7 @@ function RowExpandDepartmentEditor(props) {
|
|
|
36
36
|
document.removeEventListener('keydown', onKeyDown);
|
|
37
37
|
};
|
|
38
38
|
// eslint-disable-next-line
|
|
39
|
-
}, [isEditorFocus]);
|
|
39
|
+
}, [isEditorFocus, showEditor]);
|
|
40
40
|
(0, _react.useEffect)(() => {
|
|
41
41
|
setValue(row[column[valueKey]] || '');
|
|
42
42
|
setShowEditor(false);
|
|
@@ -49,7 +49,7 @@ function RowExpandDepartmentEditor(props) {
|
|
|
49
49
|
function onKeyDown(e) {
|
|
50
50
|
if (e.keyCode === _constants.KeyCodes.Enter && props.isEditorFocus && !showEditor) {
|
|
51
51
|
setShowEditor(true);
|
|
52
|
-
} else if (e.keyCode === _constants.KeyCodes.Escape) {
|
|
52
|
+
} else if (e.keyCode === _constants.KeyCodes.Escape && showEditor) {
|
|
53
53
|
e.stopPropagation();
|
|
54
54
|
setShowEditor(false);
|
|
55
55
|
departmentSelectContent.current.focus();
|
|
@@ -45,19 +45,19 @@ class RowExpandEmailEditor extends _react.default.Component {
|
|
|
45
45
|
this.onPaste = e => {
|
|
46
46
|
e.stopPropagation();
|
|
47
47
|
};
|
|
48
|
-
this.onKeyDown =
|
|
49
|
-
if (
|
|
50
|
-
|
|
48
|
+
this.onKeyDown = event => {
|
|
49
|
+
if (event.keyCode === _constants.KeyCodes.Esc) {
|
|
50
|
+
event.stopPropagation();
|
|
51
51
|
this.blurInput();
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
|
|
54
|
+
const {
|
|
55
55
|
selectionStart,
|
|
56
56
|
selectionEnd,
|
|
57
57
|
value
|
|
58
|
-
} =
|
|
59
|
-
if (
|
|
60
|
-
|
|
58
|
+
} = event.currentTarget;
|
|
59
|
+
if (event.keyCode === _constants.KeyCodes.ChineseInputMethod || event.keyCode === _constants.KeyCodes.LeftArrow && selectionStart === 0 || event.keyCode === _constants.KeyCodes.RightArrow && selectionEnd === value.length) {
|
|
60
|
+
event.stopPropagation();
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
this.onOpenEmailLink = () => {
|
|
@@ -58,8 +58,17 @@ class RowExpandSimpleText extends _react.default.Component {
|
|
|
58
58
|
};
|
|
59
59
|
this.onKeyDown = event => {
|
|
60
60
|
if (event.keyCode === _constants.KeyCodes.Esc) {
|
|
61
|
-
event.
|
|
61
|
+
event.stopPropagation();
|
|
62
62
|
this.blurInput();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const {
|
|
66
|
+
selectionStart,
|
|
67
|
+
selectionEnd,
|
|
68
|
+
value
|
|
69
|
+
} = event.currentTarget;
|
|
70
|
+
if (event.keyCode === _constants.KeyCodes.ChineseInputMethod || event.keyCode === _constants.KeyCodes.LeftArrow && selectionStart === 0 || event.keyCode === _constants.KeyCodes.RightArrow && selectionEnd === value.length) {
|
|
71
|
+
event.stopPropagation();
|
|
63
72
|
}
|
|
64
73
|
};
|
|
65
74
|
this.isChecked = () => {
|
|
@@ -47,19 +47,19 @@ class RowExpandUrlEditor extends _react.default.Component {
|
|
|
47
47
|
this.onPaste = e => {
|
|
48
48
|
e.stopPropagation();
|
|
49
49
|
};
|
|
50
|
-
this.onKeyDown =
|
|
51
|
-
if (
|
|
52
|
-
|
|
50
|
+
this.onKeyDown = event => {
|
|
51
|
+
if (event.keyCode === _constants.KeyCodes.Esc) {
|
|
52
|
+
event.preventDefault();
|
|
53
53
|
this.blurInput();
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
const {
|
|
57
57
|
selectionStart,
|
|
58
58
|
selectionEnd,
|
|
59
59
|
value
|
|
60
|
-
} =
|
|
61
|
-
if (
|
|
62
|
-
|
|
60
|
+
} = event.currentTarget;
|
|
61
|
+
if (event.keyCode === _constants.KeyCodes.ChineseInputMethod || event.keyCode === _constants.KeyCodes.LeftArrow && selectionStart === 0 || event.keyCode === _constants.KeyCodes.RightArrow && selectionEnd === value.length) {
|
|
62
|
+
event.stopPropagation();
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
this.onOpenUrlLink = () => {
|