@eturnity/eturnity_reusable_components 1.2.26-EPDM-3412.3 → 1.2.26-EPDM-2942.1

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.
package/babel.config.js CHANGED
@@ -2,4 +2,4 @@ module.exports = {
2
2
  presets: [
3
3
  '@vue/cli-plugin-babel/preset'
4
4
  ]
5
- }
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "1.2.26-EPDM-3412.3",
3
+ "version": "1.2.26-EPDM-2942.1",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
package/src/App.vue CHANGED
@@ -2,61 +2,80 @@
2
2
  <ThemeProvider :theme="getTheme()" :style="{ height: '100%' }">
3
3
  <page-container>
4
4
  <br />
5
- <input-number
6
- :value="inputValue"
7
- @input-change="inputValue = $event"
8
- inputWidth="250px"
9
- slotSize="50%"
10
- ><InputAnnexContainer>
11
- <span>123m2</span>
12
- <info-text
13
- size="10px"
14
- alignArrow="right"
15
- text="infoText ceci est le text"
16
- ></info-text>
17
- </InputAnnexContainer>
18
- </input-number>
19
- <input-number
20
- :value="inputValue"
21
- @input-change="inputValue = $event"
22
- inputWidth="250px"
23
- slotSize="50%"
24
- :isError="true"
25
- ><InputAnnexContainer>
26
- <span>123m2</span>
27
- <info-text
28
- :style="{ 'justify-self': 'end' }"
29
- size="12px"
30
- alignArrow="center"
31
- text="infoText ceci est le text"
32
- >This is the tooltip text</info-text
33
- >
34
- </InputAnnexContainer>
35
- </input-number>
5
+ <!-- <modal backdrop="dark" :isLoading="false" :isOpen="false"> -->
6
+ <!-- <main-table titleText="My Table">
7
+ <thead>
8
+ <tr>
9
+ <th>Column 1</th>
10
+ <th>Column 2</th>
11
+ <th>Column 3</th>
12
+ <div />
13
+ </tr>
14
+ </thead>
15
+ <tbody>
16
+ <tr> -->
17
+ <!-- <table-dropdown
18
+ :colSpan="3"
19
+ :tableItems="getDropdownValues()"
20
+ @toggle-dropdown-open="toggleDropdownOpen()"
21
+ @item-selected="onItemSelected({ item: $event, index })"
22
+ :isOpen="isDropdownOpen()"
23
+ :optionItems="itemOptions"
24
+ :optionsDisplay="['display_name', 'company_item_number', 'model']"
25
+ /> -->
26
+ <!-- <td>Test</td>
27
+ <div class="icons-container">
28
+ <three-dots :options="listOptions" :isLoading="false" />
29
+ </div>
30
+ </tr>
31
+ </tbody>
32
+ </main-table>
33
+ </modal>
34
+ <row-container>
35
+ <div v-for="(item, index) in markersArray" :key="item.index">
36
+ <project-marker
37
+ :activeLanguage="'en-us'"
38
+ :markerData="item"
39
+ :isLimitedPartner="false"
40
+ :isGroupSupport="false"
41
+ :isEditable="true"
42
+ :gettext="gettext"
43
+ :date="'23.07.2022'"
44
+ @editHandler="consoleLog('edit index ' + index)"
45
+ @deleteHandler="consoleLog('delete id ' + item.id)"
46
+ />
47
+ </div>
48
+ </row-container>
36
49
  <br />
37
-
38
- <p>InputText</p>
50
+ <iconCollection />
51
+ <br />
52
+ <toggle
53
+ @on-toggle-change="onInputChange($event)"
54
+ :isChecked="inputValue"
55
+ label="My Label Text"
56
+ infoTextMessage="This is my test message"
57
+ infoTextAlign="right"
58
+ labelAlign="right"
59
+ :disabled="false"
60
+ />
61
+ <br /> -->
62
+ <iconCollection />
39
63
  <input-text
40
- placeholder="Company name"
64
+ placeholder="Enter distance"
41
65
  :value="inputValue"
42
- :isError="true"
43
- errorMessage="This is my error message"
44
- infoTextAlign="right"
45
- infoTextMessage="My info message"
46
- label="Question 5"
47
- alignItems="vertical"
48
- inputWidth="250px"
49
- minWidth="100px"
66
+ @input-change="onInputChange($event)"
67
+ type="password"
50
68
  />
51
69
  <br />
52
- <input-number
53
- :value="num"
54
- @input-change="num = $event"
55
- unitName="t"
56
- id="biebie"
57
- test="koko"
58
- @keydown="keydownHandler"
59
- />
70
+ <!-- <page-subtitle text="My Subtitle" infoText="My info Text" />
71
+ <spinner size="30px" />
72
+ <checkbox
73
+ label="Do you accept the Terms?"
74
+ :isChecked="true"
75
+ size="small"
76
+ :isDisabled="false"
77
+ /> -->
78
+ <!-- <external-button text="Click me!" minWidth="500px" /> -->
60
79
  </page-container>
61
80
  </ThemeProvider>
62
81
  </template>
