@syncfusion/ej2-inplace-editor 20.4.48 → 21.1.35

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/ej2-inplace-editor.min.js +2 -2
  3. package/dist/ej2-inplace-editor.umd.min.js +2 -2
  4. package/dist/ej2-inplace-editor.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-inplace-editor.es2015.js +57 -84
  6. package/dist/es6/ej2-inplace-editor.es2015.js.map +1 -1
  7. package/dist/es6/ej2-inplace-editor.es5.js +58 -85
  8. package/dist/es6/ej2-inplace-editor.es5.js.map +1 -1
  9. package/dist/global/ej2-inplace-editor.min.js +2 -2
  10. package/dist/global/ej2-inplace-editor.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +17 -17
  13. package/src/inplace-editor/base/inplace-editor-model.d.ts +1 -2
  14. package/src/inplace-editor/base/inplace-editor.js +55 -83
  15. package/src/inplace-editor/base/interface.d.ts +1 -0
  16. package/src/inplace-editor/base/models-model.d.ts +2 -0
  17. package/src/inplace-editor/base/models.d.ts +2 -0
  18. package/src/inplace-editor/base/models.js +0 -2
  19. package/src/inplace-editor/modules/combo-box.d.ts +2 -0
  20. package/src/inplace-editor/modules/combo-box.js +2 -0
  21. package/src/inplace-editor/modules/date-range-picker.d.ts +1 -0
  22. package/src/inplace-editor/modules/date-range-picker.js +1 -0
  23. package/styles/inplace-editor/_bootstrap-dark-definition.scss +0 -1
  24. package/styles/inplace-editor/_bootstrap-definition.scss +0 -1
  25. package/styles/inplace-editor/_bootstrap4-definition.scss +0 -1
  26. package/styles/inplace-editor/_bootstrap5-definition.scss +0 -2
  27. package/styles/inplace-editor/_fabric-dark-definition.scss +0 -1
  28. package/styles/inplace-editor/_fabric-definition.scss +0 -1
  29. package/styles/inplace-editor/_fluent-definition.scss +0 -2
  30. package/styles/inplace-editor/_fusionnew-definition.scss +0 -2
  31. package/styles/inplace-editor/_highcontrast-definition.scss +0 -1
  32. package/styles/inplace-editor/_highcontrast-light-definition.scss +0 -1
  33. package/styles/inplace-editor/_layout.scss +9 -9
  34. package/styles/inplace-editor/_material-dark-definition.scss +0 -1
  35. package/styles/inplace-editor/_material-definition.scss +0 -1
  36. package/styles/inplace-editor/_tailwind-definition.scss +0 -2
  37. package/styles/inplace-editor/_theme.scss +12 -12
  38. package/styles/inplace-editor/_material3-definition.scss +0 -71
