@vuu-ui/vuu-data-local 3.2.0 → 3.3.0

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,5 +1,5 @@
1
1
  {
2
- "version": "3.2.0",
2
+ "version": "3.3.0",
3
3
  "main": "./src/index.js",
4
4
  "author": "heswell",
5
5
  "license": "Apache-2.0",
@@ -10,14 +10,14 @@
10
10
  "type-defs": "node ../../scripts/build-type-defs.mjs"
11
11
  },
12
12
  "devDependencies": {
13
- "@vuu-ui/vuu-data-types": "3.2.0",
14
- "@vuu-ui/vuu-table-types": "3.2.0",
15
- "@vuu-ui/vuu-filter-types": "3.2.0",
16
- "@vuu-ui/vuu-protocol-types": "3.2.0"
13
+ "@vuu-ui/vuu-data-types": "3.3.0",
14
+ "@vuu-ui/vuu-table-types": "3.3.0",
15
+ "@vuu-ui/vuu-filter-types": "3.3.0",
16
+ "@vuu-ui/vuu-protocol-types": "3.3.0"
17
17
  },
18
18
  "dependencies": {
19
- "@vuu-ui/vuu-filter-parser": "3.2.0",
20
- "@vuu-ui/vuu-utils": "3.2.0"
19
+ "@vuu-ui/vuu-filter-parser": "3.3.0",
20
+ "@vuu-ui/vuu-utils": "3.3.0"
21
21
  },
22
22
  "sideEffects": false,
23
23
  "files": [
@@ -317,7 +317,15 @@ class ArrayDataSource extends EventEmitter {
317
317
  }
318
318
  getFilterPredicate() {
319
319
  const { filterSpec: { filterStruct } } = combineFilters(this._config);
320
- if (filterStruct) return filterPredicate(this.#columnMap, filterStruct);
320
+ if (filterStruct) {
321
+ if (this.dataMap) {
322
+ const { count: offset } = metadataKeys;
323
+ const actualColumnMap = {};
324
+ for (const [col, idx] of Object.entries(this.dataMap))actualColumnMap[col] = offset + idx;
325
+ return filterPredicate(actualColumnMap, filterStruct);
326
+ }
327
+ return filterPredicate(this.#columnMap, filterStruct);
328
+ }
321
329
  throw Error("filter must include filterStruct");
322
330
  }
323
331
  applyConfig(config, preserveExistingConfigAttributes = false) {