@eturnity/eturnity_reusable_components 1.2.39 → 1.2.41

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.39",
3
+ "version": "1.2.41",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -1,8 +1,9 @@
1
1
  <template>
2
2
  <page-container>
3
3
  <button-container
4
- :isDisabled="isDisabled"
5
4
  :type="type"
5
+ :minWidth="minWidth"
6
+ :isDisabled="isDisabled"
6
7
  :customColor="customColor"
7
8
  >
8
9
  {{ text }}
@@ -14,37 +15,39 @@
14
15
  // To use:
15
16
  // import MainButton from "@eturnity/eturnity_reusable_components/src/components/buttons/mainButton"
16
17
  // <main-button
17
- // type="secondary" // primary, secondary, cancel
18
- // :isDisabled="true"
19
18
  // text="Click Me"
20
19
  // customColor="#ab5348"
20
+ // type="secondary" // primary, secondary, cancel
21
+ // :isDisabled="true"
22
+ // :minWidth="minWidth"
21
23
  // />
22
24
 
23
25
  import styled from "vue-styled-components"
24
26
 
25
27
  const PageContainer = styled.div``
26
28
 
27
- const ButtonAttrs = { type: String, isDisabled: Boolean, customColor: String }
29
+ const ButtonAttrs = { type: String, isDisabled: Boolean, minWidth: String, customColor: String }
28
30
  const ButtonContainer = styled("div", ButtonAttrs)`
29
31
  padding: 7px 15px;
30
32
  font-size: 13px;
31
33
  color: ${(props) => props.theme.colors.white};
32
34
  background-color: ${(props) =>
33
- props.isDisabled
34
- ? props.theme.colors.disabled
35
- : props.customColor
36
- ? props.customColor
37
- : props.type === "primary"
38
- ? props.theme.colors.black
39
- : props.type === "secondary"
40
- ? props.theme.colors.grey3
41
- : props.type === "cancel"
42
- ? props.theme.colors.red
43
- : props.theme.colors.black};
35
+ props.isDisabled
36
+ ? props.theme.colors.disabled
37
+ : props.customColor
38
+ ? props.customColor
39
+ : props.type === "primary"
40
+ ? props.theme.colors.black
41
+ : props.type === "secondary"
42
+ ? props.theme.colors.grey3
43
+ : props.type === "cancel"
44
+ ? props.theme.colors.red
45
+ : props.theme.colors.black};
44
46
  border-radius: 4px;
45
47
  text-align: center;
46
48
  cursor: ${(props) => (props.isDisabled ? "not-allowed" : "pointer")};
47
49
  user-select: none;
50
+ ${(props) => (props.minWidth ? `min-width: ${props.minWidth};` : '')};
48
51
 
49
52
  &:hover {
50
53
  opacity: ${(props) => (props.isDisabled ? "1" : "0.8")};
@@ -77,6 +80,10 @@ export default {
77
80
  required: false,
78
81
  default: null,
79
82
  },
83
+ minWidth: {
84
+ required: false,
85
+ default: null
86
+ }
80
87
  },
81
88
  }
82
89
  </script>
@@ -57,11 +57,9 @@
57
57
  :isError="isError"
58
58
  >{{ unitName }}</unit-container
59
59
  >
60
- <icon
61
- v-if="(isError || inputIcon) && !showLinearUnitName"
62
- :class="inputIconImageClass"
63
- :src="isError ? warningIcon : inputIconImage"
64
- />
60
+ <icon-wrapper v-if="isError && !showLinearUnitName" size="16px">
61
+ <icon name="warning" size="16px" cursor="default" />
62
+ </icon-wrapper>
65
63
  </input-wrapper>
66
64
  <error-message v-if="isError">{{ errorMessage }}</error-message>
67
65
  </container>
@@ -101,6 +99,7 @@ import {
101
99
  import InfoText from '../../infoText'
102
100
  import ErrorMessage from '../../errorMessage'
103
101
  import warningIcon from '../../../assets/icons/error_icon.png'
102
+ import Icon from '../../icon'
104
103
 
105
104
  const inputProps = {
106
105
  isError: Boolean,
@@ -178,15 +177,6 @@ const InputContainer = styled('input', inputProps)`
178
177
  outline: none;
179
178
  }
