@eturnity/eturnity_reusable_components 1.2.17 → 1.2.18-v.5.39.2

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.17",
3
+ "version": "1.2.18-v.5.39.2",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
package/src/App.vue CHANGED
@@ -1,18 +1,20 @@
1
1
  <template>
2
2
  <ThemeProvider :theme="getTheme()" :style="{ height: '100%' }">
3
3
  <page-container>
4
- <main-table titleText="My Table">
5
- <thead>
6
- <tr>
7
- <th>Column 1</th>
8
- <th>Column 2</th>
9
- <th>Column 3</th>
10
- <div />
11
- </tr>
12
- </thead>
13
- <tbody>
14
- <tr>
15
- <!-- <table-dropdown
4
+ <br />
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
16
18
  :colSpan="3"
17
19
  :tableItems="getDropdownValues()"
18
20
  @toggle-dropdown-open="toggleDropdownOpen()"
@@ -21,14 +23,14 @@
21
23
  :optionItems="itemOptions"
22
24
  :optionsDisplay="['display_name', 'company_item_number', 'model']"
23
25
  /> -->
24
- <td>Test</td>
25
- <div class="icons-container">
26
- <three-dots :options="listOptions" :isLoading="false" />
27
- </div>
28
- </tr>
29
- </tbody>
30
- </main-table>
31
- <br />
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>
32
34
  <br />
33
35
  <toggle
34
36
  @on-toggle-change="onInputChange($event)"
@@ -47,11 +49,15 @@
47
49
  @input-change="onInputChange($event)"
48
50
  />
49
51
  <br />
50
-
51
- <icon name="info" color="red" size="50px" />
52
- <icon name="info" color="#F00" size="50px" />
53
- <icon name="info" color="blue1" size="50px" />
54
- <icon name="info" color="#00F" size="50px" />
52
+ <page-subtitle text="My Subtitle" infoText="My info Text" />
53
+ <spinner size="30px" />
54
+ <checkbox
55
+ label="Do you accept the Terms?"
56
+ :isChecked="true"
57
+ size="small"
58
+ :isDisabled="false"
59
+ />
60
+ <external-button text="Click me!" minWidth="500px" />
55
61
  </page-container>
56
62
  </ThemeProvider>
57
63
  </template>
@@ -60,8 +66,16 @@
60
66
  import { ThemeProvider } from 'vue-styled-components'
61
67
  import theme from './assets/theme'
62
68
  import styled from 'vue-styled-components'
63
- import icon from '@/components/icon'
69
+ import MainTable from '@/components/tables/mainTable'
70
+ import ThreeDots from '@/components/threeDots'
71
+ import Toggle from '@/components/inputs/toggle'
64
72
  import InputNumber from '@/components/inputs/inputNumber'
73
+ import Checkbox from '@/components/inputs/checkbox'
74
+ import PageSubtitle from '@/components/pageSubtitle'
75
+ import Spinner from '@/components/spinner'
76
+ import ExternalButton from '@/components/buttons/externalButton'
77
+ import Modal from '@/components/modals/modal'
78
+ // import TableDropdown from "@/components/tableDropdown"
65
79
 
