@eturnity/eturnity_reusable_components 1.2.19-dev03.2 → 1.2.19-v.5.45.0

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.2.19-dev03.2",
3
+ "version": "1.2.19-v.5.45.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -14,7 +14,8 @@
14
14
  "core-js": "^3.6.5",
15
15
  "vue": "^2.6.11",
16
16
  "vue-styled-components": "^1.6.0",
17
- "html-loader": "^0.5.5"
17
+ "html-loader": "^0.5.5",
18
+ "v-click-outside": "^2.1.4"
18
19
  },
19
20
  "devDependencies": {
20
21
  "@storybook/addon-actions": "^6.2.8",
package/src/App.vue CHANGED
@@ -2,10 +2,7 @@
2
2
  <ThemeProvider :theme="getTheme()" :style="{ height: '100%' }">
3
3
  <page-container>
4
4
  <br />
5
- <<<<<<< HEAD
6
- =======
7
- <iconWrapper name="bell"/>
8
- <modal backdrop="dark" :isLoading="false" :isOpen="true">
5
+ <modal backdrop="dark" :isLoading="false" :isOpen="false">
9
6
  <main-table titleText="My Table">
10
7
  <thead>
11
8
  <tr>
@@ -34,6 +31,23 @@
34
31
  </tbody>
35
32
  </main-table>
36
33
  </modal>
34
+ <row-container>
35
+ <div v-for='(item, index) in markersArray' :key="item.index">
36
+ <project-marker
37
+ :activeLanguage="'en-us'"
38
+ :markerData="item"
39
+ :isLimitedPartner="false"
40
+ :isGroupSupport="false"
41
+ :isEditable="true"
42
+ :gettext="gettext"
43
+ :date="'23.07.2022'"
44
+ @editHandler="consoleLog('edit index ' + index)"
45
+ @deleteHandler="consoleLog('delete id ' + item.id)"
46
+ />
47
+ </div>
48
+ </row-container>
49
+ <br />
50
+ <iconCollection />
37
51
  <br />
38
52
  <toggle
39
53
  @on-toggle-change="onInputChange($event)"
@@ -45,113 +59,73 @@
45
59
  :disabled="false"
46
60
  />
47
61
  <br />
48
- >>>>>>> EPDM-5448
49
- <input-number
50
- :value="inputValue"
51
- @input-change="inputValue = $event"
52
- inputWidth="250px"
53
- slotSize="50%"
54
- ><InputAnnexContainer>
55
- <span>123m2</span>
56
- <info-text size="10px" alignArrow="right" text="infoText ceci est le text"></info-text>
57
- </InputAnnexContainer>
58
- </input-number>
59
62
  <input-number
63
+ placeholder="Enter distance"
64
+ :numberPrecision="2"
60
65
  :value="inputValue"
61
- @input-change="inputValue = $event"
62
- inputWidth="250px"
63
- slotSize="50%"
64
- :isError="true"
65
- ><InputAnnexContainer>
66
- <span>123m2</span>
67
- <info-text :style="{'justify-self': 'end'}" size="12px" alignArrow="center" text="infoText ceci est le text">This is the tooltip text</info-text>
68
- </InputAnnexContainer>
69
- </input-number>
66
+ @input-change="onInputChange($event)"
67
+ />
70
68
  <br />
71
-
72
- <p>InputText</p>
73
- <input-text
74
- placeholder="Company name"
75
- :value="inputValue"
76
- :isError="true"
77
- errorMessage="This is my error message"
78
- infoTextAlign="right"
79
- infoTextMessage="My info message"
80
- label="Question 5"
81
- alignItems="vertical"
82
- inputWidth="250px"
83
- minWidth="100px"
84
- />
85
- <br/>
86
- <input-number
87
- :value="num"
88
- @input-change="num = $event"
89
- unitName="t"
90
- id="biebie"
91
- test="koko"
92
- @keydown="keydownHandler"
69
+ <page-subtitle text="My Subtitle" infoText="My info Text" />
70
+ <spinner size="30px" />
71
+ <checkbox
72
+ label="Do you accept the Terms?"
73
+ :isChecked="true"
74
+ size="small"
75
+ :isDisabled="false"
93
76
  />
77
+ <external-button text="Click me!" minWidth="500px" />
94
78
  </page-container>
95
79
  </ThemeProvider>
96
80
  </template>
97
81
 
98
82
  <script>
99
- <<<<<<< HEAD
100
- import { ThemeProvider } from "vue-styled-components"
101
- import theme from "./assets/theme"
102
- import styled from "vue-styled-components"
103
- import MainTable from "@/components/tables/mainTable"
104
- import ThreeDots from "@/components/threeDots"
105
- import Toggle from "@/components/inputs/toggle"
106
- import InputNumber from "@/components/inputs/inputNumber"
107
- import Checkbox from "@/components/inputs/checkbox"
108
- import PageSubtitle from "@/components/pageSubtitle"
109
- import Spinner from "@/components/spinner"
110
- import ExternalButton from "@/components/buttons/externalButton"
111
- import InputText from "@/components/inputs/inputText"
112
- =======
113
83
  import { ThemeProvider } from 'vue-styled-components'
114
84
  import theme from './assets/theme'
115
85
  import styled from 'vue-styled-components'
116
86
  import MainTable from '@/components/tables/mainTable'
117
87
  import ThreeDots from '@/components/threeDots'
118
- import iconWrapper from '@/components/iconWrapper'
119
88
  import Toggle from '@/components/inputs/toggle'
120
89
  import InputNumber from '@/components/inputs/inputNumber'
121
90
  import Checkbox from '@/components/inputs/checkbox'
122
91
  import PageSubtitle from '@/components/pageSubtitle'
123
92
  import Spinner from '@/components/spinner'
124
93
  import ExternalButton from '@/components/buttons/externalButton'
94
+ import ProjectMarker from '@/components/projectMarker'
95
+ import iconCollection from '@/components/icon/iconCollection'
125
96
  import Modal from '@/components/modals/modal'
126
- >>>>>>> EPDM-5448
127
97
  // import TableDropdown from "@/components/tableDropdown"
128
- const InputAnnexContainer = styled.div`
129
- display: grid;
130
- grid-template-columns: auto auto;
131
- grid-gap: 10px;
132
- `
133
98
 
134
99
  const PageContainer = styled.div`
135
100
  padding: 40px;
136
101
  `
137
102
 
103
+ const RowContainer = styled.div`
104
+ display: inline-flex;
105
+ gap: 10px;
106
+ flex-wrap: wrap;
107
+ `
108
+
138
109
  export default {
139
110
  name: 'App',
140
111
  components: {
141
112
  ThemeProvider,
142
113
  PageContainer,
114
+ MainTable,
115
+ ThreeDots,
116
+ Toggle,
143
117
  InputNumber,
144
118
  PageSubtitle,
145
119
  Spinner,
146
120
  Checkbox,
147
- InputText,
148
121
  ExternalButton,
149
- iconWrapper,
150
122
  Modal,
123
+ ProjectMarker,
124
+ iconCollection,
125
+ RowContainer
151
126
  },
152
127
  data() {
153
128
  return {
154
- num: 42,
155
129
  inputValue: null,
156
130
  checkedOption: 'button_1',
157
131
  question: {
@@ -207,11 +181,15 @@ export default {
207
181
  id: 4,
208
182
  },
209
183
  ],
184
+ markersArray: [{"id":1180,"choice":"project-on-hold","translations":{"fr":{"name":"fr - Project on hold"},"en-us":{"name":"Project on hold"},"it-ch":{"name":"it-ch - Project on hold"},"de-ch":{"name":"de-ch - Project on hold"},"fr-be":{"name":"fr-be - Project on hold"}},"color":"#D27CCA","can_be_deleted":true}, {"id":266,"choice":"transferred","translations":{"en-us":{"name":"Transferred"},"fr":{"name":"fr - Transferred"},"de-ch":{"name":"de-ch - Transferred"},"it-ch":{"name":"it-ch - Transferred"},"fr-be":{"name":"fr-be - Transferred"}},"color":"#20A4CA","can_be_deleted":false},{"id":267,"choice":"sold","translations":{"en-us":{"name":"Sold"},"fr":{"name":"Vendu"},"de-ch":{"name":"Verkauft"},"it-ch":{"name":"Venduto"},"fr-be":{"name":"Vendu"}},"color":"#008351","can_be_deleted":false},{"id":268,"choice":"lost","translations":{"en-us":{"name":"Lost"},"fr":{"name":"Perdu"},"de-ch":{"name":"Verloren"},"it-ch":{"name":"Perso"},"fr-be":{"name":"Perdu"}},"color":"#A52019","can_be_deleted":false},{"id":1181,"choice":"project-created","translations":{"fr":{"name":"Project created"},"en-us":{"name":"Project created"},"it-ch":{"name":"Project created"},"de-ch":{"name":"Project created"},"fr-be":{"name":"Project created"}},"color":"#FDB813","can_be_deleted":true}]
210
185
  }
211
186
  },
212
187
  methods: {
213
- keydownHandler(e) {
214
- console.log('test', e)
188
+ consoleLog(data) {
189
+ console.log(data)
190
+ },
191
+ gettext(string) {
192
+ return string.toUpperCase()
215
193
  },
216
194
  getTheme() {
217
195
  return theme
@@ -262,8 +240,8 @@ export default {
262
240
  item = '-'
263
241
  }
264
242
  return item
265
- }
266
- }
243
+ },
244
+ },
267
245
  }
