sprintify-ui 0.0.149 → 0.0.150

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": "sprintify-ui",
3
- "version": "0.0.149",
3
+ "version": "0.0.150",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build-fast": "rimraf dist && vite build",
@@ -233,18 +233,25 @@ function onKeydown(e: KeyboardEvent) {
233
233
  emit('keydown', e);
234
234
  }
235
235
 
236
+ const defaultValue = computed<number>(() => {
237
+ return Math.max(0, props.min ?? 0);
238
+ });
239
+
236
240
  function updateInternalValueToRealValue() {
237
241
  if (realValueInternal.value === null) {
238
242
  valueInternal.value = '';
239
243
  return;
240
244
  }
241
- valueInternal.value = round(realValueInternal.value ?? 0, precision.value);
245
+ valueInternal.value = round(
246
+ realValueInternal.value ?? defaultValue.value,
247
+ precision.value
248
+ );
242
249
  }
243
250
 
244
251
  function increment() {
245
252
  if (props.disabled) return;
246
253
  if (realValueInternal.value === null) {
247
- valueInternal.value = 0;
254
+ valueInternal.value = defaultValue.value;
248
255
  } else {
249
256
  const newValue = round(
250
257
  realValueInternal.value + props.step,
@@ -260,7 +267,7 @@ function increment() {
260
267
  function decrement() {
261
268
  if (props.disabled) return;
262
269
  if (realValueInternal.value === null) {
263
- valueInternal.value = 0;
270
+ valueInternal.value = defaultValue.value;
264
271
  } else {
265
272
  const newValue = round(
266
273
  realValueInternal.value - props.step,