@eturnity/eturnity_reusable_components 1.1.16 → 1.1.19

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.1.16",
3
+ "version": "1.1.19",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -0,0 +1,4 @@
1
+ <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M22 10V12L0 12L1.19209e-07 10L22 10Z" fill="white"/>
3
+ <path d="M10 0H12V22H10V0Z" fill="white"/>
4
+ </svg>
@@ -0,0 +1,58 @@
1
+ <template>
2
+ <page-container :shouldPosition="shouldPosition">
3
+ <button-container>
4
+ <plus-button :src="require('../../assets/icons/plus_button.svg')" />
5
+ </button-container>
6
+ </page-container>
7
+ </template>
8
+
9
+ <script>
10
+ // import AddNewButton from "@eturnity/eturnity_reusable_components/src/components/addNewButton"
11
+ import styled from "vue-styled-components"
12
+
13
+ const pageAttrs = { shouldPosition: Boolean }
14
+ const PageContainer = styled("div", pageAttrs)`
15
+ position: ${(props) => (props.shouldPosition ? "fixed" : "unset")};
16
+ bottom: 30px;
17
+ right: 30px;
18
+ `
19
+
20
+ const ButtonContainer = styled.div`
21
+ height: 60px;
22
+ width: 60px;
23
+ background-color: ${(props) => props.theme.colors.green};
24
+ box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
25
+ border-radius: 100%;
26
+ cursor: pointer;
27
+ display: grid;
28
+ align-items: center;
29
+ justify-items: center;
30
+
31
+ &:hover {
32
+ background: linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),
33
+ ${(props) => props.theme.colors.green};
34
+ }
35
+
36
+ &:active,
37
+ &:focus {
38
+ background: ${(props) => props.theme.colors.green};
39
+ }
40
+ `
41
+
42
+ const PlusButton = styled.img``
43
+
44
+ export default {
45
+ name: "add-new-button",
46
+ components: {
47
+ PageContainer,
48
+ ButtonContainer,
49
+ PlusButton,
50
+ },
51
+ props: {
52
+ shouldPosition: {
53
+ required: false,
54
+ default: true,
55
+ },
56
+ },
57
+ }
58
+ </script>
@@ -1,7 +1,11 @@
1
1
  <template>
2
- <wrapper @mouseover="isHovered = true" @mouseleave="isHovered = false">
2
+ <wrapper
3
+ @mouseover="isHovered = true"
4
+ @mouseleave="isHovered = false"
5
+ :isDisabled="isDisabled"
6
+ >
3
7
  <icon-image
4
- v-if="isHovered"
8
+ v-if="isHovered && !isDisabled"
5
9
  :src="require('../../assets/icons/delete_icon.svg')"
6
10
  />
7
11
  <icon-image
@@ -13,13 +17,14 @@
13
17
 
14
18
  <script>
15
19
  // To use:
16
- // <delete-icon />
20
+ // <delete-icon color="gray" @click.native="onDeleteItem(item)" :isDisabled="true" />
17
21
  import styled from "vue-styled-components"
18
22
 
19
- const Wrapper = styled.div`
23
+ const wrapperAttrs = { isDisabled: Boolean }
24
+ const Wrapper = styled("div", wrapperAttrs)`
20
25
  width: 30px;
21
26
  height: 30px;
22
- cursor: pointer;
27
+ cursor: ${(props) => (props.isDisabled ? "not-allowed" : "pointer")};
23
28
  `
24
29
 
25
30
  const IconImage = styled.img`
@@ -35,6 +40,12 @@ export default {
35
40
  Wrapper,
36
41
  IconImage,
37
42
  },
43
+ props: {
44
+ isDisabled: {
45
+ required: false,
46
+ default: false,
47
+ },
48
+ },
38
49
  data() {
39
50
  return {
40
51
  isHovered: false,
@@ -15,7 +15,7 @@
15
15
  // import Modal from "@eturnity/eturnity_reusable_components/src/components/modals/modal"
16
16
  // This is a more flexible modal box, where the parent can decide how the body of the modal looks
17
17
  // To use:
18
- // <modal :isOpen="isOpen" @on-close="$emit('on-close-summary')">
18
+ // <modal :isOpen="isOpen" @on-close="$emit('on-close-summary')" :preventOutsideClose="true">
19
19
  // <div>Data....</div>
20
20
  // </modal>
21
21