@atlaskit/link-create 0.3.2 → 0.4.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/CHANGELOG.md +16 -0
- package/dist/cjs/common/constants.js +4 -2
- package/dist/cjs/controllers/form-context/main.js +17 -5
- package/dist/cjs/ui/create-form/main.js +52 -40
- package/dist/cjs/ui/create-form/messages.js +20 -0
- package/dist/cjs/ui/create-form/textfield/main.js +4 -3
- package/dist/cjs/ui/error-boundary/error-boundary-ui/error-svg/index.js +45 -44
- package/dist/cjs/ui/error-boundary/error-boundary-ui/messages.js +1 -1
- package/dist/cjs/ui/main.js +25 -6
- package/dist/cjs/ui/messages.js +15 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/common/constants.js +2 -1
- package/dist/es2019/controllers/form-context/main.js +11 -2
- package/dist/es2019/ui/create-form/main.js +32 -16
- package/dist/es2019/ui/create-form/messages.js +13 -0
- package/dist/es2019/ui/create-form/textfield/main.js +4 -3
- package/dist/es2019/ui/error-boundary/error-boundary-ui/error-svg/index.js +45 -44
- package/dist/es2019/ui/error-boundary/error-boundary-ui/messages.js +1 -1
- package/dist/es2019/ui/main.js +20 -5
- package/dist/es2019/ui/messages.js +8 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/common/constants.js +2 -1
- package/dist/esm/controllers/form-context/main.js +17 -5
- package/dist/esm/ui/create-form/main.js +53 -44
- package/dist/esm/ui/create-form/messages.js +13 -0
- package/dist/esm/ui/create-form/textfield/main.js +4 -3
- package/dist/esm/ui/error-boundary/error-boundary-ui/error-svg/index.js +45 -44
- package/dist/esm/ui/error-boundary/error-boundary-ui/messages.js +1 -1
- package/dist/esm/ui/main.js +25 -6
- package/dist/esm/ui/messages.js +8 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/common/constants.d.ts +1 -0
- package/dist/types/controllers/callback-context/main.d.ts +1 -1
- package/dist/types/controllers/form-context/main.d.ts +2 -0
- package/dist/types/ui/create-form/main.d.ts +3 -3
- package/dist/types/ui/create-form/messages.d.ts +12 -0
- package/dist/types/ui/create-form/textfield/main.d.ts +1 -1
- package/dist/types/ui/create-form/textfield/types.d.ts +2 -0
- package/dist/types/ui/messages.d.ts +7 -0
- package/package.json +20 -18
- package/report.api.md +15 -4
- package/dist/cjs/ui/create-form/styled.js +0 -13
- package/dist/cjs/ui/error-boundary/error-boundary-ui/error-svg/styled.js +0 -13
- package/dist/es2019/ui/create-form/styled.js +0 -7
- package/dist/es2019/ui/error-boundary/error-boundary-ui/error-svg/styled.js +0 -7
- package/dist/esm/ui/create-form/styled.js +0 -5
- package/dist/esm/ui/error-boundary/error-boundary-ui/error-svg/styled.js +0 -5
- package/dist/types/ui/create-form/styled.d.ts +0 -1
- package/dist/types/ui/error-boundary/error-boundary-ui/error-svg/styled.d.ts +0 -1
- package/tmp/api-report-tmp.d.ts +0 -141
package/dist/esm/ui/main.js
CHANGED
|
@@ -1,16 +1,25 @@
|
|
|
1
|
+
import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
/** @jsx jsx */
|
|
3
4
|
import { memo, useCallback } from 'react';
|
|
4
5
|
import { jsx } from '@emotion/react';
|
|
6
|
+
import { useIntl } from 'react-intl-next';
|
|
5
7
|
import { AnalyticsContext, useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
8
|
import Modal, { ModalBody, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
7
9
|
import { ANALYTICS_CHANNEL, COMPONENT_NAME } from '../common/constants';
|
|
8
10
|
import { withLinkCreateAnalyticsContext } from '../common/utils/analytics';
|
|
9
11
|
import createEventPayload from '../common/utils/analytics/analytics.codegen';
|
|
10
12
|
import { LinkCreateCallbackProvider } from '../controllers/callback-context';
|
|
13
|
+
import { FormContextProvider, useFormContext } from '../controllers/form-context';
|
|
11
14
|
import { name as packageName, version as packageVersion } from '../version.json';
|
|
12
15
|
import { ErrorBoundary } from './error-boundary';
|
|
13
|
-
|
|
16
|
+
import { messages } from './messages';
|
|
17
|
+
var withFormContext = function withFormContext(Component) {
|
|
18
|
+
return function (props) {
|
|
19
|
+
return jsx(FormContextProvider, null, jsx(Component, props));
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
var LinkCreate = withFormContext(function (_ref) {
|
|
14
23
|
var plugins = _ref.plugins,
|
|
15
24
|
entityKey = _ref.entityKey,
|
|
16
25
|
onCreate = _ref.onCreate,
|
|
@@ -19,24 +28,34 @@ var LinkCreate = function LinkCreate(_ref) {
|
|
|
19
28
|
var chosenOne = plugins.find(function (plugin) {
|
|
20
29
|
return plugin.key === entityKey;
|
|
21
30
|
});
|
|
31
|
+
var _useFormContext = useFormContext(),
|
|
32
|
+
setFormErrorMessage = _useFormContext.setFormErrorMessage;
|
|
22
33
|
if (!chosenOne) {
|
|
23
34
|
throw new Error('Make sure you specified a valid entityKey');
|
|
24
35
|
}
|
|
25
36
|
var handleCreate = useCallback(function (result) {
|
|
37
|
+
// Reset the form error message
|
|
38
|
+
setFormErrorMessage(undefined);
|
|
26
39
|
onCreate && onCreate(result.url);
|
|
27
|
-
}, [onCreate]);
|
|
40
|
+
}, [onCreate, setFormErrorMessage]);
|
|
41
|
+
var handleFailure = useCallback(function (errorMessage) {
|
|
42
|
+
// Set the form error message
|
|
43
|
+
setFormErrorMessage(errorMessage);
|
|
44
|
+
onFailure && onFailure(errorMessage);
|
|
45
|
+
}, [onFailure, setFormErrorMessage]);
|
|
28
46
|
return jsx(LinkCreateCallbackProvider, {
|
|
29
47
|
onCreate: handleCreate,
|
|
30
|
-
onFailure:
|
|
48
|
+
onFailure: handleFailure,
|
|
31
49
|
onCancel: onCancel
|
|
32
50
|
}, chosenOne.form);
|
|
33
|
-
};
|
|
51
|
+
});
|
|
34
52
|
var LinkCreateWithModal = function LinkCreateWithModal(props) {
|
|
35
53
|
var testId = props.testId,
|
|
36
54
|
onCancel = props.onCancel,
|
|
37
55
|
active = props.active;
|
|
38
56
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
39
57
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
58
|
+
var intl = useIntl();
|
|
40
59
|
var handleOpenComplete = useCallback(function () {
|
|
41
60
|
createAnalyticsEvent(createEventPayload('screen.linkCreateScreen.viewed', {})).fire(ANALYTICS_CHANNEL);
|
|
42
61
|
}, [createAnalyticsEvent]);
|
|
@@ -49,10 +68,10 @@ var LinkCreateWithModal = function LinkCreateWithModal(props) {
|
|
|
49
68
|
shouldScrollInViewport: true,
|
|
50
69
|
onOpenComplete: handleOpenComplete,
|
|
51
70
|
onCloseComplete: handleCloseComplete
|
|
52
|
-
}, jsx(ModalHeader, null, jsx(ModalTitle, null,
|
|
71
|
+
}, jsx(ModalHeader, null, jsx(ModalTitle, null, intl.formatMessage(messages.heading))), jsx(ModalBody, null, jsx(ErrorBoundary, null, jsx(FormContextProvider, null, jsx(LinkCreate, props))))));
|
|
53
72
|
};
|
|
54
73
|
var LinkCreateWithAnalyticsContext = withLinkCreateAnalyticsContext( /*#__PURE__*/memo(function (_ref2) {
|
|
55
|
-
var props = _extends({}, _ref2);
|
|
74
|
+
var props = _extends({}, (_objectDestructuringEmpty(_ref2), _ref2));
|
|
56
75
|
return jsx(LinkCreateWithModal, props);
|
|
57
76
|
}));
|
|
58
77
|
export var PACKAGE_DATA = {
|
package/dist/esm/version.json
CHANGED
|
@@ -3,6 +3,8 @@ import { Validator, ValidatorMap } from '../../common/types';
|
|
|
3
3
|
interface FormContextType {
|
|
4
4
|
assignValidator: (name: string, validators: Validator[]) => void;
|
|
5
5
|
getValidators: () => ValidatorMap;
|
|
6
|
+
setFormErrorMessage: (errorMessage?: string) => void;
|
|
7
|
+
formErrorMessage?: string;
|
|
6
8
|
}
|
|
7
9
|
export declare const FormContext: React.Context<FormContextType>;
|
|
8
10
|
declare const FormContextProvider: React.FC<{}>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
export interface CreateFormProps {
|
|
4
|
+
export interface CreateFormProps<FormData> {
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
testId?: string;
|
|
7
7
|
onCancel?: () => void;
|
|
8
|
-
onSubmit: (data:
|
|
8
|
+
onSubmit: (data: FormData) => void;
|
|
9
9
|
}
|
|
10
|
-
export declare const CreateForm: (
|
|
10
|
+
export declare const CreateForm: <FormData_1 extends Record<string, any> = {}>({ children, testId, onCancel, onSubmit, }: CreateFormProps<FormData_1>) => jsx.JSX.Element;
|
|
@@ -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, isRequired, testId, validators, }: TextFieldProps): jsx.JSX.Element;
|
|
9
|
+
export declare function TextField({ label, name, validationHelpText, isRequired, testId, validators, placeholder, }: TextFieldProps): jsx.JSX.Element;
|
|
@@ -4,6 +4,8 @@ export interface TextFieldProps {
|
|
|
4
4
|
name: string;
|
|
5
5
|
/** This should be properly internationalization-ed */
|
|
6
6
|
label: string;
|
|
7
|
+
/** This should be properly internationalization-ed */
|
|
8
|
+
placeholder?: string;
|
|
7
9
|
/**
|
|
8
10
|
* Optional text below the textfield explaining any requirements for a valid value.
|
|
9
11
|
* eg. "Must be 4 or more letters"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-create",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "The driver component of meta creation flow",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -26,14 +26,15 @@
|
|
|
26
26
|
".": "./src/index.ts"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@atlaskit/analytics-next": "^9.
|
|
30
|
-
"@atlaskit/button": "^16.
|
|
31
|
-
"@atlaskit/empty-state": "^7.
|
|
32
|
-
"@atlaskit/form": "^8.
|
|
33
|
-
"@atlaskit/
|
|
34
|
-
"@atlaskit/
|
|
35
|
-
"@atlaskit/
|
|
36
|
-
"@atlaskit/
|
|
29
|
+
"@atlaskit/analytics-next": "^9.1.0",
|
|
30
|
+
"@atlaskit/button": "^16.7.0",
|
|
31
|
+
"@atlaskit/empty-state": "^7.5.0",
|
|
32
|
+
"@atlaskit/form": "^8.11.0",
|
|
33
|
+
"@atlaskit/icon": "^21.12.0",
|
|
34
|
+
"@atlaskit/modal-dialog": "^12.5.0",
|
|
35
|
+
"@atlaskit/select": "^16.2.0",
|
|
36
|
+
"@atlaskit/textfield": "^5.4.0",
|
|
37
|
+
"@atlaskit/tokens": "^1.3.0",
|
|
37
38
|
"@babel/runtime": "^7.0.0",
|
|
38
39
|
"@emotion/react": "^11.7.1"
|
|
39
40
|
},
|
|
@@ -43,21 +44,22 @@
|
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
46
|
"@atlaskit/docs": "*",
|
|
46
|
-
"@atlaskit/link-picker": "^1.
|
|
47
|
-
"@atlaskit/link-provider": "^1.
|
|
48
|
-
"@atlaskit/link-test-helpers": "^2.
|
|
49
|
-
"@atlaskit/popup": "^1.
|
|
47
|
+
"@atlaskit/link-picker": "^1.19.0",
|
|
48
|
+
"@atlaskit/link-provider": "^1.6.0",
|
|
49
|
+
"@atlaskit/link-test-helpers": "^2.3.0",
|
|
50
|
+
"@atlaskit/popup": "^1.6.0",
|
|
50
51
|
"@atlaskit/ssr": "*",
|
|
51
52
|
"@atlaskit/visual-regression": "*",
|
|
52
53
|
"@atlaskit/webdriver-runner": "*",
|
|
53
54
|
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
54
|
-
"@atlassian/link-create-confluence": "^
|
|
55
|
-
"@atlassian/link-create-presets": "^
|
|
56
|
-
"@atlassian/link-picker-plugins": "^
|
|
57
|
-
"@atlassian/recent-work-client": "^1.
|
|
58
|
-
"@atlassian/search-client": "^0.
|
|
55
|
+
"@atlassian/link-create-confluence": "^5.0.0",
|
|
56
|
+
"@atlassian/link-create-presets": "^3.0.0",
|
|
57
|
+
"@atlassian/link-picker-plugins": "^19.0.0",
|
|
58
|
+
"@atlassian/recent-work-client": "^1.8.0",
|
|
59
|
+
"@atlassian/search-client": "^0.8.0",
|
|
59
60
|
"@testing-library/react": "^12.1.5",
|
|
60
61
|
"@testing-library/user-event": "^14.4.3",
|
|
62
|
+
"fetch-mock": "^8.0.0",
|
|
61
63
|
"react-dom": "^16.8.0",
|
|
62
64
|
"typescript": "4.5.5",
|
|
63
65
|
"wait-for-expect": "^1.2.0"
|
package/report.api.md
CHANGED
|
@@ -52,16 +52,21 @@ const ComposedLinkCreate: MemoExoticComponent<
|
|
|
52
52
|
export default ComposedLinkCreate;
|
|
53
53
|
|
|
54
54
|
// @public (undocumented)
|
|
55
|
-
export const CreateForm:
|
|
55
|
+
export const CreateForm: <FormData_1 extends Record<string, any> = {}>({
|
|
56
|
+
children,
|
|
57
|
+
testId,
|
|
58
|
+
onCancel,
|
|
59
|
+
onSubmit,
|
|
60
|
+
}: CreateFormProps<FormData_1>) => jsx.JSX.Element;
|
|
56
61
|
|
|
57
62
|
// @public (undocumented)
|
|
58
|
-
export interface CreateFormProps {
|
|
63
|
+
export interface CreateFormProps<FormData> {
|
|
59
64
|
// (undocumented)
|
|
60
65
|
children: ReactNode;
|
|
61
66
|
// (undocumented)
|
|
62
67
|
onCancel?: () => void;
|
|
63
68
|
// (undocumented)
|
|
64
|
-
onSubmit: (data:
|
|
69
|
+
onSubmit: (data: FormData) => void;
|
|
65
70
|
// (undocumented)
|
|
66
71
|
testId?: string;
|
|
67
72
|
}
|
|
@@ -74,7 +79,11 @@ interface FormContextType {
|
|
|
74
79
|
// (undocumented)
|
|
75
80
|
assignValidator: (name: string, validators: Validator[]) => void;
|
|
76
81
|
// (undocumented)
|
|
82
|
+
formErrorMessage?: string;
|
|
83
|
+
// (undocumented)
|
|
77
84
|
getValidators: () => ValidatorMap;
|
|
85
|
+
// (undocumented)
|
|
86
|
+
setFormErrorMessage: (errorMessage?: string) => void;
|
|
78
87
|
}
|
|
79
88
|
|
|
80
89
|
// @public (undocumented)
|
|
@@ -95,7 +104,7 @@ interface LinkCreateCallbackProviderProps {
|
|
|
95
104
|
objectId: string;
|
|
96
105
|
objectType: string;
|
|
97
106
|
}) => void;
|
|
98
|
-
onFailure?: (
|
|
107
|
+
onFailure?: (errorMessage: string) => void;
|
|
99
108
|
}
|
|
100
109
|
|
|
101
110
|
// @public (undocumented)
|
|
@@ -136,6 +145,7 @@ export function TextField({
|
|
|
136
145
|
isRequired,
|
|
137
146
|
testId,
|
|
138
147
|
validators,
|
|
148
|
+
placeholder,
|
|
139
149
|
}: TextFieldProps): jsx.JSX.Element;
|
|
140
150
|
|
|
141
151
|
// @public (undocumented)
|
|
@@ -143,6 +153,7 @@ interface TextFieldProps {
|
|
|
143
153
|
isRequired?: boolean;
|
|
144
154
|
label: string;
|
|
145
155
|
name: string;
|
|
156
|
+
placeholder?: string;
|
|
146
157
|
// (undocumented)
|
|
147
158
|
testId?: string;
|
|
148
159
|
validationHelpText?: string;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.formStyles = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
-
var _react = require("@emotion/react");
|
|
10
|
-
var _templateObject;
|
|
11
|
-
var CREATE_FORM_MAX_WIDTH_IN_PX = '600';
|
|
12
|
-
var formStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n margin: 0 auto;\n max-width: ", "px;\n padding: 0 0 ", " 0;\n"])), CREATE_FORM_MAX_WIDTH_IN_PX, "var(--ds-space-300, 24px)");
|
|
13
|
-
exports.formStyles = formStyles;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.errorStyles = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
-
var _react = require("@emotion/react");
|
|
10
|
-
var _templateObject;
|
|
11
|
-
var WIDTH = 82;
|
|
12
|
-
var errorStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: ", "px;\n margin: 0 auto ", ";\n display: block;\n"])), WIDTH, "var(--ds-space-300, 24px)");
|
|
13
|
-
exports.errorStyles = errorStyles;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject;
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
-
var CREATE_FORM_MAX_WIDTH_IN_PX = '600';
|
|
5
|
-
export var formStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin: 0 auto;\n max-width: ", "px;\n padding: 0 0 ", " 0;\n"])), CREATE_FORM_MAX_WIDTH_IN_PX, "var(--ds-space-300, 24px)");
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject;
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
-
var WIDTH = 82;
|
|
5
|
-
export var errorStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: ", "px;\n margin: 0 auto ", ";\n display: block;\n"])), WIDTH, "var(--ds-space-300, 24px)");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const formStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const errorStyles: import("@emotion/react").SerializedStyles;
|
package/tmp/api-report-tmp.d.ts
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
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
|
-
|
|
16
|
-
// @public
|
|
17
|
-
export function AsyncSelect<T = OptionType>({ label, name, validationHelpText, isRequired, testId, validators, ...rest }: AsyncSelectProps<T>): jsx.JSX.Element;
|
|
18
|
-
|
|
19
|
-
// @public (undocumented)
|
|
20
|
-
type AsyncSelectProps<T = OptionType> = AsyncSelectProps_2<T> & {
|
|
21
|
-
name: string;
|
|
22
|
-
label: string;
|
|
23
|
-
validationHelpText?: string;
|
|
24
|
-
testId?: string;
|
|
25
|
-
isRequired?: boolean;
|
|
26
|
-
validators?: Validator[];
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
// @public (undocumented)
|
|
30
|
-
const ComposedLinkCreate: MemoExoticComponent<(props: LinkCreateProps) => jsx.JSX.Element>;
|
|
31
|
-
export default ComposedLinkCreate;
|
|
32
|
-
|
|
33
|
-
// @public (undocumented)
|
|
34
|
-
export const CreateForm: (props: any) => jsx.JSX.Element;
|
|
35
|
-
|
|
36
|
-
// @public (undocumented)
|
|
37
|
-
export interface CreateFormProps {
|
|
38
|
-
// (undocumented)
|
|
39
|
-
children: ReactNode;
|
|
40
|
-
// (undocumented)
|
|
41
|
-
onCancel?: () => void;
|
|
42
|
-
// (undocumented)
|
|
43
|
-
onSubmit: (data: Record<string, unknown>) => void;
|
|
44
|
-
// (undocumented)
|
|
45
|
-
testId?: string;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// @public (undocumented)
|
|
49
|
-
export const FormContextProvider: React_2.FC<{}>;
|
|
50
|
-
|
|
51
|
-
// @public (undocumented)
|
|
52
|
-
interface FormContextType {
|
|
53
|
-
// (undocumented)
|
|
54
|
-
assignValidator: (name: string, validators: Validator[]) => void;
|
|
55
|
-
// (undocumented)
|
|
56
|
-
getValidators: () => ValidatorMap;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// @public (undocumented)
|
|
60
|
-
interface Group {
|
|
61
|
-
icon: string;
|
|
62
|
-
key: string;
|
|
63
|
-
label: string;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// @public (undocumented)
|
|
67
|
-
export const LinkCreateCallbackProvider: React_2.FC<LinkCreateCallbackProviderProps>;
|
|
68
|
-
|
|
69
|
-
// @public (undocumented)
|
|
70
|
-
interface LinkCreateCallbackProviderProps {
|
|
71
|
-
onCancel?: () => void;
|
|
72
|
-
onCreate?: (result: {
|
|
73
|
-
url: string;
|
|
74
|
-
objectId: string;
|
|
75
|
-
objectType: string;
|
|
76
|
-
}) => void;
|
|
77
|
-
onFailure?: (error: unknown) => void;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// @public (undocumented)
|
|
81
|
-
export interface LinkCreatePlugin {
|
|
82
|
-
form: ReactNode;
|
|
83
|
-
group: Group;
|
|
84
|
-
icon: string;
|
|
85
|
-
key: string;
|
|
86
|
-
label: string;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// @public (undocumented)
|
|
90
|
-
export interface LinkCreateProps {
|
|
91
|
-
active?: boolean;
|
|
92
|
-
entityKey: string;
|
|
93
|
-
groupKey?: string;
|
|
94
|
-
onCancel?: () => void;
|
|
95
|
-
onCreate?: (url: string) => void;
|
|
96
|
-
onFailure?: (error: unknown) => void;
|
|
97
|
-
// (undocumented)
|
|
98
|
-
plugins: LinkCreatePlugin[];
|
|
99
|
-
testId?: string;
|
|
100
|
-
triggeredFrom?: string;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// @public (undocumented)
|
|
104
|
-
interface Option_2 {
|
|
105
|
-
label: string;
|
|
106
|
-
value: string;
|
|
107
|
-
}
|
|
108
|
-
export { Option_2 as Option }
|
|
109
|
-
|
|
110
|
-
// @public
|
|
111
|
-
export function TextField({ label, name, validationHelpText, isRequired, testId, validators, }: TextFieldProps): jsx.JSX.Element;
|
|
112
|
-
|
|
113
|
-
// @public (undocumented)
|
|
114
|
-
interface TextFieldProps {
|
|
115
|
-
isRequired?: boolean;
|
|
116
|
-
label: string;
|
|
117
|
-
name: string;
|
|
118
|
-
// (undocumented)
|
|
119
|
-
testId?: string;
|
|
120
|
-
validationHelpText?: string;
|
|
121
|
-
validators?: Validator[];
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// @public (undocumented)
|
|
125
|
-
export const useFormContext: () => FormContextType;
|
|
126
|
-
|
|
127
|
-
// @public (undocumented)
|
|
128
|
-
export const useLinkCreateCallback: () => LinkCreateCallbackProviderProps;
|
|
129
|
-
|
|
130
|
-
// @public (undocumented)
|
|
131
|
-
export type Validator = {
|
|
132
|
-
isValid: (val: unknown) => boolean;
|
|
133
|
-
errorMessage: string;
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
// @public
|
|
137
|
-
export type ValidatorMap = Record<string, Validator[]>;
|
|
138
|
-
|
|
139
|
-
// (No @packageDocumentation comment for this package)
|
|
140
|
-
|
|
141
|
-
```
|