Skip to content

Commit b0820b7

Browse files
authored
feat: allow for file uploads in modals (#644)
1 parent 828a93a commit b0820b7

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

src/constants.ts

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,9 @@ export enum ComponentType {
10571057
/** A container component. */
10581058
CONTAINER = 17,
10591059
/** A label component. */
1060-
LABEL = 18
1060+
LABEL = 18,
1061+
/** A file upload component. */
1062+
FILE_UPLOAD = 19
10611063
}
10621064

10631065
/** The types of component button styles. */
@@ -1204,7 +1206,7 @@ export interface LabelComponent {
12041206
type: ComponentType.LABEL;
12051207
label: string;
12061208
description?: string;
1207-
component: AnySelectComponent | Omit<ComponentTextInput, 'label'>;
1209+
component: AnySelectComponent | ComponentFileUpload | Omit<ComponentTextInput, 'label'>;
12081210
}
12091211

12101212
/** Any component. */
@@ -1219,7 +1221,8 @@ export type AnyComponent =
12191221
| SeparatorComponent
12201222
| FileComponent
12211223
| ContainerComponent
1222-
| LabelComponent;
1224+
| LabelComponent
1225+
| ComponentFileUpload;
12231226

12241227
/** A row of components. */
12251228
export interface ComponentActionRow {
@@ -1404,6 +1407,21 @@ export interface ComponentTextInput {
14041407
placeholder?: string;
14051408
}
14061409

1410+
export interface ComponentFileUpload {
1411+
/** The type of component to use. */
1412+
type: ComponentType.FILE_UPLOAD;
1413+
/** Optional component identifier */
1414+
id?: number;
1415+
/** The identifier of the of the input. */
1416+
custom_id: string;
1417+
/** The minimum files that should be uploaded. */
1418+
min_values?: number;
1419+
/** The maximum files that should be uploaded. */
1420+
max_values?: number;
1421+
/** Whether this component is required to be filled. */
1422+
required?: boolean;
1423+
}
1424+
14071425
/** @hidden */
14081426
export interface ComponentSelectResponse {
14091427
type:

0 commit comments

Comments
 (0)