|
18 | 18 |
|
19 | 19 | <th:block th:fragment="dsfr-button-submit-confirm(label, icon, action, componentId, title, loading, titleMessage, confirmMessage, labelOk, labelCancel, modal_attrs, other_attrs)"
|
20 | 20 | th:assert="(${label} != null or (${icon} != null and ${title} != null)) and ${action} != null and ${componentId} != null"
|
21 |
| - th:with="myComponentId='${componentId}', |
22 |
| - myLabelOk=${labelOk?:'Oui'}, |
| 21 | + th:with="myLabelOk=${labelOk?:'Oui'}, |
23 | 22 | myLabelCancel=${labelCancel?:'Non'},
|
24 | 23 | myLoading=${loading}?:true"
|
25 |
| - th:attr="objectKey=${model.vContext['componentStates'].addComponentState(myComponentId).addPrimitive('confirm',false)}"> |
| 24 | + th:attr="objectKey=${model.vContext['componentStates'].addComponentState(componentId).addPrimitive('confirm',false)}"> |
26 | 25 |
|
27 | 26 | <dsfr-button th:icon="${icon?:''}"
|
28 | 27 | th::icon-only="${label==null}"
|
29 | 28 | th:label="${label?:''}"
|
30 | 29 | th:title="${vTitle==null ? (title?:'') : ''}"
|
31 | 30 | th::title="${vTitle?:''}"
|
32 |
| - th:@click="|componentStates.${myComponentId}.confirm = true|" |
33 |
| - th:ref="${myComponentId}" |
| 31 | + th:@click="|componentStates.__${componentId}__.confirm = true|" |
| 32 | + th:ref="__${componentId}__" |
34 | 33 | type="button"
|
35 | 34 | th:attr="__${other_attrs}__">
|
36 | 35 | <span class="sr-only" th:if="${label==null && vTitle==null}" vu:text="${title?:''}"></span>
|
37 | 36 | <span class="sr-only" th:if="${label==null && vTitle!=null}" th:text="|{{ ${vTitle?:''} }}|"></span>
|
38 | 37 | </dsfr-button>
|
39 |
| - <dsfr-modal th:v-model:opened="|componentStates.${myComponentId}.confirm|" |
40 |
| - th:@close="|componentStates.${myComponentId}.confirm = false|" |
| 38 | + <dsfr-modal th:v-model:opened="|componentStates.__${componentId}__.confirm|" |
| 39 | + th:@close="|componentStates.__${componentId}__.confirm = false|" |
41 | 40 | th:title="${titleMessage}"
|
42 | 41 | th::actions="|[
|
43 | 42 | {label: '${myLabelOk}',
|
|
48 | 47 | {label: '${myLabelCancel}',
|
49 | 48 | type: 'button',
|
50 | 49 | secondary: true,
|
51 |
| - onClick () { componentStates.${myComponentId}.confirm = false } |
| 50 | + onClick () { componentStates.__${componentId}__.confirm = false } |
52 | 51 | }]|"
|
53 |
| - th::origin="|$refs.${myComponentId}|" |
| 52 | + th::origin="|$refs.__${componentId}__|" |
54 | 53 | th:attr="__${modal_attrs}__">
|
55 | 54 | <template #default>
|
56 | 55 | <vu:content>
|
|
0 commit comments