@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
|
@@ -4,17 +4,18 @@
|
|
|
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
|
-
<p class="title">
|
|
10
|
+
<p class="title">
|
|
11
|
+
{{ columnGroup.title }}
|
|
12
|
+
</p>
|
|
11
13
|
<PsIcon
|
|
12
|
-
icon="
|
|
13
|
-
size="
|
|
14
|
-
class="psui-cursor-pointer"
|
|
15
|
-
icon-classes="psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
|
|
14
|
+
icon="info_outline"
|
|
15
|
+
size="16"
|
|
16
|
+
class="psui-cursor-pointer psui-text-blue-40 hover:psui-text-blue-60 psui-opacity-0 psui-leading-none psui-transition"
|
|
16
17
|
:style="{ display: 'flex' }"
|
|
17
|
-
@click
|
|
18
|
+
@click="emit('click-column-group-helper', columnGroup, $event)"
|
|
18
19
|
/>
|
|
19
20
|
</div>
|
|
20
21
|
</th>
|
|
@@ -22,40 +23,72 @@
|
|
|
22
23
|
|
|
23
24
|
<tr>
|
|
24
25
|
<template v-for="(columnGroup, columnGroupIndex) of header">
|
|
25
|
-
<th
|
|
26
|
-
v-for="column of columnGroup.columns"
|
|
26
|
+
<th
|
|
27
|
+
v-for="(column, index) of columnGroup.columns"
|
|
27
28
|
:key="`${columnGroup.key}-${column.key}`"
|
|
28
29
|
:data-test-id="column.key"
|
|
30
|
+
class="pr-0"
|
|
31
|
+
:class="{'pl-2':index == 0 && columnGroupIndex > 0}"
|
|
29
32
|
>
|
|
30
|
-
<div
|
|
31
|
-
class="psui-flex psui-flex-col psui-justify-center"
|
|
33
|
+
<div
|
|
34
|
+
class="psui-flex psui-flex-col psui-justify-center py-[7px]"
|
|
32
35
|
:class="columnGroupIndex == 0 ? 'psui-items-center' : 'psui-items-end'"
|
|
33
36
|
:data-index="columnGroupIndex"
|
|
37
|
+
@mouseleave="emit('column-alert-hide', column, $event, false)"
|
|
34
38
|
>
|
|
35
|
-
<div class="psui-show-childrens-on-hover absolute-childrens
|
|
36
|
-
<p
|
|
39
|
+
<div class="psui-show-childrens-on-hover absolute-childrens">
|
|
40
|
+
<p
|
|
41
|
+
v-tooltip="{
|
|
42
|
+
content: column.description,
|
|
43
|
+
placement: 'bottom',
|
|
44
|
+
classes: 'custom-tooltip'
|
|
45
|
+
}"
|
|
46
|
+
class="title"
|
|
47
|
+
:class="{'is-warning-column': !!column.warning}"
|
|
48
|
+
v-if="column.title"
|
|
49
|
+
>
|
|
50
|
+
{{ column.title }}
|
|
51
|
+
</p>
|
|
52
|
+
<span
|
|
53
|
+
v-if="column.warning"
|
|
54
|
+
class="warning-svg-position"
|
|
55
|
+
@mouseover="emit('column-alert-show', column, $event, true)"
|
|
56
|
+
>
|
|
57
|
+
<span class="cursor-pointer">
|
|
58
|
+
<svg
|
|
59
|
+
width="10"
|
|
60
|
+
height="10"
|
|
61
|
+
viewBox="0 0 10 10"
|
|
62
|
+
fill="none"
|
|
63
|
+
>
|
|
64
|
+
<circle
|
|
65
|
+
cx="5"
|
|
66
|
+
cy="5"
|
|
67
|
+
r="4.5"
|
|
68
|
+
fill="#EDAB3E"
|
|
69
|
+
/>
|
|
70
|
+
</svg>
|
|
71
|
+
</span>
|
|
72
|
+
</span>
|
|
37
73
|
|
|
38
74
|
<PsIcon
|
|
39
|
-
icon="
|
|
75
|
+
icon="info_outline"
|
|
40
76
|
size="16"
|
|
41
|
-
class="psui-cursor-pointer
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
@click.native="$emit('click-column-helper', column, $event)"
|
|
77
|
+
class="helper psui-cursor-pointer psui-text-gray-40 hover:psui-text-blue-60 psui-opacity-0 psui-leading-none psui-transition"
|
|
78
|
+
:style="{ display: 'flex', marginTop: '1px' }"
|
|
79
|
+
@click="emit('click-column-helper', column, $event)"
|
|
45
80
|
/>
|
|
46
|
-
|
|
81
|
+
|
|
47
82
|
<PsIcon
|
|
48
83
|
v-if="showOrder"
|
|
49
84
|
:icon="orderDirection == 'asc' ? 'arrow_downward' : 'arrow_upward'"
|
|
50
85
|
:type="orderDirection == 'asc' ? 'arrow_upward' : 'arrow_upward'"
|
|
51
86
|
size="16"
|
|
52
|
-
class="psui-cursor-pointer
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
@click.native="$emit('click-order-column', column)"
|
|
87
|
+
class="helper psui-cursor-pointer psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
|
|
88
|
+
:style="{ display: 'flex', marginTop: '1px' }"
|
|
89
|
+
@click="emit('click-order-column', column)"
|
|
56
90
|
/>
|
|
57
91
|
</div>
|
|
58
|
-
<p class="description" v-if="column.description">{{ column.description }}</p>
|
|
59
92
|
</div>
|
|
60
93
|
</th>
|
|
61
94
|
</template>
|
|
@@ -63,55 +96,62 @@
|
|
|
63
96
|
</thead>
|
|
64
97
|
</template>
|
|
65
98
|
|
|
66
|
-
<script>
|
|
99
|
+
<script setup>
|
|
67
100
|
import PsIcon from '../ui/PsIcon.vue'
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
/**
|
|
80
|
-
* It sets the description for the first column.
|
|
81
|
-
*/
|
|
82
|
-
firstColumnDescription: {
|
|
83
|
-
type: String,
|
|
84
|
-
default: ''
|
|
85
|
-
},
|
|
86
|
-
/**
|
|
87
|
-
* It sets the values which will be use to render the header.
|
|
88
|
-
*/
|
|
89
|
-
header: {
|
|
90
|
-
type: Array,
|
|
91
|
-
required: true,
|
|
92
|
-
default: () => {
|
|
93
|
-
return []
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
/**
|
|
97
|
-
* this sets whether sorting will be displayed.
|
|
98
|
-
*/
|
|
99
|
-
showOrder: {
|
|
100
|
-
type: Boolean,
|
|
101
|
-
default: false
|
|
102
|
-
}
|
|
101
|
+
|
|
102
|
+
import { computed, getCurrentInstance } from 'vue'
|
|
103
|
+
|
|
104
|
+
defineProps({
|
|
105
|
+
/**
|
|
106
|
+
* It sets the title for the first column.
|
|
107
|
+
*/
|
|
108
|
+
firstColumnTitle: {
|
|
109
|
+
type: String,
|
|
110
|
+
default: '',
|
|
103
111
|
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
/**
|
|
113
|
+
* It sets the description for the first column.
|
|
114
|
+
*/
|
|
115
|
+
firstColumnDescription: {
|
|
116
|
+
type: String,
|
|
117
|
+
default: '',
|
|
118
|
+
},
|
|
119
|
+
/**
|
|
120
|
+
* It sets the values which will be use to render the header.
|
|
121
|
+
*/
|
|
122
|
+
header: {
|
|
123
|
+
type: Array,
|
|
124
|
+
required: true,
|
|
125
|
+
default: () => {
|
|
126
|
+
return []
|
|
113
127
|
},
|
|
114
|
-
}
|
|
115
|
-
|
|
128
|
+
},
|
|
129
|
+
/**
|
|
130
|
+
* this sets whether sorting will be displayed.
|
|
131
|
+
*/
|
|
132
|
+
showOrder: {
|
|
133
|
+
type: Boolean,
|
|
134
|
+
default: false,
|
|
135
|
+
},
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
const emit = defineEmits(['click-column-group-helper', 'click-column-helper', 'click-order-column', 'column-alert-show', 'column-alert-hide'])
|
|
139
|
+
|
|
140
|
+
const parent = getCurrentInstance().proxy.$parent
|
|
141
|
+
|
|
142
|
+
const columnsSelectedForStudy = computed(() => {
|
|
143
|
+
return parent.columnsSelectedForStudy
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
const orderColumn = computed(() => {
|
|
147
|
+
return parent.orderColumn
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
const orderDirection = computed(() => {
|
|
151
|
+
return parent.orderDirection
|
|
152
|
+
})
|
|
116
153
|
</script>
|
|
117
|
-
|
|
154
|
+
|
|
155
|
+
<style>
|
|
156
|
+
/* Please, use the file src/assets/scss/components/PsTableResults.scss */
|
|
157
|
+
</style>
|
|
@@ -5,81 +5,84 @@
|
|
|
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"
|
|
17
17
|
>
|
|
18
|
-
<p class="ps-table-cell-value">
|
|
18
|
+
<p class="ps-table-cell-value">
|
|
19
|
+
{{ row.data[column.key] }}
|
|
20
|
+
</p>
|
|
19
21
|
</td>
|
|
20
22
|
</template>
|
|
21
23
|
</tr>
|
|
22
24
|
</tbody>
|
|
23
25
|
</template>
|
|
24
26
|
|
|
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
|
-
}
|
|
27
|
+
<script setup>
|
|
28
|
+
import { computed } from 'vue'
|
|
29
|
+
|
|
30
|
+
const props = defineProps({
|
|
31
|
+
/**
|
|
32
|
+
* It sets the values which will be use to render the body.
|
|
33
|
+
*/
|
|
34
|
+
summaryData: {
|
|
35
|
+
type: Array,
|
|
36
|
+
default() {
|
|
37
|
+
return []
|
|
46
38
|
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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 []
|
|
55
47
|
},
|
|
56
48
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
49
|
+
/**
|
|
50
|
+
* It sets the values which will be use to render the body.
|
|
51
|
+
*/
|
|
52
|
+
rows: {
|
|
53
|
+
type: Array,
|
|
54
|
+
default() {
|
|
55
|
+
return []
|
|
56
|
+
},
|
|
66
57
|
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
const addRow = (item, deep = 0, index, rows) => {
|
|
61
|
+
item.deep = deep
|
|
62
|
+
item.index = index
|
|
63
|
+
rows.push(item)
|
|
64
|
+
item.last_deep = item.items ? false : true
|
|
65
|
+
if (item.items) {
|
|
66
|
+
const items_child = [...item.items]
|
|
67
|
+
for (let indexChild = 0; indexChild < items_child.length; indexChild++) {
|
|
68
|
+
const item_child = items_child[indexChild]
|
|
69
|
+
item_child.is_last = indexChild + 1 === items_child.length ? true : false
|
|
70
|
+
addRow(item_child, deep + 1, `${index}-${indexChild}`, rows)
|
|
81
71
|
}
|
|
82
72
|
}
|
|
83
73
|
}
|
|
74
|
+
|
|
75
|
+
const getRows = computed(() => {
|
|
76
|
+
const rows = []
|
|
77
|
+
for (let index = 0; index < props.summaryData.length; index++) {
|
|
78
|
+
const item = props.summaryData[index]
|
|
79
|
+
addRow(item, 0, `${index}`, rows)
|
|
80
|
+
}
|
|
81
|
+
return rows
|
|
82
|
+
})
|
|
83
|
+
|
|
84
84
|
</script>
|
|
85
|
-
|
|
85
|
+
|
|
86
|
+
<style>
|
|
87
|
+
/* Please, use the file src/assets/scss/components/PsTableResults.scss */
|
|
88
|
+
</style>
|
|
@@ -1,137 +1,159 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="psui-el-tab-header"
|
|
4
|
-
:class="[getComponentClass, `layout-${layout}`]"
|
|
2
|
+
<div
|
|
3
|
+
class="psui-el-tab-header"
|
|
4
|
+
:class="[getComponentClass, `layout-${layout}`]"
|
|
5
5
|
role="group"
|
|
6
6
|
>
|
|
7
|
-
|
|
8
7
|
<template v-for="(item, index) in getItems">
|
|
9
|
-
<slot
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
8
|
+
<slot :item="item">
|
|
9
|
+
<PsRichTooltip
|
|
10
|
+
v-if="item.tooltip"
|
|
11
|
+
:title="item.tooltip"
|
|
12
|
+
layout="blue"
|
|
13
|
+
>
|
|
14
|
+
<template #trigger>
|
|
15
|
+
<button
|
|
16
|
+
:key="item[keyValue] + index"
|
|
17
|
+
type="button"
|
|
18
|
+
@click="selectTab(item)"
|
|
19
|
+
:class="getButtonClass(item).value"
|
|
20
|
+
>
|
|
21
|
+
<PsIcon
|
|
22
|
+
v-if="item.icon"
|
|
23
|
+
:icon="item.icon"
|
|
24
|
+
display="flex"
|
|
25
|
+
size="16"
|
|
26
|
+
/>
|
|
27
|
+
<span>{{ item[keyLabel] }}</span>
|
|
28
|
+
</button>
|
|
29
|
+
</template>
|
|
30
|
+
</PsRichTooltip>
|
|
31
|
+
<button
|
|
32
|
+
v-else
|
|
25
33
|
type="button"
|
|
34
|
+
:key="item[keyValue] + index"
|
|
26
35
|
@click="selectTab(item)"
|
|
27
|
-
:class="getButtonClass(item)"
|
|
36
|
+
:class="getButtonClass(item).value"
|
|
28
37
|
>
|
|
29
|
-
|
|
38
|
+
<PsIcon
|
|
39
|
+
v-if="item.icon"
|
|
40
|
+
:icon="item.icon"
|
|
41
|
+
display="flex"
|
|
42
|
+
size="16"
|
|
43
|
+
/>
|
|
44
|
+
<span>{{ item[keyLabel] }}</span>
|
|
30
45
|
</button>
|
|
31
46
|
</slot>
|
|
32
47
|
</template>
|
|
33
|
-
|
|
48
|
+
</div>
|
|
34
49
|
</template>
|
|
35
50
|
|
|
36
|
-
<script>
|
|
51
|
+
<script setup>
|
|
37
52
|
import PsRichTooltip from '../tooltip/PsRichTooltip.vue'
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
/**
|
|
51
|
-
* It sets the tabs which will be rendered.
|
|
52
|
-
*/
|
|
53
|
-
items: {
|
|
54
|
-
type: Array,
|
|
55
|
-
required: true
|
|
56
|
-
},
|
|
57
|
-
/**
|
|
58
|
-
* It sets the key label of the items if needed.
|
|
59
|
-
*/
|
|
60
|
-
keyLabel: {
|
|
61
|
-
type: String,
|
|
62
|
-
default: 'label'
|
|
63
|
-
},
|
|
64
|
-
/**
|
|
65
|
-
* It sets the key value of the items if needed.
|
|
66
|
-
*/
|
|
67
|
-
keyValue: {
|
|
68
|
-
type: String,
|
|
69
|
-
default: 'value'
|
|
70
|
-
},
|
|
71
|
-
/**
|
|
72
|
-
* It disabled the tab header. All mouse events are disabled.
|
|
73
|
-
*/
|
|
74
|
-
disabled: {
|
|
75
|
-
type: Boolean,
|
|
76
|
-
default: false
|
|
77
|
-
},
|
|
78
|
-
/**
|
|
79
|
-
* It sets the tab seleced.
|
|
80
|
-
*/
|
|
81
|
-
selected: {},
|
|
53
|
+
import { computed } from 'vue'
|
|
54
|
+
import PsIcon from '../ui/PsIcon.vue'
|
|
55
|
+
|
|
56
|
+
const props = defineProps({
|
|
57
|
+
/**
|
|
58
|
+
* It sets the layout of the tabheader. eg: standard, underline and folder.
|
|
59
|
+
*/
|
|
60
|
+
layout: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: 'standard',
|
|
63
|
+
validator: (value) => ['standard', 'underline', 'folder', 'policy-design'].includes(value),
|
|
82
64
|
},
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
getIsObject() {
|
|
92
|
-
return typeof this.selected === 'object'
|
|
93
|
-
},
|
|
94
|
-
getSelected() {
|
|
95
|
-
if (this.selected) {
|
|
96
|
-
if (typeof this.selected === 'object' && this.selected[this.keyValue] ) {
|
|
97
|
-
return this.selected[this.keyValue]
|
|
98
|
-
} else {
|
|
99
|
-
return this.selected
|
|
100
|
-
}
|
|
101
|
-
} else {
|
|
102
|
-
return false
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
getItems() {
|
|
106
|
-
if (this.items.length > 0 && typeof this.items[0] !== 'object') {
|
|
107
|
-
return this.items.map((item) => {
|
|
108
|
-
return {
|
|
109
|
-
[this.keyLabel]: item,
|
|
110
|
-
[this.keyValue]: item
|
|
111
|
-
}
|
|
112
|
-
})
|
|
113
|
-
} else {
|
|
114
|
-
return this.items
|
|
115
|
-
}
|
|
116
|
-
},
|
|
65
|
+
/**
|
|
66
|
+
* It sets the tabs which will be rendered.
|
|
67
|
+
*/
|
|
68
|
+
items: {
|
|
69
|
+
type: Array,
|
|
70
|
+
required: true,
|
|
117
71
|
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
72
|
+
/**
|
|
73
|
+
* It sets the key label of the items if needed.
|
|
74
|
+
*/
|
|
75
|
+
keyLabel: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: 'label',
|
|
78
|
+
},
|
|
79
|
+
/**
|
|
80
|
+
* It sets the key value of the items if needed.
|
|
81
|
+
*/
|
|
82
|
+
keyValue: {
|
|
83
|
+
type: String,
|
|
84
|
+
default: 'value',
|
|
85
|
+
},
|
|
86
|
+
/**
|
|
87
|
+
* It disabled the tab header. All mouse events are disabled.
|
|
88
|
+
*/
|
|
89
|
+
disabled: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
default: false,
|
|
92
|
+
},
|
|
93
|
+
/**
|
|
94
|
+
* It sets the tab seleced.
|
|
95
|
+
*/
|
|
96
|
+
selected: {},
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
const emit = defineEmits(['change', 'update:selected'])
|
|
100
|
+
|
|
101
|
+
const getComponentClass = computed(() => {
|
|
102
|
+
if (props.disabled) {
|
|
103
|
+
return 'status-disabled'
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return ''
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
const getIsObject = computed(() => {
|
|
110
|
+
return typeof props.selected === 'object'
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
const getSelected = computed(() => {
|
|
114
|
+
if (props.selected) {
|
|
115
|
+
if (typeof props.selected === 'object' && props.selected[props.keyValue]) {
|
|
116
|
+
return props.selected[props.keyValue]
|
|
117
|
+
} else {
|
|
118
|
+
return props.selected
|
|
131
119
|
}
|
|
120
|
+
} else {
|
|
121
|
+
return false
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
const getItems = computed(() => {
|
|
126
|
+
if (props.items.length > 0 && typeof props.items[0] !== 'object') {
|
|
127
|
+
return props.items.map((item) => {
|
|
128
|
+
return {
|
|
129
|
+
[props.keyLabel]: item,
|
|
130
|
+
[props.keyValue]: item,
|
|
131
|
+
}
|
|
132
|
+
})
|
|
133
|
+
} else {
|
|
134
|
+
return props.items
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
const selectTab = (item) => {
|
|
139
|
+
if (item.disabled !== true) {
|
|
140
|
+
emit('update:selected', getIsObject.value ? item : item[props.keyValue])
|
|
141
|
+
emit('change', getIsObject.value ? item : item[props.keyValue])
|
|
132
142
|
}
|
|
143
|
+
}
|
|
133
144
|
|
|
145
|
+
const getButtonClass = (item) => {
|
|
146
|
+
return computed(() => {
|
|
147
|
+
if (item.disabled) {
|
|
148
|
+
return ['status-disabled']
|
|
149
|
+
} else {
|
|
150
|
+
return { 'status-active': getSelected.value === item[props.keyValue], 'status-enabled': true }
|
|
151
|
+
}
|
|
152
|
+
})
|
|
134
153
|
}
|
|
154
|
+
|
|
135
155
|
</script>
|
|
136
156
|
|
|
137
|
-
<style>
|
|
157
|
+
<style>
|
|
158
|
+
/* Please, use the file src/assets/scss/components/PsTabHeader.scss */
|
|
159
|
+
</style>
|