Skip to content
This repository was archived by the owner on Jan 20, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
32 changes: 32 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"root": true,
"env": {
"es2021": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": [
"@typescript-eslint",
"prettier"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"rules": {
"prettier/prettier": "error",
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
"@typescript-eslint/explicit-module-boundary-types": "off"
},
"ignorePatterns": [
"lib/",
"dist/",
"node_modules/"
]
}
10 changes: 5 additions & 5 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Form.io Semantic UI Templates
# GoForms Template

This repository will change the rendering of forms in formio.js so that it uses html and classes compatible with the [Semantic UI](https://semantic-ui.com/) framework.
This repository provides templates for form.io forms in GoForms.

## Usage

```javascript
import semantic from '@formio/semantic';
import { Formio } from 'formiojs';
import goforms from 'goforms-template';
import { Formio } from '@formio/js';

Formio.use(semantic);
Formio.use(goforms);
```
1 change: 1 addition & 0 deletions dist/goforms.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion dist/semantic.js

This file was deleted.

23 changes: 23 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import prettier from 'eslint-config-prettier';
import prettierPlugin from 'eslint-plugin-prettier';

export default [
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.ts'],
ignores: ['dist/', 'lib/', 'node_modules/'],
plugins: {
'@typescript-eslint': tseslint.plugin,
prettier: prettierPlugin,
},
rules: {
'prettier/prettier': 'error',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
},
prettier,
];
24 changes: 0 additions & 24 deletions gulpfile.js

This file was deleted.

137 changes: 68 additions & 69 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,173 +1,172 @@
declare const _default: {
declare const goforms: {
framework: string;
templates: {
semantic: {
goforms: {
table: {
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
webform: {
form: string;
builder: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
well: {
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
wizard: {
form: string;
builder: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
wizardHeader: {
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
wizardHeaderClassic: {
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
wizardHeaderVertical: {
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
wizardNav: {
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
alert: {
form: string;
form: (ctx: import("./templates/goforms/alert/form").AlertTemplateContext) => string;
};
errorsList: {
form: string;
form: (_ctx: import("./templates/goforms/types").TemplateContext) => string;
};
treeView: {
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
treeEdit: {
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
transform(type: any, text: any): any;
defaultIconset: string;
iconClass: (iconset: any, name: any, spinning: any) => string;
cssClasses: {
'has-error': string;
'is-invalid': string;
'formio-tab-panel-active': string;
'formio-tab-link-active': string;
'formio-tab-link-container-active': string;
"has-error": string;
"is-invalid": string;
"formio-tab-panel-active": string;
"formio-tab-link-active": string;
"formio-tab-link-container-active": string;
};
builder: {
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
builderComponent: {
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
builderComponents: {
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
builderEditForm: {
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
builderPlaceholder: {
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
builderSidebar: {
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
builderSidebarGroup: {
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
builderWizard: {
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
button: {
form: string;
html: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
html: (_ctx: import("./templates/goforms/types").TemplateContext) => string;
};
checkbox: {
form: string;
html: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
html: (_ctx: import("./templates/goforms/types").TemplateContext) => string;
};
columns: {
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
component: {
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
datagrid: {
form: string;
html: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
html: (_ctx: import("./templates/goforms/types").TemplateContext) => string;
};
day: {
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
editgrid: {
form: string;
html: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
html: (_ctx: import("./templates/goforms/types").TemplateContext) => string;
};
field: {
form: string;
align: string;
form: (_ctx: import("./templates/goforms/types").TemplateContext) => string;
align: (_ctx: import("./templates/goforms/types").TemplateContext) => string;
};
fieldset: {
form: string;
form: (_ctx: import("./templates/goforms/types").TemplateContext) => string;
};
file: {
form: string;
form: (_ctx: import("./templates/goforms/types").TemplateContext) => string;
};
icon: {
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
input: {
form: string;
html: string;
form: (_ctx: import("./templates/goforms/types").TemplateContext) => string;
html: (_ctx: import("./templates/goforms/types").TemplateContext) => string;
};
label: {
form: string;
form: (_ctx: import("./templates/goforms/types").TemplateContext) => string;
};
loader: {
form: string;
form: typeof import("./templates/goforms/loader/form").default;
};
loading: {
form: string;
form: typeof import("./templates/goforms/loading/form").default;
};
message: {
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
multiValueRow: {
form: string;
form: (_ctx: import("./templates/goforms/types").TemplateContext) => string;
};
multiValueTable: {
form: string;
form: (_ctx: import("./templates/goforms/types").TemplateContext) => string;
};
panel: {
form: string;
form: (_ctx: import("./templates/goforms/types").TemplateContext) => string;
};
radio: {
form: string;
html: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
html: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
resourceAdd: {
form: string;
form: typeof import("./templates/goforms/resourceAdd/form").default;
};
select: {
form: string;
html: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
html: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
selectOption: {
form: string;
html: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
html: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
signature: {
form: string;
html: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
html: (_ctx: import("./templates/goforms/types").TemplateContext) => string;
};
survey: {
form: string;
html: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
html: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
tab: {
flat: string;
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
flat: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
tree: {
form: string;
form: (ctx: import("./templates/goforms/types").TemplateContext) => string;
};
};
};
};
export default _default;
export default goforms;
export { goforms };
16 changes: 10 additions & 6 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var templates_1 = require("./templates");
exports.default = {
framework: 'semantic',
templates: templates_1.default,
import templates from "./templates";
const goforms = {
framework: "goforms",
templates,
};
export default goforms;
export { goforms };
// For CJS consumers (optional, but robust)
if (typeof module !== "undefined") {
module.exports = goforms;
}
6 changes: 6 additions & 0 deletions lib/templates/goforms/alert/form.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface AlertTemplateContext {
attrs: Record<string, string>;
message: string;
}
declare const _default: (ctx: AlertTemplateContext) => string;
export default _default;
12 changes: 12 additions & 0 deletions lib/templates/goforms/alert/form.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default (ctx) => {
let attrs = "";
for (const attr in ctx.attrs) {
if (attr === "class") {
attrs += `${attr}="ui message ${ctx.attrs[attr]}" `;
}
else {
attrs += `${attr}="${ctx.attrs[attr]}" `;
}
}
return `<div ${attrs.trim()}>${ctx.message}</div>`;
};
4 changes: 4 additions & 0 deletions lib/templates/goforms/alert/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare const _default: {
form: (ctx: import("./form").AlertTemplateContext) => string;
};
export default _default;
2 changes: 2 additions & 0 deletions lib/templates/goforms/alert/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import form from "./form";
export default { form };
3 changes: 3 additions & 0 deletions lib/templates/goforms/builder/form.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { TemplateContext } from "../types";
declare const _default: (ctx: TemplateContext) => string;
export default _default;
Loading