@atlaskit/link-create 0.10.0 → 1.0.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/CHANGELOG.md +12 -0
- package/dist/cjs/controllers/create-field/index.js +12 -0
- package/dist/cjs/controllers/create-field/main.js +62 -0
- package/dist/cjs/index.js +12 -0
- package/dist/cjs/ui/create-form/async-select/main.js +117 -35
- package/dist/cjs/ui/create-form/form-footer/main.js +9 -2
- package/dist/cjs/ui/create-form/form-spy/index.js +27 -0
- package/dist/cjs/ui/create-form/index.js +15 -1
- package/dist/cjs/ui/create-form/main.js +20 -10
- package/dist/cjs/ui/create-form/select/index.js +12 -0
- package/dist/cjs/ui/create-form/select/main.js +50 -0
- package/dist/cjs/ui/create-form/select/types.js +5 -0
- package/dist/cjs/ui/create-form/textfield/main.js +26 -48
- package/dist/cjs/ui/index.js +15 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/controllers/create-field/index.js +1 -0
- package/dist/es2019/controllers/create-field/main.js +57 -0
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/ui/create-form/async-select/main.js +75 -34
- package/dist/es2019/ui/create-form/form-footer/main.js +9 -2
- package/dist/es2019/ui/create-form/form-spy/index.js +18 -0
- package/dist/es2019/ui/create-form/index.js +3 -1
- package/dist/es2019/ui/create-form/main.js +25 -16
- package/dist/es2019/ui/create-form/select/index.js +1 -0
- package/dist/es2019/ui/create-form/select/main.js +40 -0
- package/dist/es2019/ui/create-form/textfield/main.js +24 -48
- package/dist/es2019/ui/index.js +3 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/controllers/create-field/index.js +1 -0
- package/dist/esm/controllers/create-field/main.js +56 -0
- package/dist/esm/controllers/create-field/types.js +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/ui/create-form/async-select/main.js +118 -36
- package/dist/esm/ui/create-form/form-footer/main.js +9 -2
- package/dist/esm/ui/create-form/form-spy/index.js +19 -0
- package/dist/esm/ui/create-form/index.js +3 -1
- package/dist/esm/ui/create-form/main.js +19 -8
- package/dist/esm/ui/create-form/select/index.js +1 -0
- package/dist/esm/ui/create-form/select/main.js +42 -0
- package/dist/esm/ui/create-form/select/types.js +1 -0
- package/dist/esm/ui/create-form/textfield/main.js +25 -47
- package/dist/esm/ui/index.js +3 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/common/utils/form/index.d.ts +2 -2
- package/dist/types/controllers/create-field/index.d.ts +1 -0
- package/dist/types/controllers/create-field/main.d.ts +3 -0
- package/dist/types/controllers/create-field/types.d.ts +24 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/ui/create-form/async-select/main.d.ts +5 -5
- package/dist/types/ui/create-form/async-select/types.d.ts +9 -4
- package/dist/types/ui/create-form/form-spy/index.d.ts +12 -0
- package/dist/types/ui/create-form/index.d.ts +2 -0
- package/dist/types/ui/create-form/main.d.ts +2 -1
- package/dist/types/ui/create-form/select/index.d.ts +1 -0
- package/dist/types/ui/create-form/select/main.d.ts +12 -0
- package/dist/types/ui/create-form/select/types.d.ts +18 -0
- package/dist/types/ui/create-form/textfield/main.d.ts +2 -1
- package/dist/types/ui/index.d.ts +2 -0
- package/dist/types-ts4.5/common/utils/form/index.d.ts +2 -2
- package/dist/types-ts4.5/controllers/create-field/index.d.ts +1 -0
- package/dist/types-ts4.5/controllers/create-field/main.d.ts +3 -0
- package/dist/types-ts4.5/controllers/create-field/types.d.ts +24 -0
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/create-form/async-select/main.d.ts +5 -5
- package/dist/types-ts4.5/ui/create-form/async-select/types.d.ts +9 -4
- package/dist/types-ts4.5/ui/create-form/form-spy/index.d.ts +12 -0
- package/dist/types-ts4.5/ui/create-form/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/create-form/main.d.ts +2 -1
- package/dist/types-ts4.5/ui/create-form/select/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/create-form/select/main.d.ts +12 -0
- package/dist/types-ts4.5/ui/create-form/select/types.d.ts +18 -0
- package/dist/types-ts4.5/ui/create-form/textfield/main.d.ts +2 -1
- package/dist/types-ts4.5/ui/index.d.ts +2 -0
- package/example-helpers/mock-plugin-form.tsx +1 -3
- package/package.json +7 -4
- package/report.api.md +54 -11
- package/tmp/api-report-tmp.d.ts +32 -4
- package/dist/cjs/ui/group-selection/index.js +0 -22
- package/dist/es2019/ui/group-selection/index.js +0 -16
- package/dist/esm/ui/group-selection/index.js +0 -15
- package/dist/types/ui/group-selection/index.d.ts +0 -4
- package/dist/types/ui/group-selection/types.d.ts +0 -12
- package/dist/types-ts4.5/ui/group-selection/index.d.ts +0 -4
- package/dist/types-ts4.5/ui/group-selection/types.d.ts +0 -12
- /package/dist/cjs/{ui/group-selection → controllers/create-field}/types.js +0 -0
- /package/dist/es2019/{ui/group-selection → controllers/create-field}/types.js +0 -0
- /package/dist/{esm/ui/group-selection → es2019/ui/create-form/select}/types.js +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FieldInputProps } from 'react-final-form';
|
|
3
|
+
import { Validator } from '../../common/types';
|
|
4
|
+
type FieldProps = FieldInputProps<any, HTMLElement> & {
|
|
5
|
+
fieldId: string;
|
|
6
|
+
isInvalid: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type CreateFieldProps = {
|
|
9
|
+
id?: string;
|
|
10
|
+
/** Name passed to the <Field>.*/
|
|
11
|
+
name: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Optional text below the textfield explaining any requirements for a valid value.
|
|
15
|
+
* eg. "Must be 4 or more letters"
|
|
16
|
+
*/
|
|
17
|
+
validationHelpText?: string;
|
|
18
|
+
/** Validators for this field */
|
|
19
|
+
validators?: Validator[];
|
|
20
|
+
isRequired?: boolean;
|
|
21
|
+
testId: string;
|
|
22
|
+
children: (fieldProps: FieldProps) => React.ReactNode;
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { CreateFormProps } from './ui/index';
|
|
2
2
|
export type { LinkCreateProps, LinkCreatePlugin, LinkCreateWithModalProps, CreatePayload, } from './common/types';
|
|
3
|
-
export { default, TextField, CreateForm, AsyncSelect, CreateFormLoader, } from './ui/index';
|
|
3
|
+
export { default, TextField, CreateForm, Select, AsyncSelect, CreateFormLoader, FormSpy, } from './ui/index';
|
|
4
4
|
export { useLinkCreateCallback, LinkCreateCallbackProvider, } from './controllers/callback-context';
|
|
5
5
|
export type { Validator, ValidatorMap } from './common/types';
|
|
@@ -3,9 +3,9 @@ import { OptionType } from '@atlaskit/select';
|
|
|
3
3
|
import { AsyncSelectProps } from './types';
|
|
4
4
|
export declare const TEST_ID = "link-create-async-select";
|
|
5
5
|
/**
|
|
6
|
-
* An async select utilising the Atlaskit AsyncSelect and Field
|
|
7
|
-
* Validation is handled by the form
|
|
8
|
-
* the handleSubmit function passed to the form <Form> that
|
|
9
|
-
* of this
|
|
6
|
+
* An async select utilising the Atlaskit AsyncSelect and Field components from
|
|
7
|
+
* `@atlaskit/form`. Validation is handled by the form on form submission. Any
|
|
8
|
+
* errors returned by the handleSubmit function passed to the form <Form> that
|
|
9
|
+
* have a key matching the `name` of this field are shown below the field.
|
|
10
10
|
*/
|
|
11
|
-
export declare function AsyncSelect<T = OptionType>({
|
|
11
|
+
export declare function AsyncSelect<T = OptionType>({ id, name, label, isRequired, validators, validationHelpText, testId, defaultOption: propsDefaultValue, loadOptions, ...restProps }: AsyncSelectProps<T>): jsx.JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { AsyncSelectProps as AKAsyncSelectProps, OptionType } from '@atlaskit/select';
|
|
1
|
+
import { AsyncSelectProps as AKAsyncSelectProps, GroupType, OptionType } from '@atlaskit/select';
|
|
2
2
|
import { Validator } from '../../../common/types';
|
|
3
|
-
export type AsyncSelectProps<T = OptionType> = AKAsyncSelectProps<T> & {
|
|
4
|
-
/** Name passed to the <Field
|
|
3
|
+
export type AsyncSelectProps<T = OptionType> = Omit<AKAsyncSelectProps<T>, 'loadOptions'> & {
|
|
4
|
+
/** Name passed to the <Field> */
|
|
5
5
|
name: string;
|
|
6
6
|
/** This should be properly internationalization-ed */
|
|
7
7
|
label: string;
|
|
8
8
|
/**
|
|
9
|
-
* Optional text below the
|
|
9
|
+
* Optional text below the field explaining any requirements for a valid value.
|
|
10
10
|
* eg. "Must be 4 or more letters"
|
|
11
11
|
*/
|
|
12
12
|
validationHelpText?: string;
|
|
@@ -15,4 +15,9 @@ export type AsyncSelectProps<T = OptionType> = AKAsyncSelectProps<T> & {
|
|
|
15
15
|
isRequired?: boolean;
|
|
16
16
|
/** Validators for this field */
|
|
17
17
|
validators?: Validator[];
|
|
18
|
+
/**
|
|
19
|
+
* Function to options to display in async select.
|
|
20
|
+
* **WARNING** Will refetch if function changes.
|
|
21
|
+
*/
|
|
22
|
+
loadOptions?: (inputValue: string) => Promise<T[] | GroupType<T>[]>;
|
|
18
23
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type FormSpyProps<T> = {
|
|
3
|
+
children: ({ values }: {
|
|
4
|
+
values: T;
|
|
5
|
+
}) => React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Lightweight wrapper around the react-final-form
|
|
9
|
+
* FormSpy component so that we can control selectively
|
|
10
|
+
* how much of the API we are commited to.
|
|
11
|
+
*/
|
|
12
|
+
export declare const FormSpy: <T extends Record<string, unknown>>({ children, }: FormSpyProps<T>) => JSX.Element;
|
|
@@ -8,6 +8,7 @@ export interface CreateFormProps<FormData> {
|
|
|
8
8
|
onCancel?: () => void;
|
|
9
9
|
isLoading?: boolean;
|
|
10
10
|
hideFooter?: boolean;
|
|
11
|
+
initialValues?: FormData;
|
|
11
12
|
}
|
|
12
13
|
export declare const TEST_ID = "link-create-form";
|
|
13
|
-
export declare const CreateForm: <FormData_1 extends Record<string, any> = {}>({ children, testId, onSubmit, onCancel, isLoading, hideFooter, }: CreateFormProps<FormData_1>) => jsx.JSX.Element;
|
|
14
|
+
export declare const CreateForm: <FormData_1 extends Record<string, any> = {}>({ children, testId, onSubmit, onCancel, isLoading, hideFooter, initialValues, }: CreateFormProps<FormData_1>) => jsx.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Select } from './main';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import { OptionType } from '@atlaskit/select';
|
|
4
|
+
import { SelectProps } from './types';
|
|
5
|
+
export declare const TEST_ID = "link-create-select";
|
|
6
|
+
/**
|
|
7
|
+
* A select utilising the Atlaskit Select and Field components from
|
|
8
|
+
* `@atlaskit/form`. Validation is handled by the form on form submission. Any
|
|
9
|
+
* errors returned by the handleSubmit function passed to the form <Form> that
|
|
10
|
+
* have a key matching the `name` of this field are shown below the field.
|
|
11
|
+
*/
|
|
12
|
+
export declare function Select<T = OptionType>({ id, name, label, isRequired, validators, validationHelpText, testId, ...restProps }: SelectProps<T>): jsx.JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SelectProps as AKSelectProps, OptionType } from '@atlaskit/select';
|
|
2
|
+
import { Validator } from '../../../common/types';
|
|
3
|
+
export type SelectProps<T = OptionType> = AKSelectProps<T> & {
|
|
4
|
+
/** Name passed to the <Field> */
|
|
5
|
+
name: string;
|
|
6
|
+
/** This should be properly internationalization-ed */
|
|
7
|
+
label: string;
|
|
8
|
+
/**
|
|
9
|
+
* Optional text below the field explaining any requirements for a valid value.
|
|
10
|
+
* eg. "Must be 4 or more letters"
|
|
11
|
+
*/
|
|
12
|
+
validationHelpText?: string;
|
|
13
|
+
testId?: string;
|
|
14
|
+
/** Will display a red astrix next to the field title if true */
|
|
15
|
+
isRequired?: boolean;
|
|
16
|
+
/** Validators for this field */
|
|
17
|
+
validators?: Validator[];
|
|
18
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import { jsx } from '@emotion/react';
|
|
2
3
|
import { TextFieldProps } from './types';
|
|
3
4
|
export declare const TEST_ID = "link-create-text-field";
|
|
@@ -7,4 +8,4 @@ export declare const TEST_ID = "link-create-text-field";
|
|
|
7
8
|
* the handleSubmit function passed to the form <Form> that have a key matching the `name`
|
|
8
9
|
* of this text field are shown above the field.
|
|
9
10
|
*/
|
|
10
|
-
export declare function TextField({
|
|
11
|
+
export declare function TextField({ id, name, label, isRequired, validators, validationHelpText, testId, ...restProps }: TextFieldProps): jsx.JSX.Element;
|
|
@@ -3,4 +3,6 @@ export { TextField } from './create-form/textfield';
|
|
|
3
3
|
export { CreateForm } from './create-form/main';
|
|
4
4
|
export { CreateFormLoader } from './create-form/form-loader';
|
|
5
5
|
export type { CreateFormProps } from './create-form/main';
|
|
6
|
+
export { Select } from './create-form/select';
|
|
6
7
|
export { AsyncSelect } from './create-form/async-select';
|
|
8
|
+
export { FormSpy } from './create-form/form-spy';
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
|
|
3
|
-
import { OptionsType } from '@atlaskit/select';
|
|
4
|
-
|
|
5
3
|
import {
|
|
6
4
|
AsyncSelect,
|
|
7
5
|
CreateForm,
|
|
@@ -42,7 +40,7 @@ export function MockPluginForm({ shouldThrowError }: pluginProps) {
|
|
|
42
40
|
[],
|
|
43
41
|
);
|
|
44
42
|
|
|
45
|
-
const exampleOptions
|
|
43
|
+
const exampleOptions = [
|
|
46
44
|
{ label: 'Option 1', value: 'option-1' },
|
|
47
45
|
{ label: 'Option 2', value: 'option-2' },
|
|
48
46
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-create",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "The driver component of meta creation flow",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,9 +44,12 @@
|
|
|
44
44
|
"@atlaskit/select": "^16.5.0",
|
|
45
45
|
"@atlaskit/spinner": "^15.4.0",
|
|
46
46
|
"@atlaskit/textfield": "^5.6.0",
|
|
47
|
-
"@atlaskit/tokens": "^1.
|
|
47
|
+
"@atlaskit/tokens": "^1.14.0",
|
|
48
48
|
"@babel/runtime": "^7.0.0",
|
|
49
|
-
"@emotion/react": "^11.7.1"
|
|
49
|
+
"@emotion/react": "^11.7.1",
|
|
50
|
+
"debounce-promise": "^3.1.2",
|
|
51
|
+
"final-form": "^4.20.1",
|
|
52
|
+
"react-final-form": "^6.5.3"
|
|
50
53
|
},
|
|
51
54
|
"peerDependencies": {
|
|
52
55
|
"react": "^16.8.0",
|
|
@@ -54,7 +57,7 @@
|
|
|
54
57
|
},
|
|
55
58
|
"devDependencies": {
|
|
56
59
|
"@af/visual-regression": "*",
|
|
57
|
-
"@atlaskit/link-test-helpers": "^
|
|
60
|
+
"@atlaskit/link-test-helpers": "^6.0.0",
|
|
58
61
|
"@atlaskit/visual-regression": "*",
|
|
59
62
|
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
60
63
|
"@testing-library/react": "^12.1.5",
|
package/report.api.md
CHANGED
|
@@ -18,35 +18,43 @@
|
|
|
18
18
|
/// <reference types="react" />
|
|
19
19
|
|
|
20
20
|
import { AsyncSelectProps as AsyncSelectProps_2 } from '@atlaskit/select';
|
|
21
|
+
import { GroupType } from '@atlaskit/select';
|
|
21
22
|
import { jsx } from '@emotion/react';
|
|
22
23
|
import { MemoExoticComponent } from 'react';
|
|
23
24
|
import { ModalDialogProps } from '@atlaskit/modal-dialog';
|
|
24
25
|
import { OptionType } from '@atlaskit/select';
|
|
25
26
|
import { default as React_2 } from 'react';
|
|
26
27
|
import { ReactNode } from 'react';
|
|
28
|
+
import { SelectProps as SelectProps_2 } from '@atlaskit/select';
|
|
27
29
|
import { SpinnerProps } from '@atlaskit/spinner';
|
|
28
30
|
import { TextFieldProps as TextFieldProps_2 } from '@atlaskit/textfield';
|
|
29
31
|
|
|
30
32
|
// @public
|
|
31
33
|
export function AsyncSelect<T = OptionType>({
|
|
32
|
-
|
|
34
|
+
id,
|
|
33
35
|
name,
|
|
34
|
-
|
|
36
|
+
label,
|
|
35
37
|
isRequired,
|
|
36
|
-
testId,
|
|
37
38
|
validators,
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
validationHelpText,
|
|
40
|
+
testId,
|
|
41
|
+
defaultOption: propsDefaultValue,
|
|
42
|
+
loadOptions,
|
|
43
|
+
...restProps
|
|
40
44
|
}: AsyncSelectProps<T>): jsx.JSX.Element;
|
|
41
45
|
|
|
42
46
|
// @public (undocumented)
|
|
43
|
-
type AsyncSelectProps<T = OptionType> =
|
|
47
|
+
type AsyncSelectProps<T = OptionType> = Omit<
|
|
48
|
+
AsyncSelectProps_2<T>,
|
|
49
|
+
'loadOptions'
|
|
50
|
+
> & {
|
|
44
51
|
name: string;
|
|
45
52
|
label: string;
|
|
46
53
|
validationHelpText?: string;
|
|
47
54
|
testId?: string;
|
|
48
55
|
isRequired?: boolean;
|
|
49
56
|
validators?: Validator[];
|
|
57
|
+
loadOptions?: (inputValue: string) => Promise<GroupType<T>[] | T[]>;
|
|
50
58
|
};
|
|
51
59
|
|
|
52
60
|
// @public (undocumented)
|
|
@@ -63,6 +71,7 @@ export const CreateForm: <FormData_1 extends Record<string, any> = {}>({
|
|
|
63
71
|
onCancel,
|
|
64
72
|
isLoading,
|
|
65
73
|
hideFooter,
|
|
74
|
+
initialValues,
|
|
66
75
|
}: CreateFormProps<FormData_1>) => jsx.JSX.Element;
|
|
67
76
|
|
|
68
77
|
// @public (undocumented)
|
|
@@ -77,6 +86,8 @@ export interface CreateFormProps<FormData> {
|
|
|
77
86
|
// (undocumented)
|
|
78
87
|
hideFooter?: boolean;
|
|
79
88
|
// (undocumented)
|
|
89
|
+
initialValues?: FormData;
|
|
90
|
+
// (undocumented)
|
|
80
91
|
isLoading?: boolean;
|
|
81
92
|
// (undocumented)
|
|
82
93
|
onCancel?: () => void;
|
|
@@ -94,6 +105,16 @@ export type CreatePayload = {
|
|
|
94
105
|
data?: Record<string, unknown>;
|
|
95
106
|
};
|
|
96
107
|
|
|
108
|
+
// @public
|
|
109
|
+
export const FormSpy: <T extends Record<string, unknown>>({
|
|
110
|
+
children,
|
|
111
|
+
}: FormSpyProps<T>) => JSX.Element;
|
|
112
|
+
|
|
113
|
+
// @public (undocumented)
|
|
114
|
+
type FormSpyProps<T> = {
|
|
115
|
+
children: ({ values }: { values: T }) => React_2.ReactNode;
|
|
116
|
+
};
|
|
117
|
+
|
|
97
118
|
// @public (undocumented)
|
|
98
119
|
interface Group {
|
|
99
120
|
icon: string;
|
|
@@ -142,14 +163,36 @@ export interface LinkCreateWithModalProps
|
|
|
142
163
|
}
|
|
143
164
|
|
|
144
165
|
// @public
|
|
145
|
-
export function
|
|
146
|
-
|
|
166
|
+
export function Select<T = OptionType>({
|
|
167
|
+
id,
|
|
147
168
|
name,
|
|
148
|
-
|
|
149
|
-
|
|
169
|
+
label,
|
|
170
|
+
isRequired,
|
|
150
171
|
validators,
|
|
151
|
-
|
|
172
|
+
validationHelpText,
|
|
173
|
+
testId,
|
|
174
|
+
...restProps
|
|
175
|
+
}: SelectProps<T>): jsx.JSX.Element;
|
|
176
|
+
|
|
177
|
+
// @public (undocumented)
|
|
178
|
+
type SelectProps<T = OptionType> = SelectProps_2<T> & {
|
|
179
|
+
name: string;
|
|
180
|
+
label: string;
|
|
181
|
+
validationHelpText?: string;
|
|
182
|
+
testId?: string;
|
|
183
|
+
isRequired?: boolean;
|
|
184
|
+
validators?: Validator[];
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
// @public
|
|
188
|
+
export function TextField({
|
|
189
|
+
id,
|
|
190
|
+
name,
|
|
191
|
+
label,
|
|
152
192
|
isRequired,
|
|
193
|
+
validators,
|
|
194
|
+
validationHelpText,
|
|
195
|
+
testId,
|
|
153
196
|
...restProps
|
|
154
197
|
}: TextFieldProps): jsx.JSX.Element;
|
|
155
198
|
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -7,26 +7,29 @@
|
|
|
7
7
|
/// <reference types="react" />
|
|
8
8
|
|
|
9
9
|
import { AsyncSelectProps as AsyncSelectProps_2 } from '@atlaskit/select';
|
|
10
|
+
import { GroupType } from '@atlaskit/select';
|
|
10
11
|
import { jsx } from '@emotion/react';
|
|
11
12
|
import { MemoExoticComponent } from 'react';
|
|
12
13
|
import { ModalDialogProps } from '@atlaskit/modal-dialog';
|
|
13
14
|
import { OptionType } from '@atlaskit/select';
|
|
14
15
|
import { default as React_2 } from 'react';
|
|
15
16
|
import { ReactNode } from 'react';
|
|
17
|
+
import { SelectProps as SelectProps_2 } from '@atlaskit/select';
|
|
16
18
|
import { SpinnerProps } from '@atlaskit/spinner';
|
|
17
19
|
import { TextFieldProps as TextFieldProps_2 } from '@atlaskit/textfield';
|
|
18
20
|
|
|
19
21
|
// @public
|
|
20
|
-
export function AsyncSelect<T = OptionType>({
|
|
22
|
+
export function AsyncSelect<T = OptionType>({ id, name, label, isRequired, validators, validationHelpText, testId, defaultOption: propsDefaultValue, loadOptions, ...restProps }: AsyncSelectProps<T>): jsx.JSX.Element;
|
|
21
23
|
|
|
22
24
|
// @public (undocumented)
|
|
23
|
-
type AsyncSelectProps<T = OptionType> = AsyncSelectProps_2<T> & {
|
|
25
|
+
type AsyncSelectProps<T = OptionType> = Omit<AsyncSelectProps_2<T>, 'loadOptions'> & {
|
|
24
26
|
name: string;
|
|
25
27
|
label: string;
|
|
26
28
|
validationHelpText?: string;
|
|
27
29
|
testId?: string;
|
|
28
30
|
isRequired?: boolean;
|
|
29
31
|
validators?: Validator[];
|
|
32
|
+
loadOptions?: (inputValue: string) => Promise<GroupType<T>[] | T[]>;
|
|
30
33
|
};
|
|
31
34
|
|
|
32
35
|
// @public (undocumented)
|
|
@@ -34,7 +37,7 @@ const ComposedLinkCreate: MemoExoticComponent<(props: LinkCreateWithModalProps)
|
|
|
34
37
|
export default ComposedLinkCreate;
|
|
35
38
|
|
|
36
39
|
// @public (undocumented)
|
|
37
|
-
export const CreateForm: <FormData_1 extends Record<string, any> = {}>({ children, testId, onSubmit, onCancel, isLoading, hideFooter, }: CreateFormProps<FormData_1>) => jsx.JSX.Element;
|
|
40
|
+
export const CreateForm: <FormData_1 extends Record<string, any> = {}>({ children, testId, onSubmit, onCancel, isLoading, hideFooter, initialValues, }: CreateFormProps<FormData_1>) => jsx.JSX.Element;
|
|
38
41
|
|
|
39
42
|
// @public (undocumented)
|
|
40
43
|
export function CreateFormLoader({ size }: Partial<SpinnerProps>): jsx.JSX.Element;
|
|
@@ -46,6 +49,8 @@ export interface CreateFormProps<FormData> {
|
|
|
46
49
|
// (undocumented)
|
|
47
50
|
hideFooter?: boolean;
|
|
48
51
|
// (undocumented)
|
|
52
|
+
initialValues?: FormData;
|
|
53
|
+
// (undocumented)
|
|
49
54
|
isLoading?: boolean;
|
|
50
55
|
// (undocumented)
|
|
51
56
|
onCancel?: () => void;
|
|
@@ -63,6 +68,16 @@ export type CreatePayload = {
|
|
|
63
68
|
data?: Record<string, unknown>;
|
|
64
69
|
};
|
|
65
70
|
|
|
71
|
+
// @public
|
|
72
|
+
export const FormSpy: <T extends Record<string, unknown>>({ children, }: FormSpyProps<T>) => JSX.Element;
|
|
73
|
+
|
|
74
|
+
// @public (undocumented)
|
|
75
|
+
type FormSpyProps<T> = {
|
|
76
|
+
children: ({ values }: {
|
|
77
|
+
values: T;
|
|
78
|
+
}) => React_2.ReactNode;
|
|
79
|
+
};
|
|
80
|
+
|
|
66
81
|
// @public (undocumented)
|
|
67
82
|
interface Group {
|
|
68
83
|
icon: string;
|
|
@@ -109,7 +124,20 @@ export interface LinkCreateWithModalProps extends LinkCreateProps, Partial<Pick<
|
|
|
109
124
|
}
|
|
110
125
|
|
|
111
126
|
// @public
|
|
112
|
-
export function
|
|
127
|
+
export function Select<T = OptionType>({ id, name, label, isRequired, validators, validationHelpText, testId, ...restProps }: SelectProps<T>): jsx.JSX.Element;
|
|
128
|
+
|
|
129
|
+
// @public (undocumented)
|
|
130
|
+
type SelectProps<T = OptionType> = SelectProps_2<T> & {
|
|
131
|
+
name: string;
|
|
132
|
+
label: string;
|
|
133
|
+
validationHelpText?: string;
|
|
134
|
+
testId?: string;
|
|
135
|
+
isRequired?: boolean;
|
|
136
|
+
validators?: Validator[];
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
// @public
|
|
140
|
+
export function TextField({ id, name, label, isRequired, validators, validationHelpText, testId, ...restProps }: TextFieldProps): jsx.JSX.Element;
|
|
113
141
|
|
|
114
142
|
// @public (undocumented)
|
|
115
143
|
type TextFieldProps = Omit<TextFieldProps_2, 'name'> & {
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = GroupSelect;
|
|
7
|
-
var _react = require("@emotion/react");
|
|
8
|
-
/** @jsx jsx */
|
|
9
|
-
|
|
10
|
-
var containerStyles = (0, _react.css)({
|
|
11
|
-
padding: '8px',
|
|
12
|
-
border: '1px solid',
|
|
13
|
-
borderRadius: '4px'
|
|
14
|
-
});
|
|
15
|
-
function GroupSelect(_ref) {
|
|
16
|
-
var testId = _ref.testId,
|
|
17
|
-
groups = _ref.groups;
|
|
18
|
-
return (0, _react.jsx)("div", {
|
|
19
|
-
css: [containerStyles],
|
|
20
|
-
"data-testid": testId
|
|
21
|
-
}, "Not build yet");
|
|
22
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { css, jsx } from '@emotion/react';
|
|
3
|
-
const containerStyles = css({
|
|
4
|
-
padding: '8px',
|
|
5
|
-
border: '1px solid',
|
|
6
|
-
borderRadius: '4px'
|
|
7
|
-
});
|
|
8
|
-
export default function GroupSelect({
|
|
9
|
-
testId,
|
|
10
|
-
groups
|
|
11
|
-
}) {
|
|
12
|
-
return jsx("div", {
|
|
13
|
-
css: [containerStyles],
|
|
14
|
-
"data-testid": testId
|
|
15
|
-
}, "Not build yet");
|
|
16
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { css, jsx } from '@emotion/react';
|
|
3
|
-
var containerStyles = css({
|
|
4
|
-
padding: '8px',
|
|
5
|
-
border: '1px solid',
|
|
6
|
-
borderRadius: '4px'
|
|
7
|
-
});
|
|
8
|
-
export default function GroupSelect(_ref) {
|
|
9
|
-
var testId = _ref.testId,
|
|
10
|
-
groups = _ref.groups;
|
|
11
|
-
return jsx("div", {
|
|
12
|
-
css: [containerStyles],
|
|
13
|
-
"data-testid": testId
|
|
14
|
-
}, "Not build yet");
|
|
15
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Group } from '../../common/types';
|
|
2
|
-
export interface GroupSelectProps {
|
|
3
|
-
/**
|
|
4
|
-
* A `testId` prop is provided for specified elements, which is a unique
|
|
5
|
-
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
6
|
-
* serving as a hook for automated tests */
|
|
7
|
-
testId?: string;
|
|
8
|
-
/**
|
|
9
|
-
* Available groups to display
|
|
10
|
-
*/
|
|
11
|
-
groups: Group[];
|
|
12
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Group } from '../../common/types';
|
|
2
|
-
export interface GroupSelectProps {
|
|
3
|
-
/**
|
|
4
|
-
* A `testId` prop is provided for specified elements, which is a unique
|
|
5
|
-
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
6
|
-
* serving as a hook for automated tests */
|
|
7
|
-
testId?: string;
|
|
8
|
-
/**
|
|
9
|
-
* Available groups to display
|
|
10
|
-
*/
|
|
11
|
-
groups: Group[];
|
|
12
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|