@policystudio/policy-studio-ui-vue 1.1.90-beta.12 → 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 (224) 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 +57 -71
  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} +0 -3
  58. package/src/util/directives.ts +24 -0
  59. package/src/util/eventBus.js +10 -0
  60. package/src/util/{imageLoader.ts → imageLoader.js} +7 -8
  61. package/tailwind.config.js +1 -1
  62. package/tsconfig.json +15 -17
  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/contents/ComparisonData.js +0 -376
  69. package/dist/contents/ComparisonData.js.map +0 -1
  70. package/dist/contents/FlexibleData.js +0 -501
  71. package/dist/contents/FlexibleData.js.map +0 -1
  72. package/dist/contents/ResultsData.js +0 -530
  73. package/dist/contents/ResultsData.js.map +0 -1
  74. package/dist/css/psui_styles.css +0 -4647
  75. package/dist/index.js +0 -114
  76. package/dist/index.js.map +0 -1
  77. package/dist/stories/Accordion.stories.js +0 -56
  78. package/dist/stories/Accordion.stories.js.map +0 -1
  79. package/dist/stories/BadgeWithIcon.stories.js +0 -28
  80. package/dist/stories/BadgeWithIcon.stories.js.map +0 -1
  81. package/dist/stories/BarChart.stories.js +0 -16
  82. package/dist/stories/BarChart.stories.js.map +0 -1
  83. package/dist/stories/Breadcrumb.stories.js +0 -21
  84. package/dist/stories/Breadcrumb.stories.js.map +0 -1
  85. package/dist/stories/Button.stories.js +0 -44
  86. package/dist/stories/Button.stories.js.map +0 -1
  87. package/dist/stories/CardInfos.stories.js +0 -13
  88. package/dist/stories/CardInfos.stories.js.map +0 -1
  89. package/dist/stories/ChartLegend.stories.js +0 -13
  90. package/dist/stories/ChartLegend.stories.js.map +0 -1
  91. package/dist/stories/Checkbox.stories.js +0 -44
  92. package/dist/stories/Checkbox.stories.js.map +0 -1
  93. package/dist/stories/CheckboxSimple.stories.js +0 -48
  94. package/dist/stories/CheckboxSimple.stories.js.map +0 -1
  95. package/dist/stories/Chips.stories.js +0 -27
  96. package/dist/stories/Chips.stories.js.map +0 -1
  97. package/dist/stories/ClimateZoneBadge.stories.js +0 -15
  98. package/dist/stories/ClimateZoneBadge.stories.js.map +0 -1
  99. package/dist/stories/CostEffectBar.stories.js +0 -21
  100. package/dist/stories/CostEffectBar.stories.js.map +0 -1
  101. package/dist/stories/Datatable.stories.js +0 -45
  102. package/dist/stories/Datatable.stories.js.map +0 -1
  103. package/dist/stories/DateCardInfo.stories.js +0 -18
  104. package/dist/stories/DateCardInfo.stories.js.map +0 -1
  105. package/dist/stories/Dialog.stories.js +0 -127
  106. package/dist/stories/Dialog.stories.js.map +0 -1
  107. package/dist/stories/Draggable.stories.js +0 -20
  108. package/dist/stories/Draggable.stories.js.map +0 -1
  109. package/dist/stories/Dropdown.stories.js +0 -98
  110. package/dist/stories/Dropdown.stories.js.map +0 -1
  111. package/dist/stories/DropdownList.stories.js +0 -208
  112. package/dist/stories/DropdownList.stories.js.map +0 -1
  113. package/dist/stories/Header.stories.js +0 -39
  114. package/dist/stories/Header.stories.js.map +0 -1
  115. package/dist/stories/HighlightRippleDot.stories.js +0 -13
  116. package/dist/stories/HighlightRippleDot.stories.js.map +0 -1
  117. package/dist/stories/Icon.stories.js +0 -19
  118. package/dist/stories/Icon.stories.js.map +0 -1
  119. package/dist/stories/InlineSelector.stories.js +0 -16
  120. package/dist/stories/InlineSelector.stories.js.map +0 -1
  121. package/dist/stories/Input.stories.js +0 -235
  122. package/dist/stories/Input.stories.js.map +0 -1
  123. package/dist/stories/InputSelect.stories.js +0 -28
  124. package/dist/stories/InputSelect.stories.js.map +0 -1
  125. package/dist/stories/InputTextArea.stories.js +0 -23
  126. package/dist/stories/InputTextArea.stories.js.map +0 -1
  127. package/dist/stories/MiniTag.stories.js +0 -44
  128. package/dist/stories/MiniTag.stories.js.map +0 -1
  129. package/dist/stories/Playground.stories.js +0 -14
  130. package/dist/stories/Playground.stories.js.map +0 -1
  131. package/dist/stories/ProgressBar.stories.js +0 -21
  132. package/dist/stories/ProgressBar.stories.js.map +0 -1
  133. package/dist/stories/RadioButton.stories.js +0 -36
  134. package/dist/stories/RadioButton.stories.js.map +0 -1
  135. package/dist/stories/RadioButtonSimple.stories.js +0 -40
  136. package/dist/stories/RadioButtonSimple.stories.js.map +0 -1
  137. package/dist/stories/SimpleAlert.stories.js +0 -19
  138. package/dist/stories/SimpleAlert.stories.js.map +0 -1
  139. package/dist/stories/Slider.stories.js +0 -70
  140. package/dist/stories/Slider.stories.js.map +0 -1
  141. package/dist/stories/Switch.stories.js +0 -35
  142. package/dist/stories/Switch.stories.js.map +0 -1
  143. package/dist/stories/TabHeader.stories.js +0 -48
  144. package/dist/stories/TabHeader.stories.js.map +0 -1
  145. package/dist/stories/TableResults.stories.js +0 -717
  146. package/dist/stories/TableResults.stories.js.map +0 -1
  147. package/dist/stories/TagScope.stories.js +0 -16
  148. package/dist/stories/TagScope.stories.js.map +0 -1
  149. package/dist/stories/TestimonialCard.stories.js +0 -24
  150. package/dist/stories/TestimonialCard.stories.js.map +0 -1
  151. package/dist/stories/Toast.stories.js +0 -51
  152. package/dist/stories/Toast.stories.js.map +0 -1
  153. package/dist/stories/Toggle.stories.js +0 -42
  154. package/dist/stories/Toggle.stories.js.map +0 -1
  155. package/dist/stories/Tooltip.stories.js +0 -108
  156. package/dist/stories/Tooltip.stories.js.map +0 -1
  157. package/dist/util/GeneralFunctions.js +0 -29
  158. package/dist/util/GeneralFunctions.js.map +0 -1
  159. package/dist/util/imageLoader.js +0 -52
  160. package/dist/util/imageLoader.js.map +0 -1
  161. package/postcss.config.js +0 -8
  162. package/src/assets/images/multifamily-units.svg +0 -10
  163. package/src/assets/images/policy-studio.svg +0 -15
  164. package/src/components/playground/PsScrollBar.vue +0 -320
  165. package/src/contents/ComparisonData.ts +0 -378
  166. package/src/contents/FlexibleData.ts +0 -502
  167. package/src/contents/ResultsData.ts +0 -531
  168. package/src/stories/Accordion.stories.ts +0 -59
  169. package/src/stories/BadgeWithIcon.stories.ts +0 -31
  170. package/src/stories/BarChart.stories.ts +0 -17
  171. package/src/stories/Breadcrumb.stories.ts +0 -22
  172. package/src/stories/Button.stories.ts +0 -48
  173. package/src/stories/Button.vue +0 -59
  174. package/src/stories/CardInfos.stories.ts +0 -15
  175. package/src/stories/ChartLegend.stories.ts +0 -15
  176. package/src/stories/Checkbox.stories.ts +0 -45
  177. package/src/stories/CheckboxSimple.stories.ts +0 -49
  178. package/src/stories/Chips.stories.ts +0 -33
  179. package/src/stories/ClimateZoneBadge.stories.ts +0 -18
  180. package/src/stories/Colors.mdx +0 -70
  181. package/src/stories/CostEffectBar.stories.ts +0 -24
  182. package/src/stories/Datatable.stories.ts +0 -53
  183. package/src/stories/DateCardInfo.stories.ts +0 -20
  184. package/src/stories/Dialog.stories.ts +0 -131
  185. package/src/stories/Draggable.stories.ts +0 -23
  186. package/src/stories/Dropdown.stories.ts +0 -100
  187. package/src/stories/DropdownList.stories.ts +0 -213
  188. package/src/stories/ElevationSystem.mdx +0 -41
  189. package/src/stories/Header.stories.ts +0 -42
  190. package/src/stories/Header.vue +0 -77
  191. package/src/stories/HighlightRippleDot.stories.ts +0 -16
  192. package/src/stories/Icon.stories.ts +0 -23
  193. package/src/stories/InlineSelector.stories.ts +0 -18
  194. package/src/stories/Input.stories.ts +0 -243
  195. package/src/stories/InputSelect.stories.ts +0 -31
  196. package/src/stories/InputTextArea.stories.ts +0 -25
  197. package/src/stories/Introduction.mdx +0 -211
  198. package/src/stories/MiniTag.stories.ts +0 -59
  199. package/src/stories/Playground.stories.ts +0 -16
  200. package/src/stories/ProgressBar.stories.ts +0 -24
  201. package/src/stories/RadioButton.stories.ts +0 -40
  202. package/src/stories/RadioButtonSimple.stories.ts +0 -43
  203. package/src/stories/SimpleAlert.stories.ts +0 -22
  204. package/src/stories/Slider.stories.ts +0 -79
  205. package/src/stories/Switch.stories.ts +0 -39
  206. package/src/stories/TabHeader.stories.ts +0 -57
  207. package/src/stories/TableResults.stories.ts +0 -728
  208. package/src/stories/TagScope.stories.ts +0 -17
  209. package/src/stories/TestimonialCard.stories.ts +0 -27
  210. package/src/stories/Toast.stories.ts +0 -52
  211. package/src/stories/Toggle.stories.ts +0 -48
  212. package/src/stories/Tooltip.stories.ts +0 -114
  213. package/src/stories/Typography.mdx +0 -212
  214. package/src/stories/assets/code-brackets.svg +0 -1
  215. package/src/stories/assets/colors.svg +0 -1
  216. package/src/stories/assets/comments.svg +0 -1
  217. package/src/stories/assets/direction.svg +0 -1
  218. package/src/stories/assets/flow.svg +0 -1
  219. package/src/stories/assets/plugin.svg +0 -1
  220. package/src/stories/assets/repo.svg +0 -1
  221. package/src/stories/assets/stackalt.svg +0 -1
  222. package/src/stories/button.css +0 -30
  223. package/src/stories/header.css +0 -32
  224. package/webpack.config.js +0 -36
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div
3
3
  class="psui-el-switch"
