Use a stimulus controller to implement collectionType for specifications/parameters.

This commit is contained in:
Jan Böhmer 2022-08-01 22:28:09 +02:00
parent f7ce94c168
commit 537b7fad7f
6 changed files with 153 additions and 91 deletions

View file

@ -0,0 +1,18 @@
{% macro controller(form, deleteMessage) %}
{{ stimulus_controller('elements/collection_type', {
'deleteMessage': 'parameter.delete.confirm'|trans,
'prototype': form_widget(form.parameters.vars.prototype)|e('html_attr')
}) }}
{% endmacro %}
{% macro target() %}
{{ stimulus_target('elements/collection_type', 'target') }}
{% endmacro %}
{% macro create_btn() %}
{{ stimulus_action('elements/collection_type', 'createElement') }}
{% endmacro %}
{% macro delete_btn() %}
{{ stimulus_action('elements/collection_type', 'deleteElement') }}
{% endmacro %}