@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
@@ -13,13 +13,13 @@
13
13
  class="w-full"
14
14
  >
15
15
  <template #trigger>
16
- <div
16
+ <div
17
17
  class="psui-el-draggable-wrapper-title"
18
- :class="{'psui-opacity-50 psui-pointer-events-none':columnGroup.disabled}"
18
+ :class="{ 'psui-opacity-50 psui-pointer-events-none': columnGroup.disabled }"
19
19
  draggable="true"
20
- @dragstart="$emit('drag-start-group', indexColumnGroup)"
21
- @dragend="$emit('drag-end-group', indexColumnGroup)"
22
- @dragover="$emit('drag-over-group', indexColumnGroup)"
20
+ @dragstart="emit('drag-start-group', indexColumnGroup)"
21
+ @dragend="emit('drag-end-group', indexColumnGroup)"
22
+ @dragover="emit('drag-over-group', indexColumnGroup)"
23
23
  >
24
24
  <span class="flex psui-items-center">
25
25
  <p>{{ columnGroup.title }}</p>
@@ -28,16 +28,16 @@
28
28
  v-if="columnGroup.hasHelper && columnGroup.hasHelper.showOnEditHideColumns"
29
29
  icon="info"
30
30
  size="16"
31
- :icon-classes="columnGroup.disabled ? 'psui-ml-2 psui-text-gray-50':'psui-ml-2 psui-text-blue-50 psui-cursor-pointer'"
32
- @click="$emit('column-group-helper', columnGroup.hasHelper)"
31
+ :icon-classes="columnGroup.disabled ? 'psui-ml-2 psui-text-gray-50' : 'psui-ml-2 psui-text-blue-50 psui-cursor-pointer'"
32
+ @click="emit('column-group-helper', columnGroup.hasHelper)"
33
33
  />
34
34
  </span>
35
35
  <i class="material-icons-round">drag_indicator</i>
36
36
  </div>
37
37
 
38
- <div
39
- class="psui-el-draggable-wrapper-list"
40
- :class="{'psui-opacity-50 psui-pointer-events-none':columnGroup.disabled}"
38
+ <div
39
+ class="psui-el-draggable-wrapper-list"
40
+ :class="{ 'psui-opacity-50 psui-pointer-events-none': columnGroup.disabled }"
41
41
  >
42
42
  <div
43
43
  v-for="(column, indexColumn) in columnGroup.columns"
@@ -45,31 +45,29 @@
45
45
  :id="`edit-columns-column-${indexColumnGroup}-${indexColumn}`"
46
46
  class="psui-el-draggable-item"
47
47
  draggable="true"
48
- @dragstart="$emit('drag-start-item', { indexColumnGroup, indexColumn }, $event)"
49
- @dragover="$emit('drag-over-item', { indexColumnGroup, indexColumn }, $event)"
50
- @dragend="$emit('drag-end-item', $event)"
48
+ @dragstart="emit('drag-start-item', { indexColumnGroup, indexColumn }, $event)"
49
+ @dragover="emit('drag-over-item', { indexColumnGroup, indexColumn }, $event)"
50
+ @dragend="emit('drag-end-item', $event)"
51
51
  v-tooltip="column.tooltip || undefined"
52
52
  >
53
- <div
54
- class="psui-w-full psui-flex psui-items-center"
55
- >
53
+ <div class="psui-w-full psui-flex psui-items-center">
56
54
  <span class="psui-el-draggable-item-title psui-flex psui-flex-row psui-items-center">
57
55
  <PsCheckboxSimple
58
56
  size="small"
59
57
  :label="column.title"
60
- :class="{'active' : column.isActive}"
58
+ :class="{ active: column.isActive }"
61
59
  :checked="column.isActive"
62
60
  :disabled="column.isDisabled"
63
61
  class="psui-el-draggable-item-checkbox"
64
- @change="$emit('on-select-item', { studyKey: getColumns.key, indexColumnGroup, indexColumn, columnGroupKey: columnGroup.key })"
62
+ @change="emit('on-select-item', { studyKey: getColumns.key, indexColumnGroup, indexColumn, columnGroupKey: columnGroup.key })"
65
63
  />
66
64
  <PsIcon
67
65
  class="psui-el-draggable-item-title-icon"
68
66
  v-if="column.hasHelper && column.hasHelper.showOnEditHideColumns"
69
67
  icon="info"
70
68
  size="16"
