@eturnity/eturnity_reusable_components 1.0.33 → 1.0.37

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.33",
3
+ "version": "1.0.37",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
package/src/App.vue CHANGED
@@ -18,11 +18,17 @@
18
18
  <td class="text">Body 3</td>
19
19
  <td class="text">Body 4</td>
20
20
  <div class="icons-container">
21
- <three-dots :options="listOptions" />
21
+ <three-dots :options="listOptions" :isLoading="false" />
22
22
  </div>
23
23
  </tr>
24
24
  </tbody>
25
25
  </main-table>
26
+ <checkbox
27
+ :isChecked="false"
28
+ @on-event-handler="onInputChange($event)"
29
+ size="small"
30
+ :isDisabled="false"
31
+ />
26
32
  </page-container>
27
33
  </ThemeProvider>
28
34
  </template>
@@ -33,6 +39,7 @@ import theme from "./assets/theme"
33
39
  import styled from "vue-styled-components"
34
40
  import MainTable from "@/components/tables/mainTable"
35
41
  import ThreeDots from "@/components/threeDots"
42
+ import Checkbox from "@/components/inputs/checkbox"
36
43
 
37
44
  const PageContainer = styled.div`
38
45
  padding: 40px;
@@ -45,6 +52,7 @@ export default {
45
52
  PageContainer,
46
53
  MainTable,
47
54
  ThreeDots,
55
+ Checkbox,
48
56
  },
49
57
  data() {
50
58
  return {
@@ -28,16 +28,16 @@ const Icon = styled("span", iconAttrs)`
28
28
  cursor: pointer;
29
29
  background-image: ${(props) =>
30
30
  props.color === "red"
31
- ? `url(${require("../../assets/images/delete_icon.svg")})`
31
+ ? `url(${require("../../assets/icons/delete_icon.svg")})`
32
32
  : props.color === "gray"
33
- ? `url(${require("../../assets/images/delete_icon_gray.svg")})`
34
- : `url(${require("../../assets/images/delete_icon.svg")})`};
33
+ ? `url(${require("../../assets/icons/delete_icon_gray.svg")})`
34
+ : `url(${require("../../assets/icons/delete_icon.svg")})`};
35
35
 
36
36
  &:hover {
37
37
  box-shadow: 0px 4px 9px 1px rgb(0 0 0 / 20%);
38
38
  border-radius: 4px;
39
39
  background-image: ${() =>
40
- `url(${require("../../assets/images/delete_icon.svg")})`};
40
+ `url(${require("../../assets/icons/delete_icon.svg")})`};
41
41
  }
42
42
  `
43
43
 
@@ -6,6 +6,7 @@
6
6
  :hasLabel="!!label.length"
7
7
  :backgroundColor="backgroundColor"
8
8
  :isChecked="isChecked"
9
+ :isDisabled="isDisabled"
9
10
  >{{ label }}
10
11
  <input-checkbox
11
12
  type="checkbox"
@@ -40,6 +41,7 @@ const containerAttrs = {
40
41
  hasLabel: Boolean,
41
42
  backgroundColor: String,
42
43
  isChecked: Boolean,
44
+ isDisabled: Boolean,
43
45
  }
44
46
  const Container = styled("label", containerAttrs)`
45
47
  display: grid;
@@ -49,7 +51,7 @@ const Container = styled("label", containerAttrs)`
49
51
  position: relative;
50
52
  padding-left: 42px;
51
53
  margin-bottom: 12px;
52
- cursor: pointer;
54
+ cursor: ${(props) => (props.isDisabled ? "not-allowed" : "pointer")};
53
55
  font-size: 16px;
54
56
  user-select: none;
55
57
 
@@ -70,7 +72,9 @@ const Container = styled("label", containerAttrs)`
70
72
  ? "16px"
71
73
  : "25px"};
