@eturnity/eturnity_reusable_components 1.0.70 → 1.0.74

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.70",
3
+ "version": "1.0.74",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
package/src/App.vue CHANGED
@@ -7,7 +7,6 @@
7
7
  <th>Column 1</th>
8
8
  <th>Column 2</th>
9
9
  <th>Column 3</th>
10
- <th>Column 4</th>
11
10
  <div />
12
11
  </tr>
13
12
  </thead>
@@ -24,19 +23,12 @@
24
23
  </main-table>
25
24
  <br />
26
25
  <br />
27
- <input-wrapper>
28
- <input-number
29
- placeholder="Enter Value"
30
- unitName="kWh"
31
- :value="inputValue"
32
- @input-change="onInputChange($event)"
33
- textAlign="left"
34
- fontSize="13px"
35
- labelText="Number of Modules"
36
- labelInfoText="Here is some information for you..."
37
- :disabled="true"
38
- />
39
- </input-wrapper>
26
+ <toggle
27
+ @on-toggle-change="onInputChange($event)"
28
+ :isChecked="isChecked"
29
+ label="My Label Text"
30
+ labelAlign="right"
31
+ />
40
32
  </page-container>
41
33
  </ThemeProvider>
42
34
  </template>
@@ -47,17 +39,12 @@ import theme from "./assets/theme"
47
39
  import styled from "vue-styled-components"
48
40
  import MainTable from "@/components/tables/mainTable"
49
41
  import ThreeDots from "@/components/threeDots"
50
- import InputNumber from "@/components/inputs/inputNumber"
42
+ import Toggle from "@/components/inputs/toggle"
51
43
 
52
44
  const PageContainer = styled.div`
53
45
  padding: 40px;
54
46
  `
55
47
 
