@eturnity/eturnity_reusable_components 1.2.19-EPDM-5262.5 → 1.2.19-EPDM-3412.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-EPDM-5262.5",
3
+ "version": "1.2.19-EPDM-3412.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
package/src/App.vue CHANGED
@@ -2,82 +2,87 @@
2
2
  <ThemeProvider :theme="getTheme()" :style="{ height: '100%' }">
3
3
  <page-container>
4
4
  <br />
5
- <input-number
6
- :value="inputValue"
7
- @input-change="inputValue = $event"
8
- inputWidth="250px"
9
- slotSize="50%"
10
- ><InputAnnexContainer>
11
- <span>123m2</span>
12
- <info-text size="10" alignArrow="right" text="infoText ceci est le text"></info-text>
13
- </InputAnnexContainer>
14
- </input-number>
15
- <input-number
16
- :value="inputValue"
17
- @input-change="inputValue = $event"
18
- inputWidth="250px"
19
- slotSize="50%"
20
- :isError="true"
21
- ><InputAnnexContainer>
22
- <span>123m2</span>
23
- <info-text :style="{'justify-self': 'end'}" size="12" alignArrow="center" text="infoText ceci est le text">This is the tooltip text</info-text>
24
- </InputAnnexContainer>
25
- </input-number>
5
+ <modal backdrop="dark" :isLoading="false" :isOpen="true">
6
+ <main-table titleText="My Table">
7
+ <thead>
8
+ <tr>
9
+ <th>Column 1</th>
10
+ <th>Column 2</th>
11
+ <th>Column 3</th>
12
+ <div />
13
+ </tr>
14
+ </thead>
15
+ <tbody>
16
+ <tr>
17
+ <!-- <table-dropdown
18
+ :colSpan="3"
19
+ :tableItems="getDropdownValues()"
20
+ @toggle-dropdown-open="toggleDropdownOpen()"
21
+ @item-selected="onItemSelected({ item: $event, index })"
22
+ :isOpen="isDropdownOpen()"
23
+ :optionItems="itemOptions"
24
+ :optionsDisplay="['display_name', 'company_item_number', 'model']"
25
+ /> -->
26
+ <td>Test</td>
27
+ <div class="icons-container">
28
+ <three-dots :options="listOptions" :isLoading="false" />
29
+ </div>
30
+ </tr>
31
+ </tbody>
32
+ </main-table>
33
+ </modal>
26
34
  <br />
27
- <div :style="{ 'margin': '50px'}">
28
- <input-number
29
- labelText="Panel inclination"
30
- labelInfoText="
31
- Defines the slope of the installed panels to the horizon.
32
- "
33
- :value="inputValue"
34
-
35
- />
36
- <info-text size="100" alignArrow="center" width="360px">This is the tooltip text center</info-text>
37
- <br /><br />
38
- <info-text size="50" alignArrow="center" width="120px">This is the tooltip text center</info-text>
39
- <br /><br />
40
- <info-text size="10" alignArrow="center" width="100%">This is the tooltip text center</info-text>
41
- <br /><br /><br /><br /><br />
42
- <info-text size="100" alignArrow="left" width="360px">This is the tooltip text center</info-text>
43
- <br /><br />
44
- <info-text size="50" alignArrow="left" width="360px">This is the tooltip text center</info-text>
45
- <br /><br />
46
- <info-text size="10" alignArrow="left" width="360px">This is the tooltip text center</info-text>
47
- <br /><br />
48
- <br /><br /><br />
49
- <info-text size="100" alignArrow="right" width="360px">This is the tooltip text center</info-text>
50
- <br /><br />
51
- <info-text size="50" alignArrow="right" width="360px">This is the tooltip text center</info-text>
52
- <br /><br />
53
- <info-text size="10" alignArrow="right" width="360px">This is the tooltip text center</info-text>
54
- <br /><br />
55
- </div>
56
- <input-number
57
- placeholder="Enter distance"
58
- :numberPrecision="2"
59
- :value="inputValue"
60
- @input-change="onInputChange($event)"
61
- >unit</input-number
62
- >
35
+ <toggle
36
+ @on-toggle-change="onInputChange($event)"
37
+ :isChecked="inputValue"
38
+ label="My Label Text"
39
+ infoTextMessage="This is my test message"
40
+ infoTextAlign="right"
41
+ labelAlign="right"
42
+ :disabled="false"
43
+ />
63
44
  <br />
