@eturnity/eturnity_reusable_components 1.2.25 → 1.2.26-3d-master.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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.25",
3
+ "version": "1.2.26-3d-master.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
package/src/App.vue CHANGED
@@ -2,8 +2,13 @@
2
2
  <ThemeProvider :theme="getTheme()" :style="{ height: '100%' }">
3
3
  <page-container>
4
4
  <br />
5
- <!-- <modal backdrop="dark" :isLoading="false" :isOpen="false"> -->
6
- <!-- <main-table titleText="My Table">
5
+
6
+ <iconWrapper name="bell"/>
7
+ <modal backdrop="dark" :isLoading="false" :isOpen="true">
8
+
9
+ <modal backdrop="dark" :isLoading="false" :isOpen="false">
10
+
11
+ <main-table titleText="My Table">
7
12
  <thead>
8
13
  <tr>
9
14
  <th>Column 1</th>
@@ -58,6 +63,55 @@
58
63
  labelAlign="right"
59
64
  :disabled="false"
60
65
  />
66
+ <<<<<<< HEAD
67
+ <br />
68
+ >>>>>>> EPDM-5448
69
+ <input-number
70
+ :value="inputValue"
71
+ @input-change="inputValue = $event"
72
+ inputWidth="250px"
73
+ slotSize="50%"
74
+ ><InputAnnexContainer>
75
+ <span>123m2</span>
76
+ <info-text size="10px" alignArrow="right" text="infoText ceci est le text"></info-text>
77
+ </InputAnnexContainer>
78
+ </input-number>
79
+ <input-number
80
+ :value="inputValue"
81
+ @input-change="inputValue = $event"
82
+ inputWidth="250px"
83
+ slotSize="50%"
84
+ :isError="true"
85
+ ><InputAnnexContainer>
86
+ <span>123m2</span>
87
+ <info-text :style="{'justify-self': 'end'}" size="12px" alignArrow="center" text="infoText ceci est le text">This is the tooltip text</info-text>
88
+ </InputAnnexContainer>
89
+ </input-number>
90
+ <br />
91
+
92
+ <p>InputText</p>
93
+ <input-text
94
+ placeholder="Company name"
95
+ :value="inputValue"
96
+ :isError="true"
97
+ errorMessage="This is my error message"
98
+ infoTextAlign="right"
99
+ infoTextMessage="My info message"
100
+ label="Question 5"
101
+ alignItems="vertical"
102
+ inputWidth="250px"
103
+ minWidth="100px"
104
+ />
105
+ <br/>
106
+ <input-number
107
+ :value="num"
108
+ @input-change="num = $event"
109
+ unitName="t"
110
+ id="biebie"
111
+ test="koko"
112
+ @keydown="keydownHandler"
113
+ />
114
+ =======
61
115
  <br /> -->
62
116
  <iconCollection />
63
117
  <input-text
@@ -76,26 +130,30 @@
76
130
  :isDisabled="false"
77
131
  /> -->
78
132
  <!-- <external-button text="Click me!" minWidth="500px" /> -->
133
+ >>>>>>> master
79
134
  </page-container>
80
135
  </ThemeProvider>
81
136
  </template>
82
137
 
83
138
  <script>
84
- import { ThemeProvider } from 'vue-styled-components'
85
- import theme from './assets/theme'
86
- import styled from 'vue-styled-components'
87
- // import MainTable from '@/components/tables/mainTable'
88
- // import ThreeDots from '@/components/threeDots'
89
- // import Toggle from '@/components/inputs/toggle'
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'
139
+ import { ThemeProvider } from "vue-styled-components"
140
+ import theme from "./assets/theme"
141
+ import styled from "vue-styled-components"
142
+ import MainTable from "@/components/tables/mainTable"
143
+ import ThreeDots from "@/components/threeDots"
144
+ import Toggle from "@/components/inputs/toggle"
145
+ import InputNumber from "@/components/inputs/inputNumber"
146
+ import Checkbox from "@/components/inputs/checkbox"
147
+ import PageSubtitle from "@/components/pageSubtitle"
148
+ import Spinner from "@/components/spinner"
149
+ import ExternalButton from "@/components/buttons/externalButton"
150
+ import InputText from "@/components/inputs/inputText"
98
151
  // import TableDropdown from "@/components/tableDropdown"
152
+ const InputAnnexContainer = styled.div`
153
+ display: grid;
154
+ grid-template-columns: auto auto;
155
+ grid-gap: 10px;
156
+ `
99
157
 
