@eturnity/eturnity_reusable_components 1.2.15-QA03-2092022.0 → 1.2.16-EPDM-5285.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "1.2.15-QA03-2092022.0",
3
+ "version": "1.2.16-EPDM-5285.1",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -13,8 +13,7 @@
13
13
  "@vueform/slider": "1.0.5",
14
14
  "core-js": "^3.6.5",
15
15
  "vue": "^2.6.11",
16
- "vue-styled-components": "^1.6.0",
17
- "html-loader": "^0.5.5"
16
+ "vue-styled-components": "^1.6.0"
18
17
  },
19
18
  "devDependencies": {
20
19
  "@storybook/addon-actions": "^6.2.8",
@@ -29,7 +28,8 @@
29
28
  "babel-eslint": "^10.1.0",
30
29
  "eslint": "^6.7.2",
31
30
  "eslint-plugin-vue": "^6.2.2",
32
- "vue-template-compiler": "^2.6.11"
31
+ "vue-template-compiler": "^2.6.11",
32
+ "html-loader": "^0.5.5"
33
33
  },
34
34
  "eslintConfig": {
35
35
  "root": true,
package/src/App.vue CHANGED
@@ -1,20 +1,18 @@
1
1
  <template>
2
2
  <ThemeProvider :theme="getTheme()" :style="{ height: '100%' }">
3
3
  <page-container>
4
- <br />
5
- <modal backdrop="dark" :isLoading="false" :isOpen="true">
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
4
+ <main-table titleText="My Table">
5
+ <thead>
6
+ <tr>
7
+ <th>Column 1</th>
8
+ <th>Column 2</th>
9
+ <th>Column 3</th>
10
+ <div />
11
+ </tr>
12
+ </thead>
13
+ <tbody>
14
+ <tr>
15
+ <!-- <table-dropdown
18
16
  :colSpan="3"
19
17
  :tableItems="getDropdownValues()"
20
18
  @toggle-dropdown-open="toggleDropdownOpen()"
@@ -23,14 +21,14 @@
23
21
  :optionItems="itemOptions"
24
22
  :optionsDisplay="['display_name', 'company_item_number', 'model']"
25
23
  /> -->
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>
24
+ <td>Test</td>
25
+ <div class="icons-container">
26
+ <three-dots :options="listOptions" :isLoading="false" />
27
+ </div>
28
+ </tr>
29
+ </tbody>
30
+ </main-table>
31
+ <br />
34
32
  <br />
35
33
  <toggle
36
34
  @on-toggle-change="onInputChange($event)"
@@ -43,13 +41,17 @@
43
41
  />
44
42
  <br />
45
43
  <input-number
46
- :value="num"
47
- @input-change="num = $event"
48
- unitName="t"
49
- id="biebie"
50
- test="koko"
51
- @keydown="keydownHandler"
44
+ placeholder="Enter distance"
45
+ :numberPrecision="2"
46
+ :value="inputValue"
47
+ @input-change="onInputChange($event)"
52
48
  />
49
+ <br />
50
+
51
+ <icon name="info" color="red" size="50px" />
52
+ <icon name="info" color="#F00" size="50px" />
53
+ <icon name="info" color="blue1" size="50px" />
54
+ <icon name="info" color="#00F" size="50px" />
53
55
  </page-container>
54
56
  </ThemeProvider>
55
57
  </template>
@@ -58,16 +60,8 @@
58
60
  import { ThemeProvider } from 'vue-styled-components'
59
61
  import theme from './assets/theme'
60
62
  import styled from 'vue-styled-components'
61
- import MainTable from '@/components/tables/mainTable'
62
- import ThreeDots from '@/components/threeDots'
63
- import Toggle from '@/components/inputs/toggle'
63
+ import icon from '@/components/icon'
64
64
  import InputNumber from '@/components/inputs/inputNumber'
65
- import Checkbox from '@/components/inputs/checkbox'
66
- import PageSubtitle from '@/components/pageSubtitle'
67
- import Spinner from '@/components/spinner'
68
- import ExternalButton from '@/components/buttons/externalButton'
69
- import Modal from '@/components/modals/modal'
70
- // import TableDropdown from "@/components/tableDropdown"
71
65
 
72
66
  const PageContainer = styled.div`
73
67
  padding: 40px;
@@ -78,19 +72,11 @@ export default {
78
72
  components: {
79
73
  ThemeProvider,
80
74
  PageContainer,
81
- MainTable,
82
- ThreeDots,
83
- Toggle,
84
75
  InputNumber,
85
- PageSubtitle,
86
- Spinner,
87
- Checkbox,
88
- ExternalButton,
89
- Modal
76
+ icon
90
77
  },
91
78
  data() {
92
79
  return {
93
- num: 42,
94
80
  inputValue: null,
95
81
  checkedOption: 'button_1',
96
82
  question: {
@@ -149,9 +135,6 @@ export default {
149
135
  }
150
136
  },
151
137
  methods: {
152
- keydownHandler(e) {
153
- console.log('test', e)
154
- },
155
138
  getTheme() {
156
139
  return theme
157
140
  },
@@ -212,4 +195,4 @@ body {
212
195
  height: 100%;
213
196
  margin: 0;
214
197
  }
215
- </style>
198
+ </style>
@@ -37,7 +37,8 @@ const IconImage = styled('div', IconImageProps)`
37
37
  height: ${(props) => props.size};
38
38
  }
