ingred-ui 33.0.0 → 33.1.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/ContextMenu2/ContextMenu2SortableItem.d.ts +15 -3
- package/dist/components/ContextMenu2/ContextMenu2TriggerItem.d.ts +1 -0
- package/dist/components/ContextMenu2/index.d.ts +1 -1
- package/dist/components/DataTable2/DataTable2.d.ts +7 -2
- package/dist/components/DataTable2/DataTable2Column.d.ts +1 -1
- package/dist/components/DataTable2/context.d.ts +3 -2
- package/dist/components/DataTable2/index.d.ts +1 -1
- package/dist/components/DataTable2/types.d.ts +23 -0
- package/dist/components/DataTable2/utils/__tests__/columnEditCapabilities.test.d.ts +1 -0
- package/dist/components/DataTable2/utils/columnEditCapabilities.d.ts +30 -0
- package/dist/components/Icon/Icon.d.ts +1 -1
- package/dist/components/Icon/internal/ListOrdered2Icon/index.d.ts +4 -0
- package/dist/components/Icon/internal/Translate2Icon/index.d.ts +4 -0
- package/dist/index.es.js +649 -636
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +667 -654
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import React, { type ReactNode
|
|
1
|
+
import React, { type ReactNode } from "react";
|
|
2
2
|
import { type UniqueIdentifier } from "@dnd-kit/core";
|
|
3
3
|
export declare const ContextMenu2SortableContext: React.Context<{
|
|
4
4
|
isSorting: boolean;
|
|
5
5
|
setIsSorting: (_: boolean) => void;
|
|
6
6
|
}>;
|
|
7
7
|
type ContextMenu2SortableContainerProps = {
|
|
8
|
+
/** SortableContext に登録する ID(並べ替え可能な項目のみ) */
|
|
8
9
|
order: UniqueIdentifier[];
|
|
9
|
-
|
|
10
|
+
/** 固定行を含む表示順。省略時は order と同じ */
|
|
11
|
+
displayOrder?: UniqueIdentifier[];
|
|
12
|
+
children: ReactNode;
|
|
10
13
|
onOrderChange: (order: UniqueIdentifier[]) => void;
|
|
11
14
|
};
|
|
12
|
-
export declare const ContextMenu2SortableGroup: ({ order, children, onOrderChange, }: ContextMenu2SortableContainerProps) => React.JSX.Element;
|
|
15
|
+
export declare const ContextMenu2SortableGroup: ({ order, displayOrder, children, onOrderChange, }: ContextMenu2SortableContainerProps) => React.JSX.Element;
|
|
13
16
|
type ContextMenu2SortableItemProps = {
|
|
14
17
|
id: UniqueIdentifier;
|
|
15
18
|
disabled?: boolean;
|
|
@@ -19,4 +22,13 @@ export declare const ContextMenu2SortableItem: {
|
|
|
19
22
|
({ id, disabled, children, }: ContextMenu2SortableItemProps): React.JSX.Element;
|
|
20
23
|
displayName: string;
|
|
21
24
|
};
|
|
25
|
+
type ContextMenu2SortableFixedItemProps = {
|
|
26
|
+
id: UniqueIdentifier;
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
};
|
|
29
|
+
/** 並べ替え不可の行。SortableGroup 内で SortableContext の外として描画する */
|
|
30
|
+
export declare const ContextMenu2SortableFixedItem: {
|
|
31
|
+
({ id, children, }: ContextMenu2SortableFixedItemProps): React.JSX.Element;
|
|
32
|
+
displayName: string;
|
|
33
|
+
};
|
|
22
34
|
export {};
|
|
@@ -8,4 +8,4 @@ export { ContextMenu2SwitchItem } from "./ContextMenu2SwitchItem";
|
|
|
8
8
|
export { ContextMenu2TextInputItem } from "./ContextMenu2TextInputItem";
|
|
9
9
|
export { ContextMenu2SeparatorItem } from "./ContextMenu2SeparatorItem";
|
|
10
10
|
export { ContextMenu2ButtonControlsItem } from "./ContextMenu2ButtonControlsItem";
|
|
11
|
-
export { ContextMenu2SortableGroup, ContextMenu2SortableItem, } from "./ContextMenu2SortableItem";
|
|
11
|
+
export { ContextMenu2SortableGroup, ContextMenu2SortableItem, ContextMenu2SortableFixedItem, } from "./ContextMenu2SortableItem";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { type ReactNode } from "react";
|
|
2
|
-
import type { TableColumn } from "./types";
|
|
2
|
+
import type { DataTable2ColumnEditFeatures, TableColumn } from "./types";
|
|
3
3
|
import type { TableAction } from "./types/tableActions";
|
|
4
4
|
type DataTable2Props = {
|
|
5
5
|
/**
|
|
@@ -63,6 +63,11 @@ type DataTable2Props = {
|
|
|
63
63
|
* @default true
|
|
64
64
|
*/
|
|
65
65
|
enableRowSelection?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* カラム編集メニューでエンドユーザーに許可する操作。
|
|
68
|
+
* 例: `{ reorder: false }` で表示 ON/OFF のみ、`{ visibility: false }` で並び替えのみ。
|
|
69
|
+
*/
|
|
70
|
+
columnEditFeatures?: DataTable2ColumnEditFeatures;
|
|
66
71
|
} & {
|
|
67
72
|
/**
|
|
68
73
|
* 見た目の制御。枠線で囲むか否か。枠線で囲むと角丸も適用される
|
|
@@ -75,5 +80,5 @@ type DataTable2Props = {
|
|
|
75
80
|
*/
|
|
76
81
|
onCheckedRowsChange?: (checkedRows: string[]) => void;
|
|
77
82
|
};
|
|
78
|
-
export declare const DataTable2: ({ bordered, currentPage, pageSize, pageSizeOptions, totalCount, columns, onPageChange, onPageSizeChange, onColumnsChange, onCheckedRowsChange, children, tableActions, customTableActionArea, enableRowSelection, }: DataTable2Props) => React.JSX.Element;
|
|
83
|
+
export declare const DataTable2: ({ bordered, currentPage, pageSize, pageSizeOptions, totalCount, columns, onPageChange, onPageSizeChange, onColumnsChange, onCheckedRowsChange, children, tableActions, customTableActionArea, enableRowSelection, columnEditFeatures: columnEditFeaturesProp, }: DataTable2Props) => React.JSX.Element;
|
|
79
84
|
export {};
|
|
@@ -4,7 +4,7 @@ type DataTable2ColumnProps = {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
/**
|
|
6
6
|
* 横スクロール時に列をビューポート右端に固定する。**最大 1 列**のみ指定可(先にマウントした列が有効)。
|
|
7
|
-
* カラム編集で動かさない場合は `TableColumn.
|
|
7
|
+
* カラム編集で動かさない場合は `TableColumn.reorderable: false`(または `sortable: false`)の末尾列に付けることを推奨。
|
|
8
8
|
*/
|
|
9
9
|
sticky?: "right";
|
|
10
10
|
isResizable: true;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { TableColumn } from "./types";
|
|
2
|
+
import type { ResolvedDataTable2ColumnEditFeatures, 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[];
|
|
@@ -8,6 +8,7 @@ export declare const DataTable2Context: import("react").Context<{
|
|
|
8
8
|
hasRowControls: boolean;
|
|
9
9
|
checkedRows: string[];
|
|
10
10
|
columns: TableColumn[];
|
|
11
|
+
columnEditFeatures: ResolvedDataTable2ColumnEditFeatures;
|
|
11
12
|
setRowIds: (rowIds: string[]) => void;
|
|
12
13
|
setCheckedRows: (rowIds: string[]) => void;
|
|
13
14
|
setColumns: (columns: TableColumn[]) => void;
|
|
@@ -31,7 +32,7 @@ export declare const DataTable2StickyScrollContext: import("react").Context<{
|
|
|
31
32
|
}>;
|
|
32
33
|
/**
|
|
33
34
|
* `sticky="right"` は **最大 1 列**(先に登録した列のみ有効。2 列目は開発時に警告して無視)。
|
|
34
|
-
* 利用上は **右端列**(例: 操作列)に `
|
|
35
|
+
* 利用上は **右端列**(例: 操作列)に `reorderable: false`(または後方互換の `sortable: false`)を付け、カラム編集で末尾固定にして移動させないことを推奨。
|
|
35
36
|
*/
|
|
36
37
|
export declare const DataTable2ColumnStickyContext: import("react").Context<{
|
|
37
38
|
registerColumnSticky: (index: number, sticky: "right" | undefined) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { TableColumn, SortDirection } from "./types";
|
|
1
|
+
export type { TableColumn, SortDirection, DataTable2ColumnEditFeatures, } from "./types";
|
|
2
2
|
export type { TableAction } from "./types/tableActions";
|
|
3
3
|
export { DataTable2 } from "./DataTable2";
|
|
4
4
|
export { DataTable2Head } from "./DataTable2Head";
|
|
@@ -1,9 +1,32 @@
|
|
|
1
|
+
/** カラム編集メニューでエンドユーザーに許可する操作(テーブル単位) */
|
|
2
|
+
export type DataTable2ColumnEditFeatures = {
|
|
3
|
+
/** 並び替えを許可する。false のとき全列のドラッグハンドルを無効化する */
|
|
4
|
+
reorder?: boolean;
|
|
5
|
+
/** 表示 ON/OFF を許可する。false のとき全列のスイッチを無効化する */
|
|
6
|
+
visibility?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type ResolvedDataTable2ColumnEditFeatures = Required<DataTable2ColumnEditFeatures>;
|
|
1
9
|
export type TableColumn = {
|
|
2
10
|
id: string;
|
|
3
11
|
label: string;
|
|
4
12
|
order: number;
|
|
5
13
|
visible: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* カラム編集での位置ロックと編集可否の後方互換用フラグ。
|
|
16
|
+
* `reorderable` / `visibilityEditable` 未指定時はこの値が両方の既定になる。
|
|
17
|
+
*
|
|
18
|
+
* @deprecated 新規は `reorderable` と `visibilityEditable` を明示してください。
|
|
19
|
+
*/
|
|
6
20
|
sortable: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* カラム編集で並び替え可能か。未指定時は `sortable` に従う。
|
|
23
|
+
* false の列は先頭/末尾の固定ブロックに入り、ドラッグで動かせない。
|
|
24
|
+
*/
|
|
25
|
+
reorderable?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* カラム編集で表示 ON/OFF 可能か。未指定時は `sortable` に従う。
|
|
28
|
+
*/
|
|
29
|
+
visibilityEditable?: boolean;
|
|
7
30
|
/**
|
|
8
31
|
* true で入力値あり、false で入力値なし、undefined でフィルタ入力機能なし
|
|
9
32
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { DataTable2ColumnEditFeatures, ResolvedDataTable2ColumnEditFeatures, TableColumn } from "../types";
|
|
2
|
+
export declare function resolveColumnEditFeatures(features?: DataTable2ColumnEditFeatures): ResolvedDataTable2ColumnEditFeatures;
|
|
3
|
+
/** カラム編集メニューでの並び替え可否(列定義。テーブル単位は別途かける) */
|
|
4
|
+
export declare function isColumnPositionLocked(column: TableColumn): boolean;
|
|
5
|
+
export declare function resolveColumnReorderable(column: TableColumn, tableFeatures: ResolvedDataTable2ColumnEditFeatures): boolean;
|
|
6
|
+
export declare function resolveColumnVisibilityEditable(column: TableColumn, tableFeatures: ResolvedDataTable2ColumnEditFeatures): boolean;
|
|
7
|
+
export declare function shouldShowColumnEditMenu(columns: TableColumn[], tableFeatures: ResolvedDataTable2ColumnEditFeatures): boolean;
|
|
8
|
+
export type ColumnEditMenuSegment = {
|
|
9
|
+
type: "fixed";
|
|
10
|
+
columns: TableColumn[];
|
|
11
|
+
} | {
|
|
12
|
+
type: "reorderable";
|
|
13
|
+
columns: TableColumn[];
|
|
14
|
+
};
|
|
15
|
+
/** 表示順を保ったまま、連続する並べ替え可能列だけを reorderable セグメントにまとめる */
|
|
16
|
+
export declare function segmentColumnsForEditMenu(orderedColumns: TableColumn[]): ColumnEditMenuSegment[];
|
|
17
|
+
/** @deprecated segmentColumnsForEditMenu を使用してください */
|
|
18
|
+
export declare function groupColumnsForEditMenu(orderedColumns: TableColumn[]): {
|
|
19
|
+
startFixed: TableColumn[];
|
|
20
|
+
reorderable: TableColumn[];
|
|
21
|
+
endFixed: TableColumn[];
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* 並べ替え可能列だけの新しい順序から column.order を再計算する。
|
|
25
|
+
* reorderable でない列はもとのインデックスに固定し、並べ替え可能列だけが空きスロットに入る。
|
|
26
|
+
*/
|
|
27
|
+
export declare function applyReorderableOrderChange(columns: TableColumn[], newReorderableOrder: (string | number)[], tableFeatures: ResolvedDataTable2ColumnEditFeatures): TableColumn[];
|
|
28
|
+
/** @deprecated applyReorderableOrderChange を使用してください */
|
|
29
|
+
export declare function applyColumnOrderFromDrag(columns: TableColumn[], newVisualOrder: (string | number)[], tableFeatures: ResolvedDataTable2ColumnEditFeatures): TableColumn[];
|
|
30
|
+
export declare function getColumnEditHelpText(tableFeatures: ResolvedDataTable2ColumnEditFeatures): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
/** @deprecated "arrow_bottom" は "arrow_down" に置き換わりました */
|
|
3
3
|
type DeprecatedArrowBottom = "arrow_bottom";
|
|
4
|
-
export type IconName = "dashboard" | "bar_chart" | "bar_chart_framed" | "line_chart_framed" | "multi_line_chart_framed" | "logout" | "setting" | "arrow_up" | "arrow_down" | "arrow_left" | "arrow_right" | "pencil" | "delete_bin" | "close" | "forbid" | "check" | "eye" | "eye_off" | "exclamation" | "expand_diagonal_s_fill" | "arrow_double_left" | "arrow_double_right" | "question" | "zoom_in" | "sort_up" | "sort_down" | "sort_inactive" | "folder" | "folder_open" | "refresh_line" | "return_line" | "link" | "unlink" | "no_link" | "search" | "import" | "export" | "add_line" | "more" | "more_vert" | "date_range" | "external_link" | "desktop" | "mobile" | "desktop_mobile" | "copy" | "truck" | "camera_movie" | "code_file" | "cart_secure" | "profile" | "auction" | "mail" | "mail_open" | "filter" | "notification" | "user_settings" | "company_settings" | "heart_pulse" | "checkbox_circle" | "alert" | "base_station" | "braille" | "label" | "download_cloud" | "save" | "sidebar_fold" | "sidebar_unfold" | "skip_down" | "close_circle" | "bid_strap" | "fluct" | "data_strap" | "company" | "document" | "user" | "information" | "analytics" | "support" | "apps" | "ad_block" | "building" | "image" | "calendar" | "menu" | "file_list" | "draft" | "time" | "stop_circle" | "play_circle" | "sort_asc" | "sort_desc" | "bar_chart_search" | "check_thin" | "image_check" | "group2" | "key" | "operator_match" | "operator_does_not_match" | "operator_contains" | "operator_does_not_contains" | "operator_starts_with" | "operator_ends_with" | "operator_equal" | "operator_not_equal" | "operator_greater_than" | "operator_greater_than_or_equal_to" | "operator_less_than" | "operator_less_than_or_equal_to" | "bookmark" | "circle" | "money_dollar_circle" | "money_jpy_circle" | "expand_list" | "collapse_list" | "history" | "keyvalue" | "dashboard2" | "calculator" | "upload_cloud" | "corner_down_right";
|
|
4
|
+
export type IconName = "dashboard" | "bar_chart" | "bar_chart_framed" | "line_chart_framed" | "multi_line_chart_framed" | "logout" | "setting" | "arrow_up" | "arrow_down" | "arrow_left" | "arrow_right" | "pencil" | "delete_bin" | "close" | "forbid" | "check" | "eye" | "eye_off" | "exclamation" | "expand_diagonal_s_fill" | "arrow_double_left" | "arrow_double_right" | "question" | "zoom_in" | "sort_up" | "sort_down" | "sort_inactive" | "folder" | "folder_open" | "refresh_line" | "return_line" | "link" | "list_ordered_2" | "unlink" | "no_link" | "search" | "import" | "export" | "add_line" | "more" | "more_vert" | "date_range" | "external_link" | "desktop" | "mobile" | "desktop_mobile" | "copy" | "truck" | "translate_2" | "camera_movie" | "code_file" | "cart_secure" | "profile" | "auction" | "mail" | "mail_open" | "filter" | "notification" | "user_settings" | "company_settings" | "heart_pulse" | "checkbox_circle" | "alert" | "base_station" | "braille" | "label" | "download_cloud" | "save" | "sidebar_fold" | "sidebar_unfold" | "skip_down" | "close_circle" | "bid_strap" | "fluct" | "data_strap" | "company" | "document" | "user" | "information" | "analytics" | "support" | "apps" | "ad_block" | "building" | "image" | "calendar" | "menu" | "file_list" | "draft" | "time" | "stop_circle" | "play_circle" | "sort_asc" | "sort_desc" | "bar_chart_search" | "check_thin" | "image_check" | "group2" | "key" | "operator_match" | "operator_does_not_match" | "operator_contains" | "operator_does_not_contains" | "operator_starts_with" | "operator_ends_with" | "operator_equal" | "operator_not_equal" | "operator_greater_than" | "operator_greater_than_or_equal_to" | "operator_less_than" | "operator_less_than_or_equal_to" | "bookmark" | "circle" | "money_dollar_circle" | "money_jpy_circle" | "expand_list" | "collapse_list" | "history" | "keyvalue" | "dashboard2" | "calculator" | "upload_cloud" | "corner_down_right";
|
|
5
5
|
type IconType = "fill" | "line";
|
|
6
6
|
type IconColor = IconType | "active" | string;
|
|
7
7
|
export type IconSize = "sm" | "sm-md" | "md" | "md-lg" | "lg";
|