100
158
  const PageContainer = styled.div`
101
159
  padding: 40px;
@@ -112,21 +170,21 @@ export default {
112
170
  components: {
113
171
  ThemeProvider,
114
172
  PageContainer,
115
- // MainTable,
116
- // ThreeDots,
117
- // Toggle,
173
+ InputNumber,
174
+ PageSubtitle,
175
+ Spinner,
176
+ Checkbox,
118
177
  InputText,
119
- // PageSubtitle,
120
- // Spinner,
121
- // Checkbox,
122
- // ExternalButton,
123
- // Modal,
124
- // ProjectMarker,
125
- iconCollection
126
- // RowContainer
178
+ ExternalButton,
179
+ iconWrapper,
180
+ Modal,
181
+ ProjectMarker,
182
+ iconCollection,
183
+ RowContainer
127
184
  },
128
185
  data() {
129
186
  return {
187
+ num: 42,
130
188
  inputValue: null,
131
189
  checkedOption: 'button_1',
132
190
  question: {
@@ -252,11 +310,8 @@ export default {
252
310
  }
253
311
  },
254
312
  methods: {
255
- consoleLog(data) {
256
- console.log(data)
257
- },
258
- gettext(string) {
259
- return string.toUpperCase()
313
+ keydownHandler(e) {
314
+ console.log('test', e)
260
315
  },
261
316
  getTheme() {
262
317
  return theme
@@ -0,0 +1,3 @@
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="0.75" y="0.75" width="12.5" height="12.5" stroke="white" stroke-width="1.5"/>
3
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M0 0L26 26H0V0Z" fill="#0068DE"/>
3
+ <line x1="12.4823" y1="20.4854" x2="4.70417" y2="12.7072" stroke="white" stroke-linecap="round"/>
4
+ <line x1="8.94524" y1="21.1924" x2="3.99549" y2="16.2427" stroke="white" stroke-linecap="round"/>
5
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M5.77451 5.87537C6.42348 5.2264 7.47566 5.2264 8.12463 5.87537C8.7736 6.52434 8.7736 7.57652 8.12463 8.22549L2.83685 13.5133C2.18788 14.1622 1.1357 14.1622 0.486727 13.5133C-0.162242 12.8643 -0.162242 11.8121 0.486727 11.1631L5.77451 5.87537Z" fill="white"/>
3
+ <path d="M13.9998 0L13.5544 1.14505C13.2528 1.92013 13.2528 2.78011 13.5544 3.5552L13.9998 4.70025L12.8548 4.25476C12.0797 3.9532 11.2197 3.9532 10.4446 4.25476L9.2996 4.70025L9.74509 3.5552C10.0466 2.78012 10.0466 1.92013 9.74509 1.14505L9.2996 0L10.4446 0.445491C11.2197 0.747047 12.0797 0.747047 12.8548 0.445491L13.9998 0Z" fill="white"/>
4
+ <path d="M12.3948 8.99997L12.3845 9.02637C12.0829 9.80146 12.0829 10.6614 12.3845 11.4365L12.3948 11.4629L12.3684 11.4527C11.5933 11.1511 10.7333 11.1511 9.9582 11.4527L9.9318 11.4629L9.94207 11.4365C10.2436 10.6614 10.2436 9.80146 9.94207 9.02637L9.9318 8.99997L9.9582 9.01024C10.7333 9.3118 11.5933 9.3118 12.3684 9.01024L12.3948 8.99997Z" fill="white"/>
5
+ <path d="M5.55927 0.5027L5.33136 1.0885C5.02981 1.86359 5.02981 2.72357 5.33136 3.49866L5.55927 4.08446L4.97347 3.85655C4.19839 3.55499 3.3384 3.55499 2.56332 3.85655L1.97752 4.08446L2.20543 3.49866C2.50698 2.72357 2.50698 1.86359 2.20543 1.0885L1.97752 0.5027L2.56332 0.730611C3.3384 1.03217 4.19839 1.03217 4.97347 0.730611L5.55927 0.5027Z" fill="white"/>
6
+ </svg>
@@ -1,3 +1,5 @@
1
- <svg fill="none" height="14" viewbox="13 13 14 14" width="14" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M21.3333 15V24H22.1281L21.9394 24.0809L17.6667 25.912L14 24.3406V14.5165L17.2727 15.9191L17.4614 16H16.6667V25H18.6667V16H17.8719L18.0606 15.9191L22.3333 14.088L26 15.6594V25.4835L22.7273 24.0809L22.5386 24H23.3333V15H21.3333Z" stroke="#B2B9C5" stroke-width="2"></path>
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M9 12L14 14V2L9 0L5 2L0 0V12L5 14L9 12ZM4.93167 12.3571L8.93167 10.3571L12.5 11.7845V3.01555L9.06834 1.64288L5.06834 3.64288L1.5 2.21555V10.9845L4.93167 12.3571Z" fill="white"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M4.25 13V3H5.75V13H4.25Z" fill="white"/>
4
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M8.25 11V1H9.75V11H8.25Z" fill="white"/>
3
5
  </svg>
@@ -0,0 +1,6 @@
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <!-- <rect x="0.75" y="0.75" width="12.5" height="12.5" stroke="white" stroke-width="1.5"/>
3
+ <rect x="4.5" y="4.5" width="5" height="5" stroke="white" stroke-width="1.5"/> -->
4
+ <path d="M0 0 h 14 v 14 h -14 v-12.5 h 1.5 v11 h11 v-11 h-12.5 Z" fill="red"></path>
5
+ <path d="M3 3 h 8 v 8 h -8 v-7.5 h1.5 v6 h5 v-5 h-6.5Z" fill="red"></path>
6
+ </svg>
@@ -1,13 +1,9 @@
1
- <svg fill="none" height="23" viewbox="6 12 34 23" width="34" xmlns="http://www.w3.org/2000/svg">
2
- <mask height="14" id="mask0_6458_86453" maskunits="userSpaceOnUse" style="mask-type:alpha" width="14" x="13" y="13">
3
- <rect fill="#FF5656" height="14" width="14" x="13" y="13"></rect>
4
- </mask>
5
- <g mask="url(#mask0_6458_86453)">
6
- <rect fill="#FF5656" height="1.55556" transform="rotate(-45 6.77783 21.6267)" width="21" x="6.77783" y="21.6267"></rect>
7
- <rect fill="#FF5656" height="1.55556" transform="rotate(-45 8.97803 23.8269)" width="21" x="8.97803" y="23.8269"></rect>
8
- <rect fill="#FF5656" height="1.55556" transform="rotate(-45 11.1777 26.0269)" width="21" x="11.1777" y="26.0269"></rect>
9
- <rect fill="#FF5656" height="1.55556" transform="rotate(-45 13.3774 28.2266)" width="21" x="13.3774" y="28.2266"></rect>
10
- <rect fill="#FF5656" height="1.55556" transform="rotate(-45 15.5771 30.4265)" width="21" x="15.5771" y="30.4265"></rect>
11
- <rect fill="#FF5656" height="1.55556" transform="rotate(-45 17.7773 32.6262)" width="21" x="17.7773" y="32.6262"></rect>
1
+ <svg fill="none" height="16" viewbox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg">
2
+ <defs>
3
+ <pattern id="pattern_Z6wSY" patternUnits="userSpaceOnUse" width="4" height="4" patternTransform="rotate(-45)">
4
+ <path d="M0 0 L 16 0 L 16 2 L 0 2 Z" fill="red" stroke-width="0"></path>
5
+ </pattern>
6
+ </defs>
7
+ <rect width="16" height="16" fill="url(#pattern_Z6wSY)" :opacity="1" />
12
8
  </g>
13
9
  </svg>
@@ -0,0 +1,11 @@
1
+ <svg width="15" height="16" viewBox="0 0 15 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="2.80078" y="4.06415" width="8" height="1.6" transform="rotate(90 2.80078 4.06415)" fill="white"/>
3
+ <rect x="7.00195" y="3.8642" width="4" height="1.6" transform="rotate(-180 7.00195 3.8642)" fill="white"/>
4
+ <path d="M8.5 3.07846L6.00098 0.935599L6.00098 5.22131L8.5 3.07846Z" fill="white"/>
5
+ <rect x="11.002" y="13.8643" width="8" height="1.6" transform="rotate(-180 11.002 13.8643)" fill="white"/>
6
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M2 4.06409C2.55228 4.06409 3 3.61637 3 3.06409C3 2.5118 2.55228 2.06409 2 2.06409C1.44772 2.06409 1 2.5118 1 3.06409C1 3.61637 1.44772 4.06409 2 4.06409ZM2 5.06409C3.10457 5.06409 4 4.16866 4 3.06409C4 1.95952 3.10457 1.06409 2 1.06409C0.895431 1.06409 0 1.95952 0 3.06409C0 4.16866 0.895431 5.06409 2 5.06409Z" fill="white"/>
7
+ <rect x="12.7988" y="4.06433" width="8" height="1.6" transform="rotate(90 12.7988 4.06433)" fill="white"/>
8
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M12.002 4.06421C12.5542 4.06421 13.002 3.61649 13.002 3.06421C13.002 2.51192 12.5542 2.06421 12.002 2.06421C11.4497 2.06421 11.002 2.51192 11.002 3.06421C11.002 3.61649 11.4497 4.06421 12.002 4.06421ZM12.002 5.06421C13.1065 5.06421 14.002 4.16878 14.002 3.06421C14.002 1.95964 13.1065 1.06421 12.002 1.06421C10.8974 1.06421 10.002 1.95964 10.002 3.06421C10.002 4.16878 10.8974 5.06421 12.002 5.06421Z" fill="white"/>
9
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M12.002 14.0643C12.5542 14.0643 13.002 13.6166 13.002 13.0643C13.002 12.512 12.5542 12.0643 12.002 12.0643C11.4497 12.0643 11.002 12.512 11.002 13.0643C11.002 13.6166 11.4497 14.0643 12.002 14.0643ZM12.002 15.0643C13.1065 15.0643 14.002 14.1688 14.002 13.0643C14.002 11.9597 13.1065 11.0643 12.002 11.0643C10.8974 11.0643 10.002 11.9597 10.002 13.0643C10.002 14.1688 10.8974 15.0643 12.002 15.0643Z" fill="white"/>
10
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M2 14.0644C2.55228 14.0644 3 13.6167 3 13.0644C3 12.5121 2.55228 12.0644 2 12.0644C1.44772 12.0644 1 12.5121 1 13.0644C1 13.6167 1.44772 14.0644 2 14.0644ZM2 15.0644C3.10457 15.0644 4 14.169 4 13.0644C4 11.9598 3.10457 11.0644 2 11.0644C0.895431 11.0644 0 11.9598 0 13.0644C0 14.169 0.895431 15.0644 2 15.0644Z" fill="white"/>
11
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg width="14" height="10" viewBox="0 0 14 10" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M4.51904 2H10.519V4H4.51904V2Z" fill="#555D61"/>
3
+ <path d="M4.51904 8H8.51904V10H4.51904V8Z" fill="#555D61"/>
4
+ <path d="M10.519 5.92321L13.4807 2.96161L10.519 0L10.519 5.92321Z" fill="#555D61"/>
5
+ <path d="M7.98391 8C7.29229 9.1956 5.99961 10 4.51904 10C2.3099 10 0.519043 8.20914 0.519043 6C0.519043 3.79086 2.3099 2 4.51904 2C5.99961 2 7.2923 2.8044 7.98391 4H4.51904C3.41447 4 2.51904 4.89543 2.51904 6C2.51904 7.10457 3.41447 8 4.51904 8H7.98391Z" fill="#555D61"/>
6
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M0 0L26 26H0V0Z" fill="#0068DE"/>
3
+ <line x1="12.4823" y1="20.4854" x2="4.70417" y2="12.7072" stroke="white" stroke-linecap="round"/>
4
+ <line x1="8.94524" y1="21.1924" x2="3.99549" y2="16.2427" stroke="white" stroke-linecap="round"/>
5
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M0 10 L7 0 L14 10" fill="none" stroke="white" stroke-width="1.5"/>
3
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg width="14" height="10" viewBox="0 0 14 10" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M9.48096 2H3.48096V4H9.48096V2Z" fill="white"/>
3
+ <path d="M9.48096 8H5.48096V10H9.48096V8Z" fill="white"/>
4
+ <path d="M3.48096 5.92321L0.519349 2.96161L3.48096 0L3.48096 5.92321Z" fill="white"/>
5
+ <path d="M6.01609 8C6.70771 9.1956 8.00039 10 9.48096 10C11.6901 10 13.481 8.20914 13.481 6C13.481 3.79086 11.6901 2 9.48096 2C8.00039 2 6.7077 2.8044 6.01609 4H9.48096C10.5855 4 11.481 4.89543 11.481 6C11.481 7.10457 10.5855 8 9.48096 8H6.01609Z" fill="white"/>
6
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M6.96161 0L10.9232 3.96161L7.96713 3.96161V6.55264L12.3875 9.0786L14 10L12.3875 10.9214L7 14L1.61245 10.9214L0 10L1.61245 9.0786L5.99272 6.57559V3.96161L3 3.96161L6.96161 0ZM5.99272 8.41839L3.2249 10L7 12.1572L10.7751 10L7.96713 8.39545V9.78795H5.99272V8.41839Z" fill="white"/>
3
+ </svg>
@@ -19,6 +19,8 @@ const theme = {
19
19
  grey4: '#dee2eb',
20
20
  grey5: '#fafafa',
21
21
  green: '#99db0c',
22
+ transparentWhite1:'#ffffff32',
23
+ transparentBlack1:'#263238e6',
22
24
  disabled: '#dfe1e1'
23
25
  },
24
26
  screen: {
@@ -0,0 +1,62 @@
1
+ <template>
2
+ <component-wrapper>
3
+ <text-overlay>
4
+ <slot></slot>
5
+ </text-overlay>
6
+ </component-wrapper>
7
+ </template>
8
+
9
+ <script>
10
+ // import InfoText from "@eturnity/eturnity_reusable_components/src/components/infoText"
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: 200px;
26
+ font-size: 11px;
27
+ font-weight: 400;
28
+ border-radius: 4px;
29
+ font-family: 'Lato-Bold', Arial;
30
+ z-index: 10;
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>
@@ -1,6 +1,7 @@
1
1
  <template>
2
- <wrapper :isDisabled="isDisabled" :size="size" :cursor="cursor">
2
+ <Wrapper :isDisabled="disabled" :size="size" :cursor="cursor">
3
3
  <icon-image
4
+ :disabled="disabled"
4
5
  :size="size"
5
6
  :color="color"
6
7
  :hoveredColor="hoveredColor"
@@ -8,7 +9,7 @@
8
9
  require(`!html-loader!./../../assets/svgIcons/${name.toLowerCase()}.svg`)
9
10
  "
10
11
  ></icon-image>
11
- </wrapper>
12
+ </Wrapper>
12
13
  </template>
13
14
 
14
15
  <script>
@@ -35,14 +36,14 @@ const Wrapper = styled('div', wrapperAttrs)`
35
36
  const IconImageProps = { color: String, hoveredColor: String, size: String }