268
246
  </script>
269
247
 
@@ -273,4 +251,4 @@ body {
273
251
  height: 100%;
274
252
  margin: 0;
275
253
  }
276
- </style>
254
+ </style>
@@ -0,0 +1,4 @@
1
+ <svg fill="none" height="10" viewBox="0 0 10 10" width="10" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M9.87865 8.47868L8.47865 9.87868L0.121287 1.52132L1.52129 0.121318L5.69997 4.3L9.87865 8.47868Z" fill="black"/>
3
+ <path d="M1.5213 9.87868L0.121302 8.47868L8.47866 0.12132L9.87866 1.52132L1.5213 9.87868Z" fill="black"/>
4
+ </svg>
@@ -1,4 +1,4 @@
1
- <svg fill="none" height="16" viewbox="12 12 16 16" width="16" xmlns="http://www.w3.org/2000/svg">
1
+ <svg fill="none" height="23" viewbox="6 12 34 23" width="34" xmlns="http://www.w3.org/2000/svg">
2
2
  <mask height="14" id="mask0_6458_86453" maskunits="userSpaceOnUse" style="mask-type:alpha" width="14" x="13" y="13">
3
3
  <rect fill="#FF5656" height="14" width="14" x="13" y="13"></rect>
4
4
  </mask>
