@eturnity/eturnity_reusable_components 1.2.19-EPDM-3412.5 → 1.2.19-EPDM-5310.2

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 (217) hide show
  1. package/.prettierrc +6 -6
  2. package/.storybook/main.js +8 -8
  3. package/.storybook/preview.js +46 -46
  4. package/README.md +29 -29
  5. package/babel.config.js +5 -5
  6. package/package.json +62 -62
  7. package/public/index.html +17 -17
  8. package/src/App.vue +218 -214
  9. package/src/assets/icons/arrow_down.svg +3 -3
  10. package/src/assets/icons/arrow_up_red.svg +3 -3
  11. package/src/assets/icons/black_spinner.svg +35 -35
  12. package/src/assets/icons/delete_icon.svg +11 -11
  13. package/src/assets/icons/delete_icon_gray.svg +11 -11
  14. package/src/assets/icons/drag_icon.svg +8 -8
  15. package/src/assets/icons/external_icon.svg +6 -6
  16. package/src/assets/icons/language_icon.svg +6 -6
  17. package/src/assets/icons/pdf_icon.svg +6 -6
  18. package/src/assets/icons/plus_button.svg +4 -4
  19. package/src/assets/icons/search_icon_black.svg +3 -3
  20. package/src/assets/icons/subposition_icon.svg +3 -3
  21. package/src/assets/icons/subposition_marker.svg +3 -3
  22. package/src/assets/icons/warning_icon.svg +3 -3
  23. package/src/assets/svgIcons/2d_active.svg +7 -7
  24. package/src/assets/svgIcons/2d_inactive.svg +8 -8
  25. package/src/assets/svgIcons/3d_active.svg +7 -7
  26. package/src/assets/svgIcons/3d_inactive.svg +8 -8
  27. package/src/assets/svgIcons/accept.svg +5 -5
  28. package/src/assets/svgIcons/activate_panels_active.svg +22 -22
  29. package/src/assets/svgIcons/activate_panels_inactive.svg +20 -20
  30. package/src/assets/svgIcons/add_icon-1.svg +3 -3
  31. package/src/assets/svgIcons/add_icon.svg +4 -4
  32. package/src/assets/svgIcons/address_book.svg +3 -3
  33. package/src/assets/svgIcons/after_sale_as_a_service.svg +6 -6
  34. package/src/assets/svgIcons/all_good.svg +3 -3
  35. package/src/assets/svgIcons/angle_active.svg +5 -5
  36. package/src/assets/svgIcons/angle_inactive.svg +4 -4
  37. package/src/assets/svgIcons/area_active.svg +11 -11
  38. package/src/assets/svgIcons/area_inactive.svg +26 -26
  39. package/src/assets/svgIcons/arrow_down.svg +3 -3
  40. package/src/assets/svgIcons/arrow_left.svg +4 -4
  41. package/src/assets/svgIcons/arrow_right.svg +4 -4
  42. package/src/assets/svgIcons/arrow_up.svg +3 -3
  43. package/src/assets/svgIcons/attachment.svg +3 -3
  44. package/src/assets/svgIcons/battery.svg +3 -3
  45. package/src/assets/svgIcons/bell.svg +3 -3
  46. package/src/assets/svgIcons/bold.svg +3 -3
  47. package/src/assets/svgIcons/bom.svg +3 -3
  48. package/src/assets/svgIcons/bom_generation.svg +10 -10
  49. package/src/assets/svgIcons/bubble.svg +3 -3
  50. package/src/assets/svgIcons/bullet_list.svg +8 -8
  51. package/src/assets/svgIcons/calendar.svg +7 -7
  52. package/src/assets/svgIcons/calendar_icon.svg +7 -7
  53. package/src/assets/svgIcons/call.svg +3 -3
  54. package/src/assets/svgIcons/camera.svg +3 -3
  55. package/src/assets/svgIcons/car.svg +3 -3
  56. package/src/assets/svgIcons/cart.svg +3 -3
  57. package/src/assets/svgIcons/checkbox.svg +3 -3
  58. package/src/assets/svgIcons/clear_formatting.svg +7 -7
  59. package/src/assets/svgIcons/clickable_info.svg +4 -4
  60. package/src/assets/svgIcons/clip.svg +3 -3
  61. package/src/assets/svgIcons/clock.svg +4 -4
  62. package/src/assets/svgIcons/close_for_modals,_tool_tips.svg +4 -4
  63. package/src/assets/svgIcons/collapse.svg +4 -4
  64. package/src/assets/svgIcons/component_library.svg +7 -7
  65. package/src/assets/svgIcons/context_menu-1.svg +6 -6
  66. package/src/assets/svgIcons/context_menu-2.svg +5 -5
  67. package/src/assets/svgIcons/context_menu.svg +5 -5
  68. package/src/assets/svgIcons/context_menu_tabs.svg +5 -5
  69. package/src/assets/svgIcons/current_variant.svg +4 -4
  70. package/src/assets/svgIcons/deadline.svg +4 -4
  71. package/src/assets/svgIcons/delete.svg +4 -4
  72. package/src/assets/svgIcons/delete_area_active.svg +16 -16
  73. package/src/assets/svgIcons/delete_area_inactive.svg +15 -15
  74. package/src/assets/svgIcons/direction_active-1.svg +12 -12
  75. package/src/assets/svgIcons/direction_active.svg +5 -5
  76. package/src/assets/svgIcons/direction_inactive.svg +4 -4
  77. package/src/assets/svgIcons/distances_active.svg +9 -9
  78. package/src/assets/svgIcons/distances_inactive.svg +8 -8
  79. package/src/assets/svgIcons/document.svg +3 -3
  80. package/src/assets/svgIcons/downarrow.svg +3 -3
  81. package/src/assets/svgIcons/download.svg +4 -4
  82. package/src/assets/svgIcons/duplicate-1.svg +8 -8
  83. package/src/assets/svgIcons/duplicate-2.svg +5 -5
  84. package/src/assets/svgIcons/duplicate-3.svg +3 -3
  85. package/src/assets/svgIcons/duplicate.svg +4 -4
  86. package/src/assets/svgIcons/e-mobility_configurator.svg +6 -6
  87. package/src/assets/svgIcons/edit_button.svg +3 -3
  88. package/src/assets/svgIcons/email.svg +3 -3
  89. package/src/assets/svgIcons/ems-1.svg +3 -3
  90. package/src/assets/svgIcons/ems.svg +3 -3
  91. package/src/assets/svgIcons/end_of_the_list.svg +5 -5
  92. package/src/assets/svgIcons/erase.svg +4 -4
  93. package/src/assets/svgIcons/fav_icon.svg +4 -4
  94. package/src/assets/svgIcons/financing_for_pv-1.svg +5 -5
  95. package/src/assets/svgIcons/financing_for_pv-2.svg +3 -3
  96. package/src/assets/svgIcons/financing_for_pv.svg +6 -6
  97. package/src/assets/svgIcons/finish-1.svg +4 -4
  98. package/src/assets/svgIcons/finish.svg +3 -3
  99. package/src/assets/svgIcons/folder.svg +3 -3
  100. package/src/assets/svgIcons/heat_calc.svg +7 -7
  101. package/src/assets/svgIcons/house.svg +3 -3
  102. package/src/assets/svgIcons/info.svg +3 -3
  103. package/src/assets/svgIcons/initial_situation.svg +3 -3
  104. package/src/assets/svgIcons/intro-tour-1.svg +3 -3
  105. package/src/assets/svgIcons/intro-tour.svg +3 -3
  106. package/src/assets/svgIcons/inverter-1.svg +5 -5
  107. package/src/assets/svgIcons/inverter.svg +3 -3
  108. package/src/assets/svgIcons/italic.svg +3 -3
  109. package/src/assets/svgIcons/key.svg +3 -3
  110. package/src/assets/svgIcons/lead_marketplace.svg +6 -6
  111. package/src/assets/svgIcons/lead_provider.svg +4 -4
  112. package/src/assets/svgIcons/length_in_2d_active.svg +12 -12
  113. package/src/assets/svgIcons/length_in_2d_inctive.svg +13 -13
  114. package/src/assets/svgIcons/light_bulb.svg +3 -3
  115. package/src/assets/svgIcons/line_graph.svg +3 -3
  116. package/src/assets/svgIcons/local_subsidies.svg +18 -18
  117. package/src/assets/svgIcons/location.svg +3 -3
  118. package/src/assets/svgIcons/lock.svg +3 -3
  119. package/src/assets/svgIcons/loop.svg +3 -3
  120. package/src/assets/svgIcons/lunch.svg +4 -4
  121. package/src/assets/svgIcons/map_icon.svg +3 -3
  122. package/src/assets/svgIcons/meeting.svg +6 -6
  123. package/src/assets/svgIcons/move_copy.svg +4 -4
  124. package/src/assets/svgIcons/new_area_inactive.svg +11 -11
  125. package/src/assets/svgIcons/next.svg +4 -4
  126. package/src/assets/svgIcons/not_equal_to.svg +3 -3
  127. package/src/assets/svgIcons/numbered_list.svg +6 -6
  128. package/src/assets/svgIcons/obstacle_tool.svg +13 -13
  129. package/src/assets/svgIcons/pan_tool.svg +12 -12
  130. package/src/assets/svgIcons/panels_tool.svg +8 -8
  131. package/src/assets/svgIcons/pen_tool.svg +4 -4
  132. package/src/assets/svgIcons/picker_tool.svg +4 -4
  133. package/src/assets/svgIcons/picture.svg +3 -3
  134. package/src/assets/svgIcons/pin.svg +5 -5
  135. package/src/assets/svgIcons/presentation.svg +3 -3
  136. package/src/assets/svgIcons/previous.svg +4 -4
  137. package/src/assets/svgIcons/profile-1.svg +4 -4
  138. package/src/assets/svgIcons/profile.svg +4 -4
  139. package/src/assets/svgIcons/profitability.svg +3 -3
  140. package/src/assets/svgIcons/project_analysis.svg +4 -4
  141. package/src/assets/svgIcons/project_settings.svg +4 -4
  142. package/src/assets/svgIcons/pv.svg +3 -3
  143. package/src/assets/svgIcons/quotations.svg +6 -6
  144. package/src/assets/svgIcons/rotate_view.svg +5 -5
  145. package/src/assets/svgIcons/run_simulation.svg +3 -3
  146. package/src/assets/svgIcons/scaling_tool.svg +8 -8
  147. package/src/assets/svgIcons/search.svg +3 -3
  148. package/src/assets/svgIcons/security.svg +3 -3
  149. package/src/assets/svgIcons/settings.svg +3 -3
  150. package/src/assets/svgIcons/show_in_a_new_tab.svg +12 -12
  151. package/src/assets/svgIcons/smartphone.svg +4 -4
  152. package/src/assets/svgIcons/solar_calc.svg +13 -13
  153. package/src/assets/svgIcons/sorting.svg +4 -4
  154. package/src/assets/svgIcons/start_of_the_list.svg +5 -5
  155. package/src/assets/svgIcons/strikethrough.svg +4 -4
  156. package/src/assets/svgIcons/subsidies-1.svg +5 -5
  157. package/src/assets/svgIcons/subsidies-2.svg +3 -3
  158. package/src/assets/svgIcons/subsidies.svg +3 -3
  159. package/src/assets/svgIcons/subtract_icon.svg +3 -3
  160. package/src/assets/svgIcons/suitcase.svg +3 -3
  161. package/src/assets/svgIcons/template_icon_not_clickable.svg +6 -6
  162. package/src/assets/svgIcons/truck.svg +3 -3
  163. package/src/assets/svgIcons/underlined.svg +3 -3
  164. package/src/assets/svgIcons/uparrow.svg +3 -3
  165. package/src/assets/svgIcons/upload_avatar-1.svg +12 -12
  166. package/src/assets/svgIcons/upload_avatar.svg +5 -5
  167. package/src/assets/svgIcons/upload_image.svg +8 -8
  168. package/src/assets/svgIcons/virtual_storage.svg +4 -4
  169. package/src/assets/svgIcons/warning.svg +4 -4
  170. package/src/assets/svgIcons/way.svg +5 -5
  171. package/src/assets/svgIcons/wifi.svg +3 -3
  172. package/src/assets/svgIcons/winter.svg +3 -3
  173. package/src/assets/theme.js +34 -34
  174. package/src/components/addNewButton/AddNewButton.stories.js +24 -24
  175. package/src/components/addNewButton/index.vue +58 -58
  176. package/src/components/buttons/closeButton/CloseButton.stories.js +29 -29
  177. package/src/components/buttons/closeButton/index.vue +61 -61
  178. package/src/components/buttons/externalButton/index.vue +101 -101
  179. package/src/components/buttons/mainButton/index.vue +82 -82
  180. package/src/components/deleteIcon/DeleteIcon.stories.js +29 -29
  181. package/src/components/deleteIcon/index.vue +55 -55
  182. package/src/components/icon/Icons.stories.js +41 -41
  183. package/src/components/icon/iconCollection.vue +68 -68
  184. package/src/components/icon/index.vue +76 -76
  185. package/src/components/infoText/index.vue +151 -164
  186. package/src/components/inputs/checkbox/Checkbox.stories.js +57 -57
  187. package/src/components/inputs/checkbox/index.vue +182 -182
  188. package/src/components/inputs/inputNumber/InputNumber.stories.js +150 -150
  189. package/src/components/inputs/inputNumber/index.vue +390 -476
  190. package/src/components/inputs/inputNumberQuestion/index.vue +215 -215
  191. package/src/components/inputs/inputText/InputText.stories.js +75 -75
  192. package/src/components/inputs/inputText/index.vue +198 -200
  193. package/src/components/inputs/radioButton/RadioButton.stories.js +58 -58
  194. package/src/components/inputs/radioButton/index.vue +253 -253
  195. package/src/components/inputs/searchInput/SearchInput.stories.js +40 -40
  196. package/src/components/inputs/searchInput/index.vue +97 -96
  197. package/src/components/inputs/slider/index.vue +126 -126
  198. package/src/components/inputs/textAreaInput/TextAreaInput.stories.js +135 -135
  199. package/src/components/inputs/textAreaInput/index.vue +189 -194
  200. package/src/components/inputs/toggle/Toggle.stories.js +77 -77
  201. package/src/components/inputs/toggle/index.vue +288 -288
  202. package/src/components/modals/modal/index.vue +153 -153
  203. package/src/components/modals/modal/modal.stories.js +31 -31
  204. package/src/components/pageSubtitle/index.vue +68 -64
  205. package/src/components/pageTitle/index.vue +41 -37
  206. package/src/components/progressBar/index.vue +125 -125
  207. package/src/components/spinner/index.vue +71 -71
  208. package/src/components/tableDropdown/index.vue +644 -644
  209. package/src/components/tables/mainTable/exampleNested.vue +328 -328
  210. package/src/components/tables/mainTable/index.vue +365 -365
  211. package/src/components/tables/viewTable/index.vue +195 -195
  212. package/src/components/threeDots/index.vue +324 -324
  213. package/src/helpers/numberConverter.js +98 -101
  214. package/src/helpers/translateLang.js +80 -80
  215. package/src/main.js +11 -11
  216. package/src/assets/icons/error_icon copy.png +0 -0
  217. package/src/components/errorMessage/index.vue +0 -62
