ingred-ui 23.7.0 → 23.9.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 +19 -14
- package/dist/components/DataTable2/DataTable2.stories.d.ts +8 -5
- package/dist/components/DataTable2/DataTable2Toolbar.d.ts +11 -0
- package/dist/components/DataTable2/index.d.ts +1 -0
- package/dist/components/DataTable2/styled.d.ts +12 -1
- package/dist/components/DataTable2/types/__tests__/tableActions.test.d.ts +1 -0
- package/dist/components/DataTable2/types/tableActions.d.ts +54 -0
- package/dist/components/DataTable2/utils/__tests__/toolbarUtils.test.d.ts +1 -0
- package/dist/components/DataTable2/utils/toolbarUtils.d.ts +80 -0
- package/dist/components/Drawer/Drawer.d.ts +4 -0
- package/dist/components/Drawer/Drawer.stories.d.ts +11 -0
- package/dist/components/Drawer/__tests__/Drawer.test.d.ts +1 -0
- package/dist/components/Drawer/index.d.ts +2 -0
- package/dist/components/Drawer/styled.d.ts +25 -0
- package/dist/components/Drawer/types.d.ts +25 -0
- package/dist/components/Drawer/utils.d.ts +22 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/index.es.js +638 -423
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +674 -459
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
1
|
+
import React, { type ReactNode } from "react";
|
|
2
2
|
import type { TableColumn } from "./types";
|
|
3
|
-
type
|
|
4
|
-
/**
|
|
5
|
-
* 「◯件選択中」をクリックしたときに表示される ContextMenu2 の中身を指定できます。
|
|
6
|
-
* `<ContextMenu2>` 内に格納できるコンポーネントのみで構成してください。
|
|
7
|
-
*/
|
|
8
|
-
rowControls?: ReactNode;
|
|
9
|
-
/**
|
|
10
|
-
* 右上に任意のボタンを設置できます。
|
|
11
|
-
*/
|
|
12
|
-
extraButtons?: ReactNode;
|
|
13
|
-
};
|
|
3
|
+
import type { TableAction } from "./types/tableActions";
|
|
14
4
|
type DataTable2Props = {
|
|
15
5
|
/**
|
|
16
6
|
* ページネーションの現在のページ
|
|
@@ -47,6 +37,21 @@ type DataTable2Props = {
|
|
|
47
37
|
* @param columns 変更後のカラム
|
|
48
38
|
*/
|
|
49
39
|
onColumnsChange: (columns: TableColumn[]) => void;
|
|
40
|
+
/**
|
|
41
|
+
* テーブルアクションボタン群の定義。enabledWhenとdisplayInで表示場所を制御:
|
|
42
|
+
* - enabledWhen: "checked" + displayIn: "toolbar" → デスクトップ時は左側の直接ボタン、モバイル時は「n件を操作」ドロップダウン
|
|
43
|
+
* - enabledWhen: "checked" + displayIn: "dropdown" → デスクトップ時は左側の3点リーダーボタン、モバイル時は「n件を操作」ドロップダウン
|
|
44
|
+
* - enabledWhen: "unchecked" + displayIn: "toolbar" → デスクトップ時は右側の直接ボタン、モバイル時は右側の3点リーダーボタン
|
|
45
|
+
* - enabledWhen: "unchecked" + displayIn: "dropdown" → デスクトップ・モバイル共に右側の3点リーダーボタン
|
|
46
|
+
*/
|
|
47
|
+
tableActions?: TableAction[];
|
|
48
|
+
/**
|
|
49
|
+
* テーブルアクションエリアを完全カスタマイズしたい場合のrender-props。isSmallLayout, checkedRows等を受け取れる。
|
|
50
|
+
*/
|
|
51
|
+
customTableActionArea?: (context: {
|
|
52
|
+
isSmallLayout: boolean;
|
|
53
|
+
checkedRows: string[];
|
|
54
|
+
}) => React.ReactNode;
|
|
50
55
|
} & {
|
|
51
56
|
/**
|
|
52
57
|
* 見た目の制御。枠線で囲むか否か。枠線で囲むと角丸も適用される
|
|
@@ -58,6 +63,6 @@ type DataTable2Props = {
|
|
|
58
63
|
* 読み取り専用で、今のところは外から `checkedRows` を変更することはできません
|
|
59
64
|
*/
|
|
60
65
|
onCheckedRowsChange?: (checkedRows: string[]) => void;
|
|
61
|
-
}
|
|
62
|
-
export declare const DataTable2: ({ bordered,
|
|
66
|
+
};
|
|
67
|
+
export declare const DataTable2: ({ bordered, currentPage, pageSize, pageSizeOptions, totalCount, columns, onPageChange, onPageSizeChange, onColumnsChange, onCheckedRowsChange, children, tableActions, customTableActionArea, }: DataTable2Props) => JSX.Element;
|
|
63
68
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StoryObj } from "@storybook/react";
|
|
3
|
-
import { type TableColumn } from "./index";
|
|
3
|
+
import { type TableColumn, type TableAction } from "./index";
|
|
4
4
|
declare const meta: {
|
|
5
5
|
title: string;
|
|
6
|
-
component: ({ bordered,
|
|
6
|
+
component: ({ bordered, currentPage, pageSize, pageSizeOptions, totalCount, columns, onPageChange, onPageSizeChange, onColumnsChange, onCheckedRowsChange, children, tableActions, customTableActionArea, }: {
|
|
7
7
|
currentPage: number;
|
|
8
8
|
pageSize: number;
|
|
9
9
|
pageSizeOptions: number[];
|
|
@@ -12,13 +12,15 @@ declare const meta: {
|
|
|
12
12
|
onPageChange: (page: number) => void;
|
|
13
13
|
onPageSizeChange: (size: number) => void;
|
|
14
14
|
onColumnsChange: (columns: TableColumn[]) => void;
|
|
15
|
+
tableActions?: TableAction[] | undefined;
|
|
16
|
+
customTableActionArea?: ((context: {
|
|
17
|
+
isSmallLayout: boolean;
|
|
18
|
+
checkedRows: string[];
|
|
19
|
+
}) => React.ReactNode) | undefined;
|
|
15
20
|
} & {
|
|
16
21
|
bordered?: boolean | undefined;
|
|
17
22
|
children: React.ReactNode;
|
|
18
23
|
onCheckedRowsChange?: ((checkedRows: string[]) => void) | undefined;
|
|
19
|
-
} & {
|
|
20
|
-
rowControls?: React.ReactNode;
|
|
21
|
-
extraButtons?: React.ReactNode;
|
|
22
24
|
}) => JSX.Element;
|
|
23
25
|
argTypes: {};
|
|
24
26
|
};
|
|
@@ -65,6 +67,7 @@ export default meta;
|
|
|
65
67
|
* ```
|
|
66
68
|
*/
|
|
67
69
|
export declare const Default: StoryObj<typeof meta>;
|
|
70
|
+
export declare const Sample: StoryObj<typeof meta>;
|
|
68
71
|
/**
|
|
69
72
|
* 以下のように、セルの loading を true に設定すると、スピナーが表示されます。
|
|
70
73
|
* ```
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { TableAction } from "./types/tableActions";
|
|
3
|
+
type DataTable2ToolbarProps = {
|
|
4
|
+
tableActions?: TableAction[];
|
|
5
|
+
customTableActionArea?: (context: {
|
|
6
|
+
isSmallLayout: boolean;
|
|
7
|
+
checkedRows: string[];
|
|
8
|
+
}) => React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export declare const DataTable2Toolbar: ({ tableActions, customTableActionArea, }: DataTable2ToolbarProps) => JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type { TableColumn, SortDirection } from "./types";
|
|
2
|
+
export type { TableAction } from "./types/tableActions";
|
|
2
3
|
export { DataTable2 } from "./DataTable2";
|
|
3
4
|
export { DataTable2Head } from "./DataTable2Head";
|
|
4
5
|
export { DataTable2Column, DataTable2ColumnLabel } from "./DataTable2Column";
|
|
@@ -16,7 +16,6 @@ export declare const ToolbarPaginationOperator: import("styled-components").Styl
|
|
|
16
16
|
export declare const ToolbarFilterTrigger: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
17
17
|
export declare const ToolbarExtras: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
18
18
|
export declare const DataTable2ActionButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
19
|
-
export declare const DataTable2ExtrasMenuTrigger: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
20
19
|
export declare const DataTable2Header: import("styled-components").StyledComponent<"thead", import("styled-components").DefaultTheme, {}, never>;
|
|
21
20
|
export declare const DataTable2Column: import("styled-components").StyledComponent<"th", import("styled-components").DefaultTheme, {}, never>;
|
|
22
21
|
export declare const DataTable2ColumnInner: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
@@ -36,3 +35,15 @@ export declare const DataTable2CellSpinner: import("styled-components").StyledCo
|
|
|
36
35
|
export declare const DataTable2CellContents: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
37
36
|
export declare const DataTable2InlineEditor: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
38
37
|
export declare const DataTable2InlineEditorButton: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
38
|
+
export declare const ToolbarTableActionArea: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
39
|
+
export declare const TableSelectedText: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
40
|
+
export declare const TableActionButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
41
|
+
color?: "primary" | "danger" | "default" | undefined;
|
|
42
|
+
}, never>;
|
|
43
|
+
export declare const TableActionMenuTrigger: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
44
|
+
export declare const TableActionMenuItem: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
45
|
+
color?: "primary" | "danger" | "default" | undefined;
|
|
46
|
+
}, never>;
|
|
47
|
+
export declare const DashedDivider: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
48
|
+
export declare const TableActionContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
49
|
+
export declare const TableActionDropdownButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* テーブルアクションボタン群の定義。enabledWhenとdisplayInで表示場所を制御:
|
|
4
|
+
* - enabledWhen: "checked" + displayIn: "toolbar" → デスクトップ時は左側の直接ボタン、モバイル時は「n件を操作」ドロップダウン
|
|
5
|
+
* - enabledWhen: "checked" + displayIn: "dropdown" → デスクトップ時は左側の3点リーダーボタン、モバイル時は「n件を操作」ドロップダウン
|
|
6
|
+
* - enabledWhen: "unchecked" + displayIn: "toolbar" → デスクトップ時は右側の直接ボタン、モバイル時は右側の3点リーダーボタン
|
|
7
|
+
* - enabledWhen: "unchecked" + displayIn: "dropdown" → デスクトップ・モバイル共に右側の3点リーダーボタン
|
|
8
|
+
*/
|
|
9
|
+
export type TableAction = {
|
|
10
|
+
type: "singleButton";
|
|
11
|
+
label: string;
|
|
12
|
+
icon?: React.ReactNode;
|
|
13
|
+
onClick: (selectedRows: string[]) => void;
|
|
14
|
+
color?: "danger" | "primary" | "primaryPale" | "basicLight" | "basicDark" | "clear";
|
|
15
|
+
displayIn?: "toolbar" | "dropdown";
|
|
16
|
+
enabledWhen?: "checked" | "unchecked" | "custom";
|
|
17
|
+
disabled?: (checkedRows: string[]) => boolean;
|
|
18
|
+
style?: React.CSSProperties;
|
|
19
|
+
headingLabel?: string;
|
|
20
|
+
dynamicIconColor?: {
|
|
21
|
+
enabled: string;
|
|
22
|
+
disabled?: string;
|
|
23
|
+
};
|
|
24
|
+
} | {
|
|
25
|
+
type: "groupButton";
|
|
26
|
+
items: {
|
|
27
|
+
label: string;
|
|
28
|
+
icon?: React.ReactNode;
|
|
29
|
+
onClick: (selectedRows: string[]) => void;
|
|
30
|
+
color?: "danger" | "primary" | "primaryPale" | "basicLight" | "basicDark" | "clear";
|
|
31
|
+
enabledWhen?: "checked" | "unchecked" | "custom";
|
|
32
|
+
disabled?: (checkedRows: string[]) => boolean;
|
|
33
|
+
style?: React.CSSProperties;
|
|
34
|
+
dynamicIconColor?: {
|
|
35
|
+
enabled: string;
|
|
36
|
+
disabled?: string;
|
|
37
|
+
};
|
|
38
|
+
}[];
|
|
39
|
+
displayIn?: "toolbar" | "dropdown";
|
|
40
|
+
enabledWhen?: "checked" | "unchecked" | "custom";
|
|
41
|
+
headingLabel?: string;
|
|
42
|
+
} | {
|
|
43
|
+
type: "divider";
|
|
44
|
+
displayIn?: "toolbar" | "dropdown";
|
|
45
|
+
} | {
|
|
46
|
+
type: "separator";
|
|
47
|
+
displayIn?: "toolbar" | "dropdown";
|
|
48
|
+
enabledWhen?: "checked" | "unchecked" | "custom";
|
|
49
|
+
} | {
|
|
50
|
+
type: "heading";
|
|
51
|
+
label: string;
|
|
52
|
+
displayIn?: "toolbar" | "dropdown";
|
|
53
|
+
enabledWhen?: "checked" | "unchecked" | "custom";
|
|
54
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Theme } from "../../../themes/createTheme";
|
|
3
|
+
import type { TableAction } from "../types/tableActions";
|
|
4
|
+
/**
|
|
5
|
+
* アイコンの色を動的に変更するヘルパー関数
|
|
6
|
+
*
|
|
7
|
+
* @param originalIcon - 元のアイコンReactNode
|
|
8
|
+
* @param dynamicIconColor - 動的色設定オブジェクト
|
|
9
|
+
* @param isEnabled - 有効状態(通常はcheckedRows.length > 0)
|
|
10
|
+
* @param theme - テーマオブジェクト
|
|
11
|
+
* @returns 色が適用されたアイコン
|
|
12
|
+
*/
|
|
13
|
+
export declare const getDynamicIcon: (originalIcon: React.ReactNode, dynamicIconColor: {
|
|
14
|
+
enabled: string;
|
|
15
|
+
disabled?: string;
|
|
16
|
+
} | undefined, isEnabled: boolean, theme: Theme) => React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* TableActionのenabledWhenに基づいてアクションを分類
|
|
19
|
+
*
|
|
20
|
+
* @param actions - TableActionの配列
|
|
21
|
+
* @returns checked用とunchecked用に分離されたアクション
|
|
22
|
+
*/
|
|
23
|
+
export declare const categorizeActionsByEnabledWhen: (actions: TableAction[]) => {
|
|
24
|
+
checkedActions: TableAction[];
|
|
25
|
+
uncheckedActions: TableAction[];
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* TableActionのdisplayInに基づいてアクションを分類
|
|
29
|
+
*
|
|
30
|
+
* @param actions - TableActionの配列
|
|
31
|
+
* @returns toolbar用とdropdown用に分離されたアクション
|
|
32
|
+
*/
|
|
33
|
+
export declare const categorizeActionsByDisplayIn: (actions: TableAction[]) => {
|
|
34
|
+
toolbarActions: TableAction[];
|
|
35
|
+
dropdownActions: TableAction[];
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* enabledWhenとcustomDisabled関数に基づいてアクションが無効かどうかを判定
|
|
39
|
+
*
|
|
40
|
+
* @param action - 判定対象のアクションまたはアイテム
|
|
41
|
+
* @param checkedRows - 現在選択されている行の配列
|
|
42
|
+
* @param isUncheckedContext - unchecked系アクション専用のコンテキストかどうか
|
|
43
|
+
* @returns アクションが無効かどうか
|
|
44
|
+
*/
|
|
45
|
+
export declare const isActionDisabled: (action: {
|
|
46
|
+
enabledWhen?: "checked" | "unchecked" | "custom" | undefined;
|
|
47
|
+
disabled?: ((checkedRows: string[]) => boolean) | undefined;
|
|
48
|
+
}, checkedRows: string[], isUncheckedContext?: boolean) => boolean;
|
|
49
|
+
/**
|
|
50
|
+
* TableActionのキーを生成するヘルパー関数
|
|
51
|
+
*
|
|
52
|
+
* @param action - TableAction
|
|
53
|
+
* @param index - 配列内のインデックス
|
|
54
|
+
* @returns ユニークなキー文字列
|
|
55
|
+
*/
|
|
56
|
+
export declare const getActionKey: (action: TableAction, index: number) => string;
|
|
57
|
+
/**
|
|
58
|
+
* ButtonGroupのアイテムキーを生成するヘルパー関数
|
|
59
|
+
*
|
|
60
|
+
* @param item - グループ内のアイテム
|
|
61
|
+
* @param parentIndex - 親グループのインデックス
|
|
62
|
+
* @param itemIndex - アイテムのインデックス
|
|
63
|
+
* @returns ユニークなキー文字列
|
|
64
|
+
*/
|
|
65
|
+
export declare const getGroupItemKey: (item: {
|
|
66
|
+
label?: string;
|
|
67
|
+
}, parentIndex: number, itemIndex: number) => string;
|
|
68
|
+
/**
|
|
69
|
+
* ドロップダウン内のアイテム用のより具体的なキーを生成するヘルパー関数
|
|
70
|
+
*
|
|
71
|
+
* @param item - ドロップダウン内のアイテム
|
|
72
|
+
* @param prefix - キーのプレフィックス
|
|
73
|
+
* @param parentIndex - 親要素のインデックス
|
|
74
|
+
* @param itemIndex - アイテムのインデックス
|
|
75
|
+
* @returns ユニークなキー文字列
|
|
76
|
+
*/
|
|
77
|
+
export declare const getDropdownItemKey: (item: {
|
|
78
|
+
label?: string;
|
|
79
|
+
icon?: React.ReactNode;
|
|
80
|
+
}, prefix: string, parentIndex: number, itemIndex: number) => string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Drawer from "./Drawer";
|
|
3
|
+
declare const meta: Meta<typeof Drawer>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Responsive: Story;
|
|
8
|
+
export declare const WithStickyHeaderFooter: Story;
|
|
9
|
+
export declare const WithCloseConfirmation: Story;
|
|
10
|
+
export declare const DynamicConfirmClose: Story;
|
|
11
|
+
export declare const AnchorTrigger: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type BackdropProps = {
|
|
2
|
+
shouldShow: boolean;
|
|
3
|
+
transitionDuration: number;
|
|
4
|
+
};
|
|
5
|
+
export declare const Backdrop: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, BackdropProps, never>;
|
|
6
|
+
export type DrawerContainerProps = {
|
|
7
|
+
direction: "left" | "right" | "bottom";
|
|
8
|
+
currentSize: number;
|
|
9
|
+
shouldShow: boolean;
|
|
10
|
+
transitionDuration: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const DrawerContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, DrawerContainerProps, never>;
|
|
13
|
+
export type ResizeHandleProps = {
|
|
14
|
+
direction: "left" | "right" | "bottom";
|
|
15
|
+
};
|
|
16
|
+
export declare const ResizeHandle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, ResizeHandleProps, never>;
|
|
17
|
+
export type ResizeBarProps = ResizeHandleProps & {
|
|
18
|
+
active?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export declare const ResizeBar: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, ResizeHandleProps & {
|
|
21
|
+
active?: boolean | undefined;
|
|
22
|
+
}, never>;
|
|
23
|
+
export declare const StickyHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
24
|
+
export declare const ScrollableContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
25
|
+
export declare const StickyFooter: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ConfirmModalProps } from "../ConfirmModal/ConfirmModal";
|
|
3
|
+
export type ConfirmCloseConfig = Pick<ConfirmModalProps, "confirmText" | "cancelText" | "buttonColor"> & {
|
|
4
|
+
title?: string;
|
|
5
|
+
message?: string;
|
|
6
|
+
};
|
|
7
|
+
export type DrawerProps = {
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
direction: "left" | "right" | "bottom";
|
|
10
|
+
onClose?: (reason: "backdropClick" | "escapeKey") => void;
|
|
11
|
+
size?: string | number;
|
|
12
|
+
resizable?: boolean;
|
|
13
|
+
minSize?: string | number;
|
|
14
|
+
maxSize?: string | number;
|
|
15
|
+
onResize?: (newSize: number) => void;
|
|
16
|
+
stickyHeader?: React.ReactNode;
|
|
17
|
+
stickyFooter?: React.ReactNode;
|
|
18
|
+
confirmOnClose?: string | ConfirmCloseConfig;
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* ドロワー表示中も背景をスクロール可能にする(Backdrop非表示)
|
|
22
|
+
*/
|
|
23
|
+
allowBackgroundScroll?: boolean;
|
|
24
|
+
};
|
|
25
|
+
export type CloseReason = "backdropClick" | "escapeKey";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drawerコンポーネント用のユーティリティ関数
|
|
3
|
+
*
|
|
4
|
+
* このファイルの主な目的:
|
|
5
|
+
* 1. 開発者体験の向上: Drawerのsize、minSize、maxSizeプロパティで
|
|
6
|
+
* 様々な単位(px, vw, vh, %)を受け入れ可能にする
|
|
7
|
+
* 2. 内部処理の統一: すべてのサイズ計算をpx値で統一し、
|
|
8
|
+
* リサイズ処理、バリデーション、アニメーション計算を簡潔にする
|
|
9
|
+
*
|
|
10
|
+
* 使用例:
|
|
11
|
+
* - size="40vw" (ビューポート幅の40%)
|
|
12
|
+
* - size="300px" (固定300ピクセル)
|
|
13
|
+
* - size={400} (数値、px扱い)
|
|
14
|
+
* - size="80%" (画面サイズの80%)
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* 相対値をpx値に変換するヘルパー関数
|
|
18
|
+
* @param value - 変換する値(数値またはvw/vh/%/px等の単位付き文字列)
|
|
19
|
+
* @param direction - Drawerの方向(変換時の基準値決定に使用)
|
|
20
|
+
* @returns px値(数値)
|
|
21
|
+
*/
|
|
22
|
+
export declare const convertToPixels: (value: string | number, direction: "left" | "right" | "bottom") => number;
|
|
@@ -38,6 +38,8 @@ export { default as DateRangePicker } from "./DateRangePicker";
|
|
|
38
38
|
export * from "./DateRangePicker";
|
|
39
39
|
export { default as Divider } from "./Divider";
|
|
40
40
|
export * from "./Divider";
|
|
41
|
+
export { default as Drawer } from "./Drawer";
|
|
42
|
+
export * from "./Drawer";
|
|
41
43
|
export { default as DropdownButton } from "./DropdownButton";
|
|
42
44
|
export * from "./DropdownButton";
|
|
43
45
|
export { default as DualListBox } from "./DualListBox";
|