@policystudio/policy-studio-ui-vue 1.1.2 → 1.1.4
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 +2 -1
- package/package.json +1 -1
- package/src/assets/scss/components/PsChartLegend.scss +1 -1
- package/src/assets/scss/components/PsTableResults.scss +1 -1
- package/src/components/badges-and-tags/PsChartLegend.vue +9 -4
- package/src/components/forms/PsDropdown.vue +33 -10
- package/src/components/table-results/PsTableResults.vue +125 -82
package/dist/css/psui_styles.css
CHANGED
|
@@ -1711,6 +1711,7 @@ video {
|
|
|
1711
1711
|
color: rgba(121, 132, 144, var(--text-opacity));
|
|
1712
1712
|
font-size: 16px;
|
|
1713
1713
|
line-height: 130%;
|
|
1714
|
+
margin-top: 0.25rem;
|
|
1714
1715
|
}
|
|
1715
1716
|
|
|
1716
1717
|
.psui-el-climate-zone-badge {
|
|
@@ -2077,7 +2078,7 @@ video {
|
|
|
2077
2078
|
|
|
2078
2079
|
.psui-el-table-results tbody tr td:first-child {
|
|
2079
2080
|
padding-left: 0;
|
|
2080
|
-
padding-right:
|
|
2081
|
+
padding-right: 0.5rem;
|
|
2081
2082
|
text-align: left;
|
|
2082
2083
|
display: block;
|
|
2083
2084
|
background-color: #ffffff ;
|
package/package.json
CHANGED
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
&:first-child {
|
|
115
|
-
@apply psui-pl-0 psui-pr-
|
|
115
|
+
@apply psui-pl-0 psui-pr-2 psui-text-left psui-block psui-bg-white psui-sticky psui-z-10 psui-left-0;
|
|
116
116
|
box-shadow: inset -1px 0px 0px #EBEEF0;
|
|
117
117
|
padding-top: 8px;
|
|
118
118
|
padding-bottom: 8px;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="psui-el-chart-legend">
|
|
3
3
|
<div class="psui-flex psui-flex-shrink-0">
|
|
4
|
-
<div class="psui-el-chart-legend-dot" :style="dotColor"
|
|
4
|
+
<div class="psui-el-chart-legend-dot" :style="dotColor"/>
|
|
5
5
|
</div>
|
|
6
|
-
<div class="psui-flex-grow-1">
|
|
6
|
+
<div class="psui-flex-grow-1 flex psui-flex-col">
|
|
7
7
|
<div class="psui-el-chart-legend-text">{{ text }}</div>
|
|
8
|
-
<
|
|
9
|
-
|
|
8
|
+
<div class="flex psui-items-center psui-flex-shrink-0 psui-gap-1">
|
|
9
|
+
<span v-if="this.total" class="psui-el-chart-legend-total">{{ total }}</span>
|
|
10
|
+
<span class="psui-text-gray-30" v-if="total && percentage"> | </span>
|
|
11
|
+
<span class="psui-el-chart-legend-percentage" v-if="percentage">
|
|
12
|
+
{{ percentage }}%
|
|
13
|
+
</span>
|
|
14
|
+
</div>
|
|
10
15
|
</div>
|
|
11
16
|
</div>
|
|
12
17
|
</template>
|
|
@@ -77,6 +77,20 @@ export default {
|
|
|
77
77
|
type: Boolean,
|
|
78
78
|
default: false,
|
|
79
79
|
},
|
|
80
|
+
/**
|
|
81
|
+
* It sets the vertical position.
|
|
82
|
+
*/
|
|
83
|
+
position: {
|
|
84
|
+
type: String,
|
|
85
|
+
validator: (value)=> ['bottom','top', 'custom'].includes(value)
|
|
86
|
+
},
|
|
87
|
+
/**
|
|
88
|
+
* It sets the custom positions.
|
|
89
|
+
*/
|
|
90
|
+
customPosition: {
|
|
91
|
+
type: String,
|
|
92
|
+
default: '',
|
|
93
|
+
},
|
|
80
94
|
},
|
|
81
95
|
data() {
|
|
82
96
|
return {
|
|
@@ -139,6 +153,16 @@ export default {
|
|
|
139
153
|
PSDropdownDialog.style.left = `${rectTrigger.x}px`
|
|
140
154
|
}
|
|
141
155
|
|
|
156
|
+
if(this.position == 'top') {
|
|
157
|
+
PSDropdownDialog.style.top = `${(rectTrigger.y - rectDialog.height) - 10}px`
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if(this.position == 'custom') {
|
|
161
|
+
PSDropdownDialog.style = this.customPosition
|
|
162
|
+
PSDropdownDialog.style.display = 'block'
|
|
163
|
+
PSDropdownDialog.style.position = 'absolute'
|
|
164
|
+
}
|
|
165
|
+
|
|
142
166
|
if (rectTrigger.top < 10) {
|
|
143
167
|
this.close()
|
|
144
168
|
console.warn('The dropdown are too close from the top of the page')
|
|
@@ -152,8 +176,10 @@ export default {
|
|
|
152
176
|
open() {
|
|
153
177
|
this.$emit('open')
|
|
154
178
|
this.show = true
|
|
155
|
-
this.$refs.PSDropdownDialog
|
|
156
|
-
|
|
179
|
+
if(this.$refs.PSDropdownDialog){
|
|
180
|
+
this.$refs.PSDropdownDialog.style.opacity = 0
|
|
181
|
+
this.$refs.PSDropdownDialog.style.display = 'block'
|
|
182
|
+
}
|
|
157
183
|
setTimeout(() => {
|
|
158
184
|
this.updatePosition()
|
|
159
185
|
this.watchParentScrolling()
|
|
@@ -165,8 +191,10 @@ export default {
|
|
|
165
191
|
close() {
|
|
166
192
|
if (this.show) {
|
|
167
193
|
this.$emit('close')
|
|
168
|
-
this.$refs.PSDropdownDialog
|
|
169
|
-
|
|
194
|
+
if(this.$refs.PSDropdownDialog){
|
|
195
|
+
this.$refs.PSDropdownDialog.style.display = 'none'
|
|
196
|
+
this.$refs.PSDropdownDialog.style.opacity = 0
|
|
197
|
+
}
|
|
170
198
|
this.show = false
|
|
171
199
|
this.unwatchParentScrolling()
|
|
172
200
|
}
|
|
@@ -179,12 +207,7 @@ export default {
|
|
|
179
207
|
},
|
|
180
208
|
clickOutside(event) {
|
|
181
209
|
if (!this.show) return
|
|
182
|
-
if (
|
|
183
|
-
!(
|
|
184
|
-
this.$refs.PSDropdown == event.target ||
|
|
185
|
-
this.$refs.PSDropdown.contains(event.target)
|
|
186
|
-
)
|
|
187
|
-
) {
|
|
210
|
+
if (!this.$refs.PSDropdown == event.target || !this.$refs.PSDropdown?.contains(event.target)) {
|
|
188
211
|
this.close()
|
|
189
212
|
}
|
|
190
213
|
},
|
|
@@ -29,89 +29,127 @@
|
|
|
29
29
|
>
|
|
30
30
|
<td>
|
|
31
31
|
<div
|
|
32
|
-
class="
|
|
33
|
-
:style="{ paddingLeft: `${item.deep * 16}px` }"
|
|
32
|
+
class="psui-flex psui-justify-between"
|
|
34
33
|
>
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
size="24"
|
|
39
|
-
class="actions-button psui-transition psui-transform"
|
|
40
|
-
:icon-classes="item.is_disabled ? 'psui-text-gray-40' : getIconClasses(item)"
|
|
41
|
-
:style="{ display: 'flex' }"
|
|
42
|
-
:class="[checkRowIsVisible(item) ? 'psui-rotate-0' : 'psui--rotate-90', { 'psui-pointer-events-none' : item.is_disabled }]"
|
|
43
|
-
@click.native="onCollapse(item)"
|
|
44
|
-
/>
|
|
45
|
-
|
|
46
|
-
<PsRichTooltip
|
|
47
|
-
v-if="item.is_disabled"
|
|
48
|
-
layout="gray"
|
|
49
|
-
position="top"
|
|
50
|
-
class="psui-inline-flex psui-cursor-default"
|
|
51
|
-
:class="{ 'is-last-deep' : item.last_deep }"
|
|
52
|
-
>
|
|
53
|
-
<template v-slot:trigger>
|
|
54
|
-
<p class="title psui-text-gray-50">{{ item.title }}</p>
|
|
55
|
-
</template>
|
|
56
|
-
<template v-slot:content>
|
|
57
|
-
<p
|
|
58
|
-
v-if="item.disabled_text"
|
|
59
|
-
class="psui-font-bold psui-text-gray-80 psui-text-xsmall"
|
|
60
|
-
>
|
|
61
|
-
{{ item.disabled_text }}
|
|
62
|
-
</p>
|
|
63
|
-
<p
|
|
64
|
-
v-else
|
|
65
|
-
class="psui-font-bold psui-text-gray-80 psui-text-xsmall"
|
|
66
|
-
>
|
|
67
|
-
{{ item.title }} buildings are <br>not allowed.
|
|
68
|
-
</p>
|
|
69
|
-
</template>
|
|
70
|
-
</PsRichTooltip>
|
|
71
|
-
<p
|
|
72
|
-
v-else
|
|
73
|
-
class="title opacity-100-childrens-on-hover"
|
|
74
|
-
:class="[
|
|
75
|
-
{ 'psui-font-bold' : item.type == 'total' },
|
|
76
|
-
{ 'is-last-deep' : item.last_deep }
|
|
77
|
-
]"
|
|
34
|
+
<div
|
|
35
|
+
class="actions psui-space-x-3"
|
|
36
|
+
:style="{ paddingLeft: `${item.deep * 16}px` }"
|
|
78
37
|
>
|
|
79
|
-
{{ item.title }}
|
|
80
|
-
|
|
81
38
|
<PsIcon
|
|
82
|
-
v-if="item.
|
|
83
|
-
icon="
|
|
84
|
-
size="
|
|
85
|
-
class="
|
|
39
|
+
v-if="!item.last_deep || item.type === 'total'"
|
|
40
|
+
icon="expand_more"
|
|
41
|
+
size="24"
|
|
42
|
+
class="actions-button psui-transition psui-transform"
|
|
43
|
+
:icon-classes="item.is_disabled ? 'psui-text-gray-40' : getIconClasses(item)"
|
|
86
44
|
:style="{ display: 'flex' }"
|
|
87
|
-
|
|
45
|
+
:class="[checkRowIsVisible(item) ? 'psui-rotate-0' : 'psui--rotate-90', { 'psui-pointer-events-none' : item.is_disabled }]"
|
|
46
|
+
@click.native="onCollapse(item)"
|
|
88
47
|
/>
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
48
|
+
|
|
49
|
+
<PsRichTooltip
|
|
50
|
+
v-if="item.is_disabled"
|
|
51
|
+
layout="gray"
|
|
52
|
+
position="top"
|
|
53
|
+
class="psui-inline-flex psui-cursor-default sticky"
|
|
54
|
+
:class="{ 'is-last-deep' : item.last_deep }"
|
|
55
|
+
>
|
|
56
|
+
<template v-slot:trigger>
|
|
57
|
+
<p class="title psui-text-gray-50">{{ item.title }}</p>
|
|
58
|
+
</template>
|
|
59
|
+
<template v-slot:content>
|
|
60
|
+
<p
|
|
61
|
+
v-if="item.disabled_text"
|
|
62
|
+
class="psui-font-bold psui-text-gray-80 psui-text-xsmall"
|
|
63
|
+
>
|
|
64
|
+
{{ item.disabled_text }}
|
|
65
|
+
</p>
|
|
66
|
+
<p
|
|
67
|
+
v-else
|
|
68
|
+
class="psui-font-bold psui-text-gray-80 psui-text-xsmall"
|
|
69
|
+
>
|
|
70
|
+
{{ item.title }} buildings are <br>not allowed.
|
|
71
|
+
</p>
|
|
72
|
+
</template>
|
|
73
|
+
</PsRichTooltip>
|
|
74
|
+
<p
|
|
75
|
+
v-else
|
|
76
|
+
class="title opacity-100-childrens-on-hover"
|
|
77
|
+
:class="[
|
|
78
|
+
{ 'psui-font-bold' : item.type == 'total' },
|
|
79
|
+
{ 'is-last-deep' : item.last_deep }
|
|
80
|
+
]"
|
|
81
|
+
>
|
|
82
|
+
{{ item.title }}
|
|
83
|
+
|
|
99
84
|
<PsIcon
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
size="
|
|
85
|
+
v-if="item.has_helper"
|
|
86
|
+
icon="info"
|
|
87
|
+
size="14"
|
|
88
|
+
class="psui-text-blue-60 psui-opacity-0 psui-transition psui-leading-none psui-cursor-pointer psui-ml-1"
|
|
103
89
|
:style="{ display: 'flex' }"
|
|
104
|
-
@click.native="
|
|
90
|
+
@click.native="$eventBus.$emit('openDescriptionModal', { type: 'helper', slug: `table-results-${item.helper_slug}` })"
|
|
105
91
|
/>
|
|
106
|
-
</
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
92
|
+
</p>
|
|
93
|
+
</div>
|
|
94
|
+
<div
|
|
95
|
+
class="actions psui-space-x-3 flex justify-between"
|
|
96
|
+
:style="{ paddingLeft: `${item.deep * 16}px` }"
|
|
97
|
+
>
|
|
98
|
+
<PsRichTooltip
|
|
99
|
+
v-if="shouldShowIcon(item)"
|
|
100
|
+
position="top"
|
|
101
|
+
layout="gray"
|
|
102
|
+
class="psui-inline-flex psui-cursor-default"
|
|
103
|
+
:class="[isHoveringRow === index ? 'opacity-1' : 'opacity-0']"
|
|
104
|
+
:ignoreDialog="!shouldShowIcon(item)"
|
|
105
|
+
>
|
|
106
|
+
<template v-slot:trigger>
|
|
107
|
+
<PsIcon
|
|
108
|
+
:icon="getIcon(item)"
|
|
109
|
+
class="psui-flex psui-text-gray-40 psui-cursor-pointer leading-none hover:psui-text-blue-60 psui-gap-3 psui-px-5 psui-py-1 transition-all"
|
|
110
|
+
size="18"
|
|
111
|
+
:style="{ display: 'flex' }"
|
|
112
|
+
@click.native="executeCallback(item)"
|
|
113
|
+
/>
|
|
114
|
+
</template>
|
|
115
|
+
<template v-slot:content>
|
|
116
|
+
<p
|
|
117
|
+
class="psui-font-bold psui-text-gray-80 psui-text-xsmall"
|
|
118
|
+
>
|
|
119
|
+
{{ getText(item) }}
|
|
120
|
+
</p>
|
|
121
|
+
</template>
|
|
122
|
+
</PsRichTooltip>
|
|
123
|
+
|
|
124
|
+
<PsDropdown
|
|
125
|
+
v-if="shouldShowDropdown(item)"
|
|
126
|
+
:class="[isHoveringRow === index ? 'opacity-1' : 'opacity-0']"
|
|
127
|
+
position="custom"
|
|
128
|
+
custom-position="top: 0; left: 5rem;"
|
|
129
|
+
>
|
|
130
|
+
<template v-slot:dropdownTrigger>
|
|
131
|
+
<PsIcon
|
|
132
|
+
icon="more_horiz"
|
|
133
|
+
size="18"
|
|
134
|
+
class="psui-flex psui-text-gray-40 psui-cursor-pointer leading-none hover:psui-text-blue-60 psui-gap-3 psui-px-5 psui-py-1 transition-all"
|
|
135
|
+
:style="{ display: 'flex' }"
|
|
136
|
+
/>
|
|
137
|
+
</template>
|
|
138
|
+
<template v-slot:items>
|
|
139
|
+
<ul class="psui-w-full psui-font-bold psui-my-3">
|
|
140
|
+
<li
|
|
141
|
+
v-for="(action, index) in item.actions"
|
|
142
|
+
:key="index"
|
|
143
|
+
:title="action.title"
|
|
144
|
+
class="psui-text-gray-60 hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3 psui-px-5 psui-py-1 transition-all"
|
|
145
|
+
@click="executeCallback(item, action)"
|
|
146
|
+
>
|
|
147
|
+
<span class="psui-w-auto psui-text-small">{{ action.title }}</span>
|
|
148
|
+
</li>
|
|
149
|
+
</ul>
|
|
150
|
+
</template>
|
|
151
|
+
</PsDropdown>
|
|
152
|
+
</div>
|
|
115
153
|
</div>
|
|
116
154
|
</td>
|
|
117
155
|
|
|
@@ -356,19 +394,24 @@ export default {
|
|
|
356
394
|
this.isHoveringRow = index
|
|
357
395
|
},
|
|
358
396
|
shouldShowIcon(item) {
|
|
359
|
-
if(item?.
|
|
397
|
+
if(item?.actions?.length === 1) return true
|
|
398
|
+
else return false
|
|
399
|
+
},
|
|
400
|
+
shouldShowDropdown(item) {
|
|
401
|
+
if(item?.actions?.length > 1) return true
|
|
360
402
|
else return false
|
|
361
403
|
},
|
|
362
404
|
getIcon(item) {
|
|
363
|
-
if(item?.
|
|
405
|
+
if(item?.actions?.length === 1) return item.actions[0].icon
|
|
364
406
|
},
|
|
365
407
|
getText(item) {
|
|
366
|
-
if(item?.
|
|
367
|
-
},
|
|
368
|
-
executeCallback(item) {
|
|
369
|
-
if(item?.action) item.action.callback(item)
|
|
408
|
+
if(item?.actions?.length === 1) return item.actions[0].text
|
|
370
409
|
},
|
|
371
|
-
|
|
410
|
+
executeCallback(item, action) {
|
|
411
|
+
if(item?.actions?.length === 1) item.actions[0].callback(item)
|
|
412
|
+
else action?.callback(item)
|
|
413
|
+
}
|
|
414
|
+
},
|
|
372
415
|
}
|
|
373
416
|
</script>
|
|
374
417
|
<style> /* Please, use the file src/assets/scss/components/PsTableResults.scss */ </style>
|