@@ -0,0 +1,4 @@
1
+ <svg fill="none" height="10" viewBox="0 0 10 10" width="10" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M3 9.98993L3.47934e-07 6.01003L10 6.01003V7.98993L3 7.98993L3 9.98993Z" fill="black"/>
3
+ <path d="M7 0.0100708L10 3.98997H0L1.19209e-07 2.01007L7 2.01007V0.0100708Z" fill="black"/>
4
+ </svg>
@@ -19,8 +19,6 @@ const theme = {
19
19
  grey4: '#dee2eb',
20
20
  grey5: '#fafafa',
21
21
  green: '#99db0c',
22
- transparentWhite1:'#ffffff32',
23
- transparentBlack1:'#263238e6',
24
22
  disabled: '#dfe1e1'
25
23
  },
26
24
  screen: {
@@ -1,6 +1,6 @@
1
1
  <template>
2
+ <wrapper :isDisabled="isDisabled" :size="size" :cursor="cursor">
2
3
  <icon-image
3
- :disabled="disabled"
4
4
  :size="size"
5
5
  :color="color"
6
6
  :hoveredColor="hoveredColor"
@@ -8,6 +8,7 @@
8
8
  require(`!html-loader!./../../assets/svgIcons/${name.toLowerCase()}.svg`)
9
9
  "
10
10
  ></icon-image>
11
+ </wrapper>
11
12
  </template>
12
13
 
13
14
  <script>
@@ -22,17 +23,19 @@
22
23
 
23
24
  import styled from 'vue-styled-components'
24
25
 
25
- const IconImageProps = { color: String, hoveredColor: String, size: String ,disabled:Boolean}
26
- const IconImage = styled('div', IconImageProps)`
27
- display: inline-flex;
26
+ const wrapperAttrs = { isDisabled: Boolean, size: String, cursor: String }
27
+ const Wrapper = styled('div', wrapperAttrs)`
28
+ display: inline-block;
28
29
  width: ${(props) => props.size};
29
30
  height: ${(props) => props.size};
30
- justify-content:center;
31
- align-items:center;
32
- cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};
31
+ cursor: ${(props) => (props.isDisabled ? 'not-allowed' : props.cursor)};
32
+ line-height: 0;
33
+ `
34
+ const IconImageProps = { color: String, hoveredColor: String, size: String }
35
+ const IconImage = styled('div', IconImageProps)`
33
36
  svg {
34
- width: 100%;
35
- height: 100%;
37
+ width: ${(props) => props.size};
38
+ height: ${(props) => props.size};
36
39
  }
