@eturnity/eturnity_reusable_components 1.0.40 → 1.0.44

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.40",
3
+ "version": "1.0.44",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
package/src/App.vue CHANGED
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <ThemeProvider :theme="getTheme()" :style="{ height: '100%' }">
3
3
  <page-container>
4
- <main-table>
4
+ <main-table titleText="My Table">
5
5
  <thead>
6
6
  <tr>
7
7
  <th>Column 1</th>
@@ -12,6 +12,7 @@
12
12
  @focus="focusInput()"
13
13
  @keyup.enter="$emit('on-enter-click')"
14
14
  :disabled="disabled"
15
+ :isDisabled="disabled"
15
16
  :noBorder="noBorder"
16
17
  :textAlign="textAlign"
17
18
  />
@@ -36,6 +37,7 @@
36
37
  // inputWidth="150px" //by default, this is 100%
37
38
  // :numberPrecision="3"
38
39
  // unitName="pc"
40
+ // :numberPrecision="4"
39
41
  // :value="inputValue" //required -- String
40
42
  // @input-change="onInputChange($event)" //required
41
43
  // @on-enter-click="onInputSubmit()"
@@ -61,7 +63,7 @@ const inputProps = {
61
63
  hasUnit: Boolean,
62
64
  inputWidth: String,
63
65
  hasLength: Boolean,
64
- disabled: Boolean,
66
+ isDisabled: Boolean,
65
67
  noBorder: Boolean,
66
68
  textAlign: String,
67
69
  }
@@ -78,13 +80,13 @@ const InputContainer = styled("input", inputProps)`
78
80
  props.hasUnit ? "11px 40px 11px 10px" : "11px 5px 11px 10px"};
79
81
  border-radius: 4px;
80
82
  text-align: ${(props) => props.textAlign};
81
- cursor: ${(props) => (props.disabled ? "not-allowed" : "auto")};
83
+ cursor: ${(props) => (props.isDisabled ? "not-allowed" : "auto")};
82
84
  font-size: 16px;
83
85
  color: ${(props) =>
84
86
  props.isError ? props.theme.colors.red : props.theme.colors.black};
85
87
  width: ${(props) => (props.inputWidth ? props.inputWidth : "100%")};
86
88
  background-color: ${(props) =>
87
- props.disabled
89
+ props.isDisabled
88
90
  ? props.theme.colors.grey5 + " !important"
89
91
  : "#fff !important"};
90
92
 
@@ -240,6 +242,9 @@ export default {
240
242
  }
241
243
  },
242
244
  focusInput() {
245
+ if (this.disabled) {
246
+ return
247
+ }
243
248
  this.isFocused = true
244
249
  },
245
250
  formatWithCurrency(value) {
@@ -1,14 +1,19 @@
1
1
  <template>
2
- <table-scroll>
3
- <table-wrapper :fullWidth="fullWidth">
4
- <spinner-wrapper v-if="isLoading">
5
- <spinner />
6
- </spinner-wrapper>
7
- <table-container v-else>
8
- <slot />
9
- </table-container>
10
- </table-wrapper>
11
- </table-scroll>
2
+ <page-container>
3
+ <table-title v-if="titleText">
4
+ {{ titleText }}
5
+ </table-title>
6
+ <table-scroll>
7
+ <table-wrapper :fullWidth="fullWidth">
8
+ <spinner-wrapper v-if="isLoading">
9
+ <spinner />
10
+ </spinner-wrapper>
11
+ <table-container v-else>
12
+ <slot />
13
+ </table-container>
14
+ </table-wrapper>
15
+ </table-scroll>
16
+ </page-container>
12
17
  </template>
13
18
 
14
19
  <script>
@@ -17,6 +22,14 @@
17
22
  import styled from "vue-styled-components"
18
23
  import Spinner from "../../spinner"
19
24
 
25
+ const PageContainer = styled.div``
26
+
27
+ const TableTitle = styled.div`
28
+ margin-bottom: 6px;
29
+ font-weight: bold;
30
+ font-size: 13px;
31
+ `
32
+
20
33
  const TableScroll = styled.div`
21
34
  position: relative;
22
35
  max-width: 100%;
@@ -193,8 +206,8 @@ const TableContainer = styled.table`
193
206
  }
194
207
 
195
208
  &:hover {
196
- input {
197
- background-color: ${(props) => props.theme.colors.grey5};
209
+ input:disabled {
210
+ background-color: ${(props) => props.theme.colors.grey5 + "!important"};
198
211
  }
199
212
 
200
213
  .drag-icon {
@@ -204,7 +217,7 @@ const TableContainer = styled.table`
204
217
 
205
218
  .drag-container {
206
219
  display: table-cell;
207
- width: auto;
220
+ width: 12px;
208
221
  vertical-align: middle;
209
222
  }
210
223
 
@@ -253,6 +266,7 @@ const TableContainer = styled.table`
253
266
  input {
254
267
  font-size: 13px;
255
268
  padding: 5px 10px;
269
+ background: #fff !important;
256
270
  }
257
271
 
258
272
  .open-container {
@@ -270,6 +284,8 @@ export default {
270
284
  SpinnerWrapper,
271
285
  Spinner,
272
286
  TableContainer,
287
+ PageContainer,
288
+ TableTitle,
273
289
  },
274
290
  props: {
275
291
  fullWidth: {
@@ -280,6 +296,10 @@ export default {
280
296
  required: false,
281
297
  default: false,
282
298
  },
299
+ titleText: {
300
+ required: false,
301
+ default: null,
302
+ },
283
303
  },
284
304
  }
285
305
  </script>