├── .devcontainer ├── Dockerfile └── devcontainer.json ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── config.yml │ └── feature_request.yml ├── config │ └── changelog.json └── workflows │ ├── ci.yaml │ └── publish.yaml ├── .gitignore ├── .npmignore ├── .npmrc ├── .nvmrc ├── .prettierrc.js ├── .vscode ├── extensions.json └── settings.json ├── CONTRIBUTING.md ├── LICENSE ├── MIGRATION.md ├── README.md ├── ROADMAP.md ├── add-file-headers.sh ├── lerna.json ├── package.json ├── packages ├── angular-material │ ├── .eslintrc.js │ ├── .prettierrc.js │ ├── LICENSE │ ├── README.md │ ├── angular.json │ ├── example │ │ ├── app │ │ │ ├── app.component.ts │ │ │ └── app.module.ts │ │ ├── index.html │ │ └── main.ts │ ├── karma.conf.js │ ├── ng-package.json │ ├── package.json │ ├── src │ │ ├── index.ts │ │ ├── library │ │ │ ├── controls │ │ │ │ ├── autocomplete.renderer.ts │ │ │ │ ├── boolean.renderer.ts │ │ │ │ ├── date.renderer.ts │ │ │ │ ├── index.ts │ │ │ │ ├── number.renderer.ts │ │ │ │ ├── range.renderer.ts │ │ │ │ ├── text.renderer.ts │ │ │ │ ├── textarea.renderer.ts │ │ │ │ └── toggle.renderer.ts │ │ │ ├── index.ts │ │ │ ├── layouts │ │ │ │ ├── array-layout.renderer.ts │ │ │ │ ├── categorization-layout.renderer.ts │ │ │ │ ├── group-layout.renderer.ts │ │ │ │ ├── horizontal-layout.renderer.ts │ │ │ │ ├── index.ts │ │ │ │ ├── layout.renderer.ts │ │ │ │ └── vertical-layout.renderer.ts │ │ │ ├── module.ts │ │ │ ├── other │ │ │ │ ├── index.ts │ │ │ │ ├── label.renderer.ts │ │ │ │ ├── master-detail │ │ │ │ │ ├── detail.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── master.ts │ │ │ │ ├── object.renderer.ts │ │ │ │ ├── table.renderer.ts │ │ │ │ └── util.ts │ │ │ └── util │ │ │ │ ├── date-format.ts │ │ │ │ └── dayjs-date-adapter.ts │ │ └── public_api.ts │ ├── test │ │ ├── autocomplete-control.spec.ts │ │ ├── boolean-control.spec.ts │ │ ├── categorization-tab-layout.spec.ts │ │ ├── common │ │ │ ├── boolean.ts │ │ │ ├── index.ts │ │ │ ├── layout.ts │ │ │ ├── number.ts │ │ │ ├── range.ts │ │ │ ├── text.ts │ │ │ └── util.ts │ │ ├── date-control.spec.ts │ │ ├── group-layout.spec.ts │ │ ├── horizontal-layout.spec.ts │ │ ├── label-renderer.spec.ts │ │ ├── master-detail.spec.ts │ │ ├── middleware.spec.ts │ │ ├── number-control.spec.ts │ │ ├── object-control.spec.ts │ │ ├── range-control.spec.ts │ │ ├── table-control.spec.ts │ │ ├── test.ts │ │ ├── text-area.spec.ts │ │ ├── text-control.spec.ts │ │ ├── toggle-control.spec.ts │ │ ├── util.ts │ │ └── vertical-layout.spec.ts │ ├── tsconfig.example.json │ ├── tsconfig.json │ └── tsconfig.spec.json ├── angular │ ├── .eslintrc.js │ ├── .prettierrc.js │ ├── LICENSE │ ├── README.md │ ├── build-package.js │ ├── ng-package.json │ ├── package.json │ ├── src │ │ ├── index.ts │ │ ├── library │ │ │ ├── abstract-control.ts │ │ │ ├── array-control.ts │ │ │ ├── base.renderer.ts │ │ │ ├── control.ts │ │ │ ├── index.ts │ │ │ ├── jsonforms-root.component.ts │ │ │ ├── jsonforms.component.ts │ │ │ ├── jsonforms.module.ts │ │ │ ├── jsonforms.service.ts │ │ │ └── unknown.component.ts │ │ └── public_api.ts │ ├── test-config │ │ └── ts-node.config.js │ ├── test │ │ ├── dummy.test.ts │ │ └── tsconfig.test.json │ ├── tsconfig.cjs.json │ └── tsconfig.json ├── core │ ├── .eslintrc.js │ ├── .nycrc │ ├── .prettierrc.js │ ├── LICENSE │ ├── README.md │ ├── package.json │ ├── rollup.config.js │ ├── src │ │ ├── actions │ │ │ ├── actions.ts │ │ │ └── index.ts │ │ ├── configDefault.ts │ │ ├── generators │ │ │ ├── Generate.ts │ │ │ ├── index.ts │ │ │ ├── schema.ts │ │ │ └── uischema.ts │ │ ├── i18n │ │ │ ├── arrayTranslations.ts │ │ │ ├── combinatorTranslations.ts │ │ │ ├── i18nUtil.ts │ │ │ ├── index.ts │ │ │ └── selectors.ts │ │ ├── index.ts │ │ ├── mappers │ │ │ ├── cell.ts │ │ │ ├── combinators.ts │ │ │ ├── index.ts │ │ │ ├── renderer.ts │ │ │ └── util.ts │ │ ├── models │ │ │ ├── draft4.ts │ │ │ ├── index.ts │ │ │ ├── jsonSchema.ts │ │ │ ├── jsonSchema4.ts │ │ │ ├── jsonSchema7.ts │ │ │ └── uischema.ts │ │ ├── reducers │ │ │ ├── cells.ts │ │ │ ├── config.ts │ │ │ ├── core.ts │ │ │ ├── default-data.ts │ │ │ ├── i18n.ts │ │ │ ├── index.ts │ │ │ ├── middleware.ts │ │ │ ├── reducers.ts │ │ │ ├── renderers.ts │ │ │ └── uischemas.ts │ │ ├── store │ │ │ ├── i18nTypes.ts │ │ │ ├── index.ts │ │ │ ├── jsonFormsCore.ts │ │ │ ├── store.ts │ │ │ └── type.ts │ │ ├── testers │ │ │ ├── index.ts │ │ │ └── testers.ts │ │ └── util │ │ │ ├── Formatted.ts │ │ │ ├── defaultDateFormat.ts │ │ │ ├── errors.ts │ │ │ ├── helpers.ts │ │ │ ├── ids.ts │ │ │ ├── index.ts │ │ │ ├── label.ts │ │ │ ├── path.ts │ │ │ ├── resolvers.ts │ │ │ ├── runtime.ts │ │ │ ├── schema.ts │ │ │ ├── uischema.ts │ │ │ ├── util.ts │ │ │ └── validator.ts │ ├── test-config │ │ └── ts-node.config.js │ ├── test │ │ ├── actions │ │ │ └── actions.test.ts │ │ ├── generators │ │ │ ├── schema.test.ts │ │ │ └── uischema.test.ts │ │ ├── i18n │ │ │ └── i18nUtil.test.ts │ │ ├── mappers │ │ │ ├── array.test.ts │ │ │ ├── cell.test.ts │ │ │ ├── combinators.test.ts │ │ │ └── renderer.test.ts │ │ ├── reducers │ │ │ ├── core.test.ts │ │ │ └── uischemas.test.ts │ │ ├── testers.test.ts │ │ └── util │ │ │ ├── derivetype.test.ts │ │ │ ├── label.test.ts │ │ │ ├── path.test.ts │ │ │ ├── resolvers.test.ts │ │ │ └── runtime.test.ts │ └── tsconfig.json ├── examples-app │ ├── README.md │ ├── index.html │ ├── package.json │ └── prepare-examples-app.js ├── examples-react │ ├── .eslintrc.js │ ├── .prettierrc.js │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ └── manifest.json │ └── src │ │ ├── App.css │ │ ├── App.tsx │ │ ├── index.tsx │ │ └── logo.svg ├── examples │ ├── .eslintrc.js │ ├── .prettierrc.js │ ├── README.md │ ├── icons │ │ ├── drive.png │ │ ├── folder.png │ │ └── page.png │ ├── package.json │ ├── rollup.config.js │ ├── src │ │ ├── example.ts │ │ ├── examples │ │ │ ├── 1884.ts │ │ │ ├── 1948.ts │ │ │ ├── additional-errors.ts │ │ │ ├── additional-properties.ts │ │ │ ├── allOf.ts │ │ │ ├── anyOf-oneOf-allOf-resolve.ts │ │ │ ├── anyOf.ts │ │ │ ├── arrays-with-custom-element-label.ts │ │ │ ├── arrays-with-defaults.ts │ │ │ ├── arrays-with-detail-and-rule.ts │ │ │ ├── arrays-with-detail.ts │ │ │ ├── arrays-with-sorting.ts │ │ │ ├── arrays-with-translated-custom-element-label.ts │ │ │ ├── arrays.ts │ │ │ ├── arraysI18n.ts │ │ │ ├── categorization-stepper-nav-buttons.ts │ │ │ ├── categorization-stepper.ts │ │ │ ├── categorization.ts │ │ │ ├── conditional-schema-compositions.ts │ │ │ ├── config.ts │ │ │ ├── control-options.ts │ │ │ ├── dates.ts │ │ │ ├── default.ts │ │ │ ├── enum-multi-with-label-and-desc.ts │ │ │ ├── enum-multi.ts │ │ │ ├── enum.ts │ │ │ ├── enumInArray.ts │ │ │ ├── generate-dynamic.ts │ │ │ ├── generate.ts │ │ │ ├── generateUI.ts │ │ │ ├── huge.ts │ │ │ ├── i18n.ts │ │ │ ├── if_then_else.ts │ │ │ ├── json-editor.ts │ │ │ ├── jsonschema.ts │ │ │ ├── layout.ts │ │ │ ├── list-with-detail-primitives.ts │ │ │ ├── list-with-detail-registered.ts │ │ │ ├── list-with-detail.ts │ │ │ ├── login.ts │ │ │ ├── mixed-object.ts │ │ │ ├── mixed.ts │ │ │ ├── nestedArrays.ts │ │ │ ├── nestedCategorization.ts │ │ │ ├── numbers.ts │ │ │ ├── object.ts │ │ │ ├── onChange.ts │ │ │ ├── oneOf-recursive.ts │ │ │ ├── oneOf.ts │ │ │ ├── oneOfArray.ts │ │ │ ├── person.ts │ │ │ ├── radioGroup.ts │ │ │ ├── readonly.ts │ │ │ ├── rule.ts │ │ │ ├── ruleInheritance.ts │ │ │ ├── scope.ts │ │ │ ├── string.ts │ │ │ ├── stringArray.ts │ │ │ └── text.ts │ │ ├── index.ts │ │ └── register.ts │ └── tsconfig.json ├── material-renderers │ ├── .eslintrc.js │ ├── .prettierrc.js │ ├── LICENSE │ ├── README.md │ ├── example │ │ ├── index.bundled.html │ │ ├── index.html │ │ └── index.tsx │ ├── package.json │ ├── rollup.config.js │ ├── rollup.example.config.js │ ├── src │ │ ├── additional │ │ │ ├── ListWithDetailMasterItem.tsx │ │ │ ├── MaterialLabelRenderer.tsx │ │ │ ├── MaterialListWithDetailRenderer.tsx │ │ │ ├── index.ts │ │ │ └── unwrapped.ts │ │ ├── cells │ │ │ ├── CustomizableCells.ts │ │ │ ├── MaterialBooleanCell.tsx │ │ │ ├── MaterialBooleanToggleCell.tsx │ │ │ ├── MaterialDateCell.tsx │ │ │ ├── MaterialEnumCell.tsx │ │ │ ├── MaterialIntegerCell.tsx │ │ │ ├── MaterialNumberCell.tsx │ │ │ ├── MaterialNumberFormatCell.tsx │ │ │ ├── MaterialOneOfEnumCell.tsx │ │ │ ├── MaterialTextCell.tsx │ │ │ ├── MaterialTimeCell.tsx │ │ │ └── index.ts │ │ ├── complex │ │ │ ├── CombinatorProperties.tsx │ │ │ ├── DeleteDialog.tsx │ │ │ ├── MaterialAllOfRenderer.tsx │ │ │ ├── MaterialAnyOfRenderer.tsx │ │ │ ├── MaterialArrayControlRenderer.tsx │ │ │ ├── MaterialEnumArrayRenderer.tsx │ │ │ ├── MaterialObjectRenderer.tsx │ │ │ ├── MaterialOneOfRenderer.tsx │ │ │ ├── MaterialTableControl.tsx │ │ │ ├── NoBorderTableCell.tsx │ │ │ ├── TabSwitchConfirmDialog.tsx │ │ │ ├── TableToolbar.tsx │ │ │ ├── ValidationIcon.tsx │ │ │ ├── index.ts │ │ │ └── unwrapped.ts │ │ ├── controls │ │ │ ├── MaterialAnyOfStringOrEnumControl.tsx │ │ │ ├── MaterialBooleanControl.tsx │ │ │ ├── MaterialBooleanToggleControl.tsx │ │ │ ├── MaterialDateControl.tsx │ │ │ ├── MaterialDateTimeControl.tsx │ │ │ ├── MaterialEnumControl.tsx │ │ │ ├── MaterialInputControl.tsx │ │ │ ├── MaterialIntegerControl.tsx │ │ │ ├── MaterialNativeControl.tsx │ │ │ ├── MaterialNumberControl.tsx │ │ │ ├── MaterialOneOfEnumControl.tsx │ │ │ ├── MaterialOneOfRadioGroupControl.tsx │ │ │ ├── MaterialRadioGroup.tsx │ │ │ ├── MaterialRadioGroupControl.tsx │ │ │ ├── MaterialSliderControl.tsx │ │ │ ├── MaterialTextControl.tsx │ │ │ ├── MaterialTimeControl.tsx │ │ │ ├── index.ts │ │ │ └── unwrapped.ts │ │ ├── index.ts │ │ ├── layouts │ │ │ ├── ArrayToolbar.tsx │ │ │ ├── ExpandPanelRenderer.tsx │ │ │ ├── MaterialArrayLayout.tsx │ │ │ ├── MaterialArrayLayoutRenderer.tsx │ │ │ ├── MaterialCategorizationLayout.tsx │ │ │ ├── MaterialCategorizationStepperLayout.tsx │ │ │ ├── MaterialGroupLayout.tsx │ │ │ ├── MaterialHorizontalLayout.tsx │ │ │ ├── MaterialVerticalLayout.tsx │ │ │ ├── index.ts │ │ │ └── unwrapped.ts │ │ ├── mui-controls │ │ │ ├── MuiAutocomplete.tsx │ │ │ ├── MuiCheckbox.tsx │ │ │ ├── MuiInputInteger.tsx │ │ │ ├── MuiInputNumber.tsx │ │ │ ├── MuiInputNumberFormat.tsx │ │ │ ├── MuiInputText.tsx │ │ │ ├── MuiInputTime.tsx │ │ │ ├── MuiSelect.tsx │ │ │ ├── MuiToggle.tsx │ │ │ └── index.ts │ │ └── util │ │ │ ├── datejs.tsx │ │ │ ├── debounce.ts │ │ │ ├── focus.ts │ │ │ ├── i18nDefaults.ts │ │ │ ├── index.ts │ │ │ ├── layout.tsx │ │ │ └── theme.ts │ ├── test │ │ ├── datejs.test.ts │ │ └── renderers │ │ │ ├── MaterialAllOfRenderer.test.tsx │ │ │ ├── MaterialAnyOfRenderer.test.tsx │ │ │ ├── MaterialAnyOfStringOrEnumControl.test.tsx │ │ │ ├── MaterialArrayControl.test.tsx │ │ │ ├── MaterialArrayLayout.test.tsx │ │ │ ├── MaterialBooleanCell.test.tsx │ │ │ ├── MaterialBooleanToggleCell.test.tsx │ │ │ ├── MaterialBooleanToggleControl.test.tsx │ │ │ ├── MaterialCategorizationLayout.test.tsx │ │ │ ├── MaterialCategorizationStepperLayout.test.tsx │ │ │ ├── MaterialDateCell.test.tsx │ │ │ ├── MaterialDateControl.test.tsx │ │ │ ├── MaterialDateTimeControl.test.tsx │ │ │ ├── MaterialEnumArrayRenderer.test.tsx │ │ │ ├── MaterialEnumCell.test.tsx │ │ │ ├── MaterialEnumControl.test.tsx │ │ │ ├── MaterialGroupLayout.test.tsx │ │ │ ├── MaterialInputControl.test.tsx │ │ │ ├── MaterialIntegerCell.test.tsx │ │ │ ├── MaterialLabelRenderer.test.tsx │ │ │ ├── MaterialLayouts.test.tsx │ │ │ ├── MaterialListWithDetailRenderer.test.tsx │ │ │ ├── MaterialNativeControl.test.tsx │ │ │ ├── MaterialNumberCell.test.tsx │ │ │ ├── MaterialObjectControl.test.tsx │ │ │ ├── MaterialOneOfEnumCell.test.tsx │ │ │ ├── MaterialOneOfRadioGroupControl.test.tsx │ │ │ ├── MaterialOneOfRenderer.test.tsx │ │ │ ├── MaterialRadioGroupControl.test.tsx │ │ │ ├── MaterialSliderControl.test.tsx │ │ │ ├── MaterialTableControl.test.tsx │ │ │ ├── MaterialTextCell.test.tsx │ │ │ ├── MaterialTextControl.test.tsx │ │ │ ├── MaterialTimeCell.test.tsx │ │ │ ├── MaterialTimeControl.test.tsx │ │ │ ├── tooltipChecker.tsx │ │ │ └── util.ts │ ├── tsconfig.json │ ├── tsconfig.test.json │ └── webpack │ │ └── webpack.dev.js ├── react │ ├── .eslintrc.js │ ├── .prettierrc.js │ ├── LICENSE │ ├── README.md │ ├── __mocks__ │ │ └── react.js │ ├── package.json │ ├── rollup.config.js │ ├── src │ │ ├── Control.ts │ │ ├── DispatchCell.tsx │ │ ├── JsonForms.tsx │ │ ├── JsonFormsContext.tsx │ │ ├── Renderer.tsx │ │ ├── UnknownRenderer.tsx │ │ ├── index.ts │ │ └── redux │ │ │ ├── JsonFormsReduxContext.tsx │ │ │ └── index.ts │ ├── test │ │ ├── JsonFormsContext.test.tsx │ │ └── renderers │ │ │ └── JsonForms.test.tsx │ ├── tsconfig.json │ ├── tsconfig.redux.json │ └── tsconfig.test.json ├── vanilla-renderers │ ├── .eslintrc.js │ ├── .nycrc │ ├── .prettierrc.js │ ├── LICENSE │ ├── README.md │ ├── Styles.md │ ├── example │ │ ├── example.css │ │ ├── example.dark.css │ │ ├── index.bundled.html │ │ ├── index.html │ │ ├── index.tsx │ │ └── theme.switcher.ts │ ├── package.json │ ├── rollup.config.js │ ├── rollup.example.config.js │ ├── src │ │ ├── actions │ │ │ └── index.ts │ │ ├── cells │ │ │ ├── BooleanCell.tsx │ │ │ ├── CustomizableCells.ts │ │ │ ├── DateCell.tsx │ │ │ ├── DateTimeCell.tsx │ │ │ ├── EnumCell.tsx │ │ │ ├── IntegerCell.tsx │ │ │ ├── NumberCell.tsx │ │ │ ├── NumberFormatCell.tsx │ │ │ ├── OneOfEnumCell.tsx │ │ │ ├── SliderCell.tsx │ │ │ ├── TextAreaCell.tsx │ │ │ ├── TextCell.tsx │ │ │ ├── TimeCell.tsx │ │ │ └── index.ts │ │ ├── complex │ │ │ ├── LabelRenderer.tsx │ │ │ ├── TableArrayControl.tsx │ │ │ ├── array │ │ │ │ ├── ArrayControlRenderer.tsx │ │ │ │ └── index.ts │ │ │ ├── categorization │ │ │ │ ├── CategorizationList.tsx │ │ │ │ ├── CategorizationRenderer.tsx │ │ │ │ ├── SingleCategory.tsx │ │ │ │ ├── index.ts │ │ │ │ └── tester.ts │ │ │ └── index.ts │ │ ├── controls │ │ │ ├── InputControl.tsx │ │ │ ├── OneOfRadioGroupControl.tsx │ │ │ ├── RadioGroup.tsx │ │ │ ├── RadioGroupControl.tsx │ │ │ └── index.ts │ │ ├── index.ts │ │ ├── layouts │ │ │ ├── GroupLayout.tsx │ │ │ ├── HorizontalLayout.tsx │ │ │ ├── JsonFormsLayout.tsx │ │ │ ├── VerticalLayout.tsx │ │ │ ├── index.ts │ │ │ └── util.tsx │ │ ├── reducers │ │ │ ├── index.ts │ │ │ └── styling.ts │ │ ├── renderers.ts │ │ ├── styles │ │ │ ├── index.ts │ │ │ ├── styleContext.ts │ │ │ └── styles.ts │ │ └── util │ │ │ ├── i18nDefaults.ts │ │ │ ├── index.ts │ │ │ └── props.tsx │ ├── test │ │ ├── renderers │ │ │ ├── ArrayControl.test.tsx │ │ │ ├── BooleanCell.test.tsx │ │ │ ├── CategorizationRenderer.test.tsx │ │ │ ├── DateCell.test.tsx │ │ │ ├── DateTimeCell.test.tsx │ │ │ ├── EnumCell.test.tsx │ │ │ ├── GroupLayout.test.tsx │ │ │ ├── HorizontalLayout.test.tsx │ │ │ ├── InputControl.test.tsx │ │ │ ├── IntegerCell.test.tsx │ │ │ ├── LabelControl.test.tsx │ │ │ ├── NumberCell.test.tsx │ │ │ ├── OneOfEnumCell.test.tsx │ │ │ ├── RadioGroupControl.test.tsx │ │ │ ├── SliderCell.test.tsx │ │ │ ├── TableArrayControl.test.tsx │ │ │ ├── TextAreaCell.test.tsx │ │ │ ├── TextCell.test.tsx │ │ │ ├── TimeCell.test.tsx │ │ │ └── VerticalLayout.test.tsx │ │ ├── styling.registry.test.ts │ │ └── util.ts │ ├── tsconfig.json │ ├── tsconfig.test.json │ └── webpack │ │ └── webpack.dev.js ├── vue-vanilla │ ├── .eslintrc.js │ ├── .prettierrc.js │ ├── LICENSE │ ├── README.md │ ├── babel.config.js │ ├── config │ │ └── jsonforms.ts │ ├── dev │ │ ├── components │ │ │ └── App.vue │ │ └── serve.ts │ ├── example │ │ └── index.bundled.html │ ├── package.json │ ├── rollup.config.js │ ├── rollup.example.config.js │ ├── shims-vue.d.ts │ ├── src │ │ ├── array │ │ │ ├── ArrayListElement.vue │ │ │ ├── ArrayListRenderer.vue │ │ │ └── index.ts │ │ ├── complex │ │ │ ├── EnumArrayRenderer.vue │ │ │ ├── ObjectRenderer.vue │ │ │ ├── OneOfRenderer.vue │ │ │ ├── components │ │ │ │ └── CombinatorProperties.vue │ │ │ └── index.ts │ │ ├── controls │ │ │ ├── BooleanControlRenderer.vue │ │ │ ├── ControlWrapper.vue │ │ │ ├── DateControlRenderer.vue │ │ │ ├── DateTimeControlRenderer.vue │ │ │ ├── EnumControlRenderer.vue │ │ │ ├── EnumOneOfControlRenderer.vue │ │ │ ├── IntegerControlRenderer.vue │ │ │ ├── MultiStringControlRenderer.vue │ │ │ ├── NumberControlRenderer.vue │ │ │ ├── StringControlRenderer.vue │ │ │ ├── TimeControlRenderer.vue │ │ │ └── index.ts │ │ ├── index.ts │ │ ├── label │ │ │ ├── LabelRenderer.vue │ │ │ └── index.ts │ │ ├── layouts │ │ │ ├── CategorizationRenderer.vue │ │ │ ├── CategorizationStepperRenderer.vue │ │ │ ├── GroupRenderer.vue │ │ │ ├── LayoutRenderer.vue │ │ │ └── index.ts │ │ ├── renderers.ts │ │ ├── styles │ │ │ ├── defaultStyles.ts │ │ │ ├── index.ts │ │ │ ├── styles.ts │ │ │ └── util.ts │ │ └── util │ │ │ ├── composition.ts │ │ │ ├── index.ts │ │ │ └── options.ts │ ├── tests │ │ └── unit │ │ │ ├── array │ │ │ └── ArrayListRenderer.spec.ts │ │ │ ├── complex │ │ │ ├── EnumArrayRenderer.spec.ts │ │ │ ├── ObjectRenderer.spec.ts │ │ │ └── OneOfRenderer.spec.ts │ │ │ ├── controls │ │ │ ├── BooleanControlRenderer.spec.ts │ │ │ ├── DateControlRenderer.spec.ts │ │ │ ├── DateTimeControlRenderer.spec.ts │ │ │ ├── EnumControlRenderer.spec.ts │ │ │ ├── EnumOneOfControlRenderer.spec.ts │ │ │ ├── IntegerControlRenderer.spec.ts │ │ │ ├── MultiStringControlRenderer.spec.ts │ │ │ ├── NumberControlRenderer.spec.ts │ │ │ ├── StringControlRenderer.spec.ts │ │ │ └── TimeControlRenderer.spec.ts │ │ │ ├── form │ │ │ └── JsonForms.spec.ts │ │ │ ├── label │ │ │ └── LabelRenderer.spec.ts │ │ │ ├── layouts │ │ │ ├── CategorizationRenderer.spec.ts │ │ │ ├── CategorizationStepperRenderer.spec.ts │ │ │ ├── GroupRenderer.spec.ts │ │ │ └── LayoutRenderer.spec.ts │ │ │ └── util │ │ │ ├── TestComponent.vue │ │ │ ├── index.ts │ │ │ └── util.ts │ ├── tsconfig.json │ └── vanilla.css ├── vue-vuetify │ ├── .eslintrc.cjs │ ├── .prettierrc.cjs │ ├── LICENSE │ ├── README.md │ ├── dev │ │ ├── App.vue │ │ ├── assets │ │ │ ├── JsonFormsLogo.vue │ │ │ ├── VuetifyLogo.vue │ │ │ ├── logo.png │ │ │ └── logo.svg │ │ ├── components │ │ │ ├── ExampleAppBar.vue │ │ │ ├── ExampleDrawer.vue │ │ │ ├── ExampleForm.vue │ │ │ ├── ExampleSettings.vue │ │ │ ├── MonacoEditor.vue │ │ │ └── ThemeChanger.vue │ │ ├── core │ │ │ ├── jsonSchemaValidation.ts │ │ │ ├── jsonschema │ │ │ │ ├── index.ts │ │ │ │ └── specification │ │ │ │ │ ├── rule.json │ │ │ │ │ ├── schema.json │ │ │ │ │ └── uischema.json │ │ │ └── monaco.ts │ │ ├── env.d.ts │ │ ├── examples │ │ │ └── index.ts │ │ ├── icons │ │ │ ├── fa.ts │ │ │ ├── icons.ts │ │ │ └── mdi.ts │ │ ├── main.ts │ │ ├── plugins │ │ │ └── vuetify.ts │ │ ├── store │ │ │ └── index.ts │ │ ├── validate │ │ │ ├── dynamicDefaults.ts │ │ │ ├── index.ts │ │ │ ├── keywords.ts │ │ │ └── transform.ts │ │ └── views │ │ │ ├── ExampleView.vue │ │ │ └── HomeView.vue │ ├── index.html │ ├── package.json │ ├── src │ │ ├── additional │ │ │ ├── LabelRenderer.entry.ts │ │ │ ├── LabelRenderer.vue │ │ │ ├── ListWithDetailRenderer.entry.ts │ │ │ ├── ListWithDetailRenderer.vue │ │ │ └── index.ts │ │ ├── array │ │ │ └── index.ts │ │ ├── complex │ │ │ ├── AllOfRenderer.entry.ts │ │ │ ├── AllOfRenderer.vue │ │ │ ├── AnyOfRenderer.entry.ts │ │ │ ├── AnyOfRenderer.vue │ │ │ ├── ArrayControlRenderer.entry.ts │ │ │ ├── ArrayControlRenderer.vue │ │ │ ├── EnumArrayRenderer.entry.ts │ │ │ ├── EnumArrayRenderer.vue │ │ │ ├── MixedRenderer.entry.ts │ │ │ ├── MixedRenderer.vue │ │ │ ├── ObjectRenderer.entry.ts │ │ │ ├── ObjectRenderer.vue │ │ │ ├── OneOfRenderer.entry.ts │ │ │ ├── OneOfRenderer.vue │ │ │ ├── OneOfTabRenderer.entry.ts │ │ │ ├── OneOfTabRenderer.vue │ │ │ ├── components │ │ │ │ ├── AdditionalProperties.vue │ │ │ │ ├── CombinatorProperties.vue │ │ │ │ └── index.ts │ │ │ └── index.ts │ │ ├── controls │ │ │ ├── AnyOfStringOrEnumControlRenderer.entry.ts │ │ │ ├── AnyOfStringOrEnumControlRenderer.vue │ │ │ ├── BooleanControlRenderer.entry.ts │ │ │ ├── BooleanControlRenderer.vue │ │ │ ├── BooleanToggleControlRenderer.entry.ts │ │ │ ├── BooleanToggleControlRenderer.vue │ │ │ ├── ControlWrapper.vue │ │ │ ├── DateControlRenderer.entry.ts │ │ │ ├── DateControlRenderer.vue │ │ │ ├── DateTimeControlRenderer.entry.ts │ │ │ ├── DateTimeControlRenderer.vue │ │ │ ├── EnumControlRenderer.entry.ts │ │ │ ├── EnumControlRenderer.vue │ │ │ ├── IntegerControlRenderer.entry.ts │ │ │ ├── IntegerControlRenderer.vue │ │ │ ├── MultiStringControlRenderer.entry.ts │ │ │ ├── MultiStringControlRenderer.vue │ │ │ ├── NumberControlRenderer.entry.ts │ │ │ ├── NumberControlRenderer.vue │ │ │ ├── OneOfEnumControlRenderer.entry.ts │ │ │ ├── OneOfEnumControlRenderer.vue │ │ │ ├── OneOfRadioGroupControlRenderer.entry.ts │ │ │ ├── OneOfRadioGroupControlRenderer.vue │ │ │ ├── PasswordControlRenderer.entry.ts │ │ │ ├── PasswordControlRenderer.vue │ │ │ ├── RadioGroupControlRenderer.entry.ts │ │ │ ├── RadioGroupControlRenderer.vue │ │ │ ├── SliderControlRenderer.entry.ts │ │ │ ├── SliderControlRenderer.vue │ │ │ ├── StringControlRenderer.entry.ts │ │ │ ├── StringControlRenderer.vue │ │ │ ├── StringMaskControlRenderer.entry.ts │ │ │ ├── StringMaskControlRenderer.vue │ │ │ ├── TimeControlRenderer.entry.ts │ │ │ ├── TimeControlRenderer.vue │ │ │ ├── components │ │ │ │ ├── ValidationBadge.vue │ │ │ │ ├── ValidationIcon.vue │ │ │ │ └── index.ts │ │ │ ├── directives │ │ │ │ ├── DisabledIconFocus.ts │ │ │ │ └── index.ts │ │ │ └── index.ts │ │ ├── extended │ │ │ ├── AutocompleteEnumControlRenderer.entry.ts │ │ │ ├── AutocompleteEnumControlRenderer.vue │ │ │ ├── AutocompleteOneOfEnumControlRenderer.entry.ts │ │ │ ├── AutocompleteOneOfEnumControlRenderer.vue │ │ │ └── index.ts │ │ ├── i18n │ │ │ ├── additionalPropertiesTranslations.ts │ │ │ ├── i18nUtil.ts │ │ │ └── index.ts │ │ ├── icons │ │ │ ├── fa.ts │ │ │ ├── icons.ts │ │ │ ├── index.ts │ │ │ └── mdi.ts │ │ ├── index.ts │ │ ├── layouts │ │ │ ├── ArrayLayoutRenderer.entry.ts │ │ │ ├── ArrayLayoutRenderer.vue │ │ │ ├── CategorizationRenderer.entry.ts │ │ │ ├── CategorizationRenderer.vue │ │ │ ├── CategorizationStepperRenderer.entry.ts │ │ │ ├── CategorizationStepperRenderer.vue │ │ │ ├── GroupRenderer.entry.ts │ │ │ ├── GroupRenderer.vue │ │ │ ├── HorizontalLayoutRenderer.entry.ts │ │ │ ├── HorizontalLayoutRenderer.vue │ │ │ ├── VerticalLayoutRenderer.entry.ts │ │ │ ├── VerticalLayoutRenderer.vue │ │ │ └── index.ts │ │ ├── renderers.ts │ │ ├── styles │ │ │ ├── defaultStyles.ts │ │ │ ├── index.ts │ │ │ ├── styles.ts │ │ │ └── util.ts │ │ └── util │ │ │ ├── composition.ts │ │ │ ├── datejs.ts │ │ │ ├── index.ts │ │ │ ├── inject.ts │ │ │ ├── options.ts │ │ │ └── validator.ts │ ├── tests │ │ ├── index.ts │ │ └── unit │ │ │ ├── additional │ │ │ ├── LabelRenderer.spec.ts │ │ │ ├── ListWithDetailRenderer.spec.ts │ │ │ └── __snapshots__ │ │ │ │ ├── LabelRenderer.spec.ts.snap │ │ │ │ └── ListWithDetailRenderer.spec.ts.snap │ │ │ ├── complex │ │ │ ├── ArrayControlRenderer.spec.ts │ │ │ ├── OneOfRenderer.spec.ts │ │ │ └── __snapshots__ │ │ │ │ ├── ArrayControlRenderer.spec.ts.snap │ │ │ │ └── OneOfRenderer.spec.ts.snap │ │ │ ├── controls │ │ │ ├── BooleanControlRenderer.spec.ts │ │ │ ├── DateControlRenderer.spec.ts │ │ │ ├── DateTimeControlRenderer.spec.ts │ │ │ ├── EnumControlRenderer.spec.ts │ │ │ ├── IntegerControlRenderer.spec.ts │ │ │ ├── MultiStringControlRenderer.spec.ts │ │ │ ├── NumberControlRenderer.spec.ts │ │ │ ├── OneOfEnumControlRenderer.spec.ts │ │ │ ├── StringControlRenderer.spec.ts │ │ │ ├── TimeControlRenderer.spec.ts │ │ │ └── __snapshots__ │ │ │ │ ├── BooleanControlRenderer.spec.ts.snap │ │ │ │ ├── DateControlRenderer.spec.ts.snap │ │ │ │ ├── DateTimeControlRenderer.spec.ts.snap │ │ │ │ ├── EnumControlRenderer.spec.ts.snap │ │ │ │ ├── IntegerControlRenderer.spec.ts.snap │ │ │ │ ├── MultiStringControlRenderer.spec.ts.snap │ │ │ │ ├── NumberControlRenderer.spec.ts.snap │ │ │ │ ├── OneOfEnumControlRenderer.spec.ts.snap │ │ │ │ ├── StringControlRenderer.spec.ts.snap │ │ │ │ └── TimeControlRenderer.spec.ts.snap │ │ │ ├── layout │ │ │ ├── ArrayLayoutRenderer.spec.ts │ │ │ └── __snapshots__ │ │ │ │ └── ArrayLayoutRenderer.spec.ts.snap │ │ │ └── util │ │ │ ├── TestComponent.vue │ │ │ ├── index.ts │ │ │ └── util.ts │ ├── tsconfig.example.json │ ├── tsconfig.json │ ├── tsconfig.lib.json │ ├── tsconfig.node.json │ ├── tsconfig.typedoc.json │ ├── tsconfig.vitest.json │ ├── vite.config.ts │ ├── vite.example.config.ts │ └── vitest.config.ts └── vue │ ├── .eslintrc.js │ ├── .prettierrc.js │ ├── LICENSE │ ├── README.md │ ├── babel.config.js │ ├── dev │ ├── components │ │ └── App.vue │ ├── renderers │ │ ├── ControlRenderer.vue │ │ ├── LayoutRenderer.vue │ │ └── index.ts │ └── serve.ts │ ├── jest.config.js │ ├── package.json │ ├── rollup.config.js │ ├── shims-vue.d.ts │ ├── src │ ├── components │ │ ├── DispatchCell.vue │ │ ├── DispatchRenderer.vue │ │ ├── JsonForms.vue │ │ ├── UnknownRenderer.vue │ │ └── index.ts │ ├── index.ts │ ├── jsonFormsCompositions.ts │ └── types.ts │ ├── tests │ ├── testHelper.ts │ └── unit │ │ └── JsonForms.spec.ts │ └── tsconfig.json ├── pnpm-lock.yaml ├── pnpm-workspace.yaml ├── tsconfig.base.json └── webpack ├── webpack.base.js └── webpack.dev.base.js /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.191.1/containers/javascript-node/.devcontainer/base.Dockerfile 2 | 3 | # [Choice] Node.js version: 22 4 | ARG VARIANT="22" 5 | FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:1-${VARIANT} 6 | 7 | # Install chromium and point the CHROME_BIN environment variable to it 8 | # This allows running angular-material's tests in the dev container 9 | RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ 10 | && apt-get -y install --no-install-recommends chromium 11 | ENV CHROME_BIN=/usr/bin/chromium 12 | 13 | # [Optional] Uncomment if you want to install an additional version of node using nvm 14 | # ARG EXTRA_NODE_VERSION=10 15 | # RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}" 16 | 17 | # Install and configure pnpm 18 | RUN su node -c "npm install -g pnpm@10" 19 | RUN su node -c "pnpm config set store-dir /home/node/.pnpm-store" 20 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: 2 | // https://github.com/microsoft/vscode-dev-containers/tree/v0.191.1/containers/javascript-node 3 | { 4 | "name": "Node.js", 5 | "build": { 6 | "dockerfile": "Dockerfile", 7 | // Update 'VARIANT' to pick a Node version: 18 8 | "args": { 9 | "VARIANT": "18" 10 | } 11 | }, 12 | // Set *default* container specific settings.json values on container create. 13 | // Add the IDs of extensions you want installed when the container is created. 14 | "customizations": { 15 | "extensions": [ 16 | "DavidAnson.vscode-markdownlint", 17 | "dbaeumer.vscode-eslint", 18 | "esbenp.prettier-vscode", 19 | "vue.volar" 20 | ] 21 | }, 22 | // Use 'postCreateCommand' to run commands after the container is created. 23 | "postCreateCommand": "pnpm i --frozen-lockfile && pnpm run build", 24 | // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. 25 | "remoteUser": "node" 26 | } 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: JSON Forms board 4 | url: https://jsonforms.discourse.group 5 | about: For questions and discussions 6 | - name: Professional support 7 | url: https://jsonforms.io/support 8 | about: Professional support by EclipseSource 9 | -------------------------------------------------------------------------------- /.github/config/changelog.json: -------------------------------------------------------------------------------- 1 | { 2 | "sort": "DESC", 3 | "pr_template": "- [${{LABELS}}] ${{TITLE}} (#${{NUMBER}})", 4 | "template": "${{UNCATEGORIZED}}", 5 | "ignore_labels": ["dependencies"] 6 | } 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | coverage 3 | .nyc_output 4 | dist 5 | lib 6 | docs 7 | *.log 8 | stats.html 9 | 10 | .idea/ 11 | .vscode/* 12 | !.vscode/extensions.json 13 | !.vscode/settings.json 14 | 15 | .coveralls.yml 16 | packages/examples-react/build 17 | 18 | **/.angular/cache -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .github 2 | .travis.yml 3 | .npmignore 4 | .nyc_output 5 | bower.json 6 | CLA.md 7 | CONTRIBUTING.md 8 | 9 | ########################################### 10 | # Copied from .gitgnore 11 | ########################################### 12 | 13 | temp/ 14 | coverage/ 15 | reports/ 16 | 17 | # webpack 18 | webpack/ 19 | 20 | # npm 21 | node_modules/ 22 | 23 | # test 24 | dist/ts-build/test 25 | test/ 26 | wct-test/ 27 | wct.conf.json 28 | 29 | # typescript cache files 30 | .tscache/ 31 | 32 | # logs 33 | *.log 34 | 35 | # examples 36 | example/ 37 | example_library/ 38 | 39 | # webstorm 40 | .idea 41 | 42 | # mac users 43 | .DS_Store 44 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | resolution-mode=highest 2 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 22 2 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | $schema: 'http://json.schemastore.org/prettierrc', 3 | singleQuote: true, 4 | jsxSingleQuote: true, 5 | endOfLine: 'auto', 6 | }; 7 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. 3 | // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp 4 | // List of extensions which should be recommended for users of this workspace. 5 | "recommendations": [ 6 | "DavidAnson.vscode-markdownlint", 7 | "dbaeumer.vscode-eslint", 8 | "esbenp.prettier-vscode", 9 | "ms-vscode-remote.remote-containers" 10 | ], 11 | // List of extensions recommended by VS Code that should not be recommended for users of this workspace. 12 | "unwantedRecommendations": [] 13 | } 14 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.formatOnSave": true, 3 | "editor.defaultFormatter": "esbenp.prettier-vscode", 4 | "eslint.validate": [ 5 | "javascript", 6 | "javascriptreact", 7 | "typescript", 8 | "typescriptreact", 9 | "vue" 10 | ], 11 | "[json]": { 12 | "editor.defaultFormatter": "esbenp.prettier-vscode" 13 | }, 14 | "[jsonc]": { 15 | "editor.defaultFormatter": "esbenp.prettier-vscode" 16 | }, 17 | "search.exclude": { 18 | "**/docs": true, 19 | "**/node_modules": true, 20 | "**/lib": true 21 | }, 22 | "typescript.tsdk": "node_modules/typescript/lib", 23 | "[javascript][javascriptreact][typescript][typescriptreact][vue]": { 24 | "editor.defaultFormatter": "esbenp.prettier-vscode", 25 | "editor.codeActionsOnSave": { 26 | "source.fixAll.eslint": "explicit" 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2019 EclipseSource GmbH 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /ROADMAP.md: -------------------------------------------------------------------------------- 1 | # Roadmap 2 | 3 | This roadmap defines our current view on how we will continue with the development of JSON Forms on a very coarse-grained level and is subject to change at any time: 4 | 5 | H1/2025 6 | 7 | - Improve adopter experience 8 | 9 | H2/2025 10 | 11 | - Improve adopter experience 12 | - Release 4.0 13 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "3.6.0-alpha.1", 3 | "npmClient": "pnpm", 4 | "useWorkspaces": true 5 | } 6 | -------------------------------------------------------------------------------- /packages/angular-material/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | $schema: 'http://json.schemastore.org/prettierrc', 3 | singleQuote: true, 4 | jsxSingleQuote: true, 5 | endOfLine: 'auto', 6 | }; 7 | -------------------------------------------------------------------------------- /packages/angular-material/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2019 EclipseSource Munich 4 | https://github.com/eclipsesource/jsonforms 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /packages/angular-material/example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSON Forms Angular Material RendererSet 6 | 7 | 8 | 9 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 29 | -------------------------------------------------------------------------------- /packages/angular-material/ng-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/ng-packagr/ng-package.schema.json", 3 | "dest": "./lib", 4 | "allowedNonPeerDependencies": [ 5 | "@jsonforms/angular", 6 | "@jsonforms/core", 7 | "hammerjs", 8 | "lodash" 9 | ] 10 | } -------------------------------------------------------------------------------- /packages/angular-material/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './public_api'; 2 | -------------------------------------------------------------------------------- /packages/angular-material/src/library/controls/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | export * from './boolean.renderer'; 26 | export * from './text.renderer'; 27 | export * from './textarea.renderer'; 28 | export * from './number.renderer'; 29 | export * from './range.renderer'; 30 | export * from './date.renderer'; 31 | export * from './toggle.renderer'; 32 | export * from './autocomplete.renderer'; 33 | -------------------------------------------------------------------------------- /packages/angular-material/src/library/layouts/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | export * from './array-layout.renderer'; 26 | export * from './horizontal-layout.renderer'; 27 | export * from './vertical-layout.renderer'; 28 | export * from './categorization-layout.renderer'; 29 | export * from './layout.renderer'; 30 | export * from './group-layout.renderer'; 31 | -------------------------------------------------------------------------------- /packages/angular-material/src/library/other/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | export * from './label.renderer'; 26 | export * from './master-detail'; 27 | export * from './object.renderer'; 28 | export * from './table.renderer'; 29 | -------------------------------------------------------------------------------- /packages/angular-material/src/library/other/master-detail/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | export * from './detail'; 26 | export * from './master'; 27 | -------------------------------------------------------------------------------- /packages/angular-material/src/library/util/date-format.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable() 4 | export class MyFormat { 5 | displayFormat = 'M/D/YYYY'; 6 | 7 | setDisplayFormat(displayFormat: string) { 8 | this.displayFormat = displayFormat; 9 | } 10 | 11 | get display() { 12 | return { 13 | monthYearLabel: 'YYYY-MM', 14 | dateA11yLabel: 'YYYY-MM-DD', 15 | monthYearA11yLabel: 'YYYY-MM', 16 | dateInput: this.displayFormat, 17 | }; 18 | } 19 | get parse() { 20 | return { 21 | dateInput: this.displayFormat, 22 | }; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/angular-material/src/public_api.ts: -------------------------------------------------------------------------------- 1 | export * from './library'; 2 | -------------------------------------------------------------------------------- /packages/angular-material/test/common/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | export * from './boolean'; 26 | export * from './text'; 27 | export * from './number'; 28 | export * from './range'; 29 | export * from './util'; 30 | export * from './layout'; 31 | -------------------------------------------------------------------------------- /packages/angular-material/test/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting, 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting() 14 | ); 15 | -------------------------------------------------------------------------------- /packages/angular-material/test/util.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2022 EclipseSource 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | import { JsonSchema, TesterContext } from '@jsonforms/core'; 26 | 27 | export const createTesterContext = ( 28 | rootSchema: JsonSchema, 29 | config?: any 30 | ): TesterContext => ({ rootSchema, config }); 31 | -------------------------------------------------------------------------------- /packages/angular-material/tsconfig.example.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig", 3 | "compilerOptions": { 4 | "outDir": "./example/dist", 5 | "baseUrl": "./", 6 | "paths": { 7 | "@jsonforms/angular": ["../angular/src"], 8 | "@jsonforms/core": ["../core/src"], 9 | "@jsonforms/examples": ["../examples/src"], 10 | }, 11 | }, 12 | "files": ["./example/main.ts"], 13 | "angularCompilerOptions": { 14 | "compilationMode": "full", 15 | "strictMetadataEmit": true, 16 | "generateCodeForLibraries": false, 17 | "skipTemplateCodegen": true, 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/angular-material/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base", 3 | "compilerOptions": { 4 | "declaration": true, 5 | "declarationMap": true, 6 | "inlineSources": true, 7 | "sourceMap": true, 8 | }, 9 | "exclude": ["node_modules"], 10 | "files": ["src/index.ts"], 11 | "angularCompilerOptions": { 12 | "compilationMode": "partial", 13 | "strictMetadataEmit": true, 14 | "generateCodeForLibraries": false, 15 | "skipTemplateCodegen": true 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/angular-material/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base", 3 | "compilerOptions": { 4 | "outDir": "../../out-tsc/spec", 5 | "inlineSourceMap": true, 6 | "sourceMap": true, 7 | "types": [ 8 | "jasmine" 9 | ] 10 | }, 11 | "include": [ 12 | "test/test.ts", 13 | "**/*.spec.ts", 14 | "**/*.d.ts" 15 | ], 16 | "angularCompilerOptions": { 17 | "compilationMode": "partial", 18 | "strictMetadataEmit": true, 19 | "generateCodeForLibraries": false, 20 | "skipTemplateCodegen": true 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/angular/.eslintrc.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | /** @type {import('eslint').Linter.Config} */ 3 | module.exports = { 4 | root: true, 5 | parser: '@typescript-eslint/parser', 6 | parserOptions: { 7 | /* Reset project because @angular-eslint/recommended sets this to an incompatible value */ 8 | project: null, 9 | }, 10 | // There is no file include in ESLint. Thus, ignore all and include files via negative ignore (!) 11 | ignorePatterns: ['/*', '!/src', '!/test'], 12 | extends: [ 13 | 'eslint:recommended', 14 | 'plugin:@typescript-eslint/recommended', 15 | 'plugin:import/recommended', 16 | 'plugin:import/typescript', 17 | 'plugin:@angular-eslint/recommended', 18 | 'plugin:@angular-eslint/template/process-inline-templates', 19 | 'plugin:prettier/recommended', 20 | ], 21 | rules: { 22 | '@angular-eslint/component-class-suffix': 'off', 23 | '@angular-eslint/directive-class-suffix': 'off', 24 | '@angular-eslint/no-conflicting-lifecycle': 'warn', 25 | '@typescript-eslint/no-explicit-any': 'off', 26 | // Base rule must be disabled to avoid incorrect errors 27 | 'no-unused-vars': 'off', 28 | '@typescript-eslint/no-unused-vars': [ 29 | 'warn', // or "error" 30 | { 31 | argsIgnorePattern: '^_', 32 | varsIgnorePattern: '^_', 33 | caughtErrorsIgnorePattern: '^_', 34 | }, 35 | ], 36 | 'import/no-unresolved': [ 37 | 'error', 38 | { 39 | // Ignore ava import because it is incorrectly reported as unresolved despite working as expected. 40 | ignore: ['^ava$'], 41 | }, 42 | ], 43 | }, 44 | }; 45 | -------------------------------------------------------------------------------- /packages/angular/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | $schema: 'http://json.schemastore.org/prettierrc', 3 | singleQuote: true, 4 | jsxSingleQuote: true, 5 | endOfLine: 'auto', 6 | }; 7 | -------------------------------------------------------------------------------- /packages/angular/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2019 EclipseSource Munich 4 | https://github.com/eclipsesource/jsonforms 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /packages/angular/build-package.js: -------------------------------------------------------------------------------- 1 | const ngPackage = require('ng-packagr'); 2 | 3 | ngPackage 4 | .ngPackagr() 5 | .forProject('ng-package.json') 6 | .withTsConfig('tsconfig.json') 7 | .build() 8 | .catch(error => { 9 | console.error(error); 10 | process.exit(1); 11 | }); -------------------------------------------------------------------------------- /packages/angular/ng-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/ng-packagr/ng-package.schema.json", 3 | "dest": "./lib", 4 | "allowedNonPeerDependencies": ["lodash"] 5 | } -------------------------------------------------------------------------------- /packages/angular/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './public_api'; 2 | -------------------------------------------------------------------------------- /packages/angular/src/library/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2020 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | export * from './base.renderer'; 26 | export * from './control'; 27 | export * from './array-control'; 28 | export * from './jsonforms.component'; 29 | export * from './jsonforms.module'; 30 | export * from './unknown.component'; 31 | export * from './jsonforms.service'; 32 | export * from './jsonforms-root.component'; 33 | export * from './abstract-control'; 34 | -------------------------------------------------------------------------------- /packages/angular/src/library/jsonforms.module.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2020 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | import { NgModule } from '@angular/core'; 26 | 27 | import { JsonForms } from './jsonforms-root.component'; 28 | import { JsonFormsOutlet } from './jsonforms.component'; 29 | import { UnknownRenderer } from './unknown.component'; 30 | @NgModule({ 31 | declarations: [JsonFormsOutlet, UnknownRenderer, JsonForms], 32 | exports: [JsonFormsOutlet, JsonForms], 33 | }) 34 | export class JsonFormsModule {} 35 | -------------------------------------------------------------------------------- /packages/angular/src/library/unknown.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | import { Component } from '@angular/core'; 26 | @Component({ 27 | selector: 'unknown.renderer', 28 | template: 'No applicable renderer found!', 29 | standalone: false, 30 | }) 31 | export class UnknownRenderer {} 32 | -------------------------------------------------------------------------------- /packages/angular/src/public_api.ts: -------------------------------------------------------------------------------- 1 | export * from './library'; 2 | -------------------------------------------------------------------------------- /packages/angular/test-config/ts-node.config.js: -------------------------------------------------------------------------------- 1 | // Register ts-node and override ts options for ava 2 | require('ts-node').register({ 3 | compilerOptions: { 4 | module: 'commonjs', 5 | }, 6 | }); 7 | -------------------------------------------------------------------------------- /packages/angular/test/dummy.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | import test from 'ava'; 26 | test.todo('dummy'); 27 | -------------------------------------------------------------------------------- /packages/angular/test/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../dist/test", 5 | "target": "es6", 6 | "inlineSourceMap": true 7 | }, 8 | "include": ["**/*.ts", "**/*.tsx"], 9 | "exclude": ["node_modules"], 10 | "files": ["../src/index.ts"] 11 | } 12 | -------------------------------------------------------------------------------- /packages/angular/tsconfig.cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig", 3 | "compilerOptions": { 4 | "outDir": "./lib/cjs", 5 | "sourceMap": true, 6 | "target": "es5", 7 | "module": "commonjs" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/angular/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base", 3 | "compilerOptions": { 4 | "declaration": true, 5 | "declarationMap": true, 6 | "inlineSources": true, 7 | "sourceMap": true, 8 | }, 9 | "exclude": ["node_modules"], 10 | "files": ["src/index.ts"], 11 | "angularCompilerOptions": { 12 | "compilationMode": "partial", 13 | "strictMetadataEmit": true, 14 | "generateCodeForLibraries": false, 15 | "skipTemplateCodegen": true 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/core/.eslintrc.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | /** @type {import('eslint').Linter.Config} */ 3 | module.exports = { 4 | root: true, 5 | parser: '@typescript-eslint/parser', 6 | // There is no file include in ESLint. Thus, ignore all and include files via negative ignore (!) 7 | ignorePatterns: ['/*', '!/src', '!/test'], 8 | extends: [ 9 | 'eslint:recommended', 10 | 'plugin:@typescript-eslint/recommended', 11 | 'plugin:import/recommended', 12 | 'plugin:import/typescript', 13 | 'plugin:prettier/recommended', 14 | ], 15 | rules: { 16 | // Allow extending interfaces without additional properties to create marker interfaces 17 | '@typescript-eslint/no-empty-interface': [ 18 | 'error', 19 | { 20 | allowSingleExtends: true, 21 | }, 22 | ], 23 | '@typescript-eslint/no-explicit-any': 'off', 24 | // Base rule must be disabled to avoid incorrect errors 25 | 'no-unused-vars': 'off', 26 | '@typescript-eslint/no-unused-vars': [ 27 | 'error', 28 | { 29 | argsIgnorePattern: '^_', 30 | varsIgnorePattern: '^_', 31 | caughtErrorsIgnorePattern: '^_', 32 | }, 33 | ], 34 | 'import/no-unresolved': [ 35 | 'error', 36 | { 37 | // Ignore ava import because it is incorrectly reported as unresolved despite working as expected. 38 | ignore: ['^ava$'], 39 | }, 40 | ], 41 | 'import/no-cycle': [ 42 | 'error', 43 | { 44 | ignoreExternal: true, 45 | }, 46 | ], 47 | }, 48 | }; 49 | -------------------------------------------------------------------------------- /packages/core/.nycrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@istanbuljs/nyc-config-typescript", 3 | "lines": 40, 4 | "all": true, 5 | "check-coverage": true 6 | } 7 | -------------------------------------------------------------------------------- /packages/core/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | $schema: 'http://json.schemastore.org/prettierrc', 3 | singleQuote: true, 4 | jsxSingleQuote: true, 5 | endOfLine: 'auto', 6 | }; 7 | -------------------------------------------------------------------------------- /packages/core/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2019 EclipseSource Munich 4 | https://github.com/eclipsesource/jsonforms 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /packages/core/rollup.config.js: -------------------------------------------------------------------------------- 1 | import typescript from 'rollup-plugin-typescript2'; 2 | import cleanup from 'rollup-plugin-cleanup'; 3 | import { visualizer } from 'rollup-plugin-visualizer'; 4 | 5 | const packageJson = require('./package.json'); 6 | 7 | const baseConfig = { 8 | input: 'src/index.ts', 9 | external: [...Object.keys(packageJson.dependencies), /^lodash\/.*/], 10 | }; 11 | 12 | export default [ 13 | { 14 | ...baseConfig, 15 | output: { 16 | file: packageJson.module, 17 | format: 'esm', 18 | sourcemap: true, 19 | }, 20 | plugins: [ 21 | typescript(), 22 | cleanup({ extensions: ['js', 'ts', 'jsx', 'tsx'] }), 23 | visualizer({ open: false }), 24 | ], 25 | }, 26 | { 27 | ...baseConfig, 28 | output: { 29 | file: packageJson.main, 30 | format: 'cjs', 31 | sourcemap: true, 32 | }, 33 | plugins: [ 34 | typescript({ 35 | tsconfigOverride: { 36 | compilerOptions: { 37 | target: 'ES5', 38 | }, 39 | }, 40 | }), 41 | cleanup({ extensions: ['js', 'ts', 'jsx', 'tsx'] }), 42 | ], 43 | }, 44 | ]; 45 | -------------------------------------------------------------------------------- /packages/core/src/actions/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | 26 | export * from './actions'; 27 | -------------------------------------------------------------------------------- /packages/core/src/generators/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | 26 | export * from './Generate'; 27 | export * from './schema'; 28 | export * from './uischema'; 29 | -------------------------------------------------------------------------------- /packages/core/src/i18n/combinatorTranslations.ts: -------------------------------------------------------------------------------- 1 | export interface CombinatorDefaultTranslation { 2 | key: CombinatorTranslationEnum; 3 | default: (variable?: string) => string; 4 | } 5 | 6 | export enum CombinatorTranslationEnum { 7 | clearDialogTitle = 'clearDialogTitle', 8 | clearDialogMessage = 'clearDialogMessage', 9 | clearDialogAccept = 'clearDialogAccept', 10 | clearDialogDecline = 'clearDialogDecline', 11 | } 12 | 13 | export type CombinatorTranslations = { 14 | [key in CombinatorTranslationEnum]?: string; 15 | }; 16 | 17 | export const combinatorDefaultTranslations: CombinatorDefaultTranslation[] = [ 18 | { 19 | key: CombinatorTranslationEnum.clearDialogTitle, 20 | default: () => 'Clear form?', 21 | }, 22 | { 23 | key: CombinatorTranslationEnum.clearDialogMessage, 24 | default: () => 'Your data will be cleared. Do you want to proceed?', 25 | }, 26 | { key: CombinatorTranslationEnum.clearDialogAccept, default: () => 'Yes' }, 27 | { key: CombinatorTranslationEnum.clearDialogDecline, default: () => 'No' }, 28 | ]; 29 | -------------------------------------------------------------------------------- /packages/core/src/i18n/index.ts: -------------------------------------------------------------------------------- 1 | export * from './arrayTranslations'; 2 | export * from './combinatorTranslations'; 3 | export * from './selectors'; 4 | export * from './i18nUtil'; 5 | -------------------------------------------------------------------------------- /packages/core/src/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | 26 | export * from './actions'; 27 | export * as Actions from './actions'; 28 | export * from './generators'; 29 | export * from './models'; 30 | export * from './reducers'; 31 | export * from './testers'; 32 | export * as Test from './testers'; 33 | export * from './util'; 34 | export * from './store'; 35 | export * from './i18n'; 36 | export * from './mappers'; 37 | -------------------------------------------------------------------------------- /packages/core/src/mappers/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2024 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | 26 | export * from './renderer'; 27 | export * from './cell'; 28 | export * from './combinators'; 29 | export * from './util'; 30 | -------------------------------------------------------------------------------- /packages/core/src/mappers/util.ts: -------------------------------------------------------------------------------- 1 | import { JsonSchema, UISchemaElement } from '../models'; 2 | import { JsonFormsState, getAjv } from '../store'; 3 | import { hasEnableRule, isEnabled } from '../util'; 4 | 5 | /** 6 | * Indicates whether the given `uischema` element shall be enabled or disabled. 7 | * Checks the global readonly flag, uischema rule, uischema options (including the config), 8 | * the schema and the enablement indicator of the parent. 9 | */ 10 | export const isInherentlyEnabled = ( 11 | state: JsonFormsState, 12 | ownProps: any, 13 | uischema: UISchemaElement, 14 | schema: (JsonSchema & { readOnly?: boolean }) | undefined, 15 | rootData: any, 16 | config: any 17 | ) => { 18 | if (state?.jsonforms?.readonly) { 19 | return false; 20 | } 21 | if (uischema && hasEnableRule(uischema)) { 22 | return isEnabled(uischema, rootData, ownProps?.path, getAjv(state)); 23 | } 24 | if (typeof uischema?.options?.readonly === 'boolean') { 25 | return !uischema.options.readonly; 26 | } 27 | if (typeof uischema?.options?.readOnly === 'boolean') { 28 | return !uischema.options.readOnly; 29 | } 30 | if (typeof config?.readonly === 'boolean') { 31 | return !config.readonly; 32 | } 33 | if (typeof config?.readOnly === 'boolean') { 34 | return !config.readOnly; 35 | } 36 | if (schema?.readOnly === true) { 37 | return false; 38 | } 39 | if (typeof ownProps?.enabled === 'boolean') { 40 | return ownProps.enabled; 41 | } 42 | return true; 43 | }; 44 | -------------------------------------------------------------------------------- /packages/core/src/models/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | 26 | export * from './draft4'; 27 | export * from './jsonSchema'; 28 | export * from './jsonSchema4'; 29 | export * from './jsonSchema7'; 30 | export * from './uischema'; 31 | -------------------------------------------------------------------------------- /packages/core/src/models/jsonSchema.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | 26 | import type { JsonSchema4 } from './jsonSchema4'; 27 | import type { JsonSchema7 } from './jsonSchema7'; 28 | 29 | export type JsonSchema = JsonSchema4 | JsonSchema7; 30 | -------------------------------------------------------------------------------- /packages/core/src/reducers/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | 26 | export * from './cells'; 27 | export * from './config'; 28 | export * from './core'; 29 | export * from './default-data'; 30 | export * from './i18n'; 31 | export * from './reducers'; 32 | export * from './renderers'; 33 | export * from './uischemas'; 34 | export * from './middleware'; 35 | -------------------------------------------------------------------------------- /packages/core/src/store/i18nTypes.ts: -------------------------------------------------------------------------------- 1 | import type { ErrorObject } from 'ajv'; 2 | import type { JsonSchema, UISchemaElement } from '../models'; 3 | 4 | export type Translator = { 5 | (id: string, defaultMessage: string, values?: any): string; 6 | (id: string, defaultMessage: undefined, values?: any): string | undefined; 7 | (id: string, defaultMessage?: string, values?: any): string | undefined; 8 | }; 9 | 10 | export type ErrorTranslator = ( 11 | error: ErrorObject, 12 | translate: Translator, 13 | uischema?: UISchemaElement 14 | ) => string; 15 | 16 | export interface JsonFormsI18nState { 17 | locale?: string; 18 | translate?: Translator; 19 | translateError?: ErrorTranslator; 20 | } 21 | 22 | export type i18nJsonSchema = JsonSchema & { i18n?: string }; 23 | -------------------------------------------------------------------------------- /packages/core/src/store/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2024-2024 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | 26 | export * from './store'; 27 | export * from './type'; 28 | export * from './i18nTypes'; 29 | export * from './jsonFormsCore'; 30 | -------------------------------------------------------------------------------- /packages/core/src/testers/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | 26 | export * from './testers'; 27 | -------------------------------------------------------------------------------- /packages/core/src/util/defaultDateFormat.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2023-2023 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | 26 | export const defaultDateFormat = 'YYYY-MM-DD'; 27 | export const defaultTimeFormat = 'HH:mm:ss'; 28 | export const defaultDateTimeFormat = 'YYYY-MM-DDTHH:mm:ss.sssZ'; 29 | -------------------------------------------------------------------------------- /packages/core/src/util/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | 26 | export * from './Formatted'; 27 | export * from './ids'; 28 | export * from './label'; 29 | export * from './path'; 30 | export * from './resolvers'; 31 | export * from './runtime'; 32 | export * from './schema'; 33 | export * from './uischema'; 34 | export * from './util'; 35 | export * from './validator'; 36 | export * from './defaultDateFormat'; 37 | export * from './errors'; 38 | export * from './helpers'; 39 | -------------------------------------------------------------------------------- /packages/core/test-config/ts-node.config.js: -------------------------------------------------------------------------------- 1 | // Register ts-node and override ts options for ava 2 | require('ts-node').register({ 3 | compilerOptions: { 4 | module: 'commonjs', 5 | target: 'es5', 6 | }, 7 | }); 8 | -------------------------------------------------------------------------------- /packages/core/test/mappers/array.test.ts: -------------------------------------------------------------------------------- 1 | import anyTest, { TestFn } from 'ava'; 2 | import { moveDown, moveUp } from '../../src/mappers'; 3 | 4 | const test = anyTest as TestFn<{ array: number[] }>; 5 | 6 | test.beforeEach((t) => { 7 | t.context.array = [1, 2, 3, 4, 5]; 8 | }); 9 | 10 | test('Move up should move item up by one index', (t) => { 11 | moveUp(t.context.array, 2); 12 | t.deepEqual(t.context.array, [1, 3, 2, 4, 5]); 13 | }); 14 | 15 | test('Move up should not change array if item to move is the first item ', (t) => { 16 | moveUp(t.context.array, 0); 17 | t.deepEqual(t.context.array, [1, 2, 3, 4, 5]); 18 | }); 19 | 20 | test('Move down should move item down by one index', (t) => { 21 | moveDown(t.context.array, 2); 22 | t.deepEqual(t.context.array, [1, 2, 4, 3, 5]); 23 | }); 24 | 25 | test('Move down should not change array if item to move is the last item ', (t) => { 26 | moveDown(t.context.array, 4); 27 | t.deepEqual(t.context.array, [1, 2, 3, 4, 5]); 28 | }); 29 | -------------------------------------------------------------------------------- /packages/core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "sourceMap": true 6 | }, 7 | "exclude": ["node_modules"], 8 | "files": ["./src/index.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/examples-app/README.md: -------------------------------------------------------------------------------- 1 | # JSON Forms - More Forms. Less Code 2 | 3 | _Complex forms in the blink of an eye_ 4 | 5 | JSON Forms eliminates the tedious task of writing fully-featured forms by hand by leveraging the capabilities of JSON, JSON Schema and Javascript. 6 | 7 | ## Examples App 8 | 9 | This package aggregates JSON Forms examples and makes them reachable via single `index.html` file. 10 | 11 | Aggregating the examples assumes that packages were built and their examples bundled. 12 | Afterwards, the examples app can be aggregated with [prepare-examples-app.js](./prepare-examples-app.js) into folder `dist`. 13 | -------------------------------------------------------------------------------- /packages/examples-app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSON Forms Examples 6 | 7 | 8 | 9 | 10 |