@@ -65,8 +84,17 @@
65
84
  import { ThemeProvider } from 'vue-styled-components'
66
85
  import theme from './assets/theme'
67
86
  import styled from 'vue-styled-components'
68
- import InputNumber from '@/components/inputs/inputNumber'
87
+ // import MainTable from '@/components/tables/mainTable'
88
+ // import ThreeDots from '@/components/threeDots'
89
+ // import Toggle from '@/components/inputs/toggle'
69
90
  import InputText from '@/components/inputs/inputText'
91
+ // import Checkbox from '@/components/inputs/checkbox'
92
+ // import PageSubtitle from '@/components/pageSubtitle'
93
+ // import Spinner from '@/components/spinner'
94
+ // import ExternalButton from '@/components/buttons/externalButton'
95
+ // import ProjectMarker from '@/components/projectMarker'
96
+ import iconCollection from '@/components/icon/iconCollection'
97
+ // import Modal from '@/components/modals/modal'
70
98
  // import TableDropdown from "@/components/tableDropdown"
71
99
 
72
100
  const PageContainer = styled.div`
@@ -84,12 +112,21 @@ export default {
84
112
  components: {
85
113
  ThemeProvider,
86
114
  PageContainer,
87
- InputNumber,
88
- InputText
115
+ // MainTable,
116
+ // ThreeDots,
117
+ // Toggle,
118
+ InputText,
119
+ // PageSubtitle,
120
+ // Spinner,
121
+ // Checkbox,
122
+ // ExternalButton,
123
+ // Modal,
124
+ // ProjectMarker,
125
+ iconCollection
126
+ // RowContainer
89
127
  },
90
128
  data() {
91
129
  return {
92
- num: 42,
93
130
  inputValue: null,
94
131
  checkedOption: 'button_1',
95
132
  question: {
@@ -215,8 +252,11 @@ export default {
215
252
  }
216
253
  },
217
254
  methods: {
218
- keydownHandler(e) {
219
- console.log('test', e)
255
+ consoleLog(data) {
256
+ console.log(data)
257
+ },
258
+ gettext(string) {
259
+ return string.toUpperCase()
220
260
  },
221
261
  getTheme() {
222
262
  return theme
@@ -6,6 +6,7 @@
6
6
  >
7
7
  <icon-image
8
8
  v-if="isHovered && !isDisabled"
9
+ :hoverBg="hoverBg"
9
10
  :src="require('../../assets/icons/delete_icon.svg')"
10
11
  />
11
12
  <icon-image
@@ -27,9 +28,10 @@ const Wrapper = styled("div", wrapperAttrs)`
27
28
  cursor: ${(props) => (props.isDisabled ? "not-allowed" : "pointer")};
28
29
  `
29
30
 
30
- const IconImage = styled.img`
31
+ const IconImageAttrs = { hoverBg: String }
32
+ const IconImage = styled('img', IconImageAttrs)`
31
33
  &:hover {
32
- background-color: ${(props) => props.theme.colors.grey5};
34
+ background-color: ${(props) => props.hoverBg ? props.hoverBg : props.theme.colors.grey5};
33
35
  border-radius: 4px;
34
36
  }
35
37
  `
@@ -45,6 +47,10 @@ export default {
45
47
  required: false,
46
48
  default: false,
47
49
  },
50
+ hoverBg: {
51
+ required: false,
52
+ default: '',
53
+ }
48
54
  },
