@eturnity/eturnity_reusable_components 1.0.72 → 1.0.73

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.72",
3
+ "version": "1.0.73",
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>
@@ -37,6 +36,9 @@
37
36
  :disabled="true"
38
37
  />
39
38
  </input-wrapper>
39
+ <br />
40
+ <br />
41
+ <delete-icon />
40
42
  </page-container>
41
43
  </ThemeProvider>
42
44
  </template>
@@ -48,6 +50,7 @@ import styled from "vue-styled-components"
48
50
  import MainTable from "@/components/tables/mainTable"
49
51
  import ThreeDots from "@/components/threeDots"
50
52
  import InputNumber from "@/components/inputs/inputNumber"
53
+ import DeleteIcon from "@/components/deleteIcon"
51
54
 
52
55
  const PageContainer = styled.div`
53
56
  padding: 40px;
@@ -67,6 +70,7 @@ export default {
67
70
  ThreeDots,
68
71
  InputNumber,
69
72
  InputWrapper,
73
+ DeleteIcon,
70
74
  },
71
75
  data() {
72
76
  return {
@@ -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,55 +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
- background-image: ${() =>
38
- `url(${require("../../assets/icons/delete_icon.svg")})`};
27
+ background-color: ${(props) => props.theme.colors.grey5};
28
+ border-radius: 4px;
39
29
  }
40
30
  `
41
31
 
42
32
  export default {
43
33
  name: "delete-icon",
44
34
  components: {
45
- Icon,
46
35
  Wrapper,
36
+ IconImage,
47
37
  },
48
- props: {
49
- color: {
50
- required: false,
51
- default: "red", // red, gray
52
- },
38
+ data() {
39
+ return {
40
+ isHovered: false,
41
+ }
53
42
  },
54
43
  }
55
44
  </script>
@@ -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`