@eturnity/eturnity_reusable_components 1.1.25 → 1.1.28

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.25",
3
+ "version": "1.1.28",
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`
@@ -6,7 +6,7 @@
6
6
  ref="dropdownItem"
7
7
  :disabled="disabled"
8
8
  >
9
- <component-container :colSpan="colSpan" class="table-dropdown">
9
+ <component-container :colSpan="colSpan - 1" class="table-dropdown">
10
10
  <component-item v-for="(item, index) in tableItems" :key="index">
11
11
  <template-button
12
12
  @click.stop="onTemplateClick(item.row)"
@@ -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>
@@ -161,7 +161,7 @@ const ComponentItem = styled.div`
161
161
  const containerAttrs = { colSpan: Number }
162
162
  const ComponentContainer = styled("div", containerAttrs)`
163
163
  display: grid;
164
- grid-template-columns: repeat(${(props) => props.colSpan}, minmax(0, 1fr)) auto;
164
+ grid-template-columns: 1fr repeat(${(props) => props.colSpan}, auto) auto;
165
165
  grid-gap: 12px;
166
166
  align-items: center;
167
167
  background-color: ${(props) => props.theme.colors.white};
@@ -217,7 +217,7 @@ const OptionsWrapper = styled.div`
217
217
 
218
218
  const OptionsItem = styled("div", containerAttrs)`
219
219
  display: grid;
220
- grid-template-columns: repeat(${(props) => props.colSpan}, minmax(0, 1fr));
220
+ grid-template-columns: 1fr repeat(${(props) => props.colSpan}, auto);
221
221
  grid-gap: 12px;
222
222
  padding: 10px;
223
223
  height: max-content;
@@ -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() {