@eturnity/eturnity_reusable_components 1.0.75 → 1.0.76

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.75",
3
+ "version": "1.0.76",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
package/src/App.vue CHANGED
@@ -13,8 +13,21 @@
13
13
  <tbody>
14
14
  <tr>
15
15
  <td class="text">Body 2</td>
16
- <td class="text">Body 3</td>
17
- <td class="text">Body 4</td>
16
+ <td>
17
+ <toggle
18
+ @on-toggle-change="onInputChange($event)"
19
+ :isChecked="isChecked"
20
+ labelAlign="right"
21
+ />
22
+ </td>
23
+ <td>
24
+ <toggle
25
+ @on-toggle-change="onInputChange($event)"
26
+ :isChecked="isChecked"
27
+ labelAlign="right"
28
+ :disabled="true"
29
+ />
30
+ </td>
18
31
  <div class="icons-container">
19
32
  <three-dots :options="listOptions" :isLoading="false" />
20
33
  </div>
@@ -28,6 +41,7 @@
28
41
  :isChecked="isChecked"
29
42
  label="My Label Text"
30
43
  labelAlign="right"
44
+ :disabled="true"
31
45
  />
32
46
  </page-container>
33
47
  </ThemeProvider>
@@ -64,7 +78,7 @@ export default {
64
78
  number_max_allowed: 10,
65
79
  unit_short_name: "cm",
66
80
  },
67
- isChecked: true,
81
+ isChecked: false,
68
82
  listOptions: [
69
83
  {
70
84
  name: "Option 1",
@@ -11,6 +11,8 @@
11
11
  tabindex="0"
12
12
  @keydown.space.prevent="onToggleChange"
13
13
  :disabled="disabled"
14
+ :backgroundColor="backgroundColor"
15
+ :isChecked="isChecked"
14
16
  >
15
17
  <toggle-background
16
18
  :backgroundColor="backgroundColor"
@@ -69,7 +71,13 @@ const FlexWrapper = styled("div", flexAttrs)`
69
71
  cursor: ${(props) => (props.disabled ? "not-allowed" : "pointer")};
70
72
  `
71
73
 
72
- const toggleAttrs = { size: String, fontColor: String, disabled: Boolean }
74
+ const toggleAttrs = {
75
+ size: String,
76
+ fontColor: String,
77
+ disabled: Boolean,
78
+ backgroundColor: String,
79
+ isChecked: Boolean,
80
+ }
73
81
  const LabelText = styled("div", toggleAttrs)`
74
82
  color: ${(props) =>
75
83
  props.fontColor ? props.fontColor : props.theme.colors.darkGray};
@@ -84,7 +92,13 @@ const LabelText = styled("div", toggleAttrs)`
84
92
  const ToggleWrapper = styled("span", toggleAttrs)`
85
93
  display: inline-block;
86
94
  border: ${(props) =>
87
- props.disabled ? "1px solid " + props.theme.colors.disabled : "none"}
95
+ props.disabled
96
+ ? "1px solid " + props.theme.colors.disabled
97
+ : props.isChecked
98
+ ? props.backgroundColor
99
+ ? "1px solid " + props.backgroundColor
100
+ : "1px solid " + props.theme.colors.green
101
+ : "1px solid " + props.theme.colors.grey3}
88
102
  position: relative;
89
103
  cursor: ${(props) => (props.disabled ? "not-allowed" : "pointer")};
90
104
  width: ${(props) =>
@@ -97,7 +111,7 @@ const ToggleWrapper = styled("span", toggleAttrs)`
97
111
  props.size === "medium"
98
112
  ? "24px"
99
113
  : props.size === "small"
100
- ? "16px"
114
+ ? "14px"
101
115
  : "24px"};
102
116
  border-radius: 9px;
103
117
 
@@ -154,7 +168,7 @@ const ToggleDot = styled("span", toggleProps)`
154
168
  : "14px"};
155
169
  left: 3px
156
170
  bottom: ${(props) =>
157
- props.size === "medium" ? "5px" : props.size === "small" ? "3px" : "5px"};
171
+ props.size === "medium" ? "5px" : props.size === "small" ? "2px" : "5px"};
158
172
  background-color: ${(props) =>
159
173
  props.disabled
160
174
  ? props.theme.colors.disabled