36
37
  const IconImage = styled('div', IconImageProps)`
37
38
  svg {
38
- width: ${(props) => props.size};
39
- height: ${(props) => props.size};
39
+ width: 100%;
40
+ height: 100%;
40
41
  }
41
- svg > path {
42
+ svg path {
42
43
  ${(props) =>
43
44
  props.color && `fill: ${props.theme.colors[props.color] || props.color};`}
44
45
  }
45
- &:hover > svg > path {
46
+ &:hover > svg path {
46
47
  ${(props) => props.hoveredColor && `fill: ${props.hoveredColor};`}
47
48
  }
48
49
  `
@@ -50,11 +51,11 @@ const IconImage = styled('div', IconImageProps)`
50
51
  export default {
51
52
  name: 'icon',
52
53
  components: {
53
- Wrapper,
54
- IconImage
54
+ IconImage,
55
+ Wrapper
55
56
  },
56
57
  props: {
57
- isDisabled: {
58
+ disabled: {
58
59
  required: false,
59
60
  default: false
60
61
  },
@@ -73,7 +74,7 @@ export default {
73
74
  },
74
75
  cursor: {
75
76
  required: false,
76
- default: 'pointer'
77
+ default: null
77
78
  }
78
79
  },
79
80
  data() {
@@ -0,0 +1,116 @@
1
+ <template>
2
+ <Wrapper
3
+ :disabled="disabled"
4
+ :size="size"
5
+ :backgroundColor="backgroundColor"
6
+ :borderRadius="borderRadius"
7
+ :hoveredBackgroundColor="hoveredBackgroundColor"
8
+ :isHovered="isHovered"
9
+ >
10
+ <icon :disabled="disabled"
11
+ :size="iconSize"
12
+ :name="name"
13
+ :color="iconColor"
14
+ :hoveredColor="hoveredIconColor" />
15
+ <caret v-if="hasCaret">
16
+ <iconWrapper :disabled="disabled"
17
+ size="10px"
18
+ name="arrow_down"
19
+ :iconColor="iconColor"
20
+ :hoveredBackgroundColor="hoveredIconColor"
21
+ borderRadius="1px"
22
+ />
23
+ </caret>
24
+ </Wrapper>
25
+ </template>
26
+
27
+ <script>
28
+ // import Icon from "@eturnity/eturnity_reusable_components/src/components/icon"
29
+ // How to use:
30
+ //<icon
31
+ // name="House" //required. a svg file named [name].svg should be present in /assets/svgIcons
32
+ // color="red"
33
+ // hoveredColor="blue"
34
+ // size="60px" by default, this is 30px
35
+ // />
36
+
37
+ import styled from 'vue-styled-components'
38
+ import icon from '../icon'
39
+ const wrapperAttrs = { isHovered:Boolean,borderRadius:String,disabled: Boolean, size: String,backgroundColor:String,hoveredBackgroundColor:String }
40
+ const Wrapper = styled('div', wrapperAttrs)`
41
+ position:relative;
42
+ display: inline-flex;
43
+ width: ${(props) => props.size};
44
+ height: ${(props) => props.size};
45
+ justify-content:center;
46
+ align-items:center;
47
+ cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};
48
+ background-color: ${(props)=>props.theme.colors[props.backgroundColor] || props.backgroundColor};
49
+ border-radius: ${(props) => props.borderRadius};
50
+ ${(props)=>(props.isHovered ? 'background-color:'+props.theme.colors[props.hoveredBackgroundColor] || props.hoveredBackgroundColor : "")};
51
+ &:hover{
52
+ background-color:${(props)=>props.theme.colors[props.hoveredBackgroundColor] || props.hoveredBackgroundColor};
53
+ }
54
+ `
55
+ const caret=styled.div`
56
+ position:absolute;
57
+ bottom:3px;
58
+ right:2px;
59
+ height:10px;
60
+ `
61
+
62
+ export default {
63
+ name: 'iconWrapper',
64
+ components: {
65
+ Wrapper,
66
+ icon,
67
+ caret
68
+ },
69
+ props: {
70
+ disabled: {
71
+ required: false,
72
+ default: false
73
+ },
74
+ name: {
75
+ required: true
76
+ },
77
+ iconColor: {
78
+ required: false,
79
+ default: 'white'
80
+ },
81
+ hoveredIconColor: {
82
+ required: false
83
+ },
84
+ backgroundColor: {
85
+ required: false,
86
+ },
87
+ hoveredBackgroundColor: {
88
+ required: false,
89
+ default:"transparentWhite1"
90
+ },
91
+ size: {
92
+ required: false,
93
+ default: '32px'
94
+ },
95
+ iconSize:{
96
+ required: false,
97
+ default:'18px'
98
+ },
99
+ hasCaret:{
100
+ required: false,
101
+ default: false
102
+ },
103
+ borderRadius:{
104
+ required:false,
105
+ default:'6px'
106
+ },
107
+ isHovered:{
108
+ required:false,
109
+ default:false
110
+ }
111
+ },
112
+ data() {
113
+ return {}
114
+ }
115
+ }
116
+ </script>
@@ -1,34 +1,25 @@
1
1
  <template>
2
2
  <component-wrapper>
3
- <icon-wrapper>
3
+ <icon-wrapper :size="size">
4
4
  <icon-img
5
5
  :isActive="showInfo"
6
6
  :size="size"
7
7
  :borderColor="borderColor"
8
8
  @click.prevent="toggleShowInfo()"
9
- @mouseenter="toggleShowInfo()"
10
- @mouseleave="toggleShowInfo()"
9
+ @mouseenter="openTrigger == 'onHover' ? toggleShowInfo() : ''"
10
+ @mouseleave="openTrigger == 'onHover' ? toggleShowInfo() : ''"
11
11
  >
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>
12
+ <icon :size="size" name="info" :color="iconColor" />
26
13
  </icon-img>
27
14
  <text-overlay
28
15
  v-if="showInfo"
29
16
  :borderColor="borderColor"
30
17
  :alignText="alignText"
31
- >
18
+ :width="width"
19
+ :halfComputedTextInfoWidth="halfComputedTextInfoWidth"
20
+ :alignArrow="alignArrow"
21
+ :iconSize="size"
22
+ ><slot />
32
23
  {{ text }}
33
24
  </text-overlay>
34
25
  </icon-wrapper>
@@ -44,22 +35,23 @@
44
35
  // size="20"
45
36
  // alignText="right" // default is left
46
37
  // />
38
+ import theme from '../../assets/theme.js'
39
+ import styled from 'vue-styled-components'
40
+ import icon from '../icon'
47
41
 
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)`
42
+ const textAttrs = { iconSize:String, borderColor: String, alignArrow:String, alignText: String, width:String,halfComputedTextInfoWidth:Number }
43
+ const TextOverlay = styled('div', textAttrs)`
56
44
  position: absolute;
57
- top: 26px;
58
- right: ${(props) => (props.alignText === "left" ? "-10px" : "inherit")};
59
- left: ${(props) => (props.alignText === "left" ? "inherit" : "-10px")};
45
+ top: ${(props) => 'calc('+props.iconSize+' + 15px)'};
46
+ ${(props) => (props.alignArrow === 'left'
47
+ ? 'left: calc('+props.iconSize+' /2 - 18px)'
48
+ : props.alignArrow === 'center'
49
+ ? 'left: calc((-'+props.width+' + '+props.iconSize+') /2 + 2px)'
50
+ : 'right: calc('+props.iconSize+' /2 - 17px)')};
51
+ text-align: ${(props) => props.alignText};
60
52
  background: ${(props) => props.theme.colors.black};
61
53
  padding: 10px;
62
- width: max-content;
54
+ width: ${(props) => props.width };
63
55
  max-width: 400px;
64
56
  font-size: 13px;
65
57
  font-weight: 400;
@@ -68,12 +60,13 @@ const TextOverlay = styled("div", textAttrs)`
68
60
  color: ${(props) => props.theme.colors.white};