45
+
46
+ <p>InputText</p>
47
+ <input-text
48
+ placeholder="Company name"
49
+ :value="inputValue"
50
+ :isError="true"
51
+ errorMessage="This is my error message"
52
+ infoTextAlign="right"
53
+ infoTextMessage="My info message"
54
+ label="Question 5"
55
+ alignItems="vertical"
56
+ inputWidth="250px"
57
+ minWidth="100px"
58
+ />
59
+ <br/>
60
+ <input-number
61
+ :value="num"
62
+ @input-change="num = $event"
63
+ unitName="t"
64
+ id="biebie"
65
+ test="koko"
66
+ @keydown="keydownHandler"
67
+ />
64
68
  </page-container>
65
69
  </ThemeProvider>
66
70
  </template>
67
71
 
68
72
  <script>
69
- import { ThemeProvider } from 'vue-styled-components'
70
- import theme from './assets/theme'
71
- import styled from 'vue-styled-components'
72
-
73
- import InputNumber from '@/components/inputs/inputNumber'
74
- import infoText from '@/components/infoText'
73
+ import { ThemeProvider } from "vue-styled-components"
74
+ import theme from "./assets/theme"
75
+ import styled from "vue-styled-components"
76
+ import MainTable from "@/components/tables/mainTable"
77
+ import ThreeDots from "@/components/threeDots"
78
+ import Toggle from "@/components/inputs/toggle"
79
+ import InputNumber from "@/components/inputs/inputNumber"
80
+ import Checkbox from "@/components/inputs/checkbox"
81
+ import PageSubtitle from "@/components/pageSubtitle"
82
+ import Spinner from "@/components/spinner"
83
+ import ExternalButton from "@/components/buttons/externalButton"
84
+ import InputText from "@/components/inputs/inputText"
75
85
  // import TableDropdown from "@/components/tableDropdown"
76
- const InputAnnexContainer = styled.div`
77
- display: grid;
78
- grid-template-columns: auto auto;
79
- grid-gap: 10px;
80
- `
81
86
 
