@policystudio/policy-studio-ui-vue 1.1.90-beta.12 → 1.1.90-beta.18

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 (231) 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/dist/index.d.ts +50 -0
  6. package/dist/index.js +53 -63
  7. package/dist/index.js.map +1 -1
  8. package/dist/util/GeneralFunctions.d.ts +3 -0
  9. package/dist/util/GeneralFunctions.js.map +1 -1
  10. package/dist/util/directives.d.ts +1 -0
  11. package/dist/util/directives.js +22 -0
  12. package/dist/util/directives.js.map +1 -0
  13. package/dist/util/eventBus.d.ts +7 -0
  14. package/dist/util/eventBus.js +8 -0
  15. package/dist/util/eventBus.js.map +1 -0
  16. package/dist/util/imageLoader.d.ts +6 -0
  17. package/dist/util/imageLoader.js.map +1 -1
  18. package/package.json +9 -23
  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 -34
  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 +61 -62
  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 +132 -129
  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 +452 -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 +57 -71
  68. package/src/tsconfig.json +12 -0
  69. package/src/{shims-vue.d.ts → types/index.d.ts} +0 -5
  70. package/src/util/{GeneralFunctions.ts → GeneralFunctions.js} +0 -3
  71. package/src/util/directives.ts +24 -0
  72. package/src/util/eventBus.js +10 -0
  73. package/src/util/{imageLoader.ts → imageLoader.js} +7 -8
  74. package/tailwind.config.js +1 -1
  75. package/tsconfig.json +15 -17
  76. package/.storybook/PolicyStudio.ts +0 -11
  77. package/.storybook/eventBus.ts +0 -26
  78. package/.storybook/main.ts +0 -21
  79. package/.storybook/manager.ts +0 -7
  80. package/.storybook/preview.ts +0 -17
  81. package/dist/contents/ComparisonData.js +0 -376
  82. package/dist/contents/ComparisonData.js.map +0 -1
  83. package/dist/contents/FlexibleData.js +0 -501
  84. package/dist/contents/FlexibleData.js.map +0 -1
  85. package/dist/contents/ResultsData.js +0 -530
  86. package/dist/contents/ResultsData.js.map +0 -1
  87. package/dist/css/psui_styles.css +0 -4647
  88. package/dist/stories/Accordion.stories.js +0 -56
  89. package/dist/stories/Accordion.stories.js.map +0 -1
  90. package/dist/stories/BadgeWithIcon.stories.js +0 -28
  91. package/dist/stories/BadgeWithIcon.stories.js.map +0 -1
  92. package/dist/stories/BarChart.stories.js +0 -16
  93. package/dist/stories/BarChart.stories.js.map +0 -1
  94. package/dist/stories/Breadcrumb.stories.js +0 -21
  95. package/dist/stories/Breadcrumb.stories.js.map +0 -1
  96. package/dist/stories/Button.stories.js +0 -44
  97. package/dist/stories/Button.stories.js.map +0 -1
  98. package/dist/stories/CardInfos.stories.js +0 -13
  99. package/dist/stories/CardInfos.stories.js.map +0 -1
  100. package/dist/stories/ChartLegend.stories.js +0 -13
  101. package/dist/stories/ChartLegend.stories.js.map +0 -1
  102. package/dist/stories/Checkbox.stories.js +0 -44
  103. package/dist/stories/Checkbox.stories.js.map +0 -1
  104. package/dist/stories/CheckboxSimple.stories.js +0 -48
  105. package/dist/stories/CheckboxSimple.stories.js.map +0 -1
  106. package/dist/stories/Chips.stories.js +0 -27
  107. package/dist/stories/Chips.stories.js.map +0 -1
  108. package/dist/stories/ClimateZoneBadge.stories.js +0 -15
  109. package/dist/stories/ClimateZoneBadge.stories.js.map +0 -1
  110. package/dist/stories/CostEffectBar.stories.js +0 -21
  111. package/dist/stories/CostEffectBar.stories.js.map +0 -1
  112. package/dist/stories/Datatable.stories.js +0 -45
  113. package/dist/stories/Datatable.stories.js.map +0 -1
  114. package/dist/stories/DateCardInfo.stories.js +0 -18
  115. package/dist/stories/DateCardInfo.stories.js.map +0 -1
  116. package/dist/stories/Dialog.stories.js +0 -127
  117. package/dist/stories/Dialog.stories.js.map +0 -1
  118. package/dist/stories/Draggable.stories.js +0 -20
  119. package/dist/stories/Draggable.stories.js.map +0 -1
  120. package/dist/stories/Dropdown.stories.js +0 -98
  121. package/dist/stories/Dropdown.stories.js.map +0 -1
  122. package/dist/stories/DropdownList.stories.js +0 -208
  123. package/dist/stories/DropdownList.stories.js.map +0 -1
  124. package/dist/stories/Header.stories.js +0 -39
  125. package/dist/stories/Header.stories.js.map +0 -1
  126. package/dist/stories/HighlightRippleDot.stories.js +0 -13
  127. package/dist/stories/HighlightRippleDot.stories.js.map +0 -1
  128. package/dist/stories/Icon.stories.js +0 -19
  129. package/dist/stories/Icon.stories.js.map +0 -1
  130. package/dist/stories/InlineSelector.stories.js +0 -16
  131. package/dist/stories/InlineSelector.stories.js.map +0 -1
  132. package/dist/stories/Input.stories.js +0 -235
  133. package/dist/stories/Input.stories.js.map +0 -1
  134. package/dist/stories/InputSelect.stories.js +0 -28
  135. package/dist/stories/InputSelect.stories.js.map +0 -1
  136. package/dist/stories/InputTextArea.stories.js +0 -23
  137. package/dist/stories/InputTextArea.stories.js.map +0 -1
  138. package/dist/stories/MiniTag.stories.js +0 -44
  139. package/dist/stories/MiniTag.stories.js.map +0 -1
  140. package/dist/stories/Playground.stories.js +0 -14
  141. package/dist/stories/Playground.stories.js.map +0 -1
  142. package/dist/stories/ProgressBar.stories.js +0 -21
  143. package/dist/stories/ProgressBar.stories.js.map +0 -1
  144. package/dist/stories/RadioButton.stories.js +0 -36
  145. package/dist/stories/RadioButton.stories.js.map +0 -1
  146. package/dist/stories/RadioButtonSimple.stories.js +0 -40
  147. package/dist/stories/RadioButtonSimple.stories.js.map +0 -1
  148. package/dist/stories/SimpleAlert.stories.js +0 -19
  149. package/dist/stories/SimpleAlert.stories.js.map +0 -1
  150. package/dist/stories/Slider.stories.js +0 -70
  151. package/dist/stories/Slider.stories.js.map +0 -1
  152. package/dist/stories/Switch.stories.js +0 -35
  153. package/dist/stories/Switch.stories.js.map +0 -1
  154. package/dist/stories/TabHeader.stories.js +0 -48
  155. package/dist/stories/TabHeader.stories.js.map +0 -1
  156. package/dist/stories/TableResults.stories.js +0 -717
  157. package/dist/stories/TableResults.stories.js.map +0 -1
  158. package/dist/stories/TagScope.stories.js +0 -16
  159. package/dist/stories/TagScope.stories.js.map +0 -1
  160. package/dist/stories/TestimonialCard.stories.js +0 -24
  161. package/dist/stories/TestimonialCard.stories.js.map +0 -1
  162. package/dist/stories/Toast.stories.js +0 -51
  163. package/dist/stories/Toast.stories.js.map +0 -1
  164. package/dist/stories/Toggle.stories.js +0 -42
  165. package/dist/stories/Toggle.stories.js.map +0 -1
  166. package/dist/stories/Tooltip.stories.js +0 -108
  167. package/dist/stories/Tooltip.stories.js.map +0 -1
  168. package/postcss.config.js +0 -8
  169. package/src/assets/images/multifamily-units.svg +0 -10
  170. package/src/assets/images/policy-studio.svg +0 -15
  171. package/src/components/playground/PsScrollBar.vue +0 -320
  172. package/src/contents/ComparisonData.ts +0 -378
  173. package/src/contents/FlexibleData.ts +0 -502
  174. package/src/contents/ResultsData.ts +0 -531
  175. package/src/stories/Accordion.stories.ts +0 -59
  176. package/src/stories/BadgeWithIcon.stories.ts +0 -31
  177. package/src/stories/BarChart.stories.ts +0 -17
  178. package/src/stories/Breadcrumb.stories.ts +0 -22
  179. package/src/stories/Button.stories.ts +0 -48
  180. package/src/stories/Button.vue +0 -59
  181. package/src/stories/CardInfos.stories.ts +0 -15
  182. package/src/stories/ChartLegend.stories.ts +0 -15
  183. package/src/stories/Checkbox.stories.ts +0 -45
  184. package/src/stories/CheckboxSimple.stories.ts +0 -49
  185. package/src/stories/Chips.stories.ts +0 -33
  186. package/src/stories/ClimateZoneBadge.stories.ts +0 -18
  187. package/src/stories/Colors.mdx +0 -70
  188. package/src/stories/CostEffectBar.stories.ts +0 -24
  189. package/src/stories/Datatable.stories.ts +0 -53
  190. package/src/stories/DateCardInfo.stories.ts +0 -20
  191. package/src/stories/Dialog.stories.ts +0 -131
  192. package/src/stories/Draggable.stories.ts +0 -23
  193. package/src/stories/Dropdown.stories.ts +0 -100
  194. package/src/stories/DropdownList.stories.ts +0 -213
  195. package/src/stories/ElevationSystem.mdx +0 -41
  196. package/src/stories/Header.stories.ts +0 -42
  197. package/src/stories/Header.vue +0 -77
  198. package/src/stories/HighlightRippleDot.stories.ts +0 -16
  199. package/src/stories/Icon.stories.ts +0 -23
  200. package/src/stories/InlineSelector.stories.ts +0 -18
  201. package/src/stories/Input.stories.ts +0 -243
  202. package/src/stories/InputSelect.stories.ts +0 -31
  203. package/src/stories/InputTextArea.stories.ts +0 -25
  204. package/src/stories/Introduction.mdx +0 -211
  205. package/src/stories/MiniTag.stories.ts +0 -59
  206. package/src/stories/Playground.stories.ts +0 -16
  207. package/src/stories/ProgressBar.stories.ts +0 -24
  208. package/src/stories/RadioButton.stories.ts +0 -40
  209. package/src/stories/RadioButtonSimple.stories.ts +0 -43
  210. package/src/stories/SimpleAlert.stories.ts +0 -22
  211. package/src/stories/Slider.stories.ts +0 -79
  212. package/src/stories/Switch.stories.ts +0 -39
  213. package/src/stories/TabHeader.stories.ts +0 -57
  214. package/src/stories/TableResults.stories.ts +0 -728
  215. package/src/stories/TagScope.stories.ts +0 -17
  216. package/src/stories/TestimonialCard.stories.ts +0 -27
  217. package/src/stories/Toast.stories.ts +0 -52
  218. package/src/stories/Toggle.stories.ts +0 -48
  219. package/src/stories/Tooltip.stories.ts +0 -114
  220. package/src/stories/Typography.mdx +0 -212
  221. package/src/stories/assets/code-brackets.svg +0 -1
  222. package/src/stories/assets/colors.svg +0 -1
  223. package/src/stories/assets/comments.svg +0 -1
  224. package/src/stories/assets/direction.svg +0 -1
  225. package/src/stories/assets/flow.svg +0 -1
  226. package/src/stories/assets/plugin.svg +0 -1
  227. package/src/stories/assets/repo.svg +0 -1
  228. package/src/stories/assets/stackalt.svg +0 -1
  229. package/src/stories/button.css +0 -30
  230. package/src/stories/header.css +0 -32
  231. 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>