diff --git a/fragments/datalist/hatch.js b/fragments/datalist/hatch.js
index 8728044b8..c586f083e 100644
--- a/fragments/datalist/hatch.js
+++ b/fragments/datalist/hatch.js
@@ -3,7 +3,17 @@ module.exports = {
f.wrap($, 'themecleanflex-components-block')
f.bindAttribute($.parent(),'model','model')
- let heading = $.find('th').first()
+ let heading = $.find('th span').first()
+
+ let dropdownArrow = $.find('svg').first()
+ let dropdownArrowClasses = `{
+ 'rotate-0': active,
+ 'rotate-180': !active,
+ 'hidden': !model.sortable
+ }`
+ f.bindAttribute(dropdownArrow, 'class', dropdownArrowClasses, false)
+ f.bindEvent(dropdownArrow, 'click', "toggleSort(i)");
+
f.mapField(heading, 'storageData')
}
}
\ No newline at end of file
diff --git a/fragments/datalist/template.html b/fragments/datalist/template.html
index 8f7857fe4..116c9c5d5 100644
--- a/fragments/datalist/template.html
+++ b/fragments/datalist/template.html
@@ -1,9 +1,9 @@
-
+
-
- Column Header
+ |
+ Column1 Header
@@ -12,8 +12,13 @@
|
- Column item |
- Column item |
+ Column1 item1 |
+ Column2 item1 |
+
+
+
+ Column1 item2 |
+ Column2 item2 |
diff --git a/fragments/datalist/template.vue b/fragments/datalist/template.vue
index 094d8015e..2d19adbb6 100644
--- a/fragments/datalist/template.vue
+++ b/fragments/datalist/template.vue
@@ -1,16 +1,32 @@
-
+
- {{storageData}} |
+
+ {{storageData}}
+
+ |
- Column item |
- Column item |
+ Column1 item1 |
+ Column2 item1 |
+
+
+ Column1 item2 |
+ Column2 item2 |
@@ -23,7 +39,9 @@
export default {
props: ['model'],
data() {
+ const numElements = this.model.columns ? this.model.columns.length : 0;
return {
+ active: new Array(numElements).fill(false),
storageData: JSON.parse(localStorage.getItem('list'))
}
},
@@ -33,6 +51,13 @@
window.addEventListener('storage', () => {
this.storageData = JSON.parse(localStorage.getItem('list'))
});
+ },
+ methods: {
+ toggleSort: function() {
+ this.active.forEach( (active,j) => {
+ Vue.set(this.active, j, j === i ? !this.active[j] : false);
+ })
+ },
}
}
diff --git a/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/datalist/template.vue b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/datalist/template.vue
index 094d8015e..2d19adbb6 100644
--- a/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/datalist/template.vue
+++ b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/datalist/template.vue
@@ -1,16 +1,32 @@
-
+
- {{storageData}} |
+
+ {{storageData}}
+
+ |
- Column item |
- Column item |
+ Column1 item1 |
+ Column2 item1 |
+
+
+ Column1 item2 |
+ Column2 item2 |
@@ -23,7 +39,9 @@
export default {
props: ['model'],
data() {
+ const numElements = this.model.columns ? this.model.columns.length : 0;
return {
+ active: new Array(numElements).fill(false),
storageData: JSON.parse(localStorage.getItem('list'))
}
},
@@ -33,6 +51,13 @@
window.addEventListener('storage', () => {
this.storageData = JSON.parse(localStorage.getItem('list'))
});
+ },
+ methods: {
+ toggleSort: function() {
+ this.active.forEach( (active,j) => {
+ Vue.set(this.active, j, j === i ? !this.active[j] : false);
+ })
+ },
}
}
diff --git a/ui.apps/src/main/content/jcr_root/etc/felibs/themecleanflex/css/build.css b/ui.apps/src/main/content/jcr_root/etc/felibs/themecleanflex/css/build.css
index bc623a76a..1312ca351 100644
--- a/ui.apps/src/main/content/jcr_root/etc/felibs/themecleanflex/css/build.css
+++ b/ui.apps/src/main/content/jcr_root/etc/felibs/themecleanflex/css/build.css
@@ -467,6 +467,10 @@ button,
cursor: pointer;
}
+table {
+ border-collapse: collapse;
+}
+
h1,
h2,
h3,
@@ -720,6 +724,10 @@ video {
display: flex;
}
+.table {
+ display: table;
+}
+
.hidden {
display: none;
}
@@ -1297,6 +1305,14 @@ video {
z-index: 10;
}
+.rotate-0 {
+ --transform-rotate: 0;
+}
+
+.rotate-180 {
+ --transform-rotate: 180deg;
+}
+
.transition {
transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
}