49
55
  data() {
50
56
  return {
@@ -1,26 +1,35 @@
1
1
  <template>
2
2
  <component-wrapper>
3
- <icon-wrapper :size="size">
3
+ <icon-wrapper>
4
4
  <icon-img
5
5
  :isActive="showInfo"
6
6
  :size="size"
7
7
  :borderColor="borderColor"
8
8
  @click.prevent="toggleShowInfo()"
9
- @mouseenter="openTrigger == 'onHover' ? toggleShowInfo() : ''"
10
- @mouseleave="openTrigger == 'onHover' ? toggleShowInfo() : ''"
9
+ @mouseenter="toggleShowInfo()"
10
+ @mouseleave="toggleShowInfo()"
11
11
  >
12
- <icon :size="size" name="info" :color="iconColor" />
12
+ <svg
13
+ class="img-icon"
14
+ :width="size"
15
+ :height="size"
16
+ viewBox="0 0 24 24"
17
+ fill="none"
18
+ xmlns="http://www.w3.org/2000/svg"
19
+ >
20
+ <path
21
+ class="img-icon"
22
+ d="M20.4853 3.51469C18.2188 1.24823 15.2053 0 12 0C8.79469 0 5.78123 1.24823 3.51469 3.51469C1.24823 5.78123 0 8.79469 0 12C0 15.2053 1.24823 18.2188 3.51469 20.4853C5.78123 22.7518 8.79469 24 12 24C15.2053 24 18.2188 22.7518 20.4853 20.4853C22.7518 18.2188 24 15.2053 24 12C24 8.79469 22.7518 5.78123 20.4853 3.51469ZM12 3.28125C13.4216 3.28125 14.5781 4.4378 14.5781 5.85938C14.5781 7.28095 13.4216 8.4375 12 8.4375C10.5784 8.4375 9.42188 7.28095 9.42188 5.85938C9.42188 4.4378 10.5784 3.28125 12 3.28125ZM15.2812 19.6875H8.71875V18.2812H10.125V11.9167H8.71875V10.5104H13.875V18.2812H15.2812V19.6875Z"
23
+ fill="#D5D5D5"
24
+ />
25
+ </svg>
13
26
  </icon-img>
14
27
  <text-overlay
15
28
  v-if="showInfo"
16
29
  :borderColor="borderColor"
17
30
  :alignText="alignText"
18
- :width="width"
19
- :halfComputedTextInfoWidth="halfComputedTextInfoWidth"
20
- :alignArrow="alignArrow"
21
- :iconSize="size"
22
- ><slot />
23
- <span v-html="text"></span>
31
+ >
32
+ {{ text }}
24
33
  </text-overlay>
25
34
  </icon-wrapper>
26
35
  </component-wrapper>
@@ -35,31 +44,22 @@
35
44
  // size="20"
36
45
  // alignText="right" // default is left
37
46
  // />
38
- import theme from '../../assets/theme.js'
39
- import styled from 'vue-styled-components'
40
- import icon from '../icon'
41
47
 
42
- const textAttrs = {
43
- iconSize: String,
44
- borderColor: String,
45
- alignArrow: String,
46
- alignText: String,
47
- width: String,
48
- halfComputedTextInfoWidth: Number
49
- }
50
- const TextOverlay = styled('div', textAttrs)`
48
+ import styled from "vue-styled-components"
49
+
50
+ const IconWrapper = styled.div`
51
+ position: relative;
52
+ `
53
+
54
+ const textAttrs = { borderColor: String, alignText: String }
55
+ const TextOverlay = styled("div", textAttrs)`
51
56
  position: absolute;
52
- top: ${(props) => 'calc(' + props.iconSize + ' + 15px)'};
53
- ${(props) =>
54
- props.alignArrow === 'left'
55
- ? 'left: calc(' + props.iconSize + ' /2 - 18px)'
56
- : props.alignArrow === 'center'
57
- ? 'left: calc((-' + props.width + ' + ' + props.iconSize + ') /2 + 2px)'
58
- : 'right: calc(' + props.iconSize + ' /2 - 17px)'};
59
- text-align: ${(props) => props.alignText};
57
+ top: 26px;
58
+ right: ${(props) => (props.alignText === "left" ? "-10px" : "inherit")};
59
+ left: ${(props) => (props.alignText === "left" ? "inherit" : "-10px")};
60
60
  background: ${(props) => props.theme.colors.black};
61
61
  padding: 10px;
62
- width: ${(props) => props.width};
62
+ width: max-content;
63
63
  max-width: 400px;
64
64
  font-size: 13px;
65
65
  font-weight: 400;
@@ -68,37 +68,32 @@ const TextOverlay = styled('div', textAttrs)`
68
68
  color: ${(props) => props.theme.colors.white};
69
69
 
70
70
  :before {
71
- content: '';
71
+ content: "";
72
72
  background-color: ${(props) => props.theme.colors.black};
73
73
  position: absolute;
74
74
  top: 2px;
75
- ${(props) =>
76
- props.alignArrow === 'left'
77
- ? 'left:40px;'
78
- : props.alignArrow == 'center'
79
- ? 'left: calc(50% + 19px);'
80
- : 'right:-13px;'};
75
+ right: ${(props) => (props.alignText === "left" ? "-12px" : "inherit")};
76
+ left: ${(props) => (props.alignText === "left" ? "inherit" : "40px")};
81
77
  height: 8px;
82
78
  width: 8px;
83
79
  transform-origin: center center;
84
80
  transform: translate(-2em, -0.5em) rotate(45deg);
85
81
  }
86
-
87
- span a {
88
- color: #2cc0eb;
89
- }
90
82
  `
91
83
 
92
84
  const iconAttrs = { isActive: Boolean, size: String, borderColor: String }
93
-
94
- const IconWrapper = styled('div', iconAttrs)`
95
- position: relative;
96
- top: 1px;
97
- height: ${(props) => props.size};
98
- `
99
- const IconImg = styled('div', iconAttrs)`
85
+ const IconImg = styled("div", iconAttrs)`
100
86
  cursor: pointer;
101
- height: ${(props) => props.size};
87
+ height: ${(props) => props.size + "px"};
88
+
89
+ .img-icon {
90
+ fill: ${(props) =>
91
+ props.isActive
92
+ ? props.borderColor
93
+ ? props.borderColor
94
+ : props.theme.colors.secondary
95
+ : props.theme.colors.mediumGray};
96
+ }
102
97
  `
103
98
 
104
99
  const ComponentWrapper = styled.div`
@@ -106,51 +101,38 @@ const ComponentWrapper = styled.div`
106
101
  `
107
102
 
108
103
  export default {
109
- name: 'info-text',
104
+ name: "info-text",
110
105
  components: {
111
106
  IconWrapper,
112
107
  TextOverlay,
113
108
  ComponentWrapper,
114
109
  IconImg,
115
- icon
116
110
  },
117
111
  props: {
118
112
  text: {
119
- required: false
113
+ required: true,
120
114
  },
121
115
  borderColor: {
122
116
  required: false,
123
- default: null
117
+ default: null,
124
118
  },
125
119
  size: {
126
120
  required: false,
127
- default: '14px'
121
+ default: "20",
128
122
  },
129
123
  alignText: {
130
124
  required: false,
131
- default: 'left' // "left" or "right"
132
- },
133
- alignArrow: {
134
- required: false,
135
- default: 'center'
125
+ default: "left", // "left" or "right"
136
126
  },
137
- openTrigger: {
138
- required: false,
139
- default: 'onClick'
140
- },
141
- width: {
142
- required: false,
143
- default: '165px'
144
- }
145
127
  },
146
128
  methods: {
147
129
  toggleShowInfo() {
148
130
  this.showInfo = !this.showInfo
149
131
 
150
132
  if (this.showInfo) {
151
- document.addEventListener('click', this.clickOutside)
133
+ document.addEventListener("click", this.clickOutside)
152
134
  } else {
153
- document.removeEventListener('click', this.clickOutside)
135
+ document.removeEventListener("click", this.clickOutside)
154
136
  }
155
137
  },
156
138
  clickOutside(event) {
@@ -158,24 +140,12 @@ export default {
158
140
  return
159
141
  }
160
142
  this.toggleShowInfo()
161
- }
143
+ },
162
144
  },
163
145
  data() {
164
146
  return {
165
- showInfo: false
147
+ showInfo: false,
166
148
  }
167
149
  },
168
- computed: {
169
- iconColor() {
170
- return this.isActive
171
- ? this.borderColor
172
- ? this.borderColor
173
- : theme.colors.secondary
174
- : theme.colors.mediumGray
175
- },
176
- halfComputedTextInfoWidth() {
177
- return parseInt(this.width) / 2
178
- }
179
- }
180
150
  }
181
151
  </script>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <container :inputWidth="inputWidth">
2
+ <container>
3
3
  <label-wrapper v-if="labelText">
4
4
  <label-text>
5
5
  {{ labelText }}
@@ -8,19 +8,17 @@
8
8
  v-if="labelInfoText"
9
9
  :text="labelInfoText"
10
10
  borderColor="#ccc"
11
- size="14px"
11
+ size="13"
12
12
  :alignText="labelInfoAlign"
13
13
  />
14
14
  </label-wrapper>
15
15
  <input-wrapper>
16
16
  <input-container
17
- v-bind="$attrs"
18
17
  ref="inputField1"
19
18
  :hasUnit="unitName && !!unitName.length"
20
- :placeholder="displayedPlaceholder"
19
+ :placeholder="placeholder"
21
20
  :isError="isError"
22
21
  :inputWidth="inputWidth"
23
- :inputHeight="inputHeight"
24
22
  :minWidth="minWidth"
25
23
  :value="formatWithCurrency(value)"
26
24
  @blur="onInputBlur($event)"
@@ -32,25 +30,13 @@
32
30
  :textAlign="textAlign"
33
31
  :fontSize="fontSize"
34
32
  :fontColor="fontColor"
35
- v-on="$listeners"
36
- :hasSlot="hasSlot"
37
- :slotSize="slotSize"
38
33
  />
39
- <slot-container v-if="hasSlot" :slotSize="slotSize" :isError="isError">
40
- <slot></slot>
41
- </slot-container>
42
-
43
34
  <unit-container
44
- v-if="unitName && showLinearUnitName && !hasSlot"
35
+ v-if="unitName && showLinearUnitName"
45
36
  :hasLength="!!textInput.length"
46
37
  :isError="isError"
47
38
  >{{ unitName }}</unit-container
48
39
  >
49
- <icon
50
- v-if="(isError || inputIcon) && !showLinearUnitName"
51
- :class="inputIconImageClass"
52
- :src="isError ? warningIcon : inputIconImage"
53
- />
54
40
  </input-wrapper>
55
41
  <error-message v-if="isError">{{ errorMessage }}</error-message>
56
42
  </container>
@@ -88,8 +74,11 @@ import {
88
74
  numberToString
89
75
  } from '../../../helpers/numberConverter'
90
76
  import InfoText from '../../infoText'
91
- import ErrorMessage from '../../errorMessage'
92
- import warningIcon from '../../../assets/icons/error_icon.png'
77
+
78
+ const Container = styled.div`
79
+ width: 100%;
80
+ position: relative;
81
+ `
93
82
 
94
83
  const inputProps = {
95
84
  isError: Boolean,
@@ -100,17 +89,8 @@ const inputProps = {
100
89
  noBorder: Boolean,
101
90
  textAlign: String,
102
91
  fontSize: String,
103
- fontColor: String,
104
- hasSlot: Boolean,
105
- slotSize: String,
106
- inputHeight: String
92
+ fontColor: String
107
93
  }
108
-
109
- const Container = styled('div', inputProps)`
110
- width: ${(props) => (props.inputWidth ? props.inputWidth : '100%')};
111
- position: relative;
112
- `
113
-
114
94
  const InputContainer = styled('input', inputProps)`
115
95
  border: ${(props) =>
116
96
  props.isError
@@ -118,15 +98,8 @@ const InputContainer = styled('input', inputProps)`
118
98
  : props.noBorder
119
99
  ? 'none'
120
100
  : '1px solid ' + props.theme.colors.mediumGray};
121
- padding-top: 11px;
122
- padding-bottom: 11px;
123
- padding-left: 10px;
124
- padding-right: ${(props) =>
125
- props.slotSize
126
- ? 'calc(' + props.slotSize + ' + 10px)'
127
- : props.hasUnit
128
- ? '40px'
129
- : '5px'};
101
+ padding: ${(props) =>
102
+ props.hasUnit ? '11px 40px 11px 10px' : '11px 5px 11px 10px'};
130
103
  border-radius: 4px;
131
104
  text-align: ${(props) => props.textAlign};
132
105
  cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'auto')};