82
87
  const PageContainer = styled.div`
83
88
  padding: 40px;
@@ -88,20 +93,27 @@ export default {
88
93
  components: {
89
94
  ThemeProvider,
90
95
  PageContainer,
96
+ MainTable,
97
+ ThreeDots,
98
+ Toggle,
91
99
  InputNumber,
92
- infoText,
93
- InputAnnexContainer
94
- // TableDropdown,
100
+ PageSubtitle,
101
+ Spinner,
102
+ Checkbox,
103
+ InputText,
104
+ ExternalButton,
105
+ Modal,
95
106
  },
96
107
  data() {
97
108
  return {
109
+ num: 42,
98
110
  inputValue: null,
99
111
  checkedOption: 'button_1',
100
112
  question: {
101
113
  number_format_precision: 4,
102
114
  number_min_allowed: 0,
103
115
  number_max_allowed: 10,
104
- unit_short_name: 'cm'
116
+ unit_short_name: 'cm',
105
117
  },
106
118
  dropdownOpen: false,
107
119
  isChecked: false,
@@ -109,50 +121,53 @@ export default {
109
121
  {
110
122
  name: 'Option 1',
111
123
  value: 'option_1',
112
- disabled: true
124
+ disabled: true,
113
125
  },
114
126
  {
115
127
  name: 'Option 2',
116
- value: 'option_2'
128
+ value: 'option_2',
117
129
  },
118
130
  {
119
131
  name: 'Option 3',
120
- value: 'option_3'
132
+ value: 'option_3',
121
133
  },
122
134
  {
123
135
  name: 'Option 4',
124
- value: 'option_4'
125
- }
136
+ value: 'option_4',
137
+ },
126
138
  ],
127
139
  itemOptions: [
128
140
  {
129
141
  display_name: 'Test 1',
130
142
  company_item_number: '123',
131
143
  model: 'BTB-2145 Long Text Long Text Long Text Long Text Long Text',
132
- id: 1
144
+ id: 1,
133
145
  },
134
146
  {
135
147
  display_name: 'Test 2',
136
148
  company_item_number: '1234',
137
149
  model: 'BTB-123',
138
- id: 2
150
+ id: 2,
139
151
  },
140
152
  {
141
153
  display_name: 'Test 3',
142
154
  company_item_number: '12345',
143
155
  model: 'BTB-543',
144
- id: 3
156
+ id: 3,
145
157
  },
146
158
  {
147
159
  display_name: 'Test 4',
148
160
  company_item_number: '123456',
149
161
  model: 'BTB-4930',
150
- id: 4
151
- }
152
- ]
162
+ id: 4,
163
+ },
164
+ ],
153
165
  }
154
166
  },
155
167
  methods: {
168
+ keydownHandler(e) {
169
+ console.log('test', e)
170
+ },
156
171
  getTheme() {
157
172
  return theme
158
173
  },
@@ -174,21 +189,21 @@ export default {
174
189
  {
175
190
  value: this.getComponentInfo({
176
191
  row: this.itemOptions[0],
177
- value: 'display_name'
178
- })
192
+ value: 'display_name',
193
+ }),
179
194
  },
180
195
  {
181
196
  value: this.getComponentInfo({
182
197
  row: this.itemOptions[0],
183
- value: 'company_item_number'
184
- })
198
+ value: 'company_item_number',
199
+ }),
185
200
  },
186
201
  {
187
202
  value: this.getComponentInfo({
188
203
  row: this.itemOptions[0],
189
- value: 'model'
190
- })
191
- }
204
+ value: 'model',
205
+ }),
206
+ },
192
207
  ]
193
208
  return items
194
209
  },
@@ -1,34 +1,34 @@
1
1
  const theme = {
2
2
  colors: {
3
- primary: "#48a2d0",
4
- secondary: "#fdb813",
5
- tertiary: "#d5d5d5",
6
- black: "#353535",
7
- yellow: "#fdb813",
8
- darkGray: "#818181",
9
- gray1: "#666",
10
- mediumGray: "#d5d5d5",
11
- lightGray: "#f2f2f2",
12
- white: "#fff",
13
- blue: "#48a2d0",
14
- red: "#ff5656",
15
- blue1: "#e4efff",
16
- grey1: "#666",
17
- grey2: "#c4c4c4",
18
- grey3: "#b2b9c5",
19
- grey4: "#ebeef4",
20
- grey5: "#fafafa",
21
- green: "#99db0c",
22
- disabled: "#dfe1e1",
3
+ primary: '#48a2d0',
4
+ secondary: '#fdb813',
5
+ tertiary: '#d5d5d5',
6
+ black: '#353535',
7
+ yellow: '#fdb813',
8
+ darkGray: '#818181',
9
+ gray1: '#666',
10
+ mediumGray: '#d5d5d5',
11
+ lightGray: '#f2f2f2',
12
+ white: '#fff',
13
+ blue: '#48a2d0',
14
+ red: '#ff5656',
15
+ blue1: '#e4efff',
16
+ grey1: '#666',
17
+ grey2: '#c4c4c4',
18
+ grey3: '#b2b9c5',
19
+ grey4: '#dee2eb',
20
+ grey5: '#fafafa',
21
+ green: '#99db0c',
22
+ disabled: '#dfe1e1'
23
23
  },
24
24
  screen: {
25
- mobileSmall: "345px",
26
- mobile: "425px",
27
- mobileLarge: "530px",
28
- tablet: "768px",
29
- tabletLarge: "950px",
25
+ mobileSmall: '345px',
26
+ mobile: '425px',
27
+ mobileLarge: '530px',
28
+ tablet: '768px',
29
+ tabletLarge: '950px'
30
30
  },
31
- borderRadius: "4px",
31
+ borderRadius: '4px'
32
32
  }
33
33
 
34
34
  export default theme
@@ -0,0 +1,62 @@
1
+ <template>
2
+ <component-wrapper>
3
+ <text-overlay>
4
+ <slot></slot>
5
+ </text-overlay>
6
+ </component-wrapper>
7
+ </template>
8
+
9
+ <script>
10
+ // import InfoText from "@eturnity/eturnity_reusable_components/src/components/infoText"
11
+ //To use:
12
+ // <error-message
13
+ // alignText="right" // default is left
14
+ // />
15
+
16
+ import styled from 'vue-styled-components'
17
+
18
+ const TextOverlay = styled.div`
19
+ position: absolute;
20
+ top: calc(100% + 13px);
21
+ background: ${(props) => props.theme.colors.red};
22
+ padding: 10px;
23
+ width: max-content;
24
+ max-width: 100%;
25
+ min-width: 200px;
26
+ font-size: 11px;
27
+ font-weight: 400;
28
+ border-radius: 4px;
29
+ font-family: 'Lato-Bold', Arial;
30
+ z-index: 99;
31
+ color: ${(props) => props.theme.colors.white};
32
+
33
+ :before {
34
+ content: '';
35
+ background-color: ${(props) => props.theme.colors.red};
36
+ position: absolute;
37
+ top: 2px;
38
+ left: 40px;
39
+ height: 11px;
40
+ width: 11px;
41
+ transform-origin: center center;
42
+ transform: translate(-2em, -0.5em) rotate(45deg);
43
+ }
44
+ `
45
+
46
+ const ComponentWrapper = styled.div`
47
+ display: block;
48
+ `
49
+
50
+ export default {
51
+ name: 'info-text',
52
+ components: {
53
+ TextOverlay,
54
+ ComponentWrapper
55
+ },
56
+ props: {},
57
+ methods: {},
58
+ data() {
59
+ return {}
60
+ }
61
+ }
62
+ </script>
@@ -37,7 +37,8 @@ const IconImage = styled('div', IconImageProps)`
37
37
  height: ${(props) => props.size};
