toggle-components-library 1.27.3 → 1.27.5
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/dist/toggle-components-library.common.js +27 -6
- package/dist/toggle-components-library.common.js.map +1 -1
- package/dist/toggle-components-library.css +1 -1
- package/dist/toggle-components-library.umd.js +27 -6
- package/dist/toggle-components-library.umd.js.map +1 -1
- package/dist/toggle-components-library.umd.min.js +1 -1
- package/dist/toggle-components-library.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/forms/ToggleInputNumberUnit.vue +22 -0
- package/src/sass/includes/_as_inputs.scss +1 -1
package/package.json
CHANGED
|
@@ -75,6 +75,17 @@ export default {
|
|
|
75
75
|
prependString: {
|
|
76
76
|
type: String,
|
|
77
77
|
required: false
|
|
78
|
+
},
|
|
79
|
+
max: {
|
|
80
|
+
type: Number,
|
|
81
|
+
required: false,
|
|
82
|
+
validator(value) {
|
|
83
|
+
return value > 0
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
min: {
|
|
87
|
+
type: Number,
|
|
88
|
+
required: false
|
|
78
89
|
}
|
|
79
90
|
},
|
|
80
91
|
|
|
@@ -139,6 +150,17 @@ export default {
|
|
|
139
150
|
if (this.value != '') {
|
|
140
151
|
// When the user clicks out of the box, add the prepend and/or append values
|
|
141
152
|
let tempValue = this.value;
|
|
153
|
+
|
|
154
|
+
// If max prop is set and value is greater than max, set value to max
|
|
155
|
+
if (this.max && (tempValue > this.max)) {
|
|
156
|
+
tempValue = this.max
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// If min prop is set and value is less than min, set value to min
|
|
160
|
+
if (this.min && (tempValue < this.min)) {
|
|
161
|
+
tempValue = this.min
|
|
162
|
+
}
|
|
163
|
+
|
|
142
164
|
if (this.appendString) {
|
|
143
165
|
// First add the append string
|
|
144
166
|
tempValue += this.appendString;
|