@@ -142,7 +115,7 @@ const InputContainer = styled('input', inputProps)`
142
115
  background-color: ${(props) =>
143
116
  props.isDisabled ? props.theme.colors.grey5 : '#fff'};
144
117
  box-sizing: border-box;
145
- max-height: ${(props) => props.inputHeight};
118
+
146
119
  &::placeholder {
147
120
  color: ${(props) =>
148
121
  props.isError ? props.theme.colors.red : props.theme.colors.darkGray};
@@ -152,15 +125,6 @@ const InputContainer = styled('input', inputProps)`
152
125
  outline: none;
153
126
  }
154
127
  `
155
- const IconProps = {
156
- inputIconHeight: String
157
- }
158
-
159
- const Icon = styled('img', IconProps)`
160
- position: absolute;
161
- right: 10px;
162
- top: 2px;
163
- `
164
128
 
165
129
  const InputWrapper = styled.span`
166
130
  position: relative;
@@ -178,7 +142,6 @@ const UnitContainer = styled('span', inputProps)`
178
142
  right: 10px;
179
143
  top: 0;
180
144
  padding-left: 10px;
181
- text-align: right;
182
145
  color: ${(props) =>
183
146
  props.isError
184
147
  ? props.theme.colors.red
@@ -187,27 +150,11 @@ const UnitContainer = styled('span', inputProps)`
187
150
  : props.theme.colors.mediumGray};
