-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(react-formio): migrate to esm and vitest
BREAKING CHANGE: expose all formio modules on ESM format only
- Loading branch information
Showing
206 changed files
with
10,574 additions
and
2,081 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default { extends: ["@commitlint/config-conventional"] }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite + React + TS</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"name": "@tsed/react-formio-integration", | ||
"version": "2.3.2", | ||
"description": "", | ||
"private": true, | ||
"type": "module", | ||
"license": "MIT", | ||
"scripts": { | ||
"dev": "vite dev" | ||
}, | ||
"dependencies": { | ||
"classnames": "^2.3.1", | ||
"eventemitter2": "^6.4.3", | ||
"prop-types": "15.8.1" | ||
}, | ||
"peerDependencies": { | ||
"@formio/choices.js": ">=9.0.1", | ||
"formiojs": ">=4.0.0", | ||
"lodash": ">=4.17.20", | ||
"prop-types": ">=15.7.2", | ||
"react": ">=16.14.0", | ||
"react-dnd": ">=16.0.1", | ||
"react-dnd-html5-backend": ">=16.0.1", | ||
"react-dom": ">=16.14.0", | ||
"react-table": ">=7.6.3", | ||
"tooltip.js": ">=1.3.3" | ||
}, | ||
"devDependencies": { | ||
"@tsed/react-formio": "workspace:*", | ||
"@tsed/tailwind-formio": "workspace:*", | ||
"@tsed/typescript": "workspace:*", | ||
"microbundle": "0.13.0", | ||
"vite": "5.4.11", | ||
"vitest": "2.1.8" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export default { | ||
plugins: { | ||
"postcss-normalize": {}, | ||
"tailwindcss/nesting": {}, | ||
tailwindcss: {}, | ||
autoprefixer: {} | ||
} | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
import { defaultDisplayChoices, FormEdit } from "@tsed/react-formio"; | ||
|
||
const opts: any = { | ||
typeChoices: [ | ||
{ label: "Form", value: "form" }, | ||
{ label: "Resources", value: "resource" } | ||
], | ||
displayChoices: defaultDisplayChoices, | ||
enableTags: true, | ||
// options: { template: "tailwind", iconset: "bx" }, | ||
form: { | ||
type: "form", | ||
tags: [], | ||
owner: "5d0797a382461b6656d2c790", | ||
components: [ | ||
{ | ||
label: "Text Field", | ||
labelPosition: "top", | ||
placeholder: "", | ||
description: "", | ||
tooltip: "", | ||
prefix: "", | ||
suffix: "", | ||
widget: { type: "input" }, | ||
inputMask: "", | ||
allowMultipleMasks: false, | ||
customClass: "", | ||
tabindex: "", | ||
autocomplete: "", | ||
hidden: false, | ||
hideLabel: false, | ||
showWordCount: false, | ||
showCharCount: false, | ||
mask: false, | ||
autofocus: false, | ||
spellcheck: true, | ||
disabled: false, | ||
tableView: true, | ||
modalEdit: false, | ||
multiple: false, | ||
persistent: true, | ||
inputFormat: "plain", | ||
protected: false, | ||
dbIndex: false, | ||
case: "", | ||
encrypted: false, | ||
redrawOn: "", | ||
clearOnHide: true, | ||
customDefaultValue: "", | ||
calculateValue: "", | ||
calculateServer: false, | ||
allowCalculateOverride: false, | ||
validateOn: "change", | ||
validate: { | ||
required: true, | ||
pattern: "", | ||
customMessage: "", | ||
custom: "", | ||
customPrivate: false, | ||
json: "", | ||
minLength: "", | ||
maxLength: "", | ||
strictDateValidation: false, | ||
multiple: false, | ||
unique: false | ||
}, | ||
unique: false, | ||
errorLabel: "", | ||
key: "textField", | ||
tags: [], | ||
properties: {}, | ||
conditional: { show: null, when: null, eq: "", json: "" }, | ||
customConditional: "", | ||
logic: [], | ||
attributes: {}, | ||
overlay: { | ||
style: "", | ||
page: "", | ||
left: "", | ||
top: "", | ||
width: "", | ||
height: "" | ||
}, | ||
type: "textfield", | ||
input: true, | ||
refreshOn: "", | ||
inputType: "text", | ||
id: "eqb1o4r", | ||
defaultValue: "" | ||
} | ||
], | ||
title: "text-field", | ||
display: "form", | ||
access: [ | ||
{ | ||
roles: ["5d0797bc872fc747da559858", "5d0797bc872fc71d05559859", "5d0797bc872fc7da3b55985a"], | ||
type: "read_all" | ||
} | ||
], | ||
submissionAccess: [], | ||
controller: "", | ||
properties: {}, | ||
settings: {}, | ||
name: "textField", | ||
path: "textfield", | ||
machineName: "tcspjwhsevrzpcd:textField" | ||
} | ||
}; | ||
|
||
function App() { | ||
return ( | ||
<div className='p-8'> | ||
<FormEdit {...opts} /> | ||
</div> | ||
); | ||
} | ||
|
||
export default App; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import "./styles/index.css"; | ||
|
||
import { Formio, Templates } from "@tsed/react-formio"; | ||
import tailwind from "@tsed/tailwind-formio"; | ||
import { StrictMode } from "react"; | ||
import { createRoot } from "react-dom/client"; | ||
|
||
import App from "./App"; | ||
|
||
// eslint-disable-next-line react-hooks/rules-of-hooks | ||
Formio.use(tailwind); | ||
Templates.framework = "tailwind"; | ||
|
||
createRoot(document.getElementById("root")!).render( | ||
<StrictMode> | ||
<App /> | ||
</StrictMode> | ||
); |
Oops, something went wrong.