@@ -160,7 +160,6 @@ var PopupSettings = /** @__PURE__ @class */ (function (_super) {
160
160
  * @hidden
161
161
  */
162
162
  var modulesList = {
163
- /* eslint-disable */
164
163
  'AutoComplete': 'auto-complete',
165
164
  'Color': 'color-picker',
166
165
  'ComboBox': 'combo-box',
@@ -176,7 +175,6 @@ var modulesList = {
176
175
  */
177
176
  // eslint-disable-next-line
178
177
  var localeConstant = {
179
- /* eslint-disable */
180
178
  'Click': { 'editAreaClick': 'Click to edit' },
181
179
  'DblClick': { 'editAreaDoubleClick': 'Double click to edit' },
182
180
  'EditIconClick': { 'editAreaClick': 'Click to edit' }
@@ -342,7 +340,6 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
342
340
  this.updateAdaptor();
343
341
  this.appendValueElement();
344
342
  this.updateValue();
345
- // eslint-disable-next-line
346
343
  this.textOption === 'Never' ?
347
344
  this.renderValue(this.checkValue(parseValue(this.type, this.value, this.model)))
348
345
  : this.renderInitialValue();
@@ -357,7 +354,6 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
357
354
  var allClassName = val.split(' ');
358
355
  for (var i = 0; i < allClassName.length; i++) {
359
356
  if (allClassName[i].trim() !== '') {
360
- // eslint-disable-next-line
361
357
  action === 'add' ? addClass([this.element], [allClassName[i]]) : removeClass([this.element], [allClassName[i]]);
362
358
  }
363
359
  }
@@ -399,14 +395,11 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
399
395
  var query = isNullOrUndefined(model.query) ? new Query() : model.query;
400
396
  if (model.dataSource instanceof DataManager) {
401
397
  model.dataSource.executeQuery(this.getInitQuery(model, query)).then(function (e) {
402
- // eslint-disable-next-line
403
398
  _this.updateInitValue(mText, mVal, e.result);
404
399
  });
405
400
  }
406
401
  else {
407
- this.updateInitValue(mText, mVal, new DataManager(model.dataSource).executeLocal(
408
- // eslint-disable-next-line
409
- this.getInitQuery(model, query)));
402
+ this.updateInitValue(mText, mVal, new DataManager(model.dataSource).executeLocal(this.getInitQuery(model, query)));
410
403
  }
411
404
  };
412
405
  InPlaceEditor.prototype.getInitQuery = function (model, query) {
@@ -426,7 +419,6 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
426
419
  }
427
420
  return query.where(predicate);
428
421
  };
429
- // eslint-disable-next-line
430
422
  InPlaceEditor.prototype.updateInitValue = function (mText, mVal, result) {
431
423
  if (result.length <= 0) {
432
424
  return;
@@ -446,7 +438,6 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
446
438
  this.valueWrap.classList.remove(LOAD);
447
439
  };
448
440
  InPlaceEditor.prototype.renderValue = function (val) {
449
- // eslint-disable-next-line
450
441
  this.enableHtmlSanitizer && this.type !== 'RTE' && this.type !== 'MultiSelect' ? this.valueEle.innerText = val :
451
442
  (this.valueEle.innerHTML = this.enableHtmlParse ? val : encode(val));
452
443
  if (this.type === 'Color') {
@@ -474,7 +465,6 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
474
465
  if (this.beginEditArgs.cancel) {
475
466
  return;
476
467
  }
477
- // eslint-disable-next-line
478
468
  var tipOptions = undefined;
479
469
  var target = select('.' + VALUE_WRAPPER, this.element);
480
470
  if (this.editableOn !== 'EditIconClick') {
@@ -519,7 +509,6 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
519
509
  }
520
510
  addClass([this.valueWrap], [OPEN]);
521
511
  this.setProperties({ enableEditMode: true }, true);
522
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
523
512
  if (this.isReact) {
524
513
  this.renderReactTemplates();
525
514
  }
@@ -675,7 +664,6 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
675
664
  break;
676
665
  case 'Numeric':
677
666
  if (this.model.value) {
678
- // eslint-disable-next-line no-useless-escape
679
667
  var expRegex = new RegExp('[eE][\-+]?([0-9]+)');
680
668
  if (expRegex.test(this.model.value)) {
681
669
  this.model.value = this.model.value;
@@ -745,7 +733,6 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
745
733
  InPlaceEditor.prototype.getEditElement = function () {
746
734
  return select('.' + ELEMENTS, this.formEle);
747
735
  };
748
- // eslint-disable-next-line
749
736
  InPlaceEditor.prototype.getLocale = function (prop, val) {
750
737
  return new L10n('inplace-editor', prop, this.locale).getConstant(val);
751
738
  };
@@ -753,7 +740,6 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
753
740
  return (!this.isEmpty(val)) ? val : this.emptyText;
754
741
  };
755
742
  InPlaceEditor.prototype.extendModelValue = function (val) {
756
- // eslint-disable-next-line
757
743
  var model = this.model;
758
744
  extend(model, { value: val });
759
745
  this.setProperties({ model: model }, true);
@@ -832,18 +818,15 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
832
818
  }
833
819
  };
834
820
  InPlaceEditor.prototype.setRtl = function (value) {
835
- // eslint-disable-next-line
836
821
  value ? addClass([this.element], [RTL]) : removeClass([this.element], [RTL]);
837
822
  };
838
823
  InPlaceEditor.prototype.setFocus = function () {
839
824
  if (this.isTemplate) {
840
825
  return;
841
826
  }
842
- // eslint-disable-next-line
843
827
  this.isExtModule ? this.notify(setFocus, {}) : this.componentObj.element.focus();
844
828
  };
845
829
  InPlaceEditor.prototype.removeEditor = function (isBlazorDestroy) {
846
- // eslint-disable-next-line
847
830
  if (isBlazor() && !this.isStringTemplate) {
848
831
  resetBlazorTemplate(this.element.id + 'template', 'Template');
849
832
  }
@@ -879,7 +862,6 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
879
862
  this.valueWrap.parentElement.setAttribute('title', this.getLocale(localeConstant[this.editableOn], titleConstant));
880
863
  }
881
864
  }
882
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
883
865
  if (this.isReact) {
884
866
  this.clearTemplate();
885
867
  }
@@ -918,7 +900,7 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
918
900
  this.submitBtn = undefined;
919
901
  }
920
902
  if (!isNullOrUndefined(this.cancelBtn)) {
921
- EventHandler.remove(this.cancelBtn.element, 'mousedown', this.cancelBtnClick);
903
+ EventHandler.remove(this.cancelBtn.element, 'mouseup', this.cancelBtnClick);
922
904
  EventHandler.remove(this.cancelBtn.element, 'keydown', this.btnKeyDownHandler);
923
905
  this.cancelBtn.destroy();
924
906
  this.cancelBtn = undefined;
@@ -950,7 +932,6 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
950
932
  _this.dataManager.executeQuery(_this.getQuery(actionBeginArgs.data), _this.successHandler.bind(_this), _this.failureHandler.bind(_this));
951
933
  }
952
934
  else {
953
- // eslint-disable-next-line
954
935
  var crud = _this.dataManager.insert(actionBeginArgs.data);
955
936
  crud.then(function (e) { return _this.successHandler(e); }).catch(function (e) { return _this.failureHandler(e); });
956
937
  }
@@ -971,11 +952,9 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
971
952
  };
972
953
  InPlaceEditor.prototype.templateCompile = function (trgEle, tempStr) {
973
954
  var tempEle;
974
- // eslint-disable-next-line
975
955
  if (typeof tempStr === 'string') {
976
956
  tempStr = tempStr.trim();
977
957
  }
978
- // eslint-disable-next-line
979
958
  var compiler = compile(tempStr);
980
959
  if (!isNullOrUndefined(compiler)) {
981
960
  var isString = (isBlazor() &&
@@ -1005,7 +984,6 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
1005
984
  helper: null
1006
985
  };
1007
986
  extend(item_1, item_1, beforeEvent);
1008
- // eslint-disable-next-line
1009
987
  this.trigger('beforeSanitizeHtml', item_1, function (args) {
1010
988
  if (item_1.cancel && !isNullOrUndefined(item_1.helper)) {
1011
989
  value = item_1.helper(value);
@@ -1041,14 +1019,12 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
1041
1019
  }
1042
1020
  };
1043
1021
  InPlaceEditor.prototype.disable = function (value) {
1044
- // eslint-disable-next-line
1045
1022
  value ? addClass([this.element], [DISABLE]) : removeClass([this.element], [DISABLE]);
1046
1023
  };
1047
1024
  InPlaceEditor.prototype.enableEditor = function (val, isInit) {
1048
1025
  if (isInit && !val) {
1049
1026
  return;
1050
1027
  }
1051
- // eslint-disable-next-line
1052
1028
  (val) ? this.renderEditor() : this.cancelHandler('cancel');
1053
1029
  };
1054
1030
  InPlaceEditor.prototype.checkValidation = function (fromSubmit, isValidate) {
@@ -1132,11 +1108,9 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
1132
1108
  return;
1133
1109
  }
1134
1110
  var inputEle = select('.e-input-group', this.formEle);
1135
- // eslint-disable-next-line
1136
1111
  var errorClass = function (element, val, action) {
1137
1112
  [].slice.call(element).forEach(function (ele) {
1138
1113
  if (ele) {
1139
- // eslint-disable-next-line
1140
1114
  action === 'add' ? addClass([ele], [val]) : removeClass([ele], [val]);
1141
1115
  }
1142
1116
  });
@@ -1213,7 +1187,7 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
1213
1187
  EventHandler.add(this.submitBtn.element, 'keydown', this.btnKeyDownHandler, this);
1214
1188
  }
1215
1189
  if (!isNullOrUndefined(this.cancelBtn)) {
1216
- EventHandler.add(this.cancelBtn.element, 'mousedown', this.cancelBtnClick, this);
1190
+ EventHandler.add(this.cancelBtn.element, 'mouseup', this.cancelBtnClick, this);
1217
1191
  EventHandler.add(this.cancelBtn.element, 'keydown', this.btnKeyDownHandler, this);
1218
1192
  }
1219
1193
  };
@@ -1335,17 +1309,14 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
1335
1309
  this.tipObj.refresh(tipTarget);
1336
1310
  }
1337
1311
  };
1338
- // eslint-disable-next-line
1339
1312
  InPlaceEditor.prototype.successHandler = function (e) {
1340
1313
  this.initRender = false;
1341
1314
  var eventArgs = { data: e, value: this.getSendValue() };
1342
1315
  this.triggerSuccess(eventArgs);
1343
1316
  };
1344
- // eslint-disable-next-line
1345
1317
  InPlaceEditor.prototype.failureHandler = function (e) {
1346
1318
  var _this = this;
1347
1319
  var eventArgs = { data: e, value: this.getSendValue() };
1348
- // eslint-disable-next-line
1349
1320
  this.trigger('actionFailure', eventArgs, function (args) {
1350
1321
  _this.removeSpinner('submit');
1351
1322
  if (_this.mode === 'Popup') {
@@ -1446,7 +1417,6 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
1446
1417
  this.element.focus();
1447
1418
  this.editEle = select('.' + INPUT, this.formEle);
1448
1419
  var errEle = null;
1449
- // eslint-disable-next-line
1450
1420
  errEle = select('.' + ERROR, this.editEle);
1451
1421
  if (!this.isTemplate) {
1452
1422
  this.setValue();
@@ -1480,7 +1450,6 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
1480
1450
  if (!(isBlazor() && this.isServerRendered)) {
1481
1451
  _super.prototype.destroy.call(this);
1482
1452
  }
1483
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1484
1453
  if (this.isReact) {
1485
1454
  this.clearTemplate();
1486
1455
  }
@@ -1522,58 +1491,59 @@ var InPlaceEditor = /** @__PURE__ @class */ (function (_super) {
1522
1491
  * @private
1523
1492
  */
1524
1493
  InPlaceEditor.prototype.onPropertyChanged = function (newProp, oldProp) {
1525
- if (this.isEditorOpen()) {
1526
- var editModeChanged = 'enableEditMode' in newProp;
1527
- if ((editModeChanged && oldProp.enableEditMode && !newProp.enableEditMode) || (!editModeChanged && this.enableEditMode)) {
1528
- this.triggerEndEdit('cancel');
1529
- }
1530
- else {
1531
- this.removeEditor();
1494
+ var checkValidation = this.validationRules ? !isNullOrUndefined(this.element.querySelectorAll('.' + ERROR)) &&
1495
+ this.element.querySelectorAll('.' + ERROR).length > 0 ? false : true : true;
1496
+ if (checkValidation) {
1497
+ if (this.isEditorOpen()) {
1498
+ var editModeChanged = 'enableEditMode' in newProp;
1499
+ if ((editModeChanged && oldProp.enableEditMode && !newProp.enableEditMode) || (!editModeChanged && this.enableEditMode)) {
1500
+ this.triggerEndEdit('cancel');
1501
+ }
1502
+ else {
1503
+ this.removeEditor();
1504
+ }
1532
1505
  }
1533
- }
1534
- for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
1535
- var prop = _a[_i];
1536
- switch (prop) {
1537
- case 'showButtons':
1538
- // eslint-disable-next-line
1539
- (newProp.showButtons) ? this.appendButtons(this.formEle) : this.destroyButtons();
1540
- break;
1541
- case 'value':
1542
- this.updateValue();
1543
- // eslint-disable-next-line
1544
- this.textOption === 'Never' ? this.renderValue(this.checkValue(parseValue(this.type, this.value, this.model)))
1545
- : this.renderInitialValue();
1546
- break;
1547
- case 'emptyText':
1548
- // eslint-disable-next-line
1549
- this.textOption === 'Never' ? this.renderValue(this.checkValue(parseValue(this.type, this.value, this.model)))
1550
- : this.renderInitialValue();
1551
- break;
1552
- case 'template':
1553
- this.checkIsTemplate();
1554
- break;
1555
- case 'disabled':
1556
- this.disable(newProp.disabled);
1557
- break;
1558
- case 'enableRtl':
1559
- this.setRtl(newProp.enableRtl);
1560
- break;
1561
- case 'cssClass':
1562
- this.setClass('remove', oldProp.cssClass);
1563
- this.setClass('add', newProp.cssClass);
1564
- break;
1565
- case 'mode':
1566
- this.enableEditor(this.enableEditMode);
1567
- break;
1568
- case 'enableEditMode':
1569
- this.enableEditor(newProp.enableEditMode);
1570
- break;
1571
- case 'editableOn':
1572
- this.unWireEditEvent(oldProp.editableOn);
1573
- if (newProp.editableOn !== 'EditIconClick') {
1574
- this.wireEditEvent(newProp.editableOn);
1575
- }
1576
- break;
1506
+ for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
1507
+ var prop = _a[_i];
1508
+ switch (prop) {
1509
+ case 'showButtons':
1510
+ (newProp.showButtons) ? this.appendButtons(this.formEle) : this.destroyButtons();
1511
+ break;
1512
+ case 'value':
1513
+ this.updateValue();
1514
+ this.textOption === 'Never' ? this.renderValue(this.checkValue(parseValue(this.type, this.value, this.model)))
1515
+ : this.renderInitialValue();
1516
+ break;
1517
+ case 'emptyText':
1518
+ this.textOption === 'Never' ? this.renderValue(this.checkValue(parseValue(this.type, this.value, this.model)))
1519
+ : this.renderInitialValue();
1520
+ break;
1521
+ case 'template':
1522
+ this.checkIsTemplate();
1523
+ break;
1524
+ case 'disabled':
1525
+ this.disable(newProp.disabled);
1526
+ break;
1527
+ case 'enableRtl':
1528
+ this.setRtl(newProp.enableRtl);
1529
+ break;
1530
+ case 'cssClass':
1531
+ this.setClass('remove', oldProp.cssClass);
1532
+ this.setClass('add', newProp.cssClass);
1533
+ break;
1534
+ case 'mode':
1535
+ this.enableEditor(this.enableEditMode);
1536
+ break;
1537
+ case 'enableEditMode':
1538
+ this.enableEditor(newProp.enableEditMode);
1539
+ break;
1540
+ case 'editableOn':
1541
+ this.unWireEditEvent(oldProp.editableOn);
1542
+ if (newProp.editableOn !== 'EditIconClick') {
1543
+ this.wireEditEvent(newProp.editableOn);
1544
+ }
1545
+ break;
1546
+ }
1577
1547
  }
1578
1548
  }
1579
1549
  };
@@ -1880,6 +1850,7 @@ var ComboBox$1 = /** @__PURE__ @class */ (function () {
1880
1850
  };
1881
1851
  /**
1882
1852
  * Destroys the module.
1853
+ *
1883
1854
  * @function destroy
1884
1855
  * @returns {void}
1885
1856
  * @hidden
@@ -1895,6 +1866,7 @@ var ComboBox$1 = /** @__PURE__ @class */ (function () {
1895
1866
  };
1896
1867
  /**
1897
1868
  * For internal use only - Get the module name.
1869
+ *
1898
1870
  * @returns {string} - returns the string
1899
1871
  */
1900
1872
  ComboBox$$1.prototype.getModuleName = function () {
@@ -1922,6 +1894,7 @@ var DateRangePicker$1 = /** @__PURE__ @class */ (function () {
1922
1894
  };
1923
1895
  /**
1924
1896
  * For internal use only - Get the module name.
1897
+ *
1925
1898
  * @returns {string} - returns the string
1926
1899
  */
1927
1900
  DateRangePicker$$1.prototype.getModuleName = function () {