+ {% if(ctx.rows.length) { %}
+
+ {% ctx.rows.forEach(function(row, rowIndex) { %}
+
+ {% } %}
{% if (!ctx.readOnly && ctx.hasAddButton) { %}
-
-
-
+
+
+
{% } %}
diff --git a/src/formio/templates/editGridRow.ejs b/src/formio/templates/editGridRow.ejs
index c3c5b0c74..c36967b55 100644
--- a/src/formio/templates/editGridRow.ejs
+++ b/src/formio/templates/editGridRow.ejs
@@ -1,20 +1,16 @@
-
- {% for (const key in ctx.flattenedComponents) { %}
- {% if (ctx.isVisibleInRow(ctx.flattenedComponents[key])) { %}
-
{{ctx.flattenedComponents[key].label}}: {{ ctx.getView(ctx.flattenedComponents[key], ctx.row[key]) }}
- {% } %}
- {% } %}
-
- {% if (!ctx.self.options.readOnly) { %}
-
+ {% for (const key in ctx.flattenedComponents) { %}
+ {% if (ctx.isVisibleInRow(ctx.flattenedComponents[key])) { %}
+
{{ctx.flattenedComponents[key].label}}: {{ ctx.getView(ctx.flattenedComponents[key], ctx.row[key]) }}
+ {% } %}
{% } %}
-
+
+{% if (!ctx.self.options.readOnly) { %}
+
+
+
+
+{% } %}
diff --git a/src/i18n/compiled/en.json b/src/i18n/compiled/en.json
index f617a4153..3934b1d00 100644
--- a/src/i18n/compiled/en.json
+++ b/src/i18n/compiled/en.json
@@ -1175,6 +1175,12 @@
"value": "Your payment is received and processed."
}
],
+ "cKFCTI": [
+ {
+ "type": 0,
+ "value": "Add another"
+ }
+ ],
"cxDC/G": [
{
"type": 0,
diff --git a/src/i18n/compiled/nl.json b/src/i18n/compiled/nl.json
index c3d19a3e3..02671942d 100644
--- a/src/i18n/compiled/nl.json
+++ b/src/i18n/compiled/nl.json
@@ -1179,6 +1179,12 @@
"value": "Uw betaling is ontvangen en verwerkt."
}
],
+ "cKFCTI": [
+ {
+ "type": 0,
+ "value": "Nog één toevoegen"
+ }
+ ],
"cxDC/G": [
{
"type": 0,
diff --git a/src/i18n/messages/en.json b/src/i18n/messages/en.json
index 7777efebd..03e72a82a 100644
--- a/src/i18n/messages/en.json
+++ b/src/i18n/messages/en.json
@@ -544,6 +544,11 @@
"description": "payment registered status",
"originalDefault": "Your payment is received and processed."
},
+ "cKFCTI": {
+ "defaultMessage": "Add another",
+ "description": "Edit grid add button, default label text",
+ "originalDefault": "Add another"
+ },
"cxDC/G": {
"defaultMessage": "The required field is not filled out.",
"description": "ZOD 'required' error message",
diff --git a/src/i18n/messages/nl.json b/src/i18n/messages/nl.json
index 36cd05c53..af0937c2b 100644
--- a/src/i18n/messages/nl.json
+++ b/src/i18n/messages/nl.json
@@ -550,6 +550,11 @@
"description": "payment registered status",
"originalDefault": "Your payment is received and processed."
},
+ "cKFCTI": {
+ "defaultMessage": "Nog één toevoegen",
+ "description": "Edit grid add button, default label text",
+ "originalDefault": "Add another"
+ },
"cxDC/G": {
"defaultMessage": "Het verplichte veld is niet ingevuld.",
"description": "ZOD 'required' error message",
diff --git a/src/scss/components/_button-group.scss b/src/scss/components/_button-group.scss
new file mode 100644
index 000000000..bcc15b13f
--- /dev/null
+++ b/src/scss/components/_button-group.scss
@@ -0,0 +1,23 @@
+/**
+ * Extensions on the Utrecht button-group community component.
+ */
+@use 'microscope-sass/lib/bem';
+
+@import '@utrecht/components/button-group/css/index';
+
+.utrecht-button-group {
+ // A button group used in an edit grid item
+ @include bem.modifier('openforms-editgrid') {
+ // there currently does not exist a design token in the upstream component, and
+ // the alignment is also contextual, so we opt for an open-forms extension that
+ // can be tweaked with proprietary design tokens.
+ justify-content: var(--of-button-group-editgrid-justify-content, flex-end);
+ }
+}
+
+// Reference: https://nl-design-system.github.io/utrecht/storybook/?path=/docs/css_css-button-group--docs
+@include mobile-only {
+ .utrecht-button-group {
+ @include utrecht-button-group--vertical;
+ }
+}
diff --git a/src/scss/components/_editgrid.scss b/src/scss/components/_editgrid.scss
index 86398ab2d..9b4a14987 100644
--- a/src/scss/components/_editgrid.scss
+++ b/src/scss/components/_editgrid.scss
@@ -1,42 +1,54 @@
-@import '~microscope-sass/lib/color';
-@import '~microscope-sass/lib/typography';
-
-@import '../mixins/prefix';
-
-.#{prefix(editgrid)} {
- @include body;
-
- ul {
- padding: 0;
- }
-
- &__group {
- padding: $grid-margin-4;
- border-style: solid;
- border-width: thin;
- border-color: $color-border;
-
- &:not(:first-child) {
- border-top-style: none;
+/**
+ * The Utrecht community components do not seem to have a ready-to-use component
+ * for the edit grid layout, so we can't shake of some custom CSS yet.
+ */
+@use 'microscope-sass/lib/bem';
+
+.openforms-editgrid {
+ line-height: var(--of-editgrid-line-height, var(--utrecht-document-line-height));
+
+ display: flex;
+ flex-direction: column;
+ gap: var(--of-editgrid-gap);
+
+ @include bem.element('item') {
+ // NL DS markup uses a field with nested fieldset element inside
+ .utrecht-form-fieldset__fieldset {
+ display: flex;
+ flex-direction: column;
+ gap: var(--of-editgrid-item-gap);
}
- }
- &__group-label {
- @include h4;
- padding-bottom: $grid-margin-4;
- }
+ border: var(--of-editgrid-item-border);
+ max-inline-size: var(--of-editgrid-item-max-inline-size);
+ padding-block-end: var(--of-editgrid-item-padding-block-end);
+ padding-block-start: var(--of-editgrid-item-padding-block-start);
+ padding-inline-end: var(--of-editgrid-item-padding-inline-end);
+ padding-inline-start: var(--of-editgrid-item-padding-inline-start);
- &__list {
- list-style: none;
- }
-
- &__group-actions {
- padding-top: $grid-margin-2;
+ // ensure borders are 'collapsed'
+ & + .openforms-editgrid__item {
+ border-block-start: none;
+ }
}
- &__add-button {
- display: flex;
- width: 100%;
- padding: $grid-margin-2 0;
+ @include bem.element('item-heading') {
+ font-family: var(
+ --of-editgrid-item-heading-font-family,
+ var(--utrecht-form-fieldset-legend-font-family, var(--utrecht-document-font-family))
+ );
+ font-size: var(
+ --of-editgrid-item-heading-font-size,
+ var(--utrecht-form-fieldset-legend-font-size)
+ );
+ line-height: var(
+ --of-editgrid-item-heading-line-height,
+ var(--utrecht-form-fieldset-legend-line-height)
+ );
+ // display: contents was considered, but that doesn't allow specifying different
+ // margins/paddings at the bottom to create extra space :(
+ // legend element doesn't care about the fieldset itself having display: flex, so we
+ // must treat this specially
+ margin-block-end: var(--of-editgrid-item-heading-margin-block-end, var(--of-editgrid-item-gap));
}
}
diff --git a/src/scss/components/_language-selection.scss b/src/scss/components/_language-selection.scss
index 3859fb71a..39b900f33 100644
--- a/src/scss/components/_language-selection.scss
+++ b/src/scss/components/_language-selection.scss
@@ -1,7 +1,6 @@
@import '~microscope-sass/lib/typography';
@import '@utrecht/components/dist/alternate-lang-nav/css/index.css';
-@import '@utrecht/components/dist/button-group/css/index.css';
/**
* Allow using different spacing rules for this specific component
diff --git a/src/styles.scss b/src/styles.scss
index 1bc9e1e28..aa85986e3 100644
--- a/src/styles.scss
+++ b/src/styles.scss
@@ -24,6 +24,7 @@
@import './scss/components/alert';
@import './scss/components/anchor';
@import './scss/components/button';
+@import './scss/components/button-group';
@import './scss/components/card';
@import './scss/components/content';
@import './scss/components/errors';