JSON Forms Examples

11 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /packages/examples-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jsonforms/examples-app", 3 | "version": "3.6.0-alpha.1", 4 | "private": true, 5 | "license": "MIT", 6 | "type": "module", 7 | "scripts": {}, 8 | "devDependencies": { 9 | "@types/fs-extra": "^9.0.13", 10 | "fs-extra": "^11.1.0" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/examples-app/prepare-examples-app.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import { copySync } from 'fs-extra/esm'; 4 | import { copyFileSync, existsSync, mkdirSync, rmdirSync } from 'fs'; 5 | import { dirname, join } from 'path'; 6 | import { fileURLToPath } from 'url'; 7 | 8 | const __filename = fileURLToPath(import.meta.url); 9 | const __dirname = dirname(__filename); 10 | 11 | const distDir = join(__dirname, 'dist'); 12 | const packagesDir = join(__dirname, '..'); 13 | const examples = { 14 | 'react-vanilla': join(packagesDir, 'vanilla-renderers', 'example', 'dist'), 15 | 'react-material': join(packagesDir, 'material-renderers', 'example', 'dist'), 16 | 'angular-material': join(packagesDir, 'angular-material', 'example', 'dist'), 17 | 'vue-vanilla': join(packagesDir, 'vue-vanilla', 'example', 'dist'), 18 | 'vue-vuetify': join(packagesDir, 'vue-vuetify', 'example', 'dist'), 19 | }; 20 | 21 | // Clean and recreate dist dir 22 | if (existsSync(distDir)) { 23 | console.log('Remove existing dist dir...'); 24 | rmdirSync(distDir, { recursive: true, force: true }); 25 | } 26 | console.log('Create dist dir...'); 27 | mkdirSync(distDir, { recursive: true }); 28 | 29 | // Copy index and built examples 30 | console.log('Copy index.html...'); 31 | console.log('Copy example apps...'); 32 | copyFileSync(join(__dirname, 'index.html'), join(distDir, 'index.html')); 33 | Object.keys(examples).forEach((key) => { 34 | console.log(`Copying example ${key}...`); 35 | const path = examples[key]; 36 | copySync(path, join(distDir, key)); 37 | }); 38 | 39 | console.log('...finished'); 40 | -------------------------------------------------------------------------------- /packages/examples-react/.eslintrc.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | /** @type {import('eslint').Linter.Config} */ 3 | module.exports = { 4 | root: true, 5 | parser: '@typescript-eslint/parser', 6 | parserOptions: { 7 | ecmaFeatures: { 8 | jsx: true, 9 | }, 10 | }, 11 | // There is no file include in ESLint. Thus, ignore all and include files via negative ignore (!) 12 | ignorePatterns: ['/*', '!/src'], 13 | extends: [ 14 | 'eslint:recommended', 15 | 'plugin:@typescript-eslint/recommended', 16 | 'plugin:import/recommended', 17 | 'plugin:import/typescript', 18 | 'plugin:react/recommended', 19 | 'plugin:prettier/recommended', 20 | ], 21 | rules: { 22 | '@typescript-eslint/no-explicit-any': 'off', 23 | // Base rule must be disabled to avoid incorrect errors 24 | 'no-unused-vars': 'off', 25 | '@typescript-eslint/no-unused-vars': [ 26 | 'warn', // or "error" 27 | { 28 | argsIgnorePattern: '^_', 29 | varsIgnorePattern: '^_', 30 | caughtErrorsIgnorePattern: '^_', 31 | }, 32 | ], 33 | }, 34 | settings: { 35 | react: { 36 | version: 'detect', 37 | }, 38 | }, 39 | }; 40 | -------------------------------------------------------------------------------- /packages/examples-react/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | $schema: 'http://json.schemastore.org/prettierrc', 3 | singleQuote: true, 4 | jsxSingleQuote: true, 5 | endOfLine: 'auto', 6 | }; 7 | -------------------------------------------------------------------------------- /packages/examples-react/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jsonforms/examples-react", 3 | "version": "3.6.0-alpha.1", 4 | "private": true, 5 | "dependencies": { 6 | "@jsonforms/core": "workspace:*", 7 | "@jsonforms/examples": "workspace:*", 8 | "@jsonforms/react": "workspace:*", 9 | "@mui/material": "~5.13.0", 10 | "@types/react-highlight": "^0.12.5", 11 | "@types/react-tabs": "^2.3.3", 12 | "highlight.js": "^11.3.1", 13 | "json-refs": "3.0.15", 14 | "lodash": "^4.17.21", 15 | "react": "^17.0.2", 16 | "react-dom": "^17.0.2", 17 | "react-highlight": "^0.14.0", 18 | "react-tabs": "^3.2.3" 19 | }, 20 | "devDependencies": { 21 | "@types/react": "^17.0.24", 22 | "@types/react-dom": "^17.0.9", 23 | "@typescript-eslint/eslint-plugin": "^5.54.1", 24 | "@typescript-eslint/parser": "^5.54.1", 25 | "eslint": "^8.56.0", 26 | "eslint-config-prettier": "^8.7.0", 27 | "eslint-plugin-import": "^2.27.5", 28 | "eslint-plugin-prettier": "^4.2.1", 29 | "eslint-plugin-react": "^7.32.2", 30 | "prettier": "^2.8.4", 31 | "tslib": "^2.5.0" 32 | }, 33 | "scripts": { 34 | "build": "echo 'Nothing to do'", 35 | "lint": "eslint .", 36 | "lint:fix": "eslint --fix .", 37 | "test": "echo 'Nothing to do'" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /packages/examples-react/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipsesource/jsonforms/d0b1dfa4f91e911b8a8f37ead1fd04ad3ff3eafa/packages/examples-react/public/favicon.ico -------------------------------------------------------------------------------- /packages/examples-react/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /packages/examples/.eslintrc.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | /** @type {import('eslint').Linter.Config} */ 3 | module.exports = { 4 | root: true, 5 | parser: '@typescript-eslint/parser', 6 | // There is no file include in ESLint. Thus, ignore all and include files via negative ignore (!) 7 | ignorePatterns: ['/*', '!/src'], 8 | extends: [ 9 | 'eslint:recommended', 10 | 'plugin:@typescript-eslint/recommended', 11 | 'plugin:import/recommended', 12 | 'plugin:import/typescript', 13 | 'plugin:prettier/recommended', 14 | ], 15 | rules: { 16 | '@typescript-eslint/no-explicit-any': 'off', 17 | // Base rule must be disabled to avoid incorrect errors 18 | 'no-unused-vars': 'off', 19 | '@typescript-eslint/no-unused-vars': [ 20 | 'warn', // or "error" 21 | { 22 | argsIgnorePattern: '^_', 23 | varsIgnorePattern: '^_', 24 | caughtErrorsIgnorePattern: '^_', 25 | }, 26 | ], 27 | }, 28 | }; 29 | -------------------------------------------------------------------------------- /packages/examples/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | $schema: 'http://json.schemastore.org/prettierrc', 3 | singleQuote: true, 4 | jsxSingleQuote: true, 5 | endOfLine: 'auto', 6 | }; 7 | -------------------------------------------------------------------------------- /packages/examples/icons/drive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipsesource/jsonforms/d0b1dfa4f91e911b8a8f37ead1fd04ad3ff3eafa/packages/examples/icons/drive.png -------------------------------------------------------------------------------- /packages/examples/icons/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipsesource/jsonforms/d0b1dfa4f91e911b8a8f37ead1fd04ad3ff3eafa/packages/examples/icons/folder.png -------------------------------------------------------------------------------- /packages/examples/icons/page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipsesource/jsonforms/d0b1dfa4f91e911b8a8f37ead1fd04ad3ff3eafa/packages/examples/icons/page.png -------------------------------------------------------------------------------- /packages/examples/rollup.config.js: -------------------------------------------------------------------------------- 1 | import typescript from 'rollup-plugin-typescript2'; 2 | import cleanup from 'rollup-plugin-cleanup'; 3 | import { visualizer } from 'rollup-plugin-visualizer'; 4 | 5 | const packageJson = require('./package.json'); 6 | 7 | const baseConfig = { 8 | input: 'src/index.ts', 9 | external: [ 10 | ...Object.keys(packageJson.dependencies), 11 | ...Object.keys(packageJson.peerDependencies), 12 | /^lodash\/.*/, 13 | ], 14 | }; 15 | 16 | export default [ 17 | { 18 | ...baseConfig, 19 | output: { 20 | file: packageJson.module, 21 | format: 'esm', 22 | sourcemap: true, 23 | }, 24 | plugins: [ 25 | typescript(), 26 | cleanup({ extensions: ['js', 'ts', 'jsx', 'tsx'] }), 27 | visualizer({ open: false }), 28 | ], 29 | }, 30 | { 31 | ...baseConfig, 32 | output: { 33 | file: packageJson.main, 34 | format: 'cjs', 35 | sourcemap: true, 36 | }, 37 | plugins: [ 38 | typescript({ 39 | tsconfigOverride: { 40 | compilerOptions: { 41 | target: 'ES5', 42 | }, 43 | }, 44 | }), 45 | cleanup({ extensions: ['js', 'ts', 'jsx', 'tsx'] }), 46 | ], 47 | }, 48 | ]; 49 | -------------------------------------------------------------------------------- /packages/examples/src/examples/enumInArray.ts: -------------------------------------------------------------------------------- 1 | import { registerExamples } from '../register'; 2 | 3 | export const schema = { 4 | type: 'array', 5 | items: { 6 | type: 'object', 7 | properties: { 8 | plainEnum: { 9 | type: 'string', 10 | enum: ['foo', 'bar'], 11 | }, 12 | oneOfEnum: { 13 | type: 'string', 14 | oneOf: [ 15 | { const: 'foo', title: 'Foo' }, 16 | { const: 'bar', title: 'Bar' }, 17 | { const: 'foobar', title: 'FooBar' }, 18 | ], 19 | }, 20 | }, 21 | }, 22 | }; 23 | 24 | export const uischema = { 25 | type: 'VerticalLayout', 26 | elements: [ 27 | { 28 | type: 'Control', 29 | scope: '#', 30 | }, 31 | ], 32 | }; 33 | 34 | export const data: any[] = []; 35 | 36 | registerExamples([ 37 | { 38 | name: 'enumInArray', 39 | label: 'Array containing enums', 40 | data, 41 | schema, 42 | uischema, 43 | }, 44 | ]); 45 | -------------------------------------------------------------------------------- /packages/examples/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "sourceMap": true 6 | }, 7 | "exclude": ["node_modules"], 8 | "files": ["./src/index.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/material-renderers/.eslintrc.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | /** @type {import('eslint').Linter.Config} */ 3 | module.exports = { 4 | root: true, 5 | parser: '@typescript-eslint/parser', 6 | parserOptions: { 7 | ecmaFeatures: { 8 | jsx: true, 9 | }, 10 | }, 11 | // There is no file include in ESLint. Thus, ignore all and include files via negative ignore (!) 12 | ignorePatterns: ['/*', '!/src', '!/test', '!/example', '/example/dist'], 13 | extends: [ 14 | 'eslint:recommended', 15 | 'plugin:@typescript-eslint/recommended', 16 | 'plugin:import/recommended', 17 | 'plugin:import/typescript', 18 | 'plugin:react/recommended', 19 | 'plugin:prettier/recommended', 20 | ], 21 | rules: { 22 | '@typescript-eslint/no-explicit-any': 'off', 23 | 'import/no-named-as-default': 'off', 24 | // Base rule must be disabled to avoid incorrect errors 25 | 'no-unused-vars': 'off', 26 | '@typescript-eslint/no-unused-vars': [ 27 | 'warn', // or "error" 28 | { 29 | argsIgnorePattern: '^_', 30 | varsIgnorePattern: '^_', 31 | caughtErrorsIgnorePattern: '^_', 32 | }, 33 | ], 34 | }, 35 | settings: { 36 | react: { 37 | version: 'detect', 38 | }, 39 | }, 40 | }; 41 | -------------------------------------------------------------------------------- /packages/material-renderers/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | $schema: 'http://json.schemastore.org/prettierrc', 3 | singleQuote: true, 4 | jsxSingleQuote: true, 5 | endOfLine: 'auto', 6 | }; 7 | -------------------------------------------------------------------------------- /packages/material-renderers/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2019 EclipseSource Munich 4 | https://github.com/eclipsesource/jsonforms 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /packages/material-renderers/example/index.bundled.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSON Forms React Material RendererSet 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /packages/material-renderers/example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSON Forms React Material RendererSet 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /packages/material-renderers/rollup.config.js: -------------------------------------------------------------------------------- 1 | import typescript from 'rollup-plugin-typescript2'; 2 | import cleanup from 'rollup-plugin-cleanup'; 3 | import { visualizer } from 'rollup-plugin-visualizer'; 4 | 5 | const packageJson = require('./package.json'); 6 | 7 | const baseConfig = { 8 | input: 'src/index.ts', 9 | external: [ 10 | ...Object.keys(packageJson.dependencies), 11 | ...Object.keys(packageJson.peerDependencies), 12 | 'react', 13 | /^lodash\/.*/, 14 | /^@material-ui\/.*/, 15 | /^dayjs\/.*/, 16 | ], 17 | }; 18 | 19 | export default [ 20 | { 21 | ...baseConfig, 22 | output: { 23 | file: packageJson.module, 24 | format: 'esm', 25 | sourcemap: true, 26 | }, 27 | plugins: [ 28 | typescript(), 29 | cleanup({ extensions: ['js', 'ts', 'jsx', 'tsx'] }), 30 | visualizer({ open: false }), 31 | ], 32 | }, 33 | { 34 | ...baseConfig, 35 | output: { 36 | file: packageJson.main, 37 | format: 'cjs', 38 | sourcemap: true, 39 | }, 40 | plugins: [ 41 | typescript({ 42 | tsconfigOverride: { 43 | compilerOptions: { 44 | target: 'ES5', 45 | }, 46 | }, 47 | }), 48 | cleanup({ extensions: ['js', 'ts', 'jsx', 'tsx'] }), 49 | ], 50 | }, 51 | ]; 52 | -------------------------------------------------------------------------------- /packages/material-renderers/src/additional/unwrapped.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | import { MaterialLabelRenderer } from './MaterialLabelRenderer'; 26 | 27 | import { MaterialListWithDetailRenderer } from './MaterialListWithDetailRenderer'; 28 | 29 | export const UnwrappedAdditional = { 30 | MaterialLabelRenderer, 31 | MaterialListWithDetailRenderer, 32 | }; 33 | -------------------------------------------------------------------------------- /packages/material-renderers/src/complex/TabSwitchConfirmDialog.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { 4 | Button, 5 | Dialog, 6 | DialogActions, 7 | DialogContent, 8 | DialogContentText, 9 | DialogTitle, 10 | } from '@mui/material'; 11 | 12 | export interface TabSwitchConfirmDialogProps { 13 | open: boolean; 14 | handleClose: () => void; 15 | confirm: () => void; 16 | cancel: () => void; 17 | id: string; 18 | } 19 | 20 | export const TabSwitchConfirmDialog = ({ 21 | open, 22 | handleClose, 23 | confirm, 24 | cancel, 25 | id, 26 | }: TabSwitchConfirmDialogProps) => { 27 | return ( 28 | 34 | {'Clear form?'} 35 | 36 | 37 | Your data will be cleared if you navigate away from this tab. Do you 38 | want to proceed? 39 | 40 | 41 | 42 | 45 | 53 | 54 | 55 | ); 56 | }; 57 | -------------------------------------------------------------------------------- /packages/material-renderers/src/mui-controls/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | export * from './MuiAutocomplete'; 26 | export * from './MuiCheckbox'; 27 | export * from './MuiInputInteger'; 28 | export * from './MuiInputNumber'; 29 | export * from './MuiInputNumberFormat'; 30 | export * from './MuiInputText'; 31 | export * from './MuiInputTime'; 32 | export * from './MuiSelect'; 33 | export * from './MuiToggle'; 34 | -------------------------------------------------------------------------------- /packages/material-renderers/src/util/focus.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2021 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | import { useState, useCallback } from 'react'; 26 | 27 | export const useFocus = (): [boolean, () => void, () => void] => { 28 | const [focused, setFocused] = useState(false); 29 | const onFocus = useCallback(() => setFocused(true), []); 30 | const onBlur = useCallback(() => setFocused(false), []); 31 | return [focused, onFocus, onBlur]; 32 | }; 33 | -------------------------------------------------------------------------------- /packages/material-renderers/src/util/i18nDefaults.ts: -------------------------------------------------------------------------------- 1 | export const i18nDefaults = { 2 | 'enum.none': 'None', 3 | }; 4 | -------------------------------------------------------------------------------- /packages/material-renderers/src/util/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | export * from './datejs'; 26 | export * from './layout'; 27 | export * from './theme'; 28 | export * from './debounce'; 29 | export * from './focus'; 30 | export * from './i18nDefaults'; 31 | -------------------------------------------------------------------------------- /packages/material-renderers/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "sourceMap": true 6 | }, 7 | "exclude": ["node_modules"], 8 | "files": ["./src/index.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/material-renderers/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig", 3 | "compilerOptions": { 4 | "module": "CommonJS", 5 | "target": "ES5" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/material-renderers/webpack/webpack.dev.js: -------------------------------------------------------------------------------- 1 | const merge = require('webpack-merge').merge; 2 | const baseConfig = require('../../../webpack/webpack.dev.base.js'); 3 | var copyWebpackPlugin = require('copy-webpack-plugin'); 4 | 5 | module.exports = merge(baseConfig, { 6 | plugins: [ 7 | new copyWebpackPlugin([{ from: '../examples-react/src/logo.svg' }]), 8 | ], 9 | }); 10 | -------------------------------------------------------------------------------- /packages/react/.eslintrc.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | /** @type {import('eslint').Linter.Config} */ 3 | module.exports = { 4 | root: true, 5 | parser: '@typescript-eslint/parser', 6 | parserOptions: { 7 | ecmaFeatures: { 8 | jsx: true, 9 | }, 10 | }, 11 | // There is no file include in ESLint. Thus, ignore all and include files via negative ignore (!) 12 | ignorePatterns: ['/*', '!/src', '!/test'], 13 | extends: [ 14 | 'eslint:recommended', 15 | 'plugin:@typescript-eslint/recommended', 16 | 'plugin:import/recommended', 17 | 'plugin:import/typescript', 18 | 'plugin:react/recommended', 19 | 'plugin:prettier/recommended', 20 | ], 21 | rules: { 22 | '@typescript-eslint/no-explicit-any': 'off', 23 | // Base rule must be disabled to avoid incorrect errors 24 | 'no-unused-vars': 'off', 25 | '@typescript-eslint/no-unused-vars': [ 26 | 'warn', // or "error" 27 | { 28 | argsIgnorePattern: '^_', 29 | varsIgnorePattern: '^_', 30 | caughtErrorsIgnorePattern: '^_', 31 | }, 32 | ], 33 | }, 34 | settings: { 35 | react: { 36 | version: 'detect', 37 | }, 38 | }, 39 | }; 40 | -------------------------------------------------------------------------------- /packages/react/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | $schema: 'http://json.schemastore.org/prettierrc', 3 | singleQuote: true, 4 | jsxSingleQuote: true, 5 | endOfLine: 'auto', 6 | }; 7 | -------------------------------------------------------------------------------- /packages/react/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2019 EclipseSource Munich 4 | https://github.com/eclipsesource/jsonforms 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /packages/react/__mocks__/react.js: -------------------------------------------------------------------------------- 1 | const React = require('react'); 2 | module.exports = Object.assign({}, React, { useEffect: React.useLayoutEffect }); 3 | -------------------------------------------------------------------------------- /packages/react/src/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | 26 | export * from './Control'; 27 | export * from './JsonForms'; 28 | export * from './DispatchCell'; 29 | export * from './Renderer'; 30 | export * from './JsonFormsContext'; 31 | export * from './UnknownRenderer'; 32 | -------------------------------------------------------------------------------- /packages/react/src/redux/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | 26 | export * from './JsonFormsReduxContext'; 27 | -------------------------------------------------------------------------------- /packages/react/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "sourceMap": true 6 | }, 7 | "exclude": ["node_modules"], 8 | "files": ["./src/index.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/react/tsconfig.redux.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib/redux", 5 | "declarationDir": "./lib", 6 | "sourceMap": true 7 | }, 8 | "files": ["./src/redux/index.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/react/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig", 3 | "compilerOptions": { 4 | "module": "CommonJS", 5 | "target": "ES5" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/vanilla-renderers/.eslintrc.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | /** @type {import('eslint').Linter.Config} */ 3 | module.exports = { 4 | root: true, 5 | parser: '@typescript-eslint/parser', 6 | parserOptions: { 7 | ecmaFeatures: { 8 | jsx: true, 9 | }, 10 | }, 11 | // There is no file include in ESLint. Thus, ignore all and include files via negative ignore (!) 12 | ignorePatterns: ['/*', '!/src', '!/test', '!/example', '/example/dist'], 13 | extends: [ 14 | 'eslint:recommended', 15 | 'plugin:@typescript-eslint/recommended', 16 | 'plugin:import/recommended', 17 | 'plugin:import/typescript', 18 | 'plugin:react/recommended', 19 | 'plugin:prettier/recommended', 20 | ], 21 | rules: { 22 | '@typescript-eslint/no-explicit-any': 'off', 23 | 'import/no-named-as-default': 'off', 24 | // Base rule must be disabled to avoid incorrect errors 25 | 'no-unused-vars': 'off', 26 | '@typescript-eslint/no-unused-vars': [ 27 | 'warn', // or "error" 28 | { 29 | argsIgnorePattern: '^_', 30 | varsIgnorePattern: '^_', 31 | caughtErrorsIgnorePattern: '^_', 32 | }, 33 | ], 34 | 'import/no-unresolved': [ 35 | 'error', 36 | { 37 | // Ignore ava import because it is incorrectly reported as unresolved despite working as expected. 38 | ignore: ['^ava$'], 39 | }, 40 | ], 41 | }, 42 | }; 43 | -------------------------------------------------------------------------------- /packages/vanilla-renderers/.nycrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@istanbuljs/nyc-config-typescript", 3 | "lines": 80, 4 | "all": true, 5 | "check-coverage": true 6 | } 7 | -------------------------------------------------------------------------------- /packages/vanilla-renderers/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | $schema: 'http://json.schemastore.org/prettierrc', 3 | singleQuote: true, 4 | jsxSingleQuote: true, 5 | endOfLine: 'auto', 6 | }; 7 | -------------------------------------------------------------------------------- /packages/vanilla-renderers/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2019 EclipseSource Munich 4 | https://github.com/eclipsesource/jsonforms 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /packages/vanilla-renderers/example/example.dark.css: -------------------------------------------------------------------------------- 1 | body.dark { 2 | --jsf-main-bg-color: #222227; 3 | --jsf-modest-bg-color: #333333; 4 | --jsf-border-color: #444444; 5 | --jsf-modest-bg-highlight-color: #444444; 6 | --jsf-validation-color: darkred; 7 | --jsf-main-fg-color: #999999; 8 | background-color: var(--jsf-main-bg-color); 9 | color: var(--jsf-main-fg-color); 10 | } 11 | body.dark input { 12 | background-color: var(--jsf-main-bg-color); 13 | color: var(--jsf-main-fg-color); 14 | } 15 | body.dark input:focus { 16 | background-color: var(--jsf-main-bg-color); 17 | } 18 | body.dark select { 19 | background-color: var(--jsf-main-bg-color); 20 | color: var(--jsf-main-fg-color); 21 | border-color: var(--jsf-border-color); 22 | } 23 | body.dark textarea { 24 | background-color: var(--jsf-main-bg-color); 25 | color: var(--jsf-main-fg-color); 26 | } 27 | body.dark button { 28 | background-color: var(--jsf-modest-bg-color); 29 | color: var(--jsf-main-fg-color); 30 | } 31 | -------------------------------------------------------------------------------- /packages/vanilla-renderers/example/index.bundled.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSON Forms React Vanilla RendererSet 6 | 7 | 8 | 9 | 10 | 18 | 19 | 20 | 21 |
22 |
23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /packages/vanilla-renderers/example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSON Forms React Vanilla RendererSet 6 | 7 | 8 | 9 | 10 | 18 | 19 | 20 | 21 |
22 |
23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /packages/vanilla-renderers/example/index.tsx: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | import { createThemeSelection } from './theme.switcher'; 26 | import { vanillaCells, vanillaRenderers } from '../src'; 27 | import { renderExample } from '../../examples-react/src/index'; 28 | 29 | renderExample(vanillaRenderers, vanillaCells); 30 | createThemeSelection(); 31 | -------------------------------------------------------------------------------- /packages/vanilla-renderers/rollup.config.js: -------------------------------------------------------------------------------- 1 | import typescript from 'rollup-plugin-typescript2'; 2 | import cleanup from 'rollup-plugin-cleanup'; 3 | import { visualizer } from 'rollup-plugin-visualizer'; 4 | 5 | const packageJson = require('./package.json'); 6 | 7 | const baseConfig = { 8 | input: 'src/index.ts', 9 | external: [ 10 | ...Object.keys(packageJson.dependencies ?? {}), 11 | ...Object.keys(packageJson.peerDependencies), 12 | 'react', 13 | /^lodash\/.*/, 14 | /^@material-ui\/.*/, 15 | /^dayjs\/.*/, 16 | ], 17 | }; 18 | 19 | export default [ 20 | { 21 | ...baseConfig, 22 | output: { 23 | file: packageJson.module, 24 | format: 'esm', 25 | sourcemap: true, 26 | }, 27 | plugins: [ 28 | typescript(), 29 | cleanup({ extensions: ['js', 'ts', 'jsx', 'tsx'] }), 30 | visualizer({ open: false }), 31 | ], 32 | }, 33 | { 34 | ...baseConfig, 35 | output: { 36 | file: packageJson.main, 37 | format: 'cjs', 38 | sourcemap: true, 39 | }, 40 | plugins: [ 41 | typescript({ 42 | tsconfigOverride: { 43 | compilerOptions: { 44 | target: 'ES5', 45 | }, 46 | }, 47 | }), 48 | cleanup({ extensions: ['js', 'ts', 'jsx', 'tsx'] }), 49 | ], 50 | }, 51 | ]; 52 | -------------------------------------------------------------------------------- /packages/vanilla-renderers/src/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | 26 | export * from './actions'; 27 | export * from './controls'; 28 | export * from './complex'; 29 | export * from './cells'; 30 | export * from './layouts'; 31 | export * from './reducers'; 32 | export * from './util'; 33 | export * from './styles'; 34 | export * from './renderers'; 35 | -------------------------------------------------------------------------------- /packages/vanilla-renderers/src/layouts/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | import GroupLayout, { groupTester } from './GroupLayout'; 26 | import HorizontalLayout, { horizontalLayoutTester } from './HorizontalLayout'; 27 | import VerticalLayout, { verticalLayoutTester } from './VerticalLayout'; 28 | 29 | export { 30 | GroupLayout, 31 | groupTester, 32 | HorizontalLayout, 33 | horizontalLayoutTester, 34 | VerticalLayout, 35 | verticalLayoutTester, 36 | }; 37 | -------------------------------------------------------------------------------- /packages/vanilla-renderers/src/styles/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2021 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | 26 | export * from './styleContext'; 27 | export * from './styles'; 28 | -------------------------------------------------------------------------------- /packages/vanilla-renderers/src/util/i18nDefaults.ts: -------------------------------------------------------------------------------- 1 | export const i18nDefaults = { 2 | 'enum.none': 'None', 3 | }; 4 | -------------------------------------------------------------------------------- /packages/vanilla-renderers/src/util/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License 3 | 4 | Copyright (c) 2017-2019 EclipseSource Munich 5 | https://github.com/eclipsesource/jsonforms 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | export * from './i18nDefaults'; 26 | export * from './props'; 27 | -------------------------------------------------------------------------------- /packages/vanilla-renderers/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "sourceMap": true 6 | }, 7 | "exclude": ["node_modules"], 8 | "files": ["./src/index.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/vanilla-renderers/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig", 3 | "compilerOptions": { 4 | "module": "CommonJS", 5 | "target": "ES5" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/vanilla-renderers/webpack/webpack.dev.js: -------------------------------------------------------------------------------- 1 | const merge = require('webpack-merge').merge; 2 | const baseConfig = require('../../../webpack/webpack.dev.base.js'); 3 | var copyWebpackPlugin = require('copy-webpack-plugin'); 4 | 5 | module.exports = merge(baseConfig, { 6 | plugins: [ 7 | new copyWebpackPlugin([ 8 | { from: './example/example.css' }, 9 | { from: './example/example.dark.css' }, 10 | { from: '../examples-react/src/logo.svg' }, 11 | ]), 12 | ], 13 | }); 14 | -------------------------------------------------------------------------------- /packages/vue-vanilla/.eslintrc.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | /** @type {import('eslint').Linter.Config} */ 3 | module.exports = { 4 | root: true, 5 | parser: 'vue-eslint-parser', 6 | parserOptions: { 7 | ecmaFeatures: { 8 | jsx: true, 9 | }, 10 | }, 11 | // There is no file include in ESLint. Thus, ignore all and include files via negative ignore (!) 12 | ignorePatterns: ['/*', '!/src', '!/tests', '!/dev', '!/config'], 13 | extends: [ 14 | 'eslint:recommended', 15 | 'plugin:@typescript-eslint/recommended', 16 | 'plugin:import/recommended', 17 | 'plugin:import/typescript', 18 | 'plugin:vue/vue3-recommended', 19 | '@vue/typescript/recommended', 20 | 'plugin:prettier-vue/recommended', 21 | ], 22 | rules: { 23 | '@typescript-eslint/no-explicit-any': 'off', 24 | // Base rule must be disabled to avoid incorrect errors 25 | 'no-unused-vars': 'off', 26 | '@typescript-eslint/no-unused-vars': [ 27 | 'warn', // or "error" 28 | { 29 | argsIgnorePattern: '^_', 30 | varsIgnorePattern: '^_', 31 | caughtErrorsIgnorePattern: '^_', 32 | }, 33 | ], 34 | }, 35 | }; 36 | -------------------------------------------------------------------------------- /packages/vue-vanilla/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | $schema: 'http://json.schemastore.org/prettierrc', 3 | singleQuote: true, 4 | jsxSingleQuote: true, 5 | endOfLine: 'auto', 6 | }; 7 | -------------------------------------------------------------------------------- /packages/vue-vanilla/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2019 EclipseSource Munich 4 | https://github.com/eclipsesource/jsonforms 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /packages/vue-vanilla/babel.config.js: -------------------------------------------------------------------------------- 1 | const devPresets = ['@vue/cli-plugin-babel/preset']; 2 | const buildPresets = ['@babel/preset-env', '@babel/preset-typescript']; 3 | module.exports = { 4 | presets: process.env.NODE_ENV === 'production' ? buildPresets : devPresets, 5 | plugins: 6 | process.env.NODE_ENV === 'test' 7 | ? [ 8 | '@babel/plugin-proposal-optional-chaining', 9 | '@babel/plugin-proposal-nullish-coalescing-operator', 10 | ] 11 | : [], 12 | }; 13 | -------------------------------------------------------------------------------- /packages/vue-vanilla/config/jsonforms.ts: -------------------------------------------------------------------------------- 1 | export * from '@jsonforms/vue'; 2 | -------------------------------------------------------------------------------- /packages/vue-vanilla/dev/serve.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue'; 2 | import App from './components/App.vue'; 3 | 4 | createApp(App).mount('#app'); 5 | -------------------------------------------------------------------------------- /packages/vue-vanilla/example/index.bundled.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSON Forms Vue Vanilla RendererSet 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /packages/vue-vanilla/rollup.example.config.js: -------------------------------------------------------------------------------- 1 | import commonjs from '@rollup/plugin-commonjs'; 2 | import json from '@rollup/plugin-json'; 3 | import nodeResolve from '@rollup/plugin-node-resolve'; 4 | import replace from '@rollup/plugin-replace'; 5 | import copy from 'rollup-plugin-copy'; 6 | import css from 'rollup-plugin-import-css'; 7 | import typescript from 'rollup-plugin-typescript2'; 8 | import vue from 'rollup-plugin-vue'; 9 | 10 | /** 11 | * @type {import('rollup').RollupOptions} 12 | */ 13 | const config = { 14 | input: 'dev/serve.ts', 15 | output: { 16 | file: 'example/dist/bundle.js', 17 | format: 'iife', 18 | sourcemap: true, 19 | }, 20 | plugins: [ 21 | replace({ 22 | 'process.env.NODE_ENV': JSON.stringify('production'), 23 | preventAssignment: true, // recommended to be set by library to be forward compatible 24 | }), 25 | vue(), 26 | nodeResolve({ browser: true }), 27 | // Transform mixed because some JsonForms modules use import and require 28 | commonjs({ transformMixedEsModules: true }), 29 | css({ 30 | output: 'bundle.css', 31 | }), 32 | json(), 33 | typescript({ 34 | tsconfigOverride: { 35 | include: null, 36 | compilerOptions: { 37 | // Do not emit typescript declarations for our bundled example app 38 | declaration: false, 39 | }, 40 | }, 41 | }), 42 | copy({ 43 | targets: [ 44 | { 45 | src: 'example/index.bundled.html', 46 | dest: 'example/dist', 47 | rename: () => 'index.html', 48 | }, 49 | ], 50 | }), 51 | ], 52 | }; 53 | 54 | export default config; 55 | -------------------------------------------------------------------------------- /packages/vue-vanilla/shims-vue.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.vue' { 2 | import type { DefineComponent } from 'vue'; 3 | const component: DefineComponent<{}, {}, any>; 4 | export default component; 5 | 6 | export const entry; 7 | } 8 | -------------------------------------------------------------------------------- /packages/vue-vanilla/src/array/index.ts: -------------------------------------------------------------------------------- 1 | export { default as ArrayListRenderer } from './ArrayListRenderer.vue'; 2 | 3 | import { entry as arrayListRendererEntry } from './ArrayListRenderer.vue'; 4 | 5 | export const arrayRenderers = [arrayListRendererEntry]; 6 | -------------------------------------------------------------------------------- /packages/vue-vanilla/src/complex/index.ts: -------------------------------------------------------------------------------- 1 | export { default as ObjectRenderer } from './ObjectRenderer.vue'; 2 | export { default as OneOfRenderer } from './OneOfRenderer.vue'; 3 | export { default as EnumArrayRenderer } from './EnumArrayRenderer.vue'; 4 | 5 | import { entry as objectRendererEntry } from './ObjectRenderer.vue'; 6 | import { entry as oneOfRendererEntry } from './OneOfRenderer.vue'; 7 | import { entry as enumArrayRendererEntry } from './EnumArrayRenderer.vue'; 8 | 9 | export const complexRenderers = [ 10 | objectRendererEntry, 11 | oneOfRendererEntry, 12 | enumArrayRendererEntry, 13 | ]; 14 | -------------------------------------------------------------------------------- /packages/vue-vanilla/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './array'; 2 | export * from './controls'; 3 | export * from './layouts'; 4 | export * from './renderers'; 5 | export * from './styles'; 6 | export * from './util'; 7 | export * from './label'; 8 | -------------------------------------------------------------------------------- /packages/vue-vanilla/src/label/LabelRenderer.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 39 | -------------------------------------------------------------------------------- /packages/vue-vanilla/src/label/index.ts: -------------------------------------------------------------------------------- 1 | export { default as LabelRenderer } from './LabelRenderer.vue'; 2 | 3 | import { entry as labelRendererEntry } from './LabelRenderer.vue'; 4 | 5 | export const labelRenderers = [labelRendererEntry]; 6 | -------------------------------------------------------------------------------- /packages/vue-vanilla/src/layouts/GroupRenderer.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 61 | -------------------------------------------------------------------------------- /packages/vue-vanilla/src/layouts/index.ts: -------------------------------------------------------------------------------- 1 | export { default as LayoutRenderer } from './LayoutRenderer.vue'; 2 | export { default as GroupRenderer } from './GroupRenderer.vue'; 3 | export { default as CategorizationRenderer } from '../layouts/CategorizationRenderer.vue'; 4 | export { default as CategorizationStepperRenderer } from '../layouts/CategorizationStepperRenderer.vue'; 5 | 6 | import { entry as layoutRendererEntry } from './LayoutRenderer.vue'; 7 | import { entry as groupRendererEntry } from './GroupRenderer.vue'; 8 | import { entry as categorizationEntry } from '../layouts/CategorizationRenderer.vue'; 9 | import { entry as categorizationStepperEntry } from '../layouts/CategorizationStepperRenderer.vue'; 10 | 11 | export const layoutRenderers = [ 12 | layoutRendererEntry, 13 | groupRendererEntry, 14 | categorizationEntry, 15 | categorizationStepperEntry, 16 | ]; 17 | -------------------------------------------------------------------------------- /packages/vue-vanilla/src/renderers.ts: -------------------------------------------------------------------------------- 1 | import { arrayRenderers } from './array'; 2 | import { complexRenderers } from './complex'; 3 | import { controlRenderers } from './controls'; 4 | import { labelRenderers } from './label'; 5 | import { layoutRenderers } from './layouts'; 6 | 7 | export const vanillaRenderers = [ 8 | ...controlRenderers, 9 | ...layoutRenderers, 10 | ...complexRenderers, 11 | ...arrayRenderers, 12 | ...labelRenderers, 13 | ]; 14 | -------------------------------------------------------------------------------- /packages/vue-vanilla/src/styles/index.ts: -------------------------------------------------------------------------------- 1 | export * from './styles'; 2 | export * from './util'; 3 | export * from './defaultStyles'; 4 | -------------------------------------------------------------------------------- /packages/vue-vanilla/src/styles/util.ts: -------------------------------------------------------------------------------- 1 | import { Styles } from './styles'; 2 | import cloneDeep from 'lodash/cloneDeep'; 3 | import mergeWith from 'lodash/mergeWith'; 4 | 5 | export const classes = (strings: TemplateStringsArray, ...variables: any[]) => { 6 | return strings 7 | .reduce((acc, curr, index) => { 8 | return `${acc}${curr}${variables[index] || ''}`; 9 | }, '') 10 | .trim(); 11 | }; 12 | 13 | /** 14 | * Helper function to merge two styles definitions. The contained classes will be combined, not overwritten. 15 | * 16 | * Example usage: 17 | * ```ts 18 | * const myStyles = mergeStyles(defaultStyles, { control: { root: 'mycontrol' } }); 19 | * ``` 20 | */ 21 | export const mergeStyles = ( 22 | stylesA: Partial, 23 | stylesB: Partial 24 | ): Partial => { 25 | const styles = cloneDeep(stylesA); 26 | mergeWith(styles, stylesB, (aValue, bValue) => { 27 | if (typeof aValue === 'string' && typeof bValue === 'string') { 28 | return `${aValue} ${bValue}`; 29 | } 30 | return undefined; 31 | }); 32 | return styles; 33 | }; 34 | -------------------------------------------------------------------------------- /packages/vue-vanilla/src/util/index.ts: -------------------------------------------------------------------------------- 1 | export * from './options'; 2 | export * from './composition'; 3 | -------------------------------------------------------------------------------- /packages/vue-vanilla/src/util/options.ts: -------------------------------------------------------------------------------- 1 | export interface Options { 2 | showUnfocusedDescription?: boolean; 3 | hideRequiredAsterisk?: boolean; 4 | focus?: boolean; 5 | step?: number; 6 | } 7 | -------------------------------------------------------------------------------- /packages/vue-vanilla/tests/unit/complex/ObjectRenderer.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { mountJsonForms } from '../util'; 3 | 4 | const schema = { 5 | properties: { 6 | nested: { 7 | title: 'My Object', 8 | properties: { 9 | a: { 10 | type: 'string', 11 | }, 12 | b: { 13 | type: 'boolean', 14 | }, 15 | }, 16 | }, 17 | }, 18 | }; 19 | const uischema = { 20 | type: 'Control', 21 | scope: '#', 22 | }; 23 | 24 | describe('ObjectRenderer.vue', () => { 25 | it('renders a fieldset', () => { 26 | const wrapper = mountJsonForms( 27 | { nested: { a: 'a', b: true } }, 28 | schema, 29 | uischema 30 | ); 31 | expect(wrapper.find('fieldset').exists()).to.be.true; 32 | }); 33 | 34 | it('renders group label', () => { 35 | const wrapper = mountJsonForms( 36 | { nested: { a: 'a', b: true } }, 37 | schema, 38 | uischema 39 | ); 40 | expect(wrapper.find('legend').text()).to.equal('My Object'); 41 | }); 42 | 43 | it('renders children', () => { 44 | const wrapper = mountJsonForms( 45 | { nested: { a: 'a', b: true } }, 46 | schema, 47 | uischema 48 | ); 49 | const inputs = wrapper.findAll('input'); 50 | expect(inputs.length).to.equal(2); 51 | }); 52 | }); 53 | -------------------------------------------------------------------------------- /packages/vue-vanilla/tests/unit/controls/BooleanControlRenderer.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { mountJsonForms } from '../util'; 3 | 4 | const schema = { 5 | type: 'boolean', 6 | title: 'My Boolean', 7 | }; 8 | const uischema = { 9 | type: 'Control', 10 | scope: '#', 11 | options: { 12 | placeholder: 'boolean placeholder', 13 | }, 14 | }; 15 | 16 | describe('BooleanControlRenderer.vue', () => { 17 | it('renders a checkbox', () => { 18 | const wrapper = mountJsonForms(true, schema, uischema); 19 | expect(wrapper.find('input[type="checkbox"]').exists()).to.be.true; 20 | }); 21 | 22 | it('renders title as label', () => { 23 | const wrapper = mountJsonForms(true, schema, uischema); 24 | expect(wrapper.find('label').text()).to.equal('My Boolean'); 25 | }); 26 | 27 | it('emits a data change', async () => { 28 | const wrapper = mountJsonForms(true, schema, uischema); 29 | const input = wrapper.find('input'); 30 | await input.trigger('click'); 31 | expect(wrapper.vm.data).to.equal(false); 32 | }); 33 | 34 | it('should have a placeholder', async () => { 35 | const wrapper = mountJsonForms(true, schema, uischema); 36 | const input = wrapper.find('input'); 37 | const placeholder = input.attributes('placeholder'); 38 | expect(placeholder).to.equal('boolean placeholder'); 39 | }); 40 | }); 41 | -------------------------------------------------------------------------------- /packages/vue-vanilla/tests/unit/controls/DateControlRenderer.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { mountJsonForms } from '../util'; 3 | 4 | const schema = { 5 | type: 'string', 6 | title: 'My Date', 7 | format: 'date', 8 | }; 9 | const uischema = { 10 | type: 'Control', 11 | scope: '#', 12 | options: { 13 | placeholder: 'date placeholder', 14 | }, 15 | }; 16 | 17 | describe('DateControlRenderer.vue', () => { 18 | it('renders a date input', () => { 19 | const wrapper = mountJsonForms('2021-03-09', schema, uischema); 20 | expect(wrapper.find('input[type="date"]').exists()).to.be.true; 21 | }); 22 | 23 | it('renders title as label', () => { 24 | const wrapper = mountJsonForms('2021-03-09', schema, uischema); 25 | expect(wrapper.find('label').text()).to.equal('My Date'); 26 | }); 27 | 28 | it('emits a data change', async () => { 29 | const wrapper = mountJsonForms('2021-03-09', schema, uischema); 30 | const input = wrapper.find('input'); 31 | await input.setValue('2021-03-10'); 32 | await input.trigger('blur'); 33 | expect(wrapper.vm.data).to.equal('2021-03-10'); 34 | }); 35 | 36 | it('should have a placeholder', async () => { 37 | const wrapper = mountJsonForms('2021-03-09', schema, uischema); 38 | const input = wrapper.find('input'); 39 | const placeholder = input.attributes('placeholder'); 40 | expect(placeholder).to.equal('date placeholder'); 41 | }); 42 | }); 43 | -------------------------------------------------------------------------------- /packages/vue-vanilla/tests/unit/controls/EnumControlRenderer.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { mountJsonForms } from '../util'; 3 | 4 | const schema = { 5 | type: 'string', 6 | title: 'My Enum', 7 | enum: ['a', 'b'], 8 | }; 9 | const uischema = { 10 | type: 'Control', 11 | scope: '#', 12 | }; 13 | 14 | describe('EnumControlRenderer.vue', () => { 15 | it('renders a select input', () => { 16 | const wrapper = mountJsonForms('a', schema, uischema); 17 | expect(wrapper.find('select').exists()).to.be.true; 18 | }); 19 | 20 | it('renders title as label', () => { 21 | const wrapper = mountJsonForms('a', schema, uischema); 22 | expect(wrapper.find('label').text()).to.equal('My Enum'); 23 | }); 24 | 25 | it('emits a data change', async () => { 26 | const wrapper = mountJsonForms('a', schema, uischema); 27 | const select = wrapper.find('select'); 28 | await select.setValue('b'); 29 | expect(wrapper.vm.data).to.equal('b'); 30 | }); 31 | }); 32 | -------------------------------------------------------------------------------- /packages/vue-vanilla/tests/unit/controls/EnumOneOfControlRenderer.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { mountJsonForms } from '../util'; 3 | 4 | const schema = { 5 | type: 'string', 6 | title: 'My OneOf Enum', 7 | oneOf: [ 8 | { const: 'a', title: 'Foo' }, 9 | { const: 'b', title: 'Bar' }, 10 | ], 11 | }; 12 | const uischema = { 13 | type: 'Control', 14 | scope: '#', 15 | }; 16 | 17 | describe('EnumOneOfControlRenderer.vue', () => { 18 | it('renders a select input', () => { 19 | const wrapper = mountJsonForms('a', schema, uischema); 20 | expect(wrapper.find('select').exists()).to.be.true; 21 | }); 22 | 23 | it('renders title as label', () => { 24 | const wrapper = mountJsonForms('a', schema, uischema); 25 | expect(wrapper.find('label').text()).to.equal('My OneOf Enum'); 26 | }); 27 | 28 | it('emits a data change', async () => { 29 | const wrapper = mountJsonForms('a', schema, uischema); 30 | const select = wrapper.find('select'); 31 | await select.setValue('b'); 32 | expect(wrapper.vm.data).to.equal('b'); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /packages/vue-vanilla/tests/unit/controls/IntegerControlRenderer.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { mountJsonForms } from '../util'; 3 | 4 | const schema = { 5 | type: 'integer', 6 | title: 'My Integer', 7 | }; 8 | const uischema = { 9 | type: 'Control', 10 | scope: '#', 11 | }; 12 | 13 | describe('IntegerControlRenderer.vue', () => { 14 | it('renders a number input', () => { 15 | const wrapper = mountJsonForms(1, schema, uischema); 16 | expect(wrapper.find('input[type="number"]').exists()).to.be.true; 17 | }); 18 | 19 | it('renders title as label', () => { 20 | const wrapper = mountJsonForms(1, schema, uischema); 21 | expect(wrapper.find('label').text()).to.equal('My Integer'); 22 | }); 23 | 24 | it('emits a data change', async () => { 25 | const wrapper = mountJsonForms(1, schema, uischema); 26 | const input = wrapper.find('input'); 27 | await input.setValue(2); 28 | expect(wrapper.vm.data).to.equal(2); 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /packages/vue-vanilla/tests/unit/controls/MultiStringControlRenderer.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { mountJsonForms } from '../util'; 3 | 4 | const schema = { 5 | type: 'string', 6 | title: 'My Multi String', 7 | }; 8 | const uischema = { 9 | type: 'Control', 10 | scope: '#', 11 | options: { 12 | multi: true, 13 | }, 14 | }; 15 | 16 | describe('MultiStringControlRenderer.vue', () => { 17 | it('renders a text area', () => { 18 | const wrapper = mountJsonForms('a', schema, uischema); 19 | expect(wrapper.find('textarea').exists()).to.be.true; 20 | }); 21 | 22 | it('renders title as label', () => { 23 | const wrapper = mountJsonForms('a', schema, uischema); 24 | expect(wrapper.find('label').text()).to.equal('My Multi String'); 25 | }); 26 | 27 | it('emits a data change', async () => { 28 | const wrapper = mountJsonForms('a', schema, uischema); 29 | const select = wrapper.find('textarea'); 30 | await select.setValue('b'); 31 | expect(wrapper.vm.data).to.equal('b'); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /packages/vue-vanilla/tests/unit/controls/NumberControlRenderer.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { mountJsonForms } from '../util'; 3 | 4 | const schema = { 5 | type: 'number', 6 | title: 'My Number', 7 | }; 8 | const uischema = { 9 | type: 'Control', 10 | scope: '#', 11 | options: { 12 | placeholder: 'number placeholder', 13 | }, 14 | }; 15 | 16 | describe('NumberControlRenderer.vue', () => { 17 | it('renders a number input', () => { 18 | const wrapper = mountJsonForms(1, schema, uischema); 19 | expect(wrapper.find('input[type="number"]').exists()).to.be.true; 20 | }); 21 | 22 | it('renders title as label', () => { 23 | const wrapper = mountJsonForms(1, schema, uischema); 24 | expect(wrapper.find('label').text()).to.equal('My Number'); 25 | }); 26 | 27 | it('emits a data change', async () => { 28 | const wrapper = mountJsonForms(1, schema, uischema); 29 | const input = wrapper.find('input'); 30 | await input.setValue(2); 31 | expect(wrapper.vm.data).to.equal(2); 32 | }); 33 | 34 | it('should have a placeholder', async () => { 35 | const wrapper = mountJsonForms(1, schema, uischema); 36 | const input = wrapper.find('input'); 37 | const placeholder = input.attributes('placeholder'); 38 | expect(placeholder).to.equal('number placeholder'); 39 | }); 40 | }); 41 | -------------------------------------------------------------------------------- /packages/vue-vanilla/tests/unit/controls/TimeControlRenderer.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { mountJsonForms } from '../util'; 3 | 4 | const schema = { 5 | type: 'string', 6 | title: 'My Time', 7 | format: 'time', 8 | }; 9 | const uischema = { 10 | type: 'Control', 11 | scope: '#', 12 | options: { 13 | placeholder: 'time placeholder', 14 | }, 15 | }; 16 | 17 | describe('TimeControlRenderer.vue', () => { 18 | it('renders a time input', () => { 19 | const wrapper = mountJsonForms('00:20', schema, uischema); 20 | expect(wrapper.find('input[type="time"]').exists()).to.be.true; 21 | }); 22 | 23 | it('renders title as label', () => { 24 | const wrapper = mountJsonForms('00:20', schema, uischema); 25 | expect(wrapper.find('label').text()).to.equal('My Time'); 26 | }); 27 | 28 | it('emits a data change', async () => { 29 | const wrapper = mountJsonForms('00:20', schema, uischema); 30 | const input = wrapper.find('input'); 31 | await input.setValue('01:51'); 32 | expect(wrapper.vm.data).to.equal('01:51'); 33 | }); 34 | 35 | it('should have a placeholder', async () => { 36 | const wrapper = mountJsonForms('00:20', schema, uischema); 37 | const input = wrapper.find('input'); 38 | const placeholder = input.attributes('placeholder'); 39 | expect(placeholder).to.equal('time placeholder'); 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /packages/vue-vanilla/tests/unit/form/JsonForms.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { mountJsonForms } from '../util'; 3 | 4 | const schema = { 5 | type: 'string', 6 | }; 7 | const uischema = { 8 | type: 'HorizontalLayout', 9 | elements: [ 10 | { 11 | type: 'VerticalLayout', 12 | elements: [ 13 | { 14 | type: 'Control', 15 | scope: '#', 16 | }, 17 | { 18 | type: 'Control', 19 | scope: '#', 20 | }, 21 | ], 22 | }, 23 | { 24 | type: 'VerticalLayout', 25 | elements: [ 26 | { 27 | type: 'Control', 28 | scope: '#', 29 | }, 30 | { 31 | type: 'Control', 32 | scope: '#', 33 | }, 34 | ], 35 | }, 36 | ], 37 | }; 38 | const reducedUiSchema = { 39 | type: 'HorizontalLayout', 40 | elements: [ 41 | { 42 | type: 'VerticalLayout', 43 | elements: [ 44 | { 45 | type: 'Control', 46 | scope: '#', 47 | }, 48 | { 49 | type: 'Control', 50 | scope: '#', 51 | }, 52 | ], 53 | }, 54 | ], 55 | }; 56 | 57 | describe('JsonForms.vue', () => { 58 | it('renders all inputs', () => { 59 | const wrapper = mountJsonForms('', schema, uischema); 60 | expect(wrapper.findAll('input').length).to.equal(4); 61 | }); 62 | 63 | it('reacts to uischema changes', async () => { 64 | const wrapper = mountJsonForms('', schema, uischema); 65 | await wrapper.setProps({ 66 | uischema: reducedUiSchema, 67 | }); 68 | expect(wrapper.findAll('input').length).to.equal(2); 69 | }); 70 | }); 71 | -------------------------------------------------------------------------------- /packages/vue-vanilla/tests/unit/label/LabelRenderer.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { mountJsonForms } from '../util'; 3 | 4 | const schema = { 5 | type: 'string', 6 | }; 7 | const uischema = { 8 | type: 'Label', 9 | text: 'My Label', 10 | }; 11 | 12 | describe('LabelRenderer.vue', () => { 13 | it('renders a label', () => { 14 | const wrapper = mountJsonForms('', schema, uischema); 15 | expect(wrapper.find('label').exists()).to.be.true; 16 | }); 17 | 18 | it('renders label text', () => { 19 | const wrapper = mountJsonForms('', schema, uischema); 20 | expect(wrapper.find('label').text()).to.equal('My Label'); 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /packages/vue-vanilla/tests/unit/layouts/CategorizationRenderer.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { mountJsonForms } from '../util'; 3 | 4 | const schema = { 5 | type: 'string', 6 | }; 7 | const uischema = { 8 | type: 'Categorization', 9 | elements: [ 10 | { 11 | type: 'Category', 12 | label: 'A', 13 | elements: [ 14 | { 15 | type: 'Control', 16 | scope: '#', 17 | }, 18 | ], 19 | }, 20 | { 21 | type: 'Category', 22 | label: 'B', 23 | elements: [], 24 | }, 25 | ], 26 | }; 27 | 28 | describe('CategorizationRenderer.vue', () => { 29 | it('renders categorization', () => { 30 | const wrapper = mountJsonForms('', schema, uischema); 31 | expect(wrapper.find('.categorization').exists()).to.be.true; 32 | }); 33 | 34 | it('renders 2 category items', async () => { 35 | const wrapper = mountJsonForms('', schema, uischema); 36 | const inputs = wrapper.findAll('.categorization-category > *'); 37 | expect(inputs.length).to.equal(2); 38 | }); 39 | 40 | it('renders 1 panel item', async () => { 41 | const wrapper = mountJsonForms('', schema, uischema); 42 | const inputs = wrapper.findAll('.categorization-panel > *'); 43 | expect(inputs.length).to.equal(1); 44 | }); 45 | }); 46 | -------------------------------------------------------------------------------- /packages/vue-vanilla/tests/unit/layouts/GroupRenderer.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { mountJsonForms } from '../util'; 3 | 4 | const schema = { 5 | type: 'string', 6 | }; 7 | const uischema = { 8 | type: 'Group', 9 | label: 'My Group', 10 | elements: [ 11 | { 12 | type: 'Control', 13 | scope: '#', 14 | }, 15 | { 16 | type: 'Control', 17 | scope: '#', 18 | }, 19 | ], 20 | }; 21 | 22 | describe('GroupRenderer.vue', () => { 23 | it('renders a fieldset', () => { 24 | const wrapper = mountJsonForms('', schema, uischema); 25 | expect(wrapper.find('fieldset').exists()).to.be.true; 26 | }); 27 | 28 | it('renders group label', () => { 29 | const wrapper = mountJsonForms('', schema, uischema); 30 | expect(wrapper.find('legend').text()).to.equal('My Group'); 31 | }); 32 | 33 | it('renders children', async () => { 34 | const wrapper = mountJsonForms('', schema, uischema); 35 | const inputs = wrapper.findAll('input'); 36 | expect(inputs.length).to.equal(2); 37 | }); 38 | }); 39 | -------------------------------------------------------------------------------- /packages/vue-vanilla/tests/unit/layouts/LayoutRenderer.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { mountJsonForms } from '../util'; 3 | 4 | const schema = { 5 | type: 'string', 6 | }; 7 | const vertical = { 8 | type: 'VerticalLayout', 9 | elements: [ 10 | { 11 | type: 'Control', 12 | scope: '#', 13 | }, 14 | { 15 | type: 'Control', 16 | scope: '#', 17 | }, 18 | ], 19 | }; 20 | const horizontal = { 21 | ...vertical, 22 | type: 'HorizontalLayout', 23 | }; 24 | 25 | describe('LayoutRenderer.vue', () => { 26 | it('renders a vertical container div', () => { 27 | const wrapper = mountJsonForms('', schema, vertical); 28 | expect(wrapper.find('.vertical-layout').exists()).to.be.true; 29 | }); 30 | 31 | it('renders an horizontal container div', () => { 32 | const wrapper = mountJsonForms('', schema, horizontal); 33 | expect(wrapper.find('.horizontal-layout').exists()).to.be.true; 34 | }); 35 | 36 | it('renders children', async () => { 37 | const wrapper = mountJsonForms('', schema, vertical); 38 | const inputs = wrapper.findAll('input'); 39 | expect(inputs.length).to.equal(2); 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /packages/vue-vanilla/tests/unit/util/TestComponent.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 38 | -------------------------------------------------------------------------------- /packages/vue-vanilla/tests/unit/util/index.ts: -------------------------------------------------------------------------------- 1 | export * from './util'; 2 | -------------------------------------------------------------------------------- /packages/vue-vanilla/tests/unit/util/util.ts: -------------------------------------------------------------------------------- 1 | import { mount } from '@vue/test-utils'; 2 | import TestComponent from './TestComponent.vue'; 3 | 4 | export const mountJsonForms = ( 5 | data: any, 6 | schema: any, 7 | uischema?: any, 8 | config?: any 9 | ) => { 10 | return mount(TestComponent, { 11 | props: { initialData: data, schema, uischema, config }, 12 | // Attach mounted component to document. Without this, some events are not triggered as expected. 13 | // E.g. a click on a checkbox input would not result in a change event. 14 | attachTo: document.body, 15 | }); 16 | }; 17 | -------------------------------------------------------------------------------- /packages/vue-vanilla/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2021", 4 | "module": "ES2020", 5 | "skipLibCheck": true, 6 | "strict": true, 7 | "declaration": true, 8 | "noUnusedLocals": true, 9 | "noUnusedParameters": true, 10 | "importHelpers": true, 11 | "moduleResolution": "node", 12 | "esModuleInterop": true, 13 | "allowSyntheticDefaultImports": true, 14 | "sourceMap": true, 15 | "outDir": "./lib", 16 | "types": ["node", "vue", "mocha", "chai"], 17 | "lib": ["ES2021", "dom", "dom.iterable", "scripthost"] 18 | }, 19 | "exclude": ["node_modules", "lib"] 20 | } 21 | -------------------------------------------------------------------------------- /packages/vue-vuetify/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | require('@rushstack/eslint-patch/modern-module-resolution'); 2 | 3 | module.exports = { 4 | root: true, 5 | env: { 6 | node: true, 7 | }, 8 | // There is no file include in ESLint. Thus, ignore all and include files via negative ignore (!) 9 | ignorePatterns: ['/*', '!/src', '!/tests', '!/example', '/example/dist'], 10 | extends: [ 11 | 'plugin:vue/vue3-essential', 12 | 'eslint:recommended', 13 | '@vue/eslint-config-typescript', 14 | '@vue/eslint-config-prettier/skip-formatting', 15 | 'plugin:vue-scoped-css/vue3-recommended', 16 | ], 17 | parserOptions: { 18 | ecmaVersion: 2020, 19 | }, 20 | rules: { 21 | 'no-console': 'warn', 22 | 'no-debugger': 'warn', 23 | '@typescript-eslint/no-explicit-any': 'off', 24 | '@typescript-eslint/explicit-function-return-type': 'off', 25 | '@typescript-eslint/explicit-module-boundary-types': 'off', 26 | }, 27 | }; 28 | -------------------------------------------------------------------------------- /packages/vue-vuetify/.prettierrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | $schema: 'http://json.schemastore.org/prettierrc', 3 | singleQuote: true, 4 | jsxSingleQuote: true, 5 | endOfLine: 'auto', 6 | }; 7 | -------------------------------------------------------------------------------- /packages/vue-vuetify/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2019 EclipseSource Munich 4 | https://github.com/eclipsesource/jsonforms 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /packages/vue-vuetify/dev/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipsesource/jsonforms/d0b1dfa4f91e911b8a8f37ead1fd04ad3ff3eafa/packages/vue-vuetify/dev/assets/logo.png -------------------------------------------------------------------------------- /packages/vue-vuetify/dev/assets/logo.svg: -------------------------------------------------------------------------------- 1 | Artboard 46 2 | -------------------------------------------------------------------------------- /packages/vue-vuetify/dev/core/jsonschema/index.ts: -------------------------------------------------------------------------------- 1 | import type { JsonSchema } from '@jsonforms/core'; 2 | import rule from './specification/rule.json'; 3 | import schema from './specification/schema.json'; 4 | import uischema from './specification/uischema.json'; 5 | 6 | export const jsonSchemaDraft7 = { 7 | uri: 'http://json-schema.org/draft-07/schema', 8 | schema: schema as any as JsonSchema, 9 | }; 10 | 11 | export const uiSchema = { 12 | uri: 'http://jsonforms.io/uischema', 13 | schema: uischema as JsonSchema, 14 | }; 15 | export const ruleSchema = { 16 | uri: 'http://jsonforms.io/uischema/rule', 17 | schema: rule as JsonSchema, 18 | }; 19 | -------------------------------------------------------------------------------- /packages/vue-vuetify/dev/core/monaco.ts: -------------------------------------------------------------------------------- 1 | import * as monaco from 'monaco-editor'; 2 | 3 | import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'; 4 | import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker'; 5 | 6 | self.MonacoEnvironment = { 7 | getWorker(_, label) { 8 | if (label === 'json') { 9 | return new jsonWorker(); 10 | } 11 | return new editorWorker(); 12 | }, 13 | }; 14 | 15 | export default monaco; 16 | export type MonacoApi = typeof monaco; 17 | -------------------------------------------------------------------------------- /packages/vue-vuetify/dev/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /packages/vue-vuetify/dev/examples/index.ts: -------------------------------------------------------------------------------- 1 | import { getExamples } from '../../../examples'; 2 | 3 | const examples = getExamples(); 4 | 5 | export default examples; 6 | -------------------------------------------------------------------------------- /packages/vue-vuetify/dev/icons/fa.ts: -------------------------------------------------------------------------------- 1 | import type { ExampleIconAliases } from './icons'; 2 | 3 | const aliases: ExampleIconAliases = { 4 | dark: 'fas fa-moon', 5 | light: 'fas fa-sun', 6 | ltr: 'fas fa-align-left', 7 | rtl: 'fas fa-align-right', 8 | palette: 'fas fa-palette', 9 | settings: 'fas fa-gear', 10 | formatText: 'fas fa-text', 11 | formOnly: 'fas fa-window-restore', 12 | reload: 'fas fa-rotate-right', 13 | save: 'fas fa-floppy-disk', 14 | }; 15 | 16 | export { aliases }; 17 | -------------------------------------------------------------------------------- /packages/vue-vuetify/dev/icons/icons.ts: -------------------------------------------------------------------------------- 1 | import type { IconValue } from '../../src/icons/icons'; 2 | 3 | export interface ExampleIconAliases { 4 | dark: IconValue; 5 | light: IconValue; 6 | ltr: IconValue; 7 | rtl: IconValue; 8 | palette: IconValue; 9 | settings: IconValue; 10 | formatText: IconValue; 11 | formOnly: IconValue; 12 | reload: IconValue; 13 | save: IconValue; 14 | } 15 | -------------------------------------------------------------------------------- /packages/vue-vuetify/dev/icons/mdi.ts: -------------------------------------------------------------------------------- 1 | import type { ExampleIconAliases } from './icons'; 2 | 3 | const aliases: ExampleIconAliases = { 4 | dark: 'mdi-weather-night', 5 | light: 'mdi-weather-sunny', 6 | ltr: 'mdi-format-pilcrow-arrow-right', 7 | rtl: 'mdi-format-pilcrow-arrow-left', 8 | palette: 'mdi-palette', 9 | settings: 'mdi-cog', 10 | formatText: 'mdi-format-text', 11 | formOnly: 'mdi-dock-window', 12 | reload: 'mdi-reload', 13 | save: 'mdi-content-save', 14 | }; 15 | 16 | export { aliases }; 17 | -------------------------------------------------------------------------------- /packages/vue-vuetify/dev/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue'; 2 | import App from './App.vue'; 3 | import buildVuetify from './plugins/vuetify'; 4 | 5 | createApp(App).use(buildVuetify()).mount('#app'); 6 | -------------------------------------------------------------------------------- /packages/vue-vuetify/dev/validate/index.ts: -------------------------------------------------------------------------------- 1 | import type { Options } from 'ajv'; 2 | import { markRaw } from 'vue'; 3 | import { createAjv as createDefaultAjv } from '../../src'; 4 | import { ajvKeywords } from './keywords'; 5 | 6 | export const createAjv = () => { 7 | const options: Options = { 8 | useDefaults: true, 9 | $data: true, 10 | discriminator: true, 11 | }; 12 | 13 | const ajv = createDefaultAjv(options); 14 | ajvKeywords(ajv); 15 | 16 | // when ajv is used in component properties do not make it reactive 17 | return markRaw(ajv); 18 | }; 19 | -------------------------------------------------------------------------------- /packages/vue-vuetify/dev/validate/keywords.ts: -------------------------------------------------------------------------------- 1 | import type Ajv from 'ajv'; 2 | import keywords from 'ajv-keywords'; 3 | import dynamicDefaults from 'ajv-keywords/dist/definitions/dynamicDefaults'; 4 | import tranform from './transform'; 5 | 6 | import { 7 | dateOffset, 8 | datetimeOffset, 9 | dateUnit, 10 | dynamic, 11 | searchParams, 12 | timeOffset, 13 | } from './dynamicDefaults'; 14 | 15 | export const ajvKeywords = (ajv: Ajv) => { 16 | keywords(ajv); 17 | 18 | // add custom transform to be able to use more transformation functions since the transform keyword is not extensible as the dynamicDefaults 19 | ajv.removeKeyword('transform'); 20 | ajv.addKeyword(tranform()); 21 | 22 | // register new dynamic defaults 23 | (dynamicDefaults.DEFAULTS as any).dynamic = dynamic; 24 | (dynamicDefaults.DEFAULTS as any).searchParams = searchParams; 25 | (dynamicDefaults.DEFAULTS as any).datetime = datetimeOffset; 26 | (dynamicDefaults.DEFAULTS as any).date = dateOffset; 27 | (dynamicDefaults.DEFAULTS as any).time = timeOffset; 28 | 29 | (dynamicDefaults.DEFAULTS as any).dateUnit = dateUnit; 30 | }; 31 | -------------------------------------------------------------------------------- /packages/vue-vuetify/dev/views/HomeView.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 28 | -------------------------------------------------------------------------------- /packages/vue-vuetify/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | JSON Forms Vue 3 Vuetify 12 | 13 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/additional/LabelRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | rankWith, 3 | uiTypeIs, 4 | type JsonFormsRendererRegistryEntry, 5 | } from '@jsonforms/core'; 6 | import labelRenderer from './LabelRenderer.vue'; 7 | 8 | export const entry: JsonFormsRendererRegistryEntry = { 9 | renderer: labelRenderer, 10 | tester: rankWith(1, uiTypeIs('Label')), 11 | }; 12 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/additional/LabelRenderer.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 37 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/additional/ListWithDetailRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | and, 3 | isObjectArray, 4 | rankWith, 5 | uiTypeIs, 6 | type JsonFormsRendererRegistryEntry, 7 | } from '@jsonforms/core'; 8 | import controlRenderer from './ListWithDetailRenderer.vue'; 9 | 10 | export const entry: JsonFormsRendererRegistryEntry = { 11 | renderer: controlRenderer, 12 | tester: rankWith(4, and(uiTypeIs('ListWithDetail'), isObjectArray)), 13 | }; 14 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/additional/index.ts: -------------------------------------------------------------------------------- 1 | export { default as LabelRenderer } from './LabelRenderer.vue'; 2 | export { default as ListWithDetailRenderer } from './ListWithDetailRenderer.vue'; 3 | 4 | import { entry as labelRendererEntry } from './LabelRenderer.entry'; 5 | import { entry as listWithDetailRendererEntry } from './ListWithDetailRenderer.entry'; 6 | 7 | export const additionalRenderers = [ 8 | labelRendererEntry, 9 | listWithDetailRendererEntry, 10 | ]; 11 | 12 | export { labelRendererEntry, listWithDetailRendererEntry }; 13 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/array/index.ts: -------------------------------------------------------------------------------- 1 | import { 2 | rankWith, 3 | schemaTypeIs, 4 | type JsonFormsRendererRegistryEntry, 5 | } from '@jsonforms/core'; 6 | import { ArrayLayoutRenderer } from '../layouts'; 7 | 8 | export const arrayListRendererEntry: JsonFormsRendererRegistryEntry = { 9 | renderer: ArrayLayoutRenderer, 10 | tester: rankWith(2, schemaTypeIs('array')), 11 | }; 12 | 13 | export const arrayRenderers = [arrayListRendererEntry]; 14 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/complex/AllOfRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | isAllOfControl, 3 | rankWith, 4 | type JsonFormsRendererRegistryEntry, 5 | } from '@jsonforms/core'; 6 | import controlRenderer from './AllOfRenderer.vue'; 7 | 8 | export const entry: JsonFormsRendererRegistryEntry = { 9 | renderer: controlRenderer, 10 | tester: rankWith(3, isAllOfControl), 11 | }; 12 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/complex/AnyOfRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | isAnyOfControl, 3 | rankWith, 4 | type JsonFormsRendererRegistryEntry, 5 | } from '@jsonforms/core'; 6 | import controlRenderer from './AnyOfRenderer.vue'; 7 | 8 | export const entry: JsonFormsRendererRegistryEntry = { 9 | renderer: controlRenderer, 10 | tester: rankWith(3, isAnyOfControl), 11 | }; 12 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/complex/ArrayControlRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | isObjectArrayControl, 3 | isPrimitiveArrayControl, 4 | or, 5 | rankWith, 6 | type JsonFormsRendererRegistryEntry, 7 | } from '@jsonforms/core'; 8 | import controlRenderer from './ArrayControlRenderer.vue'; 9 | 10 | export const entry: JsonFormsRendererRegistryEntry = { 11 | renderer: controlRenderer, 12 | tester: rankWith(3, or(isObjectArrayControl, isPrimitiveArrayControl)), 13 | }; 14 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/complex/EnumArrayRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | and, 3 | hasType, 4 | rankWith, 5 | schemaMatches, 6 | schemaSubPathMatches, 7 | uiTypeIs, 8 | type JsonFormsRendererRegistryEntry, 9 | type JsonSchema, 10 | } from '@jsonforms/core'; 11 | import controlRenderer from './EnumArrayRenderer.vue'; 12 | 13 | export const entry: JsonFormsRendererRegistryEntry = { 14 | renderer: controlRenderer, 15 | tester: rankWith( 16 | 5, 17 | and( 18 | uiTypeIs('Control'), 19 | and( 20 | schemaMatches( 21 | (schema) => 22 | hasType(schema, 'array') && 23 | !Array.isArray(schema.items) && 24 | schema.uniqueItems === true, 25 | ), 26 | schemaSubPathMatches('items', (schema) => { 27 | return hasOneOfItems(schema) || hasEnumItems(schema); 28 | }), 29 | ), 30 | ), 31 | ), 32 | }; 33 | 34 | const hasOneOfItems = (schema: JsonSchema): boolean => 35 | schema.oneOf !== undefined && 36 | schema.oneOf.length > 0 && 37 | (schema.oneOf as JsonSchema[]).every((entry: JsonSchema) => { 38 | return entry.const !== undefined; 39 | }); 40 | 41 | const hasEnumItems = (schema: JsonSchema): boolean => 42 | schema.type === 'string' && schema.enum !== undefined; 43 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/complex/ObjectRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | isObjectControl, 3 | rankWith, 4 | type JsonFormsRendererRegistryEntry, 5 | } from '@jsonforms/core'; 6 | import controlRenderer from './ObjectRenderer.vue'; 7 | 8 | export const entry: JsonFormsRendererRegistryEntry = { 9 | renderer: controlRenderer, 10 | tester: rankWith(2, isObjectControl), 11 | }; 12 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/complex/OneOfRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | isOneOfControl, 3 | rankWith, 4 | type JsonFormsRendererRegistryEntry, 5 | } from '@jsonforms/core'; 6 | import controlRenderer from './OneOfRenderer.vue'; 7 | 8 | export const entry: JsonFormsRendererRegistryEntry = { 9 | renderer: controlRenderer, 10 | tester: rankWith(3, isOneOfControl), 11 | }; 12 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/complex/OneOfTabRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | and, 3 | isOneOfControl, 4 | optionIs, 5 | rankWith, 6 | type JsonFormsRendererRegistryEntry, 7 | } from '@jsonforms/core'; 8 | import controlRenderer from './OneOfTabRenderer.vue'; 9 | 10 | export const entry: JsonFormsRendererRegistryEntry = { 11 | renderer: controlRenderer, 12 | tester: rankWith(4, and(isOneOfControl, optionIs('variant', 'tab'))), 13 | }; 14 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/complex/components/index.ts: -------------------------------------------------------------------------------- 1 | export { default as AdditionalProperties } from './AdditionalProperties.vue'; 2 | export { default as CombinatorProperties } from './CombinatorProperties.vue'; 3 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/controls/AnyOfStringOrEnumControlRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | and, 3 | rankWith, 4 | schemaMatches, 5 | uiTypeIs, 6 | type JsonFormsRendererRegistryEntry, 7 | type JsonSchema, 8 | } from '@jsonforms/core'; 9 | import controlRenderer from './AnyOfStringOrEnumControlRenderer.vue'; 10 | 11 | const findEnumSchema = (schemas: JsonSchema[]) => 12 | schemas.find( 13 | (s) => 14 | s.enum !== undefined && (s.type === 'string' || s.type === undefined), 15 | ); 16 | const findTextSchema = (schemas: JsonSchema[]) => 17 | schemas.find((s) => s.type === 'string' && s.enum === undefined); 18 | 19 | const hasEnumAndText = (schemas: JsonSchema[]): boolean => { 20 | // idea: map to type,enum and check that all types are string and at least one item is of type enum, 21 | const enumSchema = findEnumSchema(schemas); 22 | const stringSchema = findTextSchema(schemas); 23 | const remainingSchemas = schemas.filter( 24 | (s) => s !== enumSchema || s !== stringSchema, 25 | ); 26 | const wrongType = remainingSchemas.find((s) => s.type && s.type !== 'string'); 27 | return !!enumSchema && !!stringSchema && !wrongType; 28 | }; 29 | 30 | const simpleAnyOf = and( 31 | uiTypeIs('Control'), 32 | schemaMatches( 33 | (schema) => Array.isArray(schema.anyOf) && hasEnumAndText(schema.anyOf), 34 | ), 35 | ); 36 | 37 | export const entry: JsonFormsRendererRegistryEntry = { 38 | renderer: controlRenderer, 39 | tester: rankWith(5, simpleAnyOf), 40 | }; 41 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/controls/BooleanControlRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | type JsonFormsRendererRegistryEntry, 3 | rankWith, 4 | isBooleanControl, 5 | } from '@jsonforms/core'; 6 | import controlRenderer from './BooleanControlRenderer.vue'; 7 | 8 | export const entry: JsonFormsRendererRegistryEntry = { 9 | renderer: controlRenderer, 10 | tester: rankWith(1, isBooleanControl), 11 | }; 12 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/controls/BooleanToggleControlRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | type JsonFormsRendererRegistryEntry, 3 | rankWith, 4 | and, 5 | isBooleanControl, 6 | optionIs, 7 | } from '@jsonforms/core'; 8 | import controlRenderer from './BooleanToggleControlRenderer.vue'; 9 | 10 | export const entry: JsonFormsRendererRegistryEntry = { 11 | renderer: controlRenderer, 12 | tester: rankWith(3, and(isBooleanControl, optionIs('toggle', true))), 13 | }; 14 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/controls/ControlWrapper.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 30 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/controls/DateControlRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | type JsonFormsRendererRegistryEntry, 3 | rankWith, 4 | isDateControl, 5 | } from '@jsonforms/core'; 6 | import controlRenderer from './DateControlRenderer.vue'; 7 | 8 | export const entry: JsonFormsRendererRegistryEntry = { 9 | renderer: controlRenderer, 10 | tester: rankWith(2, isDateControl), 11 | }; 12 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/controls/DateTimeControlRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | type JsonFormsRendererRegistryEntry, 3 | rankWith, 4 | isDateTimeControl, 5 | } from '@jsonforms/core'; 6 | import controlRenderer from './DateTimeControlRenderer.vue'; 7 | 8 | export const entry: JsonFormsRendererRegistryEntry = { 9 | renderer: controlRenderer, 10 | tester: rankWith(2, isDateTimeControl), 11 | }; 12 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/controls/EnumControlRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | type JsonFormsRendererRegistryEntry, 3 | rankWith, 4 | isEnumControl, 5 | } from '@jsonforms/core'; 6 | import controlRenderer from './EnumControlRenderer.vue'; 7 | 8 | export const entry: JsonFormsRendererRegistryEntry = { 9 | renderer: controlRenderer, 10 | tester: rankWith(2, isEnumControl), 11 | }; 12 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/controls/IntegerControlRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | type JsonFormsRendererRegistryEntry, 3 | rankWith, 4 | isIntegerControl, 5 | } from '@jsonforms/core'; 6 | import controlRenderer from './IntegerControlRenderer.vue'; 7 | 8 | export const entry: JsonFormsRendererRegistryEntry = { 9 | renderer: controlRenderer, 10 | tester: rankWith(1, isIntegerControl), 11 | }; 12 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/controls/MultiStringControlRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | type JsonFormsRendererRegistryEntry, 3 | rankWith, 4 | and, 5 | isStringControl, 6 | isMultiLineControl, 7 | } from '@jsonforms/core'; 8 | import controlRenderer from './MultiStringControlRenderer.vue'; 9 | 10 | export const entry: JsonFormsRendererRegistryEntry = { 11 | renderer: controlRenderer, 12 | tester: rankWith(2, and(isStringControl, isMultiLineControl)), 13 | }; 14 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/controls/NumberControlRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | type JsonFormsRendererRegistryEntry, 3 | rankWith, 4 | isNumberControl, 5 | } from '@jsonforms/core'; 6 | import controlRenderer from './NumberControlRenderer.vue'; 7 | 8 | export const entry: JsonFormsRendererRegistryEntry = { 9 | renderer: controlRenderer, 10 | tester: rankWith(1, isNumberControl), 11 | }; 12 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/controls/OneOfEnumControlRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | type JsonFormsRendererRegistryEntry, 3 | rankWith, 4 | isOneOfEnumControl, 5 | } from '@jsonforms/core'; 6 | import controlRenderer from './OneOfEnumControlRenderer.vue'; 7 | 8 | export const entry: JsonFormsRendererRegistryEntry = { 9 | renderer: controlRenderer, 10 | tester: rankWith(5, isOneOfEnumControl), 11 | }; 12 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/controls/OneOfRadioGroupControlRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | type JsonFormsRendererRegistryEntry, 3 | rankWith, 4 | and, 5 | isOneOfEnumControl, 6 | optionIs, 7 | } from '@jsonforms/core'; 8 | import controlRenderer from './OneOfRadioGroupControlRenderer.vue'; 9 | 10 | export const entry: JsonFormsRendererRegistryEntry = { 11 | renderer: controlRenderer, 12 | tester: rankWith(20, and(isOneOfEnumControl, optionIs('format', 'radio'))), 13 | }; 14 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/controls/PasswordControlRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | type JsonFormsRendererRegistryEntry, 3 | rankWith, 4 | and, 5 | isStringControl, 6 | formatIs, 7 | } from '@jsonforms/core'; 8 | import controlRenderer from './PasswordControlRenderer.vue'; 9 | 10 | export const entry: JsonFormsRendererRegistryEntry = { 11 | renderer: controlRenderer, 12 | tester: rankWith(2, and(isStringControl, formatIs('password'))), 13 | }; 14 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/controls/RadioGroupControlRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | type JsonFormsRendererRegistryEntry, 3 | rankWith, 4 | and, 5 | isEnumControl, 6 | optionIs, 7 | } from '@jsonforms/core'; 8 | import controlRenderer from './RadioGroupControlRenderer.vue'; 9 | 10 | export const entry: JsonFormsRendererRegistryEntry = { 11 | renderer: controlRenderer, 12 | tester: rankWith(20, and(isEnumControl, optionIs('format', 'radio'))), 13 | }; 14 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/controls/SliderControlRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | type JsonFormsRendererRegistryEntry, 3 | rankWith, 4 | isRangeControl, 5 | } from '@jsonforms/core'; 6 | import controlRenderer from './SliderControlRenderer.vue'; 7 | 8 | export const entry: JsonFormsRendererRegistryEntry = { 9 | renderer: controlRenderer, 10 | tester: rankWith(4, isRangeControl), 11 | }; 12 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/controls/StringControlRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | isStringControl, 3 | rankWith, 4 | type JsonFormsRendererRegistryEntry, 5 | } from '@jsonforms/core'; 6 | import controlRenderer from './StringControlRenderer.vue'; 7 | export const entry: JsonFormsRendererRegistryEntry = { 8 | renderer: controlRenderer, 9 | tester: rankWith(1, isStringControl), 10 | }; 11 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/controls/StringMaskControlRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | type JsonFormsRendererRegistryEntry, 3 | rankWith, 4 | and, 5 | isStringControl, 6 | hasOption, 7 | } from '@jsonforms/core'; 8 | import controlRenderer from './StringMaskControlRenderer.vue'; 9 | 10 | export const entry: JsonFormsRendererRegistryEntry = { 11 | renderer: controlRenderer, 12 | tester: rankWith(2, and(isStringControl, hasOption('mask'))), 13 | }; 14 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/controls/TimeControlRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | type JsonFormsRendererRegistryEntry, 3 | rankWith, 4 | isTimeControl, 5 | } from '@jsonforms/core'; 6 | import controlRenderer from './TimeControlRenderer.vue'; 7 | 8 | export const entry: JsonFormsRendererRegistryEntry = { 9 | renderer: controlRenderer, 10 | tester: rankWith(2, isTimeControl), 11 | }; 12 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/controls/components/ValidationIcon.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 37 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/controls/components/index.ts: -------------------------------------------------------------------------------- 1 | export { default as ValidationBadge } from './ValidationBadge.vue'; 2 | export { default as ValidationIcon } from './ValidationIcon.vue'; 3 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/controls/directives/DisabledIconFocus.ts: -------------------------------------------------------------------------------- 1 | export const DisabledIconFocus = { 2 | updated(el: HTMLElement): void { 3 | el.querySelectorAll('.v-field__clearable i').forEach((x) => 4 | x.setAttribute('tabindex', '-1'), 5 | ); 6 | }, 7 | }; 8 | 9 | export default DisabledIconFocus; 10 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/controls/directives/index.ts: -------------------------------------------------------------------------------- 1 | export { default as DisabledIconFocus } from './DisabledIconFocus'; 2 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/extended/AutocompleteEnumControlRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | isEnumControl, 3 | rankWith, 4 | type JsonFormsRendererRegistryEntry, 5 | } from '@jsonforms/core'; 6 | import controlRenderer from './AutocompleteEnumControlRenderer.vue'; 7 | 8 | export const entry: JsonFormsRendererRegistryEntry = { 9 | renderer: controlRenderer, 10 | tester: rankWith(10, isEnumControl), 11 | }; 12 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/extended/AutocompleteOneOfEnumControlRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | isOneOfEnumControl, 3 | rankWith, 4 | type JsonFormsRendererRegistryEntry, 5 | } from '@jsonforms/core'; 6 | import controlRenderer from './AutocompleteOneOfEnumControlRenderer.vue'; 7 | 8 | export const entry: JsonFormsRendererRegistryEntry = { 9 | renderer: controlRenderer, 10 | tester: rankWith(10, isOneOfEnumControl), 11 | }; 12 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/extended/index.ts: -------------------------------------------------------------------------------- 1 | export { default as AutocompleteEnumControlRenderer } from './AutocompleteEnumControlRenderer.vue'; 2 | export { default as AutocompleteOneOfEnumControlRenderer } from './AutocompleteOneOfEnumControlRenderer.vue'; 3 | 4 | import { entry as autocompleteEnumControlRendererEntry } from './AutocompleteEnumControlRenderer.entry'; 5 | import { entry as autocompleteOneOfEnumControlRendererEntry } from './AutocompleteOneOfEnumControlRenderer.entry'; 6 | 7 | export const extendedRenderers = [ 8 | autocompleteEnumControlRendererEntry, 9 | autocompleteOneOfEnumControlRendererEntry, 10 | ]; 11 | 12 | export { 13 | autocompleteEnumControlRendererEntry, 14 | autocompleteOneOfEnumControlRendererEntry, 15 | }; 16 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/i18n/i18nUtil.ts: -------------------------------------------------------------------------------- 1 | import { computed, type Ref } from 'vue'; 2 | import { 3 | AdditionalPropertiesTranslationEnum, 4 | type AdditionalPropertiesDefaultTranslation, 5 | type AdditionalPropertiesTranslations, 6 | } from './additionalPropertiesTranslations'; 7 | import { addI18nKeyToPrefix, type Translator } from '@jsonforms/core'; 8 | 9 | export const getAdditionalPropertiesTranslations = ( 10 | t: Translator, 11 | defaultTranslations: AdditionalPropertiesDefaultTranslation[], 12 | i18nKeyPrefix: string, 13 | label: string, 14 | propertyName: Ref, 15 | ): AdditionalPropertiesTranslations => { 16 | const translations: AdditionalPropertiesTranslations = {}; 17 | defaultTranslations.forEach((controlElement) => { 18 | const key = addI18nKeyToPrefix(i18nKeyPrefix, controlElement.key); 19 | 20 | if ( 21 | controlElement.key == 22 | AdditionalPropertiesTranslationEnum.propertyAlreadyDefined 23 | ) { 24 | translations[controlElement.key] = computed(() => 25 | t(key, controlElement.default(propertyName.value), propertyName.value), 26 | ); 27 | } else if ( 28 | controlElement.key == 29 | AdditionalPropertiesTranslationEnum.propertyNameInvalid 30 | ) { 31 | translations[controlElement.key] = computed(() => 32 | t(key, controlElement.default(propertyName.value), propertyName.value), 33 | ); 34 | } else { 35 | translations[controlElement.key] = t( 36 | key, 37 | controlElement.default(label), 38 | label, 39 | ); 40 | } 41 | }); 42 | return translations; 43 | }; 44 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/i18n/index.ts: -------------------------------------------------------------------------------- 1 | export * from './additionalPropertiesTranslations'; 2 | export * from './i18nUtil'; 3 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/icons/fa.ts: -------------------------------------------------------------------------------- 1 | import type { IconAliases } from './icons'; 2 | 3 | const aliases: IconAliases = { 4 | itemAdd: 'fas fa-plus', 5 | itemMoveUp: 'fas fa-arrow-up', 6 | itemMoveDown: 'fas fa-arrow-down', 7 | itemDelete: 'fas fa-trash', 8 | calendarClock: 'fas fa-calendar', 9 | clock: 'far fa-clock', 10 | passwordHide: 'far fa-eye-slash', 11 | passwordShow: 'far fa-eye', 12 | validationError: 'fas fa-circle-exclamation', 13 | }; 14 | 15 | export { aliases }; 16 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/icons/icons.ts: -------------------------------------------------------------------------------- 1 | import type { ComponentPublicInstance, FunctionalComponent } from 'vue'; 2 | 3 | export type JSXComponent = 4 | | { new (): ComponentPublicInstance } 5 | | FunctionalComponent; 6 | export type IconValue = 7 | | string 8 | | (string | [path: string, opacity: number])[] 9 | | JSXComponent; 10 | 11 | export interface IconAliases { 12 | itemAdd: IconValue; 13 | itemMoveUp: IconValue; 14 | itemMoveDown: IconValue; 15 | itemDelete: IconValue; 16 | calendarClock: IconValue; 17 | clock: IconValue; 18 | passwordHide: IconValue; 19 | passwordShow: IconValue; 20 | validationError: IconValue; 21 | } 22 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/icons/index.ts: -------------------------------------------------------------------------------- 1 | export { aliases as faIconAliases } from './fa'; 2 | export * from './icons'; 3 | export { aliases as mdiIconAliases } from './mdi'; 4 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/icons/mdi.ts: -------------------------------------------------------------------------------- 1 | import type { IconAliases } from './icons'; 2 | 3 | const aliases: IconAliases = { 4 | itemAdd: 'mdi-plus', 5 | itemMoveUp: 'mdi-arrow-up', 6 | itemMoveDown: 'mdi-arrow-down', 7 | itemDelete: 'mdi-delete', 8 | calendarClock: 'mdi-calendar-clock', 9 | clock: 'mdi-clock-outline', 10 | passwordHide: 'mdi-eye-off', 11 | passwordShow: 'mdi-eye', 12 | validationError: 'mdi-alert-circle-outline', 13 | }; 14 | 15 | export { aliases }; 16 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './additional'; 2 | export * from './array'; 3 | export * from './complex'; 4 | export * from './controls'; 5 | export * from './extended'; 6 | export * from './i18n'; 7 | export * from './icons'; 8 | export * from './layouts'; 9 | export * from './renderers'; 10 | export * from './styles'; 11 | export * from './util'; 12 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/layouts/ArrayLayoutRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | isObjectArrayWithNesting, 3 | rankWith, 4 | type JsonFormsRendererRegistryEntry, 5 | } from '@jsonforms/core'; 6 | import controlRenderer from './ArrayLayoutRenderer.vue'; 7 | 8 | export const entry: JsonFormsRendererRegistryEntry = { 9 | renderer: controlRenderer, 10 | tester: rankWith(4, isObjectArrayWithNesting), 11 | }; 12 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/layouts/CategorizationRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | and, 3 | categorizationHasCategory, 4 | isCategorization, 5 | rankWith, 6 | type JsonFormsRendererRegistryEntry, 7 | } from '@jsonforms/core'; 8 | import layoutRenderer from './CategorizationRenderer.vue'; 9 | 10 | export const entry: JsonFormsRendererRegistryEntry = { 11 | renderer: layoutRenderer, 12 | tester: rankWith(2, and(isCategorization, categorizationHasCategory)), 13 | }; 14 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/layouts/CategorizationStepperRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | and, 3 | categorizationHasCategory, 4 | isCategorization, 5 | optionIs, 6 | rankWith, 7 | type JsonFormsRendererRegistryEntry, 8 | } from '@jsonforms/core'; 9 | import layoutRenderer from './CategorizationStepperRenderer.vue'; 10 | 11 | export const entry: JsonFormsRendererRegistryEntry = { 12 | renderer: layoutRenderer, 13 | tester: rankWith( 14 | 3, 15 | and( 16 | isCategorization, 17 | categorizationHasCategory, 18 | optionIs('variant', 'stepper'), 19 | ), 20 | ), 21 | }; 22 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/layouts/GroupRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | type JsonFormsRendererRegistryEntry, 3 | rankWith, 4 | and, 5 | isLayout, 6 | uiTypeIs, 7 | } from '@jsonforms/core'; 8 | import layoutRenderer from './GroupRenderer.vue'; 9 | 10 | export const entry: JsonFormsRendererRegistryEntry = { 11 | renderer: layoutRenderer, 12 | tester: rankWith(2, and(isLayout, uiTypeIs('Group'))), 13 | }; 14 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/layouts/HorizontalLayoutRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | rankWith, 3 | uiTypeIs, 4 | type JsonFormsRendererRegistryEntry, 5 | } from '@jsonforms/core'; 6 | import layoutRenderer from './HorizontalLayoutRenderer.vue'; 7 | 8 | export const entry: JsonFormsRendererRegistryEntry = { 9 | renderer: layoutRenderer, 10 | tester: rankWith(2, uiTypeIs('HorizontalLayout')), 11 | }; 12 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/layouts/VerticalLayoutRenderer.entry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | rankWith, 3 | uiTypeIs, 4 | type JsonFormsRendererRegistryEntry, 5 | } from '@jsonforms/core'; 6 | import layoutRenderer from './VerticalLayoutRenderer.vue'; 7 | 8 | export const entry: JsonFormsRendererRegistryEntry = { 9 | renderer: layoutRenderer, 10 | tester: rankWith(2, uiTypeIs('VerticalLayout')), 11 | }; 12 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/renderers.ts: -------------------------------------------------------------------------------- 1 | import { additionalRenderers } from './additional'; 2 | import { arrayRenderers } from './array'; 3 | import { complexRenderers } from './complex'; 4 | import { controlRenderers } from './controls'; 5 | import { extendedRenderers } from './extended'; 6 | import { layoutRenderers } from './layouts'; 7 | 8 | export const vuetifyRenderers = [ 9 | ...additionalRenderers, 10 | ...arrayRenderers, 11 | ...complexRenderers, 12 | ...controlRenderers, 13 | ...layoutRenderers, 14 | ]; 15 | 16 | export const extendedVuetifyRenderers = [ 17 | ...extendedRenderers, 18 | ...vuetifyRenderers, 19 | ]; 20 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/styles/index.ts: -------------------------------------------------------------------------------- 1 | export * from './defaultStyles'; 2 | export * from './styles'; 3 | export * from './util'; 4 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/styles/util.ts: -------------------------------------------------------------------------------- 1 | import cloneDeep from 'lodash/cloneDeep'; 2 | import mergeWith from 'lodash/mergeWith'; 3 | import type { Styles } from './styles'; 4 | 5 | export const classes = ( 6 | strings: TemplateStringsArray, 7 | ...variables: any[] 8 | ): string => { 9 | return strings 10 | .reduce((acc, curr, index) => { 11 | return `${acc}${curr}${variables[index] || ''}`; 12 | }, '') 13 | .trim(); 14 | }; 15 | 16 | /** 17 | * Helper function to merge two styles definitions. The contained classes will be combined, not overwritten. 18 | * 19 | * Example usage: 20 | * ```ts 21 | * const myStyles = mergeStyles(defaultStyles, { control: { root: 'mycontrol' } }); 22 | * ``` 23 | */ 24 | export const mergeStyles = ( 25 | stylesA: Partial, 26 | stylesB: Partial, 27 | ): Partial => { 28 | const styles = cloneDeep(stylesA); 29 | mergeWith(styles, stylesB, (aValue, bValue) => { 30 | if (typeof aValue === 'string' && typeof bValue === 'string') { 31 | return `${aValue} ${bValue}`; 32 | } 33 | return undefined; 34 | }); 35 | return styles; 36 | }; 37 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/util/index.ts: -------------------------------------------------------------------------------- 1 | export * from './composition'; 2 | export * from './datejs'; 3 | export * from './inject'; 4 | export * from './options'; 5 | export * from './validator'; 6 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/util/inject.ts: -------------------------------------------------------------------------------- 1 | import type { InjectionKey } from 'vue'; 2 | 3 | export const IsDynamicPropertyContext: InjectionKey = Symbol.for( 4 | 'jsonforms-vue-vuetify:IsDynamicPropertyContext', 5 | ); 6 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/util/options.ts: -------------------------------------------------------------------------------- 1 | export interface Options { 2 | showUnfocusedDescription?: boolean; 3 | hideRequiredAsterisk?: boolean; 4 | focus?: boolean; 5 | step?: number; 6 | } 7 | -------------------------------------------------------------------------------- /packages/vue-vuetify/src/util/validator.ts: -------------------------------------------------------------------------------- 1 | import { createAjv as createAjvCore } from '@jsonforms/core'; 2 | import type Ajv from 'ajv'; 3 | import { type Options } from 'ajv'; 4 | 5 | export const createAjv = (options?: Options): Ajv => { 6 | const ajv = createAjvCore(options); 7 | ajv.addFormat('password', () => true); 8 | return ajv; 9 | }; 10 | -------------------------------------------------------------------------------- /packages/vue-vuetify/tests/index.ts: -------------------------------------------------------------------------------- 1 | export const wait = (timeout?: number) => { 2 | return new Promise((resolve) => setTimeout(resolve, timeout)); 3 | }; 4 | -------------------------------------------------------------------------------- /packages/vue-vuetify/tests/unit/additional/LabelRenderer.spec.ts: -------------------------------------------------------------------------------- 1 | import { describe, it, expect, beforeEach } from 'vitest'; 2 | import { clearAllIds } from '@jsonforms/core'; 3 | import LabelRenderer from '../../../src/additional/LabelRenderer.vue'; 4 | import { entry as labelRendererEntry } from '../../../src/additional/LabelRenderer.entry'; 5 | import { mountJsonForms } from '../util'; 6 | 7 | describe('LabelRenderer.vue', () => { 8 | const renderers = [labelRendererEntry]; 9 | 10 | const data = ''; 11 | const schema = { 12 | type: 'string', 13 | }; 14 | const uischema = { 15 | type: 'Label', 16 | text: 'My Label', 17 | }; 18 | 19 | let wrapper: ReturnType; 20 | 21 | beforeEach(() => { 22 | // clear all ids to guarantee that the snapshots will always be generated with the same ids 23 | clearAllIds(); 24 | wrapper = mountJsonForms(data, schema, renderers, uischema); 25 | }); 26 | 27 | it('check if child LabelRenderer exists', () => { 28 | expect(wrapper.getComponent(LabelRenderer)); 29 | }); 30 | 31 | it('renders a label', () => { 32 | expect(wrapper.find('label').exists()).toBe(true); 33 | }); 34 | 35 | it('renders label text', () => { 36 | expect(wrapper.find('label').text()).toEqual('My Label'); 37 | }); 38 | 39 | it('should render component and match snapshot', () => { 40 | expect(wrapper.html()).toMatchSnapshot(); 41 | }); 42 | }); 43 | -------------------------------------------------------------------------------- /packages/vue-vuetify/tests/unit/additional/__snapshots__/LabelRenderer.spec.ts.snap: -------------------------------------------------------------------------------- 1 | // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html 2 | 3 | exports[`LabelRenderer.vue > should render component and match snapshot 1`] = ` 4 | "
5 |
8 |
" 9 | `; 10 | -------------------------------------------------------------------------------- /packages/vue-vuetify/tests/unit/util/index.ts: -------------------------------------------------------------------------------- 1 | export * from './util'; 2 | -------------------------------------------------------------------------------- /packages/vue-vuetify/tests/unit/util/util.ts: -------------------------------------------------------------------------------- 1 | import type { 2 | JsonFormsI18nState, 3 | JsonFormsRendererRegistryEntry, 4 | JsonSchema, 5 | UISchemaElement, 6 | } from '@jsonforms/core'; 7 | import { mount } from '@vue/test-utils'; 8 | import TestComponent from './TestComponent.vue'; 9 | import { createVuetify } from 'vuetify'; 10 | import * as components from 'vuetify/components'; 11 | import * as directives from 'vuetify/directives'; 12 | import { markRaw } from 'vue'; 13 | 14 | const vuetify = createVuetify({ 15 | components, 16 | directives, 17 | }); 18 | 19 | global.ResizeObserver = require('resize-observer-polyfill'); 20 | 21 | export const mountJsonForms = ( 22 | data: any, 23 | schema: JsonSchema, 24 | renderers: JsonFormsRendererRegistryEntry[], 25 | uischema?: UISchemaElement, 26 | config?: any, 27 | i18n?: JsonFormsI18nState, 28 | ) => { 29 | return mount(TestComponent, { 30 | global: { 31 | plugins: [vuetify], 32 | }, 33 | propsData: { 34 | data: data, 35 | schema, 36 | uischema, 37 | config, 38 | renderers: markRaw(renderers), 39 | i18n, 40 | }, 41 | attachTo: document.body, 42 | }); 43 | }; 44 | -------------------------------------------------------------------------------- /packages/vue-vuetify/tsconfig.example.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@vue/tsconfig/tsconfig.dom.json", 3 | "include": ["dev/env.d.ts", "dev/**/*", "src/**/*", "src/**/*.vue"], 4 | "exclude": ["src/**/__tests__/*", "dev/**/__tests__/*"], 5 | "compilerOptions": { 6 | "composite": true, 7 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", 8 | "baseUrl": ".", 9 | "paths": { 10 | "@/*": ["./src/*"] 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/vue-vuetify/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [], 3 | "references": [ 4 | { 5 | "path": "./tsconfig.node.json" 6 | }, 7 | { 8 | "path": "./tsconfig.lib.json" 9 | }, 10 | { 11 | "path": "./tsconfig.vitest.json" 12 | }, 13 | { 14 | "path": "./tsconfig.example.json" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /packages/vue-vuetify/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@vue/tsconfig/tsconfig.dom.json", 3 | "include": ["src/**/*", "src/**/*.vue"], 4 | "exclude": ["src/**/__tests__/*", "dev/**/*"], 5 | "compilerOptions": { 6 | "composite": true, 7 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", 8 | "baseUrl": ".", 9 | "paths": { 10 | "@/*": ["./src/*"] 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/vue-vuetify/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@tsconfig/node20/tsconfig.json", 3 | "include": [ 4 | "vite.config.*", 5 | "vitest.config.*", 6 | "cypress.config.*", 7 | "nightwatch.conf.*", 8 | "playwright.config.*" 9 | ], 10 | "compilerOptions": { 11 | "composite": true, 12 | "noEmit": true, 13 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", 14 | "module": "ESNext", 15 | "moduleResolution": "Bundler", 16 | "types": [ 17 | "node" 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/vue-vuetify/tsconfig.typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.lib.json", 3 | "include": ["lib/index.d.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /packages/vue-vuetify/tsconfig.vitest.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.lib.json", 3 | "include": [ 4 | "src/**/*", 5 | "src/**/*.vue", 6 | "tests/**/*", 7 | ], 8 | "compilerOptions": { 9 | "composite": true, 10 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vitest.tsbuildinfo", 11 | "lib": [], 12 | "types": [ 13 | "node", 14 | "jsdom", 15 | "vitest/globals" 16 | ] 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/vue-vuetify/vite.example.config.ts: -------------------------------------------------------------------------------- 1 | import { fileURLToPath, URL } from 'node:url'; 2 | 3 | import vue from '@vitejs/plugin-vue'; 4 | import { defineConfig } from 'vite'; 5 | import { nodePolyfills } from 'vite-plugin-node-polyfills'; 6 | import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'; 7 | 8 | // https://vitejs.dev/config/ 9 | export default defineConfig({ 10 | base: '', 11 | optimizeDeps: { 12 | // Exclude vuetify since it has an issue with vite dev - TypeError: makeVExpansionPanelTextProps is not a function - the makeVExpansionPanelTextProps is used before it is defined 13 | exclude: ['vuetify'], 14 | }, 15 | plugins: [ 16 | vue({ 17 | template: { transformAssetUrls }, 18 | }), 19 | vuetify(), 20 | // needed for json-refs 21 | nodePolyfills({ 22 | include: ['path', 'querystring'], 23 | globals: { 24 | process: true, 25 | }, 26 | }), 27 | ], 28 | build: { 29 | outDir: 'example/dist', 30 | rollupOptions: { 31 | output: { 32 | dir: 'example/dist', 33 | entryFileNames: 'bundle.js', 34 | format: 'iife', 35 | }, 36 | }, 37 | minify: true, 38 | sourcemap: true, // generates sourcemap files 39 | }, 40 | resolve: { 41 | alias: { 42 | '@': fileURLToPath(new URL('./src', import.meta.url)), 43 | }, 44 | }, 45 | }); 46 | -------------------------------------------------------------------------------- /packages/vue-vuetify/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { fileURLToPath } from 'node:url'; 2 | import { mergeConfig, defineConfig, configDefaults } from 'vitest/config'; 3 | import viteConfig from './vite.config'; 4 | 5 | export default mergeConfig( 6 | viteConfig, 7 | defineConfig({ 8 | test: { 9 | environment: 'jsdom', 10 | exclude: [...configDefaults.exclude, 'e2e/**'], 11 | root: fileURLToPath(new URL('./', import.meta.url)), 12 | coverage: { 13 | provider: 'v8', 14 | reporter: ['text', 'json', 'html'], 15 | }, 16 | server: { 17 | deps: { 18 | inline: ['vuetify'], 19 | }, 20 | }, 21 | }, 22 | }), 23 | ); 24 | -------------------------------------------------------------------------------- /packages/vue/.eslintrc.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | /** @type {import('eslint').Linter.Config} */ 3 | module.exports = { 4 | root: true, 5 | parser: 'vue-eslint-parser', 6 | parserOptions: { 7 | ecmaFeatures: { 8 | jsx: true, 9 | }, 10 | }, 11 | // There is no file include in ESLint. Thus, ignore all and include files via negative ignore (!) 12 | ignorePatterns: ['/*', '!/src', '!/tests', '!/dev'], 13 | extends: [ 14 | 'eslint:recommended', 15 | 'plugin:@typescript-eslint/recommended', 16 | 'plugin:import/recommended', 17 | 'plugin:import/typescript', 18 | 'plugin:vue/vue3-recommended', 19 | '@vue/typescript/recommended', 20 | 'plugin:prettier-vue/recommended', 21 | ], 22 | rules: { 23 | '@typescript-eslint/no-explicit-any': 'off', 24 | // Base rule must be disabled to avoid incorrect errors 25 | 'no-unused-vars': 'off', 26 | '@typescript-eslint/no-unused-vars': [ 27 | 'warn', // or "error" 28 | { 29 | argsIgnorePattern: '^_', 30 | varsIgnorePattern: '^_', 31 | caughtErrorsIgnorePattern: '^_', 32 | }, 33 | ], 34 | }, 35 | }; 36 | -------------------------------------------------------------------------------- /packages/vue/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | $schema: 'http://json.schemastore.org/prettierrc', 3 | singleQuote: true, 4 | jsxSingleQuote: true, 5 | endOfLine: 'auto', 6 | }; 7 | -------------------------------------------------------------------------------- /packages/vue/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2019 EclipseSource Munich 4 | https://github.com/eclipsesource/jsonforms 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /packages/vue/babel.config.js: -------------------------------------------------------------------------------- 1 | const devPresets = ['@vue/cli-plugin-babel/preset']; 2 | const buildPresets = ['@babel/preset-env', '@babel/preset-typescript']; 3 | module.exports = { 4 | presets: process.env.NODE_ENV === 'production' ? buildPresets : devPresets, 5 | plugins: 6 | process.env.NODE_ENV === 'test' 7 | ? [ 8 | '@babel/plugin-proposal-optional-chaining', 9 | '@babel/plugin-proposal-nullish-coalescing-operator', 10 | ] 11 | : [], 12 | }; 13 | -------------------------------------------------------------------------------- /packages/vue/dev/components/App.vue: -------------------------------------------------------------------------------- 1 | 43 | 44 | 55 | -------------------------------------------------------------------------------- /packages/vue/dev/renderers/index.ts: -------------------------------------------------------------------------------- 1 | import { entry as layoutRendererEntry } from './LayoutRenderer.vue'; 2 | import { entry as controlRendererEntry } from './ControlRenderer.vue'; 3 | 4 | export const vueRenderers = [layoutRendererEntry, controlRendererEntry]; 5 | -------------------------------------------------------------------------------- /packages/vue/dev/serve.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue'; 2 | import App from './components/App.vue'; 3 | 4 | createApp(App).mount('#app'); 5 | -------------------------------------------------------------------------------- /packages/vue/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'ts-jest', 3 | testEnvironment: 'jsdom', 4 | transform: { 5 | '^.+\\.ts$': 'ts-jest', 6 | '^.+\\.vue$': '@vue/vue3-jest', 7 | }, 8 | }; 9 | -------------------------------------------------------------------------------- /packages/vue/shims-vue.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.vue' { 2 | import type { DefineComponent } from 'vue'; 3 | const component: DefineComponent<{}, {}, any>; 4 | export default component; 5 | 6 | export const entry; 7 | } 8 | -------------------------------------------------------------------------------- /packages/vue/src/components/DispatchCell.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 49 | -------------------------------------------------------------------------------- /packages/vue/src/components/DispatchRenderer.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 49 | -------------------------------------------------------------------------------- /packages/vue/src/components/UnknownRenderer.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 12 | -------------------------------------------------------------------------------- /packages/vue/src/components/index.ts: -------------------------------------------------------------------------------- 1 | export { default as DispatchRenderer } from './DispatchRenderer.vue'; 2 | export { default as DispatchCell } from './DispatchCell.vue'; 3 | export { default as JsonForms } from './JsonForms.vue'; 4 | export { default as UnknownRenderer } from './UnknownRenderer.vue'; 5 | -------------------------------------------------------------------------------- /packages/vue/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './components'; 2 | export * from './jsonFormsCompositions'; 3 | export * from './types'; 4 | -------------------------------------------------------------------------------- /packages/vue/src/types.ts: -------------------------------------------------------------------------------- 1 | import { 2 | CoreActions, 3 | Dispatch, 4 | JsonFormsCore, 5 | JsonFormsSubStates, 6 | } from '@jsonforms/core'; 7 | 8 | export interface InjectJsonFormsState { 9 | jsonforms: JsonFormsSubStates; 10 | } 11 | export interface InjectJsonFormsDispatch { 12 | dispatch: Dispatch; 13 | } 14 | 15 | export type JsonFormsChangeEvent = Pick; 16 | 17 | export type MaybeReadonly = T | Readonly; 18 | -------------------------------------------------------------------------------- /packages/vue/tests/testHelper.ts: -------------------------------------------------------------------------------- 1 | export const bindings = (b: B): B => b; 2 | -------------------------------------------------------------------------------- /packages/vue/tests/unit/JsonForms.spec.ts: -------------------------------------------------------------------------------- 1 | import { JsonFormsUISchemaRegistryEntry, Generate } from '@jsonforms/core'; 2 | import { shallowMount } from '@vue/test-utils'; 3 | import { JsonForms } from '../../src'; 4 | import { bindings } from '../testHelper'; 5 | 6 | describe('JsonForms.vue', () => { 7 | it('uses undefined as schema prop when not given', () => { 8 | const data = { number: 5 }; 9 | const renderers: JsonFormsUISchemaRegistryEntry[] = []; 10 | const wrapper = shallowMount( 11 | JsonForms, 12 | bindings({ 13 | props: { data, renderers }, 14 | }) 15 | ); 16 | expect((wrapper as any).props('schema')).toBe(undefined); 17 | }); 18 | 19 | it('generates schema when not given via prop', () => { 20 | const data = { number: 5.5 }; 21 | const renderers: JsonFormsUISchemaRegistryEntry[] = []; 22 | const wrapper = shallowMount( 23 | JsonForms, 24 | bindings({ 25 | props: { data, renderers }, 26 | }) 27 | ); 28 | expect((wrapper.vm as any).jsonforms.core.schema).toEqual( 29 | Generate.jsonSchema(data) 30 | ); 31 | }); 32 | 33 | it('generates ui schema when not given via prop', () => { 34 | const data = { number: 5.5 }; 35 | const schema = { 36 | type: 'object', 37 | properties: { number: { type: 'number' } }, 38 | }; 39 | const renderers: JsonFormsUISchemaRegistryEntry[] = []; 40 | const wrapper = shallowMount( 41 | JsonForms, 42 | bindings({ 43 | props: { data, schema, renderers }, 44 | }) 45 | ); 46 | expect((wrapper.vm as any).jsonforms.core.uischema).toEqual( 47 | Generate.uiSchema(schema) 48 | ); 49 | }); 50 | }); 51 | -------------------------------------------------------------------------------- /packages/vue/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2021", 4 | "module": "ES2020", 5 | "skipLibCheck": true, 6 | "strict": true, 7 | "declaration": true, 8 | "noUnusedLocals": true, 9 | "noUnusedParameters": true, 10 | "importHelpers": true, 11 | "moduleResolution": "node", 12 | "esModuleInterop": true, 13 | "allowSyntheticDefaultImports": true, 14 | "sourceMap": true, 15 | "outDir": "./lib", 16 | "types": ["node", "vue", "jest"], 17 | "lib": ["ES2021", "dom", "dom.iterable", "scripthost"] 18 | }, 19 | "exclude": ["node_modules", "lib"] 20 | } 21 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - 'packages/*' 3 | -------------------------------------------------------------------------------- /tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "src", 4 | "declaration": true, 5 | "emitDecoratorMetadata": true, 6 | "experimentalDecorators": true, 7 | "lib": ["ES2021", "dom"], 8 | "module": "ES2020", 9 | "moduleResolution": "node", 10 | "target": "ES2021", 11 | "jsx": "react", 12 | "noUnusedParameters": true, 13 | "noUnusedLocals": true, 14 | "noImplicitAny": true, 15 | "allowSyntheticDefaultImports": true, 16 | "skipLibCheck": true, 17 | "esModuleInterop": true, 18 | "importHelpers": true 19 | }, 20 | "types": ["jest"] 21 | } 22 | -------------------------------------------------------------------------------- /webpack/webpack.dev.base.js: -------------------------------------------------------------------------------- 1 | var webpack = require('webpack'); 2 | const merge = require('webpack-merge').merge; 3 | const baseConfig = require('./webpack.base.js'); 4 | 5 | module.exports = merge(baseConfig, { 6 | mode: 'development', 7 | entry: [ 8 | 'webpack-dev-server/client?http://localhost:8080', 9 | 'webpack/hot/dev-server', 10 | './src/index.ts', 11 | '../examples/src/index.ts', 12 | './example/index.tsx', 13 | ], 14 | output: { 15 | publicPath: '/assets/', 16 | filename: 'bundle.js', 17 | }, 18 | 19 | devServer: { 20 | static: './example', 21 | }, 22 | 23 | module: { 24 | rules: [ 25 | { 26 | test: /\.html$/, 27 | exclude: /node_modules/, 28 | loader: 'html-loader', 29 | options: { 30 | exportAsEs6Default: true, 31 | }, 32 | }, 33 | { test: /\.css$/, use: ['style-loader', 'css-loader'] }, 34 | ], 35 | }, 36 | }); 37 | --------------------------------------------------------------------------------