ingred-ui 30.0.0 → 30.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/DualListBox2/DualListBox2.d.ts +2 -80
- package/dist/components/DualListBox2/DualListBox2SelectedItem.d.ts +8 -0
- package/dist/components/DualListBox2/hooks/useDualListBox2Filter.d.ts +24 -0
- package/dist/components/DualListBox2/lib.d.ts +5 -0
- package/dist/components/DualListBox2/styled.d.ts +6 -3
- package/dist/components/DualListBox2/types.d.ts +86 -1
- package/dist/index.es.js +599 -715
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +619 -735
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,81 +1,3 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
import { type Item } from "./types";
|
|
4
|
-
type DualListBox2Props = {
|
|
5
|
-
/**
|
|
6
|
-
* 選択済みの「追加」項目の配列
|
|
7
|
-
*/
|
|
8
|
-
included: Item[];
|
|
9
|
-
/**
|
|
10
|
-
* 選択済みの「除外」項目の配列
|
|
11
|
-
*/
|
|
12
|
-
excluded: Item[];
|
|
13
|
-
/**
|
|
14
|
-
* 追加ボタンを非活性にし、「除外のみモード」にするかどうか
|
|
15
|
-
*/
|
|
16
|
-
disableInclude?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* 除外ボタンを非活性にし、「追加のみモード」にするかどうか
|
|
19
|
-
*/
|
|
20
|
-
disableExclude?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* メニューに表示するカスタムボタン要素
|
|
23
|
-
*/
|
|
24
|
-
menuButtons?: ReactNode;
|
|
25
|
-
/**
|
|
26
|
-
* データ読み込み中かどうかを示すフラグ
|
|
27
|
-
*/
|
|
28
|
-
loading?: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* 項目リスト(DualListBox2Item, DualListBox2Accordion, DualListBox2Section のいずれかのコンポーネントのみ許可)
|
|
31
|
-
*/
|
|
32
|
-
children: ReactNode;
|
|
33
|
-
/**
|
|
34
|
-
* 「追加」状態の変更イベントハンドラ
|
|
35
|
-
**/
|
|
36
|
-
onIncludedChange: (includedIds: string[]) => void;
|
|
37
|
-
/**
|
|
38
|
-
* 「除外」状態の変更イベントハンドラ
|
|
39
|
-
**/
|
|
40
|
-
onExcludedChange: (excludedIds: string[]) => void;
|
|
41
|
-
/**
|
|
42
|
-
* セクション切り替え時のハンドラ
|
|
43
|
-
**/
|
|
44
|
-
onActiveSectionChange?: (activeSection: string | null) => void;
|
|
45
|
-
/**
|
|
46
|
-
* スクロールによって追加データの読み込みが必要になったときに呼び出されるハンドラ
|
|
47
|
-
**/
|
|
48
|
-
onLoadMore?: () => void;
|
|
49
|
-
/**
|
|
50
|
-
* 1ページあたりの表示件数
|
|
51
|
-
**/
|
|
52
|
-
pageSize?: number;
|
|
53
|
-
/**
|
|
54
|
-
* 1ページあたりの表示件数の選択肢
|
|
55
|
-
**/
|
|
56
|
-
pageSizeOptions?: number[];
|
|
57
|
-
/**
|
|
58
|
-
* 1ページあたりの表示件数が変更されたときのハンドラ
|
|
59
|
-
**/
|
|
60
|
-
onPageSizeChange?: (pageSize: number) => void;
|
|
61
|
-
/**
|
|
62
|
-
* 検索フィルターの文字列
|
|
63
|
-
**/
|
|
64
|
-
filter?: string;
|
|
65
|
-
/**
|
|
66
|
-
* 検索フィルターが変更されたときのハンドラ
|
|
67
|
-
**/
|
|
68
|
-
onFilterChange?: (filter: string) => void;
|
|
69
|
-
/**
|
|
70
|
-
* Floating UIのplacement(メニューの表示位置)
|
|
71
|
-
* 詳細は https://floating-ui.com/docs/tutorial#placements を参照
|
|
72
|
-
*/
|
|
73
|
-
placement?: Placement;
|
|
74
|
-
/**
|
|
75
|
-
* Floating UIのmiddleware配列(高度なメニュー位置制御用)
|
|
76
|
-
* 詳細は https://floating-ui.com/docs/middleware を参照
|
|
77
|
-
*/
|
|
78
|
-
middleware?: Middleware[];
|
|
79
|
-
};
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { DualListBox2Props } from "./types";
|
|
80
3
|
export declare const DualListBox2: React.ForwardRefExoticComponent<DualListBox2Props & React.RefAttributes<HTMLDivElement>>;
|
|
81
|
-
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { type ReactNode } from "react";
|
|
2
|
+
export declare const DualListBox2SelectedItem: React.MemoExoticComponent<({ id, children }: {
|
|
3
|
+
id: string;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}) => JSX.Element>;
|
|
6
|
+
export declare const DualListBox2SelectedLabel: ({ label }: {
|
|
7
|
+
label: string;
|
|
8
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ReactNode, type ChangeEvent } from "react";
|
|
2
|
+
import type { Item } from "../types";
|
|
3
|
+
type UseDualListBox2FilterProps = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
externalFilter: string;
|
|
6
|
+
onFilterChange?: (filter: string) => void;
|
|
7
|
+
allItems: Item[];
|
|
8
|
+
};
|
|
9
|
+
type UseDualListBox2FilterReturn = {
|
|
10
|
+
currentFilter: string;
|
|
11
|
+
filterWords: string[];
|
|
12
|
+
filteredChildren: ReactNode;
|
|
13
|
+
matchesFilter: (label: string) => boolean;
|
|
14
|
+
handleFilterChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
15
|
+
handleFilterReset: () => void;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* DualListBox2 のビルトインテキスト検索を提供するフック。
|
|
19
|
+
*
|
|
20
|
+
* `renderFilterHeader` が指定されている場合、DualListBox2 はこのフックの結果を
|
|
21
|
+
* バイパスし、フィルタリングはアプリ側に委ねられる(詳細は DualListBox2.tsx を参照)。
|
|
22
|
+
*/
|
|
23
|
+
export declare function useDualListBox2Filter({ children, externalFilter, onFilterChange, allItems, }: UseDualListBox2FilterProps): UseDualListBox2FilterReturn;
|
|
24
|
+
export {};
|
|
@@ -17,6 +17,11 @@ export declare const traverseChildren: (children: ReactNode, callback: (child: R
|
|
|
17
17
|
export declare const extractAllItems: (children: ReactNode) => Item[];
|
|
18
18
|
export declare const getAllIds: (children: ReactNode) => string[];
|
|
19
19
|
export declare const extractItemContents: (children: ReactNode) => Record<string, ReactNode>;
|
|
20
|
+
export type GroupedItems = {
|
|
21
|
+
groupName?: string;
|
|
22
|
+
items: Pick<Item, "id" | "label" | "selectedContent">[];
|
|
23
|
+
};
|
|
24
|
+
export declare const toGrouped: (items: Item[]) => GroupedItems[];
|
|
20
25
|
type groupedItems = {
|
|
21
26
|
groupName?: string;
|
|
22
27
|
items: Item[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export declare const DualListBox2: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
2
3
|
export declare const TabList: import("styled-components").StyledComponent<"ul", import("styled-components").DefaultTheme, {}, never>;
|
|
3
4
|
export declare const CountBadge: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -8,12 +9,14 @@ export declare const LeftPanel: import("styled-components").StyledComponent<"div
|
|
|
8
9
|
export declare const LeftPanelBody: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
9
10
|
export declare const LeftPanelHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
10
11
|
hasMenu?: boolean | undefined;
|
|
12
|
+
hasCustomFilterHeader?: boolean | undefined;
|
|
11
13
|
}, never>;
|
|
12
14
|
export declare const HeaderSearch: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
13
15
|
export declare const HeaderSearchReset: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
14
|
-
export declare const
|
|
16
|
+
export declare const HeaderCustomFilter: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
17
|
+
export declare const HeaderMenuButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../Button").ButtonProps & import("react").RefAttributes<HTMLButtonElement & HTMLAnchorElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
15
18
|
export declare const HeaderCount: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
16
|
-
export declare const HeaderButtons: import("styled-components").StyledComponent<"
|
|
19
|
+
export declare const HeaderButtons: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
17
20
|
export declare const HeaderLoadButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
18
21
|
export declare const RightPanel: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
19
22
|
isShow: boolean;
|
|
@@ -37,7 +40,7 @@ export declare const AccordionHeader: import("styled-components").StyledComponen
|
|
|
37
40
|
$depth: number;
|
|
38
41
|
}, never>;
|
|
39
42
|
export declare const AccordionButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
40
|
-
export declare const AccordionActionButtons: import("styled-components").StyledComponent<"
|
|
43
|
+
export declare const AccordionActionButtons: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
41
44
|
export declare const AccordionIcon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
42
45
|
export declare const SectionButtonBefore: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
43
46
|
export declare const SectionButtonAfter: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { Middleware, Placement } from "@floating-ui/react";
|
|
2
3
|
export type Item = {
|
|
3
4
|
id: string;
|
|
4
5
|
groupName?: string;
|
|
@@ -7,3 +8,87 @@ export type Item = {
|
|
|
7
8
|
childNode?: string;
|
|
8
9
|
selectedContent?: ReactNode;
|
|
9
10
|
};
|
|
11
|
+
export type DualListBox2Props = {
|
|
12
|
+
/**
|
|
13
|
+
* 選択済みの「追加」項目の配列
|
|
14
|
+
*/
|
|
15
|
+
included: Item[];
|
|
16
|
+
/**
|
|
17
|
+
* 選択済みの「除外」項目の配列
|
|
18
|
+
*/
|
|
19
|
+
excluded: Item[];
|
|
20
|
+
/**
|
|
21
|
+
* 追加ボタンを非活性にし、「除外のみモード」にするかどうか
|
|
22
|
+
*/
|
|
23
|
+
disableInclude?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 除外ボタンを非活性にし、「追加のみモード」にするかどうか
|
|
26
|
+
*/
|
|
27
|
+
disableExclude?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* メニューに表示するカスタムボタン要素
|
|
30
|
+
*/
|
|
31
|
+
menuButtons?: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* データ読み込み中かどうかを示すフラグ
|
|
34
|
+
*/
|
|
35
|
+
loading?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* 項目リスト(DualListBox2Item, DualListBox2Accordion, DualListBox2Section のいずれかのコンポーネントのみ許可)
|
|
38
|
+
*/
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* 「追加」状態の変更イベントハンドラ
|
|
42
|
+
**/
|
|
43
|
+
onIncludedChange: (includedIds: string[]) => void;
|
|
44
|
+
/**
|
|
45
|
+
* 「除外」状態の変更イベントハンドラ
|
|
46
|
+
**/
|
|
47
|
+
onExcludedChange: (excludedIds: string[]) => void;
|
|
48
|
+
/**
|
|
49
|
+
* セクション切り替え時のハンドラ
|
|
50
|
+
**/
|
|
51
|
+
onActiveSectionChange?: (activeSection: string | null) => void;
|
|
52
|
+
/**
|
|
53
|
+
* スクロールによって追加データの読み込みが必要になったときに呼び出されるハンドラ
|
|
54
|
+
**/
|
|
55
|
+
onLoadMore?: () => void;
|
|
56
|
+
/**
|
|
57
|
+
* 1ページあたりの表示件数
|
|
58
|
+
**/
|
|
59
|
+
pageSize?: number;
|
|
60
|
+
/**
|
|
61
|
+
* 1ページあたりの表示件数の選択肢
|
|
62
|
+
**/
|
|
63
|
+
pageSizeOptions?: number[];
|
|
64
|
+
/**
|
|
65
|
+
* 1ページあたりの表示件数が変更されたときのハンドラ
|
|
66
|
+
**/
|
|
67
|
+
onPageSizeChange?: (pageSize: number) => void;
|
|
68
|
+
/**
|
|
69
|
+
* 検索フィルターの文字列
|
|
70
|
+
**/
|
|
71
|
+
filter?: string;
|
|
72
|
+
/**
|
|
73
|
+
* 検索フィルターが変更されたときのハンドラ
|
|
74
|
+
**/
|
|
75
|
+
onFilterChange?: (filter: string) => void;
|
|
76
|
+
/**
|
|
77
|
+
* デフォルトの検索UIを置き換えるカスタムフィルターヘッダー。
|
|
78
|
+
* 指定時は内蔵のシンプル検索が非表示になり、フィルタリングはアプリ側の責務となる。
|
|
79
|
+
*
|
|
80
|
+
* セクション型と組み合わせる場合は、セクション未選択時のフィルター無効化や、
|
|
81
|
+
* セクション一覧へ戻ったときのフィルターリセットもアプリ側で制御する。
|
|
82
|
+
**/
|
|
83
|
+
renderFilterHeader?: () => ReactNode;
|
|
84
|
+
/**
|
|
85
|
+
* Floating UIのplacement(メニューの表示位置)
|
|
86
|
+
* 詳細は https://floating-ui.com/docs/tutorial#placements を参照
|
|
87
|
+
*/
|
|
88
|
+
placement?: Placement;
|
|
89
|
+
/**
|
|
90
|
+
* Floating UIのmiddleware配列(高度なメニュー位置制御用)
|
|
91
|
+
* 詳細は https://floating-ui.com/docs/middleware を参照
|
|
92
|
+
*/
|
|
93
|
+
middleware?: Middleware[];
|
|
94
|
+
};
|