71
- :icon-classes="columnGroup.disabled ? 'psui-ml-2 psui-text-gray-50':'psui-ml-2 psui-text-blue-50 psui-cursor-pointer'"
72
- @click="$emit('column-helper', column.hasHelper)"
69
+ :icon-classes="columnGroup.disabled ? 'psui-ml-2 psui-text-gray-50' : 'psui-ml-2 psui-text-blue-50 psui-cursor-pointer'"
70
+ @click="emit('column-helper', column.hasHelper)"
73
71
  />
74
72
  </span>
75
73
  <span class="psui-el-draggable-item-append">
@@ -79,9 +77,7 @@
79
77
  </div>
80
78
  </div>
81
79
  </template>
82
- <template
83
- #content
84
- >
80
+ <template #content>
85
81
  {{ columnGroup.disabledTitle }}
86
82
  </template>
87
83
  </PsTooltip>
@@ -89,40 +85,42 @@
89
85
  </div>
90
86
  </template>
91
87
 
92
- <script>
88
+ <script setup>
89
+ import { defineProps, defineEmits } from 'vue'
93
90
 
94
- export default {
95
- name: 'PsDraggable',
96
- props: {
97
- /**
98
- * It sets the data that will be used.
99
- */
100
- getColumns: {
101
- type: Object,
102
- },
103
- /**
104
- * It sets the module which will be used to set getters and actions.
105
- */
106
- module:{
107
- type: String
108
- },
91
+ const emit = defineEmits([
92
+ 'drag-start-group',
93
+ 'drag-end-group',
94
+ 'drag-over-group',
95
+ 'drag-start-item',
96
+ 'drag-over-item',
97
+ 'drag-end-item',
98
+ 'column-helper',
99
+ 'on-select-item',
100
+ 'column-group-helper',
101
+ ])
109
102
 
110
- /**
111
- * It disables the input. All mouse events are disabled.
112
- */
113
- disabled: {
114
- type: Boolean,
115
- default: false
116
- },
103
+ defineProps({
104
+ /**
105
+ * It sets the data that will be used.
106
+ */
107
+ getColumns: {
108
+ type: Object,
117
109
  },
118
- computed: {
119
- getStatus() {
120
- if (this.column.key == 'compliance_margin') {
121
- return true
122
- } else {
123
- return false
124
- }
125
- },
110
+ /**
111
+ * It sets the module which will be used to set getters and actions.
112
+ */
113
+ module: {
114
+ type: String,
115
+ default: '',
126
116
  },
127
- }
117
+
118
+ /**
119
+ * It disables the input. All mouse events are disabled.
120
+ */
121
+ disabled: {
122
+ type: Boolean,
123
+ default: false,
124
+ },
125
+ })
128
126
  </script>
@@ -1,12 +1,12 @@
1
1
  <template>
2
- <div
2
+ <div
3
3
  class="psui-el-inline-selector"
4
- @keydown.up="$emit('keydown-up', $event)"
5
- @keydown.down="$emit('keydown-down', $event)"
6
- @keydown.enter="$emit('keydown-enter', $event)"
7
- @keydown.tab="$emit('keydown-tab',$event)"
8
- @keydown.esc="$emit('keydown-esc',$event)"
9
- @mouseleave="$emit('mouse-leave',$event)"
4
+ @keydown.up="emit('keydown-up', $event)"
5
+ @keydown.down="emit('keydown-down', $event)"
6
+ @keydown.enter="emit('keydown-enter', $event)"
7
+ @keydown.tab="emit('keydown-tab', $event)"
8
+ @keydown.esc="emit('keydown-esc', $event)"
9
+ @mouseleave="emit('mouse-leave', $event)"
10
10
  >
11
11
  <div class="psui-el-inline-selector-input-wrapper">
12
12
  <span> {{ search ? search : placeholder }} </span>
@@ -14,9 +14,9 @@
14
14
  ref="input"
15
15
  :label="label"
16
16
  :placeholder="placeholder"
17
- @input="$emit('input', $event)"
18
- @focus="$emit('focus', $event)"
19
- @blur="$emit('blur', $event)"
17
+ @input="emit('input', $event)"
18
+ @focus="emit('focus', $event)"
19
+ @blur="emit('blur', $event)"
20
20
  autocomplete="chrome-off"
21
21
  autocorrect="off"
22
22
  autocapitalize="off"
@@ -31,9 +31,9 @@
31
31
  leave-class="opacity-100 scale-100"
32
32
  leave-to-class="opacity-0 scale-95"
33
33
  >
34
- <div
34
+ <div
35
35
  v-if="search"
36
- role="menu"
36
+ role="menu"
37
37
  aria-orientation="vertical"
38
38
  class="psui-el-inline-selector-dropdown-wrapper"
39
39
  >
@@ -49,8 +49,8 @@
49
49
  v-for="(jurisdiction, index) in jurisdictions"
50
50
  :key="`dropdown-jurisdiction-${jurisdiction.id}`"
51
51
  :id="`jurisdiction-list-item-${index}`"
52
- @click="$emit('click', $event)"
53
- @mouseover="('mouse-over', $event)"
52
+ @click="emit('click', $event)"
53
+ @mouseover="'mouse-over', $event"
54
54
  >
55
55
  <span>
56
56
  <h3>{{ jurisdiction.title }}</h3>
@@ -64,89 +64,89 @@
64
64
  </div>
65
65
  </template>
66
66
 
67
- <script>
68
- export default {
69
- name: 'PsInlineSelector',
70
- props: {
71
- /**
72
- * It sets the default width of the inline selector.
73
- */
74
- width: {
75
- default: 244
76
- },
77
- /**
78
- * It sets if it should receive focus or not when componented is mounted.
79
- */
80
- focusOnMount: {
81
- default: false
82
- },
83
- /**
84
- * It sets if the component should be scrollable.
85
- */
86
- shouldScroll: {
87
- default: false
88
- },
89
- /**
90
- * It sets the label of the component.
91
- */
92
- label: {
93
- type: String,
94
- default: 'Type a City or County'
95
- },
96
- selectOnlyFirstClimateZone: {
97
- type: Boolean,
98
- default: false
99
- },
100
- /**
101
- * It sets the jurisdiction selected.
102
- */
103
- jurisdictionSelected: {
104
- type: [ Object, Boolean ]
105
- },
106
- /**
107
- * It gets and set the data that was written.
108
- */
109
- search: {
110
- type: String,
111
- default: '',
112
- required: true
113
- },
114
- /**
115
- * It provides all the jurisdictions.
116
- */
117
- jurisdictions: {
118
- type: Array,
119
- default: () => [],
120
- required: true
121
- },
122
- /**
123
- * It is a helper for checking if fetching data was successful.
124
- */
125
- requestFetched: {
126
- type: Boolean,
127
- },
128
- showDropDown:{
129
- type: Boolean,
130
- default: true,
131
- },
132
- currentSelected:{
133
- type: Number,
134
- default: 0,
135
- },
136
- /**
137
- * It sets if the component is focused or not.
138
- */
139
- isFocused:{
140
- type: Boolean,
141
- default: false,
142
- },
143
- /**
144
- * It sets the placeholder of the component.
145
- */
146
- placeholder:{
147
- type: String,
148
- }
149
- }
150
- }
151
- </script>
67
+ <script setup>
68
+ import { defineProps, defineEmits } from 'vue'
69
+
70
+ const emit = defineEmits(['keydown-up', 'keydown-down', 'keydown-enter', 'keydown-tab', 'keydown-esc', 'mouse-leave', 'input', 'focus', 'blur', 'click'])
152
71
 
72
+ defineProps({
73
+ /**
74
+ * It sets the default width of the inline selector.
75
+ */
76
+ width: {
77
+ default: 244,
78
+ },
79
+ /**
80
+ * It sets if it should receive focus or not when componented is mounted.
81
+ */
82
+ focusOnMount: {
83
+ default: false,
84
+ },
85
+ /**
86
+ * It sets if the component should be scrollable.
87
+ */
88
+ shouldScroll: {
89
+ default: false,
90
+ },
91
+ /**
92
+ * It sets the label of the component.
93
+ */
94
+ label: {
95
+ type: String,
96
+ default: 'Type a City or County',
97
+ },
98
+ selectOnlyFirstClimateZone: {
99
+ type: Boolean,
100
+ default: false,
101
+ },
102
+ /**
103
+ * It sets the jurisdiction selected.
104
+ */
105
+ jurisdictionSelected: {
106
+ type: [Object, Boolean],
107
+ },
108
+ /**
109
+ * It gets and set the data that was written.
110
+ */
111
+ search: {
112
+ type: String,
113
+ default: '',
114
+ required: true,
115
+ },
116
+ /**
117
+ * It provides all the jurisdictions.
118
+ */
119
+ jurisdictions: {
120
+ type: Array,
121
+ default: () => [],
122
+ required: true,
123
+ },
124
+ /**
125
+ * It is a helper for checking if fetching data was successful.
126
+ */
127
+ requestFetched: {
128
+ type: Boolean,
129
+ },
130
+ showDropDown: {
131
+ type: Boolean,
132
+ default: true,
133
+ },
134
+ currentSelected: {
135
+ type: Number,
136
+ default: 0,
137
+ },
138
+ /**
139
+ * It sets if the component is focused or not.
140
+ */
141
+ isFocused: {
142
+ type: Boolean,
143
+ default: false,
144
+ },
145
+ /**
146
+ * It sets the placeholder of the component.
147
+ */
148
+ placeholder: {
149
+ type: String,
150
+ },
151
+ })
152
+ </script>
@@ -1,76 +1,77 @@
1
1
  <template>
2
2
  <div
3
3
  class="psui-el-radio"
4
- :class="[getComponentClass, {'disabled':disabled}]"
4
+ :class="[getComponentClass, { disabled: disabled }]"
5
5
  >
6
6
  <input
7
7
  :id="inputId"
8
8
  type="radio"
9
9
  :value="inputValue"
10
10
  v-model="model"
11
- :disabled="disabled"
11
+ :disabled="disabled"
12
12
  >
13
13
  <label
14
14
  :for="inputId"
15
15
  class="psui-el-checkmark"
16
- ><span>{{ label }}</span></label>
16
+ ><span>{{ label }}</span></label>
17
17
  </div>
18
18
  </template>
19
-
20
- <script>
19
+
20
+ <script setup>
21
21
  //FIGMA CONTROLS & SELECTORS https://www.figma.com/file/Tto8hrNlSfuPcwd1pfqogF/%E2%9A%A1%EF%B8%8F-Design-System?node-id=1768%3A64852
22
-
23
- export default {
24
- name: 'PsRadioButton',
25
- props: {
26
- inputId: {
27
- type: String,
28
- default: ''
29
- },
30
- /**
31
- * It sets the label of the radio button.
32
- */
33
- label: {
34
- type: String,
35
- default: '',
36
- },
37
- /**
38
- * It's the value of the checkbox
39
- */
40
- inputValue:{
41
- type: [String, Object],
42
- },
43
- value:{
44
- type: [String, Object]
45
- },
46
- /**
47
- * It disables the radio button. All mouse events are disabled.
48
- */
49
- disabled: {
50
- type: Boolean,
51
- default: false
52
- },
53
- /**
54
- * It sets the size of the radio button. eg: big and small.
55
- */
56
- size: {
57
- type: String,
58
- default: 'big',
59
- validator: (value) => ['big', 'small'].includes(value)
60
- },
22
+ import { defineProps, computed, defineEmits } from 'vue'
23
+
24
+ const props = defineProps({
25
+ inputId: {
26
+ type: String,
27
+ default: '',
61
28
  },
62
- computed: {
63
- getComponentClass(){
64
- return `size-${this.size}`
65
- },
66
- model: {
67
- get(){
68
- return this.value
69
- },
70
- set(value){
71
- this.$emit('input', value)
72
- }
73
- }
29
+ /**
30
+ * It sets the label of the radio button.
31
+ */
32
+ label: {
33
+ type: String,
34
+ default: '',
74
35
  },
75
- }
76
- </script>
36
+ /**
37
+ * It's the value of the checkbox
38
+ */
39
+ inputValue: {
40
+ type: [String, Object],
41
+ default: '',
42
+ },
43
+ value: {
44
+ type: [String, Object],
45
+ default: '',
46
+ },
47
+ /**
48
+ * It disables the radio button. All mouse events are disabled.
49
+ */
50
+ disabled: {
51
+ type: Boolean,
52
+ default: false,
53
+ },
54
+ /**
55
+ * It sets the size of the radio button. eg: big and small.
56
+ */
57
+ size: {
58
+ type: String,
59
+ default: 'big',
60
+ validator: (value) => ['big', 'small'].includes(value),
61
+ },
62
+ })
63
+
64
+ const emit = defineEmits(['input'])
65
+ const getComponentClass = computed(() => {
66
+ return `size-${props.size}`
67
+ })
68
+
69
+ const model = computed({
70
+ get: () => {
71
+ return props.value
72
+ },
73
+ set: (value) => {
74
+ emit('input', value)
75
+ },
76
+ })
77
+ </script>