ingred-ui 33.19.0 → 34.1.0-canary.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/AdvancedFilter/utils/operators.d.ts +2 -4
- package/dist/components/DualListBox2/hooks/useDualListBox2Filter.d.ts +0 -1
- package/dist/components/DualListBox2/index.d.ts +1 -0
- package/dist/components/DualListBox2/lib.d.ts +0 -1
- package/dist/components/FilterComboBox/index.d.ts +1 -0
- package/dist/components/Input/types.d.ts +5 -0
- package/dist/components/Select2/Select2Option.d.ts +6 -0
- package/dist/components/Select2/index.d.ts +1 -0
- package/dist/components/Select2/styled.d.ts +3 -0
- package/dist/components/Select2/types.d.ts +41 -0
- package/dist/components/Select2/utils/__tests__/creatableOption.test.d.ts +1 -0
- package/dist/components/Select2/utils/creatableOption.d.ts +17 -0
- package/dist/index.es.js +696 -671
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +776 -751
- package/dist/index.js.map +1 -1
- package/dist/utils/__tests__/matchesFreeWordQuery.test.d.ts +1 -0
- package/dist/utils/__tests__/normalizeForSearch.test.d.ts +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/matchesFreeWordQuery.d.ts +23 -0
- package/dist/utils/normalizeForSearch.d.ts +4 -0
- package/package.json +33 -21
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* 一元管理により保守性と再利用性を向上させる。
|
|
6
6
|
*/
|
|
7
7
|
import { FilterPresetType, FilterTypeConfig, OperatorDefinition } from "../types";
|
|
8
|
+
import { normalizeForSearch } from "../../../utils";
|
|
8
9
|
/**
|
|
9
10
|
* テキスト系フィルター用オペレーター
|
|
10
11
|
* ID、名前、コメントなどの文字列フィールド向け
|
|
@@ -73,10 +74,7 @@ export declare const selectOperatorsByIndex: (operators: OperatorDefinition[], i
|
|
|
73
74
|
* フィルタリング処理用のヘルパー関数群
|
|
74
75
|
* 実際のデータフィルタリング処理で使用
|
|
75
76
|
*/
|
|
76
|
-
|
|
77
|
-
* 文字列比較用の正規化(大文字小文字・全角半角を区別しない)
|
|
78
|
-
*/
|
|
79
|
-
export declare const normalizeForSearch: (value: string) => string;
|
|
77
|
+
export { normalizeForSearch };
|
|
80
78
|
/**
|
|
81
79
|
* 単一の値に対してオペレーターを適用
|
|
82
80
|
*/
|
|
@@ -8,7 +8,6 @@ type UseDualListBox2FilterProps = {
|
|
|
8
8
|
};
|
|
9
9
|
type UseDualListBox2FilterReturn = {
|
|
10
10
|
currentFilter: string;
|
|
11
|
-
filterWords: string[];
|
|
12
11
|
filteredChildren: ReactNode;
|
|
13
12
|
matchesFilter: (label: string) => boolean;
|
|
14
13
|
handleFilterChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -4,3 +4,4 @@ export { DualListBox2Item } from "./DualListBox2Item";
|
|
|
4
4
|
export { DualListBox2Accordion } from "./DualListBox2Accordion";
|
|
5
5
|
export { DualListBox2Section } from "./DualListBox2Section";
|
|
6
6
|
export { toGroupedItems } from "./lib";
|
|
7
|
+
export { createFreeWordMatcher } from "../../utils/matchesFreeWordQuery";
|
|
@@ -21,4 +21,9 @@ export declare const getInputVariantConfig: (theme: Theme) => Record<InputVarian
|
|
|
21
21
|
export declare const getErrorStyles: (theme: Theme) => {
|
|
22
22
|
borderColor: string;
|
|
23
23
|
shadowColor: string;
|
|
24
|
+
placeholderColor: string;
|
|
24
25
|
};
|
|
26
|
+
export declare const getPlaceholderColor: (theme: Theme, { error, disabled, }?: {
|
|
27
|
+
error?: boolean | undefined;
|
|
28
|
+
disabled?: boolean | undefined;
|
|
29
|
+
}) => string;
|
|
@@ -20,6 +20,12 @@ export type Select2OptionProps = {
|
|
|
20
20
|
* ラベルの後に表示する要素
|
|
21
21
|
*/
|
|
22
22
|
append?: React.ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* この選択肢を削除するときに呼ばれる。
|
|
25
|
+
* 渡したとき、行をホバーすると末尾にゴミ箱が出る。
|
|
26
|
+
* Select2 は選択肢を消さない。親が children と value から外す。
|
|
27
|
+
*/
|
|
28
|
+
onDelete?: () => void;
|
|
23
29
|
};
|
|
24
30
|
/**
|
|
25
31
|
* Select2Optionコンポーネント
|
|
@@ -98,6 +98,9 @@ export declare const StyledContextMenu2TextInputItem: import("styled-components/
|
|
|
98
98
|
as?: import("styled-components").WebTarget | undefined;
|
|
99
99
|
forwardedAs?: import("styled-components").WebTarget | undefined;
|
|
100
100
|
}, "$insetFocusRingPadding">>> & string;
|
|
101
|
+
export declare const DeleteOptionButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<(import("../Button").ButtonProps & import("react").RefAttributes<HTMLButtonElement & HTMLAnchorElement>) & import("styled-components/dist/types").BaseObject, never> & Partial<Pick<(import("../Button").ButtonProps & import("react").RefAttributes<HTMLButtonElement & HTMLAnchorElement>) & import("styled-components/dist/types").BaseObject, never>>> & string & Omit<import("react").ForwardRefExoticComponent<import("../Button").ButtonProps & import("react").RefAttributes<HTMLButtonElement & HTMLAnchorElement>>, keyof import("react").Component<any, {}, any>>;
|
|
102
|
+
export declare const OptionWithDelete: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
103
|
+
export declare const OptionWithDeleteMain: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
101
104
|
export declare const OptionsContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
102
105
|
export declare const LoadingContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
103
106
|
export declare const VisuallyHidden: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>> & string;
|
|
@@ -131,6 +131,40 @@ export type Select2SearchMode = {
|
|
|
131
131
|
*/
|
|
132
132
|
showDefaultOptions?: boolean;
|
|
133
133
|
};
|
|
134
|
+
/**
|
|
135
|
+
* 検索語から新しい選択肢を作る設定。
|
|
136
|
+
* `creatable={true}` のときは、ここにある既定値だけが使われる。
|
|
137
|
+
*/
|
|
138
|
+
export type Select2Creatable = {
|
|
139
|
+
/**
|
|
140
|
+
* 作成行のプレフィックス。表示は `${createMessage} "${入力値}"` になる。
|
|
141
|
+
* 入力値は前後の空白を除いたもの。
|
|
142
|
+
* @default "次の文字列を追加する"
|
|
143
|
+
*/
|
|
144
|
+
createMessage?: string;
|
|
145
|
+
/**
|
|
146
|
+
* 作成行を選んだときに呼ばれる。引数は前後の空白を除いた入力値。
|
|
147
|
+
* 渡したときは Select2 は選択値を変えない。親が children と value を更新する。
|
|
148
|
+
* 渡さないときは、その入力値を値として選ぶ。
|
|
149
|
+
* 単一選択は置き換え、複数選択は追加する。複数選択の確定タイミングは通常の選択と同じ。
|
|
150
|
+
*/
|
|
151
|
+
onCreate?: (inputValue: string) => void;
|
|
152
|
+
/**
|
|
153
|
+
* 追加の作成可否。false なら作成行を出さない。
|
|
154
|
+
* 引数は前後の空白を除いた入力値。
|
|
155
|
+
* 空文字と、既存 option の label / value との一致(大文字小文字を無視)は、この関数より先に常に拒否する。
|
|
156
|
+
*/
|
|
157
|
+
isValidNewOption?: (inputValue: string) => boolean;
|
|
158
|
+
/**
|
|
159
|
+
* 作成の通信中かどうか。
|
|
160
|
+
* true のあいだは作成行を出さない。
|
|
161
|
+
* 単一選択はメニューを閉じ、トリガーを操作できなくして矢印の位置にローディングを出す。
|
|
162
|
+
* 複数選択はメニューを開いたまま、トリガーの矢印とメニューにローディングを出す。
|
|
163
|
+
* onCreate の開始で true にし、待ちが終わったら false に戻す。失敗したときも戻す。
|
|
164
|
+
* @default false
|
|
165
|
+
*/
|
|
166
|
+
isCreating?: boolean;
|
|
167
|
+
};
|
|
134
168
|
export type Select2StyleProps = {
|
|
135
169
|
theme: Theme;
|
|
136
170
|
$size: Select2Size;
|
|
@@ -192,6 +226,13 @@ export type Select2Props = {
|
|
|
192
226
|
* @default false
|
|
193
227
|
*/
|
|
194
228
|
searchable?: boolean;
|
|
229
|
+
/**
|
|
230
|
+
* 検索語から新しい選択肢を作れるようにする。
|
|
231
|
+
* true のときは searchable の指定に関わらず検索窓を出す。
|
|
232
|
+
* オブジェクトを渡すと、作成行の文言や作成時の処理を指定できる。
|
|
233
|
+
* @default false
|
|
234
|
+
*/
|
|
235
|
+
creatable?: boolean | Select2Creatable;
|
|
195
236
|
/**
|
|
196
237
|
* 検索入力のプレースホルダー
|
|
197
238
|
* searchableがtrueの場合のみ使用されます
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const DEFAULT_CREATE_MESSAGE = "\u6B21\u306E\u6587\u5B57\u5217\u3092\u8FFD\u52A0\u3059\u308B";
|
|
2
|
+
export type CreatableMatchOption = {
|
|
3
|
+
value: string | number;
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const formatCreateLabel: (createMessage: string, inputValue: string) => string;
|
|
7
|
+
/**
|
|
8
|
+
* 既存 option の label か value が、入力と大文字小文字を無視して一致するか。
|
|
9
|
+
* 比較の前に前後の空白を落とす。
|
|
10
|
+
*/
|
|
11
|
+
export declare const hasExactOptionMatch: (inputValue: string, options: CreatableMatchOption[]) => boolean;
|
|
12
|
+
/**
|
|
13
|
+
* 作成行を出してよいか。
|
|
14
|
+
* 空文字と既存 option への一致は、isValidNewOption より先に拒否する。
|
|
15
|
+
* isValidNewOption には前後の空白を除いた入力を渡す。
|
|
16
|
+
*/
|
|
17
|
+
export declare const canCreateOption: (inputValue: string, options: CreatableMatchOption[], isValidNewOption?: ((inputValue: string) => boolean) | undefined) => boolean;
|