fuma 1.0.18 → 1.0.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.
|
@@ -3,6 +3,7 @@ import { FormControl } from "./index.js";
|
|
|
3
3
|
import dayjs from "dayjs";
|
|
4
4
|
export let value = void 0;
|
|
5
5
|
export let input = {};
|
|
6
|
+
export let getDefaultDate = () => /* @__PURE__ */ new Date(0);
|
|
6
7
|
$:
|
|
7
8
|
({ class: inputClass = "", ...inputProps } = input);
|
|
8
9
|
const dispatch = createEventDispatcher();
|
|
@@ -13,7 +14,7 @@ const onInput = ({ currentTarget }) => {
|
|
|
13
14
|
function getDateTime(v) {
|
|
14
15
|
if (!v)
|
|
15
16
|
return value;
|
|
16
|
-
const date = new Date(value
|
|
17
|
+
const date = value ? new Date(value) : getDefaultDate();
|
|
17
18
|
const dateString = [
|
|
18
19
|
date.getFullYear().toString(),
|
|
19
20
|
(date.getMonth() + 1).toString().padStart(2, "0"),
|
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import {
|
|
2
|
+
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
3
3
|
declare const __propDef: {
|
|
4
|
-
props:
|
|
4
|
+
props: {
|
|
5
|
+
class?: string | undefined;
|
|
6
|
+
classLabel?: string | undefined;
|
|
7
|
+
key?: string | undefined;
|
|
8
|
+
label?: string | import("svelte").ComponentType | import("../../index.js").ComponentAndProps | undefined;
|
|
9
|
+
error?: string | undefined;
|
|
10
|
+
hint?: string | undefined;
|
|
11
|
+
prefix?: string | number | undefined;
|
|
12
|
+
prefixFor?: string | number | undefined;
|
|
13
|
+
enhanceDisabled?: boolean | undefined;
|
|
14
|
+
labelPosition?: ("top" | "left" | "right") | undefined;
|
|
15
|
+
} & {
|
|
16
|
+
input?: HTMLInputAttributes | undefined;
|
|
17
|
+
inputElement?: HTMLInputElement | undefined;
|
|
18
|
+
classWrapper?: string | undefined;
|
|
19
|
+
value?: Date | null | undefined;
|
|
20
|
+
bindWithParams?: boolean | undefined;
|
|
21
|
+
} & {
|
|
22
|
+
getDefaultDate?: (() => Date) | undefined;
|
|
23
|
+
};
|
|
5
24
|
events: {
|
|
6
25
|
focus: FocusEvent;
|
|
7
26
|
blur: FocusEvent;
|