@policystudio/policy-studio-ui-vue 1.1.88 → 1.1.90-access.0

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 (170) hide show
  1. package/.eslintignore +1 -0
  2. package/.eslintrc.js +75 -67
  3. package/.github/workflows/deploy-storybook.yml +5 -5
  4. package/.nvmrc +1 -0
  5. package/dist/css/psui_styles_output.css +6617 -0
  6. package/dist/index.d.ts +51 -0
  7. package/dist/index.js +106 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/util/GeneralFunctions.d.ts +3 -0
  10. package/dist/util/GeneralFunctions.js +35 -0
  11. package/dist/util/GeneralFunctions.js.map +1 -0
  12. package/dist/util/directives.d.ts +1 -0
  13. package/dist/util/directives.js +22 -0
  14. package/dist/util/directives.js.map +1 -0
  15. package/dist/util/imageLoader.d.ts +6 -0
  16. package/dist/util/imageLoader.js +52 -0
  17. package/dist/util/imageLoader.js.map +1 -0
  18. package/doc/.nvmrc +1 -0
  19. package/doc/.storybook/PolicyStudio.ts +11 -0
  20. package/doc/.storybook/main.ts +27 -0
  21. package/doc/.storybook/manager.ts +7 -0
  22. package/{.storybook/preview.js → doc/.storybook/preview.ts} +2 -3
  23. package/doc/package-lock.json +22653 -0
  24. package/doc/package.json +71 -0
  25. package/doc/shims-vue.d.ts +6 -0
  26. package/{src/stories/Accordion.stories.js → doc/src/stories/Accordion.stories.ts} +4 -5
  27. package/{src/stories/BadgeWithIcon.stories.js → doc/src/stories/BadgeWithIcon.stories.ts} +2 -2
  28. package/{src/stories/BarChart.stories.js → doc/src/stories/BarChart.stories.ts} +2 -2
  29. package/{src/stories/Breadcrumb.stories.js → doc/src/stories/Breadcrumb.stories.ts} +2 -5
  30. package/{src/stories/Button.stories.js → doc/src/stories/Button.stories.ts} +130 -130
  31. package/{src/stories/CardInfos.stories.js → doc/src/stories/CardInfos.stories.ts} +2 -3
  32. package/{src/stories/ChartLegend.stories.js → doc/src/stories/ChartLegend.stories.ts} +2 -3
  33. package/{src/stories/Checkbox.stories.js → doc/src/stories/Checkbox.stories.ts} +2 -2
  34. package/{src/stories/CheckboxSimple.stories.js → doc/src/stories/CheckboxSimple.stories.ts} +2 -2
  35. package/{src/stories/Chips.stories.js → doc/src/stories/Chips.stories.ts} +22 -23
  36. package/{src/stories/ClimateZoneBadge.stories.js → doc/src/stories/ClimateZoneBadge.stories.ts} +3 -2
  37. package/doc/src/stories/Collapse.stories.ts +46 -0
  38. package/{src/stories/CostEffectBar.stories.js → doc/src/stories/CostEffectBar.stories.ts} +3 -2
  39. package/{src/stories/Datatable.stories.js → doc/src/stories/Datatable.stories.ts} +7 -4
  40. package/{src/stories/DateCardInfo.stories.js → doc/src/stories/DateCardInfo.stories.ts} +2 -6
  41. package/{src/stories/Dialog.stories.js → doc/src/stories/Dialog.stories.ts} +2 -2
  42. package/{src/stories/Draggable.stories.js → doc/src/stories/Draggable.stories.ts} +3 -2
  43. package/{src/stories/Dropdown.stories.js → doc/src/stories/Dropdown.stories.ts} +4 -3
  44. package/{src/stories/DropdownList.stories.js → doc/src/stories/DropdownList.stories.ts} +4 -2
  45. package/{src/stories/ElevationSystem.stories.mdx → doc/src/stories/ElevationSystem.mdx} +1 -1
  46. package/{src/stories/HighlightRippleDot.stories.js → doc/src/stories/HighlightRippleDot.stories.ts} +3 -2
  47. package/{src/stories/Icon.stories.js → doc/src/stories/Icon.stories.ts} +3 -1
  48. package/{src/stories/InlineSelector.stories.js → doc/src/stories/InlineSelector.stories.ts} +2 -2
  49. package/{src/stories/Input.stories.js → doc/src/stories/Input.stories.ts} +7 -4
  50. package/{src/stories/InputSelect.stories.js → doc/src/stories/InputSelect.stories.ts} +3 -2
  51. package/{src/stories/InputTextArea.stories.js → doc/src/stories/InputTextArea.stories.ts} +2 -2
  52. package/{src/stories/Introduction.stories.mdx → doc/src/stories/Introduction.mdx} +101 -101
  53. package/{src/stories/MiniTag.stories.js → doc/src/stories/MiniTag.stories.ts} +9 -2
  54. package/{src/stories/ProgressBar.stories.js → doc/src/stories/ProgressBar.stories.ts} +3 -2
  55. package/{src/stories/RadioButton.stories.js → doc/src/stories/RadioButton.stories.ts} +2 -2
  56. package/{src/stories/RadioButtonSimple.stories.js → doc/src/stories/RadioButtonSimple.stories.ts} +2 -2
  57. package/{src/stories/SimpleAlert.stories.js → doc/src/stories/SimpleAlert.stories.ts} +3 -2
  58. package/{src/stories/Slider.stories.js → doc/src/stories/Slider.stories.ts} +6 -2
  59. package/{src/stories/Switch.stories.js → doc/src/stories/Switch.stories.ts} +2 -2
  60. package/{src/stories/TabHeader.stories.js → doc/src/stories/TabHeader.stories.ts} +6 -1
  61. package/{src/stories/TableResults.stories.js → doc/src/stories/TableResults.stories.ts} +11 -7
  62. package/{src/stories/TagScope.stories.js → doc/src/stories/TagScope.stories.ts} +3 -2
  63. package/{src/stories/TestimonialCard.stories.js → doc/src/stories/TestimonialCard.stories.ts} +3 -3
  64. package/{src/stories/Toast.stories.js → doc/src/stories/Toast.stories.ts} +2 -2
  65. package/{src/stories/Toggle.stories.js → doc/src/stories/Toggle.stories.ts} +7 -4
  66. package/{src/stories/Tooltip.stories.js → doc/src/stories/Tooltip.stories.ts} +6 -6
  67. package/{src/stories/Typography.stories.mdx → doc/src/stories/Typography.mdx} +107 -105
  68. package/doc/tsconfig.json +17 -0
  69. package/package.json +43 -39
  70. package/scripts/gulp.js +11 -0
  71. package/scripts/kill-port.sh +12 -0
  72. package/src/App.vue +30 -0
  73. package/src/assets/scss/base.scss +3 -30
  74. package/src/assets/scss/components/PsAccordion.scss +2 -2
  75. package/src/assets/scss/components/PsButton.scss +7 -1
  76. package/src/assets/scss/components/PsChips.scss +12 -7
  77. package/src/assets/scss/components/PsCollapse.scss +71 -0
  78. package/src/assets/scss/components/PsCostEffectBar.scss +4 -4
  79. package/src/assets/scss/components/PsDataTable.scss +1 -1
  80. package/src/assets/scss/components/PsDateCardInfo.scss +4 -5
  81. package/src/assets/scss/components/PsDialog.scss +7 -0
  82. package/src/assets/scss/components/PsDropdownList.scss +1 -1
  83. package/src/assets/scss/components/PsInput.scss +9 -0
  84. package/src/assets/scss/components/PsProgressBar.scss +4 -4
  85. package/src/assets/scss/components/PsTabHeader.scss +57 -2
  86. package/src/assets/scss/components/PsTableResults.scss +53 -22
  87. package/src/assets/scss/components/PsTestimonialCard.scss +1 -1
  88. package/src/assets/scss/components/PsTooltip.scss +149 -145
  89. package/src/components/accordion/PsAccordion.vue +20 -21
  90. package/src/components/accordion/PsAccordionItem.vue +121 -81
  91. package/src/components/badges-and-tags/PsBadgeWithIcon.vue +37 -36
  92. package/src/components/badges-and-tags/PsCardInfos.vue +40 -40
  93. package/src/components/badges-and-tags/PsChartLegend.vue +50 -41
  94. package/src/components/badges-and-tags/PsClimateZoneBadge.vue +13 -19
  95. package/src/components/badges-and-tags/PsCostEffectBar.vue +28 -61
  96. package/src/components/badges-and-tags/PsDateCardInfo.vue +17 -18
  97. package/src/components/badges-and-tags/PsHighlightRippleDot.vue +4 -3
  98. package/src/components/badges-and-tags/PsMiniTag.vue +39 -41
  99. package/src/components/badges-and-tags/PsProgressBar.vue +72 -68
  100. package/src/components/badges-and-tags/PsTagScope.vue +17 -22
  101. package/src/components/badges-and-tags/PsTestimonialCard.vue +25 -30
  102. package/src/components/buttons/PsButton.vue +90 -98
  103. package/src/components/chips/PsChips.vue +118 -103
  104. package/src/components/collapse/PsCollapse.vue +124 -0
  105. package/src/components/controls/PsCheckbox.vue +86 -83
  106. package/src/components/controls/PsCheckboxSimple.vue +97 -97
  107. package/src/components/controls/PsDraggable.vue +100 -99
  108. package/src/components/controls/PsInlineSelector.vue +111 -113
  109. package/src/components/controls/PsRadioButton.vue +72 -60
  110. package/src/components/controls/PsRadioButtonSimple.vue +81 -77
  111. package/src/components/controls/PsSlider.vue +190 -181
  112. package/src/components/controls/PsSwitch.vue +63 -54
  113. package/src/components/controls/PsToggle.vue +62 -57
  114. package/src/components/data-graphics/PsBarChart.vue +22 -23
  115. package/src/components/datatable/PsDataTable.vue +70 -65
  116. package/src/components/datatable/PsDataTableItem.vue +30 -32
  117. package/src/components/forms/PsDropdown.vue +173 -166
  118. package/src/components/forms/PsDropdownList.vue +133 -130
  119. package/src/components/forms/PsInput.vue +163 -146
  120. package/src/components/forms/PsInputSelect.vue +121 -100
  121. package/src/components/forms/PsInputTextArea.vue +84 -74
  122. package/src/components/navigations/PsBreadcrumb.vue +25 -34
  123. package/src/components/notifications/PsDialog.vue +67 -60
  124. package/src/components/notifications/PsSimpleAlert.vue +47 -37
  125. package/src/components/notifications/PsToast.vue +48 -42
  126. package/src/components/table-results/PsTableResults.vue +534 -506
  127. package/src/components/table-results/PsTableResultsBody.vue +69 -68
  128. package/src/components/table-results/PsTableResultsHead.vue +108 -69
  129. package/src/components/table-results/PsTableResultsHeadComparison.vue +88 -69
  130. package/src/components/table-results/PsTableResultsHeadFlexible.vue +112 -72
  131. package/src/components/table-results/PsTableResultsRow.vue +61 -58
  132. package/src/components/tabs/PsTabHeader.vue +138 -116
  133. package/src/components/tooltip/PsDialogTooltip.vue +112 -107
  134. package/src/components/tooltip/PsRichTooltip.vue +46 -43
  135. package/src/components/tooltip/PsTooltip.vue +126 -122
  136. package/src/components/ui/PsDotLoader.vue +6 -10
  137. package/src/components/ui/PsIcon.vue +149 -134
  138. package/src/index.ts +159 -0
  139. package/src/tsconfig.json +12 -0
  140. package/src/types/index.d.ts +6 -0
  141. package/src/util/GeneralFunctions.js +16 -7
  142. package/src/util/directives.ts +24 -0
  143. package/src/util/imageLoader.js +14 -7
  144. package/tailwind.config.js +12 -3
  145. package/tsconfig.json +47 -0
  146. package/.storybook/PolicyStudio.js +0 -10
  147. package/.storybook/eventBus.js +0 -3
  148. package/.storybook/main.js +0 -25
  149. package/.storybook/manager.js +0 -6
  150. package/babel.config.js +0 -3
  151. package/backup-package-lock.json +0 -37194
  152. package/dist/css/psui_styles.css +0 -110890
  153. package/postcss.config.js +0 -8
  154. package/src/components/playground/PsScrollBar.vue +0 -248
  155. package/src/index.js +0 -167
  156. package/src/stories/Playground.stories.js +0 -16
  157. /package/{src → doc/src}/assets/images/multifamily-units.svg +0 -0
  158. /package/{src → doc/src}/assets/images/policy-studio.svg +0 -0
  159. /package/{src/contents/ComparisonData.js → doc/src/contents/ComparisonData.ts} +0 -0
  160. /package/{src/contents/FlexibleData.js → doc/src/contents/FlexibleData.ts} +0 -0
  161. /package/{src/contents/ResultsData.js → doc/src/contents/ResultsData.ts} +0 -0
  162. /package/{src/stories/Colors.stories.mdx → doc/src/stories/Colors.mdx} +0 -0
  163. /package/{src → doc/src}/stories/assets/code-brackets.svg +0 -0
  164. /package/{src → doc/src}/stories/assets/colors.svg +0 -0
  165. /package/{src → doc/src}/stories/assets/comments.svg +0 -0
  166. /package/{src → doc/src}/stories/assets/direction.svg +0 -0
  167. /package/{src → doc/src}/stories/assets/flow.svg +0 -0
  168. /package/{src → doc/src}/stories/assets/plugin.svg +0 -0
  169. /package/{src → doc/src}/stories/assets/repo.svg +0 -0
  170. /package/{src → doc/src}/stories/assets/stackalt.svg +0 -0
