@backstage/plugin-scaffolder-react 2.1.0 → 2.1.1-next.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 +15 -0
- package/dist/alpha.esm.js.map +1 -1
- package/dist/api/ref.esm.js.map +1 -1
- package/dist/extensions/createScaffolderFieldExtension.esm.js.map +1 -1
- package/dist/extensions/keys.esm.js.map +1 -1
- package/dist/hooks/useCustomFieldExtensions.esm.js.map +1 -1
- package/dist/hooks/useCustomLayouts.esm.js.map +1 -1
- package/dist/hooks/useEventStream.esm.js.map +1 -1
- package/dist/layouts/createScaffolderLayout.esm.js.map +1 -1
- package/dist/layouts/keys.esm.js.map +1 -1
- package/dist/next/api/index.esm.js.map +1 -1
- package/dist/next/blueprints/FormDecoratorBlueprint.esm.js.map +1 -1
- package/dist/next/blueprints/FormFieldBlueprint.esm.js.map +1 -1
- package/dist/next/blueprints/scaffolderTaskOutputsBlueprint.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/Form.module.css.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/index.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/templates/ArrayFieldDescriptionTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/templates/ArrayFieldItemTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/templates/ArrayFieldTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/templates/ArrayFieldTitleTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/templates/ButtonTemplates.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/templates/DescriptionFieldTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/templates/ErrorListTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/templates/FieldErrorTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/templates/FieldHelpTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/templates/FieldTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/templates/ObjectFieldTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/templates/TitleFieldTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/templates/UnsupportedFieldTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/templates/WrapIfAdditionalTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/templates/index.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/widgets/BaseInputTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/widgets/CheckboxWidget.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/widgets/CheckboxesWidget.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/widgets/ColorWidget.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/widgets/DateInput.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/widgets/DateTimeWidget.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/widgets/DateWidget.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/widgets/EmailWidget.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/widgets/FileWidget.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/widgets/HiddenWidget.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/widgets/PasswordWidget.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/widgets/RadioWidget.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/widgets/RangeWidget.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/widgets/SelectWidget.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/widgets/TextWidget.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/widgets/TextareaWidget.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/widgets/TimeWidget.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/widgets/URLWidget.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/widgets/index.esm.js.map +1 -1
- package/dist/next/components/Form/BuiTheme/widgets/selectOverrides.module.css.esm.js.map +1 -1
- package/dist/next/components/Form/DescriptionFieldTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/FieldTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/Form.esm.js.map +1 -1
- package/dist/next/components/Form/ScaffolderThemeContext.esm.js.map +1 -1
- package/dist/next/components/PasswordWidget/PasswordWidget.esm.js.map +1 -1
- package/dist/next/components/ReviewState/ReviewState.esm.js.map +1 -1
- package/dist/next/components/ReviewState/util.esm.js.map +1 -1
- package/dist/next/components/ScaffolderField/ScaffolderField.esm.js.map +1 -1
- package/dist/next/components/ScaffolderPageContextMenu/ScaffolderPageContextMenu.esm.js.map +1 -1
- package/dist/next/components/SecretWidget/SecretWidget.esm.js.map +1 -1
- package/dist/next/components/Stepper/ErrorListTemplate/errorListTemplate.esm.js.map +1 -1
- package/dist/next/components/Stepper/FieldOverrides/DescriptionField.esm.js.map +1 -1
- package/dist/next/components/Stepper/Stepper.esm.js.map +1 -1
- package/dist/next/components/Stepper/createAsyncValidators.esm.js.map +1 -1
- package/dist/next/components/Stepper/utils.esm.js.map +1 -1
- package/dist/next/components/TaskLogStream/TaskLogStream.esm.js.map +1 -1
- package/dist/next/components/TaskSteps/StepIcon.esm.js.map +1 -1
- package/dist/next/components/TaskSteps/StepTime.esm.js.map +1 -1
- package/dist/next/components/TaskSteps/TaskBorder.esm.js.map +1 -1
- package/dist/next/components/TaskSteps/TaskSteps.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/CardHeader.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/CardLink.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCard.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCardActions.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCardContent.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCardImpl.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCardLinks.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCardTags.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateDetailButton.esm.js.map +1 -1
- package/dist/next/components/TemplateCategoryPicker/TemplateCategoryPicker.esm.js.map +1 -1
- package/dist/next/components/TemplateGroup/TemplateGroup.esm.js.map +1 -1
- package/dist/next/components/TemplateGroups/TemplateGroups.esm.js.map +1 -1
- package/dist/next/components/TemplateOutputs/DefaultTemplateOutputs.esm.js.map +1 -1
- package/dist/next/components/TemplateOutputs/LinkOutputs.esm.js.map +1 -1
- package/dist/next/components/TemplateOutputs/TextOutputs.esm.js.map +1 -1
- package/dist/next/components/Workflow/Workflow.esm.js.map +1 -1
- package/dist/next/extensions/createScaffolderFormDecorator.esm.js.map +1 -1
- package/dist/next/hooks/useDownloadLogs.esm.js.map +1 -1
- package/dist/next/hooks/useFilteredSchemaProperties.esm.js.map +1 -1
- package/dist/next/hooks/useFormDataFromQuery.esm.js.map +1 -1
- package/dist/next/hooks/useTemplateParameterSchema.esm.js.map +1 -1
- package/dist/next/hooks/useTemplateSchema.esm.js.map +1 -1
- package/dist/next/hooks/useTemplateTimeSaved.esm.js.map +1 -1
- package/dist/next/hooks/useTransformSchemaToProps.esm.js.map +1 -1
- package/dist/next/lib/schema.esm.js.map +1 -1
- package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js.map +1 -1
- package/dist/packages/opaque-internal/src/OpaqueType.esm.js.map +1 -1
- package/dist/packages/scaffolder-internal/src/wiring/InternalFormDecorator.esm.js.map +1 -1
- package/dist/packages/scaffolder-internal/src/wiring/InternalFormField.esm.js.map +1 -1
- package/dist/secrets/SecretsContext.esm.js.map +1 -1
- package/dist/testUtils/scaffolderApiMock.esm.js.map +1 -1
- package/dist/translation.esm.js.map +1 -1
- package/dist/utils.esm.js.map +1 -1
- package/package.json +21 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WrapIfAdditionalTemplate.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/templates/WrapIfAdditionalTemplate.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 ADDITIONAL_PROPERTY_FLAG,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WrapIfAdditionalTemplateProps,\n} from '@rjsf/utils';\nimport { Button, Flex, Box, TextField } from '@backstage/ui';\nimport { RiDeleteBinLine } from '@remixicon/react';\n\nexport default function WrapIfAdditionalTemplate<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({\n children,\n classNames,\n style,\n disabled,\n id,\n label,\n onDropPropertyClick,\n onKeyChange,\n readonly,\n required,\n schema,\n}: WrapIfAdditionalTemplateProps<T, S, F>) {\n const keyLabel = `${label} Key`;\n const additional = ADDITIONAL_PROPERTY_FLAG in schema;\n\n if (!additional) {\n return (\n <Box className={classNames} style={style}>\n {children}\n </Box>\n );\n }\n\n const handleChange = (value: string) => {\n onKeyChange(value);\n };\n\n return (\n <Box className={classNames} style={style}>\n <Flex align=\"start\" gap=\"4\">\n <Box style={{ flex: 1 }}>\n <Box mb=\"4\">\n <TextField\n id={`${id}-key`}\n label={keyLabel}\n secondaryLabel={required ? 'Required' : undefined}\n defaultValue={label}\n isDisabled={disabled || readonly}\n onChange={handleChange}\n />\n </Box>\n {children}\n </Box>\n <Button\n variant=\"tertiary\"\n size=\"small\"\n isDisabled={disabled || readonly}\n onClick={onDropPropertyClick(label)}\n iconSt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AAA;AAAA,UACxB,QAAA,EAAU;AAAA;AAAA,OACZ,EACF,CAAA;AAAA,MACC;AAAA,KAAA,EACH,CAAA;AAAA,oBACA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAQ,UAAA;AAAA,QACR,IAAA,EAAK,OAAA;AAAA,QACL,YAAY,QAAA,IAAY,QAAA;AAAA,QACxB,OAAA,EAAS,oBAAoB,KAAK,CAAA;AAAA,QAClC,SAAA,sBAAY,eAAA,EAAA,EAAgB,CAAA;AAAA,QAC5B,YAAA,EAAW;AAAA;AAAA;AACb,GAAA,EACF,CAAA,EACF,CAAA;AAEJ
|
|
1
|
+
{"version":3,"file":"WrapIfAdditionalTemplate.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/templates/WrapIfAdditionalTemplate.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 ADDITIONAL_PROPERTY_FLAG,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WrapIfAdditionalTemplateProps,\n} from '@rjsf/utils';\nimport { Button, Flex, Box, TextField } from '@backstage/ui';\nimport { RiDeleteBinLine } from '@remixicon/react';\n\nexport default function WrapIfAdditionalTemplate<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({\n children,\n classNames,\n style,\n disabled,\n id,\n label,\n onDropPropertyClick,\n onKeyChange,\n readonly,\n required,\n schema,\n}: WrapIfAdditionalTemplateProps<T, S, F>) {\n const keyLabel = `${label} Key`;\n const additional = ADDITIONAL_PROPERTY_FLAG in schema;\n\n if (!additional) {\n return (\n <Box className={classNames} style={style}>\n {children}\n </Box>\n );\n }\n\n const handleChange = (value: string) => {\n onKeyChange(value);\n };\n\n return (\n <Box className={classNames} style={style}>\n <Flex align=\"start\" gap=\"4\">\n <Box style={{ flex: 1 }}>\n <Box mb=\"4\">\n <TextField\n id={`${id}-key`}\n label={keyLabel}\n secondaryLabel={required ? 'Required' : undefined}\n defaultValue={label}\n isDisabled={disabled || readonly}\n onChange={handleChange}\n />\n </Box>\n {children}\n </Box>\n <Button\n variant=\"tertiary\"\n size=\"small\"\n isDisabled={disabled || readonly}\n onClick={onDropPropertyClick(label)}\n iconStart={<RiDeleteBinLine />}\n aria-label=\"Remove\"\n />\n </Flex>\n </Box>\n );\n}\n"],"names":[],"mappings":";;;;;AAyBA,SAAwB,wBAAA,CAItB;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,EAAA;AAAA,EACA,KAAA;AAAA,EACA,mBAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAAA,EAA2C;AACzC,EAAA,MAAM,QAAA,GAAW,GAAG,KAAK,CAAA,IAAA,CAAA;AACzB,EAAA,MAAM,aAAa,wBAAA,IAA4B,MAAA;AAE/C,EAAA,IAAI,CAAC,UAAA,EAAY;AACf,IAAA,uBACE,GAAA,CAAC,GAAA,EAAA,EAAI,SAAA,EAAW,UAAA,EAAY,OACzB,QAAA,EACH,CAAA;AAAA,EAEJ;AAEA,EAAA,MAAM,YAAA,GAAe,CAAC,KAAA,KAAkB;AACtC,IAAA,WAAA,CAAY,KAAK,CAAA;AAAA,EACnB,CAAA;AAEA,EAAA,uBACE,GAAA,CAAC,GAAA,EAAA,EAAI,SAAA,EAAW,UAAA,EAAY,KAAA,EAC1B,+BAAC,IAAA,EAAA,EAAK,KAAA,EAAM,OAAA,EAAQ,GAAA,EAAI,GAAA,EACtB,QAAA,EAAA;AAAA,oBAAA,IAAA,CAAC,GAAA,EAAA,EAAI,KAAA,EAAO,EAAE,IAAA,EAAM,GAAE,EACpB,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,GAAA,EAAA,EAAI,IAAG,GAAA,EACN,QAAA,kBAAA,GAAA;AAAA,QAAC,SAAA;AAAA,QAAA;AAAA,UACC,EAAA,EAAI,GAAG,EAAE,CAAA,IAAA,CAAA;AAAA,UACT,KAAA,EAAO,QAAA;AAAA,UACP,cAAA,EAAgB,WAAW,UAAA,GAAa,MAAA;AAAA,UACxC,YAAA,EAAc,KAAA;AAAA,UACd,YAAY,QAAA,IAAY,QAAA;AAAA,UACxB,QAAA,EAAU;AAAA;AAAA,OACZ,EACF,CAAA;AAAA,MACC;AAAA,KAAA,EACH,CAAA;AAAA,oBACA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAQ,UAAA;AAAA,QACR,IAAA,EAAK,OAAA;AAAA,QACL,YAAY,QAAA,IAAY,QAAA;AAAA,QACxB,OAAA,EAAS,oBAAoB,KAAK,CAAA;AAAA,QAClC,SAAA,sBAAY,eAAA,EAAA,EAAgB,CAAA;AAAA,QAC5B,YAAA,EAAW;AAAA;AAAA;AACb,GAAA,EACF,CAAA,EACF,CAAA;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/templates/index.ts"],"sourcesContent":["/*\n * Copyright 2026 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 FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n TemplatesType,\n} from '@rjsf/utils';\n\nimport ArrayFieldDescriptionTemplate from './ArrayFieldDescriptionTemplate';\nimport ArrayFieldItemTemplate from './ArrayFieldItemTemplate';\nimport ArrayFieldTemplate from './ArrayFieldTemplate';\nimport ArrayFieldTitleTemplate from './ArrayFieldTitleTemplate';\nimport ButtonTemplates, {\n SubmitButton,\n AddButton,\n IconButton,\n} from './ButtonTemplates';\nimport DescriptionFieldTemplate from './DescriptionFieldTemplate';\nimport ErrorListTemplate from './ErrorListTemplate';\nimport FieldErrorTemplate from './FieldErrorTemplate';\nimport FieldHelpTemplate from './FieldHelpTemplate';\nimport FieldTemplate from './FieldTemplate';\nimport ObjectFieldTemplate from './ObjectFieldTemplate';\nimport TitleFieldTemplate from './TitleFieldTemplate';\nimport UnsupportedFieldTemplate from './UnsupportedFieldTemplate';\nimport WrapIfAdditionalTemplate from './WrapIfAdditionalTemplate';\n\nexport function generateBuiTemplates<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(): Partial<TemplatesType<T, S, F>> {\n return {\n ArrayFieldDescriptionTemplate,\n ArrayFieldItemTemplate,\n ArrayFieldTemplate,\n ArrayFieldTitleTemplate,\n ButtonTemplates: {\n ...ButtonTemplates,\n SubmitButton,\n AddButton,\n RemoveButton: IconButton,\n MoveDownButton: IconButton,\n MoveUpButton: IconButton,\n CopyButton: IconButton,\n },\n DescriptionFieldTemplate,\n ErrorListTemplate,\n FieldErrorTemplate,\n FieldHelpTemplate,\n FieldTemplate,\n ObjectFieldTemplate,\n TitleFieldTemplate,\n UnsupportedFieldTemplate,\n WrapIfAdditionalTemplate,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAyCO,SAAS,oBAAA,GAIqB;AACnC,EAAA,OAAO;AAAA,IACL,6BAAA;AAAA,IACA,sBAAA;AAAA,IACA,kBAAA;AAAA,IACA,uBAAA;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,GAAG,eAAA;AAAA,MACH,YAAA;AAAA,MACA,SAAA;AAAA,MACA,YAAA,EAAc,UAAA;AAAA,MACd,cAAA,EAAgB,UAAA;AAAA,MAChB,YAAA,EAAc,UAAA;AAAA,MACd,UAAA,EAAY;AAAA,KACd;AAAA,IACA,wBAAA;AAAA,IACA,iBAAA;AAAA,IACA,kBAAA;AAAA,IACA,iBAAA;AAAA,IACA,aAAA;AAAA,IACA,mBAAA;AAAA,IACA,kBAAA;AAAA,IACA,wBAAA;AAAA,IACA;AAAA,GACF;AACF
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/templates/index.ts"],"sourcesContent":["/*\n * Copyright 2026 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 FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n TemplatesType,\n} from '@rjsf/utils';\n\nimport ArrayFieldDescriptionTemplate from './ArrayFieldDescriptionTemplate';\nimport ArrayFieldItemTemplate from './ArrayFieldItemTemplate';\nimport ArrayFieldTemplate from './ArrayFieldTemplate';\nimport ArrayFieldTitleTemplate from './ArrayFieldTitleTemplate';\nimport ButtonTemplates, {\n SubmitButton,\n AddButton,\n IconButton,\n} from './ButtonTemplates';\nimport DescriptionFieldTemplate from './DescriptionFieldTemplate';\nimport ErrorListTemplate from './ErrorListTemplate';\nimport FieldErrorTemplate from './FieldErrorTemplate';\nimport FieldHelpTemplate from './FieldHelpTemplate';\nimport FieldTemplate from './FieldTemplate';\nimport ObjectFieldTemplate from './ObjectFieldTemplate';\nimport TitleFieldTemplate from './TitleFieldTemplate';\nimport UnsupportedFieldTemplate from './UnsupportedFieldTemplate';\nimport WrapIfAdditionalTemplate from './WrapIfAdditionalTemplate';\n\nexport function generateBuiTemplates<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(): Partial<TemplatesType<T, S, F>> {\n return {\n ArrayFieldDescriptionTemplate,\n ArrayFieldItemTemplate,\n ArrayFieldTemplate,\n ArrayFieldTitleTemplate,\n ButtonTemplates: {\n ...ButtonTemplates,\n SubmitButton,\n AddButton,\n RemoveButton: IconButton,\n MoveDownButton: IconButton,\n MoveUpButton: IconButton,\n CopyButton: IconButton,\n },\n DescriptionFieldTemplate,\n ErrorListTemplate,\n FieldErrorTemplate,\n FieldHelpTemplate,\n FieldTemplate,\n ObjectFieldTemplate,\n TitleFieldTemplate,\n UnsupportedFieldTemplate,\n WrapIfAdditionalTemplate,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAyCO,SAAS,oBAAA,GAIqB;AACnC,EAAA,OAAO;AAAA,IACL,6BAAA;AAAA,IACA,sBAAA;AAAA,IACA,kBAAA;AAAA,IACA,uBAAA;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,GAAG,eAAA;AAAA,MACH,YAAA;AAAA,MACA,SAAA;AAAA,MACA,YAAA,EAAc,UAAA;AAAA,MACd,cAAA,EAAgB,UAAA;AAAA,MAChB,YAAA,EAAc,UAAA;AAAA,MACd,UAAA,EAAY;AAAA,KACd;AAAA,IACA,wBAAA;AAAA,IACA,iBAAA;AAAA,IACA,kBAAA;AAAA,IACA,iBAAA;AAAA,IACA,aAAA;AAAA,IACA,mBAAA;AAAA,IACA,kBAAA;AAAA,IACA,wBAAA;AAAA,IACA;AAAA,GACF;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseInputTemplate.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/BaseInputTemplate.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 ariaDescribedByIds,\n BaseInputTemplateProps,\n examplesId,\n FormContextType,\n getInputProps,\n RJSFSchema,\n StrictRJSFSchema,\n} from '@rjsf/utils';\nimport { TextField } from '@backstage/ui';\n\nexport default function BaseInputTemplate<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({\n id,\n placeholder,\n required,\n readonly,\n disabled,\n type,\n label,\n value,\n onChange: onFieldChange,\n onBlur: onFieldBlur,\n onFocus: onFieldFocus,\n autofocus,\n options,\n schema,\n rawErrors = [],\n children,\n extraProps,\n}: BaseInputTemplateProps<T, S, F>) {\n const { type: inputType, ...restInputProps } = {\n ...extraProps,\n ...getInputProps<T, S, F>(schema, type, options),\n };\n\n const list = schema.examples ? examplesId<T>(id) : undefined;\n\n const handleChange = (val: string) =>\n onFieldChange(val === '' ? options.emptyValue : val);\n const handleBlur = () => onFieldBlur(id, value);\n const handleFocus = () => onFieldFocus(id, value);\n\n const hasError = rawErrors.length > 0;\n const isNumeric = inputType === 'number' || inputType === 'integer';\n\n // Normalize value to string for the input\n let inputValue: string;\n if (isNumeric) {\n inputValue = value || value === 0 ? String(value) : '';\n } else {\n inputValue = value === null || value === undefined ? '' : String(value);\n }\n\n return (\n <>\n <TextField\n id={id}\n name={id}\n label={label || schema.title}\n secondaryLabel={required ? 'Required' : undefined}\n placeholder={placeholder}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autofocus}\n isRequired={required}\n isDisabled={disabled}\n isReadOnly={readonly}\n isInvalid={hasError}\n value={inputValue}\n onChange={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n aria-describedby={ariaDescribedByIds<T>(id, !!schema.examples)}\n list={list}\n {...restInputProps}\n />\n {children}\n {Array.isArray(schema.examples) ? (\n <datalist id={examplesId<T>(id)}>\n {(schema.examples as string[])\n .concat(\n schema.default && !schema.examples.includes(schema.default)\n ? ([schema.default] as string[])\n : [],\n )\n .map((example: any) => {\n return <option key={example} value={example} />;\n })}\n </datalist>\n ) : null}\n </>\n );\n}\n"],"names":[],"mappings":";;;;AA0BA,SAAwB,iBAAA,CAItB;AAAA,EACA,EAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA,EAAU,aAAA;AAAA,EACV,MAAA,EAAQ,WAAA;AAAA,EACR,OAAA,EAAS,YAAA;AAAA,EACT,SAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAY,EAAC;AAAA,EACb,QAAA;AAAA,EACA;AACF,CAAA,EAAoC;AAClC,EAAA,MAAM,EAAE,IAAA,EAAM,SAAA,EAAW,GAAG,gBAAe,GAAI;AAAA,IAC7C,GAAG,UAAA;AAAA,IACH,GAAG,aAAA,CAAuB,MAAA,EAAQ,IAAA,EAAM,OAAO;AAAA,GACjD;AAEA,EAAA,MAAM,IAAA,GAAO,MAAA,CAAO,QAAA,GAAW,UAAA,CAAc,EAAE,CAAA,GAAI,MAAA;AAEnD,EAAA,MAAM,YAAA,GAAe,CAAC,GAAA,KACpB,aAAA,CAAc,QAAQ,EAAA,GAAK,OAAA,CAAQ,aAAa,GAAG,CAAA;AACrD,EAAA,MAAM,UAAA,GAAa,MAAM,WAAA,CAAY,EAAA,EAAI,KAAK,CAAA;AAC9C,EAAA,MAAM,WAAA,GAAc,MAAM,YAAA,CAAa,EAAA,EAAI,KAAK,CAAA;AAEhD,EAAA,MAAM,QAAA,GAAW,UAAU,MAAA,GAAS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,MACC,MAAA,CAAO,OAAA,IAAW,CAAC,MAAA,CAAO,QAAA,CAAS,QAAA,CAAS,MAAA,CAAO,OAAO,CAAA,GACrD,CAAC,MAAA,CAAO,OAAO,IAChB;AAAC,KACP,CACC,GAAA,CAAI,CAAC,OAAA,KAAiB;AACrB,MAAA,uBAAO,GAAA,CAAC,QAAA,EAAA,EAAqB,KAAA,EAAO,OAAA,EAAA,EAAhB,OAAyB,CAAA;AAAA,IAC/C,CAAC,GACL,CAAA,GACE;AAAA,GAAA,EACN,CAAA;AAEJ
|
|
1
|
+
{"version":3,"file":"BaseInputTemplate.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/BaseInputTemplate.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 ariaDescribedByIds,\n BaseInputTemplateProps,\n examplesId,\n FormContextType,\n getInputProps,\n RJSFSchema,\n StrictRJSFSchema,\n} from '@rjsf/utils';\nimport { TextField } from '@backstage/ui';\n\nexport default function BaseInputTemplate<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({\n id,\n placeholder,\n required,\n readonly,\n disabled,\n type,\n label,\n value,\n onChange: onFieldChange,\n onBlur: onFieldBlur,\n onFocus: onFieldFocus,\n autofocus,\n options,\n schema,\n rawErrors = [],\n children,\n extraProps,\n}: BaseInputTemplateProps<T, S, F>) {\n const { type: inputType, ...restInputProps } = {\n ...extraProps,\n ...getInputProps<T, S, F>(schema, type, options),\n };\n\n const list = schema.examples ? examplesId<T>(id) : undefined;\n\n const handleChange = (val: string) =>\n onFieldChange(val === '' ? options.emptyValue : val);\n const handleBlur = () => onFieldBlur(id, value);\n const handleFocus = () => onFieldFocus(id, value);\n\n const hasError = rawErrors.length > 0;\n const isNumeric = inputType === 'number' || inputType === 'integer';\n\n // Normalize value to string for the input\n let inputValue: string;\n if (isNumeric) {\n inputValue = value || value === 0 ? String(value) : '';\n } else {\n inputValue = value === null || value === undefined ? '' : String(value);\n }\n\n return (\n <>\n <TextField\n id={id}\n name={id}\n label={label || schema.title}\n secondaryLabel={required ? 'Required' : undefined}\n placeholder={placeholder}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autofocus}\n isRequired={required}\n isDisabled={disabled}\n isReadOnly={readonly}\n isInvalid={hasError}\n value={inputValue}\n onChange={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n aria-describedby={ariaDescribedByIds<T>(id, !!schema.examples)}\n list={list}\n {...restInputProps}\n />\n {children}\n {Array.isArray(schema.examples) ? (\n <datalist id={examplesId<T>(id)}>\n {(schema.examples as string[])\n .concat(\n schema.default && !schema.examples.includes(schema.default)\n ? ([schema.default] as string[])\n : [],\n )\n .map((example: any) => {\n return <option key={example} value={example} />;\n })}\n </datalist>\n ) : null}\n </>\n );\n}\n"],"names":[],"mappings":";;;;AA0BA,SAAwB,iBAAA,CAItB;AAAA,EACA,EAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA,EAAU,aAAA;AAAA,EACV,MAAA,EAAQ,WAAA;AAAA,EACR,OAAA,EAAS,YAAA;AAAA,EACT,SAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAY,EAAC;AAAA,EACb,QAAA;AAAA,EACA;AACF,CAAA,EAAoC;AAClC,EAAA,MAAM,EAAE,IAAA,EAAM,SAAA,EAAW,GAAG,gBAAe,GAAI;AAAA,IAC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A;AAAA,QACZ,SAAA,EAAW,QAAA;AAAA,QACX,KAAA,EAAO,UAAA;AAAA,QACP,QAAA,EAAU,YAAA;AAAA,QACV,MAAA,EAAQ,UAAA;AAAA,QACR,OAAA,EAAS,WAAA;AAAA,QACT,oBAAkB,kBAAA,CAAsB,EAAA,EAAI,CAAC,CAAC,OAAO,QAAQ,CAAA;AAAA,QAC7D,IAAA;AAAA,QACC,GAAG;AAAA;AAAA,KACN;AAAA,IACC,QAAA;AAAA,IACA,KAAA,CAAM,OAAA,CAAQ,MAAA,CAAO,QAAQ,CAAA,mBAC5B,GAAA,CAAC,UAAA,EAAA,EAAS,EAAA,EAAI,UAAA,CAAc,EAAE,CAAA,EAC1B,QAAA,EAAA,MAAA,CAAO,QAAA,CACN,MAAA;AAAA,MACC,MAAA,CAAO,OAAA,IAAW,CAAC,MAAA,CAAO,QAAA,CAAS,QAAA,CAAS,MAAA,CAAO,OAAO,CAAA,GACrD,CAAC,MAAA,CAAO,OAAO,IAChB;AAAC,KACP,CACC,GAAA,CAAI,CAAC,OAAA,KAAiB;AACrB,MAAA,uBAAO,GAAA,CAAC,QAAA,EAAA,EAAqB,KAAA,EAAO,OAAA,EAAA,EAAhB,OAAyB,CAAA;AAAA,IAC/C,CAAC,GACL,CAAA,GACE;AAAA,GAAA,EACN,CAAA;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/CheckboxWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 FormContextType,\n labelValue,\n RJSFSchema,\n schemaRequiresTrueValue,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport { Checkbox } from '@backstage/ui';\n\nexport default function CheckboxWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: WidgetProps<T, S, F>) {\n const {\n id,\n value,\n disabled,\n readonly,\n label,\n hideLabel,\n schema,\n onChange: onFieldChange,\n } = props;\n\n const required = schemaRequiresTrueValue<S>(schema);\n\n const handleChange = (checked: boolean) => {\n onFieldChange(checked);\n };\n\n return (\n <Checkbox\n name={id}\n isSelected={typeof value === 'undefined' ? false : Boolean(value)}\n isRequired={required}\n isDisabled={disabled || readonly}\n onChange={handleChange}\n >\n {labelValue(label, hideLabel || !label)}\n </Checkbox>\n );\n}\n"],"names":[],"mappings":";;;;AAyBA,SAAwB,eAItB,KAAA,EAA6B;AAC7B,EAAA,MAAM;AAAA,IACJ,EAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA;AAAA,IACA,QAAA,EAAU;AAAA,GACZ,GAAI,KAAA;AAEJ,EAAA,MAAM,QAAA,GAAW,wBAA2B,MAAM,CAAA;AAElD,EAAA,MAAM,YAAA,GAAe,CAAC,OAAA,KAAqB;AACzC,IAAA,aAAA,CAAc,OAAO,CAAA;AAAA,EACvB,CAAA;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAM,EAAA;AAAA,MACN,YAAY,OAAO,KAAA,KAAU,WAAA,GAAc,KAAA,GAAQ,QAAQ,KAAK,CAAA;AAAA,MAChE,UAAA,EAAY,QAAA;AAAA,MACZ,YAAY,QAAA,IAAY,QAAA;AAAA,MACxB,QAAA,EAAU,YAAA;AAAA,MAET,QAAA,EAAA,UAAA,CAAW,KAAA,EAAO,SAAA,IAAa,CAAC,KAAK;AAAA;AAAA,GACxC;AAEJ
|
|
1
|
+
{"version":3,"file":"CheckboxWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/CheckboxWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 FormContextType,\n labelValue,\n RJSFSchema,\n schemaRequiresTrueValue,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport { Checkbox } from '@backstage/ui';\n\nexport default function CheckboxWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: WidgetProps<T, S, F>) {\n const {\n id,\n value,\n disabled,\n readonly,\n label,\n hideLabel,\n schema,\n onChange: onFieldChange,\n } = props;\n\n const required = schemaRequiresTrueValue<S>(schema);\n\n const handleChange = (checked: boolean) => {\n onFieldChange(checked);\n };\n\n return (\n <Checkbox\n name={id}\n isSelected={typeof value === 'undefined' ? false : Boolean(value)}\n isRequired={required}\n isDisabled={disabled || readonly}\n onChange={handleChange}\n >\n {labelValue(label, hideLabel || !label)}\n </Checkbox>\n );\n}\n"],"names":[],"mappings":";;;;AAyBA,SAAwB,eAItB,KAAA,EAA6B;AAC7B,EAAA,MAAM;AAAA,IACJ,EAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA;AAAA,IACA,QAAA,EAAU;AAAA,GACZ,GAAI,KAAA;AAEJ,EAAA,MAAM,QAAA,GAAW,wBAA2B,MAAM,CAAA;AAElD,EAAA,MAAM,YAAA,GAAe,CAAC,OAAA,KAAqB;AACzC,IAAA,aAAA,CAAc,OAAO,CAAA;AAAA,EACvB,CAAA;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAM,EAAA;AAAA,MACN,YAAY,OAAO,KAAA,KAAU,WAAA,GAAc,KAAA,GAAQ,QAAQ,KAAK,CAAA;AAAA,MAChE,UAAA,EAAY,QAAA;AAAA,MACZ,YAAY,QAAA,IAAY,QAAA;AAAA,MACxB,QAAA,EAAU,YAAA;AAAA,MAET,QAAA,EAAA,UAAA,CAAW,KAAA,EAAO,SAAA,IAAa,CAAC,KAAK;AAAA;AAAA,GACxC;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxesWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/CheckboxesWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 ariaDescribedByIds,\n FormContextType,\n optionId,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport { Checkbox, CheckboxGroup } from '@backstage/ui';\n\nexport default function CheckboxesWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({\n id,\n label,\n required,\n disabled,\n readonly,\n options,\n value,\n onChange: onFieldChange,\n rawErrors = [],\n}: WidgetProps<T, S, F>) {\n const { enumOptions, enumDisabled } = options;\n\n const selectedKeys = Array.isArray(value) ? value.map(String) : [];\n const hasError = rawErrors.length > 0;\n\n const handleChange = (keys: string[]) => {\n const next =\n enumOptions\n ?.filter(option => keys.includes(String(option.value)))\n .map(option => option.value) ?? [];\n onFieldChange(next as T);\n };\n\n return (\n <CheckboxGroup\n label={label}\n isRequired={required}\n isInvalid={hasError}\n isDisabled={disabled || readonly}\n value={selectedKeys}\n onChange={handleChange}\n aria-describedby={ariaDescribedByIds<T>(id)}\n >\n {enumOptions?.map((option, index) => {\n const itemDisabled =\n Array.isArray(enumDisabled) &&\n enumDisabled.indexOf(option.value) !== -1;\n return (\n <Checkbox\n key={optionId(id, index)}\n value={String(option.value)}\n isDisabled={itemDisabled}\n >\n {option.label}\n </Checkbox>\n );\n })}\n </CheckboxGroup>\n );\n}\n"],"names":[],"mappings":";;;;AAyBA,SAAwB,gBAAA,CAItB;AAAA,EACA,EAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA,EAAU,aAAA;AAAA,EACV,YAAY;AACd,CAAA,EAAyB;AACvB,EAAA,MAAM,EAAE,WAAA,EAAa,YAAA,EAAa,GAAI,OAAA;AAEtC,EAAA,MAAM,YAAA,GAAe,MAAM,OAAA,CAAQ,KAAK,IAAI,KAAA,CAAM,GAAA,CAAI,MAAM,CAAA,GAAI,EAAC;AACjE,EAAA,MAAM,QAAA,GAAW,UAAU,MAAA,GAAS,CAAA;AAEpC,EAAA,MAAM,YAAA,GAAe,CAAC,IAAA,KAAmB;AACvC,IAAA,MAAM,OACJ,WAAA,EACI,MAAA,CAAO,CAAA,MAAA,KAAU,IAAA,CAAK,SAAS,MAAA,CAAO,MAAA,CAAO,KAAK,CAAC,CAAC,CAAA,CACrD,GAAA,CAAI,YAAU,MAAA,CAAO,KAAK,KAAK,EAAC;AACrC,IAAA,aAAA,CAAc,IAAS,CAAA;AAAA,EACzB,CAAA;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,UAAA,EAAY,QAAA;AAAA,MACZ,SAAA,EAAW,QAAA;AAAA,MACX,YAAY,QAAA,IAAY,QAAA;AAAA,MACxB,KAAA,EAAO,YAAA;AAAA,MACP,QAAA,EAAU,YAAA;AAAA,MACV,kBAAA,EAAkB,mBAAsB,EAAE,CAAA;AAAA,MAEzC,QAAA,EAAA,WAAA,EAAa,GAAA,CAAI,CAAC,MAAA,EAAQ,KAAA,KAAU;AACnC,QAAA,MAAM,YAAA,GACJ,MAAM,OAAA,CAAQ,YAAY,KAC1B,YAAA,CAAa,OAAA,CAAQ,MAAA,CAAO,KAAK,CAAA,KAAM,EAAA;AACzC,QAAA,uBACE,GAAA;AAAA,UAAC,QAAA;AAAA,UAAA;AAAA,YAEC,KAAA,EAAO,MAAA,CAAO,MAAA,CAAO,KAAK,CAAA;AAAA,YAC1B,UAAA,EAAY,YAAA;AAAA,YAEX,QAAA,EAAA,MAAA,CAAO;AAAA,WAAA;AAAA,UAJH,QAAA,CAAS,IAAI,KAAK;AAAA,SAKzB;AAAA,MAEJ,CAAC;AAAA;AAAA,GACH;AAEJ
|
|
1
|
+
{"version":3,"file":"CheckboxesWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/CheckboxesWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 ariaDescribedByIds,\n FormContextType,\n optionId,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport { Checkbox, CheckboxGroup } from '@backstage/ui';\n\nexport default function CheckboxesWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({\n id,\n label,\n required,\n disabled,\n readonly,\n options,\n value,\n onChange: onFieldChange,\n rawErrors = [],\n}: WidgetProps<T, S, F>) {\n const { enumOptions, enumDisabled } = options;\n\n const selectedKeys = Array.isArray(value) ? value.map(String) : [];\n const hasError = rawErrors.length > 0;\n\n const handleChange = (keys: string[]) => {\n const next =\n enumOptions\n ?.filter(option => keys.includes(String(option.value)))\n .map(option => option.value) ?? [];\n onFieldChange(next as T);\n };\n\n return (\n <CheckboxGroup\n label={label}\n isRequired={required}\n isInvalid={hasError}\n isDisabled={disabled || readonly}\n value={selectedKeys}\n onChange={handleChange}\n aria-describedby={ariaDescribedByIds<T>(id)}\n >\n {enumOptions?.map((option, index) => {\n const itemDisabled =\n Array.isArray(enumDisabled) &&\n enumDisabled.indexOf(option.value) !== -1;\n return (\n <Checkbox\n key={optionId(id, index)}\n value={String(option.value)}\n isDisabled={itemDisabled}\n >\n {option.label}\n </Checkbox>\n );\n })}\n </CheckboxGroup>\n );\n}\n"],"names":[],"mappings":";;;;AAyBA,SAAwB,gBAAA,CAItB;AAAA,EACA,EAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA,EAAU,aAAA;AAAA,EACV,YAAY;AACd,CAAA,EAAyB;AACvB,EAAA,MAAM,EAAE,WAAA,EAAa,YAAA,EAAa,GAAI,OAAA;AAEtC,EAAA,MAAM,YAAA,GAAe,MAAM,OAAA,CAAQ,KAAK,IAAI,KAAA,CAAM,GAAA,CAAI,MAAM,CAAA,GAAI,EAAC;AACjE,EAAA,MAAM,QAAA,GAAW,UAAU,MAAA,GAAS,CAAA;AAEpC,EAAA,MAAM,YAAA,GAAe,CAAC,IAAA,KAAmB;AACvC,IAAA,MAAM,OACJ,WAAA,EACI,MAAA,CAAO,CAAA,MAAA,KAAU,IAAA,CAAK,SAAS,MAAA,CAAO,MAAA,CAAO,KAAK,CAAC,CAAC,CAAA,CACrD,GAAA,CAAI,YAAU,MAAA,CAAO,KAAK,KAAK,EAAC;AACrC,IAAA,aAAA,CAAc,IAAS,CAAA;AAAA,EACzB,CAAA;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,UAAA,EAAY,QAAA;AAAA,MACZ,SAAA,EAAW,QAAA;AAAA,MACX,YAAY,QAAA,IAAY,QAAA;AAAA,MACxB,KAAA,EAAO,YAAA;AAAA,MACP,QAAA,EAAU,YAAA;AAAA,MACV,kBAAA,EAAkB,mBAAsB,EAAE,CAAA;AAAA,MAEzC,QAAA,EAAA,WAAA,EAAa,GAAA,CAAI,CAAC,MAAA,EAAQ,KAAA,KAAU;AACnC,QAAA,MAAM,YAAA,GACJ,MAAM,OAAA,CAAQ,YAAY,KAC1B,YAAA,CAAa,OAAA,CAAQ,MAAA,CAAO,KAAK,CAAA,KAAM,EAAA;AACzC,QAAA,uBACE,GAAA;AAAA,UAAC,QAAA;AAAA,UAAA;AAAA,YAEC,KAAA,EAAO,MAAA,CAAO,MAAA,CAAO,KAAK,CAAA;AAAA,YAC1B,UAAA,EAAY,YAAA;AAAA,YAEX,QAAA,EAAA,MAAA,CAAO;AAAA,WAAA;AAAA,UAJH,QAAA,CAAS,IAAI,KAAK;AAAA,SAKzB;AAAA,MAEJ,CAAC;AAAA;AAAA,GACH;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/ColorWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport BaseInputTemplate from './BaseInputTemplate';\n\nexport default function ColorWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: WidgetProps<T, S, F>) {\n return <BaseInputTemplate {...props} type=\"color\" />;\n}\n"],"names":[],"mappings":";;;AAuBA,SAAwB,YAItB,KAAA,EAA6B;AAC7B,EAAA,uBAAO,GAAA,CAAC,iBAAA,EAAA,EAAmB,GAAG,KAAA,EAAO,MAAK,OAAA,EAAQ,CAAA;AACpD
|
|
1
|
+
{"version":3,"file":"ColorWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/ColorWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport BaseInputTemplate from './BaseInputTemplate';\n\nexport default function ColorWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: WidgetProps<T, S, F>) {\n return <BaseInputTemplate {...props} type=\"color\" />;\n}\n"],"names":[],"mappings":";;;AAuBA,SAAwB,YAItB,KAAA,EAA6B;AAC7B,EAAA,uBAAO,GAAA,CAAC,iBAAA,EAAA,EAAmB,GAAG,KAAA,EAAO,MAAK,OAAA,EAAQ,CAAA;AACpD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateInput.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/DateInput.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { CSSProperties, ChangeEvent } from 'react';\nimport {\n ariaDescribedByIds,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport { FieldLabel } from '@backstage/ui';\n\n// Native fallback until BUI ships DatePicker/TimePicker components.\nconst baseStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n height: '2rem',\n padding: '0 var(--bui-space-3)',\n borderRadius: 'var(--bui-radius-2)',\n border: '1px solid var(--bui-border-2)',\n backgroundColor: 'var(--bui-bg-neutral-1)',\n fontSize: 'var(--bui-font-size-3)',\n fontFamily: 'var(--bui-font-regular)',\n fontWeight: 400,\n color: 'var(--bui-fg-primary)',\n transition: 'border-color 0.2s ease-in-out',\n width: '100%',\n boxSizing: 'border-box' as const,\n outline: 'none',\n WebkitAppearance: 'none' as const,\n MozAppearance: 'none' as const,\n appearance: 'none' as const,\n};\n\ninterface DateInputProps<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n> extends WidgetProps<T, S, F> {\n inputType: 'date' | 'datetime-local' | 'time';\n}\n\nexport default function DateInput<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({\n id,\n label,\n required,\n disabled,\n readonly,\n value,\n autofocus,\n schema,\n options = {},\n onChange: onFieldChange,\n onBlur: onFieldBlur,\n onFocus: onFieldFocus,\n rawErrors = [],\n inputType,\n}: DateInputProps<T, S, F>) {\n const handleChange = (event: ChangeEvent<HTMLInputElement>) =>\n onFieldChange(\n event.target.value === '' ? options.emptyValue : event.target.value,\n );\n const handleBlur = () => onFieldBlur(id, value);\n const handleFocus = () => onFieldFocus(id, value);\n\n const hasError = rawErrors.length > 0;\n const stringValue = String(value ?? '');\n\n return (\n <>\n {(label || schema.title) && (\n <FieldLabel\n label={label || schema.title}\n secondaryLabel={required ? 'Required' : undefined}\n htmlFor={id}\n />\n )}\n <input\n id={id}\n name={id}\n type={inputType}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autofocus}\n disabled={disabled}\n readOnly={readonly}\n value={stringValue}\n onChange={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n aria-describedby={ariaDescribedByIds<T>(id)}\n aria-invalid={hasError}\n style={{\n ...baseStyle,\n ...(disabled && {\n opacity: 0.5,\n cursor: 'not-allowed',\n borderColor: 'var(--bui-border-disabled)',\n }),\n ...(hasError && {\n borderColor: 'var(--bui-fg-danger)',\n }),\n }}\n />\n </>\n );\n}\n"],"names":[],"mappings":";;;;AA0BA,MAAM,SAAA,GAA2B;AAAA,EAC/B,OAAA,EAAS,MAAA;AAAA,EACT,UAAA,EAAY,QAAA;AAAA,EACZ,MAAA,EAAQ,MAAA;AAAA,EACR,OAAA,EAAS,sBAAA;AAAA,EACT,YAAA,EAAc,qBAAA;AAAA,EACd,MAAA,EAAQ,+BAAA;AAAA,EACR,eAAA,EAAiB,yBAAA;AAAA,EACjB,QAAA,EAAU,wBAAA;AAAA,EACV,UAAA,EAAY,yBAAA;AAAA,EACZ,UAAA,EAAY,GAAA;AAAA,EACZ,KAAA,EAAO,uBAAA;AAAA,EACP,UAAA,EAAY,+BAAA;AAAA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MAAC,OAAA;AAAA,MAAA;AAAA,QACC,EAAA;AAAA,QACA,IAAA,EAAM,EAAA;AAAA,QACN,IAAA,EAAM,SAAA;AAAA,QAEN,SAAA,EAAW,SAAA;AAAA,QACX,QAAA;AAAA,QACA,QAAA,EAAU,QAAA;AAAA,QACV,KAAA,EAAO,WAAA;AAAA,QACP,QAAA,EAAU,YAAA;AAAA,QACV,MAAA,EAAQ,UAAA;AAAA,QACR,OAAA,EAAS,WAAA;AAAA,QACT,kBAAA,EAAkB,mBAAsB,EAAE,CAAA;AAAA,QAC1C,cAAA,EAAc,QAAA;AAAA,QACd,KAAA,EAAO;AAAA,UACL,GAAG,SAAA;AAAA,UACH,GAAI,QAAA,IAAY;AAAA,YACd,OAAA,EAAS,GAAA;AAAA,YACT,MAAA,EAAQ,aAAA;AAAA,YACR,WAAA,EAAa;AAAA,WACf;AAAA,UACA,GAAI,QAAA,IAAY;AAAA,YACd,WAAA,EAAa;AAAA;AACf;AACF;AAAA;AACF,GAAA,EACF,CAAA;AAEJ
|
|
1
|
+
{"version":3,"file":"DateInput.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/DateInput.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { CSSProperties, ChangeEvent } from 'react';\nimport {\n ariaDescribedByIds,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport { FieldLabel } from '@backstage/ui';\n\n// Native fallback until BUI ships DatePicker/TimePicker components.\nconst baseStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n height: '2rem',\n padding: '0 var(--bui-space-3)',\n borderRadius: 'var(--bui-radius-2)',\n border: '1px solid var(--bui-border-2)',\n backgroundColor: 'var(--bui-bg-neutral-1)',\n fontSize: 'var(--bui-font-size-3)',\n fontFamily: 'var(--bui-font-regular)',\n fontWeight: 400,\n color: 'var(--bui-fg-primary)',\n transition: 'border-color 0.2s ease-in-out',\n width: '100%',\n boxSizing: 'border-box' as const,\n outline: 'none',\n WebkitAppearance: 'none' as const,\n MozAppearance: 'none' as const,\n appearance: 'none' as const,\n};\n\ninterface DateInputProps<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n> extends WidgetProps<T, S, F> {\n inputType: 'date' | 'datetime-local' | 'time';\n}\n\nexport default function DateInput<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({\n id,\n label,\n required,\n disabled,\n readonly,\n value,\n autofocus,\n schema,\n options = {},\n onChange: onFieldChange,\n onBlur: onFieldBlur,\n onFocus: onFieldFocus,\n rawErrors = [],\n inputType,\n}: DateInputProps<T, S, F>) {\n const handleChange = (event: ChangeEvent<HTMLInputElement>) =>\n onFieldChange(\n event.target.value === '' ? options.emptyValue : event.target.value,\n );\n const handleBlur = () => onFieldBlur(id, value);\n const handleFocus = () => onFieldFocus(id, value);\n\n const hasError = rawErrors.length > 0;\n const stringValue = String(value ?? '');\n\n return (\n <>\n {(label || schema.title) && (\n <FieldLabel\n label={label || schema.title}\n secondaryLabel={required ? 'Required' : undefined}\n htmlFor={id}\n />\n )}\n <input\n id={id}\n name={id}\n type={inputType}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autofocus}\n disabled={disabled}\n readOnly={readonly}\n value={stringValue}\n onChange={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n aria-describedby={ariaDescribedByIds<T>(id)}\n aria-invalid={hasError}\n style={{\n ...baseStyle,\n ...(disabled && {\n opacity: 0.5,\n cursor: 'not-allowed',\n borderColor: 'var(--bui-border-disabled)',\n }),\n ...(hasError && {\n borderColor: 'var(--bui-fg-danger)',\n }),\n }}\n />\n </>\n );\n}\n"],"names":[],"mappings":";;;;AA0BA,MAAM,SAAA,GAA2B;AAAA,EAC/B,OAAA,EAAS,MAAA;AAAA,EACT,UAAA,EAAY,QAAA;AAAA,EACZ,MAAA,EAAQ,MAAA;AAAA,EACR,OAAA,EAAS,sBAAA;AAAA,EACT,YAAA,EAAc,qBAAA;AAAA,EACd,MAAA,EAAQ,+BAAA;AAAA,EACR,eAAA,EAAiB,yBAAA;AAAA,EACjB,QAAA,EAAU,wBAAA;AAAA,EACV,UAAA,EAAY,yBAAA;AAAA,EACZ,UAAA,EAAY,GAAA;AAAA,EACZ,KAAA,EAAO,uBAAA;AAAA,EACP,UAAA,EAAY,+BAAA;AAAA,EACZ,KAAA,EAAO,MAAA;AAAA,EACP,SAAA,EAAW,YAAA;AAAA,EACX,OAAA,EAAS,MAAA;AAAA,EACT,gBAAA,EAAkB,MAAA;AAAA,EAClB,aAAA,EAAe,MAAA;AAAA,EACf,UAAA,EAAY;AACd,CAAA;AAUA,SAAwB,SAAA,CAItB;AAAA,EACA,EAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,UAAU,EAAC;AAAA,EACX,QAAA,EAAU,aAAA;AAAA,EACV,MAAA,EAAQ,WAAA;AAAA,EACR,OAAA,EAAS,YAAA;AAAA,EACT,YAAY,EAAC;AAAA,EACb;AACF,CAAA,EAA4B;AAC1B,EAAA,MAAM,YAAA,GAAe,CAAC,KAAA,KACpB,aAAA;AAAA,IACE,MAAM,MAAA,CAAO,KAAA,KAAU,KAAK,OAAA,CAAQ,UAAA,GAAa,MAAM,MAAA,CAAO;AAAA,GAChE;AACF,EAAA,MAAM,UAAA,GAAa,MAAM,WAAA,CAAY,EAAA,EAAI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../src/next/components/Form/BuiTheme/widgets/DateTimeWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport DateInput from './DateInput';\n\nexport default function DateTimeWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: WidgetProps<T, S, F>) {\n return <DateInput {...props} inputType=\"datetime-local\" />;\n}\n"],"names":[],"mappings":";;;AAuBA,SAAwB,eAItB,KAAA,EAA6B;AAC7B,EAAA,uBAAO,GAAA,CAAC,SAAA,EAAA,EAAW,GAAG,KAAA,EAAO,WAAU,gBAAA,EAAiB,CAAA;AAC1D
|
|
1
|
+
{"version":3,"file":"DateTimeWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/DateTimeWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport DateInput from './DateInput';\n\nexport default function DateTimeWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: WidgetProps<T, S, F>) {\n return <DateInput {...props} inputType=\"datetime-local\" />;\n}\n"],"names":[],"mappings":";;;AAuBA,SAAwB,eAItB,KAAA,EAA6B;AAC7B,EAAA,uBAAO,GAAA,CAAC,SAAA,EAAA,EAAW,GAAG,KAAA,EAAO,WAAU,gBAAA,EAAiB,CAAA;AAC1D;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/DateWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport DateInput from './DateInput';\n\nexport default function DateWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: WidgetProps<T, S, F>) {\n return <DateInput {...props} inputType=\"date\" />;\n}\n"],"names":[],"mappings":";;;AAuBA,SAAwB,WAItB,KAAA,EAA6B;AAC7B,EAAA,uBAAO,GAAA,CAAC,SAAA,EAAA,EAAW,GAAG,KAAA,EAAO,WAAU,MAAA,EAAO,CAAA;AAChD
|
|
1
|
+
{"version":3,"file":"DateWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/DateWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport DateInput from './DateInput';\n\nexport default function DateWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: WidgetProps<T, S, F>) {\n return <DateInput {...props} inputType=\"date\" />;\n}\n"],"names":[],"mappings":";;;AAuBA,SAAwB,WAItB,KAAA,EAA6B;AAC7B,EAAA,uBAAO,GAAA,CAAC,SAAA,EAAA,EAAW,GAAG,KAAA,EAAO,WAAU,MAAA,EAAO,CAAA;AAChD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmailWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/EmailWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport BaseInputTemplate from './BaseInputTemplate';\n\nexport default function EmailWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: WidgetProps<T, S, F>) {\n return <BaseInputTemplate {...props} type=\"email\" />;\n}\n"],"names":[],"mappings":";;;AAuBA,SAAwB,YAItB,KAAA,EAA6B;AAC7B,EAAA,uBAAO,GAAA,CAAC,iBAAA,EAAA,EAAmB,GAAG,KAAA,EAAO,MAAK,OAAA,EAAQ,CAAA;AACpD
|
|
1
|
+
{"version":3,"file":"EmailWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/EmailWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport BaseInputTemplate from './BaseInputTemplate';\n\nexport default function EmailWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: WidgetProps<T, S, F>) {\n return <BaseInputTemplate {...props} type=\"email\" />;\n}\n"],"names":[],"mappings":";;;AAuBA,SAAwB,YAItB,KAAA,EAA6B;AAC7B,EAAA,uBAAO,GAAA,CAAC,iBAAA,EAAA,EAAmB,GAAG,KAAA,EAAO,MAAK,OAAA,EAAQ,CAAA;AACpD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/FileWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { ChangeEvent, useCallback } from 'react';\nimport {\n ariaDescribedByIds,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\n\nfunction processFile(\n file: File,\n): Promise<{ dataURL: string; name: string; size: number; type: string }> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => {\n resolve({\n dataURL: reader.result as string,\n name: file.name,\n size: file.size,\n type: file.type,\n });\n };\n reader.onerror = reject;\n reader.readAsDataURL(file);\n });\n}\n\nfunction processFiles(files: FileList): Promise<any> {\n return Promise.all(Array.from(files).map(processFile));\n}\n\nexport default function FileWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({\n id,\n readonly,\n disabled,\n required,\n multiple,\n onChange,\n options,\n}: WidgetProps<T, S, F>) {\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n if (!event.target.files || readonly || disabled) {\n return;\n }\n processFiles(event.target.files).then(filesInfo => {\n onChange(multiple ? filesInfo : filesInfo[0]);\n });\n },\n [multiple, readonly, disabled, onChange],\n );\n\n return (\n <input\n id={id}\n name={id}\n type=\"file\"\n disabled={readonly || disabled}\n onChange={handleChange}\n defaultValue=\"\"\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={options.autofocus as boolean}\n multiple={multiple}\n required={required}\n accept={options.accept as string | undefined}\n aria-describedby={ariaDescribedByIds<T>(id)}\n />\n );\n}\n"],"names":[],"mappings":";;;;AAwBA,SAAS,YACP,IAAA,EACwE;AACxE,EAAA,OAAO,IAAI,OAAA,CAAQ,CAAC,OAAA,EAAS,MAAA,KAAW;AACtC,IAAA,MAAM,MAAA,GAAS,IAAI,UAAA,EAAW;AAC9B,IAAA,MAAA,CAAO,SAAS,MAAM;AACpB,MAAA,OAAA,CAAQ;AAAA,QACN,SAAS,MAAA,CAAO,MAAA;AAAA,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AW,OAAA,CAAQ,SAAA;AAAA,MACnB,QAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAQ,OAAA,CAAQ,MAAA;AAAA,MAChB,kBAAA,EAAkB,mBAAsB,EAAE;AAAA;AAAA,GAC5C;AAEJ
|
|
1
|
+
{"version":3,"file":"FileWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/FileWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { ChangeEvent, useCallback } from 'react';\nimport {\n ariaDescribedByIds,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\n\nfunction processFile(\n file: File,\n): Promise<{ dataURL: string; name: string; size: number; type: string }> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => {\n resolve({\n dataURL: reader.result as string,\n name: file.name,\n size: file.size,\n type: file.type,\n });\n };\n reader.onerror = reject;\n reader.readAsDataURL(file);\n });\n}\n\nfunction processFiles(files: FileList): Promise<any> {\n return Promise.all(Array.from(files).map(processFile));\n}\n\nexport default function FileWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({\n id,\n readonly,\n disabled,\n required,\n multiple,\n onChange,\n options,\n}: WidgetProps<T, S, F>) {\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n if (!event.target.files || readonly || disabled) {\n return;\n }\n processFiles(event.target.files).then(filesInfo => {\n onChange(multiple ? filesInfo : filesInfo[0]);\n });\n },\n [multiple, readonly, disabled, onChange],\n );\n\n return (\n <input\n id={id}\n name={id}\n type=\"file\"\n disabled={readonly || disabled}\n onChange={handleChange}\n defaultValue=\"\"\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={options.autofocus as boolean}\n multiple={multiple}\n required={required}\n accept={options.accept as string | undefined}\n aria-describedby={ariaDescribedByIds<T>(id)}\n />\n );\n}\n"],"names":[],"mappings":";;;;AAwBA,SAAS,YACP,IAAA,EACwE;AACxE,EAAA,OAAO,IAAI,OAAA,CAAQ,CAAC,OAAA,EAAS,MAAA,KAAW;AACtC,IAAA,MAAM,MAAA,GAAS,IAAI,UAAA,EAAW;AAC9B,IAAA,MAAA,CAAO,SAAS,MAAM;AACpB,MAAA,OAAA,CAAQ;AAAA,QACN,SAAS,MAAA,CAAO,MAAA;AAAA,QAChB,MAAM,IAAA,CAAK,IAAA;AAAA,QACX,MAAM,IAAA,CAAK,IAAA;AAAA,QACX,MAAM,IAAA,CAAK;AAAA,OACZ,CAAA;AAAA,IACH,CAAA;AACA,IAAA,MAAA,CAAO,OAAA,GAAU,MAAA;AACjB,IAAA,MAAA,CAAO,cAAc,IAAI,CAAA;AAAA,EAC3B,CAAC,CAAA;AACH;AAEA,SAAS,aAAa,KAAA,EAA+B;AACnD,EAAA,OAAO,OAAA,CAAQ,IAAI,KAAA,CAAM,IAAA,CAAK,KAAK,CAAA,CAAE,GAAA,CAAI,WAAW,CAAC,CAAA;AACvD;AAEA,SAAwB,UAAA,CAItB;AAAA,EACA,EAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAAA,EAAyB;AACvB,EAAA,MAAM,YAAA,GAAe,WAAA;AAAA,IACnB,CAAC,KAAA,KAAyC;AACxC,MAAA,IAAI,CAAC,KAAA,CAAM,MAAA,CAAO,KAAA,IAAS,YAAY,QAAA,EAAU;AAC/C,QAAA;AAAA,MACF;AACA,MAAA,YAAA,CAAa,KAAA,CAAM,MAAA,CAAO,KAAK,CAAA,CAAE,KAAK,CAAA,SAAA,KAAa;AACjD,QAAA,QAAA,CAAS,QAAA,GAAW,SAAA,GAAY,SAAA,CAAU,CAAC,CAAC,CAAA;AAAA,MAC9C,CAAC,CAAA;AAAA,IACH,CAAA;AAAA,IACA,CAAC,QAAA,EAAU,QAAA,EAAU,QAAA,EAAU,QAAQ;AAAA,GACzC;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,EAAA;AAAA,MACA,IAAA,EAAM,EAAA;AAAA,MACN,IAAA,EAAK,MAAA;AAAA,MACL,UAAU,QAAA,IAAY,QAAA;AAAA,MACtB,QAAA,EAAU,YAAA;AAAA,MACV,YAAA,EAAa,EAAA;AAAA,MAEb,WAAW,OAAA,CAAQ,SAAA;AAAA,MACnB,QAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAQ,OAAA,CAAQ,MAAA;AAAA,MAChB,kBAAA,EAAkB,mBAAsB,EAAE;AAAA;AAAA,GAC5C;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HiddenWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/HiddenWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\n\nexport default function HiddenWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({ id, value }: WidgetProps<T, S, F>) {\n return (\n <input\n type=\"hidden\"\n id={id}\n name={id}\n value={typeof value === 'undefined' ? '' : value}\n />\n );\n}\n"],"names":[],"mappings":";;AAsBA,SAAwB,YAAA,CAItB,EAAE,EAAA,EAAI,KAAA,EAAM,EAAyB;AACrC,EAAA,uBACE,GAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,QAAA;AAAA,MACL,EAAA;AAAA,MACA,IAAA,EAAM,EAAA;AAAA,MACN,KAAA,EAAO,OAAO,KAAA,KAAU,WAAA,GAAc,EAAA,GAAK;AAAA;AAAA,GAC7C;AAEJ
|
|
1
|
+
{"version":3,"file":"HiddenWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/HiddenWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\n\nexport default function HiddenWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({ id, value }: WidgetProps<T, S, F>) {\n return (\n <input\n type=\"hidden\"\n id={id}\n name={id}\n value={typeof value === 'undefined' ? '' : value}\n />\n );\n}\n"],"names":[],"mappings":";;AAsBA,SAAwB,YAAA,CAItB,EAAE,EAAA,EAAI,KAAA,EAAM,EAAyB;AACrC,EAAA,uBACE,GAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,QAAA;AAAA,MACL,EAAA;AAAA,MACA,IAAA,EAAM,EAAA;AAAA,MACN,KAAA,EAAO,OAAO,KAAA,KAAU,WAAA,GAAc,EAAA,GAAK;AAAA;AAAA,GAC7C;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/PasswordWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 ariaDescribedByIds,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport { PasswordField } from '@backstage/ui';\n\nexport default function PasswordWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({\n id,\n placeholder,\n required,\n readonly,\n disabled,\n label,\n value,\n onChange: onFieldChange,\n onBlur: onFieldBlur,\n onFocus: onFieldFocus,\n autofocus,\n options,\n schema,\n rawErrors = [],\n}: WidgetProps<T, S, F>) {\n const handleChange = (val: string) =>\n onFieldChange(val === '' ? options.emptyValue : val);\n const handleBlur = () => onFieldBlur(id, value);\n const handleFocus = () => onFieldFocus(id, value);\n\n const hasError = rawErrors.length > 0;\n\n return (\n <PasswordField\n id={id}\n name={id}\n label={label || schema.title}\n secondaryLabel={required ? 'Required' : undefined}\n placeholder={placeholder}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autofocus}\n isRequired={required}\n isDisabled={disabled}\n isReadOnly={readonly}\n isInvalid={hasError}\n value={value || ''}\n onChange={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n aria-describedby={ariaDescribedByIds<T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+
{"version":3,"file":"PasswordWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/PasswordWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 ariaDescribedByIds,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport { PasswordField } from '@backstage/ui';\n\nexport default function PasswordWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({\n id,\n placeholder,\n required,\n readonly,\n disabled,\n label,\n value,\n onChange: onFieldChange,\n onBlur: onFieldBlur,\n onFocus: onFieldFocus,\n autofocus,\n options,\n schema,\n rawErrors = [],\n}: WidgetProps<T, S, F>) {\n const handleChange = (val: string) =>\n onFieldChange(val === '' ? options.emptyValue : val);\n const handleBlur = () => onFieldBlur(id, value);\n const handleFocus = () => onFieldFocus(id, value);\n\n const hasError = rawErrors.length > 0;\n\n return (\n <PasswordField\n id={id}\n name={id}\n label={label || schema.title}\n secondaryLabel={required ? 'Required' : undefined}\n placeholder={placeholder}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autofocus}\n isRequired={required}\n isDisabled={disabled}\n isReadOnly={readonly}\n isInvalid={hasError}\n value={value || ''}\n onChange={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n aria-describedby={ariaDescribedByIds<T>(id)}\n />\n );\n}\n"],"names":[],"mappings":";;;;AAwBA,SAAwB,cAAA,CAItB;AAAA,EACA,EAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,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* Copyright 2026 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 ariaDescribedByIds,\n enumOptionsIndexForValue,\n enumOptionsValueForIndex,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport { RadioGroup, Radio } from '@backstage/ui';\n\nexport default function RadioWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({\n id,\n options,\n required,\n value,\n disabled,\n readonly,\n label,\n onChange: onFieldChange,\n rawErrors = [],\n}: WidgetProps<T, S, F>) {\n const { enumOptions, enumDisabled, emptyValue } = options;\n\n const handleChange = (newValue: string) => {\n const actualValue = enumOptionsValueForIndex<S>(\n newValue,\n enumOptions,\n emptyValue,\n );\n onFieldChange(actualValue);\n };\n\n const selectedIndex =\n enumOptionsIndexForValue<S>(value, enumOptions) ?? undefined;\n const hasError = rawErrors.length > 0;\n\n return (\n <RadioGroup\n name={id}\n label={label}\n secondaryLabel={required ? 'Required' : undefined}\n value={selectedIndex !== undefined ? String(selectedIndex) : ''}\n onChange={handleChange}\n isRequired={required}\n isDisabled={disabled || readonly}\n isInvalid={hasError}\n aria-describedby={ariaDescribedByIds<T>(id)}\n >\n {enumOptions?.map(({ value: optionValue, label: optionLabel }, index) => {\n const itemDisabled =\n Array.isArray(enumDisabled) &&\n enumDisabled.indexOf(optionValue) !== -1;\n\n return (\n <Radio key={index} value={String(index)} isDisabled={itemDisabled}>\n {optionLabel}\n </Radio>\n );\n })}\n </RadioGroup>\n );\n}\n"],"names":[],"mappings":";;;;AA0BA,SAAwB,WAAA,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QAAA,uBACE,GAAA,CAAC,SAAkB,KAAA,EAAO,MAAA,CAAO,KAAK,CAAA,EAAG,UAAA,EAAY,YAAA,EAClD,QAAA,EAAA,WAAA,EAAA,EADS,KAEZ,CAAA;AAAA,MAEJ,CAAC;AAAA;AAAA,GACH;AAEJ
|
|
1
|
+
{"version":3,"file":"RadioWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/RadioWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 ariaDescribedByIds,\n enumOptionsIndexForValue,\n enumOptionsValueForIndex,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport { RadioGroup, Radio } from '@backstage/ui';\n\nexport default function RadioWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({\n id,\n options,\n required,\n value,\n disabled,\n readonly,\n label,\n onChange: onFieldChange,\n rawErrors = [],\n}: WidgetProps<T, S, F>) {\n const { enumOptions, enumDisabled, emptyValue } = options;\n\n const handleChange = (newValue: string) => {\n const actualValue = enumOptionsValueForIndex<S>(\n newValue,\n enumOptions,\n emptyValue,\n );\n onFieldChange(actualValue);\n };\n\n const selectedIndex =\n enumOptionsIndexForValue<S>(value, enumOptions) ?? undefined;\n const hasError = rawErrors.length > 0;\n\n return (\n <RadioGroup\n name={id}\n label={label}\n secondaryLabel={required ? 'Required' : undefined}\n value={selectedIndex !== undefined ? String(selectedIndex) : ''}\n onChange={handleChange}\n isRequired={required}\n isDisabled={disabled || readonly}\n isInvalid={hasError}\n aria-describedby={ariaDescribedByIds<T>(id)}\n >\n {enumOptions?.map(({ value: optionValue, label: optionLabel }, index) => {\n const itemDisabled =\n Array.isArray(enumDisabled) &&\n enumDisabled.indexOf(optionValue) !== -1;\n\n return (\n <Radio key={index} value={String(index)} isDisabled={itemDisabled}>\n {optionLabel}\n </Radio>\n );\n })}\n </RadioGroup>\n );\n}\n"],"names":[],"mappings":";;;;AA0BA,SAAwB,WAAA,CAItB;AAAA,EACA,EAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA,EAAU,aAAA;AAAA,EACV,YAAY;AACd,CAAA,EAAyB;AACvB,EAAA,MAAM,EAAE,WAAA,EAAa,YAAA,EAAc,UAAA,EAAW,GAAI,OAAA;AAElD,EAAA,MAAM,YAAA,GAAe,CAAC,QAAA,KAAqB;AACzC,IAAA,MAAM,WAAA,GAAc,wBAAA;AAAA,MAClB,QAAA;AAAA,MACA,WAAA;AAAA,MACA;AAAA,KACF;AACA,IAAA,aAAA,CAAc,WAAW,CAAA;AAAA,EAC3B,CAAA;AAEA,EAAA,MAAM,aAAA,GACJ,wBAAA,CAA4B,KAAA,EAAO,WAAW,CAAA,IAAK,MAAA;AACrD,EAAA,MAAM,QAAA,GAAW,UAAU,MAAA,GAAS,CAAA;AAEpC,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAM,EAAA;AAAA,MACN,KAAA;AAAA,MACA,cAAA,EAAgB,WAAW,UAAA,GAAa,MAAA;AAAA,MACxC,KAAA,EAAO,aAAA,KAAkB,MAAA,GAAY,MAAA,CAAO,aAAa,CAAA,GAAI,EAAA;AAAA,MAC7D,QAAA,EAAU,YAAA;AAAA,MACV,UAAA,EAAY,QAAA;AAAA,MACZ,YAAY,QAAA,IAAY,QAAA;AAAA,MACxB,SAAA,EAAW,QAAA;AAAA,MACX,kBAAA,EAAkB,mBAAsB,EAAE,CAAA;AAAA,MAEzC,QAAA,EAAA,WAAA,EAAa,IAAI,CAAC,EAAE,OAAO,WAAA,EAAa,KAAA,EAAO,WAAA,EAAY,EAAG,KAAA,KAAU;AACvE,QAAA,MAAM,YAAA,GACJ,MAAM,OAAA,CAAQ,YAAY,KAC1B,YAAA,CAAa,OAAA,CAAQ,WAAW,CAAA,KAAM,EAAA;AAExC,QAAA,uBACE,GAAA,CAAC,SAAkB,KAAA,EAAO,MAAA,CAAO,KAAK,CAAA,EAAG,UAAA,EAAY,YAAA,EAClD,QAAA,EAAA,WAAA,EAAA,EADS,KAEZ,CAAA;AAAA,MAEJ,CAAC;AAAA;AAAA,GACH;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RangeWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/RangeWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { ChangeEvent } from 'react';\nimport {\n ariaDescribedByIds,\n FormContextType,\n rangeSpec,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport { Flex, Text } from '@backstage/ui';\n\nexport default function RangeWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({\n id,\n value,\n readonly,\n disabled,\n schema,\n label,\n required,\n onChange: onFieldChange,\n onBlur: onFieldBlur,\n onFocus: onFieldFocus,\n}: WidgetProps<T, S, F>) {\n const { min, max, step } = rangeSpec<S>(schema);\n\n const handleChange = ({\n target: { value: inputValue },\n }: ChangeEvent<HTMLInputElement>) => onFieldChange(parseFloat(inputValue));\n const handleBlur = () => onFieldBlur(id, value);\n const handleFocus = () => onFieldFocus(id, value);\n\n return (\n <Flex align=\"center\" gap=\"4\">\n <input\n id={id}\n name={id}\n type=\"range\"\n disabled={disabled || readonly}\n min={min}\n max={max}\n step={step}\n value={value ?? min}\n onChange={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n aria-label={label}\n aria-describedby={ariaDescribedByIds<T>(id)}\n required={required}\n style={{ flex: 1 }}\n />\n <Text\n variant=\"body-medium\"\n style={{ minWidth: '3rem', textAlign: 'right' }}\n >\n {value ?? min}\n </Text>\n </Flex>\n );\n}\n"],"names":[],"mappings":";;;;AA0BA,SAAwB,WAAA,CAItB;AAAA,EACA,EAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA,EAAU,aAAA;AAAA,EACV,MAAA,EAAQ,WAAA;AAAA,EACR,OAAA,EAAS;AACX,CAAA,EAAyB;AACvB,EAAA,MAAM,EAAE,GAAA,EAAK,GAAA,EAAK,IAAA,EAAK,GAAI,UAAa,MAAM,CAAA;AAE9C,EAAA,MAAM,eAAe,CAAC;AAAA,IACpB,MAAA,EAAQ,EAAE,KAAA,EAAO,UAAA;AAAW,GAC9B,KAAqC,aAAA,CAAc,UAAA,CAAW,UAAU,CAAC,CAAA;AACzE,EAAA,MAAM,UAAA,GAAa,MAAM,WAAA,CAAY,EAAA,EAAI,KAAK,CAAA;AAC9C,EAAA,MAAM,WAAA,GAAc,MAAM,YAAA,CAAa,EAAA,EAAI,KAAK,CAAA;AAEhD,EAAA,uBACE,IAAA,CAAC,IAAA,EAAA,EAAK,KAAA,EAAM,QAAA,EAAS,KAAI,GAAA,EACvB,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,EAAA;AAAA,QACA,IAAA,EAAM,EAAA;AAAA,QACN,IAAA,EAAK,OAAA;AAAA,QACL,UAAU,QAAA,IAAY,QAAA;AAAA,QACtB,GAAA;AAAA,QACA,GAAA;AAAA,QACA,IAAA;AAAA,QACA,OAAO,KAAA,IAAS,GAAA;AAAA,QAChB,QAAA,EAAU,YAAA;AAAA,QACV,MAAA,EAAQ,UAAA;AAAA,QACR,OAAA,EAAS,WAAA;AAAA,QACT,YAAA,EAAY,KAAA;AAAA,QACZ,kBAAA,EAAkB,mBAAsB,EAAE,CAAA;AAAA,QAC1C,QAAA;AAAA,QACA,KAAA,EAAO,EAAE,IAAA,EAAM,CAAA;AAAE;AAAA,KACnB;AAAA,oBACA,GAAA;AAAA,MAAC,IAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAQ,aAAA;AAAA,QACR,KAAA,EAAO,EAAE,QAAA,EAAU,MAAA,EAAQ,WAAW,OAAA,EAAQ;AAAA,QAE7C,QAAA,EAAA,KAAA,IAAS;AAAA;AAAA;AACZ,GAAA,EACF,CAAA;AAEJ
|
|
1
|
+
{"version":3,"file":"RangeWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/RangeWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { ChangeEvent } from 'react';\nimport {\n ariaDescribedByIds,\n FormContextType,\n rangeSpec,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport { Flex, Text } from '@backstage/ui';\n\nexport default function RangeWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({\n id,\n value,\n readonly,\n disabled,\n schema,\n label,\n required,\n onChange: onFieldChange,\n onBlur: onFieldBlur,\n onFocus: onFieldFocus,\n}: WidgetProps<T, S, F>) {\n const { min, max, step } = rangeSpec<S>(schema);\n\n const handleChange = ({\n target: { value: inputValue },\n }: ChangeEvent<HTMLInputElement>) => onFieldChange(parseFloat(inputValue));\n const handleBlur = () => onFieldBlur(id, value);\n const handleFocus = () => onFieldFocus(id, value);\n\n return (\n <Flex align=\"center\" gap=\"4\">\n <input\n id={id}\n name={id}\n type=\"range\"\n disabled={disabled || readonly}\n min={min}\n max={max}\n step={step}\n value={value ?? min}\n onChange={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n aria-label={label}\n aria-describedby={ariaDescribedByIds<T>(id)}\n required={required}\n style={{ flex: 1 }}\n />\n <Text\n variant=\"body-medium\"\n style={{ minWidth: '3rem', textAlign: 'right' }}\n >\n {value ?? min}\n </Text>\n </Flex>\n );\n}\n"],"names":[],"mappings":";;;;AA0BA,SAAwB,WAAA,CAItB;AAAA,EACA,EAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA,EAAU,aAAA;AAAA,EACV,MAAA,EAAQ,WAAA;AAAA,EACR,OAAA,EAAS;AACX,CAAA,EAAyB;AACvB,EAAA,MAAM,EAAE,GAAA,EAAK,GAAA,EAAK,IAAA,EAAK,GAAI,UAAa,MAAM,CAAA;AAE9C,EAAA,MAAM,eAAe,CAAC;AAAA,IACpB,MAAA,EAAQ,EAAE,KAAA,EAAO,UAAA;AAAW,GAC9B,KAAqC,aAAA,CAAc,UAAA,CAAW,UAAU,CAAC,CAAA;AACzE,EAAA,MAAM,UAAA,GAAa,MAAM,WAAA,CAAY,EAAA,EAAI,KAAK,CAAA;AAC9C,EAAA,MAAM,WAAA,GAAc,MAAM,YAAA,CAAa,EAAA,EAAI,KAAK,CAAA;AAEhD,EAAA,uBACE,IAAA,CAAC,IAAA,EAAA,EAAK,KAAA,EAAM,QAAA,EAAS,KAAI,GAAA,EACvB,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,EAAA;AAAA,QACA,IAAA,EAAM,EAAA;AAAA,QACN,IAAA,EAAK,OAAA;AAAA,QACL,UAAU,QAAA,IAAY,QAAA;AAAA,QACtB,GAAA;AAAA,QACA,GAAA;AAAA,QACA,IAAA;AAAA,QACA,OAAO,KAAA,IAAS,GAAA;AAAA,QAChB,QAAA,EAAU,YAAA;AAAA,QACV,MAAA,EAAQ,UAAA;AAAA,QACR,OAAA,EAAS,WAAA;AAAA,QACT,YAAA,EAAY,KAAA;AAAA,QACZ,kBAAA,EAAkB,mBAAsB,EAAE,CAAA;AAAA,QAC1C,QAAA;AAAA,QACA,KAAA,EAAO,EAAE,IAAA,EAAM,CAAA;AAAE;AAAA,KACnB;AAAA,oBACA,GAAA;AAAA,MAAC,IAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAQ,aAAA;AAAA,QACR,KAAA,EAAO,EAAE,QAAA,EAAU,MAAA,EAAQ,WAAW,OAAA,EAAQ;AAAA,QAE7C,QAAA,EAAA,KAAA,IAAS;AAAA;AAAA;AACZ,GAAA,EACF,CAAA;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/SelectWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 ariaDescribedByIds,\n enumOptionsIndexForValue,\n enumOptionsValueForIndex,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport { Select } from '@backstage/ui';\nimport overrides from './selectOverrides.module.css';\n\nexport default function SelectWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({\n id,\n options,\n required,\n disabled,\n readonly,\n value,\n multiple,\n label,\n schema,\n onChange: onFieldChange,\n onBlur: onFieldBlur,\n onFocus: onFieldFocus,\n rawErrors = [],\n}: WidgetProps<T, S, F>) {\n const { enumOptions, emptyValue } = options;\n\n const handleChange = (newValue: string) => {\n const actualIndex = newValue === '' ? '' : newValue;\n onFieldChange(\n enumOptionsValueForIndex<S>(actualIndex, enumOptions, emptyValue),\n );\n };\n\n const handleBlur = () =>\n onFieldBlur(\n id,\n enumOptionsValueForIndex<S>(value, enumOptions, emptyValue),\n );\n const handleFocus = () =>\n onFieldFocus(\n id,\n enumOptionsValueForIndex<S>(value, enumOptions, emptyValue),\n );\n\n const selectedIndex = enumOptionsIndexForValue<S>(value, enumOptions);\n const hasError = rawErrors.length > 0;\n\n const selectOptions =\n enumOptions?.map(({ label: optionLabel }, index) => ({\n value: String(index),\n label: optionLabel,\n })) || [];\n\n if (!multiple && schema.default === undefined) {\n selectOptions.unshift({\n value: '',\n label: (options.placeholder as string) || 'Select an option',\n });\n }\n\n return (\n <Select\n className={overrides.select}\n id={id}\n name={id}\n label={label || schema.title}\n secondaryLabel={required ? 'Required' : undefined}\n options={selectOptions}\n selectedKey={selectedIndex !== undefined ? String(selectedIndex) : ''}\n onSelectionChange={key => {\n const selected = key ? String(key) : '';\n handleChange(selected);\n }}\n isRequired={required}\n isDisabled={disabled || readonly}\n isInvalid={hasError}\n onBlur={handleBlur}\n onFocus={handleFocus}\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,QAAA,IAAY,MAAA,CAAO,OAAA,KAAY,MAAA,EAAW;AAC7C,IAAA,aAAA,CAAc,OAAA,CAAQ;AAAA,MACpB,KAAA,EAAO,EAAA;AAAA,MACP,KAAA,EAAQ,QAAQ,WAAA,IAA0B;AAAA,KAC3C,CAAA;AAAA,EACH;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,WAAW,SAAA,CAAU,MAAA;AAAA,MACrB,EAAA;AAAA,MACA,IAAA,EAAM,EAAA;AAAA,MACN,KAAA,EAAO,SAAS,MAAA,CAAO,KAAA;AAAA,MACvB,cAAA,EAAgB,WAAW,UAAA,GAAa,MAAA;AAAA,MACxC,OAAA,EAAS,aAAA;AAAA,MACT,WAAA,EAAa,aAAA,KAAkB,MAAA,GAAY,MAAA,CAAO,aAAa,CAAA,GAAI,EAAA;AAAA,MACnE,mBAAmB,CAAA,GAAA,KAAO;AACxB,QAAA,MAAM,QAAA,GAAW,GAAA,GAAM,MAAA,CAAO,GAAG,CAAA,GAAI,EAAA;AACrC,QAAA,YAAA,CAAa,QAAQ,CAAA;AAAA,MACvB,CAAA;AAAA,MACA,UAAA,EAAY,QAAA;AAAA,MACZ,YAAY,QAAA,IAAY,QAAA;AAAA,MACxB,SAAA,EAAW,QAAA;AAAA,MACX,MAAA,EAAQ,UAAA;AAAA,MACR,OAAA,EAAS,WAAA;AAAA,MACT,kBAAA,EAAkB,mBAAsB,EAAE;AAAA;AAAA,GAC5C;AAEJ
|
|
1
|
+
{"version":3,"file":"SelectWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/SelectWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 ariaDescribedByIds,\n enumOptionsIndexForValue,\n enumOptionsValueForIndex,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport { Select } from '@backstage/ui';\nimport overrides from './selectOverrides.module.css';\n\nexport default function SelectWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({\n id,\n options,\n required,\n disabled,\n readonly,\n value,\n multiple,\n label,\n schema,\n onChange: onFieldChange,\n onBlur: onFieldBlur,\n onFocus: onFieldFocus,\n rawErrors = [],\n}: WidgetProps<T, S, F>) {\n const { enumOptions, emptyValue } = options;\n\n const handleChange = (newValue: string) => {\n const actualIndex = newValue === '' ? '' : newValue;\n onFieldChange(\n enumOptionsValueForIndex<S>(actualIndex, enumOptions, emptyValue),\n );\n };\n\n const handleBlur = () =>\n onFieldBlur(\n id,\n enumOptionsValueForIndex<S>(value, enumOptions, emptyValue),\n );\n const handleFocus = () =>\n onFieldFocus(\n id,\n enumOptionsValueForIndex<S>(value, enumOptions, emptyValue),\n );\n\n const selectedIndex = enumOptionsIndexForValue<S>(value, enumOptions);\n const hasError = rawErrors.length > 0;\n\n const selectOptions =\n enumOptions?.map(({ label: optionLabel }, index) => ({\n value: String(index),\n label: optionLabel,\n })) || [];\n\n if (!multiple && schema.default === undefined) {\n selectOptions.unshift({\n value: '',\n label: (options.placeholder as string) || 'Select an option',\n });\n }\n\n return (\n <Select\n className={overrides.select}\n id={id}\n name={id}\n label={label || schema.title}\n secondaryLabel={required ? 'Required' : undefined}\n options={selectOptions}\n selectedKey={selectedIndex !== undefined ? String(selectedIndex) : ''}\n onSelectionChange={key => {\n const selected = key ? String(key) : '';\n handleChange(selected);\n }}\n isRequired={required}\n isDisabled={disabled || readonly}\n isInvalid={hasError}\n onBlur={handleBlur}\n onFocus={handleFocus}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C,QAAA,IAAY,MAAA,CAAO,OAAA,KAAY,MAAA,EAAW;AAC7C,IAAA,aAAA,CAAc,OAAA,CAAQ;AAAA,MACpB,KAAA,EAAO,EAAA;AAAA,MACP,KAAA,EAAQ,QAAQ,WAAA,IAA0B;AAAA,KAC3C,CAAA;AAAA,EACH;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,WAAW,SAAA,CAAU,MAAA;AAAA,MACrB,EAAA;AAAA,MACA,IAAA,EAAM,EAAA;AAAA,MACN,KAAA,EAAO,SAAS,MAAA,CAAO,KAAA;AAAA,MACvB,cAAA,EAAgB,WAAW,UAAA,GAAa,MAAA;AAAA,MACxC,OAAA,EAAS,aAAA;AAAA,MACT,WAAA,EAAa,aAAA,KAAkB,MAAA,GAAY,MAAA,CAAO,aAAa,CAAA,GAAI,EAAA;AAAA,MACnE,mBAAmB,CAAA,GAAA,KAAO;AACxB,QAAA,MAAM,QAAA,GAAW,GAAA,GAAM,MAAA,CAAO,GAAG,CAAA,GAAI,EAAA;AACrC,QAAA,YAAA,CAAa,QAAQ,CAAA;AAAA,MACvB,CAAA;AAAA,MACA,UAAA,EAAY,QAAA;AAAA,MACZ,YAAY,QAAA,IAAY,QAAA;AAAA,MACxB,SAAA,EAAW,QAAA;AAAA,MACX,MAAA,EAAQ,UAAA;AAAA,MACR,OAAA,EAAS,WAAA;AAAA,MACT,kBAAA,EAAkB,mBAAsB,EAAE;AAAA;AAAA,GAC5C;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/TextWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport BaseInputTemplate from './BaseInputTemplate';\n\nexport default function TextWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: WidgetProps<T, S, F>) {\n return <BaseInputTemplate {...props} />;\n}\n"],"names":[],"mappings":";;;AAuBA,SAAwB,WAItB,KAAA,EAA6B;AAC7B,EAAA,uBAAO,GAAA,CAAC,iBAAA,EAAA,EAAmB,GAAG,KAAA,EAAO,CAAA;AACvC
|
|
1
|
+
{"version":3,"file":"TextWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/TextWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport BaseInputTemplate from './BaseInputTemplate';\n\nexport default function TextWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: WidgetProps<T, S, F>) {\n return <BaseInputTemplate {...props} />;\n}\n"],"names":[],"mappings":";;;AAuBA,SAAwB,WAItB,KAAA,EAA6B;AAC7B,EAAA,uBAAO,GAAA,CAAC,iBAAA,EAAA,EAAmB,GAAG,KAAA,EAAO,CAAA;AACvC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextareaWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/TextareaWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { CSSProperties, ChangeEvent } from 'react';\nimport {\n ariaDescribedByIds,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport { FieldLabel } from '@backstage/ui';\n\n// Matches the outlined style used by BUI PasswordField: sits on the same\n// neutral-1 surface as the form and uses a visible border to read as an input.\nconst baseStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'flex-start',\n padding: 'var(--bui-space-3)',\n borderRadius: 'var(--bui-radius-3)',\n border: '1px solid var(--bui-border-2)',\n backgroundColor: 'var(--bui-bg-neutral-1)',\n fontSize: 'var(--bui-font-size-3)',\n fontFamily: 'var(--bui-font-regular)',\n fontWeight: 400,\n lineHeight: '1.5',\n color: 'var(--bui-fg-primary)',\n transition: 'border-color 0.2s ease-in-out',\n width: '100%',\n resize: 'vertical',\n boxSizing: 'border-box' as const,\n outline: 'none',\n WebkitAppearance: 'none' as const,\n MozAppearance: 'none' as const,\n appearance: 'none' as const,\n};\n\nexport default function TextareaWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({\n id,\n options = {},\n placeholder,\n required,\n value,\n disabled,\n readonly,\n label,\n autofocus,\n onChange: onFieldChange,\n onBlur: onFieldBlur,\n onFocus: onFieldFocus,\n schema,\n rawErrors = [],\n}: WidgetProps<T, S, F>) {\n const handleChange = (event: ChangeEvent<HTMLTextAreaElement>) =>\n onFieldChange(\n event.target.value === '' ? options.emptyValue : event.target.value,\n );\n const handleBlur = () => onFieldBlur(id, value);\n const handleFocus = () => onFieldFocus(id, value);\n\n const hasError = rawErrors.length > 0;\n\n return (\n <>\n {(label || schema.title) && (\n <FieldLabel\n label={label || schema.title}\n secondaryLabel={required ? 'Required' : undefined}\n htmlFor={id}\n />\n )}\n <textarea\n id={id}\n name={id}\n placeholder={placeholder}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autofocus}\n disabled={disabled}\n readOnly={readonly}\n value={value || ''}\n rows={(options.rows as number) || 3}\n onChange={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n aria-describedby={ariaDescribedByIds<T>(id)}\n aria-invalid={hasError}\n style={{\n ...baseStyle,\n ...(disabled && {\n opacity: 0.5,\n cursor: 'not-allowed',\n borderColor: 'var(--bui-border-disabled)',\n }),\n ...(hasError && {\n borderColor: 'var(--bui-fg-danger)',\n }),\n }}\n />\n </>\n );\n}\n"],"names":[],"mappings":";;;;AA2BA,MAAM,SAAA,GAA2B;AAAA,EAC/B,OAAA,EAAS,MAAA;AAAA,EACT,UAAA,EAAY,YAAA;AAAA,EACZ,OAAA,EAAS,oBAAA;AAAA,EACT,YAAA,EAAc,qBAAA;AAAA,EACd,MAAA,EAAQ,+BAAA;AAAA,EACR,eAAA,EAAiB,yBAAA;AAAA,EACjB,QAAA,EAAU,wBAAA;AAAA,EACV,UAAA,EAAY,yBAAA;AAAA,EACZ,UAAA,EAAY,GAAA;AAAA,EACZ,UAAA,EAAY,KAAA;AAAA,EACZ,KAAA,EAAO,uBAAA;AAAA,EACP,UAAA,EAAY,+BAAA;AAAA,EACZ,KAAA,EAAO,MAAA;AAAA,EACP,MAAA,EAAQ,UAAA;AAAA,EACR,SAAA,EAAW,YAAA;AAAA,EACX,OAAA,EAAS,MAAA;AAAA,EACT,gBAAA,EAAkB,MAAA;AAAA,EAClB,aAAA,EAAe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AChB,IAAA,EAAO,QAAQ,IAAA,IAAmB,CAAA;AAAA,QAClC,QAAA,EAAU,YAAA;AAAA,QACV,MAAA,EAAQ,UAAA;AAAA,QACR,OAAA,EAAS,WAAA;AAAA,QACT,kBAAA,EAAkB,mBAAsB,EAAE,CAAA;AAAA,QAC1C,cAAA,EAAc,QAAA;AAAA,QACd,KAAA,EAAO;AAAA,UACL,GAAG,SAAA;AAAA,UACH,GAAI,QAAA,IAAY;AAAA,YACd,OAAA,EAAS,GAAA;AAAA,YACT,MAAA,EAAQ,aAAA;AAAA,YACR,WAAA,EAAa;AAAA,WACf;AAAA,UACA,GAAI,QAAA,IAAY;AAAA,YACd,WAAA,EAAa;AAAA;AACf;AACF;AAAA;AACF,GAAA,EACF,CAAA;AAEJ
|
|
1
|
+
{"version":3,"file":"TextareaWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/TextareaWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { CSSProperties, ChangeEvent } from 'react';\nimport {\n ariaDescribedByIds,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport { FieldLabel } from '@backstage/ui';\n\n// Matches the outlined style used by BUI PasswordField: sits on the same\n// neutral-1 surface as the form and uses a visible border to read as an input.\nconst baseStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'flex-start',\n padding: 'var(--bui-space-3)',\n borderRadius: 'var(--bui-radius-3)',\n border: '1px solid var(--bui-border-2)',\n backgroundColor: 'var(--bui-bg-neutral-1)',\n fontSize: 'var(--bui-font-size-3)',\n fontFamily: 'var(--bui-font-regular)',\n fontWeight: 400,\n lineHeight: '1.5',\n color: 'var(--bui-fg-primary)',\n transition: 'border-color 0.2s ease-in-out',\n width: '100%',\n resize: 'vertical',\n boxSizing: 'border-box' as const,\n outline: 'none',\n WebkitAppearance: 'none' as const,\n MozAppearance: 'none' as const,\n appearance: 'none' as const,\n};\n\nexport default function TextareaWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({\n id,\n options = {},\n placeholder,\n required,\n value,\n disabled,\n readonly,\n label,\n autofocus,\n onChange: onFieldChange,\n onBlur: onFieldBlur,\n onFocus: onFieldFocus,\n schema,\n rawErrors = [],\n}: WidgetProps<T, S, F>) {\n const handleChange = (event: ChangeEvent<HTMLTextAreaElement>) =>\n onFieldChange(\n event.target.value === '' ? options.emptyValue : event.target.value,\n );\n const handleBlur = () => onFieldBlur(id, value);\n const handleFocus = () => onFieldFocus(id, value);\n\n const hasError = rawErrors.length > 0;\n\n return (\n <>\n {(label || schema.title) && (\n <FieldLabel\n label={label || schema.title}\n secondaryLabel={required ? 'Required' : undefined}\n htmlFor={id}\n />\n )}\n <textarea\n id={id}\n name={id}\n placeholder={placeholder}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autofocus}\n disabled={disabled}\n readOnly={readonly}\n value={value || ''}\n rows={(options.rows as number) || 3}\n onChange={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n aria-describedby={ariaDescribedByIds<T>(id)}\n aria-invalid={hasError}\n style={{\n ...baseStyle,\n ...(disabled && {\n opacity: 0.5,\n cursor: 'not-allowed',\n borderColor: 'var(--bui-border-disabled)',\n }),\n ...(hasError && {\n borderColor: 'var(--bui-fg-danger)',\n }),\n }}\n />\n </>\n );\n}\n"],"names":[],"mappings":";;;;AA2BA,MAAM,SAAA,GAA2B;AAAA,EAC/B,OAAA,EAAS,MAAA;AAAA,EACT,UAAA,EAAY,YAAA;A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A,EAAA,EACI,QAAA,EAAA;AAAA,IAAA,CAAA,KAAA,IAAS,OAAO,KAAA,qBAChB,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO,SAAS,MAAA,CAAO,KAAA;AAAA,QACvB,cAAA,EAAgB,WAAW,UAAA,GAAa,MAAA;AAAA,QACxC,OAAA,EAAS;AAAA;AAAA,KACX;AAAA,oBAEF,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,EAAA;AAAA,QACA,IAAA,EAAM,EAAA;AAAA,QACN,WAAA;AAAA,QAEA,SAAA,EAAW,SAAA;AAAA,QACX,QAAA;AAAA,QACA,QAAA,EAAU,QAAA;AAAA,QACV,OAAO,KAAA,IAAS,EAAA;AAAA,QAChB,IAAA,EAAO,QAAQ,IAAA,IAAmB,CAAA;AAAA,QAClC,QAAA,EAAU,YAAA;AAAA,QACV,MAAA,EAAQ,UAAA;AAAA,QACR,OAAA,EAAS,WAAA;AAAA,QACT,kBAAA,EAAkB,mBAAsB,EAAE,CAAA;AAAA,QAC1C,cAAA,EAAc,QAAA;AAAA,QACd,KAAA,EAAO;AAAA,UACL,GAAG,SAAA;AAAA,UACH,GAAI,QAAA,IAAY;AAAA,YACd,OAAA,EAAS,GAAA;AAAA,YACT,MAAA,EAAQ,aAAA;AAAA,YACR,WAAA,EAAa;AAAA,WACf;AAAA,UACA,GAAI,QAAA,IAAY;AAAA,YACd,WAAA,EAAa;AAAA;AACf;AACF;AAAA;AACF,GAAA,EACF,CAAA;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/TimeWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport DateInput from './DateInput';\n\nexport default function TimeWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: WidgetProps<T, S, F>) {\n return <DateInput {...props} inputType=\"time\" />;\n}\n"],"names":[],"mappings":";;;AAuBA,SAAwB,WAItB,KAAA,EAA6B;AAC7B,EAAA,uBAAO,GAAA,CAAC,SAAA,EAAA,EAAW,GAAG,KAAA,EAAO,WAAU,MAAA,EAAO,CAAA;AAChD
|
|
1
|
+
{"version":3,"file":"TimeWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/TimeWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport DateInput from './DateInput';\n\nexport default function TimeWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: WidgetProps<T, S, F>) {\n return <DateInput {...props} inputType=\"time\" />;\n}\n"],"names":[],"mappings":";;;AAuBA,SAAwB,WAItB,KAAA,EAA6B;AAC7B,EAAA,uBAAO,GAAA,CAAC,SAAA,EAAA,EAAW,GAAG,KAAA,EAAO,WAAU,MAAA,EAAO,CAAA;AAChD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"URLWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/URLWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport BaseInputTemplate from './BaseInputTemplate';\n\nexport default function URLWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: WidgetProps<T, S, F>) {\n return <BaseInputTemplate {...props} type=\"url\" />;\n}\n"],"names":[],"mappings":";;;AAuBA,SAAwB,UAItB,KAAA,EAA6B;AAC7B,EAAA,uBAAO,GAAA,CAAC,iBAAA,EAAA,EAAmB,GAAG,KAAA,EAAO,MAAK,KAAA,EAAM,CAAA;AAClD
|
|
1
|
+
{"version":3,"file":"URLWidget.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/URLWidget.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n WidgetProps,\n} from '@rjsf/utils';\nimport BaseInputTemplate from './BaseInputTemplate';\n\nexport default function URLWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: WidgetProps<T, S, F>) {\n return <BaseInputTemplate {...props} type=\"url\" />;\n}\n"],"names":[],"mappings":";;;AAuBA,SAAwB,UAItB,KAAA,EAA6B;AAC7B,EAAA,uBAAO,GAAA,CAAC,iBAAA,EAAA,EAAmB,GAAG,KAAA,EAAO,MAAK,KAAA,EAAM,CAAA;AAClD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/index.ts"],"sourcesContent":["/*\n * Copyright 2026 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 FormContextType,\n RegistryWidgetsType,\n RJSFSchema,\n StrictRJSFSchema,\n} from '@rjsf/utils';\n\nimport BaseInputTemplate from './BaseInputTemplate';\nimport CheckboxWidget from './CheckboxWidget';\nimport CheckboxesWidget from './CheckboxesWidget';\nimport ColorWidget from './ColorWidget';\nimport DateWidget from './DateWidget';\nimport DateTimeWidget from './DateTimeWidget';\nimport EmailWidget from './EmailWidget';\nimport FileWidget from './FileWidget';\nimport HiddenWidget from './HiddenWidget';\nimport PasswordWidget from './PasswordWidget';\nimport RadioWidget from './RadioWidget';\nimport RangeWidget from './RangeWidget';\nimport SelectWidget from './SelectWidget';\nimport TextareaWidget from './TextareaWidget';\nimport TextWidget from './TextWidget';\nimport TimeWidget from './TimeWidget';\nimport URLWidget from './URLWidget';\n\nexport function generateBuiWidgets<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(): RegistryWidgetsType<T, S, F> {\n return {\n BaseInput: BaseInputTemplate,\n CheckboxWidget,\n CheckboxesWidget,\n ColorWidget,\n DateWidget,\n DateTimeWidget,\n EmailWidget,\n FileWidget,\n HiddenWidget,\n PasswordWidget,\n RadioWidget,\n RangeWidget,\n SelectWidget,\n TextareaWidget,\n TextWidget,\n TimeWidget,\n URLWidget,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAwCO,SAAS,kBAAA,GAIkB;AAChC,EAAA,OAAO;AAAA,IACL,SAAA,EAAW,iBAAA;AAAA,IACX,cAAA;AAAA,IACA,gBAAA;AAAA,IACA,WAAA;AAAA,IACA,UAAA;AAAA,IACA,cAAA;AAAA,IACA,WAAA;AAAA,IACA,UAAA;AAAA,IACA,YAAA;AAAA,IACA,cAAA;AAAA,IACA,WAAA;AAAA,IACA,WAAA;AAAA,IACA,YAAA;AAAA,IACA,cAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACF;AACF
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../../../../src/next/components/Form/BuiTheme/widgets/index.ts"],"sourcesContent":["/*\n * Copyright 2026 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 FormContextType,\n RegistryWidgetsType,\n RJSFSchema,\n StrictRJSFSchema,\n} from '@rjsf/utils';\n\nimport BaseInputTemplate from './BaseInputTemplate';\nimport CheckboxWidget from './CheckboxWidget';\nimport CheckboxesWidget from './CheckboxesWidget';\nimport ColorWidget from './ColorWidget';\nimport DateWidget from './DateWidget';\nimport DateTimeWidget from './DateTimeWidget';\nimport EmailWidget from './EmailWidget';\nimport FileWidget from './FileWidget';\nimport HiddenWidget from './HiddenWidget';\nimport PasswordWidget from './PasswordWidget';\nimport RadioWidget from './RadioWidget';\nimport RangeWidget from './RangeWidget';\nimport SelectWidget from './SelectWidget';\nimport TextareaWidget from './TextareaWidget';\nimport TextWidget from './TextWidget';\nimport TimeWidget from './TimeWidget';\nimport URLWidget from './URLWidget';\n\nexport function generateBuiWidgets<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(): RegistryWidgetsType<T, S, F> {\n return {\n BaseInput: BaseInputTemplate,\n CheckboxWidget,\n CheckboxesWidget,\n ColorWidget,\n DateWidget,\n DateTimeWidget,\n EmailWidget,\n FileWidget,\n HiddenWidget,\n PasswordWidget,\n RadioWidget,\n RangeWidget,\n SelectWidget,\n TextareaWidget,\n TextWidget,\n TimeWidget,\n URLWidget,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAwCO,SAAS,kBAAA,GAIkB;AAChC,EAAA,OAAO;AAAA,IACL,SAAA,EAAW,iBAAA;AAAA,IACX,cAAA;AAAA,IACA,gBAAA;AAAA,IACA,WAAA;AAAA,IACA,UAAA;AAAA,IACA,cAAA;AAAA,IACA,WAAA;AAAA,IACA,UAAA;AAAA,IACA,YAAA;AAAA,IACA,cAAA;AAAA,IACA,WAAA;AAAA,IACA,WAAA;AAAA,IACA,YAAA;AAAA,IACA,cAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACF;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectOverrides.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"selectOverrides.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -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 { 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,CAAA,KAAA,MAAU;AAAA,EACrC,mBAAA,EAAqB;AAAA,IACnB,QAAA,EAAU,KAAA,CAAM,UAAA,CAAW,OAAA,CAAQ,QAAA;AAAA,IACnC,MAAA,EAAQ,CAAA;AAAA,IACR,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,SAAA;AAAA,IAC1B,gBAAA,EAAkB;AAAA,MAChB,MAAA,EAAQ,CAAA;AAAA,MACR,SAAA,EAAW;AAAA;AAAA;AACb;AAEJ,CAAA,CAAE,CAAA;AAMK,MAAM,wBAAA,GAA2B,CAKtC,KAAA,KACG;AACH,EAAA,MAAM,EAAE,EAAA,EAAI,WAAA,EAAY,GAAI,KAAA;AAC5B,EAAA,MAAM,UAAU,SAAA,EAAU;AAE1B,EAAA,IAAI,WAAA,EAAa;AACf,IAAA,IAAI,OAAO,gBAAgB,QAAA,EAAU;AACnC,MAAA,uBACE,GAAA;AAAA,QAAC,eAAA;AAAA,QAAA;AAAA,UACC,OAAA,EAAS,WAAA;AAAA,UACT,UAAA,EAAW,QAAA;AAAA,UACX,WAAW,OAAA,CAAQ;AAAA;AAAA,OACrB;AAAA,IAEJ;AAEA,IAAA,uBACE,GAAA,CAAC,UAAA,EAAA,EAAW,EAAA,EAAQ,OAAA,EAAQ,WAAA,EAAY,OAAO,EAAE,SAAA,EAAW,KAAA,EAAM,EAC/D,QAAA,EAAA,WAAA,EACH,CAAA;AAAA,EAEJ;AAEA,EAAA,OAAO,IAAA;AACT
|
|
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,CAAA,KAAA,MAAU;AAAA,EACrC,mBAAA,EAAqB;AAAA,IACnB,QAAA,EAAU,KAAA,CAAM,UAAA,CAAW,OAAA,CAAQ,QAAA;AAAA,IACnC,MAAA,EAAQ,CAAA;AAAA,IACR,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,SAAA;AAAA,IAC1B,gBAAA,EAAkB;AAAA,MAChB,MAAA,EAAQ,CAAA;AAAA,MACR,SAAA,EAAW;AAAA;AAAA;AACb;AAEJ,CAAA,CAAE,CAAA;AAMK,MAAM,wBAAA,GAA2B,CAKtC,KAAA,KACG;AACH,EAAA,MAAM,EAAE,EAAA,EAAI,WAAA,EAAY,GAAI,KAAA;AAC5B,EAAA,MAAM,UAAU,SAAA,EAAU;AAE1B,EAAA,IAAI,WAAA,EAAa;AACf,IAAA,IAAI,OAAO,gBAAgB,QAAA,EAAU;AACnC,MAAA,uBACE,GAAA;AAAA,QAAC,eAAA;AAAA,QAAA;AAAA,UACC,OAAA,EAAS,WAAA;AAAA,UACT,UAAA,EAAW,QAAA;AAAA,UACX,WAAW,OAAA,CAAQ;AAAA;AAAA,OACrB;AAAA,IAEJ;AAEA,IAAA,uBACE,GAAA,CAAC,UAAA,EAAA,EAAW,EAAA,EAAQ,OAAA,EAAQ,WAAA,EAAY,OAAO,EAAE,SAAA,EAAW,KAAA,EAAM,EAC/D,QAAA,EAAA,WAAA,EACH,CAAA;AAAA,EAEJ;AAEA,EAAA,OAAO,IAAA;AACT;;"}
|
|
@@ -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 {\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+BO,MAAM,aAAA,GAAgB,CAK3B,KAAA,KACG;AACH,EAAA,MAAM;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,GACF,GAAI,KAAA;AAEJ,EAAA,MAAM,SAAA,GAAY,aAAsB,QAAQ,CAAA;AAChD,EAAA,MAAM,wBAAA,GAA2B,WAAA,CAK/B,0BAAA,EAA4B,QAAA,EAAU,SAAS,CAAA;AAEjD,EAAA,IAAI,MAAA,EAAQ;AACV,IAAA,2BAAQ,KAAA,EAAA,EAAI,KAAA,EAAO,EAAE,OAAA,EAAS,MAAA,IAAW,QAAA,EAAS,CAAA;AAAA,EACpD;AACA,EAAA,uBACE,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
|
+
{"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+BO,MAAM,aAAA,GAAgB,CAK3B,KAAA,KACG;AACH,EAAA,MAAM;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,GACF,GAAI,KAAA;AAEJ,EAAA,MAAM,SAAA,GAAY,aAAsB,QAAQ,CAAA;AAChD,EAAA,MAAM,wBAAA,GAA2B,WAAA,CAK/B,0BAAA,EAA4B,QAAA,EAAU,SAAS,CAAA;AAEjD,EAAA,IAAI,MAAA,EAAQ;AACV,IAAA,2BAAQ,KAAA,EAAA,EAAI,KAAA,EAAO,EAAE,OAAA,EAAS,MAAA,IAAW,QAAA,EAAS,CAAA;AAAA,EACpD;AACA,EAAA,uBACE,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 +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 { useMemo, PropsWithChildren } from 'react';\nimport { FieldTemplate } from './FieldTemplate';\nimport { DescriptionFieldTemplate } from './DescriptionFieldTemplate';\nimport { FieldProps } from '@rjsf/utils';\nimport {\n ScaffolderRJSFFormProps,\n type FormProps,\n} from '@backstage/plugin-scaffolder-react';\nimport { Theme as MuiTheme } from '@rjsf/material-ui';\nimport { generateBuiTheme } from './BuiTheme';\nimport {\n ScaffolderThemeProvider,\n type ScaffolderTheme,\n} from './ScaffolderThemeContext';\nimport styles from './BuiTheme/Form.module.css';\n\nconst MuiForm = withTheme(MuiTheme);\nconst BuiForm = withTheme(generateBuiTheme());\n\n/**\n * The Form component\n * @alpha\n */\nexport const Form = (\n props: PropsWithChildren<\n ScaffolderRJSFFormProps & Pick<FormProps, 'EXPERIMENTAL_theme'>\n >,\n) => {\n const { EXPERIMENTAL_theme: themeProp, ...formProps } = props;\n const theme: ScaffolderTheme = themeProp ?? 'mui';\n const WrappedForm = theme === 'bui' ? BuiForm : MuiForm;\n\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(formProps.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 [formProps.fields],\n );\n\n const templates = useMemo(\n () =>\n theme === 'bui'\n ? formProps.templates ?? {}\n : {\n FieldTemplate,\n DescriptionFieldTemplate,\n ...formProps.templates,\n },\n [formProps.templates, theme],\n );\n\n const form = (\n <WrappedForm {...formProps} templates={templates} fields={wrappedFields} />\n );\n\n return (\n <ScaffolderThemeProvider value={theme}>\n {theme === 'bui' ? <div className={styles.form}>{form}</div> : form}\n </ScaffolderThemeProvider>\n );\n};\n"],"names":["MuiTheme"],"mappings":";;;;;;;;;;AAiCA,MAAM,OAAA,GAAU,UA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AM,uBACJ,GAAA,CAAC,WAAA,EAAA,EAAa,GAAG,SAAA,EAAW,SAAA,EAAsB,QAAQ,aAAA,EAAe,CAAA;AAG3E,EAAA,uBACE,GAAA,CAAC,uBAAA,EAAA,EAAwB,KAAA,EAAO,KAAA,EAC7B,QAAA,EAAA,KAAA,KAAU,KAAA,mBAAQ,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,IAAA,EAAO,QAAA,EAAA,IAAA,EAAK,IAAS,IAAA,EACjE,CAAA;AAEJ
|
|
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 {\n ScaffolderRJSFFormProps,\n type FormProps,\n} from '@backstage/plugin-scaffolder-react';\nimport { Theme as MuiTheme } from '@rjsf/material-ui';\nimport { generateBuiTheme } from './BuiTheme';\nimport {\n ScaffolderThemeProvider,\n type ScaffolderTheme,\n} from './ScaffolderThemeContext';\nimport styles from './BuiTheme/Form.module.css';\n\nconst MuiForm = withTheme(MuiTheme);\nconst BuiForm = withTheme(generateBuiTheme());\n\n/**\n * The Form component\n * @alpha\n */\nexport const Form = (\n props: PropsWithChildren<\n ScaffolderRJSFFormProps & Pick<FormProps, 'EXPERIMENTAL_theme'>\n >,\n) => {\n const { EXPERIMENTAL_theme: themeProp, ...formProps } = props;\n const theme: ScaffolderTheme = themeProp ?? 'mui';\n const WrappedForm = theme === 'bui' ? BuiForm : MuiForm;\n\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(formProps.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 [formProps.fields],\n );\n\n const templates = useMemo(\n () =>\n theme === 'bui'\n ? formProps.templates ?? {}\n : {\n FieldTemplate,\n DescriptionFieldTemplate,\n ...formProps.templates,\n },\n [formProps.templates, theme],\n );\n\n const form = (\n <WrappedForm {...formProps} templates={templates} fields={wrappedFields} />\n );\n\n return (\n <ScaffolderThemeProvider value={theme}>\n {theme === 'bui' ? <div className={styles.form}>{form}</div> : form}\n </ScaffolderThemeProvider>\n );\n};\n"],"names":["MuiTheme"],"mappings":";;;;;;;;;;AAiCA,MAAM,OAAA,GAAU,UAAUA,KAAQ,CAAA;AAClC,MAAM,OAAA,GAAU,SAAA,CAAU,gBAAA,EAAkB,CAAA;AAMrC,MAAM,IAAA,GAAO,CAClB,KAAA,KAGG;AACH,EAAA,MAAM,EAAE,kBAAA,EAAoB,SAAA,EAAW,GAAG,WAAU,GAAI,KAAA;AACxD,EAAA,MAAM,QAAyB,SAAA,IAAa,KAAA;AAC5C,EAAA,MAAM,WAAA,GAAc,KAAA,KAAU,KAAA,GAAQ,OAAA,GAAU,OAAA;AAIhD,EAAA,MAAM,aAAA,GAAgB,OAAA;AAAA,IACpB,MACE,MAAA,CAAO,WAAA;AAAA,MACL,MAAA,CAAO,OAAA,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../../../src/next/components/Form/ScaffolderThemeContext.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 { createContext, useContext } from 'react';\n\n/** @alpha */\nexport type ScaffolderTheme = 'mui' | 'bui';\n\nconst ScaffolderThemeContext = createContext<ScaffolderTheme>('mui');\n\n/** @alpha */\nexport const ScaffolderThemeProvider = ScaffolderThemeContext.Provider;\n\n/** @alpha */\nexport const useScaffolderTheme = (): ScaffolderTheme =>\n useContext(ScaffolderThemeContext);\n"],"names":[],"mappings":";;AAoBA,MAAM,sBAAA,GAAyB,cAA+B,KAAK,CAAA;AAG5D,MAAM,0BAA0B,sBAAA,CAAuB;AAGvD,MAAM,kBAAA,GAAqB,MAChC,UAAA,CAAW,sBAAsB
|
|
1
|
+
{"version":3,"file":"ScaffolderThemeContext.esm.js","sources":["../../../../src/next/components/Form/ScaffolderThemeContext.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 { createContext, useContext } from 'react';\n\n/** @alpha */\nexport type ScaffolderTheme = 'mui' | 'bui';\n\nconst ScaffolderThemeContext = createContext<ScaffolderTheme>('mui');\n\n/** @alpha */\nexport const ScaffolderThemeProvider = ScaffolderThemeContext.Provider;\n\n/** @alpha */\nexport const useScaffolderTheme = (): ScaffolderTheme =>\n useContext(ScaffolderThemeContext);\n"],"names":[],"mappings":";;AAoBA,MAAM,sBAAA,GAAyB,cAA+B,KAAK,CAAA;AAG5D,MAAM,0BAA0B,sBAAA,CAAuB;AAGvD,MAAM,kBAAA,GAAqB,MAChC,UAAA,CAAW,sBAAsB;;"}
|
|
@@ -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';\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":";;;;;;;AAwBO,MAAM,cAAA,GAAiB,CAC5B,KAAA,KACG;AACH,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAE7D,EAAA,MAAM;AAAA,IACJ,KAAA;AAAA,IACA,QAAA;AAAA,IACA,MAAA,EAAQ,EAAE,KAAA;AAAM,GAClB,GAAI,KAAA;AAEJ,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,EAAA,EAAI,KAAA;AAAA,QACJ,KAAA,EAAO,KAAA;AAAA,QACP,kBAAA,EAAkB,KAAA;AAAA,QAClB,UAAU,CAAA,CAAA,KAAK;AACb,UAAA,QAAA,CAAS,CAAA,CAAE,OAAO,KAAK,CAAA;AAAA,QACzB,CAAA;AAAA,QACA,KAAA;AAAA,QACA,YAAA,EAAa;AAAA;AAAA,KACf;AAAA,oBACA,GAAA,CAAC,cAAA,EAAA,EAAe,KAAA,EAAK,IAAA,EACnB,QAAA,kBAAA,GAAA,CAAC,mBAAgB,OAAA,EAAS,CAAA,CAAE,wBAAwB,CAAA,EAAG,CAAA,EACzD;AAAA,GAAA,EACF,CAAA;AAEJ
|
|
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":";;;;;;;AAwBO,MAAM,cAAA,GAAiB,CAC5B,KAAA,KACG;AACH,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAE7D,EAAA,MAAM;AAAA,IACJ,KAAA;AAAA,IACA,QAAA;AAAA,IACA,MAAA,EAAQ,EAAE,KAAA;AAAM,GAClB,GAAI,KAAA;AAEJ,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,EAAA,EAAI,KAAA;AAAA,QACJ,KAAA,EAAO,KAAA;AAAA,QACP,kBAAA,EAAkB,KAAA;AAAA,QAClB,UAAU,CAAA,CAAA,KAAK;AACb,UAAA,QAAA,CAAS,CAAA,CAAE,OAAO,KAAK,CAAA;AAAA,QACzB,CAAA;AAAA,QACA,KAAA;AAAA,QACA,YAAA,EAAa;AAAA;AAAA,KACf;AAAA,oBACA,GAAA,CAAC,cAAA,EAAA,EAAe,KAAA,EAAK,IAAA,EACnB,QAAA,kBAAA,GAAA,CAAC,mBAAgB,OAAA,EAAS,CAAA,CAAE,wBAAwB,CAAA,EAAG,CAAA,EACzD;AAAA,GAAA,EACF,CAAA;AAEJ;;"}
|
|
@@ -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 { 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 formatKey(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']?.toLowerCase() === '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 : [[formatKey(key), value]];\n })\n .filter(prop => prop.length > 0),\n );\n return (\n <StructuredMetadataTable\n metadata={reviewData}\n options={{ titleFormat: key => key }}\n />\n );\n};\n"],"names":["JSONSchema"],"mappings":";;;;;AA8BA,SAAS,aAAA,CACP,GAAA,EACA,KAAA,EACA,MAAA,EACA,SAAA,EACmC;AACnC,EAAA,MAAM,YAAA,GAAe,IAAIA,OAAA,CAAW,MAAA,CAAO,YAAY,CAAA;AACvD,EAAA,MAAM,kBAAA,GAAqB,aAAa,SAAA,CAAU;AAAA,IAChD,OAAA,EAAS,KAAK,GAAG,CAAA,CAAA;AAAA,IACjB,IAAA,EAAM;AAAA,GACP,CAAA;AAED,EAAA,MAAM,IAAA,GACJ,qBAAqB,cAAc,CAAA,EAAG,QAAQ,IAAA,IAC9C,kBAAA,EAAoB,KAAA,IACpB,SAAA,CAAU,GAAG,CAAA;AAEf,EAAA,IAAI,kBAAA,EAAoB;AACtB,IAAA,MAAM,sBAAA,GAAyB,kBAAA,CAAmB,cAAc,CAAA,EAAG,MAAA;AACnE,IAAA,IAAI,sBAAA,EAAwB;AAC1B,MAAA,IAAI,uBAAuB,IAAA,EAAM;AAC/B,QAAA,OAAO,CAAC,CAAC,IAAA,EAAM,sBAAA,CAAuB,IAAI,CAAC,CAAA;AAAA,MAC7C;AACA,MAAA,IAAI,sBAAA,CAAuB,SAAS,KAAA,EAAO;AACzC,QA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,QAAQ,KAAA,CAAM,SAAS,CAAA,GACjD,CAAC,CAAC,SAAA,CAAU,GAAG,CAAA,EAAG,KAAK,CAAC,CAAA;AAAA,IAC9B,CAAC,CAAA,CACA,MAAA,CAAO,CAAA,IAAA,KAAQ,IAAA,CAAK,SAAS,CAAC;AAAA,GACnC;AACA,EAAA,uBACE,GAAA;AAAA,IAAC,uBAAA;AAAA,IAAA;AAAA,MACC,QAAA,EAAU,UAAA;AAAA,MACV,OAAA,EAAS,EAAE,WAAA,EAAa,CAAA,GAAA,KAAO,GAAA;AAAI;AAAA,GACrC;AAEJ
|
|
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 formatKey(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']?.toLowerCase() === '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 : [[formatKey(key), value]];\n })\n .filter(prop => prop.length > 0),\n );\n return (\n <StructuredMetadataTable\n metadata={reviewData}\n options={{ titleFormat: key => key }}\n />\n );\n};\n"],"names":["JSONSchema"],"mappings":";;;;;AA8BA,SAAS,aAAA,CACP,GAAA,EACA,KAAA,EACA,MAAA,EACA,SAAA,EACmC;AACnC,EAAA,MAAM,YAAA,GAAe,IAAIA,OAAA,CAAW,MAAA,CAAO,YAAY,CAAA;AACvD,EAAA,MAAM,kBAAA,GAAqB,aAAa,SAAA,CAAU;AAAA,IAChD,OAAA,EAAS,KAAK,GAAG,CAAA,CAAA;AAAA,IACjB,IAAA,EAAM;AAAA,GACP,CAAA;AAED,EAAA,MAAM,IAAA,GACJ,qBAAqB,cAAc,CAAA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AAC,IAAA,EAAM,KAAK,CAAC,CAAA;AACvB;AAMO,MAAM,WAAA,GAAc,CAAC,KAAA,KAA4B;AACtD,EAAA,MAAM,aAAa,MAAA,CAAO,WAAA;AAAA,IACxB,MAAA,CAAO,OAAA,CAAQ,KAAA,CAAM,SAAS,CAAA,CAC3B,QAAQ,CAAC,CAAC,GAAA,EAAK,KAAK,CAAA,KAAM;AACzB,MAAA,MAAM,SAAS,gBAAA,CAAiB,GAAA,EAAK,KAAA,CAAM,OAAA,EAAS,MAAM,SAAS,CAAA;AACnE,MAAA,OAAO,MAAA,GACH,aAAA,CAAc,GAAA,EAAK,KAAA,EAAO,QAAQ,KAAA,CAAM,SAAS,CAAA,GACjD,CAAC,CAAC,SAAA,CAAU,GAAG,CAAA,EAAG,KAAK,CAAC,CAAA;AAAA,IAC9B,CAAC,CAAA,CACA,MAAA,CAAO,CAAA,IAAA,KAAQ,IAAA,CAAK,SAAS,CAAC;AAAA,GACnC;AACA,EAAA,uBACE,GAAA;AAAA,IAAC,uBAAA;AAAA,IAAA;AAAA,MACC,QAAA,EAAU,UAAA;AAAA,MACV,OAAA,EAAS,EAAE,WAAA,EAAa,CAAA,GAAA,KAAO,GAAA;AAAI;AAAA,GACrC;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.esm.js","sources":["../../../../src/next/components/ReviewState/util.ts"],"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 { JsonObject, JsonValue } from '@backstage/types';\nimport { startCase } from 'lodash';\nimport { ParsedTemplateSchema } from '../../hooks/useTemplateSchema';\nimport { Draft07 as JSONSchema } from 'json-schema-library';\n\nexport function isJsonObject(value?: JsonValue): value is JsonObject {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n// Helper function to format a key into a human-readable string\nexport function formatKey(key: string): string {\n const parts = key.split('/');\n return parts\n .filter(Boolean)\n .map(part => startCase(part))\n .join(' > ');\n}\n\nexport function findSchemaForKey(\n key: string,\n schemas: ParsedTemplateSchema[],\n formState: Partial<{ [key: string]: JsonValue }>,\n): ParsedTemplateSchema | null {\n for (const step of schemas) {\n /*\n To determine if a key is defined in a schema we need to call getSchema\n with an empty form state. Otherwise, it will never return undefined as it\n will fallback to a default schema based on the form state. \n\n An exception to this is when your schema is dynamic i.e. using dependencies \n because the form state is required for generating the schema. In this case,\n we add only the dependencies data to the getSchema call.\n */\n\n const schema = step.mergedSchema;\n\n // Declare data to be a subset of formState\n const data: typeof formState = {};\n\n if (schema.dependencies && isJsonObject(schema.dependencies)) {\n for (const dep in schema.dependencies) {\n if (formState.hasOwnProperty(dep)) {\n data[dep] = formState[dep]; // Add each dependency key from formState\n }\n }\n }\n\n const draft = new JSONSchema(schema);\n const res = draft.getSchema({\n pointer: `#/${key}`,\n data,\n });\n\n if (!!res) {\n return step;\n }\n }\n\n return null; // Return null if the key isn't found in any schema\n}\n"],"names":["JSONSchema"],"mappings":";;;AAqBO,SAAS,aAAa,KAAA,EAAwC;AACnE,EAAA,OAAO,OAAO,UAAU,QAAA,IAAY,KAAA,KAAU,QAAQ,CAAC,KAAA,CAAM,QAAQ,KAAK,CAAA;AAC5E;AAGO,SAAS,UAAU,GAAA,EAAqB;AAC7C,EAAA,MAAM,KAAA,GAAQ,GAAA,CAAI,KAAA,CAAM,GAAG,CAAA;AAC3B,EAAA,OAAO,KAAA,CACJ,MAAA,CAAO,OAAO,CAAA,CACd,GAAA,CAAI,CAAA,IAAA,KAAQ,SAAA,CAAU,IAAI,CAAC,CAAA,CAC3B,IAAA,CAAK,KAAK,CAAA;AACf;AAEO,SAAS,gBAAA,CACd,GAAA,EACA,OAAA,EACA,SAAA,EAC6B;AAC7B,EAAA,KAAA,MAAW,QAAQ,OAAA,EAAS;AAW1B,IAAA,MAAM,SAAS,IAAA,CAAK,YAAA;AAGpB,IAAA,MAAM,OAAyB,EAAC;AAEhC,IAAA,IAAI,MAAA,CAAO,YAAA,IAAgB,YAAA,CAAa,MAAA,CAAO,YAAY,CAAA,EAAG;AAC5D,MAAA,KAAA,MAAW,GAAA,IAAO,OAAO,YAAA,EAAc;AACrC,QAAA,IAAI,SAAA,CAAU,cAAA,CAAe,GAAG,CAAA,EAAG;AACjC,UAAA,IAAA,CAAK,GAAG,CAAA,GAAI,SAAA,CAAU,GAAG,CAAA;AAAA,QAC3B;AAAA,MACF;AAAA,IACF;AAEA,IAAA,MAAM,KAAA,GAAQ,IAAIA,OAAA,CAAW,MAAM,CAAA;AACnC,IAAA,MAAM,GAAA,GAAM,MAAM,SAAA,CAAU;AAAA,MAC1B,OAAA,EAAS,KAAK,GAAG,CAAA,CAAA;AAAA,MACjB;AAAA,KACD,CAAA;AAED,IAAA,IAAI,CAAC,CAAC,GAAA,EAAK;AACT,MAAA,OAAO,IAAA;AAAA,IACT;AAAA,EACF;AAEA,EAAA,OAAO,IAAA;AACT
|
|
1
|
+
{"version":3,"file":"util.esm.js","sources":["../../../../src/next/components/ReviewState/util.ts"],"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 { JsonObject, JsonValue } from '@backstage/types';\nimport { startCase } from 'lodash';\nimport { ParsedTemplateSchema } from '../../hooks/useTemplateSchema';\nimport { Draft07 as JSONSchema } from 'json-schema-library';\n\nexport function isJsonObject(value?: JsonValue): value is JsonObject {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n// Helper function to format a key into a human-readable string\nexport function formatKey(key: string): string {\n const parts = key.split('/');\n return parts\n .filter(Boolean)\n .map(part => startCase(part))\n .join(' > ');\n}\n\nexport function findSchemaForKey(\n key: string,\n schemas: ParsedTemplateSchema[],\n formState: Partial<{ [key: string]: JsonValue }>,\n): ParsedTemplateSchema | null {\n for (const step of schemas) {\n /*\n To determine if a key is defined in a schema we need to call getSchema\n with an empty form state. Otherwise, it will never return undefined as it\n will fallback to a default schema based on the form state. \n\n An exception to this is when your schema is dynamic i.e. using dependencies \n because the form state is required for generating the schema. In this case,\n we add only the dependencies data to the getSchema call.\n */\n\n const schema = step.mergedSchema;\n\n // Declare data to be a subset of formState\n const data: typeof formState = {};\n\n if (schema.dependencies && isJsonObject(schema.dependencies)) {\n for (const dep in schema.dependencies) {\n if (formState.hasOwnProperty(dep)) {\n data[dep] = formState[dep]; // Add each dependency key from formState\n }\n }\n }\n\n const draft = new JSONSchema(schema);\n const res = draft.getSchema({\n pointer: `#/${key}`,\n data,\n });\n\n if (!!res) {\n return step;\n }\n }\n\n return null; // Return null if the key isn't found in any schema\n}\n"],"names":["JSONSchema"],"mappings":";;;AAqBO,SAAS,aAAa,KAAA,EAAwC;AACnE,EAAA,OAAO,OAAO,UAAU,QAAA,IAAY,KAAA,KAAU,QAAQ,CAAC,KAAA,CAAM,QAAQ,KAAK,CAAA;AAC5E;AAGO,SAAS,UAAU,GAAA,EAAqB;AAC7C,EAAA,MAAM,KAAA,GAAQ,GAAA,CAAI,KAAA,CAAM,GAAG,CAAA;AAC3B,EAAA,OAAO,KAAA,CACJ,MAAA,CAAO,OAAO,CAAA,CACd,GAAA,CAAI,CAAA,IAAA,KAAQ,SAAA,CAAU,IAAI,CAAC,CAAA,CAC3B,IAAA,CAAK,KAAK,CAAA;AACf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