180
179
  `
181
- const IconProps = {
182
- inputIconHeight: String
183
- }
184
-
185
- const Icon = styled('img', IconProps)`
186
- position: absolute;
187
- right: 10px;
188
- top: 2px;
189
- `
190
180
 
191
181
  const InputWrapper = styled.span`
192
182
  position: relative;
@@ -259,6 +249,16 @@ const LabelText = styled('div', inputProps)`
259
249
  font-weight: 700;
260
250
  `
261
251
 
252
+ const IconAttrs = { size: String }
253
+ const IconWrapper = styled('div', IconAttrs)`
254
+ position: absolute;
255
+ top: 0;
256
+ bottom: 0;
257
+ margin: auto;
258
+ right: 5px;
259
+ height: ${(props) => (props.size ? props.size : 'auto')};
260
+ `
261
+
262
262
  export default {
263
263
  name: 'input-number',
264
264
  components: {
@@ -272,7 +272,8 @@ export default {
272
272
  LabelText,
273
273
  InfoText,
274
274
  Icon,
275
- SlotContainer
275
+ SlotContainer,
276
+ IconWrapper
276
277
  },
277
278
  inheritAttrs: false,
278
279
  data() {
@@ -386,25 +387,10 @@ export default {
386
387
  required: false,
387
388
  default: true
388
389
  },
389
- inputIcon: {
390
- require: false,
391
- type: Boolean,
392
- default: false
393
- },
394
- inputIconImage: {
395
- require: false,
396
- type: String,
397
- default: ''
398
- },
399
390
  allowNegative: {
400
391
  required: false,
401
392
  default: true
402
393
  },
403
- inputIconImageClass: {
404
- require: false,
405
- type: Array,
406
- default: () => []
407
- },
408
394
  slotSize: {
409
395
  required: false
410
396
  },
@@ -74,7 +74,7 @@ const InputLabel = styled('div', labelAttrs)`
74
74
  };
75
75
 
76
76
  font-size: ${(props) => (props.fontSize ? props.fontSize : '13px')};
77
- font-weight: 700;
77
+ font-family: 'Lato-Bold', Arial;
78
78
  `
79
79
 
80
80
  const LabelWrapper = styled.div`
@@ -138,7 +138,7 @@ const InputContainer = styled('input', inputProps)`
138
138
  min-width: ${(props) => (props.minWidth ? props.minWidth : 'unset')};
139
139
  max-height: ${(props) => props.inputHeight};
140
140
  box-sizing: border-box; // to allow width of 100% with padding
141
- font-weight: 500;
141
+ font-weight: 400;
142
142
  cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'auto')};
143
143
  background-color: ${(props) =>
144
144
  props.isDisabled ? props.theme.colors.grey5 :
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <component-wrapper :layout="layout">
3
3
  <radio-wrapper v-for="(item, index) in options" :key="item.value">
4
- <label-container :size="size" :isDisabled="item.disabled" :isChecked="selectedOption === item.value">
4
+ <label-container :size="size" :isDisabled="item.disabled" :isChecked="selectedOption === item.value" :checkmarkColor="checkmarkColor">
5
5
  <radio
6
6
  type="radio"
7
7
  :value="selectedOption"
@@ -83,7 +83,7 @@ const RadioWrapper = styled.div`
83
83
  grid-gap: 10px;
84
84
  `
85
85
 
86
- const containerProps = { size: String, isDisabled: Boolean, isChecked: Boolean }
86
+ const containerProps = { size: String, isDisabled: Boolean, isChecked: Boolean, checkmarkColor: String }
87
87
  const LabelContainer = styled("label", containerProps)`
88
88
  display: grid;
89
89
  grid-template-columns: auto 1fr auto;
@@ -139,7 +139,7 @@ const LabelContainer = styled("label", containerProps)`
139
139
  ? "8px"
140
140
  : "6px"};
141
141
  border-radius: 100%;
142
- background: ${(props) => props.theme.colors.primary};
142
+ background: ${(props) => props.checkmarkColor ? props.checkmarkColor : props.theme.colors.green};
143
143
  }
144
144
  }
145
145
  `
@@ -220,6 +220,10 @@ export default {
220
220
  name: {
221
221
  required: false,
222
222
  default: ''
223
+ },
224
+ checkmarkColor: {
225
+ required: false,
226
+ default: ''
223
227
  }
224
228
  },
225
229
  data() {