@eturnity/eturnity_reusable_components 1.2.19-EPDM-5295.1 → 1.2.19-EPDM-3412.9

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 (220) 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 -63
  7. package/public/index.html +17 -17
  8. package/src/App.vue +216 -254
  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/error_icon copy.png +0 -0
  16. package/src/assets/icons/external_icon.svg +6 -6
  17. package/src/assets/icons/language_icon.svg +6 -6
  18. package/src/assets/icons/pdf_icon.svg +6 -6
  19. package/src/assets/icons/plus_button.svg +4 -4
  20. package/src/assets/icons/search_icon_black.svg +3 -3
  21. package/src/assets/icons/subposition_icon.svg +3 -3
  22. package/src/assets/icons/subposition_marker.svg +3 -3
  23. package/src/assets/icons/warning_icon.svg +3 -3
  24. package/src/assets/svgIcons/2d_active.svg +7 -7
  25. package/src/assets/svgIcons/2d_inactive.svg +8 -8
  26. package/src/assets/svgIcons/3d_active.svg +7 -7
  27. package/src/assets/svgIcons/3d_inactive.svg +8 -8
  28. package/src/assets/svgIcons/accept.svg +5 -5
  29. package/src/assets/svgIcons/activate_panels_active.svg +22 -22
  30. package/src/assets/svgIcons/activate_panels_inactive.svg +20 -20
  31. package/src/assets/svgIcons/add_icon-1.svg +3 -3
  32. package/src/assets/svgIcons/add_icon.svg +4 -4
  33. package/src/assets/svgIcons/address_book.svg +3 -3
  34. package/src/assets/svgIcons/after_sale_as_a_service.svg +6 -6
  35. package/src/assets/svgIcons/all_good.svg +3 -3
  36. package/src/assets/svgIcons/angle_active.svg +5 -5
  37. package/src/assets/svgIcons/angle_inactive.svg +4 -4
  38. package/src/assets/svgIcons/area_active.svg +11 -11
  39. package/src/assets/svgIcons/area_inactive.svg +26 -26
  40. package/src/assets/svgIcons/arrow_down.svg +3 -3
  41. package/src/assets/svgIcons/arrow_left.svg +4 -4
  42. package/src/assets/svgIcons/arrow_right.svg +4 -4
  43. package/src/assets/svgIcons/arrow_up.svg +3 -3
  44. package/src/assets/svgIcons/attachment.svg +3 -3
  45. package/src/assets/svgIcons/battery.svg +3 -3
  46. package/src/assets/svgIcons/bell.svg +3 -3
  47. package/src/assets/svgIcons/bold.svg +3 -3
  48. package/src/assets/svgIcons/bom.svg +3 -3
  49. package/src/assets/svgIcons/bom_generation.svg +10 -10
  50. package/src/assets/svgIcons/bubble.svg +3 -3
  51. package/src/assets/svgIcons/bullet_list.svg +8 -8
  52. package/src/assets/svgIcons/calendar.svg +7 -7
  53. package/src/assets/svgIcons/calendar_icon.svg +7 -7
  54. package/src/assets/svgIcons/call.svg +3 -3
  55. package/src/assets/svgIcons/camera.svg +3 -3
  56. package/src/assets/svgIcons/car.svg +3 -3
  57. package/src/assets/svgIcons/cart.svg +3 -3
  58. package/src/assets/svgIcons/checkbox.svg +3 -3
  59. package/src/assets/svgIcons/clear_formatting.svg +7 -7
  60. package/src/assets/svgIcons/clickable_info.svg +4 -4
  61. package/src/assets/svgIcons/clip.svg +3 -3
  62. package/src/assets/svgIcons/clock.svg +4 -4
  63. package/src/assets/svgIcons/close_for_modals,_tool_tips.svg +4 -4
  64. package/src/assets/svgIcons/collapse.svg +4 -4
  65. package/src/assets/svgIcons/component_library.svg +7 -7
  66. package/src/assets/svgIcons/context_menu-1.svg +6 -6
  67. package/src/assets/svgIcons/context_menu-2.svg +5 -5
  68. package/src/assets/svgIcons/context_menu.svg +5 -5
  69. package/src/assets/svgIcons/context_menu_tabs.svg +5 -5
  70. package/src/assets/svgIcons/current_variant.svg +4 -4
  71. package/src/assets/svgIcons/deadline.svg +4 -4
  72. package/src/assets/svgIcons/delete.svg +4 -4
  73. package/src/assets/svgIcons/delete_area_active.svg +16 -16
  74. package/src/assets/svgIcons/delete_area_inactive.svg +15 -15
  75. package/src/assets/svgIcons/direction_active-1.svg +12 -12
  76. package/src/assets/svgIcons/direction_active.svg +5 -5
  77. package/src/assets/svgIcons/direction_inactive.svg +4 -4
  78. package/src/assets/svgIcons/distances_active.svg +9 -9
  79. package/src/assets/svgIcons/distances_inactive.svg +8 -8
  80. package/src/assets/svgIcons/document.svg +3 -3
  81. package/src/assets/svgIcons/downarrow.svg +3 -3
  82. package/src/assets/svgIcons/download.svg +4 -4
  83. package/src/assets/svgIcons/duplicate-1.svg +8 -8
  84. package/src/assets/svgIcons/duplicate-2.svg +5 -5
  85. package/src/assets/svgIcons/duplicate-3.svg +3 -3
  86. package/src/assets/svgIcons/duplicate.svg +4 -4
  87. package/src/assets/svgIcons/e-mobility_configurator.svg +6 -6
  88. package/src/assets/svgIcons/edit_button.svg +3 -3
  89. package/src/assets/svgIcons/email.svg +3 -3
  90. package/src/assets/svgIcons/ems-1.svg +3 -3
  91. package/src/assets/svgIcons/ems.svg +3 -3
  92. package/src/assets/svgIcons/end_of_the_list.svg +5 -5
  93. package/src/assets/svgIcons/erase.svg +4 -4
  94. package/src/assets/svgIcons/fav_icon.svg +4 -4
  95. package/src/assets/svgIcons/financing_for_pv-1.svg +5 -5
  96. package/src/assets/svgIcons/financing_for_pv-2.svg +3 -3
  97. package/src/assets/svgIcons/financing_for_pv.svg +6 -6
  98. package/src/assets/svgIcons/finish-1.svg +4 -4
  99. package/src/assets/svgIcons/finish.svg +3 -3
  100. package/src/assets/svgIcons/folder.svg +3 -3
  101. package/src/assets/svgIcons/heat_calc.svg +7 -7
  102. package/src/assets/svgIcons/house.svg +3 -3
  103. package/src/assets/svgIcons/info.svg +3 -3
  104. package/src/assets/svgIcons/initial_situation.svg +3 -3
  105. package/src/assets/svgIcons/intro-tour-1.svg +3 -3
  106. package/src/assets/svgIcons/intro-tour.svg +3 -3
  107. package/src/assets/svgIcons/inverter-1.svg +5 -5
  108. package/src/assets/svgIcons/inverter.svg +3 -3
  109. package/src/assets/svgIcons/italic.svg +3 -3
  110. package/src/assets/svgIcons/key.svg +3 -3
  111. package/src/assets/svgIcons/lead_marketplace.svg +6 -6
  112. package/src/assets/svgIcons/lead_provider.svg +4 -4
  113. package/src/assets/svgIcons/length_in_2d_active.svg +12 -12
  114. package/src/assets/svgIcons/length_in_2d_inctive.svg +13 -13
  115. package/src/assets/svgIcons/light_bulb.svg +3 -3
  116. package/src/assets/svgIcons/line_graph.svg +3 -3
  117. package/src/assets/svgIcons/local_subsidies.svg +18 -18
  118. package/src/assets/svgIcons/location.svg +3 -3
  119. package/src/assets/svgIcons/lock.svg +3 -3
  120. package/src/assets/svgIcons/loop.svg +3 -3
  121. package/src/assets/svgIcons/lunch.svg +4 -4
  122. package/src/assets/svgIcons/map_icon.svg +3 -3
  123. package/src/assets/svgIcons/meeting.svg +6 -6
  124. package/src/assets/svgIcons/move_copy.svg +4 -4
  125. package/src/assets/svgIcons/new_area_inactive.svg +11 -11
  126. package/src/assets/svgIcons/next.svg +4 -4
  127. package/src/assets/svgIcons/not_equal_to.svg +3 -3
  128. package/src/assets/svgIcons/numbered_list.svg +6 -6
  129. package/src/assets/svgIcons/obstacle_tool.svg +13 -13
  130. package/src/assets/svgIcons/pan_tool.svg +12 -12
  131. package/src/assets/svgIcons/panels_tool.svg +8 -8
  132. package/src/assets/svgIcons/pen_tool.svg +4 -4
  133. package/src/assets/svgIcons/picker_tool.svg +4 -4
  134. package/src/assets/svgIcons/picture.svg +3 -3
  135. package/src/assets/svgIcons/pin.svg +5 -5
  136. package/src/assets/svgIcons/presentation.svg +3 -3
  137. package/src/assets/svgIcons/previous.svg +4 -4
  138. package/src/assets/svgIcons/profile-1.svg +4 -4
  139. package/src/assets/svgIcons/profile.svg +4 -4
  140. package/src/assets/svgIcons/profitability.svg +3 -3
  141. package/src/assets/svgIcons/project_analysis.svg +4 -4
  142. package/src/assets/svgIcons/project_settings.svg +4 -4
  143. package/src/assets/svgIcons/pv.svg +3 -3
  144. package/src/assets/svgIcons/quotations.svg +6 -6
  145. package/src/assets/svgIcons/rotate_view.svg +5 -5
  146. package/src/assets/svgIcons/run_simulation.svg +3 -3
  147. package/src/assets/svgIcons/scaling_tool.svg +8 -8
  148. package/src/assets/svgIcons/search.svg +3 -3
  149. package/src/assets/svgIcons/security.svg +3 -3
  150. package/src/assets/svgIcons/settings.svg +3 -3
  151. package/src/assets/svgIcons/show_in_a_new_tab.svg +12 -12
  152. package/src/assets/svgIcons/smartphone.svg +4 -4
  153. package/src/assets/svgIcons/solar_calc.svg +13 -13
  154. package/src/assets/svgIcons/sorting.svg +4 -4
  155. package/src/assets/svgIcons/start_of_the_list.svg +5 -5
  156. package/src/assets/svgIcons/strikethrough.svg +4 -4
  157. package/src/assets/svgIcons/subsidies-1.svg +5 -5
  158. package/src/assets/svgIcons/subsidies-2.svg +3 -3
  159. package/src/assets/svgIcons/subsidies.svg +3 -3
  160. package/src/assets/svgIcons/subtract_icon.svg +3 -3
  161. package/src/assets/svgIcons/suitcase.svg +3 -3
  162. package/src/assets/svgIcons/template_icon_not_clickable.svg +6 -6
  163. package/src/assets/svgIcons/truck.svg +3 -3
  164. package/src/assets/svgIcons/underlined.svg +3 -3
  165. package/src/assets/svgIcons/uparrow.svg +3 -3
  166. package/src/assets/svgIcons/upload_avatar-1.svg +12 -12
  167. package/src/assets/svgIcons/upload_avatar.svg +5 -5
  168. package/src/assets/svgIcons/upload_image.svg +8 -8
  169. package/src/assets/svgIcons/virtual_storage.svg +4 -4
  170. package/src/assets/svgIcons/warning.svg +4 -4
  171. package/src/assets/svgIcons/way.svg +5 -5
  172. package/src/assets/svgIcons/wifi.svg +3 -3
  173. package/src/assets/svgIcons/winter.svg +3 -3
  174. package/src/assets/theme.js +34 -34
  175. package/src/components/addNewButton/AddNewButton.stories.js +24 -24
  176. package/src/components/addNewButton/index.vue +58 -58
  177. package/src/components/buttons/closeButton/CloseButton.stories.js +29 -29
  178. package/src/components/buttons/closeButton/index.vue +61 -61
  179. package/src/components/buttons/externalButton/index.vue +101 -101
  180. package/src/components/buttons/mainButton/index.vue +82 -82
  181. package/src/components/deleteIcon/DeleteIcon.stories.js +29 -29
  182. package/src/components/deleteIcon/index.vue +55 -55
  183. package/src/components/errorMessage/index.vue +62 -0
  184. package/src/components/icon/Icons.stories.js +41 -41
  185. package/src/components/icon/iconCollection.vue +68 -68
  186. package/src/components/icon/index.vue +77 -82
  187. package/src/components/infoText/index.vue +166 -151
  188. package/src/components/inputs/checkbox/Checkbox.stories.js +57 -57
  189. package/src/components/inputs/checkbox/index.vue +182 -182
  190. package/src/components/inputs/inputNumber/InputNumber.stories.js +150 -150
  191. package/src/components/inputs/inputNumber/index.vue +485 -390
  192. package/src/components/inputs/inputNumberQuestion/index.vue +215 -215
  193. package/src/components/inputs/inputText/InputText.stories.js +75 -75
  194. package/src/components/inputs/inputText/index.vue +200 -198
  195. package/src/components/inputs/radioButton/RadioButton.stories.js +58 -58
  196. package/src/components/inputs/radioButton/index.vue +253 -253
  197. package/src/components/inputs/searchInput/SearchInput.stories.js +40 -40
  198. package/src/components/inputs/searchInput/index.vue +96 -96
  199. package/src/components/inputs/slider/index.vue +126 -126
  200. package/src/components/inputs/textAreaInput/TextAreaInput.stories.js +135 -135
  201. package/src/components/inputs/textAreaInput/index.vue +194 -189
  202. package/src/components/inputs/toggle/Toggle.stories.js +77 -77
  203. package/src/components/inputs/toggle/index.vue +288 -288
  204. package/src/components/modals/modal/index.vue +153 -153
  205. package/src/components/modals/modal/modal.stories.js +31 -31
  206. package/src/components/pageSubtitle/index.vue +64 -64
  207. package/src/components/pageTitle/index.vue +37 -37
  208. package/src/components/progressBar/index.vue +125 -125
  209. package/src/components/spinner/index.vue +71 -71
  210. package/src/components/tableDropdown/index.vue +644 -644
  211. package/src/components/tables/mainTable/exampleNested.vue +328 -328
  212. package/src/components/tables/mainTable/index.vue +365 -365
  213. package/src/components/tables/viewTable/index.vue +195 -195
  214. package/src/components/threeDots/index.vue +324 -324
  215. package/src/helpers/numberConverter.js +102 -98
  216. package/src/helpers/translateLang.js +80 -80
  217. package/src/main.js +11 -13
  218. package/src/assets/svgIcons/cross.svg +0 -4
  219. package/src/assets/svgIcons/transfer.svg +0 -4
  220. package/src/components/projectMarker/index.vue +0 -281
@@ -1,198 +1,200 @@
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
+ <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 : '16px'"
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,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
+ }