y200subcontrols 0.0.329 → 0.0.330

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.
@@ -18,17 +18,17 @@ let _value = "";
18
18
  function padZero(num) {
19
19
  return num > 9 ? `${num}` : `0${num}`;
20
20
  }
21
- $: {
22
- if (value) {
23
- if (typeof value === "string") {
24
- value = new Date(value);
21
+ function setValueInternal(value2) {
22
+ if (value2) {
23
+ if (typeof value2 === "string") {
24
+ value2 = new Date(value2);
25
25
  }
26
- const year = value.getFullYear();
27
- const month = value.getMonth() + 1;
28
- const day = value.getDate();
29
- const hour = padZero(value.getHours());
30
- const minute = padZero(value.getMinutes());
31
- const second = padZero(value.getSeconds());
26
+ const year = value2.getFullYear();
27
+ const month = value2.getMonth() + 1;
28
+ const day = value2.getDate();
29
+ const hour = padZero(value2.getHours());
30
+ const minute = padZero(value2.getMinutes());
31
+ const second = padZero(value2.getSeconds());
32
32
  _value = `${year}-${padZero(month)}-${padZero(day)}T${hour}:${minute}:${second}`;
33
33
  }
34
34
  }
@@ -42,7 +42,6 @@ function validateElement(event) {
42
42
  isValid = input.checkValidity();
43
43
  if (input.type === "number") {
44
44
  console.clear();
45
- console.log(value, isValid);
46
45
  }
47
46
  dispatch("validated", isValid);
48
47
  }
@@ -75,6 +74,7 @@ onMount(() => {
75
74
  let r = (Math.random() + 1).toString(36).substring(2);
76
75
  id = `input${r}`;
77
76
  }
77
+ setValueInternal(value);
78
78
  });
79
79
  </script>
80
80
 
@@ -91,7 +91,7 @@ onMount(() => {
91
91
  {visible}
92
92
  autoApplyCss={true}
93
93
  >
94
- <input
94
+ <input
95
95
  bind:this={input}
96
96
  {disabled}
97
97
  {id}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "y200subcontrols",
3
- "version": "0.0.329",
3
+ "version": "0.0.330",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",