@@ -5,12 +5,12 @@
5
5
  :key="index"
6
6
  >
7
7
  <td>
8
- <p class="title">{{ row.title }}</p>
8
+ <p class="title">
9
+ {{ row.title }}
10
+ </p>
9
11
  </td>
10
12
 
11
- <template
12
- v-for="(columnGroup, indexColumn) of columnGroups"
13
- >
13
+ <template v-for="(columnGroup, indexColumn) of columnGroups">
14
14
  <td
15
15
  v-for="column of columnGroup.columns"
16
16
  :key="indexColumn + '-' + columnGroup.key + '-' + column.key"
@@ -22,76 +22,77 @@
22
22
  </tbody>
23
23
  </template>
24
24
 
25
- <script>
26
- export default {
27
- name: 'PsTableResultsBody',
28
- props: {
29
- /**
30
- * It sets the values which will be use to render the body.
31
- */
32
- summaryData: {
33
- type: Array,
34
- default() {
35
- return []
36
- }
37
- },
38
- /**
39
- * It sets the values which will be use to render the body.
40
- */
41
- columnGroups: {
42
- type: Array,
43
- default() {
44
- return []
45
- }
25
+ <script setup>
26
+ import { 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 []
46
36
  },
47
- /**
48
- * It sets the values which will be use to render the body.
49
- */
50
- rows: {
51
- type: Array,
52
- default() {
53
- return []
54
- }
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 []
55
45
  },
56
- /**
57
- * It sets additional styling if needed.
58
- */
59
- cssStyle: {
60
- type: String,
61
- default: 'psui-text-gray-60'
62
- }
63
46
  },
64
- computed: {
65
- cssAlign() {
66
- if (this.align === 'right') return `psui-text-right ${this.cssStyle}`
67
- if (this.align === 'center') return `psui-text-center ${this.cssStyle}`
68
- 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 []
69
54
  },
70
- getRows() {
71
- const rows = []
72
- for (let index = 0; index < this.summaryData.length; index++) {
73
- const item = this.summaryData[index]
74
- this.addRow(item, 0, `${index}`, rows)
75
- }
76
- return rows
77
- }
78
55
  },
79
- methods: {
80
- addRow(item, deep = 0, index, rows) {
81
- item.deep = deep
82
- item.index = index
83
- rows.push(item)
84
- item.last_deep = item.items ? false : true
85
- if (item.items) {
86
- const items_child = [...item.items]
87
- for (let indexChild = 0; indexChild < items_child.length; indexChild++) {
88
- const item_child = items_child[indexChild]
89
- item_child.is_last = indexChild + 1 === items_child.length ? true : false
90
- this.addRow(item_child, deep + 1, `${index}-${indexChild}`, rows)
91
- }
92
- }
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)
93
82
  }
94
83
  }
95
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
+ })
96
94
  </script>
