edvoyui-component-library-test-flight 0.0.162 → 0.0.163

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,7 +1,7 @@
1
1
  {
2
2
  "name": "edvoyui-component-library-test-flight",
3
3
  "private": false,
4
- "version": "0.0.162",
4
+ "version": "0.0.163",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist/",
@@ -18,7 +18,7 @@
18
18
  <div
19
19
  class="flex flex-col max-w-screen-sm gap-4 p-6 mx-auto mb-10 border rounded-xl"
20
20
  >
21
- <pre>{{ inputNumber }}</pre>
21
+ <pre>{{ inputNumber }} ==> {{ inputNumberPoints }}</pre>
22
22
  <EUINumberInput
23
23
  v-model.trim="inputNumber"
24
24
  name="addnote"
@@ -27,6 +27,16 @@
27
27
  placeholder="Note here..."
28
28
  :min="0"
29
29
  :max="100"
30
+ :step="1"
31
+ />
32
+ <EUINumberInput
33
+ v-model.trim="inputNumberPoints"
34
+ name="addnote"
35
+ id="addnote"
36
+ label="Add Note"
37
+ placeholder="Note here..."
38
+ :min="0"
39
+ :max="100"
30
40
  :step="0.5"
31
41
  />
32
42
  </div>
@@ -1626,6 +1636,7 @@ const datepicker = ref(new Date());
1626
1636
  const loading = ref(false);
1627
1637
 
1628
1638
  const inputNumber = ref();
1639
+ const inputNumberPoints = ref()
1629
1640
 
1630
1641
  const form = reactive({
1631
1642
  input: "Lorem ipsum dolor sit",
@@ -73,7 +73,7 @@
73
73
  autocomplete="off"
74
74
  inputmode="numeric"
75
75
  pattern="^([0-9]{1,5}(\.[0-9]{1,2})?|100000(\.0{1,2})?)$"
76
- @keypress="(e) => { if (!/[0-9.]/.test(e.key)) e.preventDefault();}"
76
+ @keypress="handleKeyPress"
77
77
  @wheel.prevent=""
78
78
  @keydown.up.prevent=""
79
79
  @keydown.down.prevent=""
@@ -201,6 +201,18 @@ const emitInput = (event: Event) => {
201
201
  };
202
202
 
203
203
 
204
+ const handleKeyPress = (e: KeyboardEvent) => {
205
+ const inputEl = e.target as HTMLInputElement | null;
206
+ if (!inputEl) return; // Safety check
207
+ const allowDecimal = props.step < 1;
208
+ // Allow digits
209
+ if (/[0-9]/.test(e.key)) return;
210
+ // Allow one '.' only if step < 1
211
+ if (allowDecimal && e.key === '.' && !inputEl.value.includes('.')) return;
212
+ // Otherwise block input
213
+ e.preventDefault();
214
+ };
215
+
204
216
 
205
217
  const inputValue = computed(() => {
206
218
  return props.modelValue === 0 ? true : !!props.modelValue;