@policystudio/policy-studio-ui-vue 1.1.89 → 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 +51 -82
  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 +527 -504
  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 -110965
  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
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div
2
+ <div
3
3
  class="psui-el-card-infos"
4
4
  @click="onClick()"
5
5
  >
@@ -8,50 +8,50 @@
8
8
  </h5>
9
9
  <div class="psui-el-card-infos-content">
10
10
  <span class="psui-el-card-infos-icon material-icons-round">{{ icon }}</span>
11
- <h5 class="psui-text-gray-80">{{ total }}</h5>
11
+ <h5 class="psui-text-gray-80">
12
+ {{ total }}
13
+ </h5>
12
14
  </div>
13
15
  </div>
14
16
  </template>
15
17
 
16
- <script>
17
- export default {
18
- name: 'PsCardInfos',
19
- props: {
20
- /**
21
- * It sets the title of your card.
22
- */
23
- title: {
24
- type: String,
25
- default: 'Total',
26
- },
27
- /**
28
- * It sets the subtitle of your card if needed.
29
- */
30
- subtitle: {
31
- type: String,
32
- default: '',
33
- },
34
- /**
35
- * It sets the text key to get the svg icon in Google Fonts. Make sure to get the right description of your icon on https://fonts.google.com/.
36
- */
37
- icon: {
38
- type: String,
39
- default: 'edit',
40
- },
41
- /**
42
- * It sets the data that will show up when component is mounted.
43
- */
44
- total: {
45
- type: String,
46
- default: '',
47
- },
18
+ <script setup>
19
+
20
+ const emit = defineEmits(['click'])
21
+
22
+ defineProps({
23
+ title: {
24
+ type: String,
25
+ default: 'Total',
26
+ },
27
+ /**
28
+ * It sets the subtitle of your card if needed.
29
+ */
30
+ subtitle: {
31
+ type: String,
32
+ default: '',
48
33
  },
49
- methods: {
50
- onClick() {
51
- this.$emit('click')
52
- }
53
- }
34
+ /**
35
+ * It sets the text key to get the svg icon in Google Fonts. Make sure to get the right description of your icon on https://fonts.google.com/.
36
+ */
37
+ icon: {
38
+ type: String,
39
+ default: 'edit',
40
+ },
41
+ /**
42
+ * It sets the data that will show up when component is mounted.
43
+ */
44
+ total: {
45
+ type: String,
46
+ default: '',
47
+ },
48
+ })
49
+
50
+ const onClick = () => {
51
+ emit('click')
54
52
  }
55
53
  </script>
56
54
 
57
- <style> /* Please, use the file src/assets/scss/components/PsCardInfos.scss */</style>
55
+ <style>
56
+ /* Please, use the file src/assets/scss/components/PsCardInfos.scss */
57
+ </style>
@@ -1,55 +1,64 @@
1
1
  <template>
2
2
  <div class="psui-el-chart-legend">
3
3
  <div class="psui-flex psui-flex-shrink-0">
4
- <div class="psui-el-chart-legend-dot" :style="dotColor"/>
4
+ <div
5
+ class="psui-el-chart-legend-dot"
6
+ :style="dotColor"
7
+ />
5
8
  </div>
6
9
  <div class="psui-flex-grow-1 flex psui-flex-col">
7
- <div class="psui-el-chart-legend-text">{{ text }}</div>
10
+ <div class="psui-el-chart-legend-text">
11
+ {{ text }}
12
+ </div>
8
13
  <div class="flex psui-items-center psui-flex-shrink-0 psui-gap-1">
9
- <span v-if="this.total" class="psui-el-chart-legend-total">{{ total }}</span>
10
- <span class="psui-text-gray-30" v-if="total && percentage"> | </span>
11
- <span class="psui-el-chart-legend-percentage" v-if="percentage">
12
- {{ percentage }}%
13
- </span>
14
+ <span
15
+ v-if="total"
16
+ class="psui-el-chart-legend-total"
17
+ >{{ total }}</span>
18
+ <span
19
+ class="psui-text-gray-30"
20
+ v-if="total && percentage"
21
+ > | </span>
22
+ <span
23
+ class="psui-el-chart-legend-percentage"
24
+ v-if="percentage"
25
+ > {{ percentage }}% </span>
14
26
  </div>
15
27
  </div>
16
28
  </div>
17
29
  </template>
18
30
 
19
- <script>
20
- export default {
21
- name: 'PsChartLegend',
22
- props: {
23
- /**
24
- * It sets the text of the chart legend.
25
- */
26
- text: {
27
- type: [String, Number],
28
- default: 'Climate Zone 10',
29
- },
30
- /**
31
- * It sets the data that will show up when component is mounted.
32
- */
33
- total: {
34
- type: String,
35
- default: null,
36
- },
37
- /**
38
- * It sets the data that wull show up when component is mounted.
39
- */
40
- percentage: {
41
- type: String,
42
- default: null,
43
- },
44
- /**
45
- * It sets the color of the dot component.
46
- */
47
- dotColor: {
48
- type: Object,
49
- default: null
50
- },
31
+ <script setup>
32
+
33
+ defineProps({
34
+ text: {
35
+ type: [String, Number],
36
+ default: 'Climate Zone 10',
37
+ },
38
+ /**
39
+ * It sets the data that will show up when component is mounted.
40
+ */
41
+ total: {
42
+ type: String,
43
+ default: null,
44
+ },
45
+ /**
46
+ * It sets the data that wull show up when component is mounted.
47
+ */
48
+ percentage: {
49
+ type: String,
50
+ default: null,
51
+ },
52
+ /**
53
+ * It sets the color of the dot component.
54
+ */
55
+ dotColor: {
56
+ type: Object,
57
+ default: null,
51
58
  },
52
- }
59
+ })
53
60
  </script>
54
61
 
55
- <style> /* Please, use the file src/assets/scss/components/PsChartLegend.scss */</style>
62
+ <style>
63
+ /* Please, use the file src/assets/scss/components/PsChartLegend.scss */
64
+ </style>
@@ -7,26 +7,20 @@
7
7
  </div>
8
8
  </template>
9
9
 
10
- <script>
11
- export default {
12
- name: 'PsClimateZoneBadge',
13
- props: {
14
- /**
15
- * It sets the text key to get the svg icon in Google Fonts. Make sure to get the right description of your icon on https://fonts.google.com/.
16
- */
17
- icon: {
18
- type: String,
19
- default: 'area_chart',
20
- },
21
- /**
22
- * It sets the content that will show up when the component is rendered.
23
- */
24
- content: {
25
- type: Number,
26
- default: 10,
27
- },
10
+ <script setup>
11
+ defineProps({
12
+ icon: {
13
+ type: String,
14
+ default: 'area_chart',
28
15
  },
29
- }
16
+ /**
17
+ * It sets the content that will show up when the component is rendered.
18
+ */
19
+ content: {
20
+ type: Number,
21
+ default: 10,
22
+ },
23
+ })
30
24
  </script>
31
25
 
32
26
  <style>
@@ -1,80 +1,47 @@
1
1
  <template>
2
2
  <div class="psui-el-cost-effect-bar">
3
3
  <div>
4
- <span :style="breakEvenPosition"> </span>
5
-
4
+ <span :style="breakEvenPosition" />
6
5
  <PsProgressBar
7
6
  :value="value"
8
- :percentageColor="percentageColor"
9
- :bgColor="bgColor"
10
- >
11
- </PsProgressBar>
7
+ :percentage-color="percentageColor"
8
+ :bg-color="bgColor"
9
+ />
12
10
  </div>
13
11
  </div>
14
12
  </template>
15
13
 
16
- <script>
14
+ <script setup>
17
15
  import PsProgressBar from './PsProgressBar.vue'
18
- export default {
19
- name: 'PsCostEffectBar',
20
- components: {
21
- PsProgressBar,
22
- },
16
+ import { computed } from 'vue'
23
17
 
24
- props: {
25
- /**
26
- * It sets the value of the progress bar within costeffectbar.
27
- */
28
- value: {
29
- type: Number,
30
- required: true,
31
- default: 0,
32
- },
33
- /**
34
- * It sets the threshold of being effective or not effective within costeffectbar.
35
- */
36
- breakEven: {
37
- type: Number,
38
- required: true,
39
- default: 0,
40
- },
18
+ const props = defineProps({
19
+ value: {
20
+ type: Number,
21
+ required: true,
22
+ default: 0,
41
23
  },
42
- data() {
43
- return {
44
- errors: [],
45
- }
24
+ /**
25
+ * It sets the threshold of being effective or not effective within costeffectbar.
26
+ */
27
+ breakEven: {
28
+ type: Number,
29
+ required: true,
30
+ default: 0,
46
31
  },
32
+ })
47
33
 
48
- computed: {
49
- valueBar() {
50
- if (this.value > 100) return 100
51
- else if (this.value < 0) return 0
52
- else return this.value
53
- },
54
-
55
- breakEvenPosition() {
56
- return `left: ${this.breakEven >= 98 ? 98 : this.breakEven}px`
57
- },
34
+ const breakEvenPosition = computed(() => {
35
+ return `left: ${props.breakEven >= 98 ? 98 : props.breakEven}px`
36
+ })
58
37
 
59
- getIsBreakEven() {
60
- if (this.breakEven < 0) return 0
61
- else if (this.breakEven > 100) return 100
62
- else return this.breakEven
63
- },
38
+ const percentageColor = computed(() => {
39
+ return props.value >= props.breakEven ? 'psui-bg-blue-60' : 'psui-bg-red-20'
40
+ })
64
41
 
65
- percentageColor() {
66
- return this.value >= this.breakEven
67
- ? 'psui-bg-blue-60'
68
- : 'psui-bg-red-20'
69
- },
70
-
71
- bgColor() {
72
- return this.value >= this.breakEven
73
- ? 'psui-bg-blue-20'
74
- : 'psui-bg-red-10'
75
- },
76
- },
77
- }
42
+ const bgColor = computed(() => {
43
+ return props.value >= props.breakEven ? 'psui-bg-blue-20' : 'psui-bg-red-10'
44
+ })
78
45
  </script>
79
46
 
80
47
  <style>
@@ -9,23 +9,22 @@
9
9
  </div>
10
10
  </template>
11
11
 
12
- <script>
13
- export default {
14
- name: 'PsDateCardInfo',
15
- props: {
16
- date: {
17
- type: [Date, String],
18
- default: new Date(),
19
- }
12
+ <script setup>
13
+ import { computed } from 'vue'
14
+
15
+ const props = defineProps({
16
+ date: {
17
+ type: [Date, String],
18
+ default: new Date(),
20
19
  },
21
- computed: {
22
- getMonthAndDayFromDate() {
23
- const options = { month: 'short', day: '2-digit' }
24
- return (new Date(this.date))?.toLocaleString('default', options).replace('.', '')
25
- },
26
- getYearFromDate() {
27
- return (new Date(this.date))?.toLocaleString('default', { year: 'numeric' })
28
- }
29
- }
30
- }
20
+ })
21
+
22
+ const getMonthAndDayFromDate = computed(() => {
23
+ const options = { month: 'short', day: '2-digit' }
24
+ return new Date(props.date)?.toLocaleString('default', options).replace('.', '')
25
+ })
26
+
27
+ const getYearFromDate = computed(() => {
28
+ return new Date(props.date)?.toLocaleString('default', { year: 'numeric' })
29
+ })
31
30
  </script>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="psui-el-highlight-ripple-icon">
3
- <div class="psui-el-icon"></div>
3
+ <div class="psui-el-icon" />
4
4
  </div>
5
5
  </template>
6
6
 
@@ -10,5 +10,6 @@ export default {
10
10
  }
11
11
  </script>
12
12
 
13
- <style> /* Please, use the file src/assets/scss/components/PsHighlightRippleDot.scss */</style>
14
-
13
+ <style>
14
+ /* Please, use the file src/assets/scss/components/PsHighlightRippleDot.scss */
15
+ </style>
@@ -1,51 +1,49 @@
1
1
  <template>
2
- <div
3
- class="psui-el-mini-tag"
4
- :class="getComponentClass"
5
- @click="$emit('click', $event.target)"
2
+ <div
3
+ class="psui-el-mini-tag"
4
+ :class="getComponentClass"
5
+ @click="emit('click', $event.target)"
6
6
  >
7
7
  <span>{{ message }}</span>
8
8
  </div>
9
9
  </template>
10
10
 
11
- <script>
12
- export const typeOptions = [
13
- 'info',
14
- 'success',
15
- 'warning',
16
- 'error',
17
- 'default',
18
- 'solid-info',
19
- 'solid-success',
20
- 'solid-warning',
21
- 'solid-error',
22
- 'solid-default'
23
- ]
24
- export default {
25
- name: 'PsMiniTag',
26
- props: {
27
- /**
28
- * It sets the layout of the the minitag. eg: info, success, warning, error and default.
29
- */
30
- layout: {
31
- type: String,
32
- default: 'info',
33
- validator: (value) => typeOptions.indexOf(value) !== -1,
34
- },
35
- /**
36
- * It sets the message that will show up within the minitag when component is rendered.
37
- */
38
- message: {
39
- type: String,
40
- },
11
+ <script setup>
12
+ import { computed } from 'vue'
13
+
14
+ const emit = defineEmits(['click'])
15
+
16
+ const props = defineProps({
17
+ layout: {
18
+ type: String,
19
+ default: 'info',
20
+ validator: (value) => [
21
+ 'info',
22
+ 'success',
23
+ 'warning',
24
+ 'error',
25
+ 'default',
26
+ 'solid-info',
27
+ 'solid-success',
28
+ 'solid-warning',
29
+ 'solid-error',
30
+ 'solid-default'
31
+ ].indexOf(value) !== -1,
41
32
  },
42
- computed: {
43
- getComponentClass() {
44
- return `psui-el-mini-tag-layout-${this.layout}`
45
- },
33
+ /**
34
+ * It sets the message that will show up within the minitag when component is rendered.
35
+ */
36
+ message: {
37
+ type: String,
38
+ default: '',
46
39
  },
47
- }
48
- </script>
40
+ })
49
41
 
50
- <style> /* Please, use the file src/assets/scss/components/PsMiniTag.scss */ </style>
42
+ const getComponentClass = computed(() => {
43
+ return `psui-el-mini-tag-layout-${props.layout}`
44
+ })
45
+ </script>
51
46
 
47
+ <style>
48
+ /* Please, use the file src/assets/scss/components/PsMiniTag.scss */
49
+ </style>
@@ -1,13 +1,13 @@
1
- <template>
1
+ <template>
2
2
  <div
3
3
  class="psui-el-progress-bar"
4
- :style="{width: `${width}px`}"
5
- :class="{ 'is-breakeven' : getIsBreakEven }"
4
+ :style="{ width: `${width}px` }"
5
+ :class="{ 'is-breakeven': getIsBreakEven }"
6
6
  >
7
7
  <div class="psui-el-progress-bar-bg" />
8
8
  <div
9
- class="psui-el-progress-bar-value"
10
- :class="[getBg, {'rounded-tr-full rounded-br-full': getProgressWidth === '100%'}]"
9
+ class="psui-el-progress-bar-value"
10
+ :class="[getBg, { 'rounded-tr-full rounded-br-full': getProgressWidth === '100%' }]"
11
11
  :style="{ width: getProgressWidth }"
12
12
  />
13
13
  <div
@@ -17,69 +17,73 @@
17
17
  </div>
18
18
  </template>
19
19
 
20
- <script>
21
- export default {
22
- name: 'PsProgressBar',
23
- props: {
24
- width: {
25
- type: [String, Number],
26
- default: 100
27
- },
28
- min: {
29
- type: Number,
30
- default: 0
31
- },
32
- max: {
33
- type: Number,
34
- default: 5
35
- },
36
- breakEven: {
37
- type: Number,
38
- default: 1
39
- },
40
- forceBreakEven: {
41
- Boolean,
42
- default: false
43
- },
44
- value: {
45
- type: [String, Number],
46
- default: null
47
- },
48
- positiveBg: {
49
- type: String,
50
- default: 'psui-bg-blue-60'
51
- },
52
- negativeBg: {
53
- type: String,
54
- default: 'psui-bg-red-20'
55
- }
20
+ <script setup>
21
+ import { computed } from 'vue'
22
+
23
+ const props = defineProps({
24
+ width: {
25
+ type: [String, Number],
26
+ default: 100,
56
27
  },
57
- computed: {
58
- getVolume(){
59
- return (this.max - this.min)
60
- },
61
- getProgress() {
62
- if(this.value == 9876543210) return 100
63
- const progress = (100 / this.getVolume) * this.value
64
- return progress > 100 ? 100 : progress
65
- },
66
- getProgressWidth() {
67
- return `${this.getProgress}%`
68
- },
69
- getIsBreakEven() {
70
- if ( this.forceBreakEven ) return true
71
- return this.value >= this.breakEven ? true : false
72
- },
73
- getBreakEvenLeft() {
74
- return `${(100 / this.getVolume) * this.breakEven}%`
75
- },
76
- getBg() {
77
- if ( this.forceBreakEven ) return this.positiveBg
78
- return this.getIsBreakEven ? this.positiveBg : this.negativeBg
79
- }
80
- }
81
- }
82
- </script>
28
+ min: {
29
+ type: Number,
30
+ default: 0,
31
+ },
32
+ max: {
33
+ type: Number,
34
+ default: 5,
35
+ },
36
+ breakEven: {
37
+ type: Number,
38
+ default: 1,
39
+ },
40
+ forceBreakEven: {
41
+ type: Boolean,
42
+ default: false,
43
+ },
44
+ value: {
45
+ type: [String, Number],
46
+ default: null,
47
+ },
48
+ positiveBg: {
49
+ type: String,
50
+ default: 'psui-bg-blue-60',
51
+ },
52
+ negativeBg: {
53
+ type: String,
54
+ default: 'psui-bg-red-20',
55
+ },
56
+ })
57
+
58
+ const getVolume = computed(() => {
59
+ return props.max - props.min
60
+ })
61
+
62
+ const getProgress = computed(() => {
63
+ if (props.value == 9876543210) return 100
64
+ const progress = (100 / getVolume.value) * props.value
65
+ return progress > 100 ? 100 : progress
66
+ })
67
+
68
+ const getProgressWidth = computed(() => {
69
+ return `${getProgress.value}%`
70
+ })
83
71
 
84
- <style> /* Please, use the file src/assets/scss/components/PsProgressBar.scss */ </style>
72
+ const getIsBreakEven = computed(() => {
73
+ if (props.forceBreakEven) return true
74
+ return props.value >= props.breakEven ? true : false
75
+ })
76
+
77
+ const getBreakEvenLeft = computed(() => {
78
+ return `${(100 / getVolume.value) * props.breakEven}%`
79
+ })
80
+
81
+ const getBg = computed(() => {
82
+ if (props.forceBreakEven) return props.positiveBg
83
+ return getIsBreakEven.value ? props.positiveBg : props.negativeBg
84
+ })
85
+ </script>
85
86
 
87
+ <style>
88
+ /* Please, use the file src/assets/scss/components/PsProgressBar.scss */
89
+ </style>