@adaptabletools/adaptable-cjs 20.0.4 → 20.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable-cjs",
3
- "version": "20.0.4",
3
+ "version": "20.0.5",
4
4
  "description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
5
5
  "keywords": [
6
6
  "web-components",
@@ -104,15 +104,43 @@ const ColumnFilterInput = ({ type, value, onChange: onChangeProp, onClear: onCle
104
104
  // autoFocus has to be FALSE because if the input receives focus in the init phase,
105
105
  // it may scroll the AG Grid header viewport into view and de-synchronize it (relative to the content viewport)
106
106
  autoFocus: false, value: liveValue ?? '', onKeyDown: onKeyDown, showClearButton: false, onChange: (e) => {
107
+ const prevValue = `${liveValue}`;
107
108
  const value = e.target.value;
108
109
  if (value) {
109
110
  if (type === 'number') {
110
111
  let numericValue = parseFloat(value);
112
+ let liveValue = numericValue;
111
113
  if (isNaN(numericValue)) {
112
114
  numericValue = null;
115
+ liveValue = null;
116
+ }
117
+ else {
118
+ const prevValueHasSeparator = prevValue.includes('.');
119
+ const newValueEndsWithSeparator = value.endsWith('.');
120
+ const newValueStartsWithSeparator = value.startsWith('.');
121
+ const newValueEndsWithZero = value.endsWith('0');
122
+ const separatorCount = (value.match(/[.,]/g) || []).length;
123
+ if (prevValueHasSeparator && separatorCount > 1) {
124
+ // not a valid number
125
+ return;
126
+ }
127
+ if (newValueEndsWithSeparator) {
128
+ const valueWithoutLastChar = value.slice(0, -1);
129
+ if (numericValue === parseFloat(valueWithoutLastChar)) {
130
+ liveValue = value;
131
+ }
132
+ }
133
+ if (newValueEndsWithZero) {
134
+ liveValue = value;
135
+ }
136
+ if (newValueStartsWithSeparator) {
137
+ if (numericValue === parseFloat('0' + value)) {
138
+ liveValue = value;
139
+ }
140
+ }
113
141
  }
114
142
  onChange(numericValue);
115
- setLiveValue(numericValue);
143
+ setLiveValue(liveValue);
116
144
  }
117
145
  else {
118
146
  onChange(value);
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const AdaptableColumnFilter_1 = require("../View/Components/ColumnFilter/AdaptableColumnFilter");
7
7
  const renderWithAdaptableContext_1 = require("../View/renderWithAdaptableContext");
8
+ const getAgGridFilterNotifyModelFn_1 = require("./getAgGridFilterNotifyModelFn");
8
9
  const FilterWrapperFactory = (adaptable) => {
9
10
  function isFilterActive(colId) {
10
11
  // we need this here
@@ -112,14 +113,15 @@ const FilterWrapperFactory = (adaptable) => {
112
113
  this.unmountReactRoot?.();
113
114
  const columnId = this.column.getColId();
114
115
  let column = adaptable.api.columnApi.getColumnWithColumnId(columnId);
115
- // for whatever reason, it works without this
116
- // const notifyModel = getNotifyModel(colId, this.params.filterChangedCallback);
116
+ function getNotifyModel(colId, onModelChange) {
117
+ return (0, getAgGridFilterNotifyModelFn_1.getAgGridFilterNotifyModelFn)(adaptable.api, colId, onModelChange);
118
+ }
119
+ const notifyModel = getNotifyModel(columnId, this.params.filterChangedCallback);
117
120
  if (column) {
118
121
  this.unmountReactRoot = adaptable.renderReactRoot((0, renderWithAdaptableContext_1.renderWithAdaptableContext)(React.createElement(AdaptableColumnFilter_1.AdaptableColumnFilter, {
119
122
  columnId,
120
123
  wrapperProps: { p: 2 },
121
- // for whatever reason, it works without this
122
- // onChange: notifyModel,
124
+ onChange: notifyModel,
123
125
  }), adaptable),
124
126
  // AdaptableColumnFilter(filterProps),
125
127
  this.filterContainer);
package/src/env.js CHANGED
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
4
  NEXT_PUBLIC_INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
5
- PUBLISH_TIMESTAMP: 1744726373908 || Date.now(),
6
- VERSION: "20.0.4" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1744964832292 || Date.now(),
6
+ VERSION: "20.0.5" || '--current-version--',
7
7
  };