@syncfusion/ej2-inplace-editor 20.4.42 → 20.4.54
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/.eslintrc.json +25 -2
- package/CHANGELOG.md +16 -0
- package/dist/ej2-inplace-editor.min.js +2 -2
- package/dist/ej2-inplace-editor.umd.min.js +2 -2
- package/dist/ej2-inplace-editor.umd.min.js.map +1 -1
- package/dist/es6/ej2-inplace-editor.es2015.js +63 -52
- package/dist/es6/ej2-inplace-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-inplace-editor.es5.js +64 -53
- package/dist/es6/ej2-inplace-editor.es5.js.map +1 -1
- package/dist/global/ej2-inplace-editor.min.js +2 -2
- package/dist/global/ej2-inplace-editor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +16 -16
- package/src/inplace-editor/base/inplace-editor-model.d.ts +1 -1
- package/src/inplace-editor/base/inplace-editor.js +64 -53
- package/tslint.json +111 -0
|
@@ -881,7 +881,7 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
881
881
|
this.submitBtn = undefined;
|
|
882
882
|
}
|
|
883
883
|
if (!isNullOrUndefined(this.cancelBtn)) {
|
|
884
|
-
EventHandler.remove(this.cancelBtn.element, '
|
|
884
|
+
EventHandler.remove(this.cancelBtn.element, 'mouseup', this.cancelBtnClick);
|
|
885
885
|
EventHandler.remove(this.cancelBtn.element, 'keydown', this.btnKeyDownHandler);
|
|
886
886
|
this.cancelBtn.destroy();
|
|
887
887
|
this.cancelBtn = undefined;
|
|
@@ -1022,6 +1022,13 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
1022
1022
|
let count = 0;
|
|
1023
1023
|
this.formValidate = new FormValidator(this.formEle, {
|
|
1024
1024
|
rules: this.validationRules,
|
|
1025
|
+
validationBegin: (e) => {
|
|
1026
|
+
if (this.type === 'RTE') {
|
|
1027
|
+
let ele = document.createElement('div');
|
|
1028
|
+
ele.innerHTML = e.value;
|
|
1029
|
+
e.value = ele.innerText;
|
|
1030
|
+
}
|
|
1031
|
+
},
|
|
1025
1032
|
validationComplete: (e) => {
|
|
1026
1033
|
count = count + 1;
|
|
1027
1034
|
args = {
|
|
@@ -1165,7 +1172,7 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
1165
1172
|
EventHandler.add(this.submitBtn.element, 'keydown', this.btnKeyDownHandler, this);
|
|
1166
1173
|
}
|
|
1167
1174
|
if (!isNullOrUndefined(this.cancelBtn)) {
|
|
1168
|
-
EventHandler.add(this.cancelBtn.element, '
|
|
1175
|
+
EventHandler.add(this.cancelBtn.element, 'mouseup', this.cancelBtnClick, this);
|
|
1169
1176
|
EventHandler.add(this.cancelBtn.element, 'keydown', this.btnKeyDownHandler, this);
|
|
1170
1177
|
}
|
|
1171
1178
|
}
|
|
@@ -1471,57 +1478,61 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
1471
1478
|
* @private
|
|
1472
1479
|
*/
|
|
1473
1480
|
onPropertyChanged(newProp, oldProp) {
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
+
let checkValidation = this.validationRules ? !isNullOrUndefined(this.element.querySelectorAll('.' + ERROR)) &&
|
|
1482
|
+
this.element.querySelectorAll('.' + ERROR).length > 0 ? false : true : true;
|
|
1483
|
+
if (checkValidation) {
|
|
1484
|
+
if (this.isEditorOpen()) {
|
|
1485
|
+
const editModeChanged = 'enableEditMode' in newProp;
|
|
1486
|
+
if ((editModeChanged && oldProp.enableEditMode && !newProp.enableEditMode) || (!editModeChanged && this.enableEditMode)) {
|
|
1487
|
+
this.triggerEndEdit('cancel');
|
|
1488
|
+
}
|
|
1489
|
+
else {
|
|
1490
|
+
this.removeEditor();
|
|
1491
|
+
}
|
|
1481
1492
|
}
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1493
|
+
for (const prop of Object.keys(newProp)) {
|
|
1494
|
+
switch (prop) {
|
|
1495
|
+
case 'showButtons':
|
|
1496
|
+
// eslint-disable-next-line
|
|
1497
|
+
(newProp.showButtons) ? this.appendButtons(this.formEle) : this.destroyButtons();
|
|
1498
|
+
break;
|
|
1499
|
+
case 'value':
|
|
1500
|
+
this.updateValue();
|
|
1501
|
+
// eslint-disable-next-line
|
|
1502
|
+
this.textOption === 'Never' ? this.renderValue(this.checkValue(parseValue(this.type, this.value, this.model)))
|
|
1503
|
+
: this.renderInitialValue();
|
|
1504
|
+
break;
|
|
1505
|
+
case 'emptyText':
|
|
1506
|
+
// eslint-disable-next-line
|
|
1507
|
+
this.textOption === 'Never' ? this.renderValue(this.checkValue(parseValue(this.type, this.value, this.model)))
|
|
1508
|
+
: this.renderInitialValue();
|
|
1509
|
+
break;
|
|
1510
|
+
case 'template':
|
|
1511
|
+
this.checkIsTemplate();
|
|
1512
|
+
break;
|
|
1513
|
+
case 'disabled':
|
|
1514
|
+
this.disable(newProp.disabled);
|
|
1515
|
+
break;
|
|
1516
|
+
case 'enableRtl':
|
|
1517
|
+
this.setRtl(newProp.enableRtl);
|
|
1518
|
+
break;
|
|
1519
|
+
case 'cssClass':
|
|
1520
|
+
this.setClass('remove', oldProp.cssClass);
|
|
1521
|
+
this.setClass('add', newProp.cssClass);
|
|
1522
|
+
break;
|
|
1523
|
+
case 'mode':
|
|
1524
|
+
this.enableEditor(this.enableEditMode);
|
|
1525
|
+
break;
|
|
1526
|
+
case 'enableEditMode':
|
|
1527
|
+
this.enableEditor(newProp.enableEditMode);
|
|
1528
|
+
break;
|
|
1529
|
+
case 'editableOn':
|
|
1530
|
+
this.unWireEditEvent(oldProp.editableOn);
|
|
1531
|
+
if (newProp.editableOn !== 'EditIconClick') {
|
|
1532
|
+
this.wireEditEvent(newProp.editableOn);
|
|
1533
|
+
}
|
|
1534
|
+
break;
|
|
1535
|
+
}
|
|
1525
1536
|
}
|
|
1526
1537
|
}
|
|
1527
1538
|
}
|