@iyulab/flex-table 0.63.0 → 0.64.1

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,28 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.64.1] - 2026-10-08
4
+
5
+ ### Fixed
6
+
7
+ - **CSV/TSV write dates as the wall clock the table shows.** A `date`/`datetime` column's value — a `Date`, or an ISO
8
+ string as JSON sources (OData) send it — was written raw or as `toISOString()`: UTC, so outside UTC the time in the
9
+ file differed from the screen (9 hours in Korea), a local-midnight `Date` in a `date` column became the day before,
10
+ and Excel did not read `…T…Z` as a date. It is now `YYYY-MM-DD` in a `date` column and `YYYY-MM-DD HH:mm:ss`
11
+ otherwise — the value an XLSX export already puts in its date cell. A string that does not read as a date stays as
12
+ it is; JSON is unchanged.
13
+ - **A copied range writes dates the same way** — not the UTC string or `Date#toString()` — so it pastes into a
14
+ spreadsheet as a date and back into the table as the same local time.
15
+
16
+ ## [0.64.0] - 2026-10-08
17
+
18
+ ### Added
19
+
20
+ - **`useODataSource` and `useArraySource` return `source`** — the source the hook binds, the same object every render.
21
+ A React screen hands it to a list skeleton that binds its views itself (`<ListPage source={orders.source}>`,
22
+ `bindSource(orders.source, el)`) and keeps its options as props, instead of building the source with `useMemo`,
23
+ reading it with `useSyncExternalStore` and calling `update` from an effect. `useArraySource`'s `source` reads the
24
+ hook's state and notifies its subscribers after each commit.
25
+
3
26
  ## [0.63.0] - 2026-10-08
4
27
 
5
28
  ### Added
package/README.md CHANGED
@@ -316,7 +316,9 @@ What goes into the file:
316
316
  status code shown as a label: `{ key: 'status', render: …, exportValue: (v) => statusLabel(v) }`.
317
317
  - **Dates**: in XLSX a `date`/`datetime` column is a date cell — a `Date`, or an ISO string as JSON sources (OData) send
318
318
  it (`YYYY-MM-DD` is that day; a full ISO string is read with its offset), the same rule the cells display with. The
319
- cell holds the wall-clock time the table shows. A string that does not read as a date stays text.
319
+ cell holds the wall-clock time the table shows. In CSV/TSV (and a copied range) the same date is wall-clock text —
320
+ `YYYY-MM-DD` in a `date` column, `YYYY-MM-DD HH:mm:ss` otherwise — which spreadsheets read as a date. JSON keeps
321
+ `Date` values as ISO instants. A string that does not read as a date stays text.
320
322
  - **BOM**: `{ bom: true }` starts CSV/TSV with a UTF-8 byte order mark so Excel on a non-UTF-8 system code page reads
321
323
  non-ASCII text correctly — the default for `exportToFile`, off for `exportToString`/`exportToBlob`.
322
324
 
@@ -911,6 +913,7 @@ The hook returns:
911
913
  | `search` / `setSearch` | Current search term and its setter (resets to page 0) |
912
914
  | `refresh` | Re-run the current request |
913
915
  | `fetchAll` | The whole result of the current conditions — the source's `fetchAll` (below), for exporting what the list shows |
916
+ | `source` | The source the hook binds (the same object every render) — hand it to a list skeleton that binds views itself: `<ListPage source={orders.source}>` (`@iyulab/enterprise/react`) or `bindSource(orders.source, element)`. `useArraySource` returns one too, over its own state |
914
917
 
915
918
  #### Search semantics
916
919
 
@@ -1,6 +1,7 @@
1
1
  import type { SortCriteria } from '../core/sorting.js';
2
2
  import type { SourceError } from '../core/source-error.js';
3
3
  import type { FetchAllOptions } from '../core/fetch-all.js';
4
+ import type { ArraySource } from './source.js';
4
5
  export interface UseArraySourceOptions<T> {
5
6
  /** 페이지당 행 수. `useODataSource`와 동일 기본값. */
6
7
  pageSize?: number;
@@ -30,7 +31,11 @@ export interface UseArraySourceOptions<T> {
30
31
  */
31
32
  searchFields?: (row: T) => Array<string | number | boolean | null | undefined>;
32
33
  }
34
+ /** `useArraySource` 의 `source` — 목록 골격(`ListPage` · `bindSource`)에 넘기는 소스. 이 훅의 상태를 읽고 조작은 훅으로 간다. */
35
+ export type HookArraySource<T> = Omit<ArraySource<T>, 'update'>;
33
36
  export interface UseArraySourceResult<T> {
37
+ /** 이 훅의 상태를 소스 모양으로 — `<ListPage source={orders.source}>` · `bindSource(orders.source, el)`. 늘 같은 객체다. */
38
+ source: HookArraySource<T>;
34
39
  /** 현재 페이지의 행(검색+정렬 적용 후 slice). */
35
40
  data: T[];
36
41
  /** 검색+정렬 적용 후, 페이지 나누기 전의 총 건수(`useODataSource`의 `@odata.count`와 동일 의미). */
@@ -2,7 +2,8 @@ import type { CellRange } from '../core/selection.js';
2
2
  import type { ColumnDefinition, DataRow } from '../models/types.js';
3
3
  /**
4
4
  * Copy selected range to clipboard as TSV — the spreadsheet clipboard format (see `encodeTsv`):
5
- * a cell containing a tab, a line break or a quote is quoted, so it pastes into Excel as one cell.
5
+ * a cell containing a tab, a line break or a quote is quoted, so it pastes into Excel as one cell. A date is its
6
+ * wall-clock text (as in a CSV export), which a spreadsheet reads as a date and a paste here reads back.
6
7
  */
7
8
  export declare function copyToClipboard(data: DataRow[], columns: ColumnDefinition[], range: CellRange): string;
8
9
  export declare function parseValueForColumn(raw: string, col: ColumnDefinition): unknown;
@@ -15,3 +15,9 @@ export declare function exportDate(value: unknown, col: ColumnDefinition): Date
15
15
  * 세면 로컬 자정의 날짜가 UTC 와 다른 시간대(한국 +09)에서 전날 오후로 들어가 날짜 서식에 전날이 보였다.
16
16
  */
17
17
  export declare function excelSerial(d: Date): number;
18
+ /**
19
+ * 글자 형식(CSV·TSV)의 날짜 — **벽시계 글자**다(표가 보여 주는 로컬 날짜·시각, XLSX 의 날짜 셀과 같은 값). `date` 열은
20
+ * `YYYY-MM-DD`, 그 밖은 `YYYY-MM-DD HH:mm:ss` — 스프레드시트가 날짜로 읽는 모양이다. ISO(`toISOString`)는 UTC 라 UTC 가
21
+ * 아닌 시간대에서 시각이 화면과 달랐고, 로컬 자정의 날짜는 전날이 됐다.
22
+ */
23
+ export declare function exportDateText(d: Date, col: ColumnDefinition): string;