From 700b7e8ec05c66112efb70a64652c082dca35059 Mon Sep 17 00:00:00 2001 From: Anton K Date: Tue, 12 Oct 2021 10:58:26 +0300 Subject: [PATCH] ACC 0.6.x initial commit --- src/templates/uswds/cssClasses.ts | 2 + src/templates/uswds/datagrid/form.ejs | 10 +++- src/templates/uswds/dynamicWizard/form.ejs | 65 ++++++++++++++++++++++ src/templates/uswds/dynamicWizard/index.ts | 3 + src/templates/uswds/editgrid/form.ejs | 22 +++++--- src/templates/uswds/editgridTable/form.ejs | 54 ++++++++++++++++++ src/templates/uswds/editgridTable/index.ts | 3 + src/templates/uswds/index.ts | 4 ++ src/templates/uswds/modalPreview/form.ejs | 2 +- 9 files changed, 154 insertions(+), 11 deletions(-) create mode 100644 src/templates/uswds/dynamicWizard/form.ejs create mode 100644 src/templates/uswds/dynamicWizard/index.ts create mode 100644 src/templates/uswds/editgridTable/form.ejs create mode 100644 src/templates/uswds/editgridTable/index.ts diff --git a/src/templates/uswds/cssClasses.ts b/src/templates/uswds/cssClasses.ts index 417aaad6..4802c949 100644 --- a/src/templates/uswds/cssClasses.ts +++ b/src/templates/uswds/cssClasses.ts @@ -10,6 +10,8 @@ export default { 'formio-modal-save': 'usa-error', 'formio-alert-danger': 'usa-alert usa-alert--error usa-alert--no-icon', 'formio-alert-success': 'usa-alert usa-alert--success usa-alert--no-icon', + 'formio-secondary-button': 'usa-button usa-button--secondary', + 'formio-primary-button': 'usa-button', 'formio-modal-cancel-button': 'usa-button usa-button--secondary', 'formio-modal-confirm-button': 'usa-button', }; diff --git a/src/templates/uswds/datagrid/form.ejs b/src/templates/uswds/datagrid/form.ejs index 063025fc..a9f1b322 100644 --- a/src/templates/uswds/datagrid/form.ejs +++ b/src/templates/uswds/datagrid/form.ejs @@ -13,6 +13,7 @@ {% }) %} {% if (ctx.hasExtraColumn) { %} + {{ ctx.t('Actions')}} {% if (!ctx.builder && ctx.hasAddButton && ctx.hasTopSubmit) { %} @@ -59,7 +64,7 @@ {% if (!ctx.builder && ctx.hasAddButton && ctx.hasBottomSubmit) { %} - + @@ -68,3 +73,4 @@ {% } %} + diff --git a/src/templates/uswds/dynamicWizard/form.ejs b/src/templates/uswds/dynamicWizard/form.ejs new file mode 100644 index 00000000..bec2db7b --- /dev/null +++ b/src/templates/uswds/dynamicWizard/form.ejs @@ -0,0 +1,65 @@ +
+ {% if (ctx.readOnly || !ctx.isChangingMode || ctx.isDisabled) { %} + {% if (ctx.header) { %} + + {% } %} + {% ctx.rows.forEach(function(row, rowIndex) { %} + + {% }) %} + {% if (ctx.footer) { %} + + {% } %} + {% } else { %} +
+ {{ ctx.currentComponent }} +
+ {% } %} +
+{% if (!ctx.readOnly && !ctx.isBlocking) { %} +{% if (!ctx.isChangingMode) { %} +

Would you like to add another?

+ +{% } else { %} + +{% } %} +{% } %} + diff --git a/src/templates/uswds/dynamicWizard/index.ts b/src/templates/uswds/dynamicWizard/index.ts new file mode 100644 index 00000000..4d4897d4 --- /dev/null +++ b/src/templates/uswds/dynamicWizard/index.ts @@ -0,0 +1,3 @@ +import form from './form.ejs'; + +export default { form }; diff --git a/src/templates/uswds/editgrid/form.ejs b/src/templates/uswds/editgrid/form.ejs index f68e741f..275d65c5 100644 --- a/src/templates/uswds/editgrid/form.ejs +++ b/src/templates/uswds/editgrid/form.ejs @@ -1,11 +1,16 @@ - + {% if (!ctx.readOnly && ctx.hasAddButton) { %} {% } %} + diff --git a/src/templates/uswds/editgridTable/form.ejs b/src/templates/uswds/editgridTable/form.ejs new file mode 100644 index 00000000..0e7cb2af --- /dev/null +++ b/src/templates/uswds/editgridTable/form.ejs @@ -0,0 +1,54 @@ +
+ + {% if (ctx.header) { %} + + {{ctx.header}} + + {% } %} + + {% ctx.rows.forEach(function(row, rowIndex) { %} + + {{row}} + {% if (ctx.openRows[rowIndex] && !ctx.readOnly) { %} + + {% } %} + {% if (ctx.errors[rowIndex]) { %} + + {% } %} + + {% }) %} + + {% if (ctx.footer) { %} + + + {{ctx.footer}} + + + {% } %} +
+
+ + {% if (ctx.component.removeRow) { %} + + {% } %} +
+
+
+
+ {{ctx.errors[rowIndex]}} +
+
+
+
+{% if (!ctx.readOnly && ctx.hasAddButton) { %} + +{% } %} + \ No newline at end of file diff --git a/src/templates/uswds/editgridTable/index.ts b/src/templates/uswds/editgridTable/index.ts new file mode 100644 index 00000000..e84506dd --- /dev/null +++ b/src/templates/uswds/editgridTable/index.ts @@ -0,0 +1,3 @@ +import form from './form.ejs'; + +export default { form }; \ No newline at end of file diff --git a/src/templates/uswds/index.ts b/src/templates/uswds/index.ts index 0a3780d1..a19dc6de 100644 --- a/src/templates/uswds/index.ts +++ b/src/templates/uswds/index.ts @@ -17,7 +17,9 @@ import container from './container'; import datagrid from './datagrid'; import day from './day'; import dialog from './dialog'; +import dynamicWizard from './dynamicWizard'; import editgrid from './editgrid'; +import editgridTable from './editgridTable'; import errorsList from './errorsList'; import field from './field'; import fieldset from './fieldset'; @@ -72,7 +74,9 @@ export default { datagrid, day, dialog, + dynamicWizard, editgrid, + editgridTable, errorsList, field, fieldset, diff --git a/src/templates/uswds/modalPreview/form.ejs b/src/templates/uswds/modalPreview/form.ejs index dc5b1e6a..649b14fc 100644 --- a/src/templates/uswds/modalPreview/form.ejs +++ b/src/templates/uswds/modalPreview/form.ejs @@ -4,7 +4,7 @@
+>{{ ctx.messages }}