@eturnity/eturnity_reusable_components 1.0.89 → 1.0.93

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.0.89",
3
+ "version": "1.0.93",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -73,13 +73,13 @@ const Container = styled("label", containerAttrs)`
73
73
  ? "16px"
74
74
  : "25px"};
75
75
  background-color: ${(props) =>
76
- props.isDisabled
77
- ? props.theme.colors.lightGray
78
- : !props.isChecked
79
- ? "#fff"
80
- : props.backgroundColor
76
+ props.isChecked
81
77
  ? props.backgroundColor
82
- : props.theme.colors.green};
78
+ ? props.backgroundColor
79
+ : props.theme.colors.green
80
+ : props.isDisabled
81
+ ? props.theme.colors.lightGray
82
+ : "#fff"};
83
83
  border-radius: 4px;
84
84
  border: 1px solid
85
85
  ${(props) =>
@@ -17,6 +17,9 @@
17
17
  :inputWidth="inputWidth"
18
18
  :value="value"
19
19
  @input="onChangeHandler"
20
+ :noBorder="noBorder"
21
+ :disabled="disabled"
22
+ :isDisabled="disabled"
20
23
  />
21
24
  </input-wrapper>
22
25
  <error-message v-if="isError">{{ errorMessage }}</error-message>
@@ -44,11 +47,20 @@ const LabelWrapper = styled.div`
44
47
  margin-bottom: 12px;
45
48
  `
46
49
 
47
- const inputProps = { isError: Boolean, inputWidth: String }
50
+ const inputProps = {
51
+ isError: Boolean,
52
+ inputWidth: String,
53
+ noBorder: Boolean,
54
+ isDisabled: Boolean,
55
+ }
48
56
  const InputContainer = styled("input", inputProps)`
49
57
  border: ${(props) =>
50
58
  props.isError
51
59
  ? "1px solid " + props.theme.colors.red
60
+ : props.noBorder
61
+ ? "none"
62
+ : props.hasLength
63
+ ? "1px solid " + props.theme.colors.black
52
64
  : "1px solid " + props.theme.colors.mediumGray};
53
65
  padding: ${(props) =>
54
66
  props.hasUnit ? "11px 40px 11px 10px" : "11px 5px 11px 10px"};
@@ -59,6 +71,9 @@ const InputContainer = styled("input", inputProps)`
59
71
  width: 100%;
60
72
  box-sizing: border-box; // to allow width of 100% with padding
61
73
  font-weight: 500;
74
+ cursor: ${(props) => (props.isDisabled ? "not-allowed" : "auto")};
75
+ background-color: ${(props) =>
76
+ props.isDisabled ? props.theme.colors.grey5 : "#fff"};
62
77
 
63
78
  &::placeholder {
64
79
  color: ${(props) =>
@@ -84,16 +99,16 @@ const ErrorMessage = styled.div`
84
99
  export default {
85
100
  // import InputText from "@eturnity/eturnity_reusable_components/src/components/inputs/inputText"
86
101
  // To use:
87
- // <input-text
88
- // placeholder="Company name"
89
- // :value="companyName"
90
- // @input-change="onInputChange({ value: $event, type: 'companyName' })"
91
- // :isError="checkErrors()"
92
- // :errorMessage="This is my error message"
93
- // infoTextAlign="right" // left by default
94
- // infoTextMessage="My info message"
95
- // label="Question 5"
96
- // />
102
+ // <input-text
103
+ // placeholder="Company name"
104
+ // :value="companyName"
105
+ // @input-change="onInputChange({ value: $event, type: 'companyName' })"
106
+ // :isError="checkErrors()"
107
+ // :errorMessage="This is my error message"
108
+ // infoTextAlign="right" // left by default
109
+ // infoTextMessage="My info message"
110
+ // label="Question 5"
111
+ // />
97
112
  name: "input-text",
98
113
  components: {
99
114
  Container,
@@ -134,6 +149,14 @@ export default {
134
149
  label: {
135
150
  required: false,
136
151
  },
152
+ noBorder: {
153
+ required: false,
154
+ default: false,
155
+ },
156
+ disabled: {
157
+ required: false,
158
+ default: false,
159
+ },
137
160
  },
138
161
  methods: {
139
162
  onChangeHandler($event) {
@@ -109,7 +109,7 @@ const TableContainer = styled.table`
109
109
  }
110
110
 
111
111
  td {
112
- padding: 7px 15px 7px 10px;
112
+ padding: 6px 15px 7px 10px;
113
113
  border-bottom: 1px solid ${(props) => props.theme.colors.grey4};
114
114
 
115
115
  &.empty {
@@ -313,6 +313,7 @@ const TableContainer = styled.table`
313
313
  font-size: 13px;
314
314
  padding: 5px 10px;
315
315
  background: #fff;
316
+ min-width: max-content;
316
317
 
317
318
  &:focus {
318
319
  background: ${(props) => props.theme.colors.grey5};