@stonecrop/beam 0.4.18 → 0.4.20

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": "@stonecrop/beam",
3
- "version": "0.4.18",
3
+ "version": "0.4.20",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "author": {
@@ -19,7 +19,7 @@ import { computed, type HTMLAttributes } from 'vue'
19
19
 
20
20
  const count = defineModel<number>({ required: true })
21
21
  const {
22
- denominator,
22
+ denominator = 0,
23
23
  debounce = 300,
24
24
  editable = true,
25
25
  uom = '',
@@ -30,11 +30,11 @@ const {
30
30
  uom?: string
31
31
  }>()
32
32
 
33
- const isCountComplete = computed(() => count.value === denominator)
33
+ const isCountComplete = computed(() => denominator !== 0 && count.value === denominator)
34
34
 
35
35
  const validate = (payload: ClipboardEvent | InputEvent | MouseEvent) => {
36
36
  const newValue = Number((payload.target as HTMLElement).innerHTML) || 0
37
- count.value = Math.min(newValue, denominator)
37
+ count.value = denominator ? Math.min(newValue, denominator) : newValue
38
38
  }
39
39
 
40
40
  const debouncedRequest = useDebounceFn((payload: InputEvent) => validate(payload), debounce)