smcgateway-sv 0.4.6 → 0.4.7

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.
@@ -3,13 +3,16 @@
3
3
 
4
4
  let {
5
5
  value = $bindable(),
6
+ id = '',
6
7
  class: className = '',
7
8
  disabled = false,
8
9
  nodate = '',
9
10
  min = new Date(2000, 1, 1),
10
- max = new Date()
11
+ max = new Date(),
12
+ ...rest
11
13
  }: {
12
14
  value: Date | '' | undefined;
15
+ id?: string;
13
16
  class?: string;
14
17
  disabled?: boolean;
15
18
  nodate?: Date | '';
@@ -45,7 +48,7 @@
45
48
  d.setHours(0, -d.getTimezoneOffset(), 0, 0);
46
49
  return d.toISOString().substring(0, 10);
47
50
  }
48
- return "";
51
+ return '';
49
52
  }
50
53
 
51
54
  function fromInputFormat(value: string): Date {
@@ -56,10 +59,10 @@
56
59
 
57
60
  function handleInput(event: Event) {
58
61
  const target = event.target as HTMLInputElement;
59
- if (target.value == "") {
60
- value = ""
61
- internal = ""
62
- return
62
+ if (target.value == '') {
63
+ value = '';
64
+ internal = '';
65
+ return;
63
66
  }
64
67
  if (target.value) {
65
68
  // Handle year being typed in
@@ -78,6 +81,7 @@
78
81
 
79
82
  <input
80
83
  type="date"
84
+ {id}
81
85
  class={className}
82
86
  {disabled}
83
87
  min={minDate}
@@ -1,5 +1,6 @@
1
1
  type $$ComponentProps = {
2
2
  value: Date | '' | undefined;
3
+ id?: string;
3
4
  class?: string;
4
5
  disabled?: boolean;
5
6
  nodate?: Date | '';
@@ -3,20 +3,23 @@
3
3
 
4
4
  let {
5
5
  value = $bindable(),
6
+ id = "",
6
7
  class: className = '',
7
8
  disabled = false,
8
9
  nodate = '',
9
10
  min = new Date(2000, 1, 1),
10
11
  max = new Date(),
11
- onchange = (e:Event) => {}
12
+ onchange = (e: Event) => {},
13
+ ...rest
12
14
  }: {
13
15
  value: Date | '';
16
+ id?: string;
14
17
  class?: string;
15
18
  disabled?: boolean;
16
19
  nodate?: Date | '';
17
20
  min?: Date;
18
21
  max?: Date;
19
- onchange?: (e:Event) => void;
22
+ onchange?: (e: Event) => void;
20
23
  } = $props();
21
24
 
22
25
  let minDate = $derived(toInputFormat(min));
@@ -72,10 +75,12 @@
72
75
 
73
76
  <input
74
77
  type="datetime-local"
78
+ {id}
75
79
  class={className}
76
80
  {disabled}
77
81
  min={minDate}
78
82
  max={maxDate}
79
83
  value={internal}
80
84
  oninput={handleInput}
85
+ {...rest}
81
86
  />
@@ -1,5 +1,6 @@
1
1
  type $$ComponentProps = {
2
2
  value: Date | '';
3
+ id?: string;
3
4
  class?: string;
4
5
  disabled?: boolean;
5
6
  nodate?: Date | '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smcgateway-sv",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "author": "Kevin Golding <kevin.golding@smc-gateway.com> (https://smc-gateway.com)",
5
5
  "license": "MIT",
6
6
  "scripts": {