@policystudio/policy-studio-ui-vue 1.1.5 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/psui_styles.css +295 -122
- package/package.json +1 -1
- package/src/assets/scss/base.scss +9 -0
- package/src/assets/scss/components/PsDraggable.scss +20 -0
- package/src/assets/scss/components/PsTableResults.scss +202 -80
- package/src/components/controls/PsDraggable.vue +2 -1
- package/src/components/forms/PsDropdown.vue +4 -16
- package/src/components/table-results/PsTableResults.vue +148 -3
- package/src/components/table-results/PsTableResultsBody.vue +0 -1
- package/src/components/table-results/PsTableResultsHead.vue +2 -2
- package/src/components/table-results/PsTableResultsHeadComparison.vue +122 -0
- package/src/components/table-results/PsTableResultsRow.vue +0 -1
- package/src/stories/TableResults.stories.js +6156 -27
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<thead>
|
|
3
|
+
<tr>
|
|
4
|
+
<th rowspan="2">
|
|
5
|
+
<div v-if="firstColumnTitle">
|
|
6
|
+
<p class="title">{{ firstColumnTitle }}</p>
|
|
7
|
+
</div>
|
|
8
|
+
<div>
|
|
9
|
+
<p v-if="firstColumnDescription" class="description">{{ firstColumnDescription }}</p>
|
|
10
|
+
</div>
|
|
11
|
+
</th>
|
|
12
|
+
|
|
13
|
+
<th
|
|
14
|
+
v-for="columnGroup of header"
|
|
15
|
+
:key="columnGroup.key"
|
|
16
|
+
:colspan="columnGroup.columns.reduce( (prev, cur) => cur.isActive ? prev + 1 : prev, 0 )"
|
|
17
|
+
>
|
|
18
|
+
<div class="psui-flex psui-space-x-1 psui-items-center psui-show-childrens-on-hover">
|
|
19
|
+
<p class="title">{{ columnGroup.title }}</p>
|
|
20
|
+
<PsIcon
|
|
21
|
+
icon="info"
|
|
22
|
+
size="18"
|
|
23
|
+
class="psui-cursor-pointer"
|
|
24
|
+
icon-classes="psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
|
|
25
|
+
:style="{ display: 'flex' }"
|
|
26
|
+
@click.native="$emit('click-column-group-helper', columnGroup, $event)"
|
|
27
|
+
/>
|
|
28
|
+
</div>
|
|
29
|
+
</th>
|
|
30
|
+
</tr>
|
|
31
|
+
|
|
32
|
+
<tr>
|
|
33
|
+
<template v-for="columnGroup of header">
|
|
34
|
+
<th
|
|
35
|
+
v-for="column of columnGroup.columns"
|
|
36
|
+
:key="`${columnGroup.key}-${column.key}`"
|
|
37
|
+
:style="`--dataCount: ${columnGroup.columns.reduce( (prev, cur) => cur.isActive ? prev + 1 : prev, 0 )};`"
|
|
38
|
+
>
|
|
39
|
+
<div class="psui-flex psui-flex-col psui-justify-center psui-items-center psui-text-center">
|
|
40
|
+
<div class="psui-show-childrens-on-hover absolute-childrens psui-mb-px">
|
|
41
|
+
<p class="title" v-if="column.title">{{ column.title }}</p>
|
|
42
|
+
|
|
43
|
+
<PsIcon
|
|
44
|
+
icon="info"
|
|
45
|
+
size="16"
|
|
46
|
+
class="psui-cursor-pointer helper"
|
|
47
|
+
icon-classes="psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
|
|
48
|
+
:style="{ display: 'flex' }"
|
|
49
|
+
@click.native="$emit('click-column-helper', column, $event)"
|
|
50
|
+
/>
|
|
51
|
+
|
|
52
|
+
<PsIcon
|
|
53
|
+
v-if="showOrder"
|
|
54
|
+
:icon="orderDirection == 'asc' ? 'arrow_downward' : 'arrow_upward'"
|
|
55
|
+
:type="orderDirection == 'asc' ? 'arrow_upward' : 'arrow_upward'"
|
|
56
|
+
size="16"
|
|
57
|
+
class="psui-cursor-pointer helper"
|
|
58
|
+
icon-classes="psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
|
|
59
|
+
:style="{ display: 'flex' }"
|
|
60
|
+
@click.native="$emit('click-order-column', column)"
|
|
61
|
+
/>
|
|
62
|
+
</div>
|
|
63
|
+
<p class="description" v-if="column.description">{{ column.description }}</p>
|
|
64
|
+
</div>
|
|
65
|
+
</th>
|
|
66
|
+
</template>
|
|
67
|
+
</tr>
|
|
68
|
+
</thead>
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
<script>
|
|
72
|
+
import PsIcon from '../ui/PsIcon.vue'
|
|
73
|
+
export default {
|
|
74
|
+
name: 'PsTableResultsHead',
|
|
75
|
+
components: { PsIcon },
|
|
76
|
+
props: {
|
|
77
|
+
/**
|
|
78
|
+
* It sets the title for the first column.
|
|
79
|
+
*/
|
|
80
|
+
firstColumnTitle: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: ''
|
|
83
|
+
},
|
|
84
|
+
/**
|
|
85
|
+
* It sets the description for the first column.
|
|
86
|
+
*/
|
|
87
|
+
firstColumnDescription: {
|
|
88
|
+
type: String,
|
|
89
|
+
default: ''
|
|
90
|
+
},
|
|
91
|
+
/**
|
|
92
|
+
* It sets the values which will be use to render the header.
|
|
93
|
+
*/
|
|
94
|
+
header: {
|
|
95
|
+
type: Array,
|
|
96
|
+
required: true,
|
|
97
|
+
default: () => {
|
|
98
|
+
return []
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
/**
|
|
102
|
+
* this sets whether sorting will be displayed.
|
|
103
|
+
*/
|
|
104
|
+
showOrder: {
|
|
105
|
+
type: Boolean,
|
|
106
|
+
default: false
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
computed: {
|
|
110
|
+
columnsSelectedForStudy() {
|
|
111
|
+
return this.$parent.columnsSelectedForStudy
|
|
112
|
+
},
|
|
113
|
+
orderColumn() {
|
|
114
|
+
return this.$parent.orderColumn
|
|
115
|
+
},
|
|
116
|
+
orderDirection() {
|
|
117
|
+
return this.$parent.orderDirection
|
|
118
|
+
},
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
</script>
|
|
122
|
+
<style> /* Please, use the file src/assets/scss/components/PsTableResults.scss */ </style>
|