@eturnity/eturnity_reusable_components 1.0.74 → 1.0.78

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.74",
3
+ "version": "1.0.78",
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>
@@ -12,12 +12,14 @@ const theme = {
12
12
  white: "#fff",
13
13
  blue: "#48a2d0",
14
14
  red: "#ff7e7e",
15
- disabled: "#c4c4c4",
16
15
  blue1: "#e4efff",
16
+ grey1: "#666",
17
+ grey2: "#c4c4c4",
17
18
  grey3: "#b2b9c5",
18
19
  grey4: "#ebeef4",
19
20
  grey5: "#fafafa",
20
21
  green: "#99db0c",
22
+ disabled: "#dfe1e1",
21
23
  },
22
24
  screen: {
23
25
  mobileSmall: "345px",
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <container>
3
- <flex-wrapper :size="size" @click="onToggleChange">
3
+ <flex-wrapper :size="size" :disabled="disabled" @click="onToggleChange">
4
4
  <label-text v-if="labelAlign === 'left'" :size="size">{{
5
5
  label
6
6
  }}</label-text>
@@ -11,10 +11,13 @@
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"
17
19
  :isChecked="isChecked"
20
+ :disabled="disabled"
18
21
  />
19
22
  <toggle-dot
20
23
  :isChecked="isChecked"
@@ -54,7 +57,7 @@ const Container = styled.div`
54
57
  display: inline-block;
55
58
  `
56
59
 
57
- const flexAttrs = { size: String }
60
+ const flexAttrs = { size: String, disabled: Boolean }
58
61
  const FlexWrapper = styled("div", flexAttrs)`
59
62
  display: grid;
60
63
  grid-template-columns: auto 1fr;
@@ -65,10 +68,16 @@ const FlexWrapper = styled("div", flexAttrs)`
65
68
  ? "10px"
66
69
  : "20px"};
67
70
  align-items: center;
68
- cursor: pointer;
71
+ cursor: ${(props) => (props.disabled ? "not-allowed" : "pointer")};
69
72
  `
70
73
 
71
- 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
+ }
72
81
  const LabelText = styled("div", toggleAttrs)`
73
82
  color: ${(props) =>
74
83
  props.fontColor ? props.fontColor : props.theme.colors.darkGray};
@@ -82,6 +91,14 @@ const LabelText = styled("div", toggleAttrs)`
82
91
 
83
92
  const ToggleWrapper = styled("span", toggleAttrs)`
84
93
  display: inline-block;
94
+ border: ${(props) =>
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}
85
102
  position: relative;
86
103
  cursor: ${(props) => (props.disabled ? "not-allowed" : "pointer")};
87
104
  width: ${(props) =>
@@ -108,14 +125,21 @@ const ToggleWrapper = styled("span", toggleAttrs)`
108
125
  }
109
126
  `
110
127
 
111
- const backgroundAttrs = { backgroundColor: String, isChecked: Boolean }
128
+ const backgroundAttrs = {
129
+ backgroundColor: String,
130
+ isChecked: Boolean,
131
+ disabled: Boolean,
132
+ }
112
133
  const ToggleBackground = styled("span", backgroundAttrs)`
113
- display: inline-block;
134
+ /* display: inline-block; */
135
+ display: block;
114
136
  border-radius: 100px;
115
137
  height: 100%;
116
138
  width: 100%;
117
139
  background-color: ${(props) =>
118
- props.isChecked
140
+ props.disabled
141
+ ? props.theme.colors.grey5
142
+ : props.isChecked
119
143
  ? props.backgroundColor
120
144
  ? props.backgroundColor
121
145
  : props.theme.colors.green
@@ -145,7 +169,7 @@ const ToggleDot = styled("span", toggleProps)`
145
169
  : "14px"};
146
170
  left: 3px
147
171
  bottom: ${(props) =>
148
- props.size === "medium" ? "5px" : props.size === "small" ? "3px" : "5px"};
172
+ props.size === "medium" ? "5px" : props.size === "small" ? "2px" : "5px"};
149
173
  background-color: ${(props) =>
150
174
  props.disabled
151
175
  ? props.theme.colors.disabled
@@ -161,7 +185,7 @@ const ToggleDot = styled("span", toggleProps)`
161
185
  ? props.size === "medium"
162
186
  ? "translateX(25px)"
163
187
  : props.size === "small"
164
- ? "translateX(13px)"
188
+ ? "translateX(12px)"
165
189
  : "translateX(25px)"
166
190
  : "translateX(0)"};
167
191
 
@@ -122,7 +122,7 @@ import SearchInput from "@eturnity/eturnity_reusable_components/src/components/i
122
122
  const DropdownRow = styled.td``
123
123
 
124
124
  const ComponentItem = styled.div`
125
- padding-left: 12px;
125
+ /* padding-left: 12px; */
126
126
  overflow: hidden;
127
127
  text-overflow: ellipsis;
128
128
  `
@@ -101,7 +101,7 @@ const TableContainer = styled.table`
101
101
  }
102
102
 
103
103
  td {
104
- padding: 7px 15px;
104
+ padding: 7px 15px 7px 10px;
105
105
  border-bottom: 1px solid ${(props) => props.theme.colors.grey4};
106
106
 
107
107
  &.empty {