72
74
  background-color: ${(props) =>
73
- !props.isChecked
75
+ props.isDisabled
76
+ ? props.theme.colors.lightGray
77
+ : !props.isChecked
74
78
  ? "#fff"
75
79
  : props.backgroundColor
76
80
  ? props.backgroundColor
@@ -87,7 +91,7 @@ const Container = styled("label", containerAttrs)`
87
91
  &:after {
88
92
  content: "";
89
93
  position: absolute;
90
- display: none;
94
+ display: ${(props) => (props.isChecked ? "block" : "none")};
91
95
  }
92
96
  }
93
97
 
@@ -124,10 +128,6 @@ const InputCheckbox = styled.input`
124
128
  cursor: pointer;
125
129
  height: 0;
126
130
  width: 0;
127
-
128
- &:checked ~ .checkmark:after {
129
- display: block;
130
- }
131
131
  `
132
132
 
133
133
  export default {
@@ -156,9 +156,16 @@ export default {
156
156
  backgroundColor: {
157
157
  required: false,
158
158
  },
159
+ isDisabled: {
160
+ required: false,
161
+ default: false,
162
+ },
159
163
  },
160
164
  methods: {
161
165
  onChangeHandler(value) {
166
+ if (this.isDisabled) {
167
+ return
168
+ }
162
169
  this.$emit("on-event-handler", value)
163
170
  },
164
171
  },
@@ -6,10 +6,13 @@
6
6
  <dot-item />
7
7
  </button-container>
8
8
  <dropdown-container v-if="isOpen">
9
+ <loading-container v-if="isLoading">
10
+ <spinner />
11
+ </loading-container>
9
12
  <children-container
10
13
  class="child"
11
14
  :isOpen="hoverItem !== null"
12
- v-if="hoverItem !== null"
15
+ v-if="hoverItem !== null && !isLoading"
13
16
  >
14
17
  <option-child
15
18
  v-for="child in childOpen"
@@ -30,7 +33,7 @@
30
33
  {{ child.name }}
31
34
  </option-child>
32
35
  </children-container>
33
- <options-container>
36
+ <options-container v-if="!isLoading">
34
37
  <option-item
35
38
  v-for="(item, index) in options"
36
39
  :key="item.value"
@@ -57,6 +60,7 @@
57
60
  // <three-dots
58
61
  // :options="listOptions"
59
62
  // @on-select="onSelect($event)"
63
+ // :isLoading="true"
60
64
  // />
61
65
  // options to pass:
62
66
  // listOptions: [
@@ -107,6 +111,7 @@
107
111
  // ],
108
112
 
109
113
  import styled from "vue-styled-components"
114
+ import Spinner from "../spinner"
110
115
 
111
116
  const PageContainer = styled.div`
112
117
  display: grid;
@@ -147,6 +152,17 @@ const DropdownContainer = styled.div`
147
152
  grid-template-columns: auto auto;
148
153
  `
149
154
 
155
+ const LoadingContainer = styled.div`
156
+ border: 1px solid ${(props) => props.theme.colors.grey3};
157
+ display: grid;
158
+ grid-template-columns: 1fr;
159
+ min-width: 200px;
160
+ height: 200px;
161
+ align-items: center;
162
+ justify-items: center;
163
+ background: #fff;
164
+ `
165
+
150
166
  const OptionsContainer = styled.div`
151
167
  border: 1px solid ${(props) => props.theme.colors.grey3};
152
168
  display: grid;
@@ -215,6 +231,7 @@ const ChildrenContainer = styled("div", childAttrs)`
215
231
  background-color: #fff;
216
232
  margin-right: -1px;
217
233
  height: max-content;
234
+ max-height: 200px;
218
235
  overflow: auto;
219
236
  `
220
237
 
@@ -230,11 +247,17 @@ export default {
230
247
  OptionChild,
231
248
  ArrowLeft,
232
249
  DropdownContainer,
250
+ Spinner,
251
+ LoadingContainer,
233
252
  },
234
253
  props: {
235
254
  options: {
236
255
  required: true,
237
256
  },
257
+ isLoading: {
258
+ required: false,
259
+ default: false,
260
+ },
238
261
  },
239
262
  data() {
240
263
  return {