@policystudio/policy-studio-ui-vue 1.1.90-beta.10 → 1.1.90-beta.17

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