69
61
 
70
62
  :before {
71
- content: "";
63
+ content: '';
72
64
  background-color: ${(props) => props.theme.colors.black};
73
65
  position: absolute;
74
66
  top: 2px;
75
- right: ${(props) => (props.alignText === "left" ? "-12px" : "inherit")};
76
- left: ${(props) => (props.alignText === "left" ? "inherit" : "40px")};
67
+ ${(props) => (props.alignArrow === 'left' ? 'left:40px;' :
68
+ props.alignArrow=='center' ? 'left: calc(50% + 19px);' :
69
+ 'right:-13px;')};
77
70
  height: 8px;
78
71
  width: 8px;
79
72
  transform-origin: center center;
@@ -82,18 +75,15 @@ const TextOverlay = styled("div", textAttrs)`
82
75
  `
83
76
 
84
77
  const iconAttrs = { isActive: Boolean, size: String, borderColor: String }
85
- const IconImg = styled("div", iconAttrs)`
86
- cursor: pointer;
87
- height: ${(props) => props.size + "px"};
88
78
 
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
- }
79
+ const IconWrapper = styled('div', iconAttrs)`
80
+ position: relative;
81
+ top: 1px;
82
+ height: ${(props) => props.size};
83
+ `
84
+ const IconImg = styled('div', iconAttrs)`
85
+ cursor: pointer;
86
+ height: ${(props) => props.size};
97
87
  `
98
88
 
99
89
  const ComponentWrapper = styled.div`
@@ -101,38 +91,51 @@ const ComponentWrapper = styled.div`
101
91
  `
102
92
 
103
93
  export default {
104
- name: "info-text",
94
+ name: 'info-text',
105
95
  components: {
106
96
  IconWrapper,
107
97
  TextOverlay,
108
98
  ComponentWrapper,
109
99
  IconImg,
100
+ icon
110
101
  },
111
102
  props: {
112
103
  text: {
113
- required: true,
104
+ required: false,
114
105
  },
115
106
  borderColor: {
116
107
  required: false,
117
- default: null,
108
+ default: null
118
109
  },
119
110
  size: {
120
111
  required: false,
121
- default: "20",
112
+ default: '14px'
122
113
  },
123
114
  alignText: {
124
115
  required: false,
125
- default: "left", // "left" or "right"
116
+ default: 'left' // "left" or "right"
117
+ },
118
+ alignArrow:{
119
+ required:false,
120
+ default:'center'
121
+ },
122
+ openTrigger:{
123
+ required:false,
124
+ default: 'onClick'
126
125
  },
126
+ width:{
127
+ required:false,
128
+ default:'165px'
129
+ }
127
130
  },
128
131
  methods: {
129
132
  toggleShowInfo() {
130
133
  this.showInfo = !this.showInfo
131
134
 
132
135
  if (this.showInfo) {
133
- document.addEventListener("click", this.clickOutside)
136
+ document.addEventListener('click', this.clickOutside)
134
137
  } else {
135
- document.removeEventListener("click", this.clickOutside)
138
+ document.removeEventListener('click', this.clickOutside)
136
139
  }
137
140
  },
138
141
  clickOutside(event) {
@@ -140,12 +143,24 @@ export default {
140
143
  return
141
144
  }
142
145
  this.toggleShowInfo()
143
- },
146
+ }
144
147
  },
145
148
  data() {
146
149
  return {
147
150
  showInfo: false,
148
151
  }
149
152
  },
153
+ computed: {
154
+ iconColor() {
155
+ return this.isActive
156
+ ? this.borderColor
157
+ ? this.borderColor
158
+ : theme.colors.secondary
159
+ : theme.colors.mediumGray
160
+ },
161
+ halfComputedTextInfoWidth() {
162
+ return parseInt(this.width)/2;
163
+ }
164
+ }
150
165
  }
