@policystudio/policy-studio-ui-vue 1.1.90-beta.2 → 1.1.90-beta.21
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/.eslintrc.js +13 -8
- package/.github/workflows/deploy-storybook.yml +4 -4
- package/.nvmrc +1 -0
- package/dist/css/psui_styles_output.css +6986 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +104 -0
- package/dist/index.js.map +1 -0
- package/dist/util/GeneralFunctions.d.ts +3 -0
- package/dist/util/GeneralFunctions.js +29 -0
- package/dist/util/GeneralFunctions.js.map +1 -0
- package/dist/util/directives.d.ts +1 -0
- package/dist/util/directives.js +22 -0
- package/dist/util/directives.js.map +1 -0
- package/dist/util/imageLoader.d.ts +6 -0
- package/dist/util/imageLoader.js +52 -0
- package/dist/util/imageLoader.js.map +1 -0
- package/package.json +24 -37
- package/src/App.vue +30 -0
- package/src/assets/scss/components/PsDataTable.scss +1 -1
- package/src/components/accordion/PsAccordionItem.vue +75 -75
- package/src/components/badges-and-tags/PsBadgeWithIcon.vue +31 -33
- package/src/components/badges-and-tags/PsCardInfos.vue +39 -41
- package/src/components/badges-and-tags/PsChartLegend.vue +46 -51
- package/src/components/badges-and-tags/PsClimateZoneBadge.vue +13 -19
- package/src/components/badges-and-tags/PsCostEffectBar.vue +24 -56
- package/src/components/badges-and-tags/PsDateCardInfo.vue +17 -18
- package/src/components/badges-and-tags/PsHighlightRippleDot.vue +3 -2
- package/src/components/badges-and-tags/PsMiniTag.vue +39 -41
- package/src/components/badges-and-tags/PsProgressBar.vue +72 -68
- package/src/components/badges-and-tags/PsTagScope.vue +17 -22
- package/src/components/badges-and-tags/PsTestimonialCard.vue +19 -26
- package/src/components/buttons/PsButton.vue +88 -111
- package/src/components/chips/PsChips.vue +98 -101
- package/src/components/controls/PsCheckbox.vue +84 -84
- package/src/components/controls/PsCheckboxSimple.vue +95 -95
- package/src/components/controls/PsDraggable.vue +53 -55
- package/src/components/controls/PsInlineSelector.vue +98 -99
- package/src/components/controls/PsRadioButton.vue +59 -58
- package/src/components/controls/PsRadioButtonSimple.vue +79 -75
- package/src/components/controls/PsSlider.vue +185 -176
- package/src/components/controls/PsSwitch.vue +51 -52
- package/src/components/controls/PsToggle.vue +52 -50
- package/src/components/data-graphics/PsBarChart.vue +18 -21
- package/src/components/datatable/PsDataTable.vue +56 -60
- package/src/components/datatable/PsDataTableItem.vue +13 -28
- package/src/components/forms/PsDropdown.vue +164 -162
- package/src/components/forms/PsDropdownList.vue +133 -130
- package/src/components/forms/PsInput.vue +154 -153
- package/src/components/forms/PsInputSelect.vue +91 -92
- package/src/components/forms/PsInputTextArea.vue +71 -71
- package/src/components/navigations/PsBreadcrumb.vue +25 -34
- package/src/components/notifications/PsDialog.vue +57 -56
- package/src/components/notifications/PsSimpleAlert.vue +27 -29
- package/src/components/notifications/PsToast.vue +40 -39
- package/src/components/table-results/PsTableResults.vue +449 -458
- package/src/components/table-results/PsTableResultsBody.vue +66 -67
- package/src/components/table-results/PsTableResultsHead.vue +62 -56
- package/src/components/table-results/PsTableResultsHeadComparison.vue +62 -56
- package/src/components/table-results/PsTableResultsHeadFlexible.vue +63 -56
- package/src/components/table-results/PsTableResultsRow.vue +55 -56
- package/src/components/tabs/PsTabHeader.vue +106 -100
- package/src/components/tooltip/PsDialogTooltip.vue +96 -101
- package/src/components/tooltip/PsRichTooltip.vue +41 -45
- package/src/components/tooltip/PsTooltip.vue +111 -116
- package/src/components/ui/PsDotLoader.vue +1 -5
- package/src/components/ui/PsIcon.vue +126 -129
- package/src/index.ts +156 -0
- package/src/tsconfig.json +12 -0
- package/src/types/index.d.ts +6 -0
- package/src/util/GeneralFunctions.js +4 -6
- package/src/util/directives.ts +24 -0
- package/src/util/imageLoader.js +14 -7
- package/tailwind.config.js +1 -1
- package/tsconfig.json +47 -0
- package/.storybook/PolicyStudio.js +0 -10
- package/.storybook/eventBus.js +0 -26
- package/.storybook/main.js +0 -21
- package/.storybook/manager.js +0 -6
- package/.storybook/preview.js +0 -17
- package/babel.config.js +0 -17
- package/dist/css/psui_styles.css +0 -4647
- package/postcss.config.js +0 -8
- package/src/assets/images/multifamily-units.svg +0 -10
- package/src/assets/images/policy-studio.svg +0 -15
- package/src/components/playground/PsScrollBar.vue +0 -320
- package/src/contents/ComparisonData.js +0 -378
- package/src/contents/FlexibleData.js +0 -502
- package/src/contents/ResultsData.js +0 -531
- package/src/index.js +0 -166
- package/src/stories/Accordion.stories.js +0 -59
- package/src/stories/BadgeWithIcon.stories.js +0 -31
- package/src/stories/BarChart.stories.js +0 -17
- package/src/stories/Breadcrumb.stories.js +0 -25
- package/src/stories/Button.stories.js +0 -48
- package/src/stories/Button.vue +0 -59
- package/src/stories/CardInfos.stories.js +0 -16
- package/src/stories/ChartLegend.stories.js +0 -16
- package/src/stories/Checkbox.stories.js +0 -45
- package/src/stories/CheckboxSimple.stories.js +0 -49
- package/src/stories/Chips.stories.js +0 -31
- package/src/stories/ClimateZoneBadge.stories.js +0 -17
- package/src/stories/Colors.mdx +0 -70
- package/src/stories/CostEffectBar.stories.js +0 -23
- package/src/stories/Datatable.stories.js +0 -50
- package/src/stories/DateCardInfo.stories.js +0 -24
- package/src/stories/Dialog.stories.js +0 -131
- package/src/stories/Draggable.stories.js +0 -22
- package/src/stories/Dropdown.stories.js +0 -99
- package/src/stories/DropdownList.stories.js +0 -211
- package/src/stories/ElevationSystem.mdx +0 -41
- package/src/stories/Header.stories.js +0 -41
- package/src/stories/Header.vue +0 -77
- package/src/stories/HighlightRippleDot.stories.js +0 -15
- package/src/stories/Icon.stories.js +0 -21
- package/src/stories/InlineSelector.stories.js +0 -18
- package/src/stories/Input.stories.js +0 -240
- package/src/stories/InputSelect.stories.js +0 -30
- package/src/stories/InputTextArea.stories.js +0 -25
- package/src/stories/Introduction.mdx +0 -211
- package/src/stories/MiniTag.stories.js +0 -52
- package/src/stories/Playground.stories.js +0 -16
- package/src/stories/ProgressBar.stories.js +0 -23
- package/src/stories/RadioButton.stories.js +0 -40
- package/src/stories/RadioButtonSimple.stories.js +0 -43
- package/src/stories/SimpleAlert.stories.js +0 -21
- package/src/stories/Slider.stories.js +0 -75
- package/src/stories/Switch.stories.js +0 -39
- package/src/stories/TabHeader.stories.js +0 -52
- package/src/stories/TableResults.stories.js +0 -724
- package/src/stories/TagScope.stories.js +0 -17
- package/src/stories/TestimonialCard.stories.js +0 -27
- package/src/stories/Toast.stories.js +0 -52
- package/src/stories/Toggle.stories.js +0 -45
- package/src/stories/Tooltip.stories.js +0 -114
- package/src/stories/Typography.mdx +0 -212
- package/src/stories/assets/code-brackets.svg +0 -1
- package/src/stories/assets/colors.svg +0 -1
- package/src/stories/assets/comments.svg +0 -1
- package/src/stories/assets/direction.svg +0 -1
- package/src/stories/assets/flow.svg +0 -1
- package/src/stories/assets/plugin.svg +0 -1
- package/src/stories/assets/repo.svg +0 -1
- package/src/stories/assets/stackalt.svg +0 -1
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/webpack.config.js +0 -22
|
@@ -10,9 +10,7 @@
|
|
|
10
10
|
</p>
|
|
11
11
|
</td>
|
|
12
12
|
|
|
13
|
-
<template
|
|
14
|
-
v-for="(columnGroup, indexColumn) of columnGroups"
|
|
15
|
-
>
|
|
13
|
+
<template v-for="(columnGroup, indexColumn) of columnGroups">
|
|
16
14
|
<td
|
|
17
15
|
v-for="column of columnGroup.columns"
|
|
18
16
|
:key="indexColumn + '-' + columnGroup.key + '-' + column.key"
|
|
@@ -24,76 +22,77 @@
|
|
|
24
22
|
</tbody>
|
|
25
23
|
</template>
|
|
26
24
|
|
|
27
|
-
<script>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
/**
|
|
41
|
-
* It sets the values which will be use to render the body.
|
|
42
|
-
*/
|
|
43
|
-
columnGroups: {
|
|
44
|
-
type: Array,
|
|
45
|
-
default() {
|
|
46
|
-
return []
|
|
47
|
-
}
|
|
25
|
+
<script setup>
|
|
26
|
+
import { computed } from 'vue'
|
|
27
|
+
|
|
28
|
+
const props = defineProps({
|
|
29
|
+
/**
|
|
30
|
+
* It sets the values which will be use to render the body.
|
|
31
|
+
*/
|
|
32
|
+
summaryData: {
|
|
33
|
+
type: Array,
|
|
34
|
+
default() {
|
|
35
|
+
return []
|
|
48
36
|
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
37
|
+
},
|
|
38
|
+
/**
|
|
39
|
+
* It sets the values which will be use to render the body.
|
|
40
|
+
*/
|
|
41
|
+
columnGroups: {
|
|
42
|
+
type: Array,
|
|
43
|
+
default() {
|
|
44
|
+
return []
|
|
57
45
|
},
|
|
58
|
-
/**
|
|
59
|
-
* It sets additional styling if needed.
|
|
60
|
-
*/
|
|
61
|
-
cssStyle: {
|
|
62
|
-
type: String,
|
|
63
|
-
default: 'psui-text-gray-60'
|
|
64
|
-
}
|
|
65
46
|
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
47
|
+
/**
|
|
48
|
+
* It sets the values which will be use to render the body.
|
|
49
|
+
*/
|
|
50
|
+
rows: {
|
|
51
|
+
type: Array,
|
|
52
|
+
default() {
|
|
53
|
+
return []
|
|
71
54
|
},
|
|
72
|
-
getRows() {
|
|
73
|
-
const rows = []
|
|
74
|
-
for (let index = 0; index < this.summaryData.length; index++) {
|
|
75
|
-
const item = this.summaryData[index]
|
|
76
|
-
this.addRow(item, 0, `${index}`, rows)
|
|
77
|
-
}
|
|
78
|
-
return rows
|
|
79
|
-
}
|
|
80
55
|
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
56
|
+
/**
|
|
57
|
+
* It sets additional styling if needed.
|
|
58
|
+
*/
|
|
59
|
+
cssStyle: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: 'psui-text-gray-60',
|
|
62
|
+
},
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
const cssAlign = computed(() => {
|
|
66
|
+
if (props.align === 'right') return `psui-text-right ${props.cssStyle}`
|
|
67
|
+
if (props.align === 'center') return `psui-text-center ${props.cssStyle}`
|
|
68
|
+
return `psui-text-left ${props.cssStyle}`
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
const addRow = (item, deep = 0, index, rows) => {
|
|
72
|
+
item.deep = deep
|
|
73
|
+
item.index = index
|
|
74
|
+
rows.push(item)
|
|
75
|
+
item.last_deep = item.items ? false : true
|
|
76
|
+
if (item.items) {
|
|
77
|
+
const items_child = [...item.items]
|
|
78
|
+
for (let indexChild = 0; indexChild < items_child.length; indexChild++) {
|
|
79
|
+
const item_child = items_child[indexChild]
|
|
80
|
+
item_child.is_last = indexChild + 1 === items_child.length ? true : false
|
|
81
|
+
addRow(item_child, deep + 1, `${index}-${indexChild}`, rows)
|
|
95
82
|
}
|
|
96
83
|
}
|
|
97
84
|
}
|
|
85
|
+
|
|
86
|
+
const getRows = computed(() => {
|
|
87
|
+
const rows = []
|
|
88
|
+
for (let index = 0; index < props.summaryData.length; index++) {
|
|
89
|
+
const item = props.summaryData[index]
|
|
90
|
+
addRow(item, 0, `${index}`, rows)
|
|
91
|
+
}
|
|
92
|
+
return rows
|
|
93
|
+
})
|
|
98
94
|
</script>
|
|
99
|
-
|
|
95
|
+
|
|
96
|
+
<style>
|
|
97
|
+
/* Please, use the file src/assets/scss/components/PsTableResults.scss */
|
|
98
|
+
</style>
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
</p>
|
|
9
9
|
</div>
|
|
10
10
|
</th>
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
<th
|
|
13
13
|
v-for="columnGroup of header"
|
|
14
14
|
:key="columnGroup.key"
|
|
15
|
-
:colspan="columnGroup.columns.reduce(
|
|
15
|
+
:colspan="columnGroup.columns.reduce((prev, cur) => (cur.isActive ? prev + 1 : prev), 0)"
|
|
16
16
|
>
|
|
17
17
|
<div class="psui-space-x-1 psui-items-center psui-show-childrens-on-hover">
|
|
18
18
|
<p class="title">
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
class="psui-cursor-pointer"
|
|
25
25
|
icon-classes="psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
|
|
26
26
|
:style="{ display: 'flex' }"
|
|
27
|
-
@click="
|
|
27
|
+
@click="emit('click-column-group-helper', columnGroup, $event)"
|
|
28
28
|
/>
|
|
29
29
|
</div>
|
|
30
30
|
</th>
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
</th>
|
|
44
44
|
|
|
45
45
|
<template v-for="columnGroup of header">
|
|
46
|
-
<th
|
|
47
|
-
v-for="column of columnGroup.columns"
|
|
48
|
-
:key="`${columnGroup.key}-${column.key}`"
|
|
46
|
+
<th
|
|
47
|
+
v-for="column of columnGroup.columns"
|
|
48
|
+
:key="`${columnGroup.key}-${column.key}`"
|
|
49
49
|
>
|
|
50
50
|
<div class="psui-flex psui-flex-col">
|
|
51
51
|
<div class="psui-flex psui-flex-row psui-space-x-1 psui-items-center psui-justify-end psui-show-childrens-on-hover psui-mb-px">
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
class="psui-cursor-pointer helper"
|
|
58
58
|
icon-classes="psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
|
|
59
59
|
:style="{ display: 'flex' }"
|
|
60
|
-
@click="
|
|
60
|
+
@click="emit('click-order-column', column)"
|
|
61
61
|
/>
|
|
62
62
|
|
|
63
63
|
<PsIcon
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
class="psui-cursor-pointer helper"
|
|
67
67
|
icon-classes="psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
|
|
68
68
|
:style="{ display: 'flex' }"
|
|
69
|
-
@click="
|
|
69
|
+
@click="emit('click-column-helper', column, $event)"
|
|
70
70
|
/>
|
|
71
71
|
<p
|
|
72
72
|
class="title"
|
|
@@ -88,55 +88,61 @@
|
|
|
88
88
|
</thead>
|
|
89
89
|
</template>
|
|
90
90
|
|
|
91
|
-
<script>
|
|
91
|
+
<script setup>
|
|
92
92
|
import PsIcon from '../ui/PsIcon.vue'
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
default: ''
|
|
103
|
-
},
|
|
104
|
-
/**
|
|
105
|
-
* It sets the description for the first column.
|
|
106
|
-
*/
|
|
107
|
-
firstColumnDescription: {
|
|
108
|
-
type: String,
|
|
109
|
-
default: ''
|
|
110
|
-
},
|
|
111
|
-
/**
|
|
112
|
-
* It sets the values which will be use to render the header.
|
|
113
|
-
*/
|
|
114
|
-
header: {
|
|
115
|
-
type: Array,
|
|
116
|
-
required: true,
|
|
117
|
-
default: () => {
|
|
118
|
-
return []
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
/**
|
|
122
|
-
* this sets whether sorting will be displayed.
|
|
123
|
-
*/
|
|
124
|
-
showOrder: {
|
|
125
|
-
type: Boolean,
|
|
126
|
-
default: false
|
|
127
|
-
}
|
|
93
|
+
import { computed, defineEmits, getCurrentInstance } from 'vue'
|
|
94
|
+
|
|
95
|
+
defineProps({
|
|
96
|
+
/**
|
|
97
|
+
* It sets the title for the first column.
|
|
98
|
+
*/
|
|
99
|
+
firstColumnTitle: {
|
|
100
|
+
type: String,
|
|
101
|
+
default: '',
|
|
128
102
|
},
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
103
|
+
/**
|
|
104
|
+
* It sets the description for the first column.
|
|
105
|
+
*/
|
|
106
|
+
firstColumnDescription: {
|
|
107
|
+
type: String,
|
|
108
|
+
default: '',
|
|
109
|
+
},
|
|
110
|
+
/**
|
|
111
|
+
* It sets the values which will be use to render the header.
|
|
112
|
+
*/
|
|
113
|
+
header: {
|
|
114
|
+
type: Array,
|
|
115
|
+
required: true,
|
|
116
|
+
default: () => {
|
|
117
|
+
return []
|
|
138
118
|
},
|
|
139
|
-
}
|
|
140
|
-
|
|
119
|
+
},
|
|
120
|
+
/**
|
|
121
|
+
* this sets whether sorting will be displayed.
|
|
122
|
+
*/
|
|
123
|
+
showOrder: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
default: false,
|
|
126
|
+
},
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
const emit = defineEmits(['click-column-group-helper', 'click-order-column', 'click-column-helper'])
|
|
130
|
+
|
|
131
|
+
const parent = getCurrentInstance().proxy.$parent
|
|
132
|
+
|
|
133
|
+
const columnsSelectedForStudy = computed(() => {
|
|
134
|
+
return parent.columnsSelectedForStudy
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
const orderColumn = computed(() => {
|
|
138
|
+
return parent.orderColumn
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
const orderDirection = computed(() => {
|
|
142
|
+
return parent.orderDirection
|
|
143
|
+
})
|
|
141
144
|
</script>
|
|
142
|
-
|
|
145
|
+
|
|
146
|
+
<style>
|
|
147
|
+
/* Please, use the file src/assets/scss/components/PsTableResults.scss */
|
|
148
|
+
</style>
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
</p>
|
|
14
14
|
</div>
|
|
15
15
|
</th>
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
<th
|
|
18
18
|
v-for="columnGroup of header"
|
|
19
19
|
:key="columnGroup.key"
|
|
20
|
-
:colspan="columnGroup.columns.reduce(
|
|
20
|
+
:colspan="columnGroup.columns.reduce((prev, cur) => (cur.isActive ? prev + 1 : prev), 0)"
|
|
21
21
|
>
|
|
22
22
|
<div class="psui-flex psui-space-x-1 psui-items-center psui-show-childrens-on-hover">
|
|
23
23
|
<p class="title">
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
class="psui-cursor-pointer"
|
|
30
30
|
icon-classes="psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
|
|
31
31
|
:style="{ display: 'flex' }"
|
|
32
|
-
@click="
|
|
32
|
+
@click="emit('click-column-group-helper', columnGroup, $event)"
|
|
33
33
|
/>
|
|
34
34
|
</div>
|
|
35
35
|
</th>
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
|
|
38
38
|
<tr>
|
|
39
39
|
<template v-for="columnGroup of header">
|
|
40
|
-
<th
|
|
41
|
-
v-for="column of columnGroup.columns"
|
|
40
|
+
<th
|
|
41
|
+
v-for="column of columnGroup.columns"
|
|
42
42
|
:key="`${columnGroup.key}-${column.key}`"
|
|
43
43
|
>
|
|
44
44
|
<div class="psui-flex psui-flex-col psui-justify-center psui-items-center psui-text-center">
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
class="psui-cursor-pointer helper"
|
|
57
57
|
icon-classes="psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
|
|
58
58
|
:style="{ display: 'flex' }"
|
|
59
|
-
@click="
|
|
59
|
+
@click="emit('click-column-helper', column, $event)"
|
|
60
60
|
/>
|
|
61
|
-
|
|
61
|
+
|
|
62
62
|
<PsIcon
|
|
63
63
|
v-if="showOrder"
|
|
64
64
|
:icon="orderDirection == 'asc' ? 'arrow_downward' : 'arrow_upward'"
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
class="psui-cursor-pointer helper"
|
|
68
68
|
icon-classes="psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
|
|
69
69
|
:style="{ display: 'flex' }"
|
|
70
|
-
@click="
|
|
70
|
+
@click="emit('click-order-column', column)"
|
|
71
71
|
/>
|
|
72
72
|
</div>
|
|
73
73
|
<p
|
|
@@ -83,55 +83,61 @@
|
|
|
83
83
|
</thead>
|
|
84
84
|
</template>
|
|
85
85
|
|
|
86
|
-
<script>
|
|
86
|
+
<script setup>
|
|
87
87
|
import PsIcon from '../ui/PsIcon.vue'
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
default: ''
|
|
98
|
-
},
|
|
99
|
-
/**
|
|
100
|
-
* It sets the description for the first column.
|
|
101
|
-
*/
|
|
102
|
-
firstColumnDescription: {
|
|
103
|
-
type: String,
|
|
104
|
-
default: ''
|
|
105
|
-
},
|
|
106
|
-
/**
|
|
107
|
-
* It sets the values which will be use to render the header.
|
|
108
|
-
*/
|
|
109
|
-
header: {
|
|
110
|
-
type: Array,
|
|
111
|
-
required: true,
|
|
112
|
-
default: () => {
|
|
113
|
-
return []
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
/**
|
|
117
|
-
* this sets whether sorting will be displayed.
|
|
118
|
-
*/
|
|
119
|
-
showOrder: {
|
|
120
|
-
type: Boolean,
|
|
121
|
-
default: false
|
|
122
|
-
}
|
|
88
|
+
import { computed, defineEmits, getCurrentInstance } from 'vue'
|
|
89
|
+
|
|
90
|
+
defineProps({
|
|
91
|
+
/**
|
|
92
|
+
* It sets the title for the first column.
|
|
93
|
+
*/
|
|
94
|
+
firstColumnTitle: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: '',
|
|
123
97
|
},
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
98
|
+
/**
|
|
99
|
+
* It sets the description for the first column.
|
|
100
|
+
*/
|
|
101
|
+
firstColumnDescription: {
|
|
102
|
+
type: String,
|
|
103
|
+
default: '',
|
|
104
|
+
},
|
|
105
|
+
/**
|
|
106
|
+
* It sets the values which will be use to render the header.
|
|
107
|
+
*/
|
|
108
|
+
header: {
|
|
109
|
+
type: Array,
|
|
110
|
+
required: true,
|
|
111
|
+
default: () => {
|
|
112
|
+
return []
|
|
133
113
|
},
|
|
134
|
-
}
|
|
135
|
-
|
|
114
|
+
},
|
|
115
|
+
/**
|
|
116
|
+
* this sets whether sorting will be displayed.
|
|
117
|
+
*/
|
|
118
|
+
showOrder: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: false,
|
|
121
|
+
},
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
const emit = defineEmits(['click-column-group-helper', 'click-column-helper', 'click-order-column'])
|
|
125
|
+
|
|
126
|
+
const parent = getCurrentInstance().proxy.$parent
|
|
127
|
+
|
|
128
|
+
const columnsSelectedForStudy = computed(() => {
|
|
129
|
+
return parent.columnsSelectedForStudy
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
const orderColumn = computed(() => {
|
|
133
|
+
return parent.orderColumn
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
const orderDirection = computed(() => {
|
|
137
|
+
return parent.orderDirection
|
|
138
|
+
})
|
|
136
139
|
</script>
|
|
137
|
-
|
|
140
|
+
|
|
141
|
+
<style>
|
|
142
|
+
/* Please, use the file src/assets/scss/components/PsTableResults.scss */
|
|
143
|
+
</style>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<th
|
|
5
5
|
v-for="columnGroup of header"
|
|
6
6
|
:key="columnGroup.key"
|
|
7
|
-
:colspan="columnGroup.columns.reduce(
|
|
7
|
+
:colspan="columnGroup.columns.reduce((prev, cur) => (cur.isActive ? prev + 1 : prev), 0)"
|
|
8
8
|
>
|
|
9
9
|
<div class="psui-flex psui-space-x-1 psui-items-center psui-show-childrens-on-hover">
|
|
10
10
|
<p class="title">
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
class="psui-cursor-pointer"
|
|
17
17
|
icon-classes="psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
|
|
18
18
|
:style="{ display: 'flex' }"
|
|
19
|
-
@click="
|
|
19
|
+
@click="emit('click-column-group-helper', columnGroup, $event)"
|
|
20
20
|
/>
|
|
21
21
|
</div>
|
|
22
22
|
</th>
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
|
|
25
25
|
<tr>
|
|
26
26
|
<template v-for="(columnGroup, columnGroupIndex) of header">
|
|
27
|
-
<th
|
|
28
|
-
v-for="column of columnGroup.columns"
|
|
27
|
+
<th
|
|
28
|
+
v-for="column of columnGroup.columns"
|
|
29
29
|
:key="`${columnGroup.key}-${column.key}`"
|
|
30
30
|
:data-test-id="column.key"
|
|
31
31
|
>
|
|
32
|
-
<div
|
|
32
|
+
<div
|
|
33
33
|
class="psui-flex psui-flex-col psui-justify-center"
|
|
34
34
|
:class="columnGroupIndex == 0 ? 'psui-items-center' : 'psui-items-end'"
|
|
35
35
|
:data-index="columnGroupIndex"
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
class="psui-cursor-pointer helper"
|
|
49
49
|
icon-classes="psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
|
|
50
50
|
:style="{ display: 'flex' }"
|
|
51
|
-
@click="
|
|
51
|
+
@click="emit('click-column-helper', column, $event)"
|
|
52
52
|
/>
|
|
53
|
-
|
|
53
|
+
|
|
54
54
|
<PsIcon
|
|
55
55
|
v-if="showOrder"
|
|
56
56
|
:icon="orderDirection == 'asc' ? 'arrow_downward' : 'arrow_upward'"
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
class="psui-cursor-pointer helper"
|
|
60
60
|
icon-classes="psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
|
|
61
61
|
:style="{ display: 'flex' }"
|
|
62
|
-
@click="
|
|
62
|
+
@click="emit('click-order-column', column)"
|
|
63
63
|
/>
|
|
64
64
|
</div>
|
|
65
65
|
<p
|
|
@@ -75,55 +75,62 @@
|
|
|
75
75
|
</thead>
|
|
76
76
|
</template>
|
|
77
77
|
|
|
78
|
-
<script>
|
|
78
|
+
<script setup>
|
|
79
79
|
import PsIcon from '../ui/PsIcon.vue'
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
/**
|
|
92
|
-
* It sets the description for the first column.
|
|
93
|
-
*/
|
|
94
|
-
firstColumnDescription: {
|
|
95
|
-
type: String,
|
|
96
|
-
default: ''
|
|
97
|
-
},
|
|
98
|
-
/**
|
|
99
|
-
* It sets the values which will be use to render the header.
|
|
100
|
-
*/
|
|
101
|
-
header: {
|
|
102
|
-
type: Array,
|
|
103
|
-
required: true,
|
|
104
|
-
default: () => {
|
|
105
|
-
return []
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
/**
|
|
109
|
-
* this sets whether sorting will be displayed.
|
|
110
|
-
*/
|
|
111
|
-
showOrder: {
|
|
112
|
-
type: Boolean,
|
|
113
|
-
default: false
|
|
114
|
-
}
|
|
80
|
+
|
|
81
|
+
import { computed, getCurrentInstance } from 'vue'
|
|
82
|
+
|
|
83
|
+
defineProps({
|
|
84
|
+
/**
|
|
85
|
+
* It sets the title for the first column.
|
|
86
|
+
*/
|
|
87
|
+
firstColumnTitle: {
|
|
88
|
+
type: String,
|
|
89
|
+
default: '',
|
|
115
90
|
},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
91
|
+
/**
|
|
92
|
+
* It sets the description for the first column.
|
|
93
|
+
*/
|
|
94
|
+
firstColumnDescription: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: '',
|
|
97
|
+
},
|
|
98
|
+
/**
|
|
99
|
+
* It sets the values which will be use to render the header.
|
|
100
|
+
*/
|
|
101
|
+
header: {
|
|
102
|
+
type: Array,
|
|
103
|
+
required: true,
|
|
104
|
+
default: () => {
|
|
105
|
+
return []
|
|
125
106
|
},
|
|
126
|
-
}
|
|
127
|
-
|
|
107
|
+
},
|
|
108
|
+
/**
|
|
109
|
+
* this sets whether sorting will be displayed.
|
|
110
|
+
*/
|
|
111
|
+
showOrder: {
|
|
112
|
+
type: Boolean,
|
|
113
|
+
default: false,
|
|
114
|
+
},
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
const emit = defineEmits(['click-column-group-helper', 'click-column-helper', 'click-order-column'])
|
|
118
|
+
|
|
119
|
+
const parent = getCurrentInstance().proxy.$parent
|
|
120
|
+
|
|
121
|
+
const columnsSelectedForStudy = computed(() => {
|
|
122
|
+
return parent.columnsSelectedForStudy
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
const orderColumn = computed(() => {
|
|
126
|
+
return parent.orderColumn
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
const orderDirection = computed(() => {
|
|
130
|
+
return parent.orderDirection
|
|
131
|
+
})
|
|
128
132
|
</script>
|
|
129
|
-
|
|
133
|
+
|
|
134
|
+
<style>
|
|
135
|
+
/* Please, use the file src/assets/scss/components/PsTableResults.scss */
|
|
136
|
+
</style>
|