37
40
  svg > path {
38
41
  ${(props) =>
@@ -46,10 +49,11 @@ const IconImage = styled('div', IconImageProps)`
46
49
  export default {
47
50
  name: 'icon',
48
51
  components: {
52
+ Wrapper,
49
53
  IconImage
50
54
  },
51
55
  props: {
52
- disabled: {
56
+ isDisabled: {
53
57
  required: false,
54
58
  default: false
55
59
  },
@@ -65,10 +69,14 @@ export default {
65
69
  size: {
66
70
  required: false,
67
71
  default: '30px'
72
+ },
73
+ cursor: {
74
+ required: false,
75
+ default: 'pointer'
68
76
  }
69
77
  },
70
78
  data() {
71
79
  return {}
72
80
  }
73
81
  }
74
- </script>
82
+ </script>
@@ -1,25 +1,34 @@
1
1
  <template>
2
2
  <component-wrapper>
3
- <icon-wrapper :size="size">
3
+ <icon-wrapper>
4
4
  <icon-img
5
5
  :isActive="showInfo"
6
6
  :size="size"
7
7
  :borderColor="borderColor"
8
8
  @click.prevent="toggleShowInfo()"
9
- @mouseenter="openTrigger == 'onHover' ? toggleShowInfo() : ''"
10
- @mouseleave="openTrigger == 'onHover' ? toggleShowInfo() : ''"
9
+ @mouseenter="toggleShowInfo()"
10
+ @mouseleave="toggleShowInfo()"
11
11
  >
12
- <icon :size="size" name="info" :color="iconColor" />
12
+ <svg
13
+ class="img-icon"
14
+ :width="size"
15
+ :height="size"
16
+ viewBox="0 0 24 24"
17
+ fill="none"
18
+ xmlns="http://www.w3.org/2000/svg"
19
+ >
20
+ <path
21
+ class="img-icon"
22
+ d="M20.4853 3.51469C18.2188 1.24823 15.2053 0 12 0C8.79469 0 5.78123 1.24823 3.51469 3.51469C1.24823 5.78123 0 8.79469 0 12C0 15.2053 1.24823 18.2188 3.51469 20.4853C5.78123 22.7518 8.79469 24 12 24C15.2053 24 18.2188 22.7518 20.4853 20.4853C22.7518 18.2188 24 15.2053 24 12C24 8.79469 22.7518 5.78123 20.4853 3.51469ZM12 3.28125C13.4216 3.28125 14.5781 4.4378 14.5781 5.85938C14.5781 7.28095 13.4216 8.4375 12 8.4375C10.5784 8.4375 9.42188 7.28095 9.42188 5.85938C9.42188 4.4378 10.5784 3.28125 12 3.28125ZM15.2812 19.6875H8.71875V18.2812H10.125V11.9167H8.71875V10.5104H13.875V18.2812H15.2812V19.6875Z"
23
+ fill="#D5D5D5"
24
+ />
25
+ </svg>
13
26
  </icon-img>
14
27
  <text-overlay
15
28
  v-if="showInfo"
16
29
  :borderColor="borderColor"
17
30
  :alignText="alignText"
18
- :width="width"
19
- :halfComputedTextInfoWidth="halfComputedTextInfoWidth"
20
- :alignArrow="alignArrow"
21
- :iconSize="size"
22
- ><slot />
31
+ >
23
32
  {{ text }}
24
33
  </text-overlay>
25
34
  </icon-wrapper>
@@ -35,23 +44,22 @@
35
44
  // size="20"
36
45
  // alignText="right" // default is left
37
46
  // />
38
- import theme from '@/assets/theme.js'
39
- import styled from 'vue-styled-components'
40
- import icon from '../icon'
41
47
 
42
- const textAttrs = { iconSize:String, borderColor: String, alignArrow:String, alignText: String, width:String,halfComputedTextInfoWidth:Number }
43
- const TextOverlay = styled('div', textAttrs)`
48
+ import styled from "vue-styled-components"
49
+
50
+ const IconWrapper = styled.div`
51
+ position: relative;
52
+ `
53
+
54
+ const textAttrs = { borderColor: String, alignText: String }
55
+ const TextOverlay = styled("div", textAttrs)`
44
56
  position: absolute;
45
- top: ${(props) => 'calc('+props.iconSize+' + 15px)'};
46
- ${(props) => (props.alignArrow === 'left'
47
- ? 'left: calc('+props.iconSize+' /2 - 18px)'
48
- : props.alignArrow === 'center'
49
- ? 'left: calc((-'+props.width+' + '+props.iconSize+') /2 + 2px)'
50
- : 'right: calc('+props.iconSize+' /2 - 17px)')};
51
- text-align: ${(props) => props.alignText};
57
+ top: 26px;
58
+ right: ${(props) => (props.alignText === "left" ? "-10px" : "inherit")};
59
+ left: ${(props) => (props.alignText === "left" ? "inherit" : "-10px")};
52
60
  background: ${(props) => props.theme.colors.black};
53
61
  padding: 10px;
54
- width: ${(props) => props.width };
62
+ width: max-content;
55
63
  max-width: 400px;
56
64
  font-size: 13px;
57
65
  font-weight: 400;
@@ -60,13 +68,12 @@ const TextOverlay = styled('div', textAttrs)`
60
68
  color: ${(props) => props.theme.colors.white};
61
69
 
62
70
  :before {
63
- content: '';
71
+ content: "";
64
72
  background-color: ${(props) => props.theme.colors.black};
65
73
  position: absolute;
66
74
  top: 2px;
67
- ${(props) => (props.alignArrow === 'left' ? 'left:40px;' :
68
- props.alignArrow=='center' ? 'left: calc(50% + 19px);' :
69
- 'right:-13px;')};
75
+ right: ${(props) => (props.alignText === "left" ? "-12px" : "inherit")};
76
+ left: ${(props) => (props.alignText === "left" ? "inherit" : "40px")};
70
77
  height: 8px;
71
78
  width: 8px;
72
79
  transform-origin: center center;
@@ -75,15 +82,18 @@ const TextOverlay = styled('div', textAttrs)`
75
82
  `
76
83
 
77
84
  const iconAttrs = { isActive: Boolean, size: String, borderColor: String }
78
-
79
- const IconWrapper = styled('div', iconAttrs)`
80
- position: relative;
81
- top: 1px;
82
- height: ${(props) => props.size};
83
- `
84
- const IconImg = styled('div', iconAttrs)`
85
+ const IconImg = styled("div", iconAttrs)`
85
86
  cursor: pointer;
86
- height: ${(props) => props.size};
87
+ height: ${(props) => props.size + "px"};
88
+
89
+ .img-icon {
90
+ fill: ${(props) =>
91
+ props.isActive
92
+ ? props.borderColor
93
+ ? props.borderColor
94
+ : props.theme.colors.secondary
95
+ : props.theme.colors.mediumGray};
96
+ }
87
97
  `
88
98
 
89
99
  const ComponentWrapper = styled.div`
@@ -91,51 +101,38 @@ const ComponentWrapper = styled.div`
91
101
  `
92
102
 
93
103
  export default {
94
- name: 'info-text',
104
+ name: "info-text",
95
105
  components: {
96
106
  IconWrapper,
97
107
  TextOverlay,
98
108
  ComponentWrapper,
99
109
  IconImg,
100
- icon
101
110
  },
102
111
  props: {
103
112
  text: {
104
- required: false,
113
+ required: true,
105
114
  },
106
115
  borderColor: {
107
116
  required: false,
108
- default: null
117
+ default: null,
109
118
  },
110
119
  size: {
111
120
  required: false,
112
- default: '14px'
121
+ default: "20",
113
122
  },
114
123
  alignText: {
115
124
  required: false,
116
- default: 'left' // "left" or "right"
117
- },
118
- alignArrow:{
119
- required:false,
120
- default:'center'
121
- },
122
- openTrigger:{
123
- required:false,
124
- default: 'onClick'
125
+ default: "left", // "left" or "right"
125
126
  },
126
- width:{
127
- required:false,
128
- default:'165px'
129
- }
130
127
  },
131
128
  methods: {
132
129
  toggleShowInfo() {
133
130
  this.showInfo = !this.showInfo
134
131
 
135
132
  if (this.showInfo) {
136
- document.addEventListener('click', this.clickOutside)
133
+ document.addEventListener("click", this.clickOutside)
137
134
  } else {
138
- document.removeEventListener('click', this.clickOutside)
135
+ document.removeEventListener("click", this.clickOutside)
139
136
  }
140
137
  },
141
138
  clickOutside(event) {
@@ -143,24 +140,12 @@ export default {
143
140
  return
144
141
  }
145
142
  this.toggleShowInfo()
146
- }
143
+ },
147
144
  },
148
145
  data() {
149
146
  return {
150
147
  showInfo: false,
151
148
  }
152
149
  },
153
- computed: {
154
- iconColor() {
155
- return this.isActive
156
- ? this.borderColor
157
- ? this.borderColor
158
- : theme.colors.secondary
159
- : theme.colors.mediumGray
160
- },
161
- halfComputedTextInfoWidth() {
162
- return parseInt(this.width)/2;
163
- }
164
- }
165
150
  }
166
- </script>
151
+ </script>