151
- </script>
166
+ </script>
@@ -1,5 +1,10 @@
1
1
  <template>
2
- <container>
2
+ <container :inputWidth="inputWidth" :alignItems="alignItems">
3
+ <label-slot-wrapper v-if="hasLabelSlot" :isInteractive="isInteractive" @mousedown="initInteraction">
4
+
5
+ <slot name="label"></slot>
6
+ </label-slot-wrapper>
7
+
3
8
  <label-wrapper v-if="labelText">
4
9
  <label-text>
5
10
  {{ labelText }}
@@ -8,35 +13,51 @@
8
13
  v-if="labelInfoText"
9
14
  :text="labelInfoText"
10
15
  borderColor="#ccc"
11
- size="13"
16
+ size="14px"
12
17
  :alignText="labelInfoAlign"
13
18
  />
14
19
  </label-wrapper>
15
20
  <input-wrapper>
16
21
  <input-container
22
+ v-bind="$attrs"
17
23
  ref="inputField1"
18
24
  :hasUnit="unitName && !!unitName.length"
19
- :placeholder="placeholder"
25
+ :placeholder="displayedPlaceholder"
20
26
  :isError="isError"
21
27
  :inputWidth="inputWidth"
28
+ :inputHeight="inputHeight"
22
29
  :minWidth="minWidth"
