@eturnity/eturnity_reusable_components 1.1.47 → 1.1.50

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.47",
3
+ "version": "1.1.50",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
package/src/App.vue CHANGED
@@ -79,7 +79,7 @@ export default {
79
79
  },
80
80
  data() {
81
81
  return {
82
- inputValue: 10,
82
+ inputValue: null,
83
83
  checkedOption: "button_1",
84
84
  question: {
85
85
  number_format_precision: 4,
@@ -14,6 +14,7 @@
14
14
  </label-wrapper>
15
15
  <input-wrapper>
16
16
  <input-container
17
+ ref="inputField1"
17
18
  :hasUnit="unitName && !!unitName.length"
18
19
  :placeholder="placeholder"
19
20
  :isError="isError"
@@ -64,6 +65,7 @@
64
65
  // labelText="Number of Modules"
65
66
  // labelInfoText="Here is some information for you..."
66
67
  // labelInfoAlign="left"
68
+ // :minNumber="0"
67
69
  // />
68
70
  import styled from "vue-styled-components"
69
71
  import {
@@ -249,6 +251,10 @@ export default {
249
251
  required: false,
250
252
  default: "right",
251
253
  },
254
+ minNumber: {
255
+ required: false,
256
+ default: null,
257
+ },
252
258
  },
253
259
  methods: {
254
260
  onChangeHandler(event) {
@@ -289,33 +295,48 @@ export default {
289
295
  let value = e.target.value
290
296
  let evaluatedInput = this.onEvaluateCode(value)
291
297
  this.onChangeHandler(evaluatedInput)
292
- if (value && value.length) {
298
+ if ((value && value.length) || this.minNumber !== null) {
293
299
  this.textInput = numberToString({
294
- value: evaluatedInput,
300
+ value: value && value.length ? evaluatedInput : this.minNumber,
295
301
  numberPrecision: this.numberPrecision,
296
302
  })
297
303
  }
298
- this.$emit("input-blur", value)
304
+ let adjustedMinValue =
305
+ value && value.length
306
+ ? value
307
+ : this.minNumber || this.minNumber === 0
308
+ ? this.minNumber
309
+ : ""
310
+ this.$emit("input-blur", adjustedMinValue)
299
311
  },
300
312
  focusInput() {
301
313
  if (this.disabled) {
302
314
  return
303
315
  }
304
316
  this.isFocused = true
317
+ this.$nextTick(() => {
318
+ this.$refs.inputField1.$el.select()
319
+ })
305
320
  },
306
321
  formatWithCurrency(value) {
307
- if ((value || value === 0) && !this.isFocused) {
322
+ let adjustedMinValue =
323
+ value || value === 0
324
+ ? value
325
+ : this.minNumber || this.minNumber === 0
326
+ ? this.minNumber
327
+ : ""
328
+ if ((adjustedMinValue || adjustedMinValue === 0) && !this.isFocused) {
308
329
  let input = numberToString({
309
- value: value,
330
+ value: adjustedMinValue,
310
331
  numberPrecision: this.numberPrecision,
311
332
  })
312
333
  let unit = this.showLinearUnitName ? "" : this.unitName
313
334
  return input + " " + unit
314
- } else if (!value) {
335
+ } else if (!adjustedMinValue && adjustedMinValue !== 0) {
315
336
  return ""
316
337
  } else {
317
338
  return numberToString({
318
- value: value,
339
+ value: adjustedMinValue,
319
340
  numberPrecision: this.numberPrecision,
320
341
  })
321
342
  }
@@ -327,6 +348,11 @@ export default {
327
348
  value: this.value,
328
349
  numberPrecision: this.numberPrecision,
329
350
  })
351
+ } else if (this.minNumber !== null) {
352
+ this.textInput = numberToString({
353
+ value: this.minNumber,
354
+ numberPrecision: this.numberPrecision,
355
+ })
330
356
  }
331
357
  },
332
358
  watch: {
@@ -8,6 +8,7 @@
8
8
  v-if="!!infoText"
9
9
  size="14"
10
10
  borderColor="#ccc"
11
+ :alignText="alignInfoText"
11
12
  />
12
13
  </subtitle-text>
13
14
  </template>
@@ -54,6 +55,10 @@ export default {
54
55
  required: false,
55
56
  default: null,
56
57
  },
58
+ alignInfoText: {
59
+ required: false,
60
+ default: "left",
61
+ },
57
62
  },
58
63
  }
59
64
  </script>
@@ -32,7 +32,6 @@ const TableTitle = styled.div`
32
32
  `
33
33
 
34
34
  const TableScroll = styled.div`
35
- /* position: relative; */
36
35
  max-width: 100%;
37
36
  `
38
37
 
@@ -43,15 +42,17 @@ const TableWrapper = styled("div", wrapperAttrs)`
43
42
  overflow: auto;
44
43
 
45
44
  ::-webkit-scrollbar {
46
- width: 10px; //width of the whole scrollbar area
45
+ height: 5px; //height of the whole scrollbar area
47
46
  }
48
47
 
49
48
  track ::-webkit-scrollbar-track {
50
- background: #fff;
49
+ background: ${(props) => props.theme.colors.grey2};
50
+ border-radius: 4px;
51
51
  }
52
52
 
53
53
  ::-webkit-scrollbar-thumb {
54
- border-bottom: 2px solid #b2b9c4; // width of the actual scrollbar
54
+ border-bottom: 5px solid ${(props) => props.theme.colors.purple}; // width of the actual scrollbar
55
+ border-radius: 4px;
55
56
  }
56
57
  `
57
58