@atlaskit/link-create 0.4.0 → 0.4.2
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/ui/create-form/main.js +3 -2
- package/dist/cjs/ui/create-form/textfield/main.js +5 -9
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/ui/create-form/main.js +3 -2
- package/dist/es2019/ui/create-form/textfield/main.js +3 -8
- package/dist/es2019/version.json +1 -1
- package/dist/esm/ui/create-form/main.js +3 -2
- package/dist/esm/ui/create-form/textfield/main.js +5 -8
- package/dist/esm/version.json +1 -1
- package/dist/types/ui/create-form/textfield/main.d.ts +1 -1
- package/dist/types/ui/create-form/textfield/types.d.ts +4 -9
- package/dist/types-ts4.0/common/constants.d.ts +3 -0
- package/dist/types-ts4.0/common/types.d.ts +88 -0
- package/dist/types-ts4.0/common/utils/analytics/analytics.codegen.d.ts +48 -0
- package/dist/types-ts4.0/common/utils/analytics/context.d.ts +29 -0
- package/dist/types-ts4.0/common/utils/analytics/index.d.ts +1 -0
- package/dist/types-ts4.0/controllers/callback-context/index.d.ts +1 -0
- package/dist/types-ts4.0/controllers/callback-context/main.d.ts +22 -0
- package/dist/types-ts4.0/controllers/form-context/index.d.ts +1 -0
- package/dist/types-ts4.0/controllers/form-context/main.d.ts +12 -0
- package/dist/types-ts4.0/index.d.ts +7 -0
- package/dist/types-ts4.0/ui/create-form/async-select/index.d.ts +1 -0
- package/dist/types-ts4.0/ui/create-form/async-select/main.d.ts +10 -0
- package/dist/types-ts4.0/ui/create-form/async-select/types.d.ts +18 -0
- package/dist/types-ts4.0/ui/create-form/index.d.ts +3 -0
- package/dist/types-ts4.0/ui/create-form/main.d.ts +10 -0
- package/dist/types-ts4.0/ui/create-form/messages.d.ts +12 -0
- package/dist/types-ts4.0/ui/create-form/textfield/index.d.ts +1 -0
- package/dist/types-ts4.0/ui/create-form/textfield/main.d.ts +9 -0
- package/dist/types-ts4.0/ui/create-form/textfield/types.d.ts +14 -0
- package/dist/types-ts4.0/ui/create-form/types.d.ts +6 -0
- package/dist/types-ts4.0/ui/create-form/utils/index.d.ts +13 -0
- package/dist/types-ts4.0/ui/error-boundary/error-boundary-base/index.d.ts +18 -0
- package/dist/types-ts4.0/ui/error-boundary/error-boundary-ui/error-svg/index.d.ts +4 -0
- package/dist/types-ts4.0/ui/error-boundary/error-boundary-ui/index.d.ts +3 -0
- package/dist/types-ts4.0/ui/error-boundary/error-boundary-ui/messages.d.ts +13 -0
- package/dist/types-ts4.0/ui/error-boundary/index.d.ts +2 -0
- package/dist/types-ts4.0/ui/group-selection/index.d.ts +4 -0
- package/dist/types-ts4.0/ui/group-selection/types.d.ts +12 -0
- package/dist/types-ts4.0/ui/index.d.ts +5 -0
- package/dist/types-ts4.0/ui/main.d.ts +7 -0
- package/dist/types-ts4.0/ui/messages.d.ts +7 -0
- package/dist/types-ts4.0/ui/types.d.ts +6 -0
- package/package.json +4 -3
- package/report.api.md +5 -10
- package/tmp/api-report-tmp.d.ts +143 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/link-create
|
|
2
2
|
|
|
3
|
+
## 0.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`93af54caca2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/93af54caca2) - EDM-6553: no functionality change, just updating UI so that there is padding between the cancel and create button for link-create. Also updated the dropdown error message.
|
|
8
|
+
|
|
9
|
+
## 0.4.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`3c5946b6cdf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3c5946b6cdf) - EDM-6524: remove isRequired prop from textfield in create component as browser validation will not be used, also spread AKTextfield props to stop exposure of testid and placeholder props.
|
|
14
|
+
|
|
3
15
|
## 0.4.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -13,6 +13,7 @@ var _react = require("react");
|
|
|
13
13
|
var _react2 = require("@emotion/react");
|
|
14
14
|
var _reactIntlNext = require("react-intl-next");
|
|
15
15
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
16
|
+
var _button = require("@atlaskit/button");
|
|
16
17
|
var _loadingButton = _interopRequireDefault(require("@atlaskit/button/loading-button"));
|
|
17
18
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
18
19
|
var _form = _interopRequireWildcard(require("@atlaskit/form"));
|
|
@@ -95,7 +96,7 @@ var CreateForm = function CreateForm(_ref) {
|
|
|
95
96
|
}, (0, _react2.jsx)(_error.default, {
|
|
96
97
|
label: formErrorMessage,
|
|
97
98
|
primaryColor: "var(--ds-icon-danger, #E34935)"
|
|
98
|
-
}), formErrorMessage), (0, _react2.jsx)(_standardButton.default, {
|
|
99
|
+
}), formErrorMessage), (0, _react2.jsx)(_button.ButtonGroup, null, (0, _react2.jsx)(_standardButton.default, {
|
|
99
100
|
appearance: "subtle",
|
|
100
101
|
onClick: handleCancel,
|
|
101
102
|
testId: 'cancel-button'
|
|
@@ -104,7 +105,7 @@ var CreateForm = function CreateForm(_ref) {
|
|
|
104
105
|
type: "submit",
|
|
105
106
|
isLoading: submitting,
|
|
106
107
|
testId: 'create-button'
|
|
107
|
-
}, intl.formatMessage(_messages.messages.create))));
|
|
108
|
+
}, intl.formatMessage(_messages.messages.create)))));
|
|
108
109
|
});
|
|
109
110
|
};
|
|
110
111
|
exports.CreateForm = CreateForm;
|
|
@@ -6,27 +6,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.TextField = TextField;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
10
|
var _react = require("react");
|
|
10
11
|
var _react2 = require("@emotion/react");
|
|
11
12
|
var _form = require("@atlaskit/form");
|
|
12
13
|
var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
|
|
13
14
|
var _formContext = require("../../../controllers/form-context");
|
|
15
|
+
var _excluded = ["label", "name", "validationHelpText", "validators"];
|
|
14
16
|
/** @jsx jsx */
|
|
15
|
-
|
|
16
17
|
/**
|
|
17
18
|
* A text field utilising the Atlaskit Textfield and Field objects from `@atlaskit/form`.
|
|
18
19
|
* Validation is handled by the form as it is on form submission. Any errors returned by
|
|
19
20
|
* the handleSubmit function passed to the form <Form> that have a key matching the `name`
|
|
20
21
|
* of this text field are shown above the field.
|
|
21
22
|
*/
|
|
23
|
+
|
|
22
24
|
function TextField(_ref) {
|
|
23
25
|
var label = _ref.label,
|
|
24
26
|
name = _ref.name,
|
|
25
27
|
validationHelpText = _ref.validationHelpText,
|
|
26
|
-
isRequired = _ref.isRequired,
|
|
27
|
-
testId = _ref.testId,
|
|
28
28
|
validators = _ref.validators,
|
|
29
|
-
|
|
29
|
+
restProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
30
30
|
var _useFormContext = (0, _formContext.useFormContext)(),
|
|
31
31
|
assignValidator = _useFormContext.assignValidator;
|
|
32
32
|
(0, _react.useEffect)(function () {
|
|
@@ -37,14 +37,10 @@ function TextField(_ref) {
|
|
|
37
37
|
return (0, _react2.jsx)(_form.Field, {
|
|
38
38
|
name: name,
|
|
39
39
|
label: label,
|
|
40
|
-
isRequired: isRequired,
|
|
41
40
|
defaultValue: ''
|
|
42
41
|
}, function (_ref2) {
|
|
43
42
|
var fieldProps = _ref2.fieldProps,
|
|
44
43
|
error = _ref2.error;
|
|
45
|
-
return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_textfield.default, (0, _extends2.default)({}, fieldProps,
|
|
46
|
-
testId: testId,
|
|
47
|
-
placeholder: placeholder
|
|
48
|
-
})), !error && (0, _react2.jsx)(_form.HelperMessage, null, validationHelpText), error && (0, _react2.jsx)(_form.ErrorMessage, null, error));
|
|
44
|
+
return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_textfield.default, (0, _extends2.default)({}, fieldProps, restProps)), !error && (0, _react2.jsx)(_form.HelperMessage, null, validationHelpText), error && (0, _react2.jsx)(_form.ErrorMessage, null, error));
|
|
49
45
|
});
|
|
50
46
|
}
|
package/dist/cjs/version.json
CHANGED
|
@@ -4,6 +4,7 @@ import { useCallback } from 'react';
|
|
|
4
4
|
import { css, jsx } from '@emotion/react';
|
|
5
5
|
import { useIntl } from 'react-intl-next';
|
|
6
6
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
7
|
+
import { ButtonGroup } from '@atlaskit/button';
|
|
7
8
|
import LoadingButton from '@atlaskit/button/loading-button';
|
|
8
9
|
import Button from '@atlaskit/button/standard-button';
|
|
9
10
|
import Form, { FormFooter, FormSection } from '@atlaskit/form';
|
|
@@ -68,7 +69,7 @@ export const CreateForm = ({
|
|
|
68
69
|
}, jsx(ErrorIcon, {
|
|
69
70
|
label: formErrorMessage,
|
|
70
71
|
primaryColor: "var(--ds-icon-danger, #E34935)"
|
|
71
|
-
}), formErrorMessage), jsx(Button, {
|
|
72
|
+
}), formErrorMessage), jsx(ButtonGroup, null, jsx(Button, {
|
|
72
73
|
appearance: "subtle",
|
|
73
74
|
onClick: handleCancel,
|
|
74
75
|
testId: 'cancel-button'
|
|
@@ -77,5 +78,5 @@ export const CreateForm = ({
|
|
|
77
78
|
type: "submit",
|
|
78
79
|
isLoading: submitting,
|
|
79
80
|
testId: 'create-button'
|
|
80
|
-
}, intl.formatMessage(messages.create)))));
|
|
81
|
+
}, intl.formatMessage(messages.create))))));
|
|
81
82
|
};
|
|
@@ -11,14 +11,13 @@ import { useFormContext } from '../../../controllers/form-context';
|
|
|
11
11
|
* the handleSubmit function passed to the form <Form> that have a key matching the `name`
|
|
12
12
|
* of this text field are shown above the field.
|
|
13
13
|
*/
|
|
14
|
+
|
|
14
15
|
export function TextField({
|
|
15
16
|
label,
|
|
16
17
|
name,
|
|
17
18
|
validationHelpText,
|
|
18
|
-
isRequired,
|
|
19
|
-
testId,
|
|
20
19
|
validators,
|
|
21
|
-
|
|
20
|
+
...restProps
|
|
22
21
|
}) {
|
|
23
22
|
const {
|
|
24
23
|
assignValidator
|
|
@@ -31,13 +30,9 @@ export function TextField({
|
|
|
31
30
|
return jsx(Field, {
|
|
32
31
|
name: name,
|
|
33
32
|
label: label,
|
|
34
|
-
isRequired: isRequired,
|
|
35
33
|
defaultValue: ''
|
|
36
34
|
}, ({
|
|
37
35
|
fieldProps,
|
|
38
36
|
error
|
|
39
|
-
}) => jsx(Fragment, null, jsx(AkTextfield, _extends({}, fieldProps,
|
|
40
|
-
testId: testId,
|
|
41
|
-
placeholder: placeholder
|
|
42
|
-
})), !error && jsx(HelperMessage, null, validationHelpText), error && jsx(ErrorMessage, null, error)));
|
|
37
|
+
}) => jsx(Fragment, null, jsx(AkTextfield, _extends({}, fieldProps, restProps)), !error && jsx(HelperMessage, null, validationHelpText), error && jsx(ErrorMessage, null, error)));
|
|
43
38
|
}
|
package/dist/es2019/version.json
CHANGED
|
@@ -6,6 +6,7 @@ import { useCallback } from 'react';
|
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
7
|
import { useIntl } from 'react-intl-next';
|
|
8
8
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
9
|
+
import { ButtonGroup } from '@atlaskit/button';
|
|
9
10
|
import LoadingButton from '@atlaskit/button/loading-button';
|
|
10
11
|
import Button from '@atlaskit/button/standard-button';
|
|
11
12
|
import Form, { FormFooter, FormSection } from '@atlaskit/form';
|
|
@@ -84,7 +85,7 @@ export var CreateForm = function CreateForm(_ref) {
|
|
|
84
85
|
}, jsx(ErrorIcon, {
|
|
85
86
|
label: formErrorMessage,
|
|
86
87
|
primaryColor: "var(--ds-icon-danger, #E34935)"
|
|
87
|
-
}), formErrorMessage), jsx(Button, {
|
|
88
|
+
}), formErrorMessage), jsx(ButtonGroup, null, jsx(Button, {
|
|
88
89
|
appearance: "subtle",
|
|
89
90
|
onClick: handleCancel,
|
|
90
91
|
testId: 'cancel-button'
|
|
@@ -93,6 +94,6 @@ export var CreateForm = function CreateForm(_ref) {
|
|
|
93
94
|
type: "submit",
|
|
94
95
|
isLoading: submitting,
|
|
95
96
|
testId: 'create-button'
|
|
96
|
-
}, intl.formatMessage(messages.create))));
|
|
97
|
+
}, intl.formatMessage(messages.create)))));
|
|
97
98
|
});
|
|
98
99
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["label", "name", "validationHelpText", "validators"];
|
|
2
4
|
/** @jsx jsx */
|
|
3
5
|
import { Fragment, useEffect } from 'react';
|
|
4
6
|
import { jsx } from '@emotion/react';
|
|
@@ -11,14 +13,13 @@ import { useFormContext } from '../../../controllers/form-context';
|
|
|
11
13
|
* the handleSubmit function passed to the form <Form> that have a key matching the `name`
|
|
12
14
|
* of this text field are shown above the field.
|
|
13
15
|
*/
|
|
16
|
+
|
|
14
17
|
export function TextField(_ref) {
|
|
15
18
|
var label = _ref.label,
|
|
16
19
|
name = _ref.name,
|
|
17
20
|
validationHelpText = _ref.validationHelpText,
|
|
18
|
-
isRequired = _ref.isRequired,
|
|
19
|
-
testId = _ref.testId,
|
|
20
21
|
validators = _ref.validators,
|
|
21
|
-
|
|
22
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
22
23
|
var _useFormContext = useFormContext(),
|
|
23
24
|
assignValidator = _useFormContext.assignValidator;
|
|
24
25
|
useEffect(function () {
|
|
@@ -29,14 +30,10 @@ export function TextField(_ref) {
|
|
|
29
30
|
return jsx(Field, {
|
|
30
31
|
name: name,
|
|
31
32
|
label: label,
|
|
32
|
-
isRequired: isRequired,
|
|
33
33
|
defaultValue: ''
|
|
34
34
|
}, function (_ref2) {
|
|
35
35
|
var fieldProps = _ref2.fieldProps,
|
|
36
36
|
error = _ref2.error;
|
|
37
|
-
return jsx(Fragment, null, jsx(AkTextfield, _extends({}, fieldProps,
|
|
38
|
-
testId: testId,
|
|
39
|
-
placeholder: placeholder
|
|
40
|
-
})), !error && jsx(HelperMessage, null, validationHelpText), error && jsx(ErrorMessage, null, error));
|
|
37
|
+
return jsx(Fragment, null, jsx(AkTextfield, _extends({}, fieldProps, restProps)), !error && jsx(HelperMessage, null, validationHelpText), error && jsx(ErrorMessage, null, error));
|
|
41
38
|
});
|
|
42
39
|
}
|
package/dist/esm/version.json
CHANGED
|
@@ -6,4 +6,4 @@ import { TextFieldProps } from './types';
|
|
|
6
6
|
* the handleSubmit function passed to the form <Form> that have a key matching the `name`
|
|
7
7
|
* of this text field are shown above the field.
|
|
8
8
|
*/
|
|
9
|
-
export declare function TextField({ label, name, validationHelpText,
|
|
9
|
+
export declare function TextField({ label, name, validationHelpText, validators, ...restProps }: TextFieldProps): jsx.JSX.Element;
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
+
import { TextFieldProps as AKTextFieldProps } from '@atlaskit/textfield';
|
|
1
2
|
import { Validator } from '../../../common/types';
|
|
2
|
-
export
|
|
3
|
+
export declare type TextFieldProps = Omit<AKTextFieldProps, 'name' | 'isRequired'> & {
|
|
3
4
|
/** Name passed to the <Field>.*/
|
|
4
5
|
name: string;
|
|
5
|
-
|
|
6
|
-
label: string;
|
|
7
|
-
/** This should be properly internationalization-ed */
|
|
8
|
-
placeholder?: string;
|
|
6
|
+
label?: string;
|
|
9
7
|
/**
|
|
10
8
|
* Optional text below the textfield explaining any requirements for a valid value.
|
|
11
9
|
* eg. "Must be 4 or more letters"
|
|
12
10
|
*/
|
|
13
11
|
validationHelpText?: string;
|
|
14
|
-
testId?: string;
|
|
15
|
-
/** Will display a red astrix next to the field title if true */
|
|
16
|
-
isRequired?: boolean;
|
|
17
12
|
/** Validators for this field */
|
|
18
13
|
validators?: Validator[];
|
|
19
|
-
}
|
|
14
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/** Map of field names to a list of validators for that field */
|
|
3
|
+
export declare type ValidatorMap = Record<string, Validator[]>;
|
|
4
|
+
export declare type Validator = {
|
|
5
|
+
/** Return true when the given input is valid */
|
|
6
|
+
isValid: (val: unknown) => boolean;
|
|
7
|
+
/** An error message is used to tell a user that the field input is invalid. For example, an error message could be 'Invalid username, needs to be more than 4 characters'. */
|
|
8
|
+
errorMessage: string;
|
|
9
|
+
};
|
|
10
|
+
export interface Group {
|
|
11
|
+
/**
|
|
12
|
+
* A label to display for the Group
|
|
13
|
+
*/
|
|
14
|
+
label: string;
|
|
15
|
+
/**
|
|
16
|
+
* An icon to display for the Group
|
|
17
|
+
*/
|
|
18
|
+
icon: string;
|
|
19
|
+
/**
|
|
20
|
+
* A unique key for the Group
|
|
21
|
+
*/
|
|
22
|
+
key: string;
|
|
23
|
+
}
|
|
24
|
+
export interface LinkCreatePlugin {
|
|
25
|
+
/**
|
|
26
|
+
* The Group that this plugin entity belongs to
|
|
27
|
+
*/
|
|
28
|
+
group: Group;
|
|
29
|
+
/**
|
|
30
|
+
* A label to display for the plugin entity
|
|
31
|
+
*/
|
|
32
|
+
label: string;
|
|
33
|
+
/**
|
|
34
|
+
* An icon to display for the plugin entity
|
|
35
|
+
*/
|
|
36
|
+
icon: string;
|
|
37
|
+
/**
|
|
38
|
+
* A unique key for the plugin entity
|
|
39
|
+
*/
|
|
40
|
+
key: string;
|
|
41
|
+
/**
|
|
42
|
+
* A renderer function to render the form
|
|
43
|
+
*/
|
|
44
|
+
form: ReactNode;
|
|
45
|
+
}
|
|
46
|
+
export interface LinkCreateProps {
|
|
47
|
+
/**
|
|
48
|
+
* A `testId` prop is provided for specified elements, which is a unique
|
|
49
|
+
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
50
|
+
* serving as a hook for automated tests */
|
|
51
|
+
testId?: string;
|
|
52
|
+
plugins: LinkCreatePlugin[];
|
|
53
|
+
/**
|
|
54
|
+
* The initial group key for create. If this is provided, it will jump
|
|
55
|
+
* directly to the entity selection screen
|
|
56
|
+
*/
|
|
57
|
+
groupKey?: string;
|
|
58
|
+
/**
|
|
59
|
+
* The initial entity name for create. If this is provided, it will jump
|
|
60
|
+
* directly to the entity creation form.
|
|
61
|
+
* Note: it will be non-optional for now and can move to optional when we have
|
|
62
|
+
* the meta creation flow built.
|
|
63
|
+
*/
|
|
64
|
+
entityKey: string;
|
|
65
|
+
/**
|
|
66
|
+
* This callback for when the resource has been successfully created.
|
|
67
|
+
*/
|
|
68
|
+
onCreate?: (url: string) => void;
|
|
69
|
+
/**
|
|
70
|
+
* This callback for any errors
|
|
71
|
+
*/
|
|
72
|
+
onFailure?: (error: unknown) => void;
|
|
73
|
+
/**
|
|
74
|
+
* This callback for when the form was manually discarded by user
|
|
75
|
+
*/
|
|
76
|
+
onCancel?: () => void;
|
|
77
|
+
/**
|
|
78
|
+
* This value controls whether the Create Modal should be active or hidden
|
|
79
|
+
* Default: false
|
|
80
|
+
*/
|
|
81
|
+
active?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* This value tells where the linkCreate was triggered from. And it's for
|
|
84
|
+
* analytic purpose only.
|
|
85
|
+
* Default: unknown
|
|
86
|
+
*/
|
|
87
|
+
triggeredFrom?: string;
|
|
88
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
*
|
|
4
|
+
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
|
+
*
|
|
6
|
+
* @codegen <<SignedSource::6d7803f5c035dc3cde1be03caa91eb04>>
|
|
7
|
+
* @codegenCommand yarn workspace @atlaskit/link-create run codegen-analytics
|
|
8
|
+
*/
|
|
9
|
+
export declare type PackageMetaDataType = {
|
|
10
|
+
packageName: '@atlaskit/link-create';
|
|
11
|
+
packageVersion: string;
|
|
12
|
+
source: 'linkCreate';
|
|
13
|
+
componentName: 'linkCreate';
|
|
14
|
+
};
|
|
15
|
+
export declare type LinkCreateAnalyticsContextType = {
|
|
16
|
+
triggeredFrom: string;
|
|
17
|
+
objectName: string;
|
|
18
|
+
appearance: 'modal' | 'popup';
|
|
19
|
+
};
|
|
20
|
+
export declare type LinkCreateScreenViewedAttributesType = {};
|
|
21
|
+
export declare type ButtonClickedCreateAttributesType = {};
|
|
22
|
+
export declare type ButtonClickedCancelAttributesType = {};
|
|
23
|
+
export declare type LinkCreateScreenClosedAttributesType = {};
|
|
24
|
+
export declare type LinkCreateUnhandledErrorCaughtAttributesType = {
|
|
25
|
+
browserInfo: string;
|
|
26
|
+
error: string;
|
|
27
|
+
componentStack: string | null;
|
|
28
|
+
};
|
|
29
|
+
export declare type ObjectCreatedLinkCreateAttributesType = {
|
|
30
|
+
objectId: string;
|
|
31
|
+
objectType: string;
|
|
32
|
+
};
|
|
33
|
+
declare type AnalyticsEventAttributes = {
|
|
34
|
+
'screen.linkCreateScreen.viewed': LinkCreateScreenViewedAttributesType;
|
|
35
|
+
'ui.button.clicked.create': ButtonClickedCreateAttributesType;
|
|
36
|
+
'ui.button.clicked.cancel': ButtonClickedCancelAttributesType;
|
|
37
|
+
'screen.linkCreateScreen.closed': LinkCreateScreenClosedAttributesType;
|
|
38
|
+
'operational.linkCreate.unhandledErrorCaught': LinkCreateUnhandledErrorCaughtAttributesType;
|
|
39
|
+
'track.object.created.linkCreate': ObjectCreatedLinkCreateAttributesType;
|
|
40
|
+
};
|
|
41
|
+
declare function createEventPayload<K extends keyof AnalyticsEventAttributes>(eventKey: K, attributes: AnalyticsEventAttributes[K]): {
|
|
42
|
+
eventType: string;
|
|
43
|
+
actionSubject: string;
|
|
44
|
+
action: string;
|
|
45
|
+
actionSubjectId: string;
|
|
46
|
+
attributes: AnalyticsEventAttributes[K];
|
|
47
|
+
};
|
|
48
|
+
export default createEventPayload;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LinkCreateProps } from '../../types';
|
|
3
|
+
import { LinkCreateAnalyticsContextType } from './analytics.codegen';
|
|
4
|
+
export declare type TrackAttribute = <K extends keyof LinkCreateAnalyticsContextType>(attribute: K, value: LinkCreateAnalyticsContextType[K]) => void;
|
|
5
|
+
interface AnalyticsContextType {
|
|
6
|
+
/**
|
|
7
|
+
* Update a single attribute in the analytics context
|
|
8
|
+
*/
|
|
9
|
+
trackAttribute: TrackAttribute;
|
|
10
|
+
/**
|
|
11
|
+
* Update a set of attributes in the analytics context
|
|
12
|
+
*/
|
|
13
|
+
trackAttributes: (attributes: Partial<LinkCreateAnalyticsContextType>) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Retrieve the current set of attributes
|
|
16
|
+
* Can be used by components to derive/compute new attributes for specific events
|
|
17
|
+
*/
|
|
18
|
+
getAttributes: () => LinkCreateAnalyticsContextType;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Hook that exposes the context-level attribute getters and setters.
|
|
22
|
+
*/
|
|
23
|
+
export declare const useLinkCreateAnalytics: () => AnalyticsContextType;
|
|
24
|
+
/**
|
|
25
|
+
* Wraps a component with the analytics context + listener to update events with contextual-level attributes.
|
|
26
|
+
* Should be implemented once at the root of the link create.
|
|
27
|
+
*/
|
|
28
|
+
export declare function withLinkCreateAnalyticsContext<P extends Pick<LinkCreateProps, 'groupKey' | 'entityKey' | 'triggeredFrom'>>(WrappedComponent: React.ComponentType<P>): React.ComponentType<P>;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useLinkCreateAnalytics, withLinkCreateAnalyticsContext, } from './context';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LinkCreateCallbackProvider, useLinkCreateCallback } from './main';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface LinkCreateCallbackProviderProps {
|
|
3
|
+
/**
|
|
4
|
+
* This callback for when the resource has been successfully created.
|
|
5
|
+
*/
|
|
6
|
+
onCreate?: (result: {
|
|
7
|
+
url: string;
|
|
8
|
+
objectId: string;
|
|
9
|
+
objectType: string;
|
|
10
|
+
}) => void;
|
|
11
|
+
/**
|
|
12
|
+
* This callback for any errors
|
|
13
|
+
*/
|
|
14
|
+
onFailure?: (errorMessage: string) => void;
|
|
15
|
+
/**
|
|
16
|
+
* This callback for when the form was manually discarded by user
|
|
17
|
+
*/
|
|
18
|
+
onCancel?: () => void;
|
|
19
|
+
}
|
|
20
|
+
declare const LinkCreateCallbackProvider: React.FC<LinkCreateCallbackProviderProps>;
|
|
21
|
+
declare const useLinkCreateCallback: () => LinkCreateCallbackProviderProps;
|
|
22
|
+
export { LinkCreateCallbackProvider, useLinkCreateCallback };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FormContextProvider, useFormContext } from './main';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Validator, ValidatorMap } from '../../common/types';
|
|
3
|
+
interface FormContextType {
|
|
4
|
+
assignValidator: (name: string, validators: Validator[]) => void;
|
|
5
|
+
getValidators: () => ValidatorMap;
|
|
6
|
+
setFormErrorMessage: (errorMessage?: string) => void;
|
|
7
|
+
formErrorMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const FormContext: React.Context<FormContextType>;
|
|
10
|
+
declare const FormContextProvider: React.FC<{}>;
|
|
11
|
+
declare const useFormContext: () => FormContextType;
|
|
12
|
+
export { FormContextProvider, useFormContext };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { Option } from './ui/types';
|
|
2
|
+
export type { CreateFormProps } from './ui/index';
|
|
3
|
+
export type { LinkCreateProps, LinkCreatePlugin } from './common/types';
|
|
4
|
+
export { default, TextField, CreateForm, AsyncSelect } from './ui/index';
|
|
5
|
+
export { useLinkCreateCallback, LinkCreateCallbackProvider, } from './controllers/callback-context';
|
|
6
|
+
export { FormContextProvider, useFormContext, } from './controllers/form-context';
|
|
7
|
+
export type { Validator, ValidatorMap } from './common/types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AsyncSelect } from './main';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
|
+
import { OptionType } from '@atlaskit/select';
|
|
3
|
+
import { AsyncSelectProps } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* An async select utilising the Atlaskit AsyncSelect and Field objects from `@atlaskit/form`.
|
|
6
|
+
* Validation is handled by the form as it is on form submission. Any errors returned by
|
|
7
|
+
* the handleSubmit function passed to the form <Form> that have a key matching the `name`
|
|
8
|
+
* of this text field are shown above the field.
|
|
9
|
+
*/
|
|
10
|
+
export declare function AsyncSelect<T = OptionType>({ label, name, validationHelpText, isRequired, testId, validators, ...rest }: AsyncSelectProps<T>): jsx.JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AsyncSelectProps as AKAsyncSelectProps, OptionType } from '@atlaskit/select';
|
|
2
|
+
import { Validator } from '../../../common/types';
|
|
3
|
+
export declare type AsyncSelectProps<T = OptionType> = AKAsyncSelectProps<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 textfield 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
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
export interface CreateFormProps<FormData> {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
testId?: string;
|
|
7
|
+
onCancel?: () => void;
|
|
8
|
+
onSubmit: (data: FormData) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const CreateForm: <FormData_1 extends Record<string, any> = {}>({ children, testId, onCancel, onSubmit, }: CreateFormProps<FormData_1>) => jsx.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TextField } from './main';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
|
+
import { TextFieldProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* A text field utilising the Atlaskit Textfield and Field objects from `@atlaskit/form`.
|
|
5
|
+
* Validation is handled by the form as it is on form submission. Any errors returned by
|
|
6
|
+
* the handleSubmit function passed to the form <Form> that have a key matching the `name`
|
|
7
|
+
* of this text field are shown above the field.
|
|
8
|
+
*/
|
|
9
|
+
export declare function TextField({ label, name, validationHelpText, validators, ...restProps }: TextFieldProps): jsx.JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TextFieldProps as AKTextFieldProps } from '@atlaskit/textfield';
|
|
2
|
+
import { Validator } from '../../../common/types';
|
|
3
|
+
export declare type TextFieldProps = Omit<AKTextFieldProps, 'name' | 'isRequired'> & {
|
|
4
|
+
/** Name passed to the <Field>.*/
|
|
5
|
+
name: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Optional text below the textfield explaining any requirements for a valid value.
|
|
9
|
+
* eg. "Must be 4 or more letters"
|
|
10
|
+
*/
|
|
11
|
+
validationHelpText?: string;
|
|
12
|
+
/** Validators for this field */
|
|
13
|
+
validators?: Validator[];
|
|
14
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare type Validator = {
|
|
2
|
+
/** Return true when the given input is valid */
|
|
3
|
+
isValid: (val: unknown) => boolean;
|
|
4
|
+
/** An error message is used to tell a user that the field input is invalid. For example, an error message could be 'Invalid username, needs to be more than 4 characters'. */
|
|
5
|
+
errorMessage: string;
|
|
6
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ValidatorMap } from '../../../common/types';
|
|
2
|
+
/** Map of field names to errors for that field (or undefined if no error for that field) */
|
|
3
|
+
export declare type ValidatorResults = {
|
|
4
|
+
[name: string]: string | undefined;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Returns an object where the keys are names of form fields, and values are a string if the field
|
|
8
|
+
* has an error, or undefined if the field is valid.
|
|
9
|
+
*/
|
|
10
|
+
export declare function validateFormData({ data, validators, }: {
|
|
11
|
+
data: Record<string, unknown>;
|
|
12
|
+
validators: ValidatorMap;
|
|
13
|
+
}): ValidatorResults;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { Component, ReactNode } from 'react';
|
|
2
|
+
export declare type ErrorBoundaryErrorInfo = {
|
|
3
|
+
componentStack: string;
|
|
4
|
+
};
|
|
5
|
+
declare type BaseErrorBoundaryState = {
|
|
6
|
+
hasError: boolean;
|
|
7
|
+
};
|
|
8
|
+
interface BaseErrorBoundaryProps {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
ErrorComponent?: React.ComponentType;
|
|
11
|
+
onError?: (error: Error, info?: ErrorBoundaryErrorInfo) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare class BaseErrorBoundary extends Component<BaseErrorBoundaryProps, BaseErrorBoundaryState> {
|
|
14
|
+
constructor(props: BaseErrorBoundaryProps);
|
|
15
|
+
componentDidCatch(error: Error, info?: ErrorBoundaryErrorInfo): void;
|
|
16
|
+
render(): React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import { LinkCreateProps } from '../common/types';
|
|
4
|
+
import { PackageMetaDataType } from '../common/utils/analytics/analytics.codegen';
|
|
5
|
+
export declare const PACKAGE_DATA: PackageMetaDataType;
|
|
6
|
+
declare const ComposedLinkCreate: import("react").MemoExoticComponent<(props: LinkCreateProps) => jsx.JSX.Element>;
|
|
7
|
+
export default ComposedLinkCreate;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-create",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "The driver component of meta creation flow",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@atlaskit/docs": "*",
|
|
47
|
-
"@atlaskit/link-picker": "^1.
|
|
47
|
+
"@atlaskit/link-picker": "^1.20.0",
|
|
48
48
|
"@atlaskit/link-provider": "^1.6.0",
|
|
49
49
|
"@atlaskit/link-test-helpers": "^2.3.0",
|
|
50
50
|
"@atlaskit/popup": "^1.6.0",
|
|
@@ -54,7 +54,8 @@
|
|
|
54
54
|
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
55
55
|
"@atlassian/link-create-confluence": "^5.0.0",
|
|
56
56
|
"@atlassian/link-create-presets": "^3.0.0",
|
|
57
|
-
"@atlassian/link-picker-
|
|
57
|
+
"@atlassian/link-picker-atlassian-plugin": "^30.0.0",
|
|
58
|
+
"@atlassian/link-picker-plugins": "^20.0.0",
|
|
58
59
|
"@atlassian/recent-work-client": "^1.8.0",
|
|
59
60
|
"@atlassian/search-client": "^0.8.0",
|
|
60
61
|
"@testing-library/react": "^12.1.5",
|
package/report.api.md
CHANGED
|
@@ -23,6 +23,7 @@ import { MemoExoticComponent } from 'react';
|
|
|
23
23
|
import { OptionType } from '@atlaskit/select';
|
|
24
24
|
import { default as React_2 } from 'react';
|
|
25
25
|
import { ReactNode } from 'react';
|
|
26
|
+
import { TextFieldProps as TextFieldProps_2 } from '@atlaskit/textfield';
|
|
26
27
|
|
|
27
28
|
// @public
|
|
28
29
|
export function AsyncSelect<T = OptionType>({
|
|
@@ -142,23 +143,17 @@ export function TextField({
|
|
|
142
143
|
label,
|
|
143
144
|
name,
|
|
144
145
|
validationHelpText,
|
|
145
|
-
isRequired,
|
|
146
|
-
testId,
|
|
147
146
|
validators,
|
|
148
|
-
|
|
147
|
+
...restProps
|
|
149
148
|
}: TextFieldProps): jsx.JSX.Element;
|
|
150
149
|
|
|
151
150
|
// @public (undocumented)
|
|
152
|
-
|
|
153
|
-
isRequired?: boolean;
|
|
154
|
-
label: string;
|
|
151
|
+
type TextFieldProps = Omit<TextFieldProps_2, 'isRequired' | 'name'> & {
|
|
155
152
|
name: string;
|
|
156
|
-
|
|
157
|
-
// (undocumented)
|
|
158
|
-
testId?: string;
|
|
153
|
+
label?: string;
|
|
159
154
|
validationHelpText?: string;
|
|
160
155
|
validators?: Validator[];
|
|
161
|
-
}
|
|
156
|
+
};
|
|
162
157
|
|
|
163
158
|
// @public (undocumented)
|
|
164
159
|
export const useFormContext: () => FormContextType;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/link-create"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
/// <reference types="react" />
|
|
8
|
+
|
|
9
|
+
import { AsyncSelectProps as AsyncSelectProps_2 } from '@atlaskit/select';
|
|
10
|
+
import { jsx } from '@emotion/react';
|
|
11
|
+
import { MemoExoticComponent } from 'react';
|
|
12
|
+
import { OptionType } from '@atlaskit/select';
|
|
13
|
+
import { default as React_2 } from 'react';
|
|
14
|
+
import { ReactNode } from 'react';
|
|
15
|
+
import { TextFieldProps as TextFieldProps_2 } from '@atlaskit/textfield';
|
|
16
|
+
|
|
17
|
+
// @public
|
|
18
|
+
export function AsyncSelect<T = OptionType>({ label, name, validationHelpText, isRequired, testId, validators, ...rest }: AsyncSelectProps<T>): jsx.JSX.Element;
|
|
19
|
+
|
|
20
|
+
// @public (undocumented)
|
|
21
|
+
type AsyncSelectProps<T = OptionType> = AsyncSelectProps_2<T> & {
|
|
22
|
+
name: string;
|
|
23
|
+
label: string;
|
|
24
|
+
validationHelpText?: string;
|
|
25
|
+
testId?: string;
|
|
26
|
+
isRequired?: boolean;
|
|
27
|
+
validators?: Validator[];
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// @public (undocumented)
|
|
31
|
+
const ComposedLinkCreate: MemoExoticComponent<(props: LinkCreateProps) => jsx.JSX.Element>;
|
|
32
|
+
export default ComposedLinkCreate;
|
|
33
|
+
|
|
34
|
+
// @public (undocumented)
|
|
35
|
+
export const CreateForm: <FormData_1 extends Record<string, any> = {}>({ children, testId, onCancel, onSubmit, }: CreateFormProps<FormData_1>) => jsx.JSX.Element;
|
|
36
|
+
|
|
37
|
+
// @public (undocumented)
|
|
38
|
+
export interface CreateFormProps<FormData> {
|
|
39
|
+
// (undocumented)
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
// (undocumented)
|
|
42
|
+
onCancel?: () => void;
|
|
43
|
+
// (undocumented)
|
|
44
|
+
onSubmit: (data: FormData) => void;
|
|
45
|
+
// (undocumented)
|
|
46
|
+
testId?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// @public (undocumented)
|
|
50
|
+
export const FormContextProvider: React_2.FC<{}>;
|
|
51
|
+
|
|
52
|
+
// @public (undocumented)
|
|
53
|
+
interface FormContextType {
|
|
54
|
+
// (undocumented)
|
|
55
|
+
assignValidator: (name: string, validators: Validator[]) => void;
|
|
56
|
+
// (undocumented)
|
|
57
|
+
formErrorMessage?: string;
|
|
58
|
+
// (undocumented)
|
|
59
|
+
getValidators: () => ValidatorMap;
|
|
60
|
+
// (undocumented)
|
|
61
|
+
setFormErrorMessage: (errorMessage?: string) => void;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// @public (undocumented)
|
|
65
|
+
interface Group {
|
|
66
|
+
icon: string;
|
|
67
|
+
key: string;
|
|
68
|
+
label: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// @public (undocumented)
|
|
72
|
+
export const LinkCreateCallbackProvider: React_2.FC<LinkCreateCallbackProviderProps>;
|
|
73
|
+
|
|
74
|
+
// @public (undocumented)
|
|
75
|
+
interface LinkCreateCallbackProviderProps {
|
|
76
|
+
onCancel?: () => void;
|
|
77
|
+
onCreate?: (result: {
|
|
78
|
+
url: string;
|
|
79
|
+
objectId: string;
|
|
80
|
+
objectType: string;
|
|
81
|
+
}) => void;
|
|
82
|
+
onFailure?: (errorMessage: string) => void;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// @public (undocumented)
|
|
86
|
+
export interface LinkCreatePlugin {
|
|
87
|
+
form: ReactNode;
|
|
88
|
+
group: Group;
|
|
89
|
+
icon: string;
|
|
90
|
+
key: string;
|
|
91
|
+
label: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// @public (undocumented)
|
|
95
|
+
export interface LinkCreateProps {
|
|
96
|
+
active?: boolean;
|
|
97
|
+
entityKey: string;
|
|
98
|
+
groupKey?: string;
|
|
99
|
+
onCancel?: () => void;
|
|
100
|
+
onCreate?: (url: string) => void;
|
|
101
|
+
onFailure?: (error: unknown) => void;
|
|
102
|
+
// (undocumented)
|
|
103
|
+
plugins: LinkCreatePlugin[];
|
|
104
|
+
testId?: string;
|
|
105
|
+
triggeredFrom?: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// @public (undocumented)
|
|
109
|
+
interface Option_2 {
|
|
110
|
+
label: string;
|
|
111
|
+
value: string;
|
|
112
|
+
}
|
|
113
|
+
export { Option_2 as Option }
|
|
114
|
+
|
|
115
|
+
// @public
|
|
116
|
+
export function TextField({ label, name, validationHelpText, validators, ...restProps }: TextFieldProps): jsx.JSX.Element;
|
|
117
|
+
|
|
118
|
+
// @public (undocumented)
|
|
119
|
+
type TextFieldProps = Omit<TextFieldProps_2, 'isRequired' | 'name'> & {
|
|
120
|
+
name: string;
|
|
121
|
+
label?: string;
|
|
122
|
+
validationHelpText?: string;
|
|
123
|
+
validators?: Validator[];
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// @public (undocumented)
|
|
127
|
+
export const useFormContext: () => FormContextType;
|
|
128
|
+
|
|
129
|
+
// @public (undocumented)
|
|
130
|
+
export const useLinkCreateCallback: () => LinkCreateCallbackProviderProps;
|
|
131
|
+
|
|
132
|
+
// @public (undocumented)
|
|
133
|
+
export type Validator = {
|
|
134
|
+
isValid: (val: unknown) => boolean;
|
|
135
|
+
errorMessage: string;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
// @public
|
|
139
|
+
export type ValidatorMap = Record<string, Validator[]>;
|
|
140
|
+
|
|
141
|
+
// (No @packageDocumentation comment for this package)
|
|
142
|
+
|
|
143
|
+
```
|