23
30
  :value="formatWithCurrency(value)"
24
31
  @blur="onInputBlur($event)"
25
32
  @focus="focusInput()"
26
33
  @keyup.enter="$emit('on-enter-click')"
34
+ @input="onInput($event)"
27
35
  :disabled="disabled"
28
36
  :isDisabled="disabled"
29
37
  :noBorder="noBorder"
30
38
  :textAlign="textAlign"
31
39
  :fontSize="fontSize"
32
40
  :fontColor="fontColor"
41
+ :backgroundColor="backgroundColor"
42
+ v-on="$listeners"
43
+ :hasSlot="hasSlot"
44
+ :slotSize="slotSize"
33
45
  />
46
+ <slot-container v-if="hasSlot" :slotSize="slotSize" :isError="isError">
47
+ <slot></slot>
48
+ </slot-container>
49
+
34
50
  <unit-container
35
- v-if="unitName && showLinearUnitName"
51
+ v-if="unitName && showLinearUnitName && !hasSlot"
36
52
  :hasLength="!!textInput.length"
37
53
  :isError="isError"
38
54
  >{{ unitName }}</unit-container
39
55
  >
56
+ <icon
57
+ v-if="(isError || inputIcon) && !showLinearUnitName"
58
+ :class="inputIconImageClass"
59
+ :src="isError ? warningIcon : inputIconImage"
60
+ />
40
61
  </input-wrapper>
41
62
  <error-message v-if="isError">{{ errorMessage }}</error-message>
42
63
  </container>
@@ -74,11 +95,8 @@ import {
74
95
  numberToString
75
96
  } from '../../../helpers/numberConverter'
76
97
  import InfoText from '../../infoText'
77
-
78
- const Container = styled.div`
79
- width: 100%;
80
- position: relative;
81
- `
98
+ import ErrorMessage from '../../errorMessage'
99
+ import warningIcon from '../../../assets/icons/error_icon.png'
82
100
 
83
101
  const inputProps = {
84
102
  isError: Boolean,
@@ -89,8 +107,23 @@ const inputProps = {
89
107
  noBorder: Boolean,
90
108
  textAlign: String,
91
109
  fontSize: String,
92
- fontColor: String
110
+ fontColor: String,
111
+ backgroundColor:String,
112
+ hasSlot: Boolean,
113
+ slotSize: String,
114
+ inputHeight:String,
115
+ isInteractive:Boolean,
116
+ alignItems:String
93
117
  }
118
+
119
+ const Container = styled('div', inputProps)`
120
+ width: ${(props) => (props.inputWidth ? props.inputWidth : '100%')};
121
+ position: relative;
122
+ display:grid;
123
+ grid-template-columns: ${(props) =>
124
+ props.alignItems === "vertical" ? "1fr" : "auto 1fr"};
125
+ `
126
+
94
127
  const InputContainer = styled('input', inputProps)`
95
128
  border: ${(props) =>
96
129
  props.isError
@@ -98,8 +131,13 @@ const InputContainer = styled('input', inputProps)`
98
131
  : props.noBorder
99
132
  ? 'none'
100
133
  : '1px solid ' + props.theme.colors.mediumGray};
101
- padding: ${(props) =>
102
- props.hasUnit ? '11px 40px 11px 10px' : '11px 5px 11px 10px'};
134
+ padding-top: 11px;
135
+ padding-bottom: 11px;
136
+ padding-left: 10px;
137
+ padding-right: ${(props) =>
138
+ props.slotSize
139
+ ? 'calc(' + props.slotSize + ' + 10px)'
140
+ : '5px'};
103
141
  border-radius: 4px;
104
142
  text-align: ${(props) => props.textAlign};
105
143
  cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'auto')};
@@ -110,12 +148,15 @@ const InputContainer = styled('input', inputProps)`
110
148
  : props.fontColor
111
149
  ? props.fontColor + ' !important'
112
150
  : props.theme.colors.black};
151
+ background-color:${(props) => props.backgroundColor
152
+ ? props.backgroundColor+' !important'
153
+ : props.theme.colors.white};
113
154
  width: ${(props) => (props.inputWidth ? props.inputWidth : '100%')};
114
155
  min-width: ${(props) => (props.minWidth ? props.minWidth : 'unset')};
115
156
  background-color: ${(props) =>
116
157
  props.isDisabled ? props.theme.colors.grey5 : '#fff'};
117
158
  box-sizing: border-box;
118
-
159
+ max-height: ${(props) => (props.inputHeight)};
119
160
  &::placeholder {
120
161
  color: ${(props) =>
121
162
  props.isError ? props.theme.colors.red : props.theme.colors.darkGray};
@@ -125,6 +166,15 @@ const InputContainer = styled('input', inputProps)`
125
166
  outline: none;
126
167
  }
127
168
  `
169
+ const IconProps = {
170
+ inputIconHeight: String
171
+ }
172
+
173
+ const Icon = styled('img', IconProps)`
174
+ position: absolute;
175
+ right: 10px;
176
+ top: 2px;
177
+ `
128
178
 
129
179
  const InputWrapper = styled.span`
130
180
  position: relative;