56
- const InputWrapper = styled.div`
57
- height: 36px;
58
- width: 180px;
59
- `
60
-
61
48
  export default {
62
49
  name: "App",
63
50
  components: {
@@ -65,8 +52,7 @@ export default {
65
52
  PageContainer,
66
53
  MainTable,
67
54
  ThreeDots,
68
- InputNumber,
69
- InputWrapper,
55
+ Toggle,
70
56
  },
71
57
  data() {
72
58
  return {
@@ -132,7 +118,7 @@ export default {
132
118
  return theme
133
119
  },
134
120
  onInputChange(event) {
135
- this.inputValue = event
121
+ this.isChecked = event
136
122
  },
137
123
  },
138
124
  }
@@ -1,4 +1,4 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40">
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="5 5 30 30">
2
2
  <defs>
3
3
  <style>
4
4
  .cls-1 {
@@ -1,4 +1,4 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40">
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="5 5 30 30">
2
2
  <defs>
3
3
  <style>
4
4
  .cls-1 {
@@ -1,57 +1,44 @@
1
1
  <template>
2
- <wrapper>
3
- <icon :color="color" />
2
+ <wrapper @mouseover="isHovered = true" @mouseleave="isHovered = false">
3
+ <icon-image
4
+ v-if="isHovered"
5
+ :src="require('../../assets/icons/delete_icon.svg')"
6
+ />
7
+ <icon-image
8
+ v-else
9
+ :src="require('../../assets/icons/delete_icon_gray.svg')"
10
+ />
4
11
  </wrapper>
5
12
  </template>
6
13
 
7
14
  <script>
8
15
  // To use:
9
- // <delete-icon
10
- // color="gray" // red is default
11
- // />
16
+ // <delete-icon />
12
17
  import styled from "vue-styled-components"
13
18
 
14
19
  const Wrapper = styled.div`
15
- width: 100%;
16
- height: 100%;
17
- min-height: 40px;
18
- display: flex;
19
- align-items: center;
20
- justify-content: center;
21
- `
22
-
23
- const iconAttrs = { color: String }
24
- const Icon = styled("span", iconAttrs)`
25
20
  width: 30px;
26
21
  height: 30px;
27
- background-position: center;
28
22
  cursor: pointer;
29
- background-image: ${(props) =>
30
- props.color === "red"
31
- ? `url(${require("../../assets/icons/delete_icon.svg")})`
32
- : props.color === "gray"
33
- ? `url(${require("../../assets/icons/delete_icon_gray.svg")})`
34
- : `url(${require("../../assets/icons/delete_icon.svg")})`};
23
+ `
35
24
 
25
+ const IconImage = styled.img`
36
26
  &:hover {
37
- box-shadow: 0px 4px 9px 1px rgb(0 0 0 / 20%);
27
+ background-color: ${(props) => props.theme.colors.grey5};
38
28
  border-radius: 4px;
39
- background-image: ${() =>
40
- `url(${require("../../assets/icons/delete_icon.svg")})`};
41
29
  }
42
30
  `
43
31
 
44
32
  export default {
45
33
  name: "delete-icon",
46
34
  components: {
47
- Icon,
48
35
  Wrapper,
36
+ IconImage,
49
37
  },
50
- props: {
51
- color: {
52
- required: false,
53
- default: "red", // red, gray
54
- },
38
+ data() {
39
+ return {
40
+ isHovered: false,
41
+ }
55
42
  },
56
43
  }
57
44
  </script>
@@ -1,18 +1,14 @@
1
1
  <template>
2
2
  <container>
3
- <flex-wrapper :size="size">
4
- <label-text
5
- v-if="labelAlign === 'left'"
6
- :size="size"
7
- @click="onToggleChange"
8
- >{{ label }}</label-text
9
- >
3
+ <flex-wrapper :size="size" @click="onToggleChange">
4
+ <label-text v-if="labelAlign === 'left'" :size="size">{{
5
+ label
6
+ }}</label-text>
10
7
  <toggle-wrapper
11
8
  role="checkbox"
12
9
  :checked="isChecked"
13
10
  :size="size"
14
11
  tabindex="0"
15
- @click="onToggleChange"
16
12
  @keydown.space.prevent="onToggleChange"
17
13
  :disabled="disabled"
18
14
  >
@@ -69,6 +65,7 @@ const FlexWrapper = styled("div", flexAttrs)`
69
65
  ? "10px"
70
66
  : "20px"};
71
67
  align-items: center;
68
+ cursor: pointer;
72
69
  `
73
70
 
74
71
  const toggleAttrs = { size: String, fontColor: String, disabled: Boolean }
@@ -146,7 +143,7 @@ const ToggleDot = styled("span", toggleProps)`
146
143
  : props.size === "small"
147
144
  ? "10px"
148
145
  : "14px"};
149
- left: 4px
146
+ left: 3px
150
147
  bottom: ${(props) =>
151
148
  props.size === "medium" ? "5px" : props.size === "small" ? "3px" : "5px"};
152
149
  background-color: ${(props) =>
@@ -164,7 +161,7 @@ const ToggleDot = styled("span", toggleProps)`
164
161
  ? props.size === "medium"
165
162
  ? "translateX(25px)"
166
163
  : props.size === "small"
167
- ? "translateX(10px)"
164
+ ? "translateX(13px)"
168
165
  : "translateX(25px)"
169
166
  : "translateX(0)"};
170
167
 
@@ -91,6 +91,7 @@ const TableContainer = styled.table`
91
91
  th {
92
92
  padding: 11px 15px;
93
93
  background-color: ${(props) => props.theme.colors.blue1};
94
+ cursor: auto;
94
95
 
95
96
  .ordering {
96
97
  display: grid;
@@ -116,6 +116,14 @@ import Spinner from "../spinner"
116
116
  const PageContainer = styled.div`
117
117
  display: grid;
118
118
  align-items: center;
119
+ justify-items: center;
120
+ width: 30px;
121
+ height: 30px;
122
+
123
+ &:hover {
124
+ background-color: ${(props) => props.theme.colors.grey5};
125
+ border-radius: 4px;
126
+ }
119
127
  `
120
128
 
121
129
  const ButtonContainer = styled.div`
@@ -128,13 +136,6 @@ const ButtonContainer = styled.div`
128
136
  // This is the dot color
129
137
  background-color: #263238;
130
138
  }
131
-
132
- &:hover {
133
- div {
134
- // Dot color on hover
135
- background-color: ${(props) => props.theme.colors.grey3};
136
- }
137
- }
138
139
  `
139
140
 
140
141
  const DotItem = styled.div`