66
80
  const PageContainer = styled.div`
67
81
  padding: 40px;
@@ -72,8 +86,15 @@ export default {
72
86
  components: {
73
87
  ThemeProvider,
74
88
  PageContainer,
89
+ MainTable,
90
+ ThreeDots,
91
+ Toggle,
75
92
  InputNumber,
76
- icon
93
+ PageSubtitle,
94
+ Spinner,
95
+ Checkbox,
96
+ ExternalButton,
97
+ Modal,
77
98
  },
78
99
  data() {
79
100
  return {
@@ -83,7 +104,7 @@ export default {
83
104
  number_format_precision: 4,
84
105
  number_min_allowed: 0,
85
106
  number_max_allowed: 10,
86
- unit_short_name: 'cm'
107
+ unit_short_name: 'cm',
87
108
  },
88
109
  dropdownOpen: false,
89
110
  isChecked: false,
@@ -91,47 +112,47 @@ export default {
91
112
  {
92
113
  name: 'Option 1',
93
114
  value: 'option_1',
94
- disabled: true
115
+ disabled: true,
95
116
  },
96
117
  {
97
118
  name: 'Option 2',
98
- value: 'option_2'
119
+ value: 'option_2',
99
120
  },
100
121
  {
101
122
  name: 'Option 3',
102
- value: 'option_3'
123
+ value: 'option_3',
103
124
  },
104
125
  {
105
126
  name: 'Option 4',
106
- value: 'option_4'
107
- }
127
+ value: 'option_4',
128
+ },
108
129
  ],
109
130
  itemOptions: [
110
131
  {
111
132
  display_name: 'Test 1',
112
133
  company_item_number: '123',
113
134
  model: 'BTB-2145 Long Text Long Text Long Text Long Text Long Text',
114
- id: 1
135
+ id: 1,
115
136
  },
116
137
  {
117
138
  display_name: 'Test 2',
118
139
  company_item_number: '1234',
119
140
  model: 'BTB-123',
120
- id: 2
141
+ id: 2,
121
142
  },
122
143
  {
123
144
  display_name: 'Test 3',
124
145
  company_item_number: '12345',
125
146
  model: 'BTB-543',
126
- id: 3
147
+ id: 3,
127
148
  },
128
149
  {
129
150
  display_name: 'Test 4',
130
151
  company_item_number: '123456',
131
152
  model: 'BTB-4930',
132
- id: 4
133
- }
134
- ]
153
+ id: 4,
154
+ },
155
+ ],
135
156
  }
136
157
  },
137
158
  methods: {
@@ -156,21 +177,21 @@ export default {
156
177
  {
157
178
  value: this.getComponentInfo({
158
179
  row: this.itemOptions[0],
159
- value: 'display_name'
160
- })
180
+ value: 'display_name',
181
+ }),
161
182
  },
162
183
  {
163
184
  value: this.getComponentInfo({
164
185
  row: this.itemOptions[0],
165
- value: 'company_item_number'
166
- })
186
+ value: 'company_item_number',
187
+ }),
167
188
  },
168
189
  {
169
190
  value: this.getComponentInfo({
170
191
  row: this.itemOptions[0],
171
- value: 'model'
172
- })
173
- }
192
+ value: 'model',
193
+ }),
194
+ },
174
195
  ]
175
196
  return items
176
197
  },
@@ -184,8 +205,8 @@ export default {
184
205
  item = '-'
185
206
  }
186
207
  return item
187
- }
188
- }
208
+ },
209
+ },
189
210
  }
190
211
  </script>
191
212
 
@@ -195,4 +216,4 @@ body {
195
216
  height: 100%;
196
217
  margin: 0;
197
218
  }
198
- </style>
219
+ </style>
@@ -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
@@ -3,15 +3,18 @@
3
3
  :isOpen="isOpen"
4
4
  :class="{ visible: isOpen, hidden: !isOpen }"
5
5
  @click.native="onOutsideClose()"
6
+ :backdrop="backdrop"
6
7
  >
7
8
  <modal-container @click.stop>
8
- <spinner v-if="isLoading" size="50px" :fullWidth="true" />
9
+ <spinner v-if="isLoading" size="50px" :limitedToModal="true" />
10
+ <content-container :visible="!isLoading">
11
+ <slot />
12
+ </content-container>
9
13
  <close-button
10
14
  v-if="!hideClose"
11
15
  @click.native="onCloseModal()"
12
16
  class="close"
13
17
  />
14
- <slot />
15
18
  </modal-container>
16
19
  </page-wrapper>
17
20
  </template>
@@ -28,7 +31,12 @@ import styled from 'vue-styled-components'
28
31
  import CloseButton from '../../buttons/closeButton'
29
32
  import Spinner from '../../spinner'
30
33
 
31
- const pageAttrs = { isOpen: Boolean }
34
+ const contentAttrs = { visible: Boolean }
35
+ const ContentContainer = styled('div', contentAttrs)`
36
+ visibility: ${(props) => (props.visible ? 'inherit' : 'hidden')};
37
+ `
38
+
39
+ const pageAttrs = { isOpen: Boolean, backdrop: String }
32
40
  const PageWrapper = styled('div', pageAttrs)`
