@backstage/plugin-scaffolder-react 1.15.0-next.0 → 1.15.0-next.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 +38 -0
- package/dist/alpha.d.ts +22 -21
- package/dist/hooks/useCustomFieldExtensions.esm.js +2 -1
- package/dist/hooks/useCustomFieldExtensions.esm.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/layouts/createScaffolderLayout.esm.js.map +1 -1
- package/dist/next/components/Form/DescriptionFieldTemplate.esm.js +3 -3
- package/dist/next/components/Form/DescriptionFieldTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/FieldTemplate.esm.js +18 -18
- package/dist/next/components/Form/FieldTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/Form.esm.js +6 -5
- package/dist/next/components/Form/Form.esm.js.map +1 -1
- package/dist/next/components/PasswordWidget/PasswordWidget.esm.js +17 -14
- package/dist/next/components/PasswordWidget/PasswordWidget.esm.js.map +1 -1
- package/dist/next/components/ReviewState/ReviewState.esm.js +2 -2
- package/dist/next/components/ReviewState/ReviewState.esm.js.map +1 -1
- package/dist/next/components/ScaffolderField/ScaffolderField.esm.js +17 -15
- package/dist/next/components/ScaffolderField/ScaffolderField.esm.js.map +1 -1
- package/dist/next/components/ScaffolderPageContextMenu/ScaffolderPageContextMenu.esm.js +65 -44
- package/dist/next/components/ScaffolderPageContextMenu/ScaffolderPageContextMenu.esm.js.map +1 -1
- package/dist/next/components/SecretWidget/SecretWidget.esm.js +3 -2
- package/dist/next/components/SecretWidget/SecretWidget.esm.js.map +1 -1
- package/dist/next/components/Stepper/ErrorListTemplate/errorListTemplate.esm.js +11 -8
- package/dist/next/components/Stepper/ErrorListTemplate/errorListTemplate.esm.js.map +1 -1
- package/dist/next/components/Stepper/FieldOverrides/DescriptionField.esm.js +2 -2
- package/dist/next/components/Stepper/FieldOverrides/DescriptionField.esm.js.map +1 -1
- package/dist/next/components/Stepper/Stepper.esm.js +106 -90
- package/dist/next/components/Stepper/Stepper.esm.js.map +1 -1
- package/dist/next/components/TaskLogStream/TaskLogStream.esm.js +3 -3
- package/dist/next/components/TaskLogStream/TaskLogStream.esm.js.map +1 -1
- package/dist/next/components/TaskSteps/StepIcon.esm.js +10 -10
- package/dist/next/components/TaskSteps/StepIcon.esm.js.map +1 -1
- package/dist/next/components/TaskSteps/StepTime.esm.js +3 -2
- package/dist/next/components/TaskSteps/StepTime.esm.js.map +1 -1
- package/dist/next/components/TaskSteps/TaskBorder.esm.js +3 -3
- package/dist/next/components/TaskSteps/TaskBorder.esm.js.map +1 -1
- package/dist/next/components/TaskSteps/TaskSteps.esm.js +43 -38
- package/dist/next/components/TaskSteps/TaskSteps.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/CardHeader.esm.js +15 -9
- package/dist/next/components/TemplateCard/CardHeader.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/CardLink.esm.js +5 -2
- package/dist/next/components/TemplateCard/CardLink.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCard.esm.js +29 -19
- package/dist/next/components/TemplateCard/TemplateCard.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCardActions.esm.js +31 -25
- package/dist/next/components/TemplateCard/TemplateCardActions.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCardContent.esm.js +3 -3
- package/dist/next/components/TemplateCard/TemplateCardContent.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCardLinks.esm.js +35 -29
- package/dist/next/components/TemplateCard/TemplateCardLinks.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCardTags.esm.js +21 -18
- package/dist/next/components/TemplateCard/TemplateCardTags.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateDetailButton.esm.js +13 -13
- package/dist/next/components/TemplateCard/TemplateDetailButton.esm.js.map +1 -1
- package/dist/next/components/TemplateCategoryPicker/TemplateCategoryPicker.esm.js +44 -41
- package/dist/next/components/TemplateCategoryPicker/TemplateCategoryPicker.esm.js.map +1 -1
- package/dist/next/components/TemplateGroup/TemplateGroup.esm.js +14 -11
- package/dist/next/components/TemplateGroup/TemplateGroup.esm.js.map +1 -1
- package/dist/next/components/TemplateGroups/TemplateGroups.esm.js +14 -8
- package/dist/next/components/TemplateGroups/TemplateGroups.esm.js.map +1 -1
- package/dist/next/components/TemplateOutputs/DefaultTemplateOutputs.esm.js +33 -27
- package/dist/next/components/TemplateOutputs/DefaultTemplateOutputs.esm.js.map +1 -1
- package/dist/next/components/TemplateOutputs/LinkOutputs.esm.js +4 -4
- package/dist/next/components/TemplateOutputs/LinkOutputs.esm.js.map +1 -1
- package/dist/next/components/TemplateOutputs/TextOutputs.esm.js +8 -8
- package/dist/next/components/TemplateOutputs/TextOutputs.esm.js.map +1 -1
- package/dist/next/components/Workflow/Workflow.esm.js +27 -23
- package/dist/next/components/Workflow/Workflow.esm.js.map +1 -1
- package/dist/secrets/SecretsContext.esm.js +6 -5
- package/dist/secrets/SecretsContext.esm.js.map +1 -1
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @backstage/plugin-scaffolder-react
|
|
2
2
|
|
|
3
|
+
## 1.15.0-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a47fd39: Removes instances of default React imports, a necessary update for the upcoming React 19 migration.
|
|
8
|
+
|
|
9
|
+
<https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html>
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @backstage/frontend-plugin-api@0.10.1-next.1
|
|
13
|
+
- @backstage/core-components@0.17.1-next.1
|
|
14
|
+
- @backstage/core-plugin-api@1.10.6-next.0
|
|
15
|
+
- @backstage/plugin-permission-react@0.4.33-next.0
|
|
16
|
+
- @backstage/plugin-catalog-react@1.17.0-next.2
|
|
17
|
+
- @backstage/theme@0.6.5-next.0
|
|
18
|
+
- @backstage/catalog-client@1.9.1
|
|
19
|
+
- @backstage/catalog-model@1.7.3
|
|
20
|
+
- @backstage/types@1.2.1
|
|
21
|
+
- @backstage/version-bridge@1.0.11
|
|
22
|
+
- @backstage/plugin-scaffolder-common@1.5.10
|
|
23
|
+
|
|
24
|
+
## 1.15.0-next.1
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Updated dependencies
|
|
29
|
+
- @backstage/core-components@0.17.1-next.0
|
|
30
|
+
- @backstage/frontend-plugin-api@0.10.1-next.0
|
|
31
|
+
- @backstage/plugin-catalog-react@1.16.1-next.1
|
|
32
|
+
- @backstage/catalog-client@1.9.1
|
|
33
|
+
- @backstage/catalog-model@1.7.3
|
|
34
|
+
- @backstage/core-plugin-api@1.10.5
|
|
35
|
+
- @backstage/theme@0.6.4
|
|
36
|
+
- @backstage/types@1.2.1
|
|
37
|
+
- @backstage/version-bridge@1.0.11
|
|
38
|
+
- @backstage/plugin-permission-react@0.4.32
|
|
39
|
+
- @backstage/plugin-scaffolder-common@1.5.10
|
|
40
|
+
|
|
3
41
|
## 1.15.0-next.0
|
|
4
42
|
|
|
5
43
|
### Minor Changes
|
package/dist/alpha.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { FieldExtensionComponentProps, CustomFieldValidator, FieldSchema, TemplateParameterSchema, FieldExtensionOptions, FormProps, ReviewStepProps, LayoutOptions, TemplateGroupFilter, ScaffolderTaskOutput, ScaffolderRJSFFormProps, ScaffolderStep } from '@backstage/plugin-scaffolder-react';
|
|
4
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
5
|
import { JsonObject, JsonValue } from '@backstage/types';
|
|
5
|
-
import * as
|
|
6
|
-
import
|
|
6
|
+
import * as react from 'react';
|
|
7
|
+
import { ComponentType, ReactNode, PropsWithChildren, ReactElement } from 'react';
|
|
7
8
|
import { TemplatePresentationV1beta3, TemplateEntityV1beta3, TaskStep } from '@backstage/plugin-scaffolder-common';
|
|
8
9
|
import { UiSchema, FieldValidation, WidgetProps } from '@rjsf/utils';
|
|
9
10
|
import { AnyApiRef, ApiHolder, IconComponent } from '@backstage/core-plugin-api';
|
|
@@ -192,7 +193,7 @@ type ReviewStateProps = {
|
|
|
192
193
|
* The component used by the {@link Stepper} to render the review step.
|
|
193
194
|
* @alpha
|
|
194
195
|
*/
|
|
195
|
-
declare const ReviewState: (props: ReviewStateProps) =>
|
|
196
|
+
declare const ReviewState: (props: ReviewStateProps) => react_jsx_runtime.JSX.Element;
|
|
196
197
|
|
|
197
198
|
/** @alpha */
|
|
198
199
|
type BackstageTemplateStepperClassKey = 'backButton' | 'footer' | 'formWrapper';
|
|
@@ -225,7 +226,7 @@ type StepperProps = {
|
|
|
225
226
|
* The `Stepper` component is the Wizard that is rendered when a user selects a template
|
|
226
227
|
* @alpha
|
|
227
228
|
*/
|
|
228
|
-
declare const Stepper: (stepperProps: StepperProps) =>
|
|
229
|
+
declare const Stepper: (stepperProps: StepperProps) => react_jsx_runtime.JSX.Element;
|
|
229
230
|
|
|
230
231
|
/** @alpha */
|
|
231
232
|
type FormValidation = {
|
|
@@ -253,7 +254,7 @@ interface TemplateCardProps {
|
|
|
253
254
|
* The `TemplateCard` component that is rendered in a list for each template
|
|
254
255
|
* @alpha
|
|
255
256
|
*/
|
|
256
|
-
declare const TemplateCard: (props: TemplateCardProps) =>
|
|
257
|
+
declare const TemplateCard: (props: TemplateCardProps) => react_jsx_runtime.JSX.Element;
|
|
257
258
|
|
|
258
259
|
/**
|
|
259
260
|
* The props for the {@link TemplateGroup} component.
|
|
@@ -269,16 +270,16 @@ interface TemplateGroupProps {
|
|
|
269
270
|
}[];
|
|
270
271
|
}[];
|
|
271
272
|
onSelected: (template: TemplateEntityV1beta3) => void;
|
|
272
|
-
title:
|
|
273
|
+
title: ReactNode;
|
|
273
274
|
components?: {
|
|
274
|
-
CardComponent?:
|
|
275
|
+
CardComponent?: ComponentType<TemplateCardProps>;
|
|
275
276
|
};
|
|
276
277
|
}
|
|
277
278
|
/**
|
|
278
279
|
* The `TemplateGroup` component is used to display a group of templates with a title.
|
|
279
280
|
* @alpha
|
|
280
281
|
*/
|
|
281
|
-
declare const TemplateGroup: (props: TemplateGroupProps) =>
|
|
282
|
+
declare const TemplateGroup: (props: TemplateGroupProps) => react_jsx_runtime.JSX.Element | null;
|
|
282
283
|
|
|
283
284
|
/**
|
|
284
285
|
* @alpha
|
|
@@ -286,7 +287,7 @@ declare const TemplateGroup: (props: TemplateGroupProps) => React__default.JSX.E
|
|
|
286
287
|
interface TemplateGroupsProps {
|
|
287
288
|
groups: TemplateGroupFilter[];
|
|
288
289
|
templateFilter?: (entity: TemplateEntityV1beta3) => boolean;
|
|
289
|
-
TemplateCardComponent?:
|
|
290
|
+
TemplateCardComponent?: ComponentType<{
|
|
290
291
|
template: TemplateEntityV1beta3;
|
|
291
292
|
}>;
|
|
292
293
|
onTemplateSelected?: (template: TemplateEntityV1beta3) => void;
|
|
@@ -299,7 +300,7 @@ interface TemplateGroupsProps {
|
|
|
299
300
|
/**
|
|
300
301
|
* @alpha
|
|
301
302
|
*/
|
|
302
|
-
declare const TemplateGroups: (props: TemplateGroupsProps) =>
|
|
303
|
+
declare const TemplateGroups: (props: TemplateGroupsProps) => react_jsx_runtime.JSX.Element | null;
|
|
303
304
|
|
|
304
305
|
/**
|
|
305
306
|
* @alpha
|
|
@@ -310,7 +311,7 @@ type WorkflowProps = {
|
|
|
310
311
|
namespace: string;
|
|
311
312
|
templateName: string;
|
|
312
313
|
components?: {
|
|
313
|
-
ReviewStepComponent?:
|
|
314
|
+
ReviewStepComponent?: ComponentType<ReviewStepProps>;
|
|
314
315
|
};
|
|
315
316
|
onError(error: Error | undefined): JSX.Element | null;
|
|
316
317
|
} & Pick<StepperProps, 'extensions' | 'formProps' | 'components' | 'onCreate' | 'initialState' | 'layouts'>;
|
|
@@ -321,7 +322,7 @@ declare const Workflow: (workflowProps: WorkflowProps) => JSX.Element | null;
|
|
|
321
322
|
/**
|
|
322
323
|
* @alpha
|
|
323
324
|
*/
|
|
324
|
-
declare const EmbeddableWorkflow: (props: WorkflowProps) =>
|
|
325
|
+
declare const EmbeddableWorkflow: (props: WorkflowProps) => react_jsx_runtime.JSX.Element;
|
|
325
326
|
|
|
326
327
|
/**
|
|
327
328
|
* The DefaultOutputs renderer for the scaffolder task output
|
|
@@ -330,13 +331,13 @@ declare const EmbeddableWorkflow: (props: WorkflowProps) => React__default.JSX.E
|
|
|
330
331
|
*/
|
|
331
332
|
declare const DefaultTemplateOutputs: (props: {
|
|
332
333
|
output?: ScaffolderTaskOutput;
|
|
333
|
-
}) =>
|
|
334
|
+
}) => react_jsx_runtime.JSX.Element | null;
|
|
334
335
|
|
|
335
336
|
/**
|
|
336
337
|
* The Form component
|
|
337
338
|
* @alpha
|
|
338
339
|
*/
|
|
339
|
-
declare const Form: (props: PropsWithChildren<ScaffolderRJSFFormProps>) =>
|
|
340
|
+
declare const Form: (props: PropsWithChildren<ScaffolderRJSFFormProps>) => react_jsx_runtime.JSX.Element;
|
|
340
341
|
|
|
341
342
|
/**
|
|
342
343
|
* Props for the TaskSteps component
|
|
@@ -354,7 +355,7 @@ interface TaskStepsProps {
|
|
|
354
355
|
*
|
|
355
356
|
* @alpha
|
|
356
357
|
*/
|
|
357
|
-
declare const TaskSteps: (props: TaskStepsProps) =>
|
|
358
|
+
declare const TaskSteps: (props: TaskStepsProps) => react_jsx_runtime.JSX.Element;
|
|
358
359
|
|
|
359
360
|
/**
|
|
360
361
|
* The text of the event stream
|
|
@@ -365,7 +366,7 @@ declare const TaskLogStream: (props: {
|
|
|
365
366
|
logs: {
|
|
366
367
|
[k: string]: string[];
|
|
367
368
|
};
|
|
368
|
-
}) =>
|
|
369
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
369
370
|
|
|
370
371
|
/** @alpha */
|
|
371
372
|
type ScaffolderReactTemplateCategoryPickerClassKey = 'root' | 'label';
|
|
@@ -374,7 +375,7 @@ type ScaffolderReactTemplateCategoryPickerClassKey = 'root' | 'label';
|
|
|
374
375
|
* categories and filtering the template list.
|
|
375
376
|
* @alpha
|
|
376
377
|
*/
|
|
377
|
-
declare const TemplateCategoryPicker: () =>
|
|
378
|
+
declare const TemplateCategoryPicker: () => react_jsx_runtime.JSX.Element | null;
|
|
378
379
|
|
|
379
380
|
/**
|
|
380
381
|
* @alpha
|
|
@@ -388,7 +389,7 @@ type ScaffolderPageContextMenuProps = {
|
|
|
388
389
|
/**
|
|
389
390
|
* @alpha
|
|
390
391
|
*/
|
|
391
|
-
declare function ScaffolderPageContextMenu(props: ScaffolderPageContextMenuProps):
|
|
392
|
+
declare function ScaffolderPageContextMenu(props: ScaffolderPageContextMenuProps): react_jsx_runtime.JSX.Element | null;
|
|
392
393
|
|
|
393
394
|
/**
|
|
394
395
|
* Props for the {@link ScaffolderField} component
|
|
@@ -409,13 +410,13 @@ interface ScaffolderFieldProps {
|
|
|
409
410
|
* on the field types
|
|
410
411
|
* @alpha
|
|
411
412
|
*/
|
|
412
|
-
declare const ScaffolderField: (props: PropsWithChildren<ScaffolderFieldProps>) =>
|
|
413
|
+
declare const ScaffolderField: (props: PropsWithChildren<ScaffolderFieldProps>) => react_jsx_runtime.JSX.Element;
|
|
413
414
|
|
|
414
415
|
/**
|
|
415
416
|
* Secret Widget for overriding the default password input widget
|
|
416
417
|
* @alpha
|
|
417
418
|
*/
|
|
418
|
-
declare const SecretWidget: (props: Pick<WidgetProps, "name" | "onChange" | "schema" | "required" | "disabled">) =>
|
|
419
|
+
declare const SecretWidget: (props: Pick<WidgetProps, "name" | "onChange" | "schema" | "required" | "disabled">) => react_jsx_runtime.JSX.Element;
|
|
419
420
|
|
|
420
421
|
/**
|
|
421
422
|
* Takes a step from a Backstage Template Manifest and converts it to a JSON Schema and UI Schema for rjsf
|
|
@@ -435,7 +436,7 @@ declare const createFieldValidation: () => FieldValidation;
|
|
|
435
436
|
* This hook is used to get the formData from the query string.
|
|
436
437
|
* @alpha
|
|
437
438
|
*/
|
|
438
|
-
declare const useFormDataFromQuery: (initialState?: Record<string, JsonValue>) => [Record<string, any>,
|
|
439
|
+
declare const useFormDataFromQuery: (initialState?: Record<string, JsonValue>) => [Record<string, any>, react.Dispatch<react.SetStateAction<Record<string, any>>>];
|
|
439
440
|
|
|
440
441
|
/**
|
|
441
442
|
* @alpha
|
|
@@ -6,13 +6,14 @@ import '../next/components/Stepper/Stepper.esm.js';
|
|
|
6
6
|
import 'json-schema-library';
|
|
7
7
|
import 'flatted';
|
|
8
8
|
import '../next/components/TemplateCard/TemplateCard.esm.js';
|
|
9
|
-
import 'react';
|
|
9
|
+
import 'react/jsx-runtime';
|
|
10
10
|
import '@backstage/core-components';
|
|
11
11
|
import 'lodash';
|
|
12
12
|
import '@backstage/catalog-model';
|
|
13
13
|
import '@backstage/plugin-catalog-react';
|
|
14
14
|
import '@backstage/plugin-scaffolder-common';
|
|
15
15
|
import '@material-ui/core/Typography';
|
|
16
|
+
import 'react';
|
|
16
17
|
import '../next/components/Workflow/Workflow.esm.js';
|
|
17
18
|
import '@backstage/frontend-plugin-api';
|
|
18
19
|
import '@material-ui/core/Box';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCustomFieldExtensions.esm.js","sources":["../../src/hooks/useCustomFieldExtensions.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useAsync, useMountEffect } from '@react-hookz/web';\nimport { useApi, useElementFilter } from '@backstage/core-plugin-api';\nimport { formFieldsApiRef } from '../next';\nimport { FieldExtensionOptions } from '../extensions';\nimport {\n FIELD_EXTENSION_KEY,\n FIELD_EXTENSION_WRAPPER_KEY,\n} from '../extensions/keys';\n\n/**\n * Hook that returns all custom field extensions from the current outlet.\n * @public\n */\nexport const useCustomFieldExtensions = <\n // todo(blam): this shouldn't be here, should remove this, but this is a breaking change to remove the generic.\n TComponentDataType = FieldExtensionOptions,\n>(\n outlet: React.ReactNode,\n) => {\n // Get custom fields created with FormFieldBlueprint\n const formFieldsApi = useApi(formFieldsApiRef);\n const [{ result: blueprintFields }, { execute }] = useAsync(\n () => formFieldsApi.getFormFields(),\n [],\n );\n useMountEffect(execute);\n\n // Get custom fields created with ScaffolderFieldExtensions\n const outletFields = useElementFilter(outlet, elements =>\n elements\n .selectByComponentData({\n key: FIELD_EXTENSION_WRAPPER_KEY,\n })\n .findComponentData<TComponentDataType>({\n key: FIELD_EXTENSION_KEY,\n }),\n );\n\n // This should really be a different type moving foward, but we do this to keep type compatibility.\n // should probably also move the defaults into the API eventually too, but that will come with the move\n // to the new frontend system.\n const blueprintsToLegacy: FieldExtensionOptions[] = blueprintFields?.map(\n field => ({\n component: field.component,\n name: field.name,\n validation: field.validation,\n schema: field.schema?.schema,\n }),\n );\n\n return [...blueprintsToLegacy, ...outletFields] as TComponentDataType[];\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCustomFieldExtensions.esm.js","sources":["../../src/hooks/useCustomFieldExtensions.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useAsync, useMountEffect } from '@react-hookz/web';\nimport { useApi, useElementFilter } from '@backstage/core-plugin-api';\nimport { formFieldsApiRef } from '../next';\nimport { FieldExtensionOptions } from '../extensions';\nimport {\n FIELD_EXTENSION_KEY,\n FIELD_EXTENSION_WRAPPER_KEY,\n} from '../extensions/keys';\n\n/**\n * Hook that returns all custom field extensions from the current outlet.\n * @public\n */\nexport const useCustomFieldExtensions = <\n // todo(blam): this shouldn't be here, should remove this, but this is a breaking change to remove the generic.\n TComponentDataType = FieldExtensionOptions,\n>(\n outlet: React.ReactNode,\n) => {\n // Get custom fields created with FormFieldBlueprint\n const formFieldsApi = useApi(formFieldsApiRef);\n const [{ result: blueprintFields }, { execute }] = useAsync(\n () => formFieldsApi.getFormFields(),\n [],\n );\n useMountEffect(execute);\n\n // Get custom fields created with ScaffolderFieldExtensions\n const outletFields = useElementFilter(outlet, elements =>\n elements\n .selectByComponentData({\n key: FIELD_EXTENSION_WRAPPER_KEY,\n })\n .findComponentData<TComponentDataType>({\n key: FIELD_EXTENSION_KEY,\n }),\n );\n\n // This should really be a different type moving foward, but we do this to keep type compatibility.\n // should probably also move the defaults into the API eventually too, but that will come with the move\n // to the new frontend system.\n const blueprintsToLegacy: FieldExtensionOptions[] = blueprintFields?.map(\n field => ({\n component: field.component,\n name: field.name,\n validation: field.validation,\n schema: field.schema?.schema,\n }),\n );\n\n return [...blueprintsToLegacy, ...outletFields] as TComponentDataType[];\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4Ba,MAAA,wBAAA,GAA2B,CAItC,MACG,KAAA;AAEH,EAAM,MAAA,aAAA,GAAgB,OAAO,gBAAgB,CAAA;AAC7C,EAAM,MAAA,CAAC,EAAE,MAAQ,EAAA,eAAA,IAAmB,EAAE,OAAA,EAAS,CAAI,GAAA,QAAA;AAAA,IACjD,MAAM,cAAc,aAAc,EAAA;AAAA,IAClC;AAAC,GACH;AACA,EAAA,cAAA,CAAe,OAAO,CAAA;AAGtB,EAAA,MAAM,YAAe,GAAA,gBAAA;AAAA,IAAiB,MAAA;AAAA,IAAQ,CAAA,QAAA,KAC5C,SACG,qBAAsB,CAAA;AAAA,MACrB,GAAK,EAAA;AAAA,KACN,EACA,iBAAsC,CAAA;AAAA,MACrC,GAAK,EAAA;AAAA,KACN;AAAA,GACL;AAKA,EAAA,MAAM,qBAA8C,eAAiB,EAAA,GAAA;AAAA,IACnE,CAAU,KAAA,MAAA;AAAA,MACR,WAAW,KAAM,CAAA,SAAA;AAAA,MACjB,MAAM,KAAM,CAAA,IAAA;AAAA,MACZ,YAAY,KAAM,CAAA,UAAA;AAAA,MAClB,MAAA,EAAQ,MAAM,MAAQ,EAAA;AAAA,KACxB;AAAA,GACF;AAEA,EAAA,OAAO,CAAC,GAAG,kBAAoB,EAAA,GAAG,YAAY,CAAA;AAChD;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ApiHolder, Extension } from '@backstage/core-plugin-api';
|
|
2
|
-
import
|
|
2
|
+
import { HTMLAttributes, ReactNode, FormEvent, ElementType, Ref, ComponentType, PropsWithChildren } from 'react';
|
|
3
3
|
import { JsonObject, JsonValue, Observable } from '@backstage/types';
|
|
4
4
|
import { JSONSchema7 } from 'json-schema';
|
|
5
5
|
import { StrictRJSFSchema, RJSFSchema, FormContextType, GenericObjectType, UiSchema, IdSchema, ErrorSchema, Registry, ValidatorType, TemplatesType, RegistryWidgetsType, RJSFValidationError, CustomValidator, ErrorTransformer, Experimental_DefaultFormStateBehavior, UIOptionsType, FieldValidation } from '@rjsf/utils';
|
|
6
6
|
import Form, { IChangeEvent, FormProps as FormProps$1 } from '@rjsf/core';
|
|
7
7
|
import { TemplateEntityV1beta3, TemplatePresentationV1beta3, TaskSpec, TaskStep } from '@backstage/plugin-scaffolder-common';
|
|
8
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
9
|
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
9
10
|
import { z } from 'zod';
|
|
10
11
|
|
|
@@ -359,7 +360,7 @@ type TemplateParameterSchema = {
|
|
|
359
360
|
*/
|
|
360
361
|
declare const SecretsContextProvider: (props: PropsWithChildren<{
|
|
361
362
|
initialSecrets?: Record<string, string>;
|
|
362
|
-
}>) =>
|
|
363
|
+
}>) => react_jsx_runtime.JSX.Element;
|
|
363
364
|
/**
|
|
364
365
|
* The return type from the useTemplateSecrets hook.
|
|
365
366
|
* @public
|
|
@@ -683,7 +684,7 @@ declare function createScaffolderLayout<TInputProps = unknown>(options: LayoutOp
|
|
|
683
684
|
*
|
|
684
685
|
* @public
|
|
685
686
|
*/
|
|
686
|
-
declare const ScaffolderLayouts:
|
|
687
|
+
declare const ScaffolderLayouts: ComponentType<PropsWithChildren<{}>>;
|
|
687
688
|
|
|
688
689
|
/**
|
|
689
690
|
* Hook that returns all custom field extensions from the current outlet.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createScaffolderLayout.esm.js","sources":["../../src/layouts/createScaffolderLayout.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { LAYOUTS_KEY, LAYOUTS_WRAPPER_KEY } from './keys';\nimport { attachComponentData, Extension } from '@backstage/core-plugin-api';\nimport type { FormProps as SchemaFormProps } from '@rjsf/core';\nimport
|
|
1
|
+
{"version":3,"file":"createScaffolderLayout.esm.js","sources":["../../src/layouts/createScaffolderLayout.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { LAYOUTS_KEY, LAYOUTS_WRAPPER_KEY } from './keys';\nimport { attachComponentData, Extension } from '@backstage/core-plugin-api';\nimport type { FormProps as SchemaFormProps } from '@rjsf/core';\nimport { PropsWithChildren, ComponentType } from 'react';\n\n/**\n * The field template from `@rjsf/core` which is a react component that gets passed `@rjsf/core` field related props.\n *\n * @public\n */\nexport type LayoutTemplate<T = any> = NonNullable<\n SchemaFormProps<T>['uiSchema']\n>['ui:ObjectFieldTemplate'];\n\n/**\n * The type of layouts that is passed to the TemplateForms\n *\n * @public\n */\nexport interface LayoutOptions<P = any> {\n name: string;\n component: LayoutTemplate<P>;\n}\n\n/**\n * A type used to wrap up the FieldExtension to embed the ReturnValue and the InputProps\n * @public\n */\nexport type LayoutComponent<_TInputProps> = () => null;\n\n/**\n * Method for creating custom Layouts that can be used in the scaffolder frontend form\n *\n * @public\n */\nexport function createScaffolderLayout<TInputProps = unknown>(\n options: LayoutOptions,\n): Extension<LayoutComponent<TInputProps>> {\n return {\n expose() {\n const LayoutDataHolder: any = () => null;\n\n attachComponentData(LayoutDataHolder, LAYOUTS_KEY, options);\n\n return LayoutDataHolder;\n },\n };\n}\n\n/**\n * The wrapping component for defining scaffolder layouts as children\n *\n * @public\n */\nexport const ScaffolderLayouts: ComponentType<\n PropsWithChildren<{}>\n> = (): JSX.Element | null => null;\n\nattachComponentData(ScaffolderLayouts, LAYOUTS_WRAPPER_KEY, true);\n"],"names":[],"mappings":";;;AAmDO,SAAS,uBACd,OACyC,EAAA;AACzC,EAAO,OAAA;AAAA,IACL,MAAS,GAAA;AACP,MAAA,MAAM,mBAAwB,MAAM,IAAA;AAEpC,MAAoB,mBAAA,CAAA,gBAAA,EAAkB,aAAa,OAAO,CAAA;AAE1D,MAAO,OAAA,gBAAA;AAAA;AACT,GACF;AACF;AAOO,MAAM,oBAET,MAA0B;AAE9B,mBAAoB,CAAA,iBAAA,EAAmB,qBAAqB,IAAI,CAAA;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { MarkdownContent } from '@backstage/core-components';
|
|
3
3
|
import Typography from '@material-ui/core/Typography';
|
|
4
4
|
import { makeStyles } from '@material-ui/core/styles';
|
|
@@ -20,7 +20,7 @@ const DescriptionFieldTemplate = (props) => {
|
|
|
20
20
|
const classes = useStyles();
|
|
21
21
|
if (description) {
|
|
22
22
|
if (typeof description === "string") {
|
|
23
|
-
return /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ jsx(
|
|
24
24
|
MarkdownContent,
|
|
25
25
|
{
|
|
26
26
|
content: description,
|
|
@@ -29,7 +29,7 @@ const DescriptionFieldTemplate = (props) => {
|
|
|
29
29
|
}
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
|
-
return /* @__PURE__ */
|
|
32
|
+
return /* @__PURE__ */ jsx(Typography, { id, variant: "subtitle2", style: { marginTop: "5px" }, children: description });
|
|
33
33
|
}
|
|
34
34
|
return null;
|
|
35
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DescriptionFieldTemplate.esm.js","sources":["../../../../src/next/components/Form/DescriptionFieldTemplate.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport
|
|
1
|
+
{"version":3,"file":"DescriptionFieldTemplate.esm.js","sources":["../../../../src/next/components/Form/DescriptionFieldTemplate.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MarkdownContent } from '@backstage/core-components';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport {\n DescriptionFieldProps,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n} from '@rjsf/utils';\n\nconst useStyles = makeStyles(theme => ({\n markdownDescription: {\n fontSize: theme.typography.caption.fontSize,\n margin: 0,\n color: theme.palette.text.secondary,\n '& :first-child': {\n margin: 0,\n marginTop: '3px', // to keep the standard browser padding\n },\n },\n}));\n\n/** The `DescriptionField` is the template to use to render the description of a field\n * @alpha\n * @param props - The `DescriptionFieldProps` for this component\n */\nexport const DescriptionFieldTemplate = <\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n props: DescriptionFieldProps<T, S, F>,\n) => {\n const { id, description } = props;\n const classes = useStyles();\n\n if (description) {\n if (typeof description === 'string') {\n return (\n <MarkdownContent\n content={description}\n linkTarget=\"_blank\"\n className={classes.markdownDescription}\n />\n );\n }\n\n return (\n <Typography id={id} variant=\"subtitle2\" style={{ marginTop: '5px' }}>\n {description}\n </Typography>\n );\n }\n\n return null;\n};\n"],"names":[],"mappings":";;;;;AAyBA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,mBAAqB,EAAA;AAAA,IACnB,QAAA,EAAU,KAAM,CAAA,UAAA,CAAW,OAAQ,CAAA,QAAA;AAAA,IACnC,MAAQ,EAAA,CAAA;AAAA,IACR,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,SAAA;AAAA,IAC1B,gBAAkB,EAAA;AAAA,MAChB,MAAQ,EAAA,CAAA;AAAA,MACR,SAAW,EAAA;AAAA;AAAA;AACb;AAEJ,CAAE,CAAA,CAAA;AAMW,MAAA,wBAAA,GAA2B,CAKtC,KACG,KAAA;AACH,EAAM,MAAA,EAAE,EAAI,EAAA,WAAA,EAAgB,GAAA,KAAA;AAC5B,EAAA,MAAM,UAAU,SAAU,EAAA;AAE1B,EAAA,IAAI,WAAa,EAAA;AACf,IAAI,IAAA,OAAO,gBAAgB,QAAU,EAAA;AACnC,MACE,uBAAA,GAAA;AAAA,QAAC,eAAA;AAAA,QAAA;AAAA,UACC,OAAS,EAAA,WAAA;AAAA,UACT,UAAW,EAAA,QAAA;AAAA,UACX,WAAW,OAAQ,CAAA;AAAA;AAAA,OACrB;AAAA;AAIJ,IACE,uBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,EAAA,EAAQ,OAAQ,EAAA,WAAA,EAAY,OAAO,EAAE,SAAA,EAAW,KAAM,EAAA,EAC/D,QACH,EAAA,WAAA,EAAA,CAAA;AAAA;AAIJ,EAAO,OAAA,IAAA;AACT;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { getUiOptions, getTemplate } from '@rjsf/utils';
|
|
3
3
|
import { ScaffolderField } from '../ScaffolderField/ScaffolderField.esm.js';
|
|
4
4
|
|
|
@@ -27,9 +27,9 @@ const FieldTemplate = (props) => {
|
|
|
27
27
|
const uiOptions = getUiOptions(uiSchema);
|
|
28
28
|
const WrapIfAdditionalTemplate = getTemplate("WrapIfAdditionalTemplate", registry, uiOptions);
|
|
29
29
|
if (hidden) {
|
|
30
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ jsx("div", { style: { display: "none" }, children });
|
|
31
31
|
}
|
|
32
|
-
return /* @__PURE__ */
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
33
|
WrapIfAdditionalTemplate,
|
|
34
34
|
{
|
|
35
35
|
classNames,
|
|
@@ -43,21 +43,21 @@ const FieldTemplate = (props) => {
|
|
|
43
43
|
required,
|
|
44
44
|
schema,
|
|
45
45
|
uiSchema,
|
|
46
|
-
registry
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
46
|
+
registry,
|
|
47
|
+
children: /* @__PURE__ */ jsx(
|
|
48
|
+
ScaffolderField,
|
|
49
|
+
{
|
|
50
|
+
displayLabel,
|
|
51
|
+
rawErrors,
|
|
52
|
+
help,
|
|
53
|
+
disabled,
|
|
54
|
+
rawDescription,
|
|
55
|
+
errors,
|
|
56
|
+
required,
|
|
57
|
+
children
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
61
|
);
|
|
62
62
|
};
|
|
63
63
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldTemplate.esm.js","sources":["../../../../src/next/components/Form/FieldTemplate.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport
|
|
1
|
+
{"version":3,"file":"FieldTemplate.esm.js","sources":["../../../../src/next/components/Form/FieldTemplate.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n FieldTemplateProps,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n getTemplate,\n getUiOptions,\n} from '@rjsf/utils';\n\nimport { ScaffolderField } from '../ScaffolderField';\n\n/** The `FieldTemplate` component is the template used by `SchemaField` to render any field. It renders the field\n * content, (label, description, children, errors and help) inside of a `WrapIfAdditional` component.\n * @alpha\n * @param props - The `FieldTemplateProps` for this component\n */\nexport const FieldTemplate = <\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n props: FieldTemplateProps<T, S, F>,\n) => {\n const {\n id,\n children,\n classNames,\n style,\n disabled,\n displayLabel,\n hidden,\n label,\n onDropPropertyClick,\n onKeyChange,\n readonly,\n required,\n rawErrors = [],\n errors,\n help,\n rawDescription,\n schema,\n uiSchema,\n registry,\n } = props;\n\n const uiOptions = getUiOptions<T, S, F>(uiSchema);\n const WrapIfAdditionalTemplate = getTemplate<\n 'WrapIfAdditionalTemplate',\n T,\n S,\n F\n >('WrapIfAdditionalTemplate', registry, uiOptions);\n\n if (hidden) {\n return <div style={{ display: 'none' }}>{children}</div>;\n }\n return (\n <WrapIfAdditionalTemplate\n classNames={classNames}\n style={style}\n disabled={disabled}\n id={id}\n label={label}\n onDropPropertyClick={onDropPropertyClick}\n onKeyChange={onKeyChange}\n readonly={readonly}\n required={required}\n schema={schema}\n uiSchema={uiSchema}\n registry={registry}\n >\n <ScaffolderField\n displayLabel={displayLabel}\n rawErrors={rawErrors}\n help={help}\n disabled={disabled}\n rawDescription={rawDescription}\n errors={errors}\n required={required}\n >\n {children}\n </ScaffolderField>\n </WrapIfAdditionalTemplate>\n );\n};\n"],"names":[],"mappings":";;;;AA+Ba,MAAA,aAAA,GAAgB,CAK3B,KACG,KAAA;AACH,EAAM,MAAA;AAAA,IACJ,EAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,YAAA;AAAA,IACA,MAAA;AAAA,IACA,KAAA;AAAA,IACA,mBAAA;AAAA,IACA,WAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,YAAY,EAAC;AAAA,IACb,MAAA;AAAA,IACA,IAAA;AAAA,IACA,cAAA;AAAA,IACA,MAAA;AAAA,IACA,QAAA;AAAA,IACA;AAAA,GACE,GAAA,KAAA;AAEJ,EAAM,MAAA,SAAA,GAAY,aAAsB,QAAQ,CAAA;AAChD,EAAA,MAAM,wBAA2B,GAAA,WAAA,CAK/B,0BAA4B,EAAA,QAAA,EAAU,SAAS,CAAA;AAEjD,EAAA,IAAI,MAAQ,EAAA;AACV,IAAA,2BAAQ,KAAI,EAAA,EAAA,KAAA,EAAO,EAAE,OAAS,EAAA,MAAA,IAAW,QAAS,EAAA,CAAA;AAAA;AAEpD,EACE,uBAAA,GAAA;AAAA,IAAC,wBAAA;AAAA,IAAA;AAAA,MACC,UAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,EAAA;AAAA,MACA,KAAA;AAAA,MACA,mBAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MAEA,QAAA,kBAAA,GAAA;AAAA,QAAC,eAAA;AAAA,QAAA;AAAA,UACC,YAAA;AAAA,UACA,SAAA;AAAA,UACA,IAAA;AAAA,UACA,QAAA;AAAA,UACA,cAAA;AAAA,UACA,MAAA;AAAA,UACA,QAAA;AAAA,UAEC;AAAA;AAAA;AACH;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { withTheme } from '@rjsf/core';
|
|
2
|
-
import
|
|
3
|
+
import { useMemo } from 'react';
|
|
3
4
|
import { FieldTemplate } from './FieldTemplate.esm.js';
|
|
4
5
|
import { DescriptionFieldTemplate } from './DescriptionFieldTemplate.esm.js';
|
|
5
6
|
import { Theme } from '@rjsf/material-ui';
|
|
6
7
|
|
|
7
8
|
const WrappedForm = withTheme(Theme);
|
|
8
9
|
const Form = (props) => {
|
|
9
|
-
const wrappedFields =
|
|
10
|
+
const wrappedFields = useMemo(
|
|
10
11
|
() => Object.fromEntries(
|
|
11
12
|
Object.entries(props.fields ?? {}).map(([key, Component]) => [
|
|
12
13
|
key,
|
|
13
14
|
(wrapperProps) => {
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ jsx(
|
|
15
16
|
Component,
|
|
16
17
|
{
|
|
17
18
|
...wrapperProps,
|
|
@@ -27,7 +28,7 @@ const Form = (props) => {
|
|
|
27
28
|
),
|
|
28
29
|
[props.fields]
|
|
29
30
|
);
|
|
30
|
-
const templates =
|
|
31
|
+
const templates = useMemo(
|
|
31
32
|
() => ({
|
|
32
33
|
FieldTemplate,
|
|
33
34
|
DescriptionFieldTemplate,
|
|
@@ -35,7 +36,7 @@ const Form = (props) => {
|
|
|
35
36
|
}),
|
|
36
37
|
[props.templates]
|
|
37
38
|
);
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ jsx(WrappedForm, { ...props, templates, fields: wrappedFields });
|
|
39
40
|
};
|
|
40
41
|
|
|
41
42
|
export { Form };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.esm.js","sources":["../../../../src/next/components/Form/Form.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { withTheme } from '@rjsf/core';\nimport
|
|
1
|
+
{"version":3,"file":"Form.esm.js","sources":["../../../../src/next/components/Form/Form.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { withTheme } from '@rjsf/core';\nimport { useMemo, PropsWithChildren } from 'react';\nimport { FieldTemplate } from './FieldTemplate';\nimport { DescriptionFieldTemplate } from './DescriptionFieldTemplate';\nimport { FieldProps } from '@rjsf/utils';\nimport { ScaffolderRJSFFormProps } from '@backstage/plugin-scaffolder-react';\nimport { Theme as MuiTheme } from '@rjsf/material-ui';\n\nconst WrappedForm = withTheme(MuiTheme);\n\n/**\n * The Form component\n * @alpha\n */\nexport const Form = (props: PropsWithChildren<ScaffolderRJSFFormProps>) => {\n // This is where we unbreak the changes from RJSF, and make it work with our custom fields so we don't pass on this\n // breaking change to our users. We will look more into a better API for this in scaffolderv2.\n const wrappedFields = useMemo(\n () =>\n Object.fromEntries(\n Object.entries(props.fields ?? {}).map(([key, Component]) => [\n key,\n (wrapperProps: FieldProps) => {\n return (\n <Component\n {...wrapperProps}\n uiSchema={wrapperProps.uiSchema ?? {}}\n formData={wrapperProps.formData}\n rawErrors={wrapperProps.rawErrors ?? []}\n disabled={wrapperProps.disabled ?? false}\n readonly={wrapperProps.readonly ?? false}\n />\n );\n },\n ]),\n ),\n [props.fields],\n );\n\n const templates = useMemo(\n () => ({\n FieldTemplate,\n DescriptionFieldTemplate,\n ...props.templates,\n }),\n [props.templates],\n );\n\n return (\n <WrappedForm {...props} templates={templates} fields={wrappedFields} />\n );\n};\n"],"names":["MuiTheme"],"mappings":";;;;;;;AAwBA,MAAM,WAAA,GAAc,UAAUA,KAAQ,CAAA;AAMzB,MAAA,IAAA,GAAO,CAAC,KAAsD,KAAA;AAGzE,EAAA,MAAM,aAAgB,GAAA,OAAA;AAAA,IACpB,MACE,MAAO,CAAA,WAAA;AAAA,MACL,MAAO,CAAA,OAAA,CAAQ,KAAM,CAAA,MAAA,IAAU,EAAE,CAAE,CAAA,GAAA,CAAI,CAAC,CAAC,GAAK,EAAA,SAAS,CAAM,KAAA;AAAA,QAC3D,GAAA;AAAA,QACA,CAAC,YAA6B,KAAA;AAC5B,UACE,uBAAA,GAAA;AAAA,YAAC,SAAA;AAAA,YAAA;AAAA,cACE,GAAG,YAAA;AAAA,cACJ,QAAA,EAAU,YAAa,CAAA,QAAA,IAAY,EAAC;AAAA,cACpC,UAAU,YAAa,CAAA,QAAA;AAAA,cACvB,SAAA,EAAW,YAAa,CAAA,SAAA,IAAa,EAAC;AAAA,cACtC,QAAA,EAAU,aAAa,QAAY,IAAA,KAAA;AAAA,cACnC,QAAA,EAAU,aAAa,QAAY,IAAA;AAAA;AAAA,WACrC;AAAA;AAEJ,OACD;AAAA,KACH;AAAA,IACF,CAAC,MAAM,MAAM;AAAA,GACf;AAEA,EAAA,MAAM,SAAY,GAAA,OAAA;AAAA,IAChB,OAAO;AAAA,MACL,aAAA;AAAA,MACA,wBAAA;AAAA,MACA,GAAG,KAAM,CAAA;AAAA,KACX,CAAA;AAAA,IACA,CAAC,MAAM,SAAS;AAAA,GAClB;AAEA,EAAA,2BACG,WAAa,EAAA,EAAA,GAAG,KAAO,EAAA,SAAA,EAAsB,QAAQ,aAAe,EAAA,CAAA;AAEzE;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { MarkdownContent } from '@backstage/core-components';
|
|
2
3
|
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
3
4
|
import FormHelperText from '@material-ui/core/FormHelperText';
|
|
4
5
|
import TextField from '@material-ui/core/TextField';
|
|
5
|
-
import React from 'react';
|
|
6
6
|
import { scaffolderReactTranslationRef } from '../../../translation.esm.js';
|
|
7
7
|
|
|
8
8
|
const PasswordWidget = (props) => {
|
|
@@ -12,19 +12,22 @@ const PasswordWidget = (props) => {
|
|
|
12
12
|
onChange,
|
|
13
13
|
schema: { title }
|
|
14
14
|
} = props;
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
onChange(e
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16
|
+
/* @__PURE__ */ jsx(
|
|
17
|
+
TextField,
|
|
18
|
+
{
|
|
19
|
+
id: title,
|
|
20
|
+
label: title,
|
|
21
|
+
"aria-describedby": title,
|
|
22
|
+
onChange: (e) => {
|
|
23
|
+
onChange(e.target.value);
|
|
24
|
+
},
|
|
25
|
+
value,
|
|
26
|
+
autoComplete: "off"
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
/* @__PURE__ */ jsx(FormHelperText, { error: true, children: /* @__PURE__ */ jsx(MarkdownContent, { content: t("passwordWidget.content") }) })
|
|
30
|
+
] });
|
|
28
31
|
};
|
|
29
32
|
|
|
30
33
|
export { PasswordWidget };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordWidget.esm.js","sources":["../../../../src/next/components/PasswordWidget/PasswordWidget.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MarkdownContent } from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport TextField from '@material-ui/core/TextField';\nimport { WidgetProps } from '@rjsf/utils';\
|
|
1
|
+
{"version":3,"file":"PasswordWidget.esm.js","sources":["../../../../src/next/components/PasswordWidget/PasswordWidget.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MarkdownContent } from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport TextField from '@material-ui/core/TextField';\nimport { WidgetProps } from '@rjsf/utils';\n\nimport { scaffolderReactTranslationRef } from '../../../translation';\n\nexport const PasswordWidget = (\n props: Pick<WidgetProps, 'onChange' | 'schema' | 'value'>,\n) => {\n const { t } = useTranslationRef(scaffolderReactTranslationRef);\n\n const {\n value,\n onChange,\n schema: { title },\n } = props;\n\n return (\n <>\n <TextField\n id={title}\n label={title}\n aria-describedby={title}\n onChange={e => {\n onChange(e.target.value);\n }}\n value={value}\n autoComplete=\"off\"\n />\n <FormHelperText error>\n <MarkdownContent content={t('passwordWidget.content')} />\n </FormHelperText>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAwBa,MAAA,cAAA,GAAiB,CAC5B,KACG,KAAA;AACH,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,6BAA6B,CAAA;AAE7D,EAAM,MAAA;AAAA,IACJ,KAAA;AAAA,IACA,QAAA;AAAA,IACA,MAAA,EAAQ,EAAE,KAAM;AAAA,GACd,GAAA,KAAA;AAEJ,EAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,EAAI,EAAA,KAAA;AAAA,QACJ,KAAO,EAAA,KAAA;AAAA,QACP,kBAAkB,EAAA,KAAA;AAAA,QAClB,UAAU,CAAK,CAAA,KAAA;AACb,UAAS,QAAA,CAAA,CAAA,CAAE,OAAO,KAAK,CAAA;AAAA,SACzB;AAAA,QACA,KAAA;AAAA,QACA,YAAa,EAAA;AAAA;AAAA,KACf;AAAA,oBACA,GAAA,CAAC,cAAe,EAAA,EAAA,KAAA,EAAK,IACnB,EAAA,QAAA,kBAAA,GAAA,CAAC,mBAAgB,OAAS,EAAA,CAAA,CAAE,wBAAwB,CAAA,EAAG,CACzD,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { StructuredMetadataTable } from '@backstage/core-components';
|
|
3
3
|
import { Draft07 } from 'json-schema-library';
|
|
4
4
|
import { findSchemaForKey, isJsonObject, formatKey } from './util.esm.js';
|
|
@@ -49,7 +49,7 @@ const ReviewState = (props) => {
|
|
|
49
49
|
const options = {
|
|
50
50
|
titleFormat: formatKey
|
|
51
51
|
};
|
|
52
|
-
return /* @__PURE__ */
|
|
52
|
+
return /* @__PURE__ */ jsx(StructuredMetadataTable, { metadata: reviewData, options });
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
export { ReviewState };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReviewState.esm.js","sources":["../../../../src/next/components/ReviewState/ReviewState.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport
|
|
1
|
+
{"version":3,"file":"ReviewState.esm.js","sources":["../../../../src/next/components/ReviewState/ReviewState.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { StructuredMetadataTable } from '@backstage/core-components';\nimport { JsonObject, JsonValue } from '@backstage/types';\nimport { Draft07 as JSONSchema } from 'json-schema-library';\nimport { ParsedTemplateSchema } from '../../hooks/useTemplateSchema';\nimport { isJsonObject, formatKey, findSchemaForKey } from './util';\n\n/**\n * The props for the {@link ReviewState} component.\n * @alpha\n */\nexport type ReviewStateProps = {\n schemas: ParsedTemplateSchema[];\n formState: JsonObject;\n};\n\nfunction processSchema(\n key: string,\n value: JsonValue | undefined,\n schema: ParsedTemplateSchema,\n formState: JsonObject,\n): [string, JsonValue | undefined][] {\n const parsedSchema = new JSONSchema(schema.mergedSchema);\n const definitionInSchema = parsedSchema.getSchema({\n pointer: `#/${key}`,\n data: formState,\n });\n\n const name =\n definitionInSchema?.['ui:backstage']?.review?.name ??\n definitionInSchema?.title ??\n key;\n\n if (definitionInSchema) {\n const backstageReviewOptions = definitionInSchema['ui:backstage']?.review;\n if (backstageReviewOptions) {\n if (backstageReviewOptions.mask) {\n return [[name, backstageReviewOptions.mask]];\n }\n if (backstageReviewOptions.show === false) {\n return [];\n }\n }\n\n if (\n definitionInSchema['ui:widget'] === 'password' ||\n definitionInSchema['ui:field']?.toLocaleLowerCase('en-us') === 'secret'\n ) {\n return [[name, '******']];\n }\n\n if (definitionInSchema.enum && definitionInSchema.enumNames) {\n return [\n [\n name,\n definitionInSchema.enumNames[\n definitionInSchema.enum.indexOf(value)\n ] || value,\n ],\n ];\n }\n\n if (backstageReviewOptions?.explode !== false && isJsonObject(value)) {\n // Recurse nested objects\n return Object.entries(value).flatMap(([nestedKey, nestedValue]) =>\n processSchema(`${key}/${nestedKey}`, nestedValue, schema, formState),\n );\n }\n }\n\n return [[name, value]];\n}\n\n/**\n * The component used by the {@link Stepper} to render the review step.\n * @alpha\n */\nexport const ReviewState = (props: ReviewStateProps) => {\n const reviewData = Object.fromEntries(\n Object.entries(props.formState)\n .flatMap(([key, value]) => {\n const schema = findSchemaForKey(key, props.schemas, props.formState);\n return schema\n ? processSchema(key, value, schema, props.formState)\n : [[key, value]];\n })\n .filter(prop => prop.length > 0),\n );\n const options = {\n titleFormat: formatKey,\n };\n return <StructuredMetadataTable metadata={reviewData} options={options} />;\n};\n"],"names":["JSONSchema"],"mappings":";;;;;AA8BA,SAAS,aACP,CAAA,GAAA,EACA,KACA,EAAA,MAAA,EACA,SACmC,EAAA;AACnC,EAAA,MAAM,YAAe,GAAA,IAAIA,OAAW,CAAA,MAAA,CAAO,YAAY,CAAA;AACvD,EAAM,MAAA,kBAAA,GAAqB,aAAa,SAAU,CAAA;AAAA,IAChD,OAAA,EAAS,KAAK,GAAG,CAAA,CAAA;AAAA,IACjB,IAAM,EAAA;AAAA,GACP,CAAA;AAED,EAAA,MAAM,OACJ,kBAAqB,GAAA,cAAc,GAAG,MAAQ,EAAA,IAAA,IAC9C,oBAAoB,KACpB,IAAA,GAAA;AAEF,EAAA,IAAI,kBAAoB,EAAA;AACtB,IAAM,MAAA,sBAAA,GAAyB,kBAAmB,CAAA,cAAc,CAAG,EAAA,MAAA;AACnE,IAAA,IAAI,sBAAwB,EAAA;AAC1B,MAAA,IAAI,uBAAuB,IAAM,EAAA;AAC/B,QAAA,OAAO,CAAC,CAAC,IAAM,EAAA,sBAAA,CAAuB,IAAI,CAAC,CAAA;AAAA;AAE7C,MAAI,IAAA,sBAAA,CAAuB,SAAS,KAAO,EAAA;AACzC,QAAA,OAAO,EAAC;AAAA;AACV;AAGF,IACE,IAAA,kBAAA,CAAmB,WAAW,CAAA,KAAM,UACpC,IAAA,kBAAA,CAAmB,UAAU,CAAG,EAAA,iBAAA,CAAkB,OAAO,CAAA,KAAM,QAC/D,EAAA;AACA,MAAA,OAAO,CAAC,CAAC,IAAM,EAAA,QAAQ,CAAC,CAAA;AAAA;AAG1B,IAAI,IAAA,kBAAA,CAAmB,IAAQ,IAAA,kBAAA,CAAmB,SAAW,EAAA;AAC3D,MAAO,OAAA;AAAA,QACL;AAAA,UACE,IAAA;AAAA,UACA,mBAAmB,SACjB,CAAA,kBAAA,CAAmB,KAAK,OAAQ,CAAA,KAAK,CACvC,CAAK,IAAA;AAAA;AACP,OACF;AAAA;AAGF,IAAA,IAAI,sBAAwB,EAAA,OAAA,KAAY,KAAS,IAAA,YAAA,CAAa,KAAK,CAAG,EAAA;AAEpE,MAAO,OAAA,MAAA,CAAO,OAAQ,CAAA,KAAK,CAAE,CAAA,OAAA;AAAA,QAAQ,CAAC,CAAC,SAAW,EAAA,WAAW,CAC3D,KAAA,aAAA,CAAc,CAAG,EAAA,GAAG,CAAI,CAAA,EAAA,SAAS,CAAI,CAAA,EAAA,WAAA,EAAa,QAAQ,SAAS;AAAA,OACrE;AAAA;AACF;AAGF,EAAA,OAAO,CAAC,CAAC,IAAM,EAAA,KAAK,CAAC,CAAA;AACvB;AAMa,MAAA,WAAA,GAAc,CAAC,KAA4B,KAAA;AACtD,EAAA,MAAM,aAAa,MAAO,CAAA,WAAA;AAAA,IACxB,MAAA,CAAO,OAAQ,CAAA,KAAA,CAAM,SAAS,CAAA,CAC3B,QAAQ,CAAC,CAAC,GAAK,EAAA,KAAK,CAAM,KAAA;AACzB,MAAA,MAAM,SAAS,gBAAiB,CAAA,GAAA,EAAK,KAAM,CAAA,OAAA,EAAS,MAAM,SAAS,CAAA;AACnE,MAAA,OAAO,MACH,GAAA,aAAA,CAAc,GAAK,EAAA,KAAA,EAAO,MAAQ,EAAA,KAAA,CAAM,SAAS,CAAA,GACjD,CAAC,CAAC,GAAK,EAAA,KAAK,CAAC,CAAA;AAAA,KAClB,CACA,CAAA,MAAA,CAAO,CAAQ,IAAA,KAAA,IAAA,CAAK,SAAS,CAAC;AAAA,GACnC;AACA,EAAA,MAAM,OAAU,GAAA;AAAA,IACd,WAAa,EAAA;AAAA,GACf;AACA,EAAA,uBAAQ,GAAA,CAAA,uBAAA,EAAA,EAAwB,QAAU,EAAA,UAAA,EAAY,OAAkB,EAAA,CAAA;AAC1E;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { MarkdownContent } from '@backstage/core-components';
|
|
3
3
|
import FormControl from '@material-ui/core/FormControl';
|
|
4
4
|
import { makeStyles } from '@material-ui/core/styles';
|
|
@@ -27,25 +27,27 @@ const ScaffolderField = (props) => {
|
|
|
27
27
|
disabled
|
|
28
28
|
} = props;
|
|
29
29
|
const classes = useStyles();
|
|
30
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ jsxs(
|
|
31
31
|
FormControl,
|
|
32
32
|
{
|
|
33
33
|
fullWidth: true,
|
|
34
34
|
error: rawErrors.length ? true : false,
|
|
35
35
|
required,
|
|
36
|
-
disabled
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
disabled,
|
|
37
|
+
children: [
|
|
38
|
+
children,
|
|
39
|
+
displayLabel && rawDescription ? /* @__PURE__ */ jsx(
|
|
40
|
+
MarkdownContent,
|
|
41
|
+
{
|
|
42
|
+
content: rawDescription,
|
|
43
|
+
linkTarget: "_blank",
|
|
44
|
+
className: classes.markdownDescription
|
|
45
|
+
}
|
|
46
|
+
) : null,
|
|
47
|
+
errors,
|
|
48
|
+
help
|
|
49
|
+
]
|
|
50
|
+
}
|
|
49
51
|
);
|
|
50
52
|
};
|
|
51
53
|
|