@ishibashi0112/spreadsheet-grid-core 1.5.1 → 1.7.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/dist/controllers/columnHeaderDragController.cjs +1 -1
- package/dist/controllers/columnHeaderDragController.d.ts +11 -0
- package/dist/controllers/columnHeaderDragController.js +259 -210
- package/dist/controllers/editController.cjs +1 -1
- package/dist/controllers/editController.d.ts +3 -2
- package/dist/controllers/editController.js +171 -152
- package/dist/controllers/pointerInteractionsController.cjs +1 -1
- package/dist/controllers/pointerInteractionsController.d.ts +1 -0
- package/dist/controllers/pointerInteractionsController.js +85 -38
- package/dist/controllers/searchSelectEditorController.cjs +1 -0
- package/dist/controllers/searchSelectEditorController.d.ts +48 -0
- package/dist/controllers/searchSelectEditorController.js +188 -0
- package/dist/engine/columnCommands.cjs +1 -1
- package/dist/engine/columnCommands.d.ts +4 -0
- package/dist/engine/columnCommands.js +47 -16
- package/dist/engine/columnLayout.cjs +1 -1
- package/dist/engine/columnLayout.d.ts +7 -1
- package/dist/engine/columnLayout.js +25 -22
- package/dist/engine/createGridEngine.cjs +1 -1
- package/dist/engine/createGridEngine.d.ts +2 -1
- package/dist/engine/createGridEngine.js +46 -36
- package/dist/engine/exportCommands.cjs +2 -2
- package/dist/engine/exportCommands.js +50 -38
- package/dist/engine/gridApi.cjs +2 -1
- package/dist/engine/gridApi.d.ts +2 -0
- package/dist/engine/gridApi.js +17 -7
- package/dist/engine/notifiers.cjs +1 -1
- package/dist/engine/notifiers.d.ts +13 -1
- package/dist/engine/notifiers.js +39 -19
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/locales/en.cjs +1 -1
- package/dist/locales/en.js +8 -0
- package/dist/logic/columnGroupCells.cjs +1 -0
- package/dist/logic/columnGroupCells.d.ts +54 -0
- package/dist/logic/columnGroupCells.js +53 -0
- package/dist/logic/columnGroups.cjs +1 -0
- package/dist/logic/columnGroups.d.ts +46 -0
- package/dist/logic/columnGroups.js +335 -0
- package/dist/logic/domGuards.cjs +1 -1
- package/dist/logic/domGuards.d.ts +1 -1
- package/dist/logic/domGuards.js +5 -5
- package/dist/logic/exportCsv.cjs +2 -2
- package/dist/logic/exportCsv.d.ts +2 -1
- package/dist/logic/exportCsv.js +16 -13
- package/dist/logic/fillHandle.cjs +1 -1
- package/dist/logic/fillHandle.js +54 -51
- package/dist/logic/gridState.cjs +1 -1
- package/dist/logic/gridState.d.ts +8 -1
- package/dist/logic/gridState.js +14 -8
- package/dist/logic/imeInput.cjs +1 -1
- package/dist/logic/imeInput.js +14 -13
- package/dist/logic/localeTextFeatures.cjs +1 -1
- package/dist/logic/localeTextFeatures.d.ts +10 -0
- package/dist/logic/localeTextFeatures.js +14 -6
- package/dist/logic/localeTextPopups.cjs +1 -1
- package/dist/logic/localeTextPopups.d.ts +2 -0
- package/dist/logic/localeTextPopups.js +2 -0
- package/dist/logic/selectEditorState.cjs +1 -1
- package/dist/logic/selectEditorState.d.ts +16 -1
- package/dist/logic/selectEditorState.js +30 -21
- package/dist/logic/selectFillRow.cjs +1 -0
- package/dist/logic/selectFillRow.d.ts +4 -0
- package/dist/logic/selectFillRow.js +25 -0
- package/dist/logic/selectLabels.cjs +1 -1
- package/dist/logic/selectLabels.js +25 -22
- package/dist/logic/selectSearch.cjs +1 -0
- package/dist/logic/selectSearch.d.ts +27 -0
- package/dist/logic/selectSearch.js +102 -0
- package/dist/model/gridActions.cjs +1 -1
- package/dist/model/gridActions.d.ts +10 -0
- package/dist/model/gridActions.js +9 -0
- package/dist/model/gridReducer.cjs +1 -1
- package/dist/model/gridReducer.js +29 -2
- package/dist/model/gridTypes.core.d.ts +218 -6
- package/dist/model/gridTypes.unbound.d.ts +3 -0
- package/dist/utils/editorVisibleBounds.cjs +1 -1
- package/dist/utils/editorVisibleBounds.d.ts +4 -0
- package/dist/utils/editorVisibleBounds.js +12 -2
- package/dist/utils/overflowTitle.cjs +1 -0
- package/dist/utils/overflowTitle.d.ts +1 -0
- package/dist/utils/overflowTitle.js +7 -0
- package/package.json +1 -1
|
@@ -519,6 +519,94 @@ export type HeaderRenderContext<T, F extends GridFrameworkTypes = GridFrameworkT
|
|
|
519
519
|
filterValue?: unknown;
|
|
520
520
|
isFiltered?: boolean | undefined;
|
|
521
521
|
};
|
|
522
|
+
/**
|
|
523
|
+
* 開閉できるグループの、閉じたときに残す列(`collapsible` のオブジェクトの形)。
|
|
524
|
+
*/
|
|
525
|
+
export type GridColumnGroupCollapsible = {
|
|
526
|
+
/**
|
|
527
|
+
* 閉じても残す列の key(このグループの中の列)。書かなければ、今の並びで先頭の 1 列を残す。残す列がどれも
|
|
528
|
+
* 表示されていないときも先頭の 1 列を残す(グループの見出しを消さない = 開き直せるように)。
|
|
529
|
+
*/
|
|
530
|
+
keep?: readonly string[] | undefined;
|
|
531
|
+
};
|
|
532
|
+
/** グループの見出しの `renderHeader` へ渡る文脈。 */
|
|
533
|
+
export type ColumnGroupHeaderRenderContext<F extends GridFrameworkTypes = GridFrameworkTypes> = {
|
|
534
|
+
/** 定義のグループ。 */
|
|
535
|
+
group: GridColumnGroup<F>;
|
|
536
|
+
/** 開いているか(開閉できないグループはいつも `true`)。 */
|
|
537
|
+
open: boolean;
|
|
538
|
+
/** 開閉できるグループか(`collapsible`)。 */
|
|
539
|
+
collapsible: boolean;
|
|
540
|
+
/** このグループの見出しのセルの幅(px。固定の境目で分かれたときはその部分の幅)。 */
|
|
541
|
+
width: number;
|
|
542
|
+
};
|
|
543
|
+
/**
|
|
544
|
+
* 列見出しの上に重ねるグループ(`columnGroups` prop の要素)。各フィールドの説明は JSDoc と同梱の
|
|
545
|
+
* `API_REFERENCE.md` の「列のグループ(多段の列見出し)」節。
|
|
546
|
+
*/
|
|
547
|
+
export type GridColumnGroup<F extends GridFrameworkTypes = GridFrameworkTypes> = {
|
|
548
|
+
/**
|
|
549
|
+
* グループのキー。グループどうしで重ならない文字列(列のキーと同じでもよい)。
|
|
550
|
+
* 開閉の状態(`closedColumnGroups`)・`setColumnGroupOpen`・エクスポートの `columnGroups` で使う。
|
|
551
|
+
*/
|
|
552
|
+
key: string;
|
|
553
|
+
/** 見出しに出す名前。 */
|
|
554
|
+
title: string;
|
|
555
|
+
/**
|
|
556
|
+
* 中の列(`columns` の列の `key`)と入れ子のグループ。見出しの並びは `columns` の並びで、`children`
|
|
557
|
+
* の順は使わない。同じ列を 2 つのグループに入れたときと、同じ `key` のグループが 2
|
|
558
|
+
* つあるときは先に書いた方を使う(開発時に警告)。`columns` に無いキーは無視する(開発時に警告)。
|
|
559
|
+
* 中に列が 1 つも無いグループは出さない。
|
|
560
|
+
*/
|
|
561
|
+
children: readonly (string | GridColumnGroup<F>)[];
|
|
562
|
+
/**
|
|
563
|
+
* 開閉できるグループにする。見出しに開閉のボタンを出し、閉じると `keep` に書いた列(書かない /
|
|
564
|
+
* どれも表示していないときは、画面の並びで表示している列の先頭。
|
|
565
|
+
* 行のグループ化の間はグループ元の列を除く)だけを見せる。外のグループを閉じたときは、
|
|
566
|
+
* 外のグループの `keep` だけで決める(中のグループの開閉は、開いたときに戻る)。
|
|
567
|
+
* 閉じても隠す列が無いグループ(列が 1 つ / `keep` がすべての列)は、
|
|
568
|
+
* 開閉できないグループと同じに扱う(ボタンを出さない)。
|
|
569
|
+
*
|
|
570
|
+
* @defaultValue `false`
|
|
571
|
+
*/
|
|
572
|
+
collapsible?: boolean | GridColumnGroupCollapsible | undefined;
|
|
573
|
+
/**
|
|
574
|
+
* 名前の寄せ。`'left'` は横にスクロールしても名前を見えている所の左に留め、`'right'`
|
|
575
|
+
* は右に留める。`'center'` はグループの幅の真ん中(留めない)。
|
|
576
|
+
*
|
|
577
|
+
* @defaultValue `'left'`
|
|
578
|
+
*/
|
|
579
|
+
headerAlign?: 'left' | 'center' | 'right' | undefined;
|
|
580
|
+
/** グループの見出しのセルに足す class。 */
|
|
581
|
+
className?: string | undefined;
|
|
582
|
+
/**
|
|
583
|
+
* 名前の代わりに描くもの。`ctx = { group, open, collapsible, width }`(`group` はこの定義、`width`
|
|
584
|
+
* はそのペインの中のグループの幅)。開閉のボタンと掴み手はグリッドが描く。
|
|
585
|
+
* 中身はセルの幅で切る(はみ出さない。文字の省略(…)は中身の側で)。
|
|
586
|
+
* 中のボタンや入力欄を押しても列は選ばない(列の `renderHeader` と同じ)。
|
|
587
|
+
* 横にスクロールしてグループが画面の外へ出たときと `columnGroups` を変えたときは描き直すので、
|
|
588
|
+
* 中の部品の状態は外に持つ。
|
|
589
|
+
*/
|
|
590
|
+
renderHeader?: ((ctx: ColumnGroupHeaderRenderContext<F>) => F['node']) | undefined;
|
|
591
|
+
};
|
|
592
|
+
/** `onColumnGroupOpenChange` の引数。 */
|
|
593
|
+
export type ColumnGroupOpenChangeParams = {
|
|
594
|
+
/** 開閉したグループの key。 */
|
|
595
|
+
groupKey: string;
|
|
596
|
+
/** 開いたら `true`。 */
|
|
597
|
+
open: boolean;
|
|
598
|
+
/** 開閉の後に閉じているグループの key(`GridState.closedColumnGroups` と同じ)。 */
|
|
599
|
+
closedGroups: string[];
|
|
600
|
+
};
|
|
601
|
+
/** `getExportData({ includeColumnGroups: true })` の段の 1 つのグループ。 */
|
|
602
|
+
export type GridExportColumnGroup = {
|
|
603
|
+
key: string;
|
|
604
|
+
title: string;
|
|
605
|
+
/** `columns` の中で最初の列の位置(0 から)。 */
|
|
606
|
+
start: number;
|
|
607
|
+
/** 何列ぶんか(1 以上)。 */
|
|
608
|
+
span: number;
|
|
609
|
+
};
|
|
522
610
|
export type GridColumnPinned = 'left' | 'right';
|
|
523
611
|
export type CellValueFormatterParams<T, F extends GridFrameworkTypes = GridFrameworkTypes> = {
|
|
524
612
|
value: unknown;
|
|
@@ -529,7 +617,32 @@ export type CellValueFormatter<T, F extends GridFrameworkTypes = GridFrameworkTy
|
|
|
529
617
|
export type EditorCommitDirection = 'down' | 'up' | 'right' | 'left';
|
|
530
618
|
export type EditorEnterMove = 'down' | 'up' | 'right' | 'left' | 'none';
|
|
531
619
|
export type GridTextEditorEnterKey = 'commit' | 'newline';
|
|
532
|
-
export type GridSelectEditorOption = GridSelectFilterOption
|
|
620
|
+
export type GridSelectEditorOption = GridSelectFilterOption & {
|
|
621
|
+
/**
|
|
622
|
+
* 検索できる選択エディタ(`search`)の一覧で、名前の右に薄く出す補足(コードなど。1.7.0 から)。検索の対象にもなる。
|
|
623
|
+
*/
|
|
624
|
+
description?: string | undefined;
|
|
625
|
+
/**
|
|
626
|
+
* 表示しないが検索の対象にする文字(読みがな・別名など。1.7.0 から)。`search` の列で、打った文字がこれに含まれる
|
|
627
|
+
* 候補も出る。
|
|
628
|
+
*/
|
|
629
|
+
searchText?: string | undefined;
|
|
630
|
+
/**
|
|
631
|
+
* 候補に添える付属の値(単価など。1.7.0 から)。グリッドは読まず、`fillRow` の `option.data` でそのまま受け取れる。
|
|
632
|
+
*/
|
|
633
|
+
data?: unknown;
|
|
634
|
+
};
|
|
635
|
+
export type GridSelectLoadOptionsParams<T, F extends GridFrameworkTypes = GridFrameworkTypes> = {
|
|
636
|
+
query: string;
|
|
637
|
+
row: T;
|
|
638
|
+
rowKey: GridRowKey;
|
|
639
|
+
column: GridColumn<T, F>;
|
|
640
|
+
signal: AbortSignal;
|
|
641
|
+
};
|
|
642
|
+
export type GridSelectFillRowContext<T> = {
|
|
643
|
+
row: T;
|
|
644
|
+
rowKey: GridRowKey;
|
|
645
|
+
};
|
|
533
646
|
export type GridColumnEditor<T, F extends GridFrameworkTypes = GridFrameworkTypes> = {
|
|
534
647
|
type: 'text';
|
|
535
648
|
multiline?: boolean | undefined;
|
|
@@ -558,6 +671,36 @@ export type GridColumnEditor<T, F extends GridFrameworkTypes = GridFrameworkType
|
|
|
558
671
|
* @defaultValue `'value'`
|
|
559
672
|
*/
|
|
560
673
|
clipboard?: 'value' | 'label' | undefined;
|
|
674
|
+
/**
|
|
675
|
+
* `true` で、セルの入力欄に打った文字で候補を絞り込む(1.7.0 から)。探し方は部分一致で、`label` / `description` /
|
|
676
|
+
* `searchText` / `value` を見る(全角と半角、大文字と小文字、ひらがなとカタカナ、空白は区別しない)。先頭が一致する候補が
|
|
677
|
+
* 上、途中が一致する候補がその下。`loadOptions` か `allowFreeText` を書けば省略しても検索になる(`false` を書けば止まる)。
|
|
678
|
+
* `/lite` では `selectSearch` の機能が要る(無ければ今までの select のまま)。
|
|
679
|
+
*
|
|
680
|
+
* @defaultValue `false`
|
|
681
|
+
*/
|
|
682
|
+
search?: boolean | undefined;
|
|
683
|
+
/**
|
|
684
|
+
* `true` で、候補に無い文字も入れられる(1.7.0 から)。`Enter` / `Tab` / フォーカスが外れたときに、ハイライトした候補が
|
|
685
|
+
* 無ければ打った文字を列のパーサへ通して書く(打った文字が候補の `label` と同じならその候補を選んだのと同じ)。
|
|
686
|
+
*
|
|
687
|
+
* @defaultValue `false`
|
|
688
|
+
*/
|
|
689
|
+
allowFreeText?: boolean | undefined;
|
|
690
|
+
/**
|
|
691
|
+
* 候補をサーバーなどから取る(1.7.0 から)。開いたときに 1 回、その後は打つたびに約 200ms 待ってから
|
|
692
|
+
* `{ query, row, rowKey, column, signal }` で呼ぶ(前の要求は `signal` で中断し、古い応答は捨てる。キャッシュはしない)。
|
|
693
|
+
* あるとき一覧はこの結果で、`options` は今の値の名前を引くため(と `clipboard: 'label'`)にだけ使う(空の配列でよい)。
|
|
694
|
+
*/
|
|
695
|
+
loadOptions?: ((params: GridSelectLoadOptionsParams<T, F>) => Promise<readonly GridSelectEditorOption[]>) | undefined;
|
|
696
|
+
/**
|
|
697
|
+
* 候補を選んだとき、ほかの項目も同じ 1 回の編集で書く(1.7.0 から)。返した項目を行へそのまま重ねる(列の `setValue` は
|
|
698
|
+
* 通さない。この列の項目は選んだ値が勝つ)。`onRowsChange` は 1 回(serverSide は `updateRows` 1 回)・元に戻すも 1 回。
|
|
699
|
+
* 読み取り専用の列の項目も書く。`validationMode: 'reject'` の列で通らない値の項目は書かない。値が変わらない確定・
|
|
700
|
+
* 候補の名前と違う打った文字の確定(`allowFreeText`。名前と同じ文字は候補を選んだのと同じで呼ぶ)・貼り付け・フィルでは
|
|
701
|
+
* 呼ばない。検索の無い select の列でも使える。
|
|
702
|
+
*/
|
|
703
|
+
fillRow?: ((option: GridSelectEditorOption, context: GridSelectFillRowContext<T>) => Partial<T>) | undefined;
|
|
561
704
|
} | {
|
|
562
705
|
type: 'date';
|
|
563
706
|
/**
|
|
@@ -999,6 +1142,7 @@ export type ColumnResizeDragState = {
|
|
|
999
1142
|
startWidth: number;
|
|
1000
1143
|
minWidth: number;
|
|
1001
1144
|
maxWidth: number;
|
|
1145
|
+
resolveWidths?: ((nextTotal: number) => Record<string, number>) | undefined;
|
|
1002
1146
|
};
|
|
1003
1147
|
export type CellSelectionDragState = {
|
|
1004
1148
|
type: 'selection';
|
|
@@ -1026,6 +1170,7 @@ export type GridUiState = {
|
|
|
1026
1170
|
sort: GridSortState;
|
|
1027
1171
|
collapsedGroupKeys: ReadonlySet<string>;
|
|
1028
1172
|
expandedDetailRowKeys: ReadonlySet<GridRowKey>;
|
|
1173
|
+
closedColumnGroupKeys?: ReadonlySet<string> | undefined;
|
|
1029
1174
|
};
|
|
1030
1175
|
export type SpreadsheetGridSelectionStats = {
|
|
1031
1176
|
selectedCellCount: number;
|
|
@@ -1283,6 +1428,12 @@ export type GridLocaleText = {
|
|
|
1283
1428
|
columnsReorderWhileSearching: string;
|
|
1284
1429
|
/** グループ化している列のツールチップ。既定 `グループ化している列です(値は自動グループ列に出ます)`、英語 `This column is grouped. Its values appear in the group column.`。 */
|
|
1285
1430
|
columnsGroupedHint: string;
|
|
1431
|
+
/** 列のタブの列のグループ(`columnGroups`)の見出しのツールチップ。既定 `{group} の列をまとめて表示 / 非表示`、英語 `Show or hide the columns in {group}`。 */
|
|
1432
|
+
columnsToggleGroup: GridLocaleTextTemplate<{
|
|
1433
|
+
group: string;
|
|
1434
|
+
}>;
|
|
1435
|
+
/** 列のタブのグループに入っている列のつまみのツールチップ。既定 `ドラッグして並べ替え(同じグループ内のみ)`、英語 `Drag to reorder (within the same group)`。 */
|
|
1436
|
+
columnsDragWithinGroup: string;
|
|
1286
1437
|
/** グループ化している列の名前(列のタブ、フィルターを足す列の一覧)。既定 `{column}(グループ化中)`、英語 `{column} (grouped)`。 */
|
|
1287
1438
|
groupedColumnTitle: GridLocaleTextTemplate<{
|
|
1288
1439
|
column: string;
|
|
@@ -1682,6 +1833,24 @@ export type GridLocaleText = {
|
|
|
1682
1833
|
pinnedBottomRow: GridLocaleTextTemplate<{
|
|
1683
1834
|
row: number;
|
|
1684
1835
|
}>;
|
|
1836
|
+
/** 列のグループ(`columnGroups`)の閉じた見出しの開くボタンの読み上げの名前。既定 `{group} を開く`、英語 `Expand {group}`。 */
|
|
1837
|
+
expandColumnGroup: GridLocaleTextTemplate<{
|
|
1838
|
+
group: string;
|
|
1839
|
+
}>;
|
|
1840
|
+
/** 同上の開いた見出しの閉じるボタン。既定 `{group} を閉じる`、英語 `Collapse {group}`。 */
|
|
1841
|
+
collapseColumnGroup: GridLocaleTextTemplate<{
|
|
1842
|
+
group: string;
|
|
1843
|
+
}>;
|
|
1844
|
+
/** 列のグループの見出しの掴み手(グループごと動かす)。既定 `ドラッグで {group} を移動`、英語 `Drag to move {group}`。 */
|
|
1845
|
+
dragColumnGroup: GridLocaleTextTemplate<{
|
|
1846
|
+
group: string;
|
|
1847
|
+
}>;
|
|
1848
|
+
/** 検索できる選択エディタ(select の `search`)の一覧で、`loadOptions` の候補を取っている間。既定 `候補を取得中…`、英語 `Loading options…`。 */
|
|
1849
|
+
selectSearchLoading: string;
|
|
1850
|
+
/** 同上の取得に失敗したとき(「再試行」のボタンは `retry`)。既定 `候補の取得に失敗しました`、英語 `Couldn't load the options`。 */
|
|
1851
|
+
selectSearchFailed: string;
|
|
1852
|
+
/** 同上で、打った文字に当たる候補が無いとき。既定 `一致する候補がありません`、英語 `No matching options`。 */
|
|
1853
|
+
selectSearchNoMatch: string;
|
|
1685
1854
|
/** 右クリックメニュー(`enableContextMenu`)をセルで開いたときの読み上げの名前。既定 `セルのメニュー`、英語 `Cell menu`。 */
|
|
1686
1855
|
contextMenuCell: string;
|
|
1687
1856
|
/** 同上(行番号で開いたとき)。既定 `行のメニュー`、英語 `Row menu`。 */
|
|
@@ -2016,6 +2185,7 @@ export type CsvExportOptions = {
|
|
|
2016
2185
|
includeTotalRow?: boolean | undefined;
|
|
2017
2186
|
includePinnedRows?: boolean | undefined;
|
|
2018
2187
|
includeGroupRows?: boolean | undefined;
|
|
2188
|
+
includeColumnGroups?: boolean | undefined;
|
|
2019
2189
|
};
|
|
2020
2190
|
export type GridExportOptions = {
|
|
2021
2191
|
scope?: CsvExportScope | undefined;
|
|
@@ -2023,6 +2193,7 @@ export type GridExportOptions = {
|
|
|
2023
2193
|
includeTotalRow?: boolean | undefined;
|
|
2024
2194
|
includePinnedRows?: boolean | undefined;
|
|
2025
2195
|
includeGroupRows?: boolean | undefined;
|
|
2196
|
+
includeColumnGroups?: boolean | undefined;
|
|
2026
2197
|
};
|
|
2027
2198
|
export type GridExportCell = {
|
|
2028
2199
|
value: unknown;
|
|
@@ -2035,6 +2206,7 @@ export type GridExportData = {
|
|
|
2035
2206
|
}[];
|
|
2036
2207
|
rows: GridExportCell[][];
|
|
2037
2208
|
rowKinds?: Array<'data' | 'label' | 'total' | 'group' | 'pinned'> | undefined;
|
|
2209
|
+
columnGroups?: GridExportColumnGroup[][] | undefined;
|
|
2038
2210
|
};
|
|
2039
2211
|
export type GridColumnState = {
|
|
2040
2212
|
key: string;
|
|
@@ -2049,6 +2221,7 @@ export type GridState = {
|
|
|
2049
2221
|
sort: GridSortState;
|
|
2050
2222
|
columns?: GridColumnState[] | undefined;
|
|
2051
2223
|
collapsedGroups?: string[] | undefined;
|
|
2224
|
+
closedColumnGroups?: string[] | undefined;
|
|
2052
2225
|
};
|
|
2053
2226
|
/**
|
|
2054
2227
|
* `applyState` に渡す状態。`getState()` の値をそのまま渡せる。渡したスライスだけを変え、省略した(`undefined` の)
|
|
@@ -2061,6 +2234,7 @@ export type GridStatePatch = {
|
|
|
2061
2234
|
sort?: GridSortState | undefined;
|
|
2062
2235
|
columns?: GridColumnState[] | undefined;
|
|
2063
2236
|
collapsedGroups?: string[] | undefined;
|
|
2237
|
+
closedColumnGroups?: string[] | undefined;
|
|
2064
2238
|
};
|
|
2065
2239
|
/**
|
|
2066
2240
|
* 命令的 API です(`ref` prop で受け取るハンドル)。状態は props で controlled のまま、props で表現しづらい
|
|
@@ -2371,6 +2545,12 @@ export type SpreadsheetGridHandle<T> = {
|
|
|
2371
2545
|
findNext: () => void;
|
|
2372
2546
|
/** 前のヒットへ(循環)。 */
|
|
2373
2547
|
findPrev: () => void;
|
|
2548
|
+
/**
|
|
2549
|
+
* 指定したグループを開く(`true`)/ 閉じる(`false`。1.6.0 から)。開閉できない(`collapsible` の無い)
|
|
2550
|
+
* グループと、無いキーのときは何もせず開発時に警告する。今の開閉は
|
|
2551
|
+
* `getState().closedColumnGroups`(閉じているグループのキー)で読める。
|
|
2552
|
+
*/
|
|
2553
|
+
setColumnGroupOpen: (groupKey: string, open: boolean) => void;
|
|
2374
2554
|
};
|
|
2375
2555
|
export type GridDensity = 'compact' | 'standard' | 'comfortable';
|
|
2376
2556
|
export type GridTheme = 'light' | 'dark' | 'auto' | 'class';
|
|
@@ -2979,11 +3159,13 @@ export type SpreadsheetGridProps<T, F extends GridFrameworkTypes = GridFramework
|
|
|
2979
3159
|
* 桁区切りを半角に直して編集を始め(「12.5」→ `12.5`)、数値として読めない変換は捨てる(「ー」
|
|
2980
3160
|
* 「。」だけの変換は `-` / `.` の打ち始めとして編集を始める)。custom エディタの列は、
|
|
2981
3161
|
* エディタの定義に `imeDirectInput: true` を付けたときだけ確定した文字を `ctx.initialText`
|
|
2982
|
-
* に入れて編集を始める(1.2.0 から)
|
|
2983
|
-
*
|
|
2984
|
-
*
|
|
2985
|
-
* `
|
|
2986
|
-
*
|
|
3162
|
+
* に入れて編集を始める(1.2.0 から)。検索できる select エディタ(`search` など)
|
|
3163
|
+
* の列は確定した文字で絞った一覧から開く(1.7.0 から)。それ以外の列(select / date / checkbox /
|
|
3164
|
+
* 付けていない custom)と読み取り専用セルでは変換を捨てる(従来どおり何も入らない)。キー操作 /
|
|
3165
|
+
* コピー・貼り付け / `Tab` は従来どおり。既定 OFF の理由:
|
|
3166
|
+
* 有効中はグリッドにフォーカスがあるあいだ `document.activeElement` が入力欄になり、
|
|
3167
|
+
* 入力欄では反応しないアプリのショートカット(例: Mantine の `useHotkeys` の既定)
|
|
3168
|
+
* が効かなくなるため。詳細は「IME オンのままの直接入力」節。
|
|
2987
3169
|
*
|
|
2988
3170
|
* @defaultValue `false`
|
|
2989
3171
|
*/
|
|
@@ -3471,6 +3653,36 @@ export type SpreadsheetGridProps<T, F extends GridFrameworkTypes = GridFramework
|
|
|
3471
3653
|
* @defaultValue `'aboveTotal'`
|
|
3472
3654
|
*/
|
|
3473
3655
|
pinnedBottomRowsPlacement?: 'aboveTotal' | 'belowTotal' | undefined;
|
|
3656
|
+
/**
|
|
3657
|
+
* **列のグループ(多段の列見出し)**。列見出しの上に、いくつかの列をまとめた見出しの段を足す(1.6.0
|
|
3658
|
+
* から)。グループは列の `key`(`children`)で書き、`columns` はそのまま。
|
|
3659
|
+
* 段の数は一番深いグループで決まり、
|
|
3660
|
+
* グループに入らない列・浅いグループの列・グリッドが足す列(行番号など)
|
|
3661
|
+
* の見出しは上の段まで伸びる。左右の固定列の境目をまたぐグループは、
|
|
3662
|
+
* ペインごとに分けて名前をそれぞれに出す。列はグループの中でだけ動かせ、
|
|
3663
|
+
* グループの見出しの掴み手でグループごと動く(`onColumnsChange` 指定時)。
|
|
3664
|
+
* グループの見出しを押すと中の列をまとめて選び(`Shift` で広げる)、
|
|
3665
|
+
* 右端を引くと中の列の幅を比のまま変える。`collapsible` のグループは開閉のボタンを出す。
|
|
3666
|
+
* 横にスクロールしてもグループの名前は見えている所に留まる。エクスポートは
|
|
3667
|
+
* `includeColumnGroups: true` のときだけ。詳細は「列のグループ」節。
|
|
3668
|
+
*
|
|
3669
|
+
* @defaultValue —(無効)
|
|
3670
|
+
*/
|
|
3671
|
+
columnGroups?: readonly GridColumnGroup<F>[] | undefined;
|
|
3672
|
+
/**
|
|
3673
|
+
* 列のグループ(`columnGroups`)の段 1 つの高さ(px。1.6.0 から)。
|
|
3674
|
+
* 書かなければ列見出しの行と同じ高さ。
|
|
3675
|
+
*
|
|
3676
|
+
* @defaultValue `headerHeight`
|
|
3677
|
+
*/
|
|
3678
|
+
columnGroupHeaderHeight?: number | undefined;
|
|
3679
|
+
/**
|
|
3680
|
+
* 列のグループ(`collapsible`)を開閉したときの通知(1.6.0 から)。
|
|
3681
|
+
* 開閉のボタン・`setColumnGroupOpen`・`applyState` のどれでも、開閉が変わったグループごとに 1
|
|
3682
|
+
* 回呼ぶ(最初の描画では呼ばない)。`params = { groupKey, open, closedGroups }`(`closedGroups`
|
|
3683
|
+
* は閉じている開閉できるグループのキーの一覧)。
|
|
3684
|
+
*/
|
|
3685
|
+
onColumnGroupOpenChange?: ((params: ColumnGroupOpenChangeParams) => void) | undefined;
|
|
3474
3686
|
/**
|
|
3475
3687
|
* **フィルハンドル**。選択範囲(無ければアクティブセル)の右下に小さな四角を出し、
|
|
3476
3688
|
* 引いた先のセルを**連続データ**(1, 2, 3 … / 日付 / 曜日・月の名前 / `P-001` のような末尾の数)
|
|
@@ -14,9 +14,12 @@ export type GridFillValueParams<T> = Core.GridFillValueParams<T, UnboundGridType
|
|
|
14
14
|
export type CellStyleContext<T> = Core.CellStyleContext<T, UnboundGridTypes>;
|
|
15
15
|
export type GridConditionalFormat<T> = Core.GridConditionalFormat<T, UnboundGridTypes>;
|
|
16
16
|
export type HeaderRenderContext<T> = Core.HeaderRenderContext<T, UnboundGridTypes>;
|
|
17
|
+
export type GridColumnGroup = Core.GridColumnGroup<UnboundGridTypes>;
|
|
18
|
+
export type ColumnGroupHeaderRenderContext = Core.ColumnGroupHeaderRenderContext<UnboundGridTypes>;
|
|
17
19
|
export type CellValueFormatterParams<T> = Core.CellValueFormatterParams<T, UnboundGridTypes>;
|
|
18
20
|
export type CellValueFormatter<T> = Core.CellValueFormatter<T, UnboundGridTypes>;
|
|
19
21
|
export type GridColumnEditor<T> = Core.GridColumnEditor<T, UnboundGridTypes>;
|
|
22
|
+
export type GridSelectLoadOptionsParams<T> = Core.GridSelectLoadOptionsParams<T, UnboundGridTypes>;
|
|
20
23
|
export type CellEditorContext<T> = Core.CellEditorContext<T, UnboundGridTypes>;
|
|
21
24
|
export type CellValidationContext<T> = Core.CellValidationContext<T, UnboundGridTypes>;
|
|
22
25
|
export type GridAggFuncParams<T> = Core.GridAggFuncParams<T, UnboundGridTypes>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./gridVisibleBand.cjs");var t=e=>{let t=e.closest(`.ssg-scroll-container`);if(!t)return null;let n=t.getBoundingClientRect().left+t.clientLeft,r=n+t.clientWidth,i=e.closest(`.ssg-center-pane`)??t.querySelector(`.ssg-center-pane`);if(i){let t=i.previousElementSibling,a=i.nextElementSibling;if(i.contains(e))t&&(n=Math.max(n,t.getBoundingClientRect().right)),a&&(r=Math.min(r,a.getBoundingClientRect().left));else{let i=t?.contains(e)?t:a?.contains(e)?a:null;if(i){let e=i.getBoundingClientRect();n=Math.max(n,e.left),r=Math.min(r,e.right)}}}return r-n>0?{left:n,right:r}:null},n=t=>{let n=e.resolveGridVisibleBand(t);return{top:Math.max(0,n?.top??0),bottom:Math.min(window.innerHeight,n?.bottom??window.innerHeight)}},r=4,i=e=>{let n=t(e);if(!n)return null;let i=Math.floor(n.right-n.left-r*2);return i>0?i:null},a=e=>{let n=t(e);if(!n)return 0;let i=e.getBoundingClientRect(),a=i.right-(n.right-r);return a<=0?0:Math.max(0,Math.min(a,i.left-n.left))};exports.resolveEditorVisibleX=t,exports.resolveEditorVisibleY=n,exports.resolveShiftIntoView=a,exports.resolveVisibleWidth=i;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./gridVisibleBand.cjs");var t=e=>{let t=e.closest(`.ssg-scroll-container`);if(!t)return null;let n=t.getBoundingClientRect().left+t.clientLeft,r=n+t.clientWidth,i=e.closest(`.ssg-center-pane`)??t.querySelector(`.ssg-center-pane`);if(i){let t=i.previousElementSibling,a=i.nextElementSibling;if(i.contains(e))t&&(n=Math.max(n,t.getBoundingClientRect().right)),a&&(r=Math.min(r,a.getBoundingClientRect().left));else{let i=t?.contains(e)?t:a?.contains(e)?a:null;if(i){let e=i.getBoundingClientRect();n=Math.max(n,e.left),r=Math.min(r,e.right)}}}return r-n>0?{left:n,right:r}:null},n=t=>{let n=e.resolveGridVisibleBand(t);return{top:Math.max(0,n?.top??0),bottom:Math.min(window.innerHeight,n?.bottom??window.innerHeight)}},r=4,i=e=>{let n=t(e);if(!n)return null;let i=Math.floor(n.right-n.left-r*2);return i>0?i:null},a=e=>{let n=t(e);if(!n)return 0;let i=e.getBoundingClientRect(),a=i.right-(n.right-r);return a<=0?0:Math.max(0,Math.min(a,i.left-n.left))},o=n=>{let r=e.resolveGridVisibleBand(n);if(!r)return!1;let i=n.getBoundingClientRect();if(i.bottom<=r.top+1||i.top>=r.bottom-1)return!0;let a=t(n);return a!==null&&(i.right<=a.left+1||i.left>=a.right-1)},s=(e,t)=>o(e)?{...t,hidden:!0}:t;exports.isEditorOutOfView=o,exports.resolveEditorVisibleX=t,exports.resolveEditorVisibleY=n,exports.resolveShiftIntoView=a,exports.resolveVisibleWidth=i,exports.withAnchorVisibility=s;
|
|
@@ -8,3 +8,7 @@ export declare const resolveEditorVisibleY: (element: Element) => {
|
|
|
8
8
|
};
|
|
9
9
|
export declare const resolveVisibleWidth: (element: Element) => number | null;
|
|
10
10
|
export declare const resolveShiftIntoView: (element: Element) => number;
|
|
11
|
+
export declare const isEditorOutOfView: (element: Element) => boolean;
|
|
12
|
+
export declare const withAnchorVisibility: <P extends object>(element: Element, placement: P) => P & {
|
|
13
|
+
hidden?: boolean | undefined;
|
|
14
|
+
};
|
|
@@ -35,6 +35,16 @@ var t = (e) => {
|
|
|
35
35
|
if (!n) return 0;
|
|
36
36
|
let i = e.getBoundingClientRect(), a = i.right - (n.right - r);
|
|
37
37
|
return a <= 0 ? 0 : Math.max(0, Math.min(a, i.left - n.left));
|
|
38
|
-
}
|
|
38
|
+
}, o = (n) => {
|
|
39
|
+
let r = e(n);
|
|
40
|
+
if (!r) return !1;
|
|
41
|
+
let i = n.getBoundingClientRect();
|
|
42
|
+
if (i.bottom <= r.top + 1 || i.top >= r.bottom - 1) return !0;
|
|
43
|
+
let a = t(n);
|
|
44
|
+
return a !== null && (i.right <= a.left + 1 || i.left >= a.right - 1);
|
|
45
|
+
}, s = (e, t) => o(e) ? {
|
|
46
|
+
...t,
|
|
47
|
+
hidden: !0
|
|
48
|
+
} : t;
|
|
39
49
|
//#endregion
|
|
40
|
-
export { t as resolveEditorVisibleX, n as resolveEditorVisibleY, a as resolveShiftIntoView, i as resolveVisibleWidth };
|
|
50
|
+
export { o as isEditorOutOfView, t as resolveEditorVisibleX, n as resolveEditorVisibleY, a as resolveShiftIntoView, i as resolveVisibleWidth, s as withAnchorVisibility };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=e=>{let t=Array.from(e.children),n=t.length>0?t:[e];n.some(e=>e.scrollWidth>e.clientWidth)?e.title=n.map(e=>(e.textContent??``).trim()).join(` `):e.removeAttribute(`title`)};exports.revealOverflowTitle=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const revealOverflowTitle: (option: HTMLElement) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/utils/overflowTitle.ts
|
|
2
|
+
var e = (e) => {
|
|
3
|
+
let t = Array.from(e.children), n = t.length > 0 ? t : [e];
|
|
4
|
+
n.some((e) => e.scrollWidth > e.clientWidth) ? e.title = n.map((e) => (e.textContent ?? "").trim()).join(" ") : e.removeAttribute("title");
|
|
5
|
+
};
|
|
6
|
+
//#endregion
|
|
7
|
+
export { e as revealOverflowTitle };
|
package/package.json
CHANGED