From d2ce0372979ff1229f5261763210b4466d090606 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 30 Nov 2021 08:47:21 +0000 Subject: [PATCH] Expose static repeater context for row index --- packages/client/manifest.json | 27 ++++++++++++++++--- .../client/src/components/app/Repeater.svelte | 4 +-- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/packages/client/manifest.json b/packages/client/manifest.json index 375aea3a02..709d454d50 100644 --- a/packages/client/manifest.json +++ b/packages/client/manifest.json @@ -501,9 +501,20 @@ "defaultValue": "M" } ], - "context": { - "type": "schema" - } + "context": [ + { + "type": "schema" + }, + { + "type": "static", + "values": [ + { + "label": "Row Index", + "key": "index" + } + ] + } + ] }, "stackedlist": { "deprecated": true, @@ -3150,6 +3161,16 @@ } ] }, + { + "type": "static", + "suffix": "repeater", + "values": [ + { + "label": "Row Index", + "key": "index" + } + ] + }, { "type": "schema", "suffix": "repeater" diff --git a/packages/client/src/components/app/Repeater.svelte b/packages/client/src/components/app/Repeater.svelte index ff077f359b..39e11d12cf 100644 --- a/packages/client/src/components/app/Repeater.svelte +++ b/packages/client/src/components/app/Repeater.svelte @@ -21,8 +21,8 @@ {#if $component.empty} {:else if rows.length > 0} - {#each rows as row} - + {#each rows as row, index} + {/each}