@@ -142,6 +192,7 @@ const UnitContainer = styled('span', inputProps)`
142
192
  right: 10px;
143
193
  top: 0;
144
194
  padding-left: 10px;
195
+ text-align: right;
145
196
  color: ${(props) =>
146
197
  props.isError
147
198
  ? props.theme.colors.red
@@ -150,17 +201,40 @@ const UnitContainer = styled('span', inputProps)`
150
201
  : props.theme.colors.mediumGray};
151
202
  `
152
203
 
153
- const ErrorMessage = styled.div`
154
- font-size: 14px;
155
- color: ${(props) => props.theme.colors.red};
204
+ const SlotContainer = styled('span', inputProps)`
205
+ text-align: right;
206
+ border-left: 1px solid
207
+ ${(props) =>
208
+ props.isError
209
+ ? props.theme.colors.red
210
+ : props.hasLength
211
+ ? props.theme.colors.black
212
+ : props.theme.colors.mediumGray};
156
213
  position: absolute;
157
- top: calc(100% + 1px);
214
+ width: ${(props) =>
215
+ props.slotSize ? 'calc(' + props.slotSize + ' - 10px)' : 'fit-content'};
216
+ right: 10px;
217
+ top: 0;
218
+ padding-left: 10px;
219
+ color: ${(props) =>
220
+ props.isError
221
+ ? props.theme.colors.red
222
+ : props.hasLength
223
+ ? props.theme.colors.black
224
+ : props.theme.colors.mediumGray};
158
225
  `
159
226
 
160
- const LabelWrapper = styled.div`
227
+ const LabelWrapper = styled('div',inputProps)`
161
228
  display: flex;
162
229
  gap: 10px;
163
230
  margin-bottom: 8px;
231
+ cursor: ${(props) => (props.isInteractive?'ew-resize':'auto')};
232
+ `
233
+ const LabelSlotWrapper = styled('div',inputProps)`
234
+ display: flex;
235
+ gap: 10px;
236
+ align-items:center;
237
+ cursor: ${(props) => (props.isInteractive?'ew-resize':'auto')};
164
238
  `
165
239
 
166
240
  const LabelText = styled.div`
@@ -177,13 +251,18 @@ export default {
177
251
  UnitContainer,
178
252
  ErrorMessage,
179
253
  LabelWrapper,
254
+ LabelSlotWrapper,
180
255
  LabelText,
181
- InfoText
256
+ InfoText,
257
+ Icon,
258
+ SlotContainer,
182
259
  },
260
+ inheritAttrs: false,
183
261
  data() {
184
262
  return {
185
263
  textInput: '',
186
- isFocused: false
264
+ isFocused: false,
265
+ warningIcon: warningIcon,
187
266
  }
188
267
  },
189
268
  props: {
@@ -203,6 +282,10 @@ export default {
203
282
  required: false,
204
283
  default: null
205
284
  },
285
+ inputHeight:{
286
+ required:false,
287
+ default:null
288
+ },
206
289
  value: {
207
290
  required: true,
208
291
  default: null
@@ -211,6 +294,10 @@ export default {
211
294
  required: false,
212
295
  default: false
213
296
  },
297
+ alignItems: {
298
+ required: false,
299
+ default: "vertical",
300
+ },
214
301
  errorMessage: {
215
302
  required: false,
216
303
  default: 'Please insert a correct number'
@@ -243,6 +330,14 @@ export default {
243
330
  required: false,
244
331
  default: '13px'
245
332
  },
333
+ isInteractive: {
334
+ required: false,
335
+ default: false
336
+ },
337
+ interactionStep:{
338
+ required:false,
339
+ default:1
340
+ },
246
341
  labelText: {
247
342
  required: false,
248
343
  default: null
@@ -253,7 +348,7 @@ export default {
253
348
  },
254
349
  labelInfoAlign: {
255
350
  required: false,
256
- default: 'right'
351
+ default: 'left'
257
352
  },
258
353
  minNumber: {
259
354
  required: false,
@@ -263,14 +358,51 @@ export default {
263
358
  required: false,
264
359
  default: null
265
360
  },
361
+ backgroundColor: {
362
+ required: false,
363
+ default: null
364
+ },
266
365
  numberToStringEnabled: {
267
366
  required: false,
268
367
  default: true
368
+ },
369
+ inputIcon: {
370
+ require: false,
371
+ type: Boolean,
372
+ default: false
373
+ },
374
+ inputIconImage: {
375
+ require: false,
376
+ type: String,
377
+ default: ''
378
+ },
379
+ inputIconImageClass: {
380
+ require: false,
381
+ type: Array,
382
+ default: () => []
383
+ },
384
+ slotSize: {
385
+ required: false
386
+ }
387
+ },
388
+ computed: {
389
+ displayedPlaceholder() {
390
+ if (this.placeholder) return this.placeholder
391
+ return `${this.minNumber || 0} ${this.unitName ? this.unitName : ''}`
392
+ },
393
+ hasSlot() {
394
+ return !!this.$slots.default
395
+ },
396
+ hasLabelSlot(){
397
+ return !!this.$slots.label
398
+ },
399
+ computedSlotSize() {
400
+ return this.slotSize || this.$slots['default'][0].elm.clientWidth
269
401
  }
270
402
  },
271
403
  methods: {
272
404
  onChangeHandler(event) {
273
- if (isNaN(event)) {
405
+ if (isNaN(event) || event=="") {
274
406
  event = this.minNumber || this.minNumber === 0 ? this.minNumber : event
275
407
  }
276
408
  this.$emit('input-change', event)
@@ -305,9 +437,15 @@ export default {
305
437
  value: evaluated,
306
438
  numberPrecision: this.numberPrecision
307
439
  })
440
+ }else if(typeof evaluated === 'number'){
441
+ evaluated=evaluated.toFixed(this.numberPrecision)
308
442
  }
309
443
  return evaluated
310
444
  },
445
+ onInput(value){
446
+ let evaluatedInput = this.onEvaluateCode(value)
447
+ this.$emit('on-input',evaluatedInput)
448
+ },
311
449
  onInputBlur(e) {
312
450
  this.isFocused = false
313
451
  let value = e.target.value
@@ -321,11 +459,11 @@ export default {
321
459
  })
322
460
  }
323
461
  let adjustedMinValue =
324
- value && value.length
325
- ? value
462
+ evaluatedInput && evaluatedInput.length
463
+ ? evaluatedInput
326
464
  : this.minNumber || this.minNumber === 0
327
465
  ? this.minNumber
328
- : ''
466
+ : ''
329
467
  this.$emit('input-blur', adjustedMinValue)
330
468
  },
331
469
  focusInput() {
@@ -336,6 +474,7 @@ export default {
336
474
  this.$nextTick(() => {
337
475
  this.$refs.inputField1.$el.select()
338
476
  })
477
+ this.$emit('input-focus')
339
478
  },
340
479
  formatWithCurrency(value) {
341
480
  let adjustedMinValue =
@@ -352,6 +491,7 @@ export default {
352
491
  })
353
492
  : adjustedMinValue
354
493
  let unit = this.showLinearUnitName ? '' : this.unitName
494
+ //return input + ' ' + unit
355
495
  return input + ' ' + unit
356
496
  } else if (!adjustedMinValue && adjustedMinValue !== 0) {
357
497
  return ''
@@ -363,7 +503,34 @@ export default {
363
503
  })
364
504
  : adjustedMinValue
365
505
  }
366
- }
506
+ },
507
+ initInteraction(e) {
508
+ console.log('InitInteract')
509
+ window.addEventListener('mousemove', this.interact, false);
510
+ window.addEventListener('mouseup', this.stopInteract, false);
511
+ e.preventDefault()
512
+ },
513
+ interact(e) {
514
+ e.preventDefault()
515
+
516
+ let value=parseInt(this.value)
517
+
518
+ value+=this.parseInt(this.interactionStep)*parseInt(e.movementX)
519
+ this.$emit('on-input',value)
520
+
521
+ console.log('interact',this.value,value)
522
+ this.textInput=numberToString({
523
+ value:
524
+ value && value.length ? value : this.minNumber,
525
+ numberPrecision: this.numberPrecision
526
+ })
527
+ //this.value=value
528
+ },
529
+ stopInteract(e) {
530
+ e.preventDefault()
531
+ window.removeEventListener('mousemove', this.interact, false);
532
+ window.removeEventListener('mouseup', this.stopInteract, false);
533
+ },
367
534
  },