188
151
  `
189
152
 
190
- const SlotContainer = styled('span', inputProps)`
191
- text-align: right;
192
- border-left: 1px solid
193
- ${(props) =>
194
- props.isError
195
- ? props.theme.colors.red
196
- : props.hasLength
197
- ? props.theme.colors.black
198
- : props.theme.colors.mediumGray};
153
+ const ErrorMessage = styled.div`
154
+ font-size: 14px;
155
+ color: ${(props) => props.theme.colors.red};
199
156
  position: absolute;
200
- width: ${(props) =>
201
- props.slotSize ? 'calc(' + props.slotSize + ' - 10px)' : 'fit-content'};
202
- right: 10px;
203
- top: 0;
204
- padding-left: 10px;
205
- color: ${(props) =>
206
- props.isError
207
- ? props.theme.colors.red
208
- : props.hasLength
209
- ? props.theme.colors.black
210
- : props.theme.colors.mediumGray};
157
+ top: calc(100% + 1px);
211
158
  `
212
159
 
213
160
  const LabelWrapper = styled.div`
@@ -231,16 +178,12 @@ export default {
231
178
  ErrorMessage,
232
179
  LabelWrapper,
233
180
  LabelText,
234
- InfoText,
235
- Icon,
236
- SlotContainer
181
+ InfoText
237
182
  },
238
- inheritAttrs: false,
239
183
  data() {
240
184
  return {
241
185
  textInput: '',
242
- isFocused: false,
243
- warningIcon: warningIcon
186
+ isFocused: false
244
187
  }
245
188
  },
246
189
  props: {
@@ -260,10 +203,6 @@ export default {
260
203
  required: false,
261
204
  default: null
262
205
  },
263
- inputHeight: {
264
- required: false,
265
- default: null
266
- },
267
206
  value: {
268
207
  required: true,
269
208
  default: null
@@ -314,7 +253,7 @@ export default {
314
253
  },
315
254
  labelInfoAlign: {
316
255
  required: false,
317
- default: 'left'
256
+ default: 'right'
318
257
  },
319
258
  minNumber: {
320
259
  required: false,
@@ -327,41 +266,11 @@ export default {
327
266
  numberToStringEnabled: {
328
267
  required: false,
329
268
  default: true
330
- },
331
- inputIcon: {
332
- require: false,
333
- type: Boolean,
334
- default: false
335
- },
336
- inputIconImage: {
337
- require: false,
338
- type: String,
339
- default: ''
340
- },
341
- inputIconImageClass: {
342
- require: false,
343
- type: Array,
344
- default: () => []
345
- },
346
- slotSize: {
347
- required: false
348
- }
349
- },
350
- computed: {
351
- displayedPlaceholder() {
352
- if (this.placeholder) return this.placeholder
353
- return `${this.minNumber || 0} ${this.unitName ? this.unitName : ''}`
354
- },
355
- hasSlot() {
356
- return !!this.$slots.default
357
- },
358
- computedSlotSize() {
359
- return this.slotSize || this.$slots['default'][0].elm.clientWidth
360
269
  }
361
270
  },
362
271
  methods: {
363
272
  onChangeHandler(event) {
364
- if (isNaN(event) || event == '') {
273
+ if (isNaN(event)) {
365
274
  event = this.minNumber || this.minNumber === 0 ? this.minNumber : event
366
275
  }
367
276
  this.$emit('input-change', event)
@@ -396,8 +305,6 @@ export default {
396
305
  value: evaluated,
397
306
  numberPrecision: this.numberPrecision
398
307
  })
399
- } else if (typeof evaluated === 'number') {
400
- evaluated = evaluated.toFixed(this.numberPrecision)
401
308
  }
402
309
  return evaluated
403
310
  },
@@ -414,8 +321,8 @@ export default {
414
321
  })
415
322
  }
416
323
  let adjustedMinValue =
417
- evaluatedInput && evaluatedInput.length
418
- ? evaluatedInput
324
+ value && value.length
325
+ ? value
419
326
  : this.minNumber || this.minNumber === 0
420
327
  ? this.minNumber
421
328
  : ''
@@ -429,7 +336,6 @@ export default {
429
336
  this.$nextTick(() => {
430
337
  this.$refs.inputField1.$el.select()
431
338
  })
432
- this.$emit('input-focus')
433
339
  },
434
340
  formatWithCurrency(value) {
435
341
  let adjustedMinValue =
@@ -446,7 +352,6 @@ export default {
446
352
  })
447
353
  : adjustedMinValue
448
354
  let unit = this.showLinearUnitName ? '' : this.unitName
449
- //return input + ' ' + unit
450
355
  return input + ' ' + unit
451
356
  } else if (!adjustedMinValue && adjustedMinValue !== 0) {
452
357
  return ''
@@ -10,42 +10,38 @@
10
10
  v-if="infoTextMessage"
11
11
  :text="infoTextMessage"
12
12
  borderColor="#ccc"
13
- :size="fontSize ? fontSize : '16px'"
13
+ :size="fontSize ? fontSize : '16'"
14
14
  :alignText="infoTextAlign"
15
15
  />
16
16
  </label-wrapper>
17
- <input-error-wrapper>
18
- <icon-container>
19
- <input-container
20
- :placeholder="placeholder"
21
- :isError="isError"
22
- :inputWidth="inputWidth"
23
- :minWidth="minWidth"
24
- :value="value"
25
- @input="onChangeHandler"
26
- :noBorder="noBorder"
27
- :disabled="disabled"
28
- :isDisabled="disabled"
29
- :fontSize="fontSize"
30
- :inputType="inputType"
31
- :type="inputTypeData"
32
- />
33
- <icon-wrapper
34
- v-if="inputType === 'password' && !isError"
35
- @click="toggleShowPassword()"
36
- size="20px"
37
- >
38
- <icon name="current_variant" size="20px" />
39
- </icon-wrapper>
40
- <icon-wrapper v-if="isError" size="16px">
41
- <icon name="warning" size="16px" cursor="default" />
42
- </icon-wrapper>
43
- </icon-container>
44
- <error-message v-if="isError && errorMessage">{{
45
- errorMessage
46
- }}</error-message>
47
- </input-error-wrapper>
17
+ <icon-container>
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
+ :inputType="inputType"
30
+ :type="inputTypeData"
31
+ />
32
+ <icon-wrapper
33
+ v-if="inputType === 'password' && !isError"
34
+ @click="toggleShowPassword()"
35
+ size="20px"
36
+ >
37
+ <icon name="current_variant" size="20px" />
38
+ </icon-wrapper>
39
+ <icon-wrapper v-if="isError" size="16px">
40
+ <icon name="warning" size="16px" cursor="default" />
41
+ </icon-wrapper>
42
+ </icon-container>
48
43
  </input-wrapper>
44
+ <error-message v-if="isError">{{ errorMessage }}</error-message>
49
45
  </container>
50
46
  </template>
51
47
 
@@ -53,7 +49,6 @@
53
49
  import styled from 'vue-styled-components'
54
50
  import InfoText from '../../infoText'
55
51
  import Icon from '../../icon'
56
- import ErrorMessage from '../../errorMessage'
57
52
 
58
53
  const Container = styled.div`