97
- <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>
@@ -3,24 +3,27 @@
3
3
  <tr>
4
4
  <th>
5
5
  <div v-if="firstColumnTitle">
6
- <p class="title">{{ firstColumnTitle }}</p>
6
+ <p class="title">
7
+ {{ firstColumnTitle }}
8
+ </p>
7
9
  </div>
8
10
  </th>
9
-
11
+
10
12
  <th
11
13
  v-for="columnGroup of header"
12
14
  :key="columnGroup.key"
13
- :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)"
14
16
  >
15
17
  <div class="psui-space-x-1 psui-items-center psui-show-childrens-on-hover">
16
- <p class="title">{{ columnGroup.title }}</p>
18
+ <p class="title">
19
+ {{ columnGroup.title }}
20
+ </p>
17
21
  <PsIcon
18
- icon="info"
19
- size="18"
20
- class="psui-cursor-pointer"
21
- icon-classes="psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
22
+ icon="info_outline"
23
+ size="16"
24
+ class="psui-cursor-pointer psui-text-gray-40 hover:psui-text-blue-60 psui-opacity-0 psui-leading-none psui-transition"
22
25
  :style="{ display: 'flex' }"
23
- @click.native="$emit('click-column-group-helper', columnGroup, $event)"
26
+ @click="emit('click-column-group-helper', columnGroup, $event)"
24
27
  />