33
41
  position: fixed;
34
42
  display: grid;
@@ -36,7 +44,10 @@ const PageWrapper = styled('div', pageAttrs)`
36
44
  left: 0;
37
45
  width: 100%;
38
46
  height: 100%;
39
- background-color: rgba(255, 255, 255, 0.9);
47
+ background-color: ${(props) =>
48
+ props.backdrop == 'dark'
49
+ ? 'rgba(0, 0, 0, 0.4)'
50
+ : 'rgba(255, 255, 255, 0.9)'};
40
51
  z-index: 99999;
41
52
  overflow: auto;
42
53
 
@@ -98,7 +109,8 @@ export default {
98
109
  PageWrapper,
99
110
  ModalContainer,
100
111
  CloseButton,
101
- Spinner
112
+ Spinner,
113
+ ContentContainer
102
114
  },
103
115
  props: {
104
116
  isOpen: {
@@ -116,6 +128,10 @@ export default {
116
128
  hideClose: {
117
129
  required: false,
118
130
  default: false
131
+ },
132
+ backdrop: {
133
+ required: false,
134
+ default: 'white'
119
135
  }
120
136
  },
121
137
  methods: {
@@ -135,4 +151,4 @@ export default {
135
151
  }
136
152
  }
137
153
  }
138
- </script>
154
+ </script>
@@ -26,5 +26,6 @@ export const Default = Template.bind({
26
26
  preventOutsideClose: true,
27
27
  isLoading: false,
28
28
  hideClose: false,
29
- });
29
+ backdrop: 'dark',
30
+ })
30
31
  Default.args = {};
@@ -7,7 +7,7 @@
7
7
  />
8
8
  </container>
9
9
  </spinner-container>
10
- <container v-else>
10
+ <container v-else :limitedToModal="limitedToModal">
11
11
  <spinner-wrapper
12
12
  :size="size"
13
13
  :src="require('../../assets/icons/black_spinner.svg')"
@@ -18,7 +18,7 @@
18
18
  <script>
19
19
  // import Spinner from "@eturnity/eturnity_reusable_components/src/components/spinner"
20
20
  // <spinner size="30px" />
21
- import styled from "vue-styled-components"
21
+ import styled from 'vue-styled-components'
22
22
 
23
23
  const SpinnerContainer = styled.div`
24
24
  position: fixed;
@@ -32,34 +32,41 @@ const SpinnerContainer = styled.div`
32
32
  justify-items: center;
33
33
  z-index: 100;
34
34
  `
35
-
36
- const Container = styled.div`
35
+ const containerAttrs = { limitedToModal: Boolean }
36
+ const Container = styled('div', containerAttrs)`
37
37
  display: grid;
38
38
  align-items: center;
39
39
  justify-items: center;
40
+ position: ${(props) => (props.limitedToModal ? 'absolute' : 'inherit')};
41
+ height: ${(props) => (props.limitedToModal ? '100%' : 'inherit')};
42
+ width: ${(props) => (props.limitedToModal ? '100%' : 'inherit')};
40
43
  `
41
44
 
42
45
  const spinnerAttrs = { size: String }
43
- const SpinnerWrapper = styled("img", spinnerAttrs)`
44
- width: ${(props) => (props.size ? props.size : "60px")};
46
+ const SpinnerWrapper = styled('img', spinnerAttrs)`
47
+ width: ${(props) => (props.size ? props.size : '60px')};
45
48
  `
46
49
 
47
50
  export default {
48
- name: "spinner",
51
+ name: 'spinner',
49
52
  components: {
50
53
  Container,
51
54
  SpinnerWrapper,
52
- SpinnerContainer,
55
+ SpinnerContainer
53
56
  },
54
57
  props: {
55
58
  fullWidth: {
56
59
  required: false,
57
- default: false,
60
+ default: false
58
61
  },
59
- size: {
62
+ limitedToModal: {
60
63
  required: false,
61
- default: null,
64
+ default: false
62
65
  },
63
- },
66
+ size: {
67
+ required: false,
68
+ default: null
69
+ }
70
+ }
64
71
  }
65
- </script>
72
+ </script>