59
54
  width: 100%;
@@ -74,13 +69,6 @@ const LabelWrapper = styled.div`
74
69
  justify-content: start;
75
70
  `
76
71
 
77
- const InputErrorWrapper = styled.div`
78
- display: inline-grid;
79
- grid-template-row: auto auto;
80
- grid-gap: 0px;
81
- align-items: center;
82
- `
83
-
84
72
  const inputProps = {
85
73
  isError: Boolean,
86
74
  inputWidth: String,
@@ -109,11 +97,7 @@ const InputContainer = styled('input', inputProps)`
109
97
  position: relative;
110
98
  font-size: ${(props) => (props.fontSize ? props.fontSize : '16px')};
111
99
  color: ${(props) =>
112
- props.isError
113
- ? props.theme.colors.red
114
- : props.isDisabled
115
- ? props.theme.colors.grey2
116
- : props.theme.colors.black};
100
+ props.isError ? props.theme.colors.red : props.theme.colors.black};
117
101
  width: ${(props) => (props.inputWidth ? props.inputWidth : '100%')};
118
102
  min-width: ${(props) => (props.minWidth ? props.minWidth : 'unset')};
119
103
  box-sizing: border-box; // to allow width of 100% with padding
@@ -142,6 +126,13 @@ const InputWrapper = styled('div', inputAttrs)`
142
126
  props.alignItems === 'vertical' || !props.hasLabel ? '1fr' : 'auto 1fr'};