25
28
  </div>
26
29
  </th>
@@ -29,14 +32,19 @@
29
32
  <tr>
30
33
  <th>
31
34
  <div>
32
- <p v-if="firstColumnDescription" class="description">{{ firstColumnDescription }}</p>
35
+ <p
36
+ v-if="firstColumnDescription"
37
+ class="description"
38
+ >
39
+ {{ firstColumnDescription }}
40
+ </p>
33
41
  </div>
34
42
  </th>
35
43
 
36
44
  <template v-for="columnGroup of header">
37
- <th
38
- v-for="column of columnGroup.columns"
39
- :key="`${columnGroup.key}-${column.key}`"
45
+ <th
46
+ v-for="column of columnGroup.columns"
47
+ :key="`${columnGroup.key}-${column.key}`"
40
48
  >
41
49
  <div class="psui-flex psui-flex-col">
42
50
  <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">
@@ -45,23 +53,32 @@
45
53
  :icon="orderDirection == 'asc' ? 'arrow_downward' : 'arrow_upward'"
46
54
  :type="orderDirection == 'asc' ? 'arrow_upward' : 'arrow_upward'"
47
55
  size="16"
48
- class="psui-cursor-pointer helper"
49
- icon-classes="psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
50
- :style="{ display: 'flex' }"
51
- @click.native="$emit('click-order-column', column)"
56
+ class="helper psui-cursor-pointer psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
57
+ :style="{ display: 'flex', marginTop: '1px' }"
58
+ @click="emit('click-order-column', column)"
52
59
  />