@@ -1,200 +1,198 @@
1
- <template>
2
- <container>
3
- <input-wrapper
4
- :hasLabel="!!label && label.length > 0"
5
- :alignItems="alignItems"
6
- >
7
- <label-wrapper v-if="label">
8
- <input-label :fontSize="fontSize">{{ label }}</input-label>
9
- <info-text
10
- v-if="infoTextMessage"
11
- :text="infoTextMessage"
12
- borderColor="#ccc"
13
- :size="fontSize ? fontSize : '16'"
14
- :alignText="infoTextAlign"
15
- />
16
- </label-wrapper>
17
- <input-error-wrapper>
18
- <input-container
19
- :placeholder="placeholder"
20
- :isError="isError"
21
- :inputWidth="inputWidth"
22
- :minWidth="minWidth"
23
- :value="value"
24
- @input="onChangeHandler"
25
- :noBorder="noBorder"
26
- :disabled="disabled"
27
- :isDisabled="disabled"
28
- :fontSize="fontSize"
29
- />
30
- <error-message v-if="isError">{{ errorMessage }}</error-message>
31
- </input-error-wrapper>
32
- </input-wrapper>
33
- </container>
34
- </template>
35
-
36
- <script>
37
- import styled from "vue-styled-components"
38
- import InfoText from "../../infoText"
39
- import ErrorMessage from '../../errorMessage'
40
-
41
- const Container = styled.div`
42
- width: 100%;
43
- position: relative;
44
- `
45
- const InputErrorWrapper = styled.div`
46
- display: inline-grid;
47
- grid-template-row: auto auto;
48
- grid-gap: 0px;
49
- align-items: center;
50
- `
51
- const labelAttrs = { fontSize: String }
52
- const InputLabel = styled("div", labelAttrs)`
53
- font-weight: bold;
54
- font-size: ${(props) => (props.fontSize ? props.fontSize : "13px")};
55
- `
56
-
57
- const LabelWrapper = styled.div`
58
- display: inline-grid;
59
- grid-template-columns: auto 1fr;
60
- grid-gap: 12px;
61
- align-items: center;
62
- `
63
-
64
- const inputProps = {
65
- isError: Boolean,
66
- inputWidth: String,
67
- minWidth: String,
68
- noBorder: Boolean,
69
- isDisabled: Boolean,
70
- fontSize: String,
71
- }
72
- const InputContainer = styled("input", inputProps)`
73
- border: ${(props) =>
74
- props.isError
75
- ? "1px solid " + props.theme.colors.red
76
- : props.noBorder
77
- ? "none"
78
- : props.hasLength
79
- ? "1px solid " + props.theme.colors.black
80
- : "1px solid " + props.theme.colors.mediumGray};
81
- padding: ${(props) =>
82
- props.hasUnit ? "11px 40px 11px 10px" : "11px 5px 11px 10px"};
83
- border-radius: 4px;
84
- font-size: ${(props) => (props.fontSize ? props.fontSize : "16px")};
85
- color: ${(props) =>
86
- props.isError ? props.theme.colors.red : props.theme.colors.black};
87
- width: ${(props) => (props.inputWidth ? props.inputWidth : "100%")};
88
- min-width: ${(props) => (props.minWidth ? props.minWidth : "unset")};
89
- box-sizing: border-box; // to allow width of 100% with padding
90
- font-weight: 500;
91
- cursor: ${(props) => (props.isDisabled ? "not-allowed" : "auto")};
92
- background-color: ${(props) =>
93
- props.isDisabled ? props.theme.colors.grey5 : "#fff"};
94
-
95
- &::placeholder {
96
- color: ${(props) =>
97
- props.isError ? props.theme.colors.red : props.theme.colors.darkGray};
98
- }
99
-
100
- &:focus {
101
- outline: none;
102
- }
103
- `
104
-
105
- const inputAttrs = { alignItems: String, hasLabel: Boolean }
106
- const InputWrapper = styled("div", inputAttrs)`
107
- position: relative;
108
- display: grid;
109
- align-items: center;
110
- gap: 8px;
111
- grid-template-columns: ${(props) =>
112
- props.alignItems === "vertical" || !props.hasLabel ? "1fr" : "auto 1fr"};
113
- `
114
-
115
- export default {
116
- // import InputText from "@eturnity/eturnity_reusable_components/src/components/inputs/inputText"
117
- // To use:
118
- // <input-text
119
- // placeholder="Company name"
120
- // :value="companyName"
121
- // @input-change="onInputChange({ value: $event, type: 'companyName' })"
122
- // :isError="checkErrors()"
123
- // :errorMessage="This is my error message"
124
- // infoTextAlign="right" // left by default
125
- // infoTextMessage="My info message"
126
- // label="Question 5"
127
- // alignItems="horizontal" // horizontal, vertical
128
- // inputWidth="250px"
129
- // minWidth="100px"
130
- // fontSize="13px"
131
- // />
132
- name: "input-text",
133
- components: {
134
- Container,
135
- InputContainer,
136
- InputWrapper,
137
- ErrorMessage,
138
- InfoText,
139
- InputLabel,
140
- InputErrorWrapper,
141
- LabelWrapper,
142
- },
143
- props: {
144
- placeholder: {
145
- required: false,
146
- default: "",
147
- },
148
- alignItems: {
149
- required: false,
150
- default: "horizontal",
151
- },
152
- isError: {
153
- required: false,
154
- default: false,
155
- },
156
- inputWidth: {
157
- required: false,
158
- default: null,
159
- },
160
- minWidth: {
161
- required: false,
162
- default: null,
163
- },
164
- value: {
165
- required: true,
166
- default: null,
167
- },
168
- errorMessage: {
169
- required: false,
170
- default: "",
171
- },
172
- infoTextMessage: {
173
- required: false,
174
- },
175
- infoTextAlign: {
176
- required: false,
177
- },
178
- label: {
179
- required: false,
180
- },
181
- noBorder: {
182
- required: false,
183
- default: false,
184
- },
185
- disabled: {
186
- required: false,
187
- default: false,
188
- },
189
- fontSize: {
190
- required: false,
191
- default: null,
192
- },
193
- },
194
- methods: {
195
- onChangeHandler($event) {
196
- this.$emit("input-change", $event)
197
- },
198
- },
199
- }
200
- </script>
1
+ <template>
2
+ <container>
3
+ <input-wrapper
4
+ :hasLabel="!!label && label.length > 0"
5
+ :alignItems="alignItems"
6
+ >
7
+ <label-wrapper v-if="label">
8
+ <input-label :fontSize="fontSize">{{ label }}</input-label>
9
+ <info-text
10
+ v-if="infoTextMessage"
11
+ :text="infoTextMessage"
12
+ borderColor="#ccc"
13
+ :size="fontSize ? fontSize : '16'"
14
+ :alignText="infoTextAlign"
15
+ />
16
+ </label-wrapper>
17
+ <input-container
18
+ :placeholder="placeholder"
19
+ :isError="isError"
20
+ :inputWidth="inputWidth"
21
+ :minWidth="minWidth"
22
+ :value="value"
23
+ @input="onChangeHandler"
24
+ :noBorder="noBorder"
25
+ :disabled="disabled"
26
+ :isDisabled="disabled"
27
+ :fontSize="fontSize"
28
+ />
29
+ </input-wrapper>
30
+ <error-message v-if="isError">{{ errorMessage }}</error-message>
31
+ </container>
32
+ </template>
33
+
34
+ <script>
35
+ import styled from "vue-styled-components"
36
+ import InfoText from "../../infoText"
37
+
38
+ const Container = styled.div`
39
+ width: 100%;
40
+ position: relative;
41
+ `
42
+
43
+ const labelAttrs = { fontSize: String }
44
+ const InputLabel = styled("div", labelAttrs)`
45
+ font-weight: bold;
46
+ font-size: ${(props) => (props.fontSize ? props.fontSize : "13px")};
47
+ `
48
+
49
+ const LabelWrapper = styled.div`
50
+ display: inline-grid;
51
+ grid-template-columns: auto 1fr;
52
+ grid-gap: 12px;
53
+ align-items: center;
54
+ `
55
+
56
+ const inputProps = {
57
+ isError: Boolean,
58
+ inputWidth: String,
59
+ minWidth: String,
60
+ noBorder: Boolean,
61
+ isDisabled: Boolean,
62
+ fontSize: String,
63
+ }
64
+ const InputContainer = styled("input", inputProps)`
65
+ border: ${(props) =>
66
+ props.isError
67
+ ? "1px solid " + props.theme.colors.red
68
+ : props.noBorder
69
+ ? "none"
70
+ : props.hasLength
71
+ ? "1px solid " + props.theme.colors.black
72
+ : "1px solid " + props.theme.colors.mediumGray};
73
+ padding: ${(props) =>
74
+ props.hasUnit ? "11px 40px 11px 10px" : "11px 5px 11px 10px"};
75
+ border-radius: 4px;
76
+ font-size: ${(props) => (props.fontSize ? props.fontSize : "16px")};
77
+ color: ${(props) =>
78
+ props.isError ? props.theme.colors.red : props.theme.colors.black};
79
+ width: ${(props) => (props.inputWidth ? props.inputWidth : "100%")};
80
+ min-width: ${(props) => (props.minWidth ? props.minWidth : "unset")};
81
+ box-sizing: border-box; // to allow width of 100% with padding
82
+ font-weight: 500;
83
+ cursor: ${(props) => (props.isDisabled ? "not-allowed" : "auto")};
84
+ background-color: ${(props) =>
85
+ props.isDisabled ? props.theme.colors.grey5 : "#fff"};
86
+
87
+ &::placeholder {
88
+ color: ${(props) =>
89
+ props.isError ? props.theme.colors.red : props.theme.colors.darkGray};
90
+ }
91
+
92
+ &:focus {
93
+ outline: none;
94
+ }
95
+ `
96
+
97
+ const inputAttrs = { alignItems: String, hasLabel: Boolean }
98
+ const InputWrapper = styled("div", inputAttrs)`
99
+ position: relative;
100
+ display: grid;
101
+ align-items: center;
102
+ gap: 8px;
103
+ grid-template-columns: ${(props) =>
104
+ props.alignItems === "vertical" || !props.hasLabel ? "1fr" : "auto 1fr"};
105
+ `
106
+
107
+ const ErrorMessage = styled.div`
108
+ font-size: 14px;
109
+ color: ${(props) => props.theme.colors.red};
110
+ position: absolute;
111
+ top: calc(100% + 1px);
112
+ `
113
+
114
+ export default {
115
+ // import InputText from "@eturnity/eturnity_reusable_components/src/components/inputs/inputText"
116
+ // To use:
117
+ // <input-text
118
+ // placeholder="Company name"
119
+ // :value="companyName"
120
+ // @input-change="onInputChange({ value: $event, type: 'companyName' })"
121
+ // :isError="checkErrors()"
122
+ // :errorMessage="This is my error message"
123
+ // infoTextAlign="right" // left by default
124
+ // infoTextMessage="My info message"
125
+ // label="Question 5"
126
+ // alignItems="horizontal" // horizontal, vertical
127
+ // inputWidth="250px"
128
+ // minWidth="100px"
129
+ // fontSize="13px"
130
+ // />
131
+ name: "input-text",
132
+ components: {
133
+ Container,
134
+ InputContainer,
135
+ InputWrapper,
136
+ ErrorMessage,
137
+ InfoText,
138
+ InputLabel,
139
+ LabelWrapper,
140
+ },
141
+ props: {
142
+ placeholder: {
143
+ required: false,
144
+ default: "",
145
+ },
146
+ alignItems: {
147
+ required: false,
148
+ default: "horizontal",
149
+ },
150
+ isError: {
151
+ required: false,
152
+ default: false,
153
+ },
154
+ inputWidth: {
155
+ required: false,
156
+ default: null,
157
+ },
158
+ minWidth: {
159
+ required: false,
160
+ default: null,
161
+ },
162
+ value: {
163
+ required: true,
164
+ default: null,
165
+ },
166
+ errorMessage: {
167
+ required: false,
168
+ default: "",
169
+ },
170
+ infoTextMessage: {
171
+ required: false,
172
+ },
173
+ infoTextAlign: {
174
+ required: false,
175
+ },
176
+ label: {
177
+ required: false,
178
+ },
179
+ noBorder: {
180
+ required: false,
181
+ default: false,
182
+ },
183
+ disabled: {
184
+ required: false,
185
+ default: false,
186
+ },
187
+ fontSize: {
188
+ required: false,
189
+ default: null,
190
+ },
191
+ },
192
+ methods: {
193
+ onChangeHandler($event) {
194
+ this.$emit("input-change", $event)
195
+ },
196
+ },
197
+ }
198
+ </script>
@@ -1,58 +1,58 @@
1
- import RadioButton from "./index.vue"
2
-
3
- export default {
4
- title: "RadioButton",
5
- component: RadioButton,
6
- // argTypes: {},
7
- }
8
-
9
- const Template = (args, { argTypes }) => ({
10
- // Components used in your story `template` are defined in the `components` object
11
- components: { RadioButton },
12
- // The story's `args` need to be mapped into the template through the `setup()` method
13
- props: Object.keys(argTypes),
14
- template: '<radio-button v-bind="$props" />',
15
-
16
- // import RadioButton from "@eturnity/eturnity_reusable_components/src/components/inputs/radioButton"
17
- // To use:
18
- // <radio-button
19
- // :options="radioOptions"
20
- // :selectedOption="checkedOption"
21
- // @on-radio-change="onInputChange($event)"
22
- // layout="vertical"
23
- // size="large"
24
- // />
25
- // Data being passed should look like:
26
- // radioOptions: [
27
- // { label: 'Button 1', value: 'button_1', img: 'www.imagesrc.com', infoText: 'my info text' },
28
- // { label: 'Button 2', value: 'button_2', img: 'www.imagesrc.com', infoText: 'my info text 2' },
29
- // { label: 'Button 3', value: 'button_3', img: 'www.imagesrc.com', disabled: true },
30
- // { label: 'Button 4', value: 'button_4', disabled: true }
31
- // ]
32
- })
33
-
34
- export const Default = Template.bind({})
35
- Default.args = {
36
- options: [
37
- { label: "Button 1", value: "button_1", infoText: "my info text" },
38
- { label: "Button 2", value: "button_2", infoText: "my info text 2" },
39
- { label: "Button 3", value: "button_3", disabled: true },
40
- { label: "Button 4", value: "button_4", disabled: true },
41
- ],
42
- selectedOption: "button_2",
43
- layout: "horizontal",
44
- size: "medium",
45
- }
46
-
47
- export const VerticalLayout = Template.bind({})
48
- VerticalLayout.args = {
49
- options: [
50
- { label: "Button 1", value: "button_1" },
51
- { label: "Button 2", value: "button_2" },
52
- { label: "Button 3", value: "button_3" },
53
- { label: "Button 4", value: "button_4", disabled: true },
54
- ],
55
- selectedOption: "button_2",
56
- layout: "vertical",
57
- size: "medium",
58
- }
1
+ import RadioButton from "./index.vue"
2
+
3
+ export default {
4
+ title: "RadioButton",
5
+ component: RadioButton,
6
+ // argTypes: {},
7
+ }
8
+
9
+ const Template = (args, { argTypes }) => ({
10
+ // Components used in your story `template` are defined in the `components` object
11
+ components: { RadioButton },
12
+ // The story's `args` need to be mapped into the template through the `setup()` method
13
+ props: Object.keys(argTypes),
14
+ template: '<radio-button v-bind="$props" />',
15
+
16
+ // import RadioButton from "@eturnity/eturnity_reusable_components/src/components/inputs/radioButton"
17
+ // To use:
18
+ // <radio-button
19
+ // :options="radioOptions"
20
+ // :selectedOption="checkedOption"
21
+ // @on-radio-change="onInputChange($event)"
22
+ // layout="vertical"
23
+ // size="large"
24
+ // />
25
+ // Data being passed should look like:
26
+ // radioOptions: [
27
+ // { label: 'Button 1', value: 'button_1', img: 'www.imagesrc.com', infoText: 'my info text' },
28
+ // { label: 'Button 2', value: 'button_2', img: 'www.imagesrc.com', infoText: 'my info text 2' },
29
+ // { label: 'Button 3', value: 'button_3', img: 'www.imagesrc.com', disabled: true },
30
+ // { label: 'Button 4', value: 'button_4', disabled: true }
31
+ // ]
32
+ })
33
+
34
+ export const Default = Template.bind({})
35
+ Default.args = {
36
+ options: [
37
+ { label: "Button 1", value: "button_1", infoText: "my info text" },
38
+ { label: "Button 2", value: "button_2", infoText: "my info text 2" },
39
+ { label: "Button 3", value: "button_3", disabled: true },
40
+ { label: "Button 4", value: "button_4", disabled: true },
41
+ ],
42
+ selectedOption: "button_2",
43
+ layout: "horizontal",
44
+ size: "medium",
45
+ }
46
+
47
+ export const VerticalLayout = Template.bind({})
48
+ VerticalLayout.args = {
49
+ options: [
50
+ { label: "Button 1", value: "button_1" },
51
+ { label: "Button 2", value: "button_2" },
52
+ { label: "Button 3", value: "button_3" },
53
+ { label: "Button 4", value: "button_4", disabled: true },
54
+ ],
55
+ selectedOption: "button_2",
56
+ layout: "vertical",
57
+ size: "medium",
58
+ }