@wikala/spmkt 2.27.1 → 2.28.0

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.
@@ -20,14 +20,22 @@ export default {
20
20
  },
21
21
  methods: {
22
22
  decrease() {
23
- if (this.value >= 2) {
24
- this.$emit('input', this.value - 1)
23
+ let val = 0;
24
+ if(this.value !== '') {
25
+ val = this.value;
26
+ }
27
+ if (val >= 2) {
28
+ this.$emit('input', val - 1)
25
29
  } else {
26
30
  this.$emit('input', 1)
27
31
  }
28
32
  },
29
33
  increase() {
30
- this.$emit('input', this.value + 1)
34
+ let val = 0;
35
+ if(this.value !== '') {
36
+ val = this.value;
37
+ }
38
+ this.$emit('input', val + 1)
31
39
  },
32
40
  qtyInput(event) {
33
41
  if(event.target.value.trim() === '') {
@@ -1,12 +1,12 @@
1
1
  <template>
2
- <div style="padding-left: 1rem; display: flex; justify-content: flex-end; flex-direction: column">
3
- <select class="select" v-if="showSelect" @change="qtySelectChange($event)" v-model="qty">
2
+ <div style="display: flex; justify-content: flex-end; flex-direction: column;">
3
+ <select class="select" v-if="showSelect" @change="qtySelectChange($event)" v-model="qty" style="text-align:center;">
4
4
  <option v-for="qty in selectRange" :value="qty" :key="qty">{{ qty }}</option>
5
5
  <option value="smp">{{ selectMax + 1 }}+</option>
6
6
  </select>
7
- <form @submit.prevent="qtyUpdate">
8
- <input ref="textInput" v-if="!showSelect" class="input" type="number" @input="qtyInput" :value="qty" />
9
- <button v-if="showUpdateButton" class="button is-small" style="width: 100%">{{ $t('global.update') }}</button>
7
+ <form @submit.prevent="qtyUpdate" style="display:flex; flex-direction: column;">
8
+ <input ref="textInput" v-if="!showSelect" class="input" @input="qtyInput" :value="qty" style="text-align:center; border:unset" />
9
+ <button v-if="showUpdateButton" class="button is-small">{{ $t('global.update') }}</button>
10
10
  </form>
11
11
  </div>
12
12
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikala/spmkt",
3
- "version": "2.27.1",
3
+ "version": "2.28.0",
4
4
  "private": false,
5
5
  "description": "supermarket",
6
6
  "scripts": {