@iyulab/flex-table 0.29.0 → 0.30.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.30.0] - 2026-08-28
4
+
5
+ ### Added
6
+
7
+ - **`buildSearchExpression` and `parseOrderBy` are now exported from
8
+ `./odata`.** Both were already implemented as pure, tested functions used
9
+ internally by `useODataSource`, but the public barrel only re-exported
10
+ the hook itself. A consumer needing the same `$search`/`$orderby`
11
+ encoding without the pagination hook (a typeahead, a standalone sort
12
+ control) had to reimplement the OData 4.0 search-quoting workaround
13
+ from scratch.
14
+
3
15
  ## [0.29.0] - 2026-08-28
4
16
 
5
17
  ### Added
package/README.md CHANGED
@@ -606,6 +606,16 @@ The hook returns:
606
606
 
607
607
  Terms are always quoted because OData 4.0 only allows letters in an unquoted `searchWord`, so `2026` or `ZT-E2E-A` would be rejected by servers that follow it (4.01 relaxed this, but [Microsoft.OData still lexes as 4.0](https://github.com/OData/odata.net/issues/2445)). Quoting keeps any term valid regardless of server version. Since a `$search` phrase cannot contain `"` and OData defines no escape for it, double quotes are stripped from the term.
608
608
 
609
+ The quoting/escaping logic above is also available standalone as `buildSearchExpression(term)`, for consumers that need the same `$search` encoding without the pagination hook (e.g. a typeahead/combobox that isn't a table). `parseOrderBy(orderBy)` (`'a asc, b desc'` → `SortCriteria[]`) is exported the same way, for consumers driving a sort UI that isn't `useODataSource` either:
610
+
611
+ ```ts
612
+ import { buildSearchExpression, parseOrderBy } from '@iyulab/flex-table/odata';
613
+
614
+ buildSearchExpression('red shirt'); // '"red" AND "shirt"'
615
+ buildSearchExpression(''); // undefined
616
+ parseOrderBy('name desc'); // [{ key: 'name', direction: 'desc' }]
617
+ ```
618
+
609
619
  ## Development
610
620
 
611
621
  ```bash
@@ -1,2 +1,2 @@
1
- export { useODataSource } from './use-odata-source.js';
1
+ export { useODataSource, buildSearchExpression, parseOrderBy } from './use-odata-source.js';
2
2
  export type { UseODataSourceOptions, UseODataSourceResult } from './types.js';
@@ -80,4 +80,4 @@ function s(e) {
80
80
  });
81
81
  }
82
82
  //#endregion
83
- export { o as useODataSource };
83
+ export { a as buildSearchExpression, s as parseOrderBy, o as useODataSource };
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iyulab/flex-table",
3
- "version": "0.29.0",
3
+ "version": "0.30.0",
4
4
  "description": "A minimalist, input-centric data grid web component",
5
5
  "type": "module",
6
6
  "main": "./dist/flex-table.js",