ingred-ui 34.0.0 → 34.1.0-canary.1
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/Select2/Select2Option.d.ts +6 -0
- package/dist/components/Select2/styled.d.ts +5 -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 +19 -0
- package/dist/index.es.js +645 -600
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +771 -726
- package/dist/index.js.map +1 -1
- package/package.json +33 -21
|
@@ -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コンポーネント
|
|
@@ -69,6 +69,8 @@ export declare const IconArea: import("styled-components/dist/types").IStyledCom
|
|
|
69
69
|
$disabled?: boolean | undefined;
|
|
70
70
|
$multiple?: boolean | undefined;
|
|
71
71
|
}, never>>> & string;
|
|
72
|
+
export declare const CreateQueryText: 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;
|
|
73
|
+
export declare const CreateNameRow: 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;
|
|
72
74
|
export declare const StyledContextMenu2TextInputItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<{
|
|
73
75
|
onEnter?: (() => void) | undefined;
|
|
74
76
|
} & import("react").InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>, "$insetFocusRingPadding"> & import("../ContextMenu2/ContextMenu2TextInputItem").ContextMenu2TextInputItemStyledProps, never> & Partial<Pick<import("styled-components").FastOmit<{
|
|
@@ -98,6 +100,9 @@ export declare const StyledContextMenu2TextInputItem: import("styled-components/
|
|
|
98
100
|
as?: import("styled-components").WebTarget | undefined;
|
|
99
101
|
forwardedAs?: import("styled-components").WebTarget | undefined;
|
|
100
102
|
}, "$insetFocusRingPadding">>> & string;
|
|
103
|
+
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>>;
|
|
104
|
+
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;
|
|
105
|
+
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
106
|
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
107
|
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
108
|
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
|
+
* 一覧の末尾へ出す作成メニューのラベル。
|
|
141
|
+
* 押すとその行が入力欄になり、アイコンは鉛筆に変わる。Enter でその名前を作成する。Esc では入力を取り消してこのメニューに戻る。検索窓は使わない。
|
|
142
|
+
* @default "新規作成"
|
|
143
|
+
*/
|
|
144
|
+
createActionLabel?: 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,19 @@
|
|
|
1
|
+
export declare const CREATE_FROM_SEARCH_MESSAGE = "\u65B0\u898F\u4F5C\u6210\u3059\u308B";
|
|
2
|
+
export declare const DEFAULT_CREATE_ACTION_LABEL = "\u65B0\u898F\u4F5C\u6210";
|
|
3
|
+
export declare const CREATE_NAME_PLACEHOLDER = "\u4F5C\u6210\u3059\u308B\u540D\u79F0\u3092\u5165\u529B";
|
|
4
|
+
export type CreatableMatchOption = {
|
|
5
|
+
value: string | number;
|
|
6
|
+
label: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const formatCreateLabel: (inputValue: string) => string;
|
|
9
|
+
/**
|
|
10
|
+
* 既存 option の label か value が、入力と大文字小文字を無視して一致するか。
|
|
11
|
+
* 比較の前に前後の空白を落とす。
|
|
12
|
+
*/
|
|
13
|
+
export declare const hasExactOptionMatch: (inputValue: string, options: CreatableMatchOption[]) => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* 作成行を出してよいか。
|
|
16
|
+
* 空文字と既存 option への一致は、isValidNewOption より先に拒否する。
|
|
17
|
+
* isValidNewOption には前後の空白を除いた入力を渡す。
|
|
18
|
+
*/
|
|
19
|
+
export declare const canCreateOption: (inputValue: string, options: CreatableMatchOption[], isValidNewOption?: ((inputValue: string) => boolean) | undefined) => boolean;
|