4
- :class="[getComponentClass, {'disabled':disabled}]"
4
+ :class="[getComponentClass, { disabled: disabled }]"
5
5
  @click="change()"
6
6
  >
7
7
  <input
@@ -15,59 +15,58 @@
15
15
  </div>
16
16
  </template>
17
17
 
18
- <script>
18
+ <script setup>
19
19
  //FIGMA CONTROLS & SELECTORS https://www.figma.com/file/Tto8hrNlSfuPcwd1pfqogF/%E2%9A%A1%EF%B8%8F-Design-System?node-id=1768%3A64852
20
+ import { defineProps, defineEmits } from 'vue'
20
21
 
21
- export default {
22
- name: 'PsSwitch',
23
- props: {
24
- /**
25
- * It sets the label of the switch button.
26
- */
27
- label:{
28
- type: String,
29
- },
30
- /**
31
- * It sets the value of the switch button.
32
- */
33
- value:{
34
- type: Boolean,
35
- },
36
- backgroundColor: {
37
- type: String,
38
- default:'psui-bg-green-20'
39
- },
40
- /**
41
- * It sets disabling mode.
42
- */
43
- disabled:{
44
- type: Boolean,
45
- default: false
46
- },
47
- /**
48
- * It sets the size of the switch button. eg: small and big.
49
- */
50
- size:{
51
- type: String,
52
- default: 'big',
53
- validator: (value)=> ['small', 'big'].includes(value)
54
- }
22
+ const emit = defineEmits('change', 'update:value')
23
+
24
+ const props = defineProps({
25
+ /**
26
+ * It sets the label of the switch button.
27
+ */
28
+ label: {
29
+ type: String,
30
+ default: '',
55
31
  },
56
- computed:{
57
- getToggleClass(){
58
- if(this.disabled) return 'toggle-false'
59
- return this.value ? `toggle-true ${this.backgroundColor}` : 'toggle-false psui-bg-gray-40'
60
- },
61
- getComponentClass(){
62
- return `size-${this.size}`
63
- }
32
+ /**
33
+ * It sets the value of the switch button.
34
+ */
35
+ value: {
36
+ type: Boolean,
64
37
  },
65
- methods: {
66
- change() {
67
- this.$emit('update:value', !this.value)
68
- this.$emit('change', !this.value)
69
- }
70
- }
71
- }
72
- </script>
38
+ backgroundColor: {
39
+ type: String,
40
+ default: 'psui-bg-green-20',
41
+ },
42
+ /**
43
+ * It sets disabling mode.
44
+ */
45
+ disabled: {
46
+ type: Boolean,
47
+ default: false,
48
+ },
49
+ /**
50
+ * It sets the size of the switch button. eg: small and big.
51
+ */
52
+ size: {
53
+ type: String,
54
+ default: 'big',
55
+ validator: (value) => ['small', 'big'].includes(value),
56
+ },
57
+ })
58
+
59
+ const getToggleClass = () => {
60
+ if (props.disabled) return 'toggle-false'
61
+ return props.value ? `toggle-true ${props.backgroundColor}` : 'toggle-false psui-bg-gray-40'
62
+ }
73
63
 
64
+ const getComponentClass = () => {
65
+ return `size-${props.size}`
66
+ }
67
+
68
+ const change = () => {
69
+ emit('update:value', !props.value)
70
+ emit('change', !props.value)
71
+ }
72
+ </script>
@@ -1,9 +1,9 @@
1
1
  <template>
2
- <div
3
- class="psui-el-toggle"
4
- role="group"
2
+ <div
3
+ class="psui-el-toggle"
4
+ role="group"
5
5
  >
6
- <button
6
+ <button
7
7
  type="button"
8
8
  v-for="(item, index) in items"
9
9
  :key="getKeyValue(item) + index"
@@ -15,55 +15,58 @@
15
15
  </div>
16
16
  </template>
17
17
 
18
- <script>
18
+ <script setup>
19
19
  //FIGMA CONTROLS & SELECTORS https://www.figma.com/file/Tto8hrNlSfuPcwd1pfqogF/%E2%9A%A1%EF%B8%8F-Design-System?node-id=1768%3A64852
20
+ import { defineProps, defineEmits } from 'vue'
20
21
 
21
- export default {
22
- name: 'PsToggle',
23
- props: {
24
- /**
25
- * It sets the items which will be used to create the toggle tab. See Figma - Controls & Selector for more information.
26
- */
27
- items: {
28
- type: Array,
29
- required: true
30
- },
31
- /**
32
- * It sets the value selected.
33
- */
34
- selected: {},
35
- /**
36
- * It sets the key label of your items if needed.
37
- */
38
- keyLabel: {
39
- type: [String, Function],
40
- default: 'label'
41
- },
42
- /**
43
- * It sets the key value of your items if needed.
44
- */
45
- keyValue: {
46
- type: [String, Function],
47
- default: 'value'
48
- }
22
+ const emit = defineEmits(['change', 'update:selected'])
23
+
24
+ const props = defineProps({
25
+ /**
26
+ * It sets the items which will be used to create the toggle tab. See Figma - Controls & Selector for more information.
27
+ */
28
+ items: {
29
+ type: Array,
30
+ required: true,
31
+ },
32
+ /**
33
+ * It sets the value selected.
34
+ */
35
+ selected: {},
36
+ /**
37
+ * It sets the key label of your items if needed.
38
+ */
39
+ keyLabel: {
40
+ type: [String, Function],
41
+ default: 'label',
49
42
  },
50
- methods: {
51
- selectOption(item) {
52
- this.$emit('update:selected', item)
53
- this.$emit('change', item)
54
- },
55
- getKeyLabel(item) {
56
- if(typeof this.keyLabel == 'function') return this.keyLabel(item)
57
- if(typeof item === 'object') return item[this.keyLabel]
58
- return item
59
- },
60
- getKeyValue(item) {
61
- if(typeof this.keyValue == 'function') return this.keyValue(item)
62
- if(typeof item === 'object') return item[this.keyLabel]
63
- return item
64
- },
65
- }
43
+ /**
44
+ * It sets the key value of your items if needed.
45
+ */
46
+ keyValue: {
47
+ type: [String, Function],
48
+ default: 'value',
49
+ },
50
+ })
51
+
52
+ const selectOption = (item) => {
53
+ emit('update:selected', item)
54
+ emit('change', item)
55
+ }
56
+
57
+ const getKeyLabel = (item) => {
58
+ if (typeof props.keyLabel == 'function') return props.keyLabel(item)
59
+ if (typeof item === 'object') return item[props.keyLabel]
60
+ return item
61
+ }
62
+
63
+ const getKeyValue = (item) => {
64
+ if (typeof props.keyValue == 'function') return props.keyValue(item)
65
+ if (typeof item === 'object') return item[props.keyLabel]
66
+ return item
66
67
  }
67
68
  </script>
68
69
 
69
- <style> /* Please, use the file src/assets/scss/components/PsToggle.scss */</style>
70
+ <style>
71
+ /* Please, use the file src/assets/scss/components/PsToggle.scss */
72
+ </style>
@@ -1,36 +1,34 @@
1
1
  <template>
2
2
  <div class="psui-el-bar-chart">
3
- <p
3
+ <p
4
4
  v-if="showNumber"
5
5
  class="psui-el-bar-chart-total"
6
6
  >
7
7
  {{ total }}
8
8
  </p>
9
9
 
10
- <div
10
+ <div
11
11
  class="psui-el-bar-chart-bar"
12
- :style="{width: `${fillWidth}%`}"
12
+ :style="{ width: `${fillWidth}%` }"
13
13
  />
14
14
  </div>
15
15
  </template>
16
16
 
17
- <script>
18
- export default {
19
- name: 'PsBarChart',
20
- props: {
21
- showNumber: {
22
- type: Boolean,
23
- default: true
24
- },
25
- total: {
26
- type: [String, Number],
27
- default: '5,0',
28
- },
29
- fillWidth: {
30
- type: Number,
31
- default: 50
32
- },
17
+ <script setup>
18
+ import { defineProps } from 'vue'
19
+
20
+ defineProps({
21
+ showNumber: {
22
+ type: Boolean,
23
+ default: true,
24
+ },
25
+ total: {
26
+ type: [String, Number],
27
+ default: '5,0',
28
+ },
29
+ fillWidth: {
30
+ type: Number,
31
+ default: 50,
33
32
  },
34
- computed: {}
35
- }
33
+ })
36
34
  </script>
@@ -37,70 +37,66 @@
37
37
  </table>
38
38
  </template>
39
39
 
40
- <script>
41
- export const type = ['simple', 'rich']
42
- export const alignment = ['center', 'right', 'left']
40
+ <script setup>
41
+ import { defineProps, computed } from 'vue'
43
42
 
44
- export default {
45
- name: 'PsDataTable',
46
- props: {
47
- /**
48
- * It sets the type of the data table. eg: simple or rich.
49
- */
50
- type: {
51
- type: String,
52
- required: true,
53
- validator: (value) => {
54
- return ['simple', 'rich'].indexOf(value) !== -1
55
- },
43
+ const props = defineProps({
44
+ type: {
45
+ type: String,
46
+ required: true,
47
+ validator: (value) => {
48
+ return ['simple', 'rich'].indexOf(value) !== -1
56
49
  },
57
- /**
58
- * It sets the values which will be use to render the header.
59
- */
60
- header: {
61
- type: Array,
62
- required: true,
63
- },
64
- /**
65
- * It sets the values which will be use to render the body.
66
- */
67
- data: {
68
- type: Array,
69
- default() {
70
- return []
71
- }
72
- },
73
- /**
74
- * It sets the values which will be use to render the footer.
75
- */
76
- footer: {
77
- type: Array,
78
- },
79
- /**
80
- * It sets the alignment of the whole context.
81
- */
82
- align: {
83
- type: String,
84
- default: 'left',
85
- validator: (value) => {
86
- return ['center', 'right', 'left'].indexOf(value) !== -1
87
- }
50
+ },
51
+ /**
52
+ * It sets the values which will be use to render the header.
53
+ */
54
+ header: {
55
+ type: Array,
56
+ required: true,
57
+ },
58
+ /**
59
+ * It sets the values which will be use to render the body.
60
+ */
61
+ data: {
62
+ type: Array,
63
+ default() {
64
+ return []
88
65
  },
89
- /**
90
- * It sets additional styling if needed.
91
- */
92
- cssStyle: {
93
- type: String,
94
- default: 'psui-text-gray-60'
95
- }
96
66
  },
97
- computed: {
98
- cssAlign() {
99
- if (this.align === 'right') return `psui-text-right ${this.cssStyle}`
100
- if (this.align === 'center') return `psui-text-center ${this.cssStyle}`
101
- return `psui-text-left ${this.cssStyle}`
67
+ /**
68
+ * It sets the values which will be use to render the footer.
69
+ */
70
+ footer: {
71
+ type: Array,
72
+ default: () => [],
73
+ },
74
+ /**
75
+ * It sets the alignment of the whole context.
76
+ */
77
+ align: {
78
+ type: String,
79
+ default: 'left',
80
+ validator: (value) => {
81
+ return ['center', 'right', 'left'].indexOf(value) !== -1
102
82
  },
103
83
  },
104
- }
84
+ /**
85
+ * It sets additional styling if needed.
86
+ */
87
+ cssStyle: {
88
+ type: String,
89
+ default: 'psui-text-gray-60',
90
+ },
91
+ })
92
+
93
+ const cssAlign = computed(() => {
94
+ if (props.align === 'right') return `psui-text-right ${props.cssStyle}`
95
+ if (props.align === 'center') return `psui-text-center ${props.cssStyle}`
96
+ return `psui-text-left ${props.cssStyle}`
97
+ })
105
98
  </script>
106
- <style> /* Please, use the file src/assets/scss/components/PsDataTable.scss */</style>
99
+
100
+ <style>
101
+ /* Please, use the file src/assets/scss/components/PsDataTable.scss */
102
+ </style>
@@ -15,11 +15,7 @@
15
15
  </span>
16
16
  <div
17
17
  class="psui-flex psui-items-center"
18
- :class="
19
- el[Object.keys(el)[1]] >= 0
20
- ? 'psui-text-green-70'
21
- : 'psui-text-red-70'
22
- "
18
+ :class="el[Object.keys(el)[1]] >= 0 ? 'psui-text-green-70' : 'psui-text-red-70'"
23
19
  >
24
20
  <i
25
21
  v-if="el[Object.keys(el)[1]] >= 0"
@@ -29,37 +25,27 @@
29
25
  v-else
30
26
  class="material-icons"
31
27
  >arrow_downward</i>
32
- <span>
33
- {{
34
- (
35
- (el[Object.keys(el)[1]] / el[Object.keys(el)[0]]) *
36
- 100
37
- ).toFixed(2)
38
- }}%
39
- </span>
28
+ <span> {{ ((el[Object.keys(el)[1]] / el[Object.keys(el)[0]]) * 100).toFixed(2) }}% </span>
40
29
  </div>
41
30
  </div>
42
- <span class="psui-text-gray-50">{{
43
- el[Object.keys(el)[0]].toFixed(6)
44
- }}</span>
31
+ <span class="psui-text-gray-50">{{ el[Object.keys(el)[0]].toFixed(6) }}</span>
45
32
  </td>
46
33
  </tr>
47
34
  </tbody>
48
35
  </template>
49
36
 
50
- <script>
51
- export default {
52
- name: 'PsDataTableItem',
53
- props: {
54
- data: {
55
- type: Array,
56
- required: true,
57
- default: () => {
58
- return []
59
- },
37
+ <script setup>
38
+ import { defineProps } from 'vue'
39
+
40
+ defineProps({
41
+ data: {
42
+ type: Array,
43
+ required: true,
44
+ default: () => {
45
+ return []
60
46
  },
61
47
  },
62
- }
48
+ })
63
49
  </script>
64
50
 
65
51
  <style scoped>
@@ -67,4 +53,4 @@ export default {
67
53
  font-size: 15px;
68
54
  margin-bottom: 2px;
69
55
  }
70
- </style>
56
+ </style>