@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.
- package/CHANGELOG.md +12 -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 +57 -84
- package/dist/es6/ej2-inplace-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-inplace-editor.es5.js +58 -85
- 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 +17 -17
- package/src/inplace-editor/base/inplace-editor-model.d.ts +1 -2
- package/src/inplace-editor/base/inplace-editor.js +55 -83
- package/src/inplace-editor/base/interface.d.ts +1 -0
- package/src/inplace-editor/base/models-model.d.ts +2 -0
- package/src/inplace-editor/base/models.d.ts +2 -0
- package/src/inplace-editor/base/models.js +0 -2
- package/src/inplace-editor/modules/combo-box.d.ts +2 -0
- package/src/inplace-editor/modules/combo-box.js +2 -0
- package/src/inplace-editor/modules/date-range-picker.d.ts +1 -0
- package/src/inplace-editor/modules/date-range-picker.js +1 -0
- package/styles/inplace-editor/_bootstrap-dark-definition.scss +0 -1
- package/styles/inplace-editor/_bootstrap-definition.scss +0 -1
- package/styles/inplace-editor/_bootstrap4-definition.scss +0 -1
- package/styles/inplace-editor/_bootstrap5-definition.scss +0 -2
- package/styles/inplace-editor/_fabric-dark-definition.scss +0 -1
- package/styles/inplace-editor/_fabric-definition.scss +0 -1
- package/styles/inplace-editor/_fluent-definition.scss +0 -2
- package/styles/inplace-editor/_fusionnew-definition.scss +0 -2
- package/styles/inplace-editor/_highcontrast-definition.scss +0 -1
- package/styles/inplace-editor/_highcontrast-light-definition.scss +0 -1
- package/styles/inplace-editor/_layout.scss +9 -9
- package/styles/inplace-editor/_material-dark-definition.scss +0 -1
- package/styles/inplace-editor/_material-definition.scss +0 -1
- package/styles/inplace-editor/_tailwind-definition.scss +0 -2
- package/styles/inplace-editor/_theme.scss +12 -12
- package/styles/inplace-editor/_material3-definition.scss +0 -71
|
@@ -142,7 +142,6 @@ __decorate([
|
|
|
142
142
|
* @hidden
|
|
143
143
|
*/
|
|
144
144
|
const modulesList = {
|
|
145
|
-
/* eslint-disable */
|
|
146
145
|
'AutoComplete': 'auto-complete',
|
|
147
146
|
'Color': 'color-picker',
|
|
148
147
|
'ComboBox': 'combo-box',
|
|
@@ -158,7 +157,6 @@ const modulesList = {
|
|
|
158
157
|
*/
|
|
159
158
|
// eslint-disable-next-line
|
|
160
159
|
let localeConstant = {
|
|
161
|
-
/* eslint-disable */
|
|
162
160
|
'Click': { 'editAreaClick': 'Click to edit' },
|
|
163
161
|
'DblClick': { 'editAreaDoubleClick': 'Double click to edit' },
|
|
164
162
|
'EditIconClick': { 'editAreaClick': 'Click to edit' }
|
|
@@ -309,7 +307,6 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
309
307
|
this.updateAdaptor();
|
|
310
308
|
this.appendValueElement();
|
|
311
309
|
this.updateValue();
|
|
312
|
-
// eslint-disable-next-line
|
|
313
310
|
this.textOption === 'Never' ?
|
|
314
311
|
this.renderValue(this.checkValue(parseValue(this.type, this.value, this.model)))
|
|
315
312
|
: this.renderInitialValue();
|
|
@@ -324,7 +321,6 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
324
321
|
const allClassName = val.split(' ');
|
|
325
322
|
for (let i = 0; i < allClassName.length; i++) {
|
|
326
323
|
if (allClassName[i].trim() !== '') {
|
|
327
|
-
// eslint-disable-next-line
|
|
328
324
|
action === 'add' ? addClass([this.element], [allClassName[i]]) : removeClass([this.element], [allClassName[i]]);
|
|
329
325
|
}
|
|
330
326
|
}
|
|
@@ -365,14 +361,11 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
365
361
|
const query = isNullOrUndefined(model.query) ? new Query() : model.query;
|
|
366
362
|
if (model.dataSource instanceof DataManager) {
|
|
367
363
|
model.dataSource.executeQuery(this.getInitQuery(model, query)).then((e) => {
|
|
368
|
-
// eslint-disable-next-line
|
|
369
364
|
this.updateInitValue(mText, mVal, e.result);
|
|
370
365
|
});
|
|
371
366
|
}
|
|
372
367
|
else {
|
|
373
|
-
this.updateInitValue(mText, mVal, new DataManager(model.dataSource).executeLocal(
|
|
374
|
-
// eslint-disable-next-line
|
|
375
|
-
this.getInitQuery(model, query)));
|
|
368
|
+
this.updateInitValue(mText, mVal, new DataManager(model.dataSource).executeLocal(this.getInitQuery(model, query)));
|
|
376
369
|
}
|
|
377
370
|
}
|
|
378
371
|
getInitQuery(model, query) {
|
|
@@ -391,7 +384,6 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
391
384
|
}
|
|
392
385
|
return query.where(predicate);
|
|
393
386
|
}
|
|
394
|
-
// eslint-disable-next-line
|
|
395
387
|
updateInitValue(mText, mVal, result) {
|
|
396
388
|
if (result.length <= 0) {
|
|
397
389
|
return;
|
|
@@ -410,7 +402,6 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
410
402
|
this.valueWrap.classList.remove(LOAD);
|
|
411
403
|
}
|
|
412
404
|
renderValue(val) {
|
|
413
|
-
// eslint-disable-next-line
|
|
414
405
|
this.enableHtmlSanitizer && this.type !== 'RTE' && this.type !== 'MultiSelect' ? this.valueEle.innerText = val :
|
|
415
406
|
(this.valueEle.innerHTML = this.enableHtmlParse ? val : encode(val));
|
|
416
407
|
if (this.type === 'Color') {
|
|
@@ -438,7 +429,6 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
438
429
|
if (this.beginEditArgs.cancel) {
|
|
439
430
|
return;
|
|
440
431
|
}
|
|
441
|
-
// eslint-disable-next-line
|
|
442
432
|
let tipOptions = undefined;
|
|
443
433
|
const target = select('.' + VALUE_WRAPPER, this.element);
|
|
444
434
|
if (this.editableOn !== 'EditIconClick') {
|
|
@@ -483,7 +473,6 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
483
473
|
}
|
|
484
474
|
addClass([this.valueWrap], [OPEN]);
|
|
485
475
|
this.setProperties({ enableEditMode: true }, true);
|
|
486
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
487
476
|
if (this.isReact) {
|
|
488
477
|
this.renderReactTemplates();
|
|
489
478
|
}
|
|
@@ -638,7 +627,6 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
638
627
|
break;
|
|
639
628
|
case 'Numeric':
|
|
640
629
|
if (this.model.value) {
|
|
641
|
-
// eslint-disable-next-line no-useless-escape
|
|
642
630
|
const expRegex = new RegExp('[eE][\-+]?([0-9]+)');
|
|
643
631
|
if (expRegex.test(this.model.value)) {
|
|
644
632
|
this.model.value = this.model.value;
|
|
@@ -708,7 +696,6 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
708
696
|
getEditElement() {
|
|
709
697
|
return select('.' + ELEMENTS, this.formEle);
|
|
710
698
|
}
|
|
711
|
-
// eslint-disable-next-line
|
|
712
699
|
getLocale(prop, val) {
|
|
713
700
|
return new L10n('inplace-editor', prop, this.locale).getConstant(val);
|
|
714
701
|
}
|
|
@@ -716,7 +703,6 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
716
703
|
return (!this.isEmpty(val)) ? val : this.emptyText;
|
|
717
704
|
}
|
|
718
705
|
extendModelValue(val) {
|
|
719
|
-
// eslint-disable-next-line
|
|
720
706
|
const model = this.model;
|
|
721
707
|
extend(model, { value: val });
|
|
722
708
|
this.setProperties({ model: model }, true);
|
|
@@ -795,18 +781,15 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
795
781
|
}
|
|
796
782
|
}
|
|
797
783
|
setRtl(value) {
|
|
798
|
-
// eslint-disable-next-line
|
|
799
784
|
value ? addClass([this.element], [RTL]) : removeClass([this.element], [RTL]);
|
|
800
785
|
}
|
|
801
786
|
setFocus() {
|
|
802
787
|
if (this.isTemplate) {
|
|
803
788
|
return;
|
|
804
789
|
}
|
|
805
|
-
// eslint-disable-next-line
|
|
806
790
|
this.isExtModule ? this.notify(setFocus, {}) : this.componentObj.element.focus();
|
|
807
791
|
}
|
|
808
792
|
removeEditor(isBlazorDestroy) {
|
|
809
|
-
// eslint-disable-next-line
|
|
810
793
|
if (isBlazor() && !this.isStringTemplate) {
|
|
811
794
|
resetBlazorTemplate(this.element.id + 'template', 'Template');
|
|
812
795
|
}
|
|
@@ -842,7 +825,6 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
842
825
|
this.valueWrap.parentElement.setAttribute('title', this.getLocale(localeConstant[this.editableOn], titleConstant));
|
|
843
826
|
}
|
|
844
827
|
}
|
|
845
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
846
828
|
if (this.isReact) {
|
|
847
829
|
this.clearTemplate();
|
|
848
830
|
}
|
|
@@ -881,7 +863,7 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
881
863
|
this.submitBtn = undefined;
|
|
882
864
|
}
|
|
883
865
|
if (!isNullOrUndefined(this.cancelBtn)) {
|
|
884
|
-
EventHandler.remove(this.cancelBtn.element, '
|
|
866
|
+
EventHandler.remove(this.cancelBtn.element, 'mouseup', this.cancelBtnClick);
|
|
885
867
|
EventHandler.remove(this.cancelBtn.element, 'keydown', this.btnKeyDownHandler);
|
|
886
868
|
this.cancelBtn.destroy();
|
|
887
869
|
this.cancelBtn = undefined;
|
|
@@ -912,7 +894,6 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
912
894
|
this.dataManager.executeQuery(this.getQuery(actionBeginArgs.data), this.successHandler.bind(this), this.failureHandler.bind(this));
|
|
913
895
|
}
|
|
914
896
|
else {
|
|
915
|
-
// eslint-disable-next-line
|
|
916
897
|
const crud = this.dataManager.insert(actionBeginArgs.data);
|
|
917
898
|
crud.then((e) => this.successHandler(e)).catch((e) => this.failureHandler(e));
|
|
918
899
|
}
|
|
@@ -933,11 +914,9 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
933
914
|
}
|
|
934
915
|
templateCompile(trgEle, tempStr) {
|
|
935
916
|
let tempEle;
|
|
936
|
-
// eslint-disable-next-line
|
|
937
917
|
if (typeof tempStr === 'string') {
|
|
938
918
|
tempStr = tempStr.trim();
|
|
939
919
|
}
|
|
940
|
-
// eslint-disable-next-line
|
|
941
920
|
const compiler = compile(tempStr);
|
|
942
921
|
if (!isNullOrUndefined(compiler)) {
|
|
943
922
|
const isString = (isBlazor() &&
|
|
@@ -967,7 +946,6 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
967
946
|
helper: null
|
|
968
947
|
};
|
|
969
948
|
extend(item, item, beforeEvent);
|
|
970
|
-
// eslint-disable-next-line
|
|
971
949
|
this.trigger('beforeSanitizeHtml', item, (args) => {
|
|
972
950
|
if (item.cancel && !isNullOrUndefined(item.helper)) {
|
|
973
951
|
value = item.helper(value);
|
|
@@ -1003,14 +981,12 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
1003
981
|
}
|
|
1004
982
|
}
|
|
1005
983
|
disable(value) {
|
|
1006
|
-
// eslint-disable-next-line
|
|
1007
984
|
value ? addClass([this.element], [DISABLE]) : removeClass([this.element], [DISABLE]);
|
|
1008
985
|
}
|
|
1009
986
|
enableEditor(val, isInit) {
|
|
1010
987
|
if (isInit && !val) {
|
|
1011
988
|
return;
|
|
1012
989
|
}
|
|
1013
|
-
// eslint-disable-next-line
|
|
1014
990
|
(val) ? this.renderEditor() : this.cancelHandler('cancel');
|
|
1015
991
|
}
|
|
1016
992
|
checkValidation(fromSubmit, isValidate) {
|
|
@@ -1093,11 +1069,9 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
1093
1069
|
return;
|
|
1094
1070
|
}
|
|
1095
1071
|
const inputEle = select('.e-input-group', this.formEle);
|
|
1096
|
-
// eslint-disable-next-line
|
|
1097
1072
|
const errorClass = (element, val, action) => {
|
|
1098
1073
|
[].slice.call(element).forEach((ele) => {
|
|
1099
1074
|
if (ele) {
|
|
1100
|
-
// eslint-disable-next-line
|
|
1101
1075
|
action === 'add' ? addClass([ele], [val]) : removeClass([ele], [val]);
|
|
1102
1076
|
}
|
|
1103
1077
|
});
|
|
@@ -1172,7 +1146,7 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
1172
1146
|
EventHandler.add(this.submitBtn.element, 'keydown', this.btnKeyDownHandler, this);
|
|
1173
1147
|
}
|
|
1174
1148
|
if (!isNullOrUndefined(this.cancelBtn)) {
|
|
1175
|
-
EventHandler.add(this.cancelBtn.element, '
|
|
1149
|
+
EventHandler.add(this.cancelBtn.element, 'mouseup', this.cancelBtnClick, this);
|
|
1176
1150
|
EventHandler.add(this.cancelBtn.element, 'keydown', this.btnKeyDownHandler, this);
|
|
1177
1151
|
}
|
|
1178
1152
|
}
|
|
@@ -1294,16 +1268,13 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
1294
1268
|
this.tipObj.refresh(tipTarget);
|
|
1295
1269
|
}
|
|
1296
1270
|
}
|
|
1297
|
-
// eslint-disable-next-line
|
|
1298
1271
|
successHandler(e) {
|
|
1299
1272
|
this.initRender = false;
|
|
1300
1273
|
const eventArgs = { data: e, value: this.getSendValue() };
|
|
1301
1274
|
this.triggerSuccess(eventArgs);
|
|
1302
1275
|
}
|
|
1303
|
-
// eslint-disable-next-line
|
|
1304
1276
|
failureHandler(e) {
|
|
1305
1277
|
const eventArgs = { data: e, value: this.getSendValue() };
|
|
1306
|
-
// eslint-disable-next-line
|
|
1307
1278
|
this.trigger('actionFailure', eventArgs, (args) => {
|
|
1308
1279
|
this.removeSpinner('submit');
|
|
1309
1280
|
if (this.mode === 'Popup') {
|
|
@@ -1403,7 +1374,6 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
1403
1374
|
this.element.focus();
|
|
1404
1375
|
this.editEle = select('.' + INPUT, this.formEle);
|
|
1405
1376
|
let errEle = null;
|
|
1406
|
-
// eslint-disable-next-line
|
|
1407
1377
|
errEle = select('.' + ERROR, this.editEle);
|
|
1408
1378
|
if (!this.isTemplate) {
|
|
1409
1379
|
this.setValue();
|
|
@@ -1436,7 +1406,6 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
1436
1406
|
if (!(isBlazor() && this.isServerRendered)) {
|
|
1437
1407
|
super.destroy();
|
|
1438
1408
|
}
|
|
1439
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1440
1409
|
if (this.isReact) {
|
|
1441
1410
|
this.clearTemplate();
|
|
1442
1411
|
}
|
|
@@ -1478,57 +1447,58 @@ let InPlaceEditor = class InPlaceEditor extends Component {
|
|
|
1478
1447
|
* @private
|
|
1479
1448
|
*/
|
|
1480
1449
|
onPropertyChanged(newProp, oldProp) {
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1450
|
+
let checkValidation = this.validationRules ? !isNullOrUndefined(this.element.querySelectorAll('.' + ERROR)) &&
|
|
1451
|
+
this.element.querySelectorAll('.' + ERROR).length > 0 ? false : true : true;
|
|
1452
|
+
if (checkValidation) {
|
|
1453
|
+
if (this.isEditorOpen()) {
|
|
1454
|
+
const editModeChanged = 'enableEditMode' in newProp;
|
|
1455
|
+
if ((editModeChanged && oldProp.enableEditMode && !newProp.enableEditMode) || (!editModeChanged && this.enableEditMode)) {
|
|
1456
|
+
this.triggerEndEdit('cancel');
|
|
1457
|
+
}
|
|
1458
|
+
else {
|
|
1459
|
+
this.removeEditor();
|
|
1460
|
+
}
|
|
1488
1461
|
}
|
|
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
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
this.wireEditEvent(newProp.editableOn);
|
|
1530
|
-
}
|
|
1531
|
-
break;
|
|
1462
|
+
for (const prop of Object.keys(newProp)) {
|
|
1463
|
+
switch (prop) {
|
|
1464
|
+
case 'showButtons':
|
|
1465
|
+
(newProp.showButtons) ? this.appendButtons(this.formEle) : this.destroyButtons();
|
|
1466
|
+
break;
|
|
1467
|
+
case 'value':
|
|
1468
|
+
this.updateValue();
|
|
1469
|
+
this.textOption === 'Never' ? this.renderValue(this.checkValue(parseValue(this.type, this.value, this.model)))
|
|
1470
|
+
: this.renderInitialValue();
|
|
1471
|
+
break;
|
|
1472
|
+
case 'emptyText':
|
|
1473
|
+
this.textOption === 'Never' ? this.renderValue(this.checkValue(parseValue(this.type, this.value, this.model)))
|
|
1474
|
+
: this.renderInitialValue();
|
|
1475
|
+
break;
|
|
1476
|
+
case 'template':
|
|
1477
|
+
this.checkIsTemplate();
|
|
1478
|
+
break;
|
|
1479
|
+
case 'disabled':
|
|
1480
|
+
this.disable(newProp.disabled);
|
|
1481
|
+
break;
|
|
1482
|
+
case 'enableRtl':
|
|
1483
|
+
this.setRtl(newProp.enableRtl);
|
|
1484
|
+
break;
|
|
1485
|
+
case 'cssClass':
|
|
1486
|
+
this.setClass('remove', oldProp.cssClass);
|
|
1487
|
+
this.setClass('add', newProp.cssClass);
|
|
1488
|
+
break;
|
|
1489
|
+
case 'mode':
|
|
1490
|
+
this.enableEditor(this.enableEditMode);
|
|
1491
|
+
break;
|
|
1492
|
+
case 'enableEditMode':
|
|
1493
|
+
this.enableEditor(newProp.enableEditMode);
|
|
1494
|
+
break;
|
|
1495
|
+
case 'editableOn':
|
|
1496
|
+
this.unWireEditEvent(oldProp.editableOn);
|
|
1497
|
+
if (newProp.editableOn !== 'EditIconClick') {
|
|
1498
|
+
this.wireEditEvent(newProp.editableOn);
|
|
1499
|
+
}
|
|
1500
|
+
break;
|
|
1501
|
+
}
|
|
1532
1502
|
}
|
|
1533
1503
|
}
|
|
1534
1504
|
}
|
|
@@ -1831,6 +1801,7 @@ class ComboBox$1 {
|
|
|
1831
1801
|
}
|
|
1832
1802
|
/**
|
|
1833
1803
|
* Destroys the module.
|
|
1804
|
+
*
|
|
1834
1805
|
* @function destroy
|
|
1835
1806
|
* @returns {void}
|
|
1836
1807
|
* @hidden
|
|
@@ -1846,6 +1817,7 @@ class ComboBox$1 {
|
|
|
1846
1817
|
}
|
|
1847
1818
|
/**
|
|
1848
1819
|
* For internal use only - Get the module name.
|
|
1820
|
+
*
|
|
1849
1821
|
* @returns {string} - returns the string
|
|
1850
1822
|
*/
|
|
1851
1823
|
getModuleName() {
|
|
@@ -1872,6 +1844,7 @@ class DateRangePicker$1 {
|
|
|
1872
1844
|
}
|
|
1873
1845
|
/**
|
|
1874
1846
|
* For internal use only - Get the module name.
|
|
1847
|
+
*
|
|
1875
1848
|
* @returns {string} - returns the string
|
|
1876
1849
|
*/
|
|
1877
1850
|
getModuleName() {
|