39
39
  svg > path {
40
- ${(props) => props.color && `fill: ${props.color};`}
40
+ ${(props) =>
41
+ props.color && `fill: ${props.theme.colors[props.color] || props.color};`}
41
42
  }
42
43
  &:hover > svg > path {
43
44
  ${(props) => props.hoveredColor && `fill: ${props.hoveredColor};`}
@@ -33,7 +33,7 @@
33
33
  // backgroundColor="red"
34
34
  // :isDisabled="true"
35
35
  // />
36
- import styled from "vue-styled-components"
36
+ import styled from 'vue-styled-components'
37
37
 
38
38
  const ComponentWrapper = styled.div`
39
39
  min-height: 18px;
@@ -45,34 +45,33 @@ const containerAttrs = {
45
45
  hasLabel: Boolean,
46
46
  backgroundColor: String,
47
47
  isChecked: Boolean,
48
- isDisabled: Boolean,
48
+ isDisabled: Boolean
49
49
  }
50
- const Container = styled("label", containerAttrs)`
50
+ const Container = styled('label', containerAttrs)`
51
51
  display: grid;
52
- grid-template-columns: ${(props) => (props.hasLabel ? "18px auto" : "18px")};
52
+ grid-template-columns: ${(props) => (props.hasLabel ? '18px auto' : '18px')};
53
53
  grid-gap: 16px;
54
54
  align-content: center;
55
- /* align-items: center; */
56
55
  color: ${(props) => props.theme.colors.black};
57
56
  position: relative;
58
- cursor: ${(props) => (props.isDisabled ? "not-allowed" : "pointer")};
57
+ cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
59
58
  font-size: 16px;
60
59
  user-select: none;
61
60
 
62
61
  .checkmark {
63
62
  position: absolute;
64
63
  height: ${(props) =>
65
- props.size === "medium"
66
- ? "25px"
67
- : props.size === "small"
68
- ? "16px"
69
- : "25px"};
64
+ props.size === 'medium'
65
+ ? '25px'
66
+ : props.size === 'small'
67
+ ? '16px'
68
+ : '25px'};
70
69
  width: ${(props) =>
71
- props.size === "medium"
72
- ? "25px"
73
- : props.size === "small"
74
- ? "16px"
75
- : "25px"};
70
+ props.size === 'medium'
71
+ ? '25px'
72
+ : props.size === 'small'
73
+ ? '16px'
74
+ : '25px'};
76
75
  background-color: ${(props) =>
77
76
  props.isChecked
78
77
  ? props.backgroundColor
@@ -80,7 +79,7 @@ const Container = styled("label", containerAttrs)`
80
79
  : props.theme.colors.green
81
80
  : props.isDisabled
82
81
  ? props.theme.colors.lightGray
83
- : "#fff"};
82
+ : '#fff'};
84
83
  border-radius: 4px;
