@eturnity/eturnity_reusable_components 7.22.2 → 7.22.4

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": "7.22.2",
3
+ "version": "7.22.4",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -1,9 +1,13 @@
1
1
  <template>
2
- <wrapper>
3
- <icon-image>
2
+ <wrapper :disabled="disabled" :size="size" :cursor="cursor">
3
+ <icon-image
4
+ :color="color"
5
+ :background-color="backgroundColor"
6
+ :hovered-color="hoveredColor"
7
+ >
4
8
  <i v-html="icon.html" />
5
9
  </icon-image>
6
- <striked-line v-if="isStriked"></striked-line>
10
+ <striked-line v-if="isStriked" :color="color"></striked-line>
7
11
  </wrapper>
8
12
  </template>
9
13
 
@@ -48,27 +52,31 @@ const props = defineProps({
48
52
  isStriked: {
49
53
  required: false,
50
54
  default: false
55
+ },
56
+ backgroundColor: {
57
+ required: false,
58
+ default: null
51
59
  }
52
60
  })
53
61
 
54
- const Wrapper = styled('div')`
62
+ const Wrapper = styled('div', {
63
+ size: String,
64
+ disabled: Boolean,
65
+ cursor: String
66
+ })`
55
67
  display: flex;
56
68
  position: relative;
57
69
  align-content: center;
58
70
  justify-content: center;
59
- width: ${props.size};
60
- height: ${props.size};
61
- min-width: ${props.size};
62
- min-height: ${props.size};
63
- cursor: ${props.disabled ? 'not-allowed' : props.cursor};
71
+ width: ${(props) => props.size};
72
+ height: ${(props) => props.size};
73
+ min-width: ${(props) => props.size};
74
+ min-height: ${(props) => props.size};
75
+ cursor: ${(props) => (props.disabled ? 'not-allowed' : props.cursor)};
64
76
  line-height: 0;
65
77
  `
66
- const strikedAttrs = {
67
- isDisabled: Boolean,
68
- color: String,
69
- hoveredColor: String
70
- }
71
- const StrikedLine = styled.div`
78
+
79
+ const StrikedLine = styled('div', { color: String })`
72
80
  display: flex;
73
81
  position: absolute;
74
82
  bottom: 0;
@@ -77,29 +85,33 @@ const StrikedLine = styled.div`
77
85
  justify-content: center;
78
86
  width: 143%;
79
87
  height: 8%;
80
- background-color: ${({ theme }) => theme.colors[props.color] || props.color};
88
+ background-color: ${({ theme, color }) => theme.colors[color] || color};
81
89
  min-height: 0;
82
90
  line-height: 0;
83
91
  transform-origin: 0% 100%;
84
92
  transform: rotate(-45deg);
85
93
  `
86
- const IconImage = styled.div`
94
+ const IconImage = styled('div', {
95
+ color: String,
96
+ backgroundColor: String,
97
+ hoveredColor: String
98
+ })`
87
99
  width: 100%;
88
100
  svg {
89
101
  width: 100%;
90
102
  height: 100%;
91
- background-color: ${(props) => props.backgroundColor};
92
- padding: ${(props) => props.backgroundColor ? '3px' : '0'};
103
+ background-color: ${(props) =>
104
+ props.backgroundColor ? props.backgroundColor : 'transparent'};
105
+ padding: ${(props) => (props.backgroundColor ? '3px' : '0')};
93
106
  }
94
107
  svg path {
95
- ${({ theme }) =>
96
- props.color && `fill: ${theme.colors[props.color] || props.color};`}
108
+ ${({ theme, color }) => color && `fill: ${theme.colors[color] || color};`}
97
109
  }
98
110
  &:hover > svg path {
99
- ${props.hoveredColor && `fill: ${props.hoveredColor};`}
111
+ ${(props) => props.hoveredColor && `fill: ${props.hoveredColor};`}
100
112
  }
101
113
  &:hover + div {
102
- background-color: ${props.hoveredColor};
114
+ background-color: ${(props) => props.hoveredColor};
103
115
  }
104
116
  `
105
117