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