38
38
  }
39
39
  svg > path {
40
- ${(props) => props.color && `fill: ${props.color};`}
40
+ ${(props) =>
41
+ props.color && `fill: ${props.theme.colors[props.color] || props.color};`}
41
42
  }
42
43
  &:hover > svg > path {
43
44
  ${(props) => props.hoveredColor && `fill: ${props.hoveredColor};`}
@@ -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 + 'px'" 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,21 +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:Number, 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) => (parseInt(props.iconSize) + 15)}px;
46
- ${(props) => (props.alignArrow === 'left' ? 'left: '+((props.iconSize/2)-18)+'px;' :
47
- props.alignArrow === 'center' ? 'left: calc((-'+props.width+' + '+props.iconSize+'px)/2 - 7px);':
48
- 'right: '+((props.iconSize/2)-17)+'px;')};
49
- text-align: ${(props) => props.alignText};
57
+ top: 26px;
58
+ right: ${(props) => (props.alignText === "left" ? "-10px" : "inherit")};
59
+ left: ${(props) => (props.alignText === "left" ? "inherit" : "-10px")};
50
60
  background: ${(props) => props.theme.colors.black};
51
61
  padding: 10px;
52
- width: ${(props) => props.width };
62
+ width: max-content;
53
63
  max-width: 400px;
54
64
  font-size: 13px;
55
65
  font-weight: 400;
@@ -58,13 +68,12 @@ const TextOverlay = styled('div', textAttrs)`
58
68
  color: ${(props) => props.theme.colors.white};
59
69
 
60
70
  :before {
61
- content: '';
71
+ content: "";
62
72
  background-color: ${(props) => props.theme.colors.black};
63
73
  position: absolute;
64
74
  top: 2px;
65
- ${(props) => (props.alignArrow === 'left' ? 'left:40px;' :
66
- props.alignArrow=='center' ? 'left: calc(50% + 19px);' :
67
- 'right:-13px;')};
75
+ right: ${(props) => (props.alignText === "left" ? "-12px" : "inherit")};
76
+ left: ${(props) => (props.alignText === "left" ? "inherit" : "40px")};
68
77
  height: 8px;
69
78
  width: 8px;
70
79
  transform-origin: center center;
@@ -73,15 +82,18 @@ const TextOverlay = styled('div', textAttrs)`
73
82
  `
74
83
 
75
84
  const iconAttrs = { isActive: Boolean, size: String, borderColor: String }
76
-
77
- const IconWrapper = styled('div', iconAttrs)`
78
- position: relative;
79
- top: 1px;
80
- height: ${(props) => props.size}px;
81
- `
82
- const IconImg = styled('div', iconAttrs)`
85
+ const IconImg = styled("div", iconAttrs)`
83
86
  cursor: pointer;
84
- height: ${(props) => props.size}px;
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
+ }
85
97
  `
86
98
 
87
99
  const ComponentWrapper = styled.div`
@@ -89,51 +101,38 @@ const ComponentWrapper = styled.div`
89
101
  `
90
102
 
91
103
  export default {
92
- name: 'info-text',
104
+ name: "info-text",
93
105
  components: {
94
106
  IconWrapper,
95
107
  TextOverlay,
96
108
  ComponentWrapper,
97
109
  IconImg,
98
- icon
99
110
  },
100
111
  props: {
101
112
  text: {
102
- required: false,
113
+ required: true,
103
114
  },
104
115
  borderColor: {
105
116
  required: false,
106
- default: null
117
+ default: null,
107
118
  },
108
119
  size: {
109
120
  required: false,
110
- default: '14'
121
+ default: "20",
111
122
  },
112
123
  alignText: {
113
124
  required: false,
114
- default: 'left' // "left" or "right"
115
- },
116
- alignArrow:{
117
- required:false,
118
- default:'center'
119
- },
120
- openTrigger:{
121
- required:false,
122
- default: 'onClick'
125
+ default: "left", // "left" or "right"
123
126
  },
124
- width:{
125
- required:false,
126
- default:'165px'
127
- }
128
127
  },
129
128
  methods: {
130
129
  toggleShowInfo() {
131
130
  this.showInfo = !this.showInfo
132
131
 
133
132
  if (this.showInfo) {
134
- document.addEventListener('click', this.clickOutside)
133
+ document.addEventListener("click", this.clickOutside)
135
134
  } else {
136
- document.removeEventListener('click', this.clickOutside)
135
+ document.removeEventListener("click", this.clickOutside)
137
136
  }
138
137
  },
139
138
  clickOutside(event) {
@@ -141,24 +140,12 @@ export default {
141
140
  return
142
141
  }
143
142
  this.toggleShowInfo()
144
- }
143
+ },
145
144
  },
146
145
  data() {
147
146
  return {
148
147
  showInfo: false,
149
148
  }
150
149
  },
151
- computed: {
152
- iconColor() {
153
- return this.isActive
154
- ? this.borderColor
155
- ? this.borderColor
156
- : theme.colors.secondary
157
- : theme.colors.mediumGray
158
- },
159
- halfComputedTextInfoWidth() {
160
- return parseInt(this.width)/2;
161
- }
162
- }
163
150
  }
164
- </script>
151
+ </script>