diff --git a/package.json b/package.json index dabff5b..031b7bb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@supplycart/ui", - "version": "1.14.33", + "version": "1.14.34", "repository": { "type": "git", "url": "https://github.com/supplycart/ui" diff --git a/src/form/components/QuantityInput.vue b/src/form/components/QuantityInput.vue index f240071..526e7de 100644 --- a/src/form/components/QuantityInput.vue +++ b/src/form/components/QuantityInput.vue @@ -3,6 +3,7 @@ v-if="onFocus" v-bind="$attrs" type="number" + :max="maximumValue" :label="label" v-model="input" :error="error" @@ -34,6 +35,10 @@ export default { components: { BaseInput }, mixins: [InputMixins], props: { + maximumValue: { + type: Number, + default: null, + }, maxDecimal: { type: Number, default: 0, @@ -104,6 +109,11 @@ export default { if (!this.allowNegative && value < 0) { emitValue = Number(value) * -1; } + + if (this.maximumValue != null && emitValue > this.maximumValue) { + emitValue = this.maximumValue + } + return emitValue; }, blur(e) {