@eturnity/eturnity_reusable_components 1.1.24 → 1.1.27

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.24",
3
+ "version": "1.1.27",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -1,6 +1,9 @@
1
1
  <template>
2
2
  <container>
3
- <input-wrapper :alignItems="alignItems">
3
+ <input-wrapper
4
+ :alignItems="alignItems"
5
+ :hasLabel="!!label && label.length > 0"
6
+ >
4
7
  <label-wrapper v-if="label">
5
8
  <input-label>{{ label }}</input-label>
6
9
  <info-text
@@ -85,14 +88,14 @@ const InputContainer = styled("input", inputProps)`
85
88
  }
86
89
  `
87
90
 
88
- const inputAttrs = { alignItems: String }
91
+ const inputAttrs = { alignItems: String, hasLabel: Boolean }
89
92
  const InputWrapper = styled("div", inputAttrs)`
90
93
  position: relative;
91
94
  display: grid;
92
95
  align-items: center;
93
96
  gap: 14px;
94
97
  grid-template-columns: ${(props) =>
95
- props.alignItems === "vertical" ? "1fr" : "auto 1fr"};
98
+ props.alignItems === "vertical" || !props.hasLabel ? "1fr" : "auto 1fr"};
96
99
  `
97
100
 
98
101
  const ErrorMessage = styled.div`
@@ -38,7 +38,7 @@
38
38
  :value="item.value"
39
39
  :noBorder="true"
40
40
  :disabled="customInputDisabled"
41
- @input-change="$emit('custom-input-change', $event)"
41
+ @input-change="onCustomInputChange($event)"
42
42
  />
43
43
  </input-container>
44
44
  <span v-else> {{ item.value }}</span>
@@ -373,6 +373,7 @@ export default {
373
373
  data() {
374
374
  return {
375
375
  inputText: "",
376
+ wasClicked: false, // prevents custom-name from being triggered on the <input-text />
376
377
  }
377
378
  },
378
379
  methods: {
@@ -380,6 +381,7 @@ export default {
380
381
  if (this.disabled) {
381
382
  return
382
383
  }
384
+ this.wasClicked = false
383
385
  if (!this.isOpen) {
384
386
  document.addEventListener("click", this.clickOutside)
385
387
  this.$emit("dropdown-search", "")
@@ -416,6 +418,7 @@ export default {
416
418
  this.$emit("on-selected-template-click", item)
417
419
  },
418
420
  onItemClick(item) {
421
+ this.wasClicked = true
419
422
  this.$emit("item-selected", item)
420
423
  },
421
424
  onSearch(value) {
@@ -441,10 +444,17 @@ export default {
441
444
  this.$emit("toggle-dropdown-open", { close: true })
442
445
  },
443
446
  onCustomNameClick() {
447
+ this.wasClicked = true
444
448
  this.$emit("on-custom-input-name", this.inputText)
445
449
  this.$emit("toggle-dropdown-open", { close: true })
446
450
  this.inputText = ""
447
451
  },
452
+ onCustomInputChange(event) {
453
+ if (this.wasClicked) {
454
+ return
455
+ }
456
+ this.$emit("custom-input-change", event)
457
+ },
448
458
  },
449
459
  computed: {
450
460
  getCustomName() {
@@ -320,6 +320,7 @@ const TableContainer = styled.table`
320
320
  padding: 5px 10px;
321
321
  background: #fff;
322
322
  min-width: max-content;
323
+ min-width: 150px; // Safari/Firefox backup
323
324
 
324
325
  &:focus {
325
326
  background: ${(props) => props.theme.colors.grey5};