143
127
  `
144
128
 
129
+ const ErrorMessage = styled.div`
130
+ font-size: 14px;
131
+ color: ${(props) => props.theme.colors.red};
132
+ position: absolute;
133
+ top: calc(100% + 1px);
134
+ `
135
+
145
136
  const IconAttrs = { size: String }
146
137
  const IconWrapper = styled('div', IconAttrs)`
147
138
  position: absolute;
@@ -184,8 +175,7 @@ export default {
184
175
  LabelWrapper,
185
176
  Icon,
186
177
  IconWrapper,
187
- IconContainer,
188
- InputErrorWrapper
178
+ IconContainer
189
179
  },
190
180
  data() {
191
181
  return {
@@ -12,7 +12,7 @@
12
12
  />
13
13
  <span class="checkmark"></span>
14
14
  <label-text :isDisabled="item.disabled">{{ item.label }}</label-text>
15
- <info-text v-if="item.infoText" :text="item.infoText" size="16px" />
15
+ <info-text v-if="item.infoText" :text="item.infoText" size="16" />
16
16
  </label-container>
17
17
  <image-container v-if="item.img">
18
18
  <radio-image :src="item.img" />
@@ -25,9 +25,8 @@
25
25
  // :value="companyName"
26
26
  // :disabled="true"
27
27
  // inputWidth="250px"
28
- // @on-change="function($event)"
29
28
  // />
30
- import styled from 'vue-styled-components'
29
+ import styled from "vue-styled-components"
31
30
 
32
31
  const Container = styled.div`
33
32
  width: 100%;
@@ -35,15 +34,15 @@ const Container = styled.div`
35
34
  `
36
35
 
37
36
  const inputAttrs = { isDisabled: Boolean, inputWidth: String }
38
- const InputContainer = styled('input', inputAttrs)`
37
+ const InputContainer = styled("input", inputAttrs)`
39
38
  border: 1px solid ${(props) => props.theme.colors.mediumGray};
40
39
  padding: 11px 30px 11px 10px;
41
40
  border-radius: 4px;
42
- font-size: 13px;
41
+ font-size: 16px;
43
42
  color: ${(props) => props.theme.colors.black};
44
- width: ${(props) => (props.inputWidth ? props.inputWidth : '100%')};
43
+ width: ${(props) => (props.inputWidth ? props.inputWidth : "100%")};
45
44
  box-sizing: border-box;
46
- cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'auto')};
45
+ cursor: ${(props) => (props.isDisabled ? "not-allowed" : "auto")};
47
46
  background: ${(props) => props.theme.colors.white} !important;
48
47
  &::placeholder {
49
48
  color: ${(props) => props.theme.colors.darkGray};
@@ -66,33 +65,33 @@ const InputWrapper = styled.span`
66
65
  `
67
66
 
68
67
  export default {
69
- name: 'search-input',
68
+ name: "search-input",
70
69
  components: {
71
70
  InputContainer,
72
71
  InputWrapper,
73
- Container
72
+ Container,
74
73
  },
75
74
  props: {
76
75
  value: {
77
- required: true
76
+ required: true,
78
77
  },
79
78
  disabled: {
80
79
  required: false,
81
- default: false
80
+ default: false,
82
81
  },
83
82
  placeholder: {
84
83
  required: false,
85
- default: ''
84
+ default: "",
86
85
  },
87
86
  inputWidth: {
88
87
  required: false,
89
- default: null
90
- }
88
+ default: null,
89
+ },
91
90
  },
92
91
  methods: {
93
92
  onChangeHandler(event) {
94
- this.$emit('on-change', event)
95
- }
96
- }
93
+ this.$emit("on-change", event)
94
+ },
95
+ },
97
96
  }
98
97
  </script>
@@ -10,7 +10,7 @@
10
10
  v-if="infoTextMessage"
11
11
  :text="infoTextMessage"
12
12
  borderColor="#ccc"
13
- size="16px"
13
+ size="16"
14
14
  :alignText="infoTextAlign"
15
15
  />
16
16
  </label-wrapper>
@@ -23,7 +23,6 @@
23
23
  :disabled="isDisabled"
24
24
  :fontSize="fontSize"
25
25
  @input="onChangeHandler"
26
- :resize="resize"
27
26
  />
28
27
  </input-wrapper>
29
28
  <error-message v-if="isError && errorText">{{ errorText }}</error-message>
@@ -45,11 +44,9 @@
45
44
  // label="Question 5"
46
45
  // alignItems="horizontal" // horizontal, vertical
47
46
  // :isDisabled="true"
48
- // . fontSize="13px"
49
47
  // />
50
48
  import styled from 'vue-styled-components'
51
49
  import InfoText from '../../infoText'
52
- import ErrorMessage from '../../errorMessage'
53
50
 
54
51
  const containerProps = { inputWidth: String }
55
52
  const Container = styled('div', containerProps)`
@@ -110,6 +107,13 @@ const InputWrapper = styled('div', inputAttrs)`
110
107
  : 'auto 1fr'};
111
108
  `
112
109
 
110
+ const ErrorMessage = styled.div`
111
+ font-size: 14px;
112
+ color: ${(props) => props.theme.colors.red};
113
+ position: absolute;
114
+ top: calc(100% + 1px);
115
+ `
116
+
113
117
  const labelAttrs = { fontSize: String }
114
118
  const InputLabel = styled('div', labelAttrs)`
115
119
  font-weight: bold;
@@ -171,10 +175,6 @@ export default {
171
175
  inputWidth: {
172
176
  required: false,
173
177
  default: null
174
- },
175
- resize: {
176
- required: false,
177
- default: 'none'
178
178
  }
179
179
  },
180
180
  methods: {
@@ -10,7 +10,7 @@
10
10
  v-if="infoTextMessage"
11
11
  :text="infoTextMessage"
12
12
  borderColor="#ccc"
13
- size="14px"
13
+ size="14"
14
14
  :alignText="infoTextAlign"
15
15
  />
16
16
  </label-container>
@@ -46,7 +46,7 @@
46
46
  v-if="infoTextMessage"
47
47
  :text="infoTextMessage"
48
48
  borderColor="#ccc"
49
- size="14px"
49
+ size="14"
50
50
  :alignText="infoTextAlign"
51
51
  />
52
52
  </label-container>
@@ -6,7 +6,7 @@
6
6
  <info-text
7
7
  :text="infoText"
8
8
  v-if="!!infoText"
9
- size="14px"
9
+ size="14"
10
10
  borderColor="#ccc"
11
11
  :alignText="alignInfoText"
12
12
  />
@@ -4,9 +4,6 @@ export const stringToNumber = ({
4
4
  allowNegative
5
5
  }) => {
6
6
  // This is for saving. It converts our input string to a readable number
7
- if (value === undefined) {
8
- value = ''
9
- }
10
7
  let newVal = value.toString()
11
8
  const selectedLang = localStorage.getItem('lang')
12
9
  // The first replace will replace not allowed characters with a blank
@@ -94,7 +91,6 @@ export const numberToString = ({ value, numberPrecision }) => {
94
91
  ? 'fr-fr'
95
92
  : localStorage.getItem('lang')
96
93
  : 'en-US'
97
- value=parseFloat(value)
98
94
  return value.toLocaleString(selectedLang, {
99
95
  minimumFractionDigits: numberPrecision,
100
96
  maximumFractionDigits: numberPrecision
@@ -1,62 +0,0 @@
1
- <template>
2
- <component-wrapper>
3
- <text-overlay>
4
- <slot></slot>
5
- </text-overlay>
6
- </component-wrapper>
7
- </template>
8
-
9
- <script>
10
- // import ErrorMessage from "@eturnity/eturnity_reusable_components/src/components/errorMessage"
11
- //To use:
12
- // <error-message
13
- // alignText="right" // default is left
14
- // />
15
-
16
- import styled from 'vue-styled-components'
17
-
18
- const TextOverlay = styled.div`
19
- position: absolute;
20
- top: calc(100% + 13px);
21
- background: ${(props) => props.theme.colors.red};
22
- padding: 10px;
23
- width: max-content;
24
- max-width: 100%;
25
- min-width: min-content;
26
- font-size: 11px;
27
- font-weight: 400;
28
- border-radius: 4px;
29
- font-family: 'Lato-Bold', Arial;
30
- z-index: 999;
31
- color: ${(props) => props.theme.colors.white};
32
-
33
- :before {
34
- content: '';
35
- background-color: ${(props) => props.theme.colors.red};
36
- position: absolute;
37
- top: 2px;
38
- left: 40px;
39
- height: 11px;
40
- width: 11px;
41
- transform-origin: center center;
42
- transform: translate(-2em, -0.5em) rotate(45deg);
43
- }
44
- `
45
-
46
- const ComponentWrapper = styled.div`
47
- display: block;
48
- `
49
-
50
- export default {
51
- name: 'info-text',
52
- components: {
53
- TextOverlay,
54
- ComponentWrapper
55
- },
56
- props: {},
57
- methods: {},
58
- data() {
59
- return {}
60
- }
61
- }
62
- </script>