53
60
 
54
61
  <PsIcon
55
- icon="info"
62
+ icon="info_outline"
56
63
  size="16"
57
- class="psui-cursor-pointer helper"
58
- icon-classes="psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
59
- :style="{ display: 'flex' }"
60
- @click.native="$emit('click-column-helper', column, $event)"
64
+ class="helper psui-cursor-pointer psui-text-gray-40 hover:psui-text-blue-60 psui-opacity-0 psui-leading-none psui-transition"
65
+ :style="{ display: 'flex', marginTop: '1px' }"
66
+ @click="emit('click-column-helper', column, $event)"
61
67
  />
62
- <p class="title" v-if="column.title">{{ column.title }}</p>
68
+ <p
69
+ v-tooltip="getTooltip(column)"
70
+ class="title"
71
+ v-if="column.title"
72
+ >
73
+ {{ column.title }}
74
+ </p>
63
75
  </div>
64
- <p class="description" v-if="column.description">{{ column.description }}</p>
76
+ <p
77
+ class="description"
78
+ v-if="column.description && layout != 'flexible'"
79
+ >
80
+ {{ column.description }}
81
+ </p>
65
82
  </div>
66
83
  </th>
67
84
  </template>
@@ -69,55 +86,77 @@
69
86
  </thead>
