@policystudio/policy-studio-ui-vue 1.1.90-beta.5 → 1.1.90-beta.51
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 +2 -8
- package/.github/workflows/deploy-storybook.yml +4 -4
- package/.nvmrc +1 -0
- package/dist/css/psui_styles_output.css +6639 -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/{.storybook → doc/.storybook}/main.ts +8 -2
- package/{.storybook → doc/.storybook}/preview.ts +2 -3
- package/doc/package-lock.json +22653 -0
- package/doc/package.json +71 -0
- package/{src → doc}/shims-vue.d.ts +0 -5
- package/{src → doc/src}/stories/Accordion.stories.ts +2 -3
- package/{src → doc/src}/stories/BadgeWithIcon.stories.ts +1 -1
- package/{src → doc/src}/stories/BarChart.stories.ts +1 -1
- package/{src → doc/src}/stories/Breadcrumb.stories.ts +1 -1
- package/doc/src/stories/Button.stories.ts +130 -0
- package/{src → doc/src}/stories/CardInfos.stories.ts +1 -1
- package/{src → doc/src}/stories/ChartLegend.stories.ts +1 -1
- package/{src → doc/src}/stories/Checkbox.stories.ts +1 -1
- package/{src → doc/src}/stories/CheckboxSimple.stories.ts +1 -1
- package/{src → doc/src}/stories/Chips.stories.ts +1 -4
- package/{src → doc/src}/stories/ClimateZoneBadge.stories.ts +2 -1
- package/doc/src/stories/Collapse.stories.ts +46 -0
- package/{src → doc/src}/stories/CostEffectBar.stories.ts +2 -1
- package/{src → doc/src}/stories/Datatable.stories.ts +5 -2
- package/{src → doc/src}/stories/DateCardInfo.stories.ts +1 -1
- package/{src → doc/src}/stories/Dialog.stories.ts +2 -2
- package/{src → doc/src}/stories/Draggable.stories.ts +3 -2
- package/{src → doc/src}/stories/Dropdown.stories.ts +4 -3
- package/{src → doc/src}/stories/DropdownList.stories.ts +4 -2
- package/{src → doc/src}/stories/HighlightRippleDot.stories.ts +3 -2
- package/{src → doc/src}/stories/Icon.stories.ts +3 -1
- package/{src → doc/src}/stories/InlineSelector.stories.ts +1 -1
- package/{src → doc/src}/stories/Input.stories.ts +7 -4
- package/{src → doc/src}/stories/InputSelect.stories.ts +3 -2
- package/{src → doc/src}/stories/InputTextArea.stories.ts +1 -1
- package/{src → doc/src}/stories/MiniTag.stories.ts +9 -2
- package/{src → doc/src}/stories/ProgressBar.stories.ts +3 -2
- package/{src → doc/src}/stories/RadioButton.stories.ts +2 -2
- package/{src → doc/src}/stories/RadioButtonSimple.stories.ts +1 -1
- package/{src → doc/src}/stories/SimpleAlert.stories.ts +3 -2
- package/{src → doc/src}/stories/Slider.stories.ts +6 -2
- package/{src → doc/src}/stories/Switch.stories.ts +2 -2
- package/{src → doc/src}/stories/TabHeader.stories.ts +6 -1
- package/{src → doc/src}/stories/TableResults.stories.ts +11 -7
- package/{src → doc/src}/stories/TagScope.stories.ts +3 -2
- package/{src → doc/src}/stories/TestimonialCard.stories.ts +3 -3
- package/{src → doc/src}/stories/Toast.stories.ts +2 -2
- package/{src → doc/src}/stories/Toggle.stories.ts +6 -3
- package/{src → doc/src}/stories/Tooltip.stories.ts +3 -3
- package/doc/tsconfig.json +17 -0
- package/package.json +13 -28
- package/scripts/gulp.js +11 -0
- package/src/assets/scss/base.scss +3 -34
- package/src/assets/scss/components/PsAccordion.scss +1 -1
- package/src/assets/scss/components/PsChips.scss +9 -3
- package/src/assets/scss/components/PsCollapse.scss +71 -0
- package/src/assets/scss/components/PsDataTable.scss +1 -1
- package/src/assets/scss/components/PsDropdownList.scss +1 -1
- package/src/assets/scss/components/PsTableResults.scss +28 -1
- package/src/assets/scss/components/PsTooltip.scss +2 -1
- package/src/components/accordion/PsAccordionItem.vue +88 -74
- package/src/components/badges-and-tags/PsBadgeWithIcon.vue +31 -34
- 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 +61 -62
- package/src/components/chips/PsChips.vue +112 -101
- package/src/components/collapse/PsCollapse.vue +124 -0
- 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 +65 -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 +166 -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 +70 -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 +461 -468
- package/src/components/table-results/PsTableResultsBody.vue +66 -67
- package/src/components/table-results/PsTableResultsHead.vue +70 -67
- package/src/components/table-results/PsTableResultsHeadComparison.vue +67 -64
- package/src/components/table-results/PsTableResultsHeadFlexible.vue +94 -67
- 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 +143 -132
- package/src/index.ts +60 -67
- package/src/tsconfig.json +12 -0
- package/src/types/index.d.ts +6 -0
- package/src/util/{GeneralFunctions.ts → GeneralFunctions.js} +12 -3
- package/src/util/directives.ts +24 -0
- package/src/util/{imageLoader.ts → imageLoader.js} +7 -0
- package/tailwind.config.js +1 -1
- package/tsconfig.json +18 -13
- package/.storybook/eventBus.ts +0 -26
- package/babel.config.js +0 -17
- package/dist/css/psui_styles.css +0 -4647
- package/postcss.config.js +0 -8
- package/src/components/playground/PsScrollBar.vue +0 -320
- package/src/stories/Button.stories.ts +0 -48
- package/src/stories/Button.vue +0 -59
- package/src/stories/Header.stories.ts +0 -41
- package/src/stories/Header.vue +0 -77
- package/src/stories/Playground.stories.ts +0 -16
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/webpack.config.js +0 -22
- /package/{.storybook → doc/.storybook}/PolicyStudio.ts +0 -0
- /package/{.storybook → doc/.storybook}/manager.ts +0 -0
- /package/{src → doc/src}/assets/images/multifamily-units.svg +0 -0
- /package/{src → doc/src}/assets/images/policy-studio.svg +0 -0
- /package/{src → doc/src}/contents/ComparisonData.ts +0 -0
- /package/{src → doc/src}/contents/FlexibleData.ts +0 -0
- /package/{src → doc/src}/contents/ResultsData.ts +0 -0
- /package/{src → doc/src}/stories/Colors.mdx +0 -0
- /package/{src → doc/src}/stories/ElevationSystem.mdx +0 -0
- /package/{src → doc/src}/stories/Introduction.mdx +0 -0
- /package/{src → doc/src}/stories/Typography.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,19 +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
10
|
<p class="title">
|
|
11
11
|
{{ columnGroup.title }}
|
|
12
12
|
</p>
|
|
13
13
|
<PsIcon
|
|
14
|
-
icon="
|
|
15
|
-
size="
|
|
16
|
-
class="psui-cursor-pointer"
|
|
17
|
-
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"
|
|
18
17
|
:style="{ display: 'flex' }"
|
|
19
|
-
@click="
|
|
18
|
+
@click="emit('click-column-group-helper', columnGroup, $event)"
|
|
20
19
|
/>
|
|
21
20
|
</div>
|
|
22
21
|
</th>
|
|
@@ -24,42 +23,63 @@
|
|
|
24
23
|
|
|
25
24
|
<tr>
|
|
26
25
|
<template v-for="(columnGroup, columnGroupIndex) of header">
|
|
27
|
-
<th
|
|
28
|
-
v-for="column of columnGroup.columns"
|
|
26
|
+
<th
|
|
27
|
+
v-for="column of columnGroup.columns"
|
|
29
28
|
:key="`${columnGroup.key}-${column.key}`"
|
|
30
29
|
:data-test-id="column.key"
|
|
31
30
|
>
|
|
32
|
-
<div
|
|
31
|
+
<div
|
|
33
32
|
class="psui-flex psui-flex-col psui-justify-center"
|
|
34
33
|
:class="columnGroupIndex == 0 ? 'psui-items-center' : 'psui-items-end'"
|
|
35
34
|
:data-index="columnGroupIndex"
|
|
35
|
+
@mouseleave="emit('column-alert-hide', column, $event, false)"
|
|
36
36
|
>
|
|
37
37
|
<div class="psui-show-childrens-on-hover absolute-childrens psui-mb-px">
|
|
38
38
|
<p
|
|
39
39
|
class="title"
|
|
40
|
+
:class="{'is-warning-column': !!column.warning}"
|
|
40
41
|
v-if="column.title"
|
|
41
42
|
>
|
|
42
43
|
{{ column.title }}
|
|
43
44
|
</p>
|
|
45
|
+
<span
|
|
46
|
+
v-if="column.warning"
|
|
47
|
+
class="warning-svg-position"
|
|
48
|
+
@mouseover="emit('column-alert-show', column, $event, true)"
|
|
49
|
+
>
|
|
50
|
+
<span class="cursor-pointer">
|
|
51
|
+
<svg
|
|
52
|
+
width="10"
|
|
53
|
+
height="10"
|
|
54
|
+
viewBox="0 0 10 10"
|
|
55
|
+
fill="none"
|
|
56
|
+
>
|
|
57
|
+
<circle
|
|
58
|
+
cx="5"
|
|
59
|
+
cy="5"
|
|
60
|
+
r="4.5"
|
|
61
|
+
fill="#EDAB3E"
|
|
62
|
+
/>
|
|
63
|
+
</svg>
|
|
64
|
+
</span>
|
|
65
|
+
</span>
|
|
44
66
|
|
|
45
67
|
<PsIcon
|
|
46
|
-
icon="
|
|
68
|
+
icon="info_outline"
|
|
47
69
|
size="16"
|
|
48
|
-
class="psui-cursor-pointer
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
@click="$emit('click-column-helper', column, $event)"
|
|
70
|
+
class="helper psui-cursor-pointer psui-text-gray-40 hover:psui-text-blue-60 psui-opacity-0 psui-leading-none psui-transition"
|
|
71
|
+
:style="{ display: 'flex', marginTop: '1px' }"
|
|
72
|
+
@click="emit('click-column-helper', column, $event)"
|
|
52
73
|
/>
|
|
53
|
-
|
|
74
|
+
|
|
54
75
|
<PsIcon
|
|
55
76
|
v-if="showOrder"
|
|
56
77
|
:icon="orderDirection == 'asc' ? 'arrow_downward' : 'arrow_upward'"
|
|
57
78
|
:type="orderDirection == 'asc' ? 'arrow_upward' : 'arrow_upward'"
|
|
58
79
|
size="16"
|
|
59
|
-
class="psui-cursor-pointer
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
@click="$emit('click-order-column', column)"
|
|
80
|
+
class="helper psui-cursor-pointer psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
|
|
81
|
+
:style="{ display: 'flex', marginTop: '1px' }"
|
|
82
|
+
@click="emit('click-order-column', column)"
|
|
63
83
|
/>
|
|
64
84
|
</div>
|
|
65
85
|
<p
|
|
@@ -75,55 +95,62 @@
|
|
|
75
95
|
</thead>
|
|
76
96
|
</template>
|
|
77
97
|
|
|
78
|
-
<script>
|
|
98
|
+
<script setup>
|
|
79
99
|
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
|
-
}
|
|
100
|
+
|
|
101
|
+
import { computed, getCurrentInstance } from 'vue'
|
|
102
|
+
|
|
103
|
+
defineProps({
|
|
104
|
+
/**
|
|
105
|
+
* It sets the title for the first column.
|
|
106
|
+
*/
|
|
107
|
+
firstColumnTitle: {
|
|
108
|
+
type: String,
|
|
109
|
+
default: '',
|
|
115
110
|
},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
111
|
+
/**
|
|
112
|
+
* It sets the description for the first column.
|
|
113
|
+
*/
|
|
114
|
+
firstColumnDescription: {
|
|
115
|
+
type: String,
|
|
116
|
+
default: '',
|
|
117
|
+
},
|
|
118
|
+
/**
|
|
119
|
+
* It sets the values which will be use to render the header.
|
|
120
|
+
*/
|
|
121
|
+
header: {
|
|
122
|
+
type: Array,
|
|
123
|
+
required: true,
|
|
124
|
+
default: () => {
|
|
125
|
+
return []
|
|
125
126
|
},
|
|
126
|
-
}
|
|
127
|
-
|
|
127
|
+
},
|
|
128
|
+
/**
|
|
129
|
+
* this sets whether sorting will be displayed.
|
|
130
|
+
*/
|
|
131
|
+
showOrder: {
|
|
132
|
+
type: Boolean,
|
|
133
|
+
default: false,
|
|
134
|
+
},
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
const emit = defineEmits(['click-column-group-helper', 'click-column-helper', 'click-order-column', 'column-alert-show', 'column-alert-hide'])
|
|
138
|
+
|
|
139
|
+
const parent = getCurrentInstance().proxy.$parent
|
|
140
|
+
|
|
141
|
+
const columnsSelectedForStudy = computed(() => {
|
|
142
|
+
return parent.columnsSelectedForStudy
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
const orderColumn = computed(() => {
|
|
146
|
+
return parent.orderColumn
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
const orderDirection = computed(() => {
|
|
150
|
+
return parent.orderDirection
|
|
151
|
+
})
|
|
128
152
|
</script>
|
|
129
|
-
|
|
153
|
+
|
|
154
|
+
<style>
|
|
155
|
+
/* Please, use the file src/assets/scss/components/PsTableResults.scss */
|
|
156
|
+
</style>
|
|
@@ -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"
|
|
@@ -26,64 +24,65 @@
|
|
|
26
24
|
</tbody>
|
|
27
25
|
</template>
|
|
28
26
|
|
|
29
|
-
<script>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
/**
|
|
43
|
-
* It sets the values which will be use to render the body.
|
|
44
|
-
*/
|
|
45
|
-
columnGroups: {
|
|
46
|
-
type: Array,
|
|
47
|
-
default() {
|
|
48
|
-
return []
|
|
49
|
-
}
|
|
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 []
|
|
50
38
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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 []
|
|
59
47
|
},
|
|
60
48
|
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
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
|
+
},
|
|
70
57
|
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
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)
|
|
85
71
|
}
|
|
86
72
|
}
|
|
87
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
|
+
|
|
88
84
|
</script>
|
|
89
|
-
|
|
85
|
+
|
|
86
|
+
<style>
|
|
87
|
+
/* Please, use the file src/assets/scss/components/PsTableResults.scss */
|
|
88
|
+
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
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
7
|
<template v-for="(item, index) in getItems">
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
:key="item[keyValue] + index"
|
|
17
17
|
type="button"
|
|
18
18
|
@click="selectTab(item)"
|
|
19
|
-
:class="getButtonClass(item)"
|
|
19
|
+
:class="getButtonClass(item).value"
|
|
20
20
|
>
|
|
21
|
-
<span>{{ item[keyLabel] }}</span>
|
|
21
|
+
<span>{{ item[keyLabel] }}</span>
|
|
22
22
|
</button>
|
|
23
23
|
</template>
|
|
24
24
|
</PsRichTooltip>
|
|
@@ -27,114 +27,120 @@
|
|
|
27
27
|
:key="item[keyValue] + index"
|
|
28
28
|
type="button"
|
|
29
29
|
@click="selectTab(item)"
|
|
30
|
-
:class="getButtonClass(item)"
|
|
30
|
+
:class="getButtonClass(item).value"
|
|
31
31
|
>
|
|
32
|
-
<span>{{ item[keyLabel] }}</span>
|
|
32
|
+
<span>{{ item[keyLabel] }}</span>
|
|
33
33
|
</button>
|
|
34
34
|
</slot>
|
|
35
35
|
</template>
|
|
36
36
|
</div>
|
|
37
37
|
</template>
|
|
38
38
|
|
|
39
|
-
<script>
|
|
39
|
+
<script setup>
|
|
40
40
|
import PsRichTooltip from '../tooltip/PsRichTooltip.vue'
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
validator: (value) => ['standard', 'underline', 'folder'].includes(value)
|
|
52
|
-
},
|
|
53
|
-
/**
|
|
54
|
-
* It sets the tabs which will be rendered.
|
|
55
|
-
*/
|
|
56
|
-
items: {
|
|
57
|
-
type: Array,
|
|
58
|
-
required: true
|
|
59
|
-
},
|
|
60
|
-
/**
|
|
61
|
-
* It sets the key label of the items if needed.
|
|
62
|
-
*/
|
|
63
|
-
keyLabel: {
|
|
64
|
-
type: String,
|
|
65
|
-
default: 'label'
|
|
66
|
-
},
|
|
67
|
-
/**
|
|
68
|
-
* It sets the key value of the items if needed.
|
|
69
|
-
*/
|
|
70
|
-
keyValue: {
|
|
71
|
-
type: String,
|
|
72
|
-
default: 'value'
|
|
73
|
-
},
|
|
74
|
-
/**
|
|
75
|
-
* It disabled the tab header. All mouse events are disabled.
|
|
76
|
-
*/
|
|
77
|
-
disabled: {
|
|
78
|
-
type: Boolean,
|
|
79
|
-
default: false
|
|
80
|
-
},
|
|
81
|
-
/**
|
|
82
|
-
* It sets the tab seleced.
|
|
83
|
-
*/
|
|
84
|
-
selected: {},
|
|
41
|
+
import { computed } from 'vue'
|
|
42
|
+
|
|
43
|
+
const props = defineProps({
|
|
44
|
+
/**
|
|
45
|
+
* It sets the layout of the tabheader. eg: standard, underline and folder.
|
|
46
|
+
*/
|
|
47
|
+
layout: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: 'standard',
|
|
50
|
+
validator: (value) => ['standard', 'underline', 'folder'].includes(value),
|
|
85
51
|
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
getIsObject() {
|
|
95
|
-
return typeof this.selected === 'object'
|
|
96
|
-
},
|
|
97
|
-
getSelected() {
|
|
98
|
-
if (this.selected) {
|
|
99
|
-
if (typeof this.selected === 'object' && this.selected[this.keyValue] ) {
|
|
100
|
-
return this.selected[this.keyValue]
|
|
101
|
-
} else {
|
|
102
|
-
return this.selected
|
|
103
|
-
}
|
|
104
|
-
} else {
|
|
105
|
-
return false
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
getItems() {
|
|
109
|
-
if (this.items.length > 0 && typeof this.items[0] !== 'object') {
|
|
110
|
-
return this.items.map((item) => {
|
|
111
|
-
return {
|
|
112
|
-
[this.keyLabel]: item,
|
|
113
|
-
[this.keyValue]: item
|
|
114
|
-
}
|
|
115
|
-
})
|
|
116
|
-
} else {
|
|
117
|
-
return this.items
|
|
118
|
-
}
|
|
119
|
-
},
|
|
52
|
+
/**
|
|
53
|
+
* It sets the tabs which will be rendered.
|
|
54
|
+
*/
|
|
55
|
+
items: {
|
|
56
|
+
type: Array,
|
|
57
|
+
required: true,
|
|
120
58
|
},
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
59
|
+
/**
|
|
60
|
+
* It sets the key label of the items if needed.
|
|
61
|
+
*/
|
|
62
|
+
keyLabel: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: 'label',
|
|
65
|
+
},
|
|
66
|
+
/**
|
|
67
|
+
* It sets the key value of the items if needed.
|
|
68
|
+
*/
|
|
69
|
+
keyValue: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: 'value',
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* It disabled the tab header. All mouse events are disabled.
|
|
75
|
+
*/
|
|
76
|
+
disabled: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: false,
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* It sets the tab seleced.
|
|
82
|
+
*/
|
|
83
|
+
selected: {},
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
const emit = defineEmits(['change', 'update:selected'])
|
|
87
|
+
|
|
88
|
+
const getComponentClass = computed(() => {
|
|
89
|
+
if (props.disabled) {
|
|
90
|
+
return 'status-disabled'
|
|
91
|
+
} else {
|
|
92
|
+
return 'status-resting'
|
|
93
|
+
}
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
const getIsObject = computed(() => {
|
|
97
|
+
return typeof props.selected === 'object'
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
const getSelected = computed(() => {
|
|
101
|
+
if (props.selected) {
|
|
102
|
+
if (typeof props.selected === 'object' && props.selected[props.keyValue]) {
|
|
103
|
+
return props.selected[props.keyValue]
|
|
104
|
+
} else {
|
|
105
|
+
return props.selected
|
|
134
106
|
}
|
|
107
|
+
} else {
|
|
108
|
+
return false
|
|
109
|
+
}
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
const getItems = computed(() => {
|
|
113
|
+
if (props.items.length > 0 && typeof props.items[0] !== 'object') {
|
|
114
|
+
return props.items.map((item) => {
|
|
115
|
+
return {
|
|
116
|
+
[props.keyLabel]: item,
|
|
117
|
+
[props.keyValue]: item,
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
} else {
|
|
121
|
+
return props.items
|
|
135
122
|
}
|
|
123
|
+
})
|
|
136
124
|
|
|
125
|
+
const selectTab = (item) => {
|
|
126
|
+
if (item.disabled !== true) {
|
|
127
|
+
emit('update:selected', getIsObject.value ? item : item[props.keyValue])
|
|
128
|
+
emit('change', getIsObject.value ? item : item[props.keyValue])
|
|
129
|
+
}
|
|
137
130
|
}
|
|
131
|
+
|
|
132
|
+
const getButtonClass = (item) => {
|
|
133
|
+
return computed(() => {
|
|
134
|
+
if (item.disabled) {
|
|
135
|
+
return ['status-disabled']
|
|
136
|
+
} else {
|
|
137
|
+
return { 'status-active': getSelected.value === item[props.keyValue], 'status-enabled': true }
|
|
138
|
+
}
|
|
139
|
+
})
|
|
140
|
+
}
|
|
141
|
+
|
|
138
142
|
</script>
|
|
139
143
|
|
|
140
|
-
<style>
|
|
144
|
+
<style>
|
|
145
|
+
/* Please, use the file src/assets/scss/components/PsTabHeader.scss */
|
|
146
|
+
</style>
|