diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index dd84ea782..b5c68e55b 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -4,7 +4,6 @@ about: Create a report to help us improve title: '' labels: '' assignees: '' - --- **Describe the bug** @@ -12,6 +11,7 @@ A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: + 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' @@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen. If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] + +- OS: [e.g. iOS] +- Browser [e.g. chrome, safari] +- Version [e.g. 22] **Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] + +- Device: [e.g. iPhone6] +- OS: [e.g. iOS8.1] +- Browser [e.g. stock browser, safari] +- Version [e.g. 22] **Additional context** Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bbcbbe7d6..2f28cead0 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -4,7 +4,6 @@ about: Suggest an idea for this project title: '' labels: '' assignees: '' - --- **Is your feature request related to a problem? Please describe.** diff --git a/CHANGELOG.md b/CHANGELOG.md index 079c75696..3afbca847 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # @formio/bootstrap +## 4.0.2 + +### Patch Changes + +- 799bfe5: preserve apostrophes in html5 option values +- c40ad3e: FIO-7954: refactored and fixed translations +- 6063d69: Prevent announcing clickable input labels when in read-only mode + +## 4.0.2-api99.0 + +### Patch Changes + +- 799bfe5: preserve apostrophes in html5 option values +- c40ad3e: FIO-7954: refactored and fixed translations +- 6063d69: Prevent announcing clickable input labels when in read-only mode + ## 4.0.1 ### Patch Changes diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 000000000..26a6b2019 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,62 @@ +# @formio/bootstrap + +## Identity + +- **Path:** `packages/bootstrap`. **Published as:** `@formio/bootstrap` on npm (MIT). +- **OSS sync:** YES — `ossRepo: github.com/formio/bootstrap`, `srcPath: "."`. Everything in `src/` ships publicly on release. +- **Module system:** TypeScript, dual CJS + ESM build (`tsconfig.cjs.json` / `tsconfig.mjs.json`), UMD bundles in `dist/`. **Lint:** TSLint (deprecated), not ESLint. +- **Era:** mature, near-static template pack. `.ts` files are thin barrels; the substance is ~220 precompiled `.ejs` markup files. +- **Purpose:** the **template pack** (markup only) that `@formio/js` uses to render forms under Bootstrap 3 / 4 / 5. It supplies HTML; the renderer owns all behavior. + +## Floor — immutable musts + +- **A `.ejs` change is almost never done in one tree.** `src/templates/{bootstrap3,bootstrap4,bootstrap5}/` are three hand-maintained copies. Mirror the edit across all three — swapping `sr-only` (BS3/BS4) ↔ `visually-hidden` (BS5), and noting BS3 lacks some anchors and is partially frozen. See [`bootstrap/subframework-parity-01`](../../docs/gotchas/bootstrap.md#subframework-parity-01--bootstrap345-are-three-hand-maintained-copies-the-intra-package-axis). +- **Don't delete a hidden announcement span or rename a `ref="..."`.** The renderer writes screen-reader announcements into those spans by `ref` name, with optional chaining — so a deletion or rename silently no-ops. The `ref`-name contract itself is seam invariant 1 ([template-markup-contract](../../docs/cross-cutting/template-markup-contract.md)); the bootstrap anchors are [`bootstrap/announce-anchors-01`](../../docs/gotchas/bootstrap.md#announce-anchors-01--the-hidden-announcement-spans-are-renderer-driven-dont-delete-or-rename-them) (marker `G-BS01`). +- **Use lodash-template delimiters, never stock EJS.** `{{ }}` interpolate, `{% %}` evaluate, `{{{ }}}` raw HTML, context var `ctx`. `<% %>` produces literal text. See [`bootstrap/ejs-precompile-delimiters-01`](../../docs/gotchas/bootstrap.md#ejs-precompile-delimiters-01--templates-use-lodash-template-delimiters-not-stock-ejs). +- **A new template is invisible until imported in `templates//index.ts`** — registration is by explicit import, not filesystem scan. And the renderer may look it up by a string-constructed name (e.g. `wizardHeader`). See [`bootstrap/template-name-and-registration-01`](../../docs/gotchas/bootstrap.md#template-name-and-registration-01--the-directory-name-is-the-renderers-lookup-key-and-the-barrel-must-import-it). +- **No secrets / internal-only / license-gated markup in `src/`** — it ships publicly. `GOTCHA(G-NNN)` markers in templates stay numeric (no topic phrases); in `.ejs` use `{% /* GOTCHA(G-NNN) */ %}`. + +## Ceiling — emerging patterns + +- **Pattern: a component is a directory of `form.ejs` (+ optional `html.ejs`) plus a 3-line `index.ts` barrel that default-exports `{ form, html }`. Example:** [`src/templates/bootstrap5/input/index.ts`](./src/templates/bootstrap5/input/index.ts). +- **Pattern: a screen-reader announcement anchor is a hidden span with a `ref` + `aria-live`, written into by the renderer. Example:** [`src/templates/bootstrap5/input/form.ejs:68`](./src/templates/bootstrap5/input/form.ejs) (`ref="announceMessage"`, carries marker `G-BS01`). + +## Blast radius + +**5 dependents, tier: medium** (headline consumer `@formio/js`, which also deep-imports `@formio/bootstrap/components`). See [`/docs/dependencies/bootstrap.md`](../../docs/dependencies/bootstrap.md). + +## Test & build + +```sh +pnpm -F @formio/bootstrap build # rm -rf lib; tsc cjs+mjs; gulp templates (precompile .ejs); webpack; libpackage.js +pnpm -F @formio/bootstrap lint # tslint -p . +pnpm -F @formio/bootstrap check-types # tsc --noEmit +``` + +**There is no test suite here** — `src/test.spec.ts` is a placeholder and there is no `test` script. "Green" locally = `build` + `lint` + `check-types`. Behavioral verification of a markup change happens **downstream in `@formio/js`** (renderer integration tests): + +```sh +pnpm -F @formio/js test # exercises this package's markup +``` + +See [`bootstrap/no-test-suite-01`](../../docs/gotchas/bootstrap.md#no-test-suite-01--there-is-no-test-suite-verify-in-formiojs). + +## Hot paths & gotchas + +See [`/docs/gotchas/bootstrap.md`](../../docs/gotchas/bootstrap.md). Entries: `bootstrap/subframework-parity-01`, `bootstrap/announce-anchors-01` (G-BS01), `bootstrap/template-name-and-registration-01`, `bootstrap/wizard-header-variants-01` (G-BS02), `bootstrap/ejs-precompile-delimiters-01`, `bootstrap/no-test-suite-01`. + +## Cross-cutting triggers + +- **Editing any `*.ejs` (markup, `ref` names, element ids, `aria-*` wiring, shared id formats like the fieldset legend `l--legend`)** → read [`/docs/cross-cutting/template-markup-contract.md`](../../docs/cross-cutting/template-markup-contract.md) first. The same markup is reimplemented in `@formio/uswds` and `@formio/standard-template`, and read back by `@formio/js`; a one-sided change is a silent a11y/behavior regression (FIO-11126, FIO-10942). +- **Editing a `wizardHeader*` / `wizardNav` template** → check what `wizard/form.ejs` already renders around it before adding a landmark, `id`, or progressbar. See [`bootstrap/wizard-header-variants-01`](../../docs/gotchas/bootstrap.md#wizard-header-variants-01--header-plus-nav-both-render-duplicate-landmarks-are-the-recurring-bug) (FIO-11049, FIO-11511). +- **Adding/renaming an `exports` sub-path (`./components`, `./bootstrap5`, …)** → `@formio/js` deep-imports `@formio/bootstrap/components`; a rename breaks it at import resolution. See [dependencies](../../docs/dependencies/bootstrap.md#deep-coupling-inventory). +- **Any publishable change** → add a changeset (`@formio/bootstrap`, plus any sibling template pack you also touched — one entry per published package). **`major` bump** → coordinate the OSS release. + +## References + +- Repo-wide: [`/CLAUDE.md`](../../CLAUDE.md), [`/STANDARDS.md`](../../STANDARDS.md) +- Architecture: [`/docs/architecture/bootstrap.md`](../../docs/architecture/bootstrap.md) +- Dependencies: [`/docs/dependencies/bootstrap.md`](../../docs/dependencies/bootstrap.md) +- Gotchas: [`/docs/gotchas/bootstrap.md`](../../docs/gotchas/bootstrap.md) +- Seam: [`/docs/cross-cutting/template-markup-contract.md`](../../docs/cross-cutting/template-markup-contract.md) +- Downstream consumer: [`packages/formio.js/CLAUDE.md`](../formio.js/CLAUDE.md) diff --git a/Readme.md b/Readme.md index 775efe0bd..f1263dc2e 100644 --- a/Readme.md +++ b/Readme.md @@ -1,8 +1,9 @@ # Form.io Bootstrap Templates + This repository will change the rendering of forms in formio.js so that it uses html and classes compatible with [Bootstrap 3](https://getbootstrap.com/docs/3.4/), [Bootstrap 4](https://getbootstrap.com/docs/4.6/getting-started/introduction/), and [Bootstrap 5](https://getbootstrap.com/docs/5.3/getting-started/introduction/) frameworks. -Official Documentation --------------------------- +## Official Documentation + For the latest documentation, release information, and guides, always refer to the official Form.io Help Documentation available here: **[https://help.form.io](https://help.form.io/dev/css-frameworks)** @@ -14,6 +15,7 @@ import bootstrap3 from '@formio/bootstrap/bootstrap3'; import { Formio } from 'formiojs'; Formio.use(bootstrap3); ``` + ### Using Bootstrap 4 ```javascript @@ -32,10 +34,10 @@ Formio.use(bootstrap5); ## Script - ```javascript -Formio.Templates.framework = "bootstrap3" +Formio.Templates.framework = 'bootstrap3'; ``` + If icon is not show ```javascript diff --git a/libpackage.js b/libpackage.js index 4beff8f72..fca73064b 100644 --- a/libpackage.js +++ b/libpackage.js @@ -1,8 +1,14 @@ const fs = require('fs'); const path = require('path'); -fs.writeFileSync(path.join(__dirname, 'lib', 'cjs', 'package.json'), `{ +fs.writeFileSync( + path.join(__dirname, 'lib', 'cjs', 'package.json'), + `{ "type": "commonjs" -}`); -fs.writeFileSync(path.join(__dirname, 'lib', 'mjs', 'package.json'), `{ +}`, +); +fs.writeFileSync( + path.join(__dirname, 'lib', 'mjs', 'package.json'), + `{ "type": "module" -}`); +}`, +); diff --git a/package.json b/package.json index 34c467eab..07a312d5a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@formio/bootstrap", - "version": "4.0.1", + "version": "4.0.2", "description": "Bootstrap templates for Form.io forms", "main": "lib/cjs/bootstrap5.js", "module": "lib/mjs/bootstrap5.js", @@ -42,7 +42,9 @@ "scripts": { "watch": "tsc -w", "build": "rm -rf ./lib && tsc --project tsconfig.cjs.json && tsc --project tsconfig.mjs.json && gulp templates && webpack && node ./libpackage.js", - "lint": "tslint -p ." + "lint": "tslint -p .", + "check-types": "tsc --noEmit", + "lint:fix": "tslint -p . --fix" }, "pre-commit": [ "lint", diff --git a/src/bootstrap3.ts b/src/bootstrap3.ts index 40362b333..630209606 100644 --- a/src/bootstrap3.ts +++ b/src/bootstrap3.ts @@ -1,7 +1,10 @@ import bootstrap3 from './templates/bootstrap3'; +import translations from './translations'; + export default { framework: 'bootstrap3', templates: { - bootstrap3 + bootstrap3, }, + translations }; diff --git a/src/bootstrap4.ts b/src/bootstrap4.ts index 6d4fc3b8b..394347234 100644 --- a/src/bootstrap4.ts +++ b/src/bootstrap4.ts @@ -1,7 +1,10 @@ import bootstrap4 from './templates/bootstrap4'; +import translations from './translations'; + export default { framework: 'bootstrap4', templates: { - bootstrap4 + bootstrap4, }, -}; \ No newline at end of file + translations +}; diff --git a/src/bootstrap5.ts b/src/bootstrap5.ts index c50cda340..e70610d88 100644 --- a/src/bootstrap5.ts +++ b/src/bootstrap5.ts @@ -1,7 +1,10 @@ import bootstrap5 from './templates/bootstrap5'; +import translations from './translations'; + export default { framework: 'bootstrap5', templates: { - bootstrap5 + bootstrap5, }, -}; \ No newline at end of file + translations +}; diff --git a/src/ejs.d.ts b/src/ejs.d.ts index 1f61555f9..a753e9c24 100644 --- a/src/ejs.d.ts +++ b/src/ejs.d.ts @@ -1,4 +1,4 @@ declare module '*.ejs' { const value: string; - export default value + export default value; } diff --git a/src/templates/bootstrap3/builderEditForm/form.ejs b/src/templates/bootstrap3/builderEditForm/form.ejs index cd10a50d6..c72ef7034 100644 --- a/src/templates/bootstrap3/builderEditForm/form.ejs +++ b/src/templates/bootstrap3/builderEditForm/form.ejs @@ -1,12 +1,12 @@
-

{{ctx.t(ctx.componentInfo.title, { _userInput: true })}} {{ctx.t('Component')}}

+

{{ctx.t(ctx.componentInfo.title, { _userInput: true })}} {{ctx.t('component')}}

{% if (ctx.helplinks) { %} @@ -19,9 +19,9 @@
{% if (!ctx.preview) { %}
- - - + + +
{% } %} @@ -29,7 +29,7 @@
-

{{ctx.t('Preview')}}

+

{{ctx.t('preview')}}

@@ -43,9 +43,9 @@
{% } %}
- - - + + +
{% } %} diff --git a/src/templates/bootstrap3/builderPlaceholder/form.ejs b/src/templates/bootstrap3/builderPlaceholder/form.ejs index 1d439ceca..40aac7394 100644 --- a/src/templates/bootstrap3/builderPlaceholder/form.ejs +++ b/src/templates/bootstrap3/builderPlaceholder/form.ejs @@ -5,5 +5,5 @@ data-noattach="true" data-position="{{ctx.position}}" > - {{ctx.t('Drag and Drop a form component')}} + {{ctx.t('dragAndDropComponent')}}
diff --git a/src/templates/bootstrap3/builderSidebar/form.ejs b/src/templates/bootstrap3/builderSidebar/form.ejs index f47612713..0252a1113 100644 --- a/src/templates/bootstrap3/builderSidebar/form.ejs +++ b/src/templates/bootstrap3/builderSidebar/form.ejs @@ -1,5 +1,5 @@
- +
{% ctx.groups.forEach(function(group) { %} {{ group }} diff --git a/src/templates/bootstrap3/builderSidebarGroup/form.ejs b/src/templates/bootstrap3/builderSidebarGroup/form.ejs index a4a523e41..8d340ddf4 100644 --- a/src/templates/bootstrap3/builderSidebarGroup/form.ejs +++ b/src/templates/bootstrap3/builderSidebarGroup/form.ejs @@ -38,7 +38,7 @@ {% }) %} {{ctx.subgroups.join('')}} {% } else { %} -
{{ctx.t('No Matches Found')}}
+
{{ctx.t('noMatchesFound')}}
{% } %}
diff --git a/src/templates/bootstrap3/column-menu/html.ejs b/src/templates/bootstrap3/column-menu/html.ejs index e5d956276..e98b3ea9d 100644 --- a/src/templates/bootstrap3/column-menu/html.ejs +++ b/src/templates/bootstrap3/column-menu/html.ejs @@ -1,12 +1,12 @@
@@ -59,14 +59,14 @@ {% if (!ctx.disabled && (ctx.component.multiple || !ctx.files.length)) { %} {% if (ctx.self.useWebViewCamera) { %}
- - + +
{% } else if (!ctx.self.cameraMode) { %}
- {{ctx.t('Drop files to attach,')}} + {{ctx.t('dropFilesToAttach')}} {% if (ctx.self.imageUpload && ctx.component.webcam) { %} - {{ctx.t('Use Camera,')}} + {{ctx.t('useCamera') + ','}} {% } %} {{ctx.t('or')}} {{ctx.t('browse')}}
@@ -74,8 +74,8 @@
- - + + {% } %} {% } %} {% ctx.statuses.forEach(function(status) { %} @@ -89,7 +89,7 @@ {% if (status.status === 'progress') { %}
- {{status.progress}}% {{ctx.t('Complete')}} + {{status.progress}}% {{ctx.t('completeStatus')}}
{% } else if (status.status === 'error'){ %} @@ -104,16 +104,16 @@ {% if (!ctx.component.storage || ctx.support.hasWarning) { %}
{% if (!ctx.component.storage) { %} -

{{ctx.t('No storage has been set for this field. File uploads are disabled until storage is set up.')}}

+

{{ctx.t('noStorageSet')}}

{% } %} {% if (!ctx.support.filereader) { %} -

{{ctx.t('File API & FileReader API not supported.')}}

+

{{ctx.t('noFileApiSupport')}}

{% } %} {% if (!ctx.support.formdata) { %} -

{{ctx.t("XHR2's FormData is not supported.")}}

+

{{ctx.t('noFormDataSupport')}}

{% } %} {% if (!ctx.support.progress) { %} -

{{ctx.t("XHR2's upload progress isn't supported.")}}

+

{{ctx.t('noProgressSupport')}}

{% } %}
{% } %} \ No newline at end of file diff --git a/src/templates/bootstrap3/grid/html.ejs b/src/templates/bootstrap3/grid/html.ejs index 0868e2f43..14aa7fbae 100644 --- a/src/templates/bootstrap3/grid/html.ejs +++ b/src/templates/bootstrap3/grid/html.ejs @@ -7,7 +7,7 @@ {% if (ctx.component.enableRowSelect) { %}
{% if (ctx.selectedRows) { %} - {{ctx.selectedRows}} selected + {{ctx.selectedRows}} {{ctx.t('selected')}} {% } %}
{% } %} @@ -21,7 +21,7 @@ {% if (!ctx.component.components.length) { %} - No components have been set up to display in the Data Table. "Table View" must be checked for components to render. + {{ctx.t('noComponentsSetInGrid')}} {% } %} {% if (ctx.component.enableRowSelect) { %} @@ -32,7 +32,7 @@ {% ctx.component.components.forEach(function(comp, i) { %} {% if (comp.show) { %} - {{ comp.label || comp.key }} + {{ ctx.t(comp.label || comp.key, { _userInput: true }) }} {% if (ctx.options.sortable && comp.sortable) { %} {{ ctx.component.sort.isAsc ? '↑' : '↓' }} @@ -53,7 +53,7 @@ && !ctx.options.pdf) { %}
- Actions + {{ctx.t('actions')}} {% if (ctx.component.showDeleteAllBtn && ctx.data.length) { %} {% } %} diff --git a/src/templates/bootstrap3/grid/index.ts b/src/templates/bootstrap3/grid/index.ts index 6cc911a13..725e812f0 100644 --- a/src/templates/bootstrap3/grid/index.ts +++ b/src/templates/bootstrap3/grid/index.ts @@ -1,2 +1,2 @@ import html from './html.ejs'; -export default { html }; \ No newline at end of file +export default { html }; diff --git a/src/templates/bootstrap3/iconClass.ts b/src/templates/bootstrap3/iconClass.ts index 6f443e9a0..5c115de2a 100644 --- a/src/templates/bootstrap3/iconClass.ts +++ b/src/templates/bootstrap3/iconClass.ts @@ -32,5 +32,7 @@ export default (iconset, name, spinning) => { } } - return spinning ? `${iconset} ${iconset}-${name} ${iconset}-spin` : `${iconset} ${iconset}-${name}`; + return spinning + ? `${iconset} ${iconset}-${name} ${iconset}-spin` + : `${iconset} ${iconset}-${name}`; }; diff --git a/src/templates/bootstrap3/index.ts b/src/templates/bootstrap3/index.ts index 5cec09990..c58702226 100644 --- a/src/templates/bootstrap3/index.ts +++ b/src/templates/bootstrap3/index.ts @@ -51,7 +51,9 @@ export default { } switch (type) { case 'class': - return this.cssClasses.hasOwnProperty(text.toString()) ? this.cssClasses[text.toString()] : text; + return this.cssClasses.hasOwnProperty(text.toString()) + ? this.cssClasses[text.toString()] + : text; } return text; }, @@ -126,5 +128,5 @@ export default { pagination, columnMenu, tbody, - paginationBottom + paginationBottom, }; diff --git a/src/templates/bootstrap3/modaldialog/form.ejs b/src/templates/bootstrap3/modaldialog/form.ejs index b6a74f239..7d2099b91 100644 --- a/src/templates/bootstrap3/modaldialog/form.ejs +++ b/src/templates/bootstrap3/modaldialog/form.ejs @@ -6,7 +6,7 @@ type="button" role="button" class="btn btn-primary btn-xs formio-modaledit-close"> - {{ctx.t('Close')}} + {{ctx.t('close')}}
diff --git a/src/templates/bootstrap3/pagination-bottom/index.ts b/src/templates/bootstrap3/pagination-bottom/index.ts index 6cc911a13..725e812f0 100644 --- a/src/templates/bootstrap3/pagination-bottom/index.ts +++ b/src/templates/bootstrap3/pagination-bottom/index.ts @@ -1,2 +1,2 @@ import html from './html.ejs'; -export default { html }; \ No newline at end of file +export default { html }; diff --git a/src/templates/bootstrap3/pagination/html.ejs b/src/templates/bootstrap3/pagination/html.ejs index 1d790c1d9..7a3f2952c 100644 --- a/src/templates/bootstrap3/pagination/html.ejs +++ b/src/templates/bootstrap3/pagination/html.ejs @@ -1,7 +1,7 @@ {% } %} diff --git a/src/templates/bootstrap4/builderEditForm/form.ejs b/src/templates/bootstrap4/builderEditForm/form.ejs index 64735f313..bffd6298e 100644 --- a/src/templates/bootstrap4/builderEditForm/form.ejs +++ b/src/templates/bootstrap4/builderEditForm/form.ejs @@ -1,12 +1,12 @@
-

{{ctx.t(ctx.componentInfo.title, { _userInput: true })}} {{ctx.t('Component')}}

+

{{ctx.t(ctx.componentInfo.title, { _userInput: true })}} {{ctx.t('component')}}

{% if (ctx.helplinks) { %} @@ -19,11 +19,11 @@
{% if (!ctx.showPreview) { %}
- - - + + + {% if (ctx.preview) { %} - + {% } %}
{% } %} @@ -32,7 +32,7 @@
-

{{ctx.t('Preview')}}

+

{{ctx.t('preview')}}

@@ -46,10 +46,10 @@
{% } %}
- - - - + + + +
{% } %} diff --git a/src/templates/bootstrap4/builderPlaceholder/form.ejs b/src/templates/bootstrap4/builderPlaceholder/form.ejs index 47bb3e80e..46f6ddf4b 100644 --- a/src/templates/bootstrap4/builderPlaceholder/form.ejs +++ b/src/templates/bootstrap4/builderPlaceholder/form.ejs @@ -5,5 +5,5 @@ data-noattach="true" data-position="{{ctx.position}}" > - {{ctx.t('Drag and Drop a form component')}} + {{ctx.t('dragAndDropComponent')}}
diff --git a/src/templates/bootstrap4/builderSidebar/form.ejs b/src/templates/bootstrap4/builderSidebar/form.ejs index b4f0b1e21..24e626b97 100644 --- a/src/templates/bootstrap4/builderSidebar/form.ejs +++ b/src/templates/bootstrap4/builderSidebar/form.ejs @@ -1,5 +1,5 @@
- +
{% ctx.groups.forEach(function(group) { %} {{ group }} diff --git a/src/templates/bootstrap4/builderSidebarGroup/form.ejs b/src/templates/bootstrap4/builderSidebarGroup/form.ejs index a46008adb..030388adc 100644 --- a/src/templates/bootstrap4/builderSidebarGroup/form.ejs +++ b/src/templates/bootstrap4/builderSidebarGroup/form.ejs @@ -42,7 +42,7 @@ {% }) %} {{ctx.subgroups.join('')}} {% } else { %} -
{{ctx.t('No Matches Found')}}
+
{{ctx.t('noMatchesFound')}}
{% } %}
diff --git a/src/templates/bootstrap4/builderWizard/form.ejs b/src/templates/bootstrap4/builderWizard/form.ejs index 8cbae158c..3409d6a0a 100644 --- a/src/templates/bootstrap4/builderWizard/form.ejs +++ b/src/templates/bootstrap4/builderWizard/form.ejs @@ -10,8 +10,8 @@ {% }) %}
  • - - {{ctx.t('Page')}} + + {{ctx.t('page')}}
  • diff --git a/src/templates/bootstrap4/column-menu/html.ejs b/src/templates/bootstrap4/column-menu/html.ejs index 72670c81e..88c965bec 100644 --- a/src/templates/bootstrap4/column-menu/html.ejs +++ b/src/templates/bootstrap4/column-menu/html.ejs @@ -1,12 +1,12 @@ @@ -86,7 +86,7 @@ {% if (file.status === 'progress') { %}
    - {{file.progress}}% {{ctx.t('Complete')}} + {{file.progress}}% {{ctx.t('completeStatus')}}
    {% } else { %} @@ -160,22 +160,22 @@ {% if (!ctx.disabled && (ctx.component.multiple || !ctx.files.length)) { %} {% if (ctx.self.useWebViewCamera) { %}
    - - + +
    {% } else if (!ctx.self.cameraMode) { %} -
    - {{ctx.t('Drop files to attach,')}} +
    + {{ctx.t('dropFilesToAttach')}} {% if (ctx.self.imageUpload && ctx.component.webcam) { %} - {{ctx.t('use camera')}} + {{ctx.t('useCamera') + ','}} {% } %} {{ctx.t('or')}} {{ctx.t('browse')}} - {{ctx.t('Browse to attach file for ' + ctx.component.label + '. ' + - (ctx.component.description ? ctx.component.description + '. ' : '') + - ((!ctx.component.filePattern || ctx.component.filePattern === '*') ? 'Any file types are allowed' : ctx.t('Allowed file types: ') + ctx.component.filePattern))}} + {{ctx.t('browseToAttachFileFor') + ' ' + ctx.t(ctx.component.label, { _userInput: true }) + '. ' + + (ctx.component.description ? ctx.t(ctx.component.description, { _userInput: true }) + '. ' : '') + + ((!ctx.component.filePattern || ctx.component.filePattern === '*') ? ctx.t('anyFileTypesAllowed') : ctx.t('allowedFileTypes') + ': ' + ctx.component.filePattern)}}
    @@ -186,23 +186,23 @@
    - - + + {% } %} {% } %} {% if (!ctx.component.storage || ctx.support.hasWarning) { %}
    {% if (!ctx.component.storage) { %} -

    {{ctx.t('No storage has been set for this field. File uploads are disabled until storage is set up.')}}

    +

    {{ctx.t('noStorageSet')}}

    {% } %} {% if (!ctx.support.filereader) { %} -

    {{ctx.t('File API & FileReader API not supported.')}}

    +

    {{ctx.t('noFileApiSupport')}}

    {% } %} {% if (!ctx.support.formdata) { %} -

    {{ctx.t("XHR2's FormData is not supported.")}}

    +

    {{ctx.t('noFormDataSupport')}}

    {% } %} {% if (!ctx.support.progress) { %} -

    {{ctx.t("XHR2's upload progress isn't supported.")}}

    +

    {{ctx.t('noProgressSupport')}}

    {% } %}
    {% } %} diff --git a/src/templates/bootstrap4/grid/html.ejs b/src/templates/bootstrap4/grid/html.ejs index ce5536a80..70a44e12d 100644 --- a/src/templates/bootstrap4/grid/html.ejs +++ b/src/templates/bootstrap4/grid/html.ejs @@ -6,7 +6,7 @@
    {% if (ctx.component.enableRowSelect) { %}
    - {{ctx.selectedRows}} selected + {{ctx.selectedRows}} {{ctx.t('selected')}}
    {% } %}
    @@ -19,7 +19,7 @@ {% if (!ctx.component.components.length) { %} - No components have been set up to display in the Data Table. "Table View" must be checked for components to render. + {{ctx.t('noComponentsSetInGrid')}} {% } %} {% if (ctx.component.enableRowSelect) { %} @@ -29,7 +29,7 @@ {% ctx.component.components.forEach(function(comp, i) { %} {% if (comp.show) { %} - {{ comp.label || comp.key }} + {{ ctx.t(comp.label || comp.key, { _userInput: true }) }} {% if (ctx.options.sortable && comp.sortable) { %} {{ ctx.component.sort.isAsc ? '↑' : '↓' }} @@ -50,7 +50,7 @@ && !ctx.options.pdf) { %}
    - Actions + {{ctx.t('actions')}} {% if (ctx.component.showDeleteAllBtn && ctx.data.length) { %} {% } %} diff --git a/src/templates/bootstrap4/grid/index.ts b/src/templates/bootstrap4/grid/index.ts index 6cc911a13..725e812f0 100644 --- a/src/templates/bootstrap4/grid/index.ts +++ b/src/templates/bootstrap4/grid/index.ts @@ -1,2 +1,2 @@ import html from './html.ejs'; -export default { html }; \ No newline at end of file +export default { html }; diff --git a/src/templates/bootstrap4/iconClass.ts b/src/templates/bootstrap4/iconClass.ts index bfbaf204e..74d273197 100644 --- a/src/templates/bootstrap4/iconClass.ts +++ b/src/templates/bootstrap4/iconClass.ts @@ -35,5 +35,7 @@ export default (iconset, name, spinning) => { } } - return spinning ? `${iconset} ${iconset}-${name} ${iconset}-spin` : `${iconset} ${iconset}-${name}`; + return spinning + ? `${iconset} ${iconset}-${name} ${iconset}-spin` + : `${iconset} ${iconset}-${name}`; }; diff --git a/src/templates/bootstrap4/index.ts b/src/templates/bootstrap4/index.ts index 59cbbda8c..a2c9a3b19 100644 --- a/src/templates/bootstrap4/index.ts +++ b/src/templates/bootstrap4/index.ts @@ -76,7 +76,9 @@ export default { } switch (type) { case 'class': - return this.cssClasses.hasOwnProperty(text.toString()) ? this.cssClasses[text.toString()] : text; + return this.cssClasses.hasOwnProperty(text.toString()) + ? this.cssClasses[text.toString()] + : text; } return text; }, @@ -150,5 +152,5 @@ export default { pagination, columnMenu, tbody, - paginationBottom + paginationBottom, }; diff --git a/src/templates/bootstrap4/label/form.ejs b/src/templates/bootstrap4/label/form.ejs index 5911037b0..bb67a584f 100644 --- a/src/templates/bootstrap4/label/form.ejs +++ b/src/templates/bootstrap4/label/form.ejs @@ -1,7 +1,7 @@
    diff --git a/src/templates/bootstrap4/modaldialog/form.ejs b/src/templates/bootstrap4/modaldialog/form.ejs index b6a74f239..7d2099b91 100644 --- a/src/templates/bootstrap4/modaldialog/form.ejs +++ b/src/templates/bootstrap4/modaldialog/form.ejs @@ -6,7 +6,7 @@ type="button" role="button" class="btn btn-primary btn-xs formio-modaledit-close"> - {{ctx.t('Close')}} + {{ctx.t('close')}}
    diff --git a/src/templates/bootstrap4/pagination-bottom/index.ts b/src/templates/bootstrap4/pagination-bottom/index.ts index 6cc911a13..725e812f0 100644 --- a/src/templates/bootstrap4/pagination-bottom/index.ts +++ b/src/templates/bootstrap4/pagination-bottom/index.ts @@ -1,2 +1,2 @@ import html from './html.ejs'; -export default { html }; \ No newline at end of file +export default { html }; diff --git a/src/templates/bootstrap4/pagination/html.ejs b/src/templates/bootstrap4/pagination/html.ejs index a5256b3e3..e8c78719f 100644 --- a/src/templates/bootstrap4/pagination/html.ejs +++ b/src/templates/bootstrap4/pagination/html.ejs @@ -1,7 +1,7 @@