d19a9aa63a36e9163b4d4a4d8160c2cd490de77a358573172f8722c90e4832b3fed612db51fc3dbcf8ce93dab232a318431210e88ea2cde74aba905dfc064f 712 B

1234567891011121314151617181920212223242526
  1. import numbro from 'numbro';
  2. import TextEditor from './textEditor';
  3. /**
  4. * @private
  5. * @editor NumericEditor
  6. * @class NumericEditor
  7. * @dependencies TextEditor numbro
  8. */
  9. class NumericEditor extends TextEditor {
  10. /**
  11. * @param {*} initialValue
  12. */
  13. beginEditing(initialValue) {
  14. if (typeof initialValue === 'undefined' && this.originalValue) {
  15. if (typeof this.cellProperties.language !== 'undefined') {
  16. numbro.culture(this.cellProperties.language);
  17. }
  18. let decimalDelimiter = numbro.cultureData().delimiters.decimal;
  19. initialValue = (`${this.originalValue}`).replace('.', decimalDelimiter);
  20. }
  21. super.beginEditing(initialValue);
  22. }
  23. }
  24. export default NumericEditor;