85
84
  border: 1px solid
86
85
  ${(props) =>
@@ -91,34 +90,34 @@ const Container = styled("label", containerAttrs)`
91
90
  : props.theme.colors.mediumGray};
92
91
 
93
92
  &:after {
94
- content: "";
93
+ content: '';
95
94
  position: absolute;
96
- display: ${(props) => (props.isChecked ? "block" : "none")};
95
+ display: ${(props) => (props.isChecked ? 'block' : 'none')};
97
96
  }
98
97
  }
99
98
 
100
99
  .checkmark:after {
101
100
  left: ${(props) =>
102
- props.size === "medium" ? "9px" : props.size === "small" ? "5px" : "9px"};
101
+ props.size === 'medium' ? '9px' : props.size === 'small' ? '5px' : '9px'};
103
102
  top: ${(props) =>
104
- props.size === "medium" ? "5px" : props.size === "small" ? "2px" : "5px"};
103
+ props.size === 'medium' ? '5px' : props.size === 'small' ? '2px' : '5px'};
105
104
  width: ${(props) =>
106
- props.size === "medium" ? "5px" : props.size === "small" ? "3px" : "5px"};
105
+ props.size === 'medium' ? '5px' : props.size === 'small' ? '3px' : '5px'};
107
106
  height: ${(props) =>
108
- props.size === "medium"
109
- ? "10px"
110
- : props.size === "small"
111
- ? "6px"
112
- : "10px"};
107
+ props.size === 'medium'
108
+ ? '10px'
109
+ : props.size === 'small'
110
+ ? '6px'
111
+ : '10px'};
113
112
  border: solid
114
113
  ${(props) =>
115
114
  props.checkColor ? props.checkColor : props.theme.colors.white};
116
115
  border-width: ${(props) =>
117
- props.size === "medium"
118
- ? "0 3px 3px 0"
119
- : props.size === "small"
120
- ? "0 2px 2px 0"
121
- : "0 3px 3px 0"};
116
+ props.size === 'medium'
117
+ ? '0 3px 3px 0'
118
+ : props.size === 'small'
119
+ ? '0 2px 2px 0'
120
+ : '0 3px 3px 0'};
122
121
  transform: rotate(45deg);
123
122
  }
124
123
  `
@@ -135,49 +134,49 @@ const InputCheckbox = styled.input`
135
134
  const LabelText = styled.div`
136
135
  font-size: 13px;
137
136
  display: grid;
138
- align-items: center;
137
+ align-items: flex-start;
139
138
  min-height: 18px;
140
139
  `
141
140
 
142
141
  export default {
143
- name: "checkbox",
142
+ name: 'checkbox',
144
143
  components: {
145
144
  ComponentWrapper,
146
145
  Container,
147
146
  InputCheckbox,
148
- LabelText,
147
+ LabelText
149
148
  },
150
149
  props: {
151
150
  label: {
152
151
  required: false,
153
- default: "",
152
+ default: ''
154
153
  },
155
154
  isChecked: {
156
155
  required: true,
157
- default: false,
156
+ default: false
158
157
  },
159
158
  checkColor: {
160
- required: false,
159
+ required: false
161
160
  },
162
161
  size: {
163
162
  required: false,
164
- default: "medium", // small, medium
163
+ default: 'medium' // small, medium
165
164
  },
166
165
  backgroundColor: {
167
- required: false,
166
+ required: false
168
167
  },
169
168
  isDisabled: {
170
169
  required: false,
171
- default: false,
172
- },
170
+ default: false
171
+ }
173
172
  },
174
173
  methods: {
175
174
  onChangeHandler(value) {
176
175
  if (this.isDisabled) {
177
176
  return
178
177
  }
179
- this.$emit("on-event-handler", value)
180
- },
181
- },
178
+ this.$emit('on-event-handler', value)
179
+ }
180
+ }
182
181
  }
183
182
  </script>
@@ -14,10 +14,9 @@
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
22
  :minWidth="minWidth"
@@ -31,7 +30,6 @@
31
30
  :textAlign="textAlign"
32
31
  :fontSize="fontSize"
33
32
  :fontColor="fontColor"
34
- v-on="$listeners"
35
33
  />
36
34
  <unit-container
37
35
  v-if="unitName && showLinearUnitName"
@@ -182,19 +180,12 @@ export default {
182
180
  LabelText,
183
181
  InfoText
184
182
  },
185
- inheritAttrs: false,
186
183
  data() {
187
184
  return {
188
185
  textInput: '',
189
186
  isFocused: false
190
187
  }
191
188
  },
192
- computed: {
193
- displayedPlaceholder() {
194
- if (this.placeholder) return this.placeholder
195
- return `${this.minNumber || 0} ${this.unitName ? this.unitName : ''}`
196
- }
197
- },
198
189
  props: {
199
190
  placeholder: {
200
191
  required: false,
@@ -308,11 +299,13 @@ export default {
308
299
  return num
309
300
  }
310
301
  })
311
- let evaluated = eval(formatted.join('')) || ''
312
- evaluated = stringToNumber({
313
- value: evaluated,
314
- numberPrecision: this.numberPrecision
315
- })
302
+ let evaluated = eval(formatted.join(''))
303
+ if (typeof evaluated === 'string') {
304
+ evaluated = stringToNumber({
305
+ value: evaluated,
306
+ numberPrecision: this.numberPrecision
307
+ })
308
+ }
316
309
  return evaluated
317
310
  },
318
311
  onInputBlur(e) {
@@ -394,4 +387,4 @@ export default {
394
387
  }
395
388
  }
396
389
  }
397
- </script>
390
+ </script>
@@ -3,18 +3,15 @@
3
3
  :isOpen="isOpen"
4
4
  :class="{ visible: isOpen, hidden: !isOpen }"
5
5
  @click.native="onOutsideClose()"
6
- :backdrop="backdrop"
7
6
  >
8
7
  <modal-container @click.stop>
9
- <spinner v-if="isLoading" size="50px" :limitedToModal="true" />
10
- <content-container :visible="!isLoading">
11
- <slot />
12
- </content-container>
8
+ <spinner v-if="isLoading" size="50px" :fullWidth="true" />
13
9
  <close-button
14
10
  v-if="!hideClose"
15
11
  @click.native="onCloseModal()"
16
12
  class="close"
17
13
  />
14
+ <slot />
18
15
  </modal-container>
19
16
  </page-wrapper>
20
17
  </template>
@@ -31,12 +28,7 @@ import styled from 'vue-styled-components'
31
28
  import CloseButton from '../../buttons/closeButton'
32
29
  import Spinner from '../../spinner'
33
30
 
34
- const contentAttrs = { visible: Boolean }
35
- const ContentContainer = styled('div', contentAttrs)`
36
- visibility: ${(props) => (props.visible ? 'inherit' : 'hidden')};
37
- `
38
-
39
- const pageAttrs = { isOpen: Boolean, backdrop: String }
31
+ const pageAttrs = { isOpen: Boolean }
40
32
  const PageWrapper = styled('div', pageAttrs)`
41
33
  position: fixed;
42
34
  display: grid;
@@ -44,10 +36,7 @@ const PageWrapper = styled('div', pageAttrs)`
44
36
  left: 0;
45
37
  width: 100%;
46
38
  height: 100%;
47
- background-color: ${(props) =>
48
- props.backdrop == 'dark'
49
- ? 'rgba(0, 0, 0, 0.4)'
50
- : 'rgba(255, 255, 255, 0.9)'};
39
+ background-color: rgba(255, 255, 255, 0.9);
51
40
  z-index: 99999;
52
41
  overflow: auto;
53
42
 
@@ -109,8 +98,7 @@ export default {
109
98
  PageWrapper,
110
99
  ModalContainer,
111
100
  CloseButton,
112
- Spinner,
113
- ContentContainer
101
+ Spinner
114
102
  },
115
103
  props: {
116
104
  isOpen: {
@@ -128,10 +116,6 @@ export default {
128
116
  hideClose: {
129
117
  required: false,
130
118
  default: false
131
- },
132
- backdrop: {
133
- required: false,
134
- default: 'white'
135
119
  }
136
120
  },
137
121
  methods: {
@@ -151,4 +135,4 @@ export default {
151
135
  }
152
136
  }
153
137
  }
154
- </script>
138
+ </script>
@@ -26,6 +26,5 @@ export const Default = Template.bind({
26
26
  preventOutsideClose: true,
27
27
  isLoading: false,
28
28
  hideClose: false,
29
- backdrop: 'dark',
30
- })
29
+ });
31
30
  Default.args = {};
@@ -7,7 +7,7 @@
7
7
  />
8
8
  </container>
9
9
  </spinner-container>
10
- <container v-else :limitedToModal="limitedToModal">
10
+ <container v-else>
11
11
  <spinner-wrapper
12
12
  :size="size"
13
13
  :src="require('../../assets/icons/black_spinner.svg')"
@@ -18,7 +18,7 @@
18
18
  <script>
19
19
  // import Spinner from "@eturnity/eturnity_reusable_components/src/components/spinner"
20
20
  // <spinner size="30px" />
21
- import styled from 'vue-styled-components'
21
+ import styled from "vue-styled-components"
22
22
 
23
23
  const SpinnerContainer = styled.div`
24
24
  position: fixed;
@@ -32,41 +32,34 @@ const SpinnerContainer = styled.div`
32
32
  justify-items: center;
33
33
  z-index: 100;
34
34
  `
35
- const containerAttrs = { limitedToModal: Boolean }
36
- const Container = styled('div', containerAttrs)`
35
+
36
+ const Container = styled.div`
37
37
  display: grid;
38
38
  align-items: center;
39
39
  justify-items: center;
40
- position: ${(props) => (props.limitedToModal ? 'absolute' : 'inherit')};
41
- height: ${(props) => (props.limitedToModal ? '100%' : 'inherit')};
42
- width: ${(props) => (props.limitedToModal ? '100%' : 'inherit')};
43
40
  `
44
41
 
45
42
  const spinnerAttrs = { size: String }
46
- const SpinnerWrapper = styled('img', spinnerAttrs)`
47
- width: ${(props) => (props.size ? props.size : '60px')};
43
+ const SpinnerWrapper = styled("img", spinnerAttrs)`
44
+ width: ${(props) => (props.size ? props.size : "60px")};
48
45
  `
49
46
 
50
47
  export default {
51
- name: 'spinner',
48
+ name: "spinner",
52
49
  components: {
53
50
  Container,
54
51
  SpinnerWrapper,
55
- SpinnerContainer
52
+ SpinnerContainer,
56
53
  },
57
54
  props: {
58
55
  fullWidth: {
59
56
  required: false,
60
- default: false
61
- },
62
- limitedToModal: {
63
- required: false,
64
- default: false
57
+ default: false,
65
58
  },
66
59
  size: {
67
60
  required: false,
68
- default: null
69
- }
70
- }
61
+ default: null,
62
+ },
63
+ },
71
64
  }
72
- </script>
65
+ </script>
@@ -9,6 +9,7 @@ export const stringToNumber = ({
9
9
  // The first replace will replace not allowed characters with a blank
10
10
  if (
11
11
  selectedLang === 'de-DE' ||
12
+ selectedLang === 'de-de' ||
12
13
  selectedLang === 'no-no' ||
13
14
  selectedLang === 'da-dk' ||
14
15
  selectedLang === 'de-lu' ||