368
535
  created() {
369
536
  if (this.value) {
@@ -387,4 +554,4 @@ export default {
387
554
  }
388
555
  }
389
556
  }
390
- </script>
557
+ </script>
@@ -10,7 +10,7 @@
10
10
  v-if="infoTextMessage"
11
11
  :text="infoTextMessage"
12
12
  borderColor="#ccc"
13
- :size="fontSize ? fontSize : '16'"
13
+ :size="fontSize ? fontSize : '16px'"
14
14
  :alignText="infoTextAlign"
15
15
  />
16
16
  </label-wrapper>
@@ -41,7 +41,6 @@
41
41
  </icon-wrapper>
42
42
  </icon-container>
43
43
  </input-wrapper>
44
- <error-message v-if="isError">{{ errorMessage }}</error-message>
45
44
  </container>
46
45
  </template>
47
46
 
@@ -54,7 +53,12 @@ const Container = styled.div`
54
53
  width: 100%;
55
54
  position: relative;
56
55
  `
57
-
56
+ const InputErrorWrapper = styled.div`
57
+ display: inline-grid;
58
+ grid-template-row: auto auto;
59
+ grid-gap: 0px;
60
+ align-items: center;
61
+ `
58
62
  const labelAttrs = { fontSize: String }
59
63
  const InputLabel = styled('div', labelAttrs)`
60
64
  font-weight: bold;
@@ -63,9 +67,10 @@ const InputLabel = styled('div', labelAttrs)`
63
67
 
64
68
  const LabelWrapper = styled.div`
65
69
  display: inline-grid;
66
- grid-template-columns: auto 1fr;
70
+ grid-template-columns: auto auto;
67
71
  grid-gap: 12px;
68
72
  align-items: center;
73
+ justify-content: start;
69
74
  `
70
75
 
71
76
  const inputProps = {
@@ -171,6 +176,7 @@ export default {
171
176
  ErrorMessage,
172
177
  InfoText,
173
178
  InputLabel,
179
+ InputErrorWrapper,
174
180
  LabelWrapper,
175
181
  Icon,
176
182
  IconWrapper,
@@ -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="16" />
15
+ <info-text v-if="item.infoText" :text="item.infoText" size="16px" />
16
16
  </label-container>
17
17
  <image-container v-if="item.img">
18
18
  <radio-image :src="item.img" />
@@ -10,7 +10,7 @@
10
10
  v-if="infoTextMessage"
11
11
  :text="infoTextMessage"
12
12
  borderColor="#ccc"
13
- size="16"
13
+ size="16px"
14
14
  :alignText="infoTextAlign"
15
15
  />
16
16
  </label-wrapper>
@@ -23,6 +23,7 @@
23
23
  :disabled="isDisabled"
24
24
  :fontSize="fontSize"
25
25
  @input="onChangeHandler"
26
+ :resize="resize"
26
27
  />
27
28
  </input-wrapper>
28
29
  <error-message v-if="isError && errorText">{{ errorText }}</error-message>
@@ -174,7 +175,11 @@ export default {
174
175
  },
175
176
  inputWidth: {
176
177
  required: false,
177
- default: null
178
+ default: null,
179
+ },
180
+ resize:{
181
+ required:false,
182
+ default: "none"
178
183
  }
179
184
  },
180
185
  methods: {
@@ -10,7 +10,7 @@
10
10
  v-if="infoTextMessage"
11
11
  :text="infoTextMessage"
12
12
  borderColor="#ccc"
13
- size="14"
13
+ size="14px"
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="14"
49
+ size="14px"
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="14"
9
+ size="14px"
10
10
  borderColor="#ccc"
11
11
  :alignText="alignInfoText"
12
12
  />
@@ -4,6 +4,9 @@ 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
+ }
7
10
  let newVal = value.toString()
8
11
  const selectedLang = localStorage.getItem('lang')
9
12
  // The first replace will replace not allowed characters with a blank
@@ -91,6 +94,8 @@ export const numberToString = ({ value, numberPrecision }) => {
91
94
  ? 'fr-fr'
92
95
  : localStorage.getItem('lang')
93
96
  : 'en-US'
97
+ if(selectedLang=="null"){selectedLang='en-US'}
98
+ value=parseFloat(value)
94
99
  return value.toLocaleString(selectedLang, {
95
100
  minimumFractionDigits: numberPrecision,
96
101
  maximumFractionDigits: numberPrecision