@policystudio/policy-studio-ui-vue 1.1.90-beta.2 → 1.1.90-beta.20

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 (146) hide show
  1. package/.eslintrc.js +13 -8
  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/dist/index.d.ts +50 -0
  6. package/dist/index.js +104 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/util/GeneralFunctions.d.ts +3 -0
  9. package/dist/util/GeneralFunctions.js +29 -0
  10. package/dist/util/GeneralFunctions.js.map +1 -0
  11. package/dist/util/directives.d.ts +1 -0
  12. package/dist/util/directives.js +22 -0
  13. package/dist/util/directives.js.map +1 -0
  14. package/dist/util/imageLoader.d.ts +6 -0
  15. package/dist/util/imageLoader.js +52 -0
  16. package/dist/util/imageLoader.js.map +1 -0
  17. package/package.json +25 -37
  18. package/src/App.vue +30 -0
  19. package/src/assets/scss/components/PsDataTable.scss +1 -1
  20. package/src/components/accordion/PsAccordionItem.vue +75 -75
  21. package/src/components/badges-and-tags/PsBadgeWithIcon.vue +31 -33
  22. package/src/components/badges-and-tags/PsCardInfos.vue +40 -41
  23. package/src/components/badges-and-tags/PsChartLegend.vue +47 -51
  24. package/src/components/badges-and-tags/PsClimateZoneBadge.vue +14 -19
  25. package/src/components/badges-and-tags/PsCostEffectBar.vue +24 -56
  26. package/src/components/badges-and-tags/PsDateCardInfo.vue +17 -18
  27. package/src/components/badges-and-tags/PsHighlightRippleDot.vue +3 -2
  28. package/src/components/badges-and-tags/PsMiniTag.vue +39 -41
  29. package/src/components/badges-and-tags/PsProgressBar.vue +72 -68
  30. package/src/components/badges-and-tags/PsTagScope.vue +17 -22
  31. package/src/components/badges-and-tags/PsTestimonialCard.vue +20 -26
  32. package/src/components/buttons/PsButton.vue +88 -111
  33. package/src/components/chips/PsChips.vue +98 -101
  34. package/src/components/controls/PsCheckbox.vue +84 -84
  35. package/src/components/controls/PsCheckboxSimple.vue +95 -95
  36. package/src/components/controls/PsDraggable.vue +53 -55
  37. package/src/components/controls/PsInlineSelector.vue +99 -99
  38. package/src/components/controls/PsRadioButton.vue +59 -58
  39. package/src/components/controls/PsRadioButtonSimple.vue +79 -75
  40. package/src/components/controls/PsSlider.vue +185 -176
  41. package/src/components/controls/PsSwitch.vue +51 -52
  42. package/src/components/controls/PsToggle.vue +53 -50
  43. package/src/components/data-graphics/PsBarChart.vue +19 -21
  44. package/src/components/datatable/PsDataTable.vue +56 -60
  45. package/src/components/datatable/PsDataTableItem.vue +14 -28
  46. package/src/components/forms/PsDropdown.vue +164 -162
  47. package/src/components/forms/PsDropdownList.vue +133 -130
  48. package/src/components/forms/PsInput.vue +155 -153
  49. package/src/components/forms/PsInputSelect.vue +91 -92
  50. package/src/components/forms/PsInputTextArea.vue +71 -71
  51. package/src/components/navigations/PsBreadcrumb.vue +26 -34
  52. package/src/components/notifications/PsDialog.vue +57 -56
  53. package/src/components/notifications/PsSimpleAlert.vue +28 -29
  54. package/src/components/notifications/PsToast.vue +40 -39
  55. package/src/components/table-results/PsTableResults.vue +449 -458
  56. package/src/components/table-results/PsTableResultsBody.vue +66 -67
  57. package/src/components/table-results/PsTableResultsHead.vue +62 -56
  58. package/src/components/table-results/PsTableResultsHeadComparison.vue +62 -56
  59. package/src/components/table-results/PsTableResultsHeadFlexible.vue +63 -56
  60. package/src/components/table-results/PsTableResultsRow.vue +55 -56
  61. package/src/components/tabs/PsTabHeader.vue +106 -100
  62. package/src/components/tooltip/PsDialogTooltip.vue +96 -101
  63. package/src/components/tooltip/PsRichTooltip.vue +42 -45
  64. package/src/components/tooltip/PsTooltip.vue +111 -116
  65. package/src/components/ui/PsDotLoader.vue +1 -5
  66. package/src/components/ui/PsIcon.vue +126 -129
  67. package/src/index.ts +156 -0
  68. package/src/tsconfig.json +12 -0
  69. package/src/types/index.d.ts +6 -0
  70. package/src/util/GeneralFunctions.js +4 -6
  71. package/src/util/directives.ts +24 -0
  72. package/src/util/imageLoader.js +14 -7
  73. package/tailwind.config.js +1 -1
  74. package/tsconfig.json +47 -0
  75. package/.storybook/PolicyStudio.js +0 -10
  76. package/.storybook/eventBus.js +0 -26
  77. package/.storybook/main.js +0 -21
  78. package/.storybook/manager.js +0 -6
  79. package/.storybook/preview.js +0 -17
  80. package/babel.config.js +0 -17
  81. package/dist/css/psui_styles.css +0 -4647
  82. package/postcss.config.js +0 -8
  83. package/src/assets/images/multifamily-units.svg +0 -10
  84. package/src/assets/images/policy-studio.svg +0 -15
  85. package/src/components/playground/PsScrollBar.vue +0 -320
  86. package/src/contents/ComparisonData.js +0 -378
  87. package/src/contents/FlexibleData.js +0 -502
  88. package/src/contents/ResultsData.js +0 -531
  89. package/src/index.js +0 -166
  90. package/src/stories/Accordion.stories.js +0 -59
  91. package/src/stories/BadgeWithIcon.stories.js +0 -31
  92. package/src/stories/BarChart.stories.js +0 -17
  93. package/src/stories/Breadcrumb.stories.js +0 -25
  94. package/src/stories/Button.stories.js +0 -48
  95. package/src/stories/Button.vue +0 -59
  96. package/src/stories/CardInfos.stories.js +0 -16
  97. package/src/stories/ChartLegend.stories.js +0 -16
  98. package/src/stories/Checkbox.stories.js +0 -45
  99. package/src/stories/CheckboxSimple.stories.js +0 -49
  100. package/src/stories/Chips.stories.js +0 -31
  101. package/src/stories/ClimateZoneBadge.stories.js +0 -17
  102. package/src/stories/Colors.mdx +0 -70
  103. package/src/stories/CostEffectBar.stories.js +0 -23
  104. package/src/stories/Datatable.stories.js +0 -50
  105. package/src/stories/DateCardInfo.stories.js +0 -24
  106. package/src/stories/Dialog.stories.js +0 -131
  107. package/src/stories/Draggable.stories.js +0 -22
  108. package/src/stories/Dropdown.stories.js +0 -99
  109. package/src/stories/DropdownList.stories.js +0 -211
  110. package/src/stories/ElevationSystem.mdx +0 -41
  111. package/src/stories/Header.stories.js +0 -41
  112. package/src/stories/Header.vue +0 -77
  113. package/src/stories/HighlightRippleDot.stories.js +0 -15
  114. package/src/stories/Icon.stories.js +0 -21
  115. package/src/stories/InlineSelector.stories.js +0 -18
  116. package/src/stories/Input.stories.js +0 -240
  117. package/src/stories/InputSelect.stories.js +0 -30
  118. package/src/stories/InputTextArea.stories.js +0 -25
  119. package/src/stories/Introduction.mdx +0 -211
  120. package/src/stories/MiniTag.stories.js +0 -52
  121. package/src/stories/Playground.stories.js +0 -16
  122. package/src/stories/ProgressBar.stories.js +0 -23
  123. package/src/stories/RadioButton.stories.js +0 -40
  124. package/src/stories/RadioButtonSimple.stories.js +0 -43
  125. package/src/stories/SimpleAlert.stories.js +0 -21
  126. package/src/stories/Slider.stories.js +0 -75
  127. package/src/stories/Switch.stories.js +0 -39
  128. package/src/stories/TabHeader.stories.js +0 -52
  129. package/src/stories/TableResults.stories.js +0 -724
  130. package/src/stories/TagScope.stories.js +0 -17
  131. package/src/stories/TestimonialCard.stories.js +0 -27
  132. package/src/stories/Toast.stories.js +0 -52
  133. package/src/stories/Toggle.stories.js +0 -45
  134. package/src/stories/Tooltip.stories.js +0 -114
  135. package/src/stories/Typography.mdx +0 -212
  136. package/src/stories/assets/code-brackets.svg +0 -1
  137. package/src/stories/assets/colors.svg +0 -1
  138. package/src/stories/assets/comments.svg +0 -1
  139. package/src/stories/assets/direction.svg +0 -1
  140. package/src/stories/assets/flow.svg +0 -1
  141. package/src/stories/assets/plugin.svg +0 -1
  142. package/src/stories/assets/repo.svg +0 -1
  143. package/src/stories/assets/stackalt.svg +0 -1
  144. package/src/stories/button.css +0 -30
  145. package/src/stories/header.css +0 -32
  146. package/webpack.config.js +0 -22
@@ -10,9 +10,7 @@
10
10
  </p>
11
11
  </td>
12
12
 
13
- <template
14
- v-for="(columnGroup, indexColumn) of columnGroups"
15
- >
13
+ <template v-for="(columnGroup, indexColumn) of columnGroups">
16
14
  <td
17
15
  v-for="column of columnGroup.columns"
18
16
  :key="indexColumn + '-' + columnGroup.key + '-' + column.key"
@@ -24,76 +22,77 @@
24
22
  </tbody>
25
23
  </template>
26
24
 
27
- <script>
28
- 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>