ingred-ui 27.3.0 → 27.4.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/components/DataTable2/DataTable2.d.ts +7 -1
- package/dist/components/DataTable2/DataTable2.stories.d.ts +22 -1
- package/dist/components/DataTable2/DataTable2Cell.d.ts +6 -1
- package/dist/components/DataTable2/DataTable2Column.d.ts +7 -1
- package/dist/components/DataTable2/context.d.ts +18 -0
- package/dist/components/DataTable2/styled.d.ts +23 -4
- package/dist/index.es.js +533 -447
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +529 -443
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -57,6 +57,12 @@ type DataTable2Props = {
|
|
|
57
57
|
isSmallLayout: boolean;
|
|
58
58
|
checkedRows: string[];
|
|
59
59
|
}) => React.ReactNode;
|
|
60
|
+
/**
|
|
61
|
+
* 複数行選択 UI を有効にするか。`false` のとき一括チェック・「n件を」・行頭チェック列を出さない。
|
|
62
|
+
* 行選択 UI を出すには `true` に加え **`tableActions` を渡す**必要がある(`tableActions` が無いとチェック列もツールバーも出ない)。
|
|
63
|
+
* @default true
|
|
64
|
+
*/
|
|
65
|
+
enableRowSelection?: boolean;
|
|
60
66
|
} & {
|
|
61
67
|
/**
|
|
62
68
|
* 見た目の制御。枠線で囲むか否か。枠線で囲むと角丸も適用される
|
|
@@ -69,5 +75,5 @@ type DataTable2Props = {
|
|
|
69
75
|
*/
|
|
70
76
|
onCheckedRowsChange?: (checkedRows: string[]) => void;
|
|
71
77
|
};
|
|
72
|
-
export declare const DataTable2: ({ bordered, currentPage, pageSize, pageSizeOptions, totalCount, columns, onPageChange, onPageSizeChange, onColumnsChange, onCheckedRowsChange, children, tableActions, customTableActionArea, }: DataTable2Props) => JSX.Element;
|
|
78
|
+
export declare const DataTable2: ({ bordered, currentPage, pageSize, pageSizeOptions, totalCount, columns, onPageChange, onPageSizeChange, onColumnsChange, onCheckedRowsChange, children, tableActions, customTableActionArea, enableRowSelection, }: DataTable2Props) => JSX.Element;
|
|
73
79
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StoryObj } from "@storybook/react-vite";
|
|
3
3
|
import { type TableColumn, type TableAction, DataTable2 } from "./index";
|
|
4
|
-
declare const meta: Meta<({ bordered, currentPage, pageSize, pageSizeOptions, totalCount, columns, onPageChange, onPageSizeChange, onColumnsChange, onCheckedRowsChange, children, tableActions, customTableActionArea, }: {
|
|
4
|
+
declare const meta: Meta<({ bordered, currentPage, pageSize, pageSizeOptions, totalCount, columns, onPageChange, onPageSizeChange, onColumnsChange, onCheckedRowsChange, children, tableActions, customTableActionArea, enableRowSelection, }: {
|
|
5
5
|
currentPage: number;
|
|
6
6
|
pageSize: number;
|
|
7
7
|
pageSizeOptions: number[];
|
|
@@ -15,6 +15,7 @@ declare const meta: Meta<({ bordered, currentPage, pageSize, pageSizeOptions, to
|
|
|
15
15
|
isSmallLayout: boolean;
|
|
16
16
|
checkedRows: string[];
|
|
17
17
|
}) => React.ReactNode) | undefined;
|
|
18
|
+
enableRowSelection?: boolean | undefined;
|
|
18
19
|
} & {
|
|
19
20
|
bordered?: boolean | undefined;
|
|
20
21
|
children: React.ReactNode;
|
|
@@ -75,3 +76,23 @@ export declare const Sample: StoryObj<typeof DataTable2>;
|
|
|
75
76
|
* 「カラム」でフィルターやソートを明示しない場合も、それらの機能は非表示になります。
|
|
76
77
|
*/
|
|
77
78
|
export declare const Loading: StoryObj<typeof DataTable2>;
|
|
79
|
+
/**
|
|
80
|
+
* `enableRowSelection={false}` のとき、一括チェック・「n件を」・行頭チェック列を出さない。
|
|
81
|
+
* `tableActions` は `enabledWhen: "unchecked"` のみなど、行選択に依存しない操作だけ置ける。
|
|
82
|
+
*/
|
|
83
|
+
export declare const WithoutRowSelection: StoryObj<typeof DataTable2>;
|
|
84
|
+
/**
|
|
85
|
+
* `enableRowSelection`(既定 `true`)かつ **`tableActions` を渡さない** とき。
|
|
86
|
+
*
|
|
87
|
+
* `hasRowControls` が false のため、**一括チェック・「-件を」・行頭チェック列はいずれも出ない**(ツールバーと行が揃う)。
|
|
88
|
+
* レビュー: [PR #2125](https://github.com/voyagegroup/ingred-ui/pull/2125#discussion_r3097576711)
|
|
89
|
+
*/
|
|
90
|
+
export declare const RowSelectionWithoutTableActions: StoryObj<typeof DataTable2>;
|
|
91
|
+
/**
|
|
92
|
+
* 右端 1 列だけに `sticky="right"` を付けたとき、横スクロールで操作列が右端に張り付く。
|
|
93
|
+
* `tableActions` で行頭チェック列・一括選択ツールバーも表示できる(チェック列は通常列としてスクロールする)。
|
|
94
|
+
* 右 sticky 列は `columns` で `sortable: false` の末尾列にしておくと、カラム編集でドラッグ移動されない(`endFixed` と整合)。
|
|
95
|
+
* ツールバー右の設定ボタンから「カラムを編集」を開き、A〜D の並び替えと末尾「操作」がドラッグ不可であることを確認できる(A〜D は `sortable: true`)。
|
|
96
|
+
* ストーリー側では縦横サイズを固定していない。挙動確認時はプレビュー枠の幅などを自分で調整すること。
|
|
97
|
+
*/
|
|
98
|
+
export declare const StickyColumns: StoryObj<typeof DataTable2>;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
type DataTable2CellProps = {
|
|
3
3
|
loading?: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* 横スクロール時に列をビューポート右端に固定する(対応する `DataTable2Column` と同じ値に)。
|
|
6
|
+
* **最大 1 列**のみテーブル全体で `sticky="right"` を指定可能。
|
|
7
|
+
*/
|
|
8
|
+
sticky?: "right";
|
|
4
9
|
children: ReactNode;
|
|
5
10
|
};
|
|
6
|
-
export declare const DataTable2Cell: ({ loading, children }: DataTable2CellProps) => JSX.Element;
|
|
11
|
+
export declare const DataTable2Cell: ({ loading, sticky: _sticky, children, }: DataTable2CellProps) => JSX.Element;
|
|
7
12
|
export {};
|
|
@@ -2,6 +2,11 @@ import { type ReactNode } from "react";
|
|
|
2
2
|
import { SortDirection } from "./types";
|
|
3
3
|
type DataTable2ColumnProps = {
|
|
4
4
|
className?: string;
|
|
5
|
+
/**
|
|
6
|
+
* 横スクロール時に列をビューポート右端に固定する。**最大 1 列**のみ指定可(先にマウントした列が有効)。
|
|
7
|
+
* カラム編集で動かさない場合は `TableColumn.sortable: false` の末尾列に付けることを推奨。
|
|
8
|
+
*/
|
|
9
|
+
sticky?: "right";
|
|
5
10
|
isResizable: true;
|
|
6
11
|
onWidthChange: (width: number) => void;
|
|
7
12
|
minWidth?: number;
|
|
@@ -10,6 +15,7 @@ type DataTable2ColumnProps = {
|
|
|
10
15
|
children: ReactNode;
|
|
11
16
|
} | {
|
|
12
17
|
className?: string;
|
|
18
|
+
sticky?: "right";
|
|
13
19
|
isResizable?: false;
|
|
14
20
|
onWidthChange?: undefined;
|
|
15
21
|
minWidth?: number;
|
|
@@ -17,7 +23,7 @@ type DataTable2ColumnProps = {
|
|
|
17
23
|
width?: number;
|
|
18
24
|
children: ReactNode;
|
|
19
25
|
};
|
|
20
|
-
export declare const DataTable2Column: ({ className, isResizable, width, minWidth, maxWidth, children, onWidthChange, }: DataTable2ColumnProps) => JSX.Element;
|
|
26
|
+
export declare const DataTable2Column: ({ className, sticky, isResizable, width, minWidth, maxWidth, children, onWidthChange, }: DataTable2ColumnProps) => JSX.Element;
|
|
21
27
|
type DataTable2ColumnLabelProps = {
|
|
22
28
|
showSortButton?: true;
|
|
23
29
|
sortButtonDirection?: SortDirection;
|
|
@@ -3,6 +3,8 @@ import type { TableColumn } from "./types";
|
|
|
3
3
|
export type RowSpacing = -2 | -1 | 0 | 1 | 2;
|
|
4
4
|
export declare const DataTable2Context: import("react").Context<{
|
|
5
5
|
rowIds: string[];
|
|
6
|
+
/** 複数行選択 UI(ツールバー一括チェック・行頭チェック列)を出すか */
|
|
7
|
+
enableRowSelection: boolean;
|
|
6
8
|
hasRowControls: boolean;
|
|
7
9
|
checkedRows: string[];
|
|
8
10
|
columns: TableColumn[];
|
|
@@ -23,6 +25,22 @@ export declare const DataTable2Context: import("react").Context<{
|
|
|
23
25
|
setColumnWidth: (index: number, width: number | null) => void;
|
|
24
26
|
setRowSpacing: (spacing: RowSpacing) => void;
|
|
25
27
|
}>;
|
|
28
|
+
/** 横スクロール位置に応じた sticky 列の境目・影の表示(DataTable2 内のスクロール領域専用) */
|
|
29
|
+
export declare const DataTable2StickyScrollContext: import("react").Context<{
|
|
30
|
+
showStickyRightEdgeDecoration: boolean;
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* `sticky="right"` は **最大 1 列**(先に登録した列のみ有効。2 列目は開発時に警告して無視)。
|
|
34
|
+
* 利用上は **右端列**(例: 操作列)に `sortable: false` を付け、カラム編集で末尾固定にして移動させないことを推奨。
|
|
35
|
+
*/
|
|
36
|
+
export declare const DataTable2ColumnStickyContext: import("react").Context<{
|
|
37
|
+
registerColumnSticky: (index: number, sticky: "right" | undefined) => void;
|
|
38
|
+
getStickyRightOffset: (columnIndex: number) => number | undefined;
|
|
39
|
+
/** 右 sticky 列の index(装飾はこの列の左縁) */
|
|
40
|
+
rightStickyColumnIndex: number | null;
|
|
41
|
+
getRightStickyZIndexHead: (columnIndex: number) => number;
|
|
42
|
+
getRightStickyZIndexBody: (columnIndex: number) => number;
|
|
43
|
+
}>;
|
|
26
44
|
export declare const ColumnContext: import("react").Context<{
|
|
27
45
|
index: number;
|
|
28
46
|
}>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
1
|
+
import React, { type ReactNode } from "react";
|
|
2
2
|
export declare const DataTable2: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
3
3
|
bordered?: boolean | undefined;
|
|
4
4
|
}, never>;
|
|
5
|
-
|
|
5
|
+
/** 横スクロールのスクロールポートはこの div。子は table のみにし、sticky の祖先を浅く保つ */
|
|
6
|
+
export declare const Viewport: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<{
|
|
6
7
|
className?: string | undefined;
|
|
7
8
|
children: ReactNode;
|
|
8
|
-
}
|
|
9
|
+
} & React.RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
9
10
|
export declare const Toolbar: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
10
11
|
isSmallLayout: boolean;
|
|
11
12
|
}, never>;
|
|
@@ -16,8 +17,23 @@ export declare const ToolbarPaginationOperator: import("styled-components").Styl
|
|
|
16
17
|
export declare const ToolbarFilterTrigger: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
17
18
|
export declare const ToolbarExtras: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
18
19
|
export declare const DataTable2ActionButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
20
|
+
/**
|
|
21
|
+
* thead 自体を position: sticky にすると、子 th の横方向 sticky(right)が
|
|
22
|
+
* スクロールに追従してしまうブラウザ挙動がある。縦方向のヘッダ固定は各 th の top: 0 に任せる。
|
|
23
|
+
*/
|
|
19
24
|
export declare const DataTable2Header: import("styled-components").StyledComponent<"thead", import("styled-components").DefaultTheme, {}, never>;
|
|
20
|
-
export declare const DataTable2Column: import("styled-components").StyledComponent<"th", import("styled-components").DefaultTheme, {
|
|
25
|
+
export declare const DataTable2Column: import("styled-components").StyledComponent<"th", import("styled-components").DefaultTheme, {
|
|
26
|
+
$stickyRightOffset?: number | undefined;
|
|
27
|
+
$stickyZIndex?: number | undefined;
|
|
28
|
+
/** false のとき inset 線と隣セル側の影帯(::after)を付けない */
|
|
29
|
+
$showStickyEdgeDecoration?: boolean | undefined;
|
|
30
|
+
}, never>;
|
|
31
|
+
/** tbody の通常セル(横スクロール時の右 sticky 用) */
|
|
32
|
+
export declare const DataTable2TableCell: import("styled-components").StyledComponent<"td", import("styled-components").DefaultTheme, {
|
|
33
|
+
$stickyRightOffset?: number | undefined;
|
|
34
|
+
$stickyZIndex?: number | undefined;
|
|
35
|
+
$showStickyEdgeDecoration?: boolean | undefined;
|
|
36
|
+
}, never>;
|
|
21
37
|
export declare const DataTable2ColumnInner: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
22
38
|
isSmallLayout: boolean;
|
|
23
39
|
}, never>;
|
|
@@ -28,7 +44,10 @@ export declare const SortButton: import("styled-components").StyledComponent<"bu
|
|
|
28
44
|
export declare const DataTable2Row: import("styled-components").StyledComponent<"tr", import("styled-components").DefaultTheme, {
|
|
29
45
|
isSmallLayout: boolean;
|
|
30
46
|
}, never>;
|
|
47
|
+
/** 行頭チェック列 */
|
|
31
48
|
export declare const DataTable2RowCheckCell: import("styled-components").StyledComponent<"td", import("styled-components").DefaultTheme, {}, never>;
|
|
49
|
+
/** thead の行頭チェック用空セル(ヘッダ行は各 th で縦 sticky) */
|
|
50
|
+
export declare const DataTable2HeadCheckCell: import("styled-components").StyledComponent<"th", import("styled-components").DefaultTheme, {}, never>;
|
|
32
51
|
export declare const CheckboxWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
33
52
|
export declare const DataTable2CellInner: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
34
53
|
export declare const DataTable2CellSpinner: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|