70
87
  </template>
71
88
 
72
- <script>
89
+ <script setup>
73
90
  import PsIcon from '../ui/PsIcon.vue'
74
- export default {
75
- name: 'PsTableResultsHead',
76
- components: { PsIcon },
77
- props: {
78
- /**
79
- * It sets the title for the first column.
80
- */
81
- firstColumnTitle: {
82
- type: String,
83
- default: ''
84
- },
85
- /**
86
- * It sets the description for the first column.
87
- */
88
- firstColumnDescription: {
89
- type: String,
90
- default: ''
91
- },
92
- /**
93
- * It sets the values which will be use to render the header.
94
- */
95
- header: {
96
- type: Array,
97
- required: true,
98
- default: () => {
99
- return []
100
- },
101
- },
102
- /**
103
- * this sets whether sorting will be displayed.
104
- */
105
- showOrder: {
106
- type: Boolean,
107
- default: false
108
- }
91
+ import { computed, getCurrentInstance } from 'vue'
92
+
93
+ const props = defineProps({
94
+ /**
95
+ * It sets the title for the first column.
96
+ */
97
+ firstColumnTitle: {
98
+ type: String,
99
+ default: '',
109
100
  },
110
- computed: {
111
- columnsSelectedForStudy() {
112
- return this.$parent.columnsSelectedForStudy
101
+ layout: {
102
+ type: String,
103
+ default: 'results',
104
+ validator: (value) => {
105
+ return ['results', 'comparison', 'flexible'].indexOf(value) !== -1
113
106
  },
114
- orderColumn() {
115
- return this.$parent.orderColumn
116
- },
117
- orderDirection() {
118
- return this.$parent.orderDirection
107
+ },
108
+ /**
109
+ * It sets the description for the first column.
110
+ */
111
+ firstColumnDescription: {
112
+ type: String,
113
+ default: '',
114
+ },
115
+ /**
116
+ * It sets the values which will be use to render the header.
117
+ */
118
+ header: {
119
+ type: Array,
120
+ required: true,
121
+ default: () => {
122
+ return []
119
123
  },
124
+ },
125
+ /**
126
+ * this sets whether sorting will be displayed.
127
+ */
128
+ showOrder: {
129
+ type: Boolean,
130
+ default: false,
131
+ },
132
+ })
133
+
134
+ const emit = defineEmits(['click-column-group-helper', 'click-order-column', 'click-column-helper'])
135
+
136
+ const parent = getCurrentInstance().proxy.$parent
137
+
138
+ const columnsSelectedForStudy = computed(() => {
139
+ return parent.columnsSelectedForStudy
140
+ })
141
+
142
+ const orderColumn = computed(() => {
143
+ return parent.orderColumn
144
+ })
145
+
146
+ const getTooltip = (column) => {
147
+ if(props.layout == 'flexible' && column) {
148
+ return {
149
+ content: column.description,
150
+ classes: 'custom-tooltip'
120
151
  }
152
+ }
153
+ return null
121
154
  }
155
+ const orderDirection = computed(() => {
156
+ return parent.orderDirection
157
+ })
122
158
  </script>
123
- <style> /* Please, use the file src/assets/scss/components/PsTableResults.scss */ </style>
159
+
160
+ <style>
161
+ /* Please, use the file src/assets/scss/components/PsTableResults.scss */
162
+ </style>
@@ -3,27 +3,32 @@
3
3
  <tr>
4
4
  <th rowspan="2">
5
5
  <div v-if="firstColumnTitle">
6
- <p class="title">{{ firstColumnTitle }}</p>
6
+ <p class="title">
7
+ {{ firstColumnTitle }}
8
+ </p>
7
9
  </div>
8
10
  <div v-if="firstColumnDescription">
9
- <p class="description">{{ firstColumnDescription }}</p>
11
+ <p class="description">
12
+ {{ firstColumnDescription }}
13
+ </p>
10
14
  </div>
11
15
  </th>
12
-
16
+
13
17
  <th
14
18
  v-for="columnGroup of header"
15
19
  :key="columnGroup.key"
16
- :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)"
17
21
  >
18
22
  <div class="psui-flex psui-space-x-1 psui-items-center psui-show-childrens-on-hover">
19
- <p class="title">{{ columnGroup.title }}</p>
23
+ <p class="title">
24
+ {{ columnGroup.title }}
25
+ </p>
20
26
  <PsIcon
21
27
  icon="info"
22
28
  size="18"
23
- class="psui-cursor-pointer"
24
- icon-classes="psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
29
+ class="psui-cursor-pointer psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
25
30
  :style="{ display: 'flex' }"
26
- @click.native="$emit('click-column-group-helper', columnGroup, $event)"
31
+ @click="emit('click-column-group-helper', columnGroup, $event)"
27
32
  />
28
33
  </div>
29
34
  </th>
@@ -31,35 +36,43 @@
31
36
 
32
37
  <tr>
33
38
  <template v-for="columnGroup of header">
34
- <th
35
- v-for="column of columnGroup.columns"
39
+ <th
40
+ v-for="column of columnGroup.columns"
36
41
  :key="`${columnGroup.key}-${column.key}`"
37
42
  >
38
43
  <div class="psui-flex psui-flex-col psui-justify-center psui-items-center psui-text-center">
39
44
  <div class="psui-show-childrens-on-hover absolute-childrens psui-mb-px">
40
- <p class="title" v-if="column.title">{{ column.title }}</p>
45
+ <p
46
+ class="title"
47
+ v-if="column.title"
48
+ >
49
+ {{ column.title }}
50
+ </p>
41
51
 
42
52
  <PsIcon
43
53
  icon="info"
44
54
  size="16"
45
- class="psui-cursor-pointer helper"
46
- icon-classes="psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
47
- :style="{ display: 'flex' }"
48
- @click.native="$emit('click-column-helper', column, $event)"
55
+ class="helper psui-cursor-pointer psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
56
+ :style="{ display: 'flex', marginTop: '1px' }"
57
+ @click="emit('click-column-helper', column, $event)"
49
58
  />
50
-
59
+
51
60
  <PsIcon
52
61
  v-if="showOrder"
53
62
  :icon="orderDirection == 'asc' ? 'arrow_downward' : 'arrow_upward'"
54
63
  :type="orderDirection == 'asc' ? 'arrow_upward' : 'arrow_upward'"
55
64
  size="16"
56
- class="psui-cursor-pointer helper"
57
- icon-classes="psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
58
- :style="{ display: 'flex' }"
59
- @click.native="$emit('click-order-column', column)"
65
+ class="helper psui-cursor-pointer psui-text-blue-50 psui-opacity-0 psui-leading-none psui-transition"
66
+ :style="{ display: 'flex', marginTop: '1px' }"
67
+ @click="emit('click-order-column', column)"
60
68
  />
61
69
  </div>
62
- <p class="description" v-if="column.description">{{ column.description }}</p>
70
+ <p
71
+ class="description"
72
+ v-if="column.description"
73
+ >
74
+ {{ column.description }}
75
+ </p>
63
76
  </div>
64
77
  </th>
65
78
  </template>
@@ -67,55 +80,61 @@
67
80
  </thead>
68
81
  </template>
69
82
 
70
- <script>
83
+ <script setup>
71
84
  import PsIcon from '../ui/PsIcon.vue'
72
- export default {
73
- name: 'PsTableResultsHead',
74
- components: { PsIcon },
75
- props: {
76
- /**
77
- * It sets the title for the first column.
78
- */
79
- firstColumnTitle: {
80
- type: String,
81
- default: ''
82
- },
83
- /**
84
- * It sets the description for the first column.
85
- */
86
- firstColumnDescription: {
87
- type: String,
88
- default: ''
89
- },
90
- /**
91
- * It sets the values which will be use to render the header.
92
- */
93
- header: {
94
- type: Array,
95
- required: true,
96
- default: () => {
97
- return []
98
- },
99
- },
100
- /**
101
- * this sets whether sorting will be displayed.
102
- */
103
- showOrder: {
104
- type: Boolean,
105
- default: false
106
- }
85
+ import { computed, getCurrentInstance } from 'vue'
86
+
87
+ defineProps({
88
+ /**
89
+ * It sets the title for the first column.
90
+ */
91
+ firstColumnTitle: {
92
+ type: String,
93
+ default: '',
107
94
  },
108
- computed: {
109
- columnsSelectedForStudy() {
110
- return this.$parent.columnsSelectedForStudy
111
- },
112
- orderColumn() {
113
- return this.$parent.orderColumn
114
- },
115
- orderDirection() {
116
- return this.$parent.orderDirection
95
+ /**
96
+ * It sets the description for the first column.
97
+ */
98
+ firstColumnDescription: {
99
+ type: String,
100
+ default: '',
101
+ },
102
+ /**
103
+ * It sets the values which will be use to render the header.
104
+ */
105
+ header: {
106
+ type: Array,
107
+ required: true,
108
+ default: () => {
109
+ return []
117
110
  },
118
- }
119
- }
111
+ },
112
+ /**
113
+ * this sets whether sorting will be displayed.
114
+ */
115
+ showOrder: {
116
+ type: Boolean,
117
+ default: false,
118
+ },
119
+ })
120
+
121
+ const emit = defineEmits(['click-column-group-helper', 'click-column-helper', 'click-order-column'])
122
+
123
+ const parent = getCurrentInstance().proxy.$parent
124
+
125
+ const columnsSelectedForStudy = computed(() => {
126
+ return parent.columnsSelectedForStudy
127
+ })
128
+
129
+ const orderColumn = computed(() => {
130
+ return parent.orderColumn
131
+ })
132
+
133
+ const orderDirection = computed(() => {
134
+ return parent.orderDirection
135
+ })
120
136
  </script>
121
- <style> /* Please, use the file src/assets/scss/components/PsTableResults.scss */ </style>
137
+
138
+ <style>
139
+ /* Please, use the file src/assets/scss/components/PsTableResults.scss */
140
+ </style>