handsontable 0.0.0-next-fd66c90-20240209 → 0.0.0-next-d255844-20240209

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of handsontable might be problematic. Click here for more details.

package/helpers/mixed.js CHANGED
@@ -134,7 +134,7 @@ const domMessages = {
134
134
  function _injectProductInfo(key, element) {
135
135
  const hasValidType = !isEmpty(key);
136
136
  const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
137
- const hotVersion = "0.0.0-next-fd66c90-20240209";
137
+ const hotVersion = "0.0.0-next-d255844-20240209";
138
138
  let keyValidityDate;
139
139
  let consoleMessageState = 'invalid';
140
140
  let domMessageState = 'invalid';
package/helpers/mixed.mjs CHANGED
@@ -124,7 +124,7 @@ const domMessages = {
124
124
  export function _injectProductInfo(key, element) {
125
125
  const hasValidType = !isEmpty(key);
126
126
  const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
127
- const hotVersion = "0.0.0-next-fd66c90-20240209";
127
+ const hotVersion = "0.0.0-next-d255844-20240209";
128
128
  let keyValidityDate;
129
129
  let consoleMessageState = 'invalid';
130
130
  let domMessageState = 'invalid';
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "url": "https://github.com/handsontable/handsontable/issues"
11
11
  },
12
12
  "author": "Handsoncode <hello@handsontable.com>",
13
- "version": "0.0.0-next-fd66c90-20240209",
13
+ "version": "0.0.0-next-d255844-20240209",
14
14
  "main": "index",
15
15
  "module": "index.mjs",
16
16
  "jsnext:main": "index.mjs",
package/pluginHooks.d.ts CHANGED
@@ -242,6 +242,7 @@ export interface Events {
242
242
  modifyColumnHeaderValue?: (headerValue: string, visualColumnIndex: number, headerLevel: number) => void | string;
243
243
  modifyColWidth?: (width: number, column: number) => void;
244
244
  modifyCopyableRange?: (copyableRanges: RangeType[]) => void;
245
+ modifyFiltersMultiSelectValue?: (value: string, meta: CellProperties) => void | CellValue;
245
246
  modifyFocusedElement?: (row: number, column: number, focusedElement: HTMLElement) => void | HTMLElement;
246
247
  modifyData?: (row: number, column: number, valueHolder: { value: CellValue }, ioMode: 'get' | 'set') => void;
247
248
  modifyFocusOnTabNavigation?: (tabActivationDir: 'from_above' | 'from_below', visualCoords: CellCoords) => void;
package/pluginHooks.js CHANGED
@@ -1340,6 +1340,16 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1340
1340
  * @param {number} column Visual column index.
1341
1341
  */
1342
1342
  'modifyColWidth',
1343
+ /**
1344
+ * Fired when rendering the list of values in the multiple-selection component of the Filters dropdown.
1345
+ * The hook allows modifying the displayed values in that component.
1346
+ *
1347
+ * @since 14.2.0
1348
+ * @event Hooks#modifyFiltersMultiSelectValue
1349
+ * @param {object} item The item in the list of values.
1350
+ * @param {object} meta The cell properties object.
1351
+ */
1352
+ 'modifyFiltersMultiSelectValue',
1343
1353
  /**
1344
1354
  * Fired when focusing a cell or a header element. Allows replacing the element to be focused by returning a
1345
1355
  * different HTML element.
package/pluginHooks.mjs CHANGED
@@ -1336,6 +1336,16 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1336
1336
  * @param {number} column Visual column index.
1337
1337
  */
1338
1338
  'modifyColWidth',
1339
+ /**
1340
+ * Fired when rendering the list of values in the multiple-selection component of the Filters dropdown.
1341
+ * The hook allows modifying the displayed values in that component.
1342
+ *
1343
+ * @since 14.2.0
1344
+ * @event Hooks#modifyFiltersMultiSelectValue
1345
+ * @param {object} item The item in the list of values.
1346
+ * @param {object} meta The cell properties object.
1347
+ */
1348
+ 'modifyFiltersMultiSelectValue',
1339
1349
  /**
1340
1350
  * Fired when focusing a cell or a header element. Allows replacing the element to be focused by returning a
1341
1351
  * different HTML element.
@@ -13,6 +13,7 @@ var _base = require("./_base");
13
13
  var _multipleSelect = require("../ui/multipleSelect");
14
14
  var _constants2 = require("../constants");
15
15
  var _conditionRegisterer = require("../conditionRegisterer");
16
+ var _numericRenderer = require("../../../renderers/numericRenderer");
16
17
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
17
18
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
19
  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
@@ -26,12 +27,29 @@ function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(
26
27
  * @class ValueComponent
27
28
  */
28
29
  var _onInputKeyDown = /*#__PURE__*/new WeakSet();
30
+ var _triggerModifyMultipleSelectionValueHook = /*#__PURE__*/new WeakSet();
31
+ var _onModifyDisplayedValue = /*#__PURE__*/new WeakSet();
29
32
  class ValueComponent extends _base.BaseComponent {
30
33
  constructor(hotInstance, options) {
31
34
  super(hotInstance, {
32
35
  id: options.id,
33
36
  stateless: false
34
37
  });
38
+ /**
39
+ * Modify the value displayed in the multiple select list.
40
+ *
41
+ * @param {*} value Cell value.
42
+ * @param {object} meta The cell meta object.
43
+ * @returns {*} Returns the modified value.
44
+ */
45
+ _classPrivateMethodInitSpec(this, _onModifyDisplayedValue);
46
+ /**
47
+ * Trigger the `modifyFiltersMultiSelectValue` hook.
48
+ *
49
+ * @param {object} item Item from the multiple select list.
50
+ * @param {Map} metaMap Map of row meta objects.
51
+ */
52
+ _classPrivateMethodInitSpec(this, _triggerModifyMultipleSelectionValueHook);
35
53
  /**
36
54
  * Key down listener.
37
55
  *
@@ -56,6 +74,7 @@ class ValueComponent extends _base.BaseComponent {
56
74
  */
57
75
  registerHooks() {
58
76
  this.getMultipleSelectElement().addLocalHook('keydown', event => _classPrivateMethodGet(this, _onInputKeyDown, _onInputKeyDown2).call(this, event)).addLocalHook('listTabKeydown', event => this.runLocalHooks('listTabKeydown', event));
77
+ this.hot.addHook('modifyFiltersMultiSelectValue', (value, meta) => _classPrivateMethodGet(this, _onModifyDisplayedValue, _onModifyDisplayedValue2).call(this, value, meta));
59
78
  }
60
79
 
61
80
  /**
@@ -113,15 +132,19 @@ class ValueComponent extends _base.BaseComponent {
113
132
  const state = {};
114
133
  const defaultBlankCellValue = this.hot.getTranslatedPhrase(C.FILTERS_VALUES_BLANK_CELLS);
115
134
  if (firstByValueCondition) {
116
- const rowValues = (0, _utils.unifyColumnValues)((0, _array.arrayMap)(filteredRowsFactory(physicalColumn, conditionsStack), row => row.value));
135
+ const filteredRows = filteredRowsFactory(physicalColumn, conditionsStack);
136
+ const rowValues = (0, _array.arrayMap)(filteredRows, row => row.value);
137
+ const rowMetaMap = new Map(filteredRows.map(row => [row.value, this.hot.getCellMeta(row.meta.visualRow, row.meta.visualCol)]));
138
+ const unifiedRowValues = (0, _utils.unifyColumnValues)(rowValues);
117
139
  if (conditionArgsChange) {
118
140
  firstByValueCondition.args[0] = conditionArgsChange;
119
141
  }
120
142
  const selectedValues = [];
121
- const itemsSnapshot = (0, _utils.intersectValues)(rowValues, firstByValueCondition.args[0], defaultBlankCellValue, item => {
143
+ const itemsSnapshot = (0, _utils.intersectValues)(unifiedRowValues, firstByValueCondition.args[0], defaultBlankCellValue, item => {
122
144
  if (item.checked) {
123
145
  selectedValues.push(item.value);
124
146
  }
147
+ _classPrivateMethodGet(this, _triggerModifyMultipleSelectionValueHook, _triggerModifyMultipleSelectionValueHook2).call(this, item, rowMetaMap);
125
148
  });
126
149
  const column = stateInfo.editedConditionStack.column;
127
150
  state.locale = this.hot.getCellMeta(0, column).locale;
@@ -182,8 +205,13 @@ class ValueComponent extends _base.BaseComponent {
182
205
  */
183
206
  reset() {
184
207
  const defaultBlankCellValue = this.hot.getTranslatedPhrase(C.FILTERS_VALUES_BLANK_CELLS);
185
- const values = (0, _utils.unifyColumnValues)(this._getColumnVisibleValues());
186
- const items = (0, _utils.intersectValues)(values, values, defaultBlankCellValue);
208
+ const rowEntries = this._getColumnVisibleValues();
209
+ const rowValues = rowEntries.map(entry => entry.value);
210
+ const rowMetaMap = new Map(rowEntries.map(row => [row.value, row.meta]));
211
+ const values = (0, _utils.unifyColumnValues)(rowValues);
212
+ const items = (0, _utils.intersectValues)(values, values, defaultBlankCellValue, item => {
213
+ _classPrivateMethodGet(this, _triggerModifyMultipleSelectionValueHook, _triggerModifyMultipleSelectionValueHook2).call(this, item, rowMetaMap);
214
+ });
187
215
  this.getMultipleSelectElement().setItems(items);
188
216
  super.reset();
189
217
  this.getMultipleSelectElement().setValue(values);
@@ -203,7 +231,12 @@ class ValueComponent extends _base.BaseComponent {
203
231
  if (selectedColumn === null) {
204
232
  return [];
205
233
  }
206
- return (0, _array.arrayMap)(this.hot.getDataAtCol(selectedColumn.visualIndex), v => (0, _utils.toEmptyString)(v));
234
+ return (0, _array.arrayMap)(this.hot.getDataAtCol(selectedColumn.visualIndex), (v, rowIndex) => {
235
+ return {
236
+ value: (0, _utils.toEmptyString)(v),
237
+ meta: this.hot.getCellMeta(selectedColumn.visualIndex, rowIndex)
238
+ };
239
+ });
207
240
  }
208
241
  }
209
242
  exports.ValueComponent = ValueComponent;
@@ -212,4 +245,17 @@ function _onInputKeyDown2(event) {
212
245
  this.runLocalHooks('cancel');
213
246
  (0, _event.stopImmediatePropagation)(event);
214
247
  }
248
+ }
249
+ function _triggerModifyMultipleSelectionValueHook2(item, metaMap) {
250
+ if (this.hot.hasHook('modifyFiltersMultiSelectValue')) {
251
+ item.visualValue = this.hot.runHooks('modifyFiltersMultiSelectValue', item.visualValue, metaMap.get(item.value));
252
+ }
253
+ }
254
+ function _onModifyDisplayedValue2(value, meta) {
255
+ switch (meta.type) {
256
+ case 'numeric':
257
+ return (0, _numericRenderer.getRenderedValue)(value, meta);
258
+ default:
259
+ return value;
260
+ }
215
261
  }
@@ -16,17 +16,35 @@ import { BaseComponent } from "./_base.mjs";
16
16
  import { MultipleSelectUI } from "../ui/multipleSelect.mjs";
17
17
  import { CONDITION_BY_VALUE, CONDITION_NONE } from "../constants.mjs";
18
18
  import { getConditionDescriptor } from "../conditionRegisterer.mjs";
19
+ import { getRenderedValue as getRenderedNumericValue } from "../../../renderers/numericRenderer/index.mjs";
19
20
  /**
20
21
  * @private
21
22
  * @class ValueComponent
22
23
  */
23
24
  var _onInputKeyDown = /*#__PURE__*/new WeakSet();
25
+ var _triggerModifyMultipleSelectionValueHook = /*#__PURE__*/new WeakSet();
26
+ var _onModifyDisplayedValue = /*#__PURE__*/new WeakSet();
24
27
  export class ValueComponent extends BaseComponent {
25
28
  constructor(hotInstance, options) {
26
29
  super(hotInstance, {
27
30
  id: options.id,
28
31
  stateless: false
29
32
  });
33
+ /**
34
+ * Modify the value displayed in the multiple select list.
35
+ *
36
+ * @param {*} value Cell value.
37
+ * @param {object} meta The cell meta object.
38
+ * @returns {*} Returns the modified value.
39
+ */
40
+ _classPrivateMethodInitSpec(this, _onModifyDisplayedValue);
41
+ /**
42
+ * Trigger the `modifyFiltersMultiSelectValue` hook.
43
+ *
44
+ * @param {object} item Item from the multiple select list.
45
+ * @param {Map} metaMap Map of row meta objects.
46
+ */
47
+ _classPrivateMethodInitSpec(this, _triggerModifyMultipleSelectionValueHook);
30
48
  /**
31
49
  * Key down listener.
32
50
  *
@@ -51,6 +69,7 @@ export class ValueComponent extends BaseComponent {
51
69
  */
52
70
  registerHooks() {
53
71
  this.getMultipleSelectElement().addLocalHook('keydown', event => _classPrivateMethodGet(this, _onInputKeyDown, _onInputKeyDown2).call(this, event)).addLocalHook('listTabKeydown', event => this.runLocalHooks('listTabKeydown', event));
72
+ this.hot.addHook('modifyFiltersMultiSelectValue', (value, meta) => _classPrivateMethodGet(this, _onModifyDisplayedValue, _onModifyDisplayedValue2).call(this, value, meta));
54
73
  }
55
74
 
56
75
  /**
@@ -108,15 +127,19 @@ export class ValueComponent extends BaseComponent {
108
127
  const state = {};
109
128
  const defaultBlankCellValue = this.hot.getTranslatedPhrase(C.FILTERS_VALUES_BLANK_CELLS);
110
129
  if (firstByValueCondition) {
111
- const rowValues = unifyColumnValues(arrayMap(filteredRowsFactory(physicalColumn, conditionsStack), row => row.value));
130
+ const filteredRows = filteredRowsFactory(physicalColumn, conditionsStack);
131
+ const rowValues = arrayMap(filteredRows, row => row.value);
132
+ const rowMetaMap = new Map(filteredRows.map(row => [row.value, this.hot.getCellMeta(row.meta.visualRow, row.meta.visualCol)]));
133
+ const unifiedRowValues = unifyColumnValues(rowValues);
112
134
  if (conditionArgsChange) {
113
135
  firstByValueCondition.args[0] = conditionArgsChange;
114
136
  }
115
137
  const selectedValues = [];
116
- const itemsSnapshot = intersectValues(rowValues, firstByValueCondition.args[0], defaultBlankCellValue, item => {
138
+ const itemsSnapshot = intersectValues(unifiedRowValues, firstByValueCondition.args[0], defaultBlankCellValue, item => {
117
139
  if (item.checked) {
118
140
  selectedValues.push(item.value);
119
141
  }
142
+ _classPrivateMethodGet(this, _triggerModifyMultipleSelectionValueHook, _triggerModifyMultipleSelectionValueHook2).call(this, item, rowMetaMap);
120
143
  });
121
144
  const column = stateInfo.editedConditionStack.column;
122
145
  state.locale = this.hot.getCellMeta(0, column).locale;
@@ -177,8 +200,13 @@ export class ValueComponent extends BaseComponent {
177
200
  */
178
201
  reset() {
179
202
  const defaultBlankCellValue = this.hot.getTranslatedPhrase(C.FILTERS_VALUES_BLANK_CELLS);
180
- const values = unifyColumnValues(this._getColumnVisibleValues());
181
- const items = intersectValues(values, values, defaultBlankCellValue);
203
+ const rowEntries = this._getColumnVisibleValues();
204
+ const rowValues = rowEntries.map(entry => entry.value);
205
+ const rowMetaMap = new Map(rowEntries.map(row => [row.value, row.meta]));
206
+ const values = unifyColumnValues(rowValues);
207
+ const items = intersectValues(values, values, defaultBlankCellValue, item => {
208
+ _classPrivateMethodGet(this, _triggerModifyMultipleSelectionValueHook, _triggerModifyMultipleSelectionValueHook2).call(this, item, rowMetaMap);
209
+ });
182
210
  this.getMultipleSelectElement().setItems(items);
183
211
  super.reset();
184
212
  this.getMultipleSelectElement().setValue(values);
@@ -198,7 +226,12 @@ export class ValueComponent extends BaseComponent {
198
226
  if (selectedColumn === null) {
199
227
  return [];
200
228
  }
201
- return arrayMap(this.hot.getDataAtCol(selectedColumn.visualIndex), v => toEmptyString(v));
229
+ return arrayMap(this.hot.getDataAtCol(selectedColumn.visualIndex), (v, rowIndex) => {
230
+ return {
231
+ value: toEmptyString(v),
232
+ meta: this.hot.getCellMeta(selectedColumn.visualIndex, rowIndex)
233
+ };
234
+ });
202
235
  }
203
236
  }
204
237
  function _onInputKeyDown2(event) {
@@ -206,4 +239,17 @@ function _onInputKeyDown2(event) {
206
239
  this.runLocalHooks('cancel');
207
240
  stopImmediatePropagation(event);
208
241
  }
242
+ }
243
+ function _triggerModifyMultipleSelectionValueHook2(item, metaMap) {
244
+ if (this.hot.hasHook('modifyFiltersMultiSelectValue')) {
245
+ item.visualValue = this.hot.runHooks('modifyFiltersMultiSelectValue', item.visualValue, metaMap.get(item.value));
246
+ }
247
+ }
248
+ function _onModifyDisplayedValue2(value, meta) {
249
+ switch (meta.type) {
250
+ case 'numeric':
251
+ return getRenderedNumericValue(value, meta);
252
+ default:
253
+ return value;
254
+ }
209
255
  }
@@ -77,7 +77,7 @@ function toEmptyString(value) {
77
77
  }
78
78
 
79
79
  /**
80
- * Unify column values (replace `null` and `undefined` values into empty string, unique values and sort them).
80
+ * Unify column values (remove duplicated values and sort them).
81
81
  *
82
82
  * @param {Array} values An array of values.
83
83
  * @returns {Array}
@@ -68,7 +68,7 @@ export function toEmptyString(value) {
68
68
  }
69
69
 
70
70
  /**
71
- * Unify column values (replace `null` and `undefined` values into empty string, unique values and sort them).
71
+ * Unify column values (remove duplicated values and sort them).
72
72
  *
73
73
  * @param {Array} values An array of values.
74
74
  * @returns {Array}
@@ -3,4 +3,5 @@
3
3
  exports.__esModule = true;
4
4
  var _numericRenderer = require("./numericRenderer");
5
5
  exports.RENDERER_TYPE = _numericRenderer.RENDERER_TYPE;
6
- exports.numericRenderer = _numericRenderer.numericRenderer;
6
+ exports.numericRenderer = _numericRenderer.numericRenderer;
7
+ exports.getRenderedValue = _numericRenderer.getRenderedValue;
@@ -1 +1 @@
1
- export { RENDERER_TYPE, numericRenderer } from "./numericRenderer.mjs";
1
+ export { RENDERER_TYPE, numericRenderer, getRenderedValue } from "./numericRenderer.mjs";
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
+ exports.getRenderedValue = getRenderedValue;
4
5
  exports.numericRenderer = numericRenderer;
5
6
  require("core-js/modules/es.array.push.js");
6
7
  var _numbro = _interopRequireDefault(require("numbro"));
@@ -9,6 +10,31 @@ var _number = require("../../helpers/number");
9
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
11
  const RENDERER_TYPE = exports.RENDERER_TYPE = 'numeric';
11
12
 
13
+ /**
14
+ * Get the rendered value.
15
+ *
16
+ * @param {*} value Value to be rendered.
17
+ * @param {CellMeta} cellProperties Cell meta object.
18
+ * @returns {*} Returns the rendered value.
19
+ */
20
+ function getRenderedValue(value, cellProperties) {
21
+ if ((0, _number.isNumeric)(value)) {
22
+ const numericFormat = cellProperties.numericFormat;
23
+ const cellCulture = numericFormat && numericFormat.culture || '-';
24
+ const cellFormatPattern = numericFormat && numericFormat.pattern;
25
+ if (typeof cellCulture !== 'undefined' && !_numbro.default.languages()[cellCulture]) {
26
+ const shortTag = cellCulture.replace('-', '');
27
+ const langData = _numbro.default.allLanguages ? _numbro.default.allLanguages[cellCulture] : _numbro.default[shortTag];
28
+ if (langData) {
29
+ _numbro.default.registerLanguage(langData);
30
+ }
31
+ }
32
+ _numbro.default.setLanguage(cellCulture);
33
+ value = (0, _numbro.default)(value).format(cellFormatPattern || '0');
34
+ }
35
+ return value;
36
+ }
37
+
12
38
  /**
13
39
  * Numeric cell renderer.
14
40
  *
@@ -24,20 +50,9 @@ const RENDERER_TYPE = exports.RENDERER_TYPE = 'numeric';
24
50
  function numericRenderer(hotInstance, TD, row, col, prop, value, cellProperties) {
25
51
  let newValue = value;
26
52
  if ((0, _number.isNumeric)(newValue)) {
27
- const numericFormat = cellProperties.numericFormat;
28
- const cellCulture = numericFormat && numericFormat.culture || '-';
29
- const cellFormatPattern = numericFormat && numericFormat.pattern;
30
53
  const className = cellProperties.className || '';
31
54
  const classArr = className.length ? className.split(' ') : [];
32
- if (typeof cellCulture !== 'undefined' && !_numbro.default.languages()[cellCulture]) {
33
- const shortTag = cellCulture.replace('-', '');
34
- const langData = _numbro.default.allLanguages ? _numbro.default.allLanguages[cellCulture] : _numbro.default[shortTag];
35
- if (langData) {
36
- _numbro.default.registerLanguage(langData);
37
- }
38
- }
39
- _numbro.default.setLanguage(cellCulture);
40
- newValue = (0, _numbro.default)(newValue).format(cellFormatPattern || '0');
55
+ newValue = getRenderedValue(newValue, cellProperties);
41
56
  if (classArr.indexOf('htLeft') < 0 && classArr.indexOf('htCenter') < 0 && classArr.indexOf('htRight') < 0 && classArr.indexOf('htJustify') < 0) {
42
57
  classArr.push('htRight');
43
58
  }
@@ -4,6 +4,31 @@ import { textRenderer } from "../textRenderer/index.mjs";
4
4
  import { isNumeric } from "../../helpers/number.mjs";
5
5
  export const RENDERER_TYPE = 'numeric';
6
6
 
7
+ /**
8
+ * Get the rendered value.
9
+ *
10
+ * @param {*} value Value to be rendered.
11
+ * @param {CellMeta} cellProperties Cell meta object.
12
+ * @returns {*} Returns the rendered value.
13
+ */
14
+ export function getRenderedValue(value, cellProperties) {
15
+ if (isNumeric(value)) {
16
+ const numericFormat = cellProperties.numericFormat;
17
+ const cellCulture = numericFormat && numericFormat.culture || '-';
18
+ const cellFormatPattern = numericFormat && numericFormat.pattern;
19
+ if (typeof cellCulture !== 'undefined' && !numbro.languages()[cellCulture]) {
20
+ const shortTag = cellCulture.replace('-', '');
21
+ const langData = numbro.allLanguages ? numbro.allLanguages[cellCulture] : numbro[shortTag];
22
+ if (langData) {
23
+ numbro.registerLanguage(langData);
24
+ }
25
+ }
26
+ numbro.setLanguage(cellCulture);
27
+ value = numbro(value).format(cellFormatPattern || '0');
28
+ }
29
+ return value;
30
+ }
31
+
7
32
  /**
8
33
  * Numeric cell renderer.
9
34
  *
@@ -19,20 +44,9 @@ export const RENDERER_TYPE = 'numeric';
19
44
  export function numericRenderer(hotInstance, TD, row, col, prop, value, cellProperties) {
20
45
  let newValue = value;
21
46
  if (isNumeric(newValue)) {
22
- const numericFormat = cellProperties.numericFormat;
23
- const cellCulture = numericFormat && numericFormat.culture || '-';
24
- const cellFormatPattern = numericFormat && numericFormat.pattern;
25
47
  const className = cellProperties.className || '';
26
48
  const classArr = className.length ? className.split(' ') : [];
27
- if (typeof cellCulture !== 'undefined' && !numbro.languages()[cellCulture]) {
28
- const shortTag = cellCulture.replace('-', '');
29
- const langData = numbro.allLanguages ? numbro.allLanguages[cellCulture] : numbro[shortTag];
30
- if (langData) {
31
- numbro.registerLanguage(langData);
32
- }
33
- }
34
- numbro.setLanguage(cellCulture);
35
- newValue = numbro(newValue).format(cellFormatPattern || '0');
49
+ newValue = getRenderedValue(newValue, cellProperties);
36
50
  if (classArr.indexOf('htLeft') < 0 && classArr.indexOf('htCenter') < 0 && classArr.indexOf('htRight') < 0 && classArr.indexOf('htJustify') < 0) {
37
51
  classArr.push('htRight');
38
52
  }