Skip to content

Commit 0e213f2

Browse files
author
ppinette
committed
[ui-dsfr] update vue-dsfr to version 6.0.0
1 parent b46f863 commit 0e213f2

File tree

16 files changed

+4303
-3735
lines changed

16 files changed

+4303
-3735
lines changed

vertigo-ui-dsfr/package-lock.json

Lines changed: 244 additions & 275 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vertigo-ui-dsfr/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
},
1010
"dependencies": {
1111
"@gouvfr/dsfr": "^1.12.1",
12-
"@gouvminint/vue-dsfr": "^5.19.2",
13-
"oh-vue-icons": "^1.0.0-rc3",
12+
"@gouvminint/vue-dsfr": "^6.0.0",
1413
"vue": "^3.4.29"
1514
},
1615
"devDependencies": {

vertigo-ui-dsfr/src/main.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,13 @@ import RouterLink from "@/components/Routerlink.vue";
88
import DsfrFacets from "@/components/DsfrFacets.vue";
99

1010
import './utils.css'
11-
import DsfrVTable from "@/components/DsfrVTable.vue";
12-
import DsfrVTd from "@/components/DsfrVTd.vue";
1311

1412
var DSFR = {
1513
install: function (vueApp, options) {
1614
vueApp.use(VueDsfr);
1715

1816
vueApp.component('RouterLink', RouterLink)
1917
vueApp.component('DsfrFacets', DsfrFacets)
20-
vueApp.component('DsfrVTable', DsfrVTable)
21-
vueApp.component('DsfrVTd', DsfrVTd)
2218
},
2319

2420
methods: DsfrMethods,

vertigo-ui-dsfr/vite.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default defineConfig({
1414
fileName: (format) => `dsfr.${format}.js`,
1515
},
1616
rollupOptions: {
17-
external: ['vue', 'oh-vue-icons/icons'],
17+
external: ['vue'],
1818
output: {
1919
globals: {
2020
vue: 'Vue'

vertigo-ui/src/main/resources/io/vertigo/ui/components/dsfr/inputs/dsfr-slider.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
th::min="${myMin}"
1717
th::max="${myMax}"
1818
th::step="${myStep}"
19-
input_attrs="${input_attrs}"
19+
th:attr="__${input_attrs}__"
2020
>
2121
<vu:content/>
2222
</dsfr-range>

vertigo-ui/src/main/resources/io/vertigo/ui/components/dsfr/layout/dsfr-accordion.html

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,17 @@
22
vu:alias="dsfr-accordion"
33
th:assert="${componentId} != null or (${componentId == null} and ${isAccordionGroup})">
44
<th:block th:if="${isAccordionsGroup}">
5-
<dsfr-accordion
6-
th::expanded-id="|componentStates.__${componentIdGroup}__.expand|"
7-
th:@expand="|componentStates.__${componentIdGroup}__.expand = $event|"
8-
th:attr="__${other_attrs}__">
5+
<dsfr-accordion th:attr="__${other_attrs}__">
96
<vu:content/>
107
</dsfr-accordion>
118
</th:block>
12-
<th:block th:unless="${isAccordionsGroup}" th:with="o=${model.vContext['componentStates'].addComponentState(componentId).addPrimitive('expand', '')}">
13-
<dsfr-accordion
14-
th::expanded-id="|componentStates.__${componentId}__.expand|"
15-
th:@expand="|componentStates.__${componentId}__.expand = $event|"
16-
th:attr="__${other_attrs}__">
17-
<vu:content/>
18-
</dsfr-accordion>
9+
<th:block th:unless="${isAccordionsGroup}"
10+
th:with="o=${model.vContext['componentStates'].addComponentState(componentId).addPrimitive('expand', '')}">
11+
<dsfr-accordions-group th:v-model="|componentStates.__${componentId}__.expand|">
12+
<dsfr-accordion th:attr="__${other_attrs}__">
13+
<vu:content/>
14+
</dsfr-accordion>
15+
</dsfr-accordions-group>
1916
</th:block>
2017
</th:block>
2118

@@ -24,7 +21,7 @@
2421
th:assert="${componentId} != null"
2522
th:with="isAccordionsGroup=true, componentIdGroup=${componentId},
2623
o=${model.vContext['componentStates'].addComponentState(componentIdGroup).addPrimitive('expand', '')}">
27-
<dsfr-accordions-group th:attr="__${other_attrs}__">
24+
<dsfr-accordions-group th:attr="__${other_attrs}__" th:v-model="|componentStates.__${componentId}__.expand|">
2825
<vu:content/>
2926
</dsfr-accordions-group>
3027
</th:block>

vertigo-ui/src/main/resources/io/vertigo/ui/components/dsfr/table/dsfr-column.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
columnClass=${model.util.smartTypeCss(list, field, class, 'col_'+name)},
88
columnSortable=${sortable != null ? sortable : (field != null) }">
99

10-
<th:block th:with="objectKey=${model.vContext['componentStates']['__${componentId}__'].addObjectToList('columns', {'key': columnName, 'field': field, 'label': columnLabel, 'align': columnAlign, 'sortable': (modifiableTable!=null?false:columnSortable), 'classes':(class?:columnClass), 'headerClasses':(class?:columnClass) })},"/>
10+
<th:block th:with="objectKey=${model.vContext['componentStates']['__${componentId}__'].addObjectToList('columns', {'key': columnName, 'field': field, 'label': columnLabel, 'align': columnAlign, 'classes':(class?:columnClass), 'headerClasses':(class?:columnClass) })}"/>
11+
<th:block th:if="(modifiableTable!=null?false:columnSortable)"
12+
th:with="objectKey=${model.vContext['componentStates']['__${componentId}__'].addObjectToList('sortableRows', columnName)}" />
1113
<vu:include-data th:if="${field != null}" object="${list}" field="${field}"/>
1214

13-
<dsfr-v-td :props="props" th:key="${columnName}" th:with="label=null" th:attr="__${td_attrs}__">
14-
<template v-slot:default="{ props }">
15-
<vu:content><th:block th:if="${field != null}">{{ props.row.[[${field}]] }}</th:block></vu:content><!--/* Default content */-->
16-
</template>
17-
</dsfr-v-td>
15+
<template th:v-if="|colKey === '${columnName}'|">
16+
<vu:content><th:block th:if="${field != null}">{{ props.row.[[${field}]] }}</th:block></vu:content><!--/* Default content */-->
17+
</template>
1818
</th:block>
Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
<th:block th:fragment="dsfr-table(list, componentId, selectable, rowKey, rowsPerPage, sortUrl, sortBy, descending, navOnRow, color, tableClass, autoColClass, title, v-title, subtitle, v-subtitle, dontUseHeading, top_right_slot, top_left_slot, header_slot, actions_slot, additional_content_slot, contentTags, tr_attrs, item_attrs, table_attrs)"
2-
th:assert="${componentId} != null and !(${sortUrl} != null and ${sortBy} != null) and !(${descending} != null and ${sortBy} == null)"
3-
th:with="tableKey=${list},
1+
<th:block
2+
th:fragment="dsfr-table(list, componentId, selectable, rowKey, rowsPerPage, sortUrl, sortBy, descending, navOnRow, color, tableClass, autoColClass, title, v-title, subtitle, v-subtitle, dontUseHeading, top_right_slot, top_left_slot, header_slot, actions_slot, table_slot, additional_content_slot, contentTags, tr_attrs, item_attrs, table_attrs)"
3+
th:assert="${componentId} != null and !(${sortUrl} != null and ${sortBy} != null) and !(${descending} != null and ${sortBy} == null)"
4+
th:with="tableKey=${list},
45
rowIndex='props.rowIndex',
56
listSize=${model.vContext[__${list}__].size()},
67
mySelectable=${selectable?:false},
@@ -9,24 +10,38 @@
910
myAutoColClass=${autoColClass?:false}">
1011

1112
<th:block th:attr="objectKey=${model.vContext['componentStates'].addComponentState(componentId).addList('columns')},
13+
objectKey=${model.vContext['componentStates'][__${componentId}__].addList('sortableRows')},
1214
objectKey=${model.vContext['componentStates'][__${componentId}__].addList('selected')},
1315
objectKey=${model.vContext['componentStates'][__${componentId}__][loading] = false },
14-
objectKey=${model.vContext['componentStates'][__${componentId}__].addObject('pagination', {'page': 1 , 'rowsPerPage' : myRowsPerPage, 'componentId' : componentId, 'listKey' : list})}" th:remove="all" />
15-
<th:block th:if="${sortUrl != null}" th:attr="objectKey=${model.vContext['componentStates'][__${componentId}__]['pagination'].put('sortUrl', sortUrl)}" th:remove="all" />
16-
<th:block th:if="${sortUrl != null}" th:attr="objectKey=${model.vContext['componentStates'][__${componentId}__]['pagination'].put('rowsNumber', listSize)}" th:remove="all" />
17-
<th:block th:if="${sortBy != null}" th:attr="objectKey=${model.vContext['componentStates'][__${componentId}__]['pagination'].put('sortBy', sortBy)}" th:remove="all" />
18-
<th:block th:if="${descending != null}" th:attr="objectKey=${model.vContext['componentStates'][__${componentId}__]['pagination'].put('descending', descending)}" th:remove="all" />
16+
objectKey=${model.vContext['componentStates'][__${componentId}__].addObject('pagination', {'page': 1 , 'rowsPerPage' : myRowsPerPage, 'componentId' : componentId, 'listKey' : list})}"
17+
th:remove="all"/>
18+
<th:block th:if="${sortUrl != null}"
19+
th:attr="objectKey=${model.vContext['componentStates'][__${componentId}__]['pagination'].put('sortUrl', sortUrl)}"
20+
th:remove="all"/>
21+
<th:block th:if="${sortUrl != null}"
22+
th:attr="objectKey=${model.vContext['componentStates'][__${componentId}__]['pagination'].put('rowsNumber', listSize)}"
23+
th:remove="all"/>
24+
<th:block th:if="${sortBy != null}"
25+
th:attr="objectKey=${model.vContext['componentStates'][__${componentId}__]['pagination'].put('sortBy', sortBy)}"
26+
th:remove="all"/>
27+
<th:block th:if="${descending != null}"
28+
th:attr="objectKey=${model.vContext['componentStates'][__${componentId}__]['pagination'].put('descending', descending)}"
29+
th:remove="all"/>
1930

20-
<dsfr-v-table th:title="${vTitle==null?title?:'':''}" th::title="${vTitle?:''}"
21-
th::columns="|componentStates.${componentId}.columns|"
22-
th::rows="|vueData.${list}|"
23-
th:attr="__${table_attrs}__">
24-
<template v-slot:default="{ props }">
31+
<dsfr-data-table th:title="${vTitle==null?title?:'':''}" th::title="${vTitle?:''}"
32+
th::header-row="|componentStates.${componentId}.columns|"
33+
th::rows="|vueData.${list}|"
34+
th::rows-per-page="|componentStates.${componentId}.pagination.rowsPerPage|"
35+
th::sortable-rows="|componentStates.${componentId}.sortableRows|"
36+
th:attr="__${table_attrs}__">
37+
<vu:content-slot name="table_slot" th:with="label=null, title=null, vTitle=null"/>
38+
<template #cell="{ colKey, cell }">
2539
<vu:content></vu:content>
26-
<vu:dsfr-column name="action" label="Actions" sortable="false" align="right" th:if="${actions_slot != null}">
40+
<vu:dsfr-column name="action" label="Actions" sortable="false" align="right"
41+
th:if="${actions_slot != null}">
2742
<vu:content-slot name="actions_slot" th:with="label=null, title=null, vTitle=null"/>
2843
</vu:dsfr-column>
2944
</template>
30-
</dsfr-v-table>
45+
</dsfr-data-table>
3146

3247
</th:block>

0 commit comments

Comments
 (0)