Skip to content

Commit b1e7ee6

Browse files
author
ppinette
committed
[ui-dsfr] update vue-dsfr to version 7.0.0
1 parent 1ccfe55 commit b1e7ee6

File tree

14 files changed

+2831
-2649
lines changed

14 files changed

+2831
-2649
lines changed

vertigo-ui-dsfr/package-lock.json

Lines changed: 26 additions & 10 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"dependencies": {
1111
"@gouvfr/dsfr": "^1.12.1",
12-
"@gouvminint/vue-dsfr": "^6.0.0",
12+
"@gouvminint/vue-dsfr": "^7.0.0",
1313
"vue": "^3.4.29"
1414
},
1515
"devDependencies": {

vertigo-ui-dsfr/src/components/DsfrVTable.vue

Lines changed: 0 additions & 87 deletions
This file was deleted.

vertigo-ui-dsfr/src/components/DsfrVTd.vue

Lines changed: 0 additions & 27 deletions
This file was deleted.

vertigo-ui-dsfr/src/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import RouterLink from "@/components/Routerlink.vue";
88
import DsfrFacets from "@/components/DsfrFacets.vue";
99

1010
import './utils.css'
11+
import './surcharges.css'
1112

1213
var DSFR = {
1314
install: function (vueApp, options) {

vertigo-ui-dsfr/src/surcharges.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.fr-table .fr-select {
2+
max-width: min-content;
3+
}
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
<th:block th:fragment="dsfr-column-table(list, field, name, label, align, sortable, datetimeFormat, class, td_attrs)" vu:alias="dsfr-column"
22
vu:selector="${renderTableAsGrid == null || !renderTableAsGrid }"
33
th:assert="${(field != null) or (name != null and label != null)}"
4-
th:with="columnName=${name != null ? name : field},
4+
th:with="columnName=${name != null ? name : 'col_' + field},
55
columnLabel=${label != null ? label : model.util.label(list + '.' + field)},
66
columnAlign=${model.util.smartTypeAlign(list, field, align)},
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, '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)}" />
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) })}"/>
1311
<vu:include-data th:if="${field != null}" object="${list}" field="${field}"/>
1412

1513
<template th:v-if="|colKey === '${columnName}'|">
16-
<vu:content><th:block th:if="${field != null}">{{ props.row.[[${field}]] }}</th:block></vu:content><!--/* Default content */-->
14+
<vu:content><th:block th:if="${field != null}">{{ cell.[[${field}]] }}</th:block></vu:content><!--/* Default content */-->
1715
</template>
1816
</th:block>

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
objectKey=${model.vContext['componentStates'][__${componentId}__].addList('sortableRows')},
1414
objectKey=${model.vContext['componentStates'][__${componentId}__].addList('selected')},
1515
objectKey=${model.vContext['componentStates'][__${componentId}__][loading] = false },
16-
objectKey=${model.vContext['componentStates'][__${componentId}__].addObject('pagination', {'page': 1 , 'rowsPerPage' : myRowsPerPage, 'componentId' : componentId, 'listKey' : list})}"
16+
objectKey=${model.vContext['componentStates'][__${componentId}__].addObject('pagination', {'page': 0 , 'rowsPerPage' : myRowsPerPage, 'componentId' : componentId, 'listKey' : list})}"
1717
th:remove="all"/>
1818
<th:block th:if="${sortUrl != null}"
1919
th:attr="objectKey=${model.vContext['componentStates'][__${componentId}__]['pagination'].put('sortUrl', sortUrl)}"
@@ -29,10 +29,13 @@
2929
th:remove="all"/>
3030

3131
<dsfr-data-table th:title="${vTitle==null?title?:'':''}" th::title="${vTitle?:''}"
32-
th::header-row="|componentStates.${componentId}.columns|"
32+
th::headers-row="|componentStates.${componentId}.columns|"
3333
th::rows="|vueData.${list}|"
3434
th::rows-per-page="|componentStates.${componentId}.pagination.rowsPerPage|"
35-
th::sortable-rows="|componentStates.${componentId}.sortableRows|"
35+
th::sortable-rows="|componentStates.${componentId}.columns.filter(o => o.sortable).map(o => o.key)|"
36+
th:v-model:selection="|componentStates.${componentId}.selected|"
37+
th::selectable-rows="${mySelectable ? 'true' : 'false'}"
38+
th:v-model:current-page="|componentStates.${componentId}.pagination.page|"
3639
th:attr="__${table_attrs}__">
3740
<vu:content-slot name="table_slot" th:with="label=null, title=null, vTitle=null"/>
3841
<template #cell="{ colKey, cell }">

0 commit comments

Comments
 (0)