sprintify-ui 0.0.174 → 0.0.175

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.
@@ -9,7 +9,6 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
9
9
  name?: string | undefined;
10
10
  inline?: boolean | undefined;
11
11
  enableTime?: boolean | undefined;
12
- format?: string | undefined;
13
12
  mode?: "time" | "multiple" | "single" | "range" | undefined;
14
13
  noCalendar?: boolean | undefined;
15
14
  disableDates?: string[] | Date[] | undefined;
@@ -23,7 +22,6 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
23
22
  name: undefined;
24
23
  inline: boolean;
25
24
  enableTime: boolean;
26
- format: string;
27
25
  mode: string;
28
26
  noCalendar: boolean;
29
27
  disableDates(): never[];
@@ -37,7 +35,6 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
37
35
  name?: string | undefined;
38
36
  inline?: boolean | undefined;
39
37
  enableTime?: boolean | undefined;
40
- format?: string | undefined;
41
38
  mode?: "time" | "multiple" | "single" | "range" | undefined;
42
39
  noCalendar?: boolean | undefined;
43
40
  disableDates?: string[] | Date[] | undefined;
@@ -51,7 +48,6 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
51
48
  name: undefined;
52
49
  inline: boolean;
53
50
  enableTime: boolean;
54
- format: string;
55
51
  mode: string;
56
52
  noCalendar: boolean;
57
53
  disableDates(): never[];
@@ -68,7 +64,6 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
68
64
  minDate: string | Date | null;
69
65
  maxDate: string | Date | null;
70
66
  enableTime: boolean;
71
- format: string;
72
67
  noCalendar: boolean;
73
68
  disableDates: string[] | Date[];
74
69
  }>;
@@ -106,9 +106,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
106
106
  onError?: ((...args: any[]) => any) | undefined;
107
107
  onSuccess?: ((...args: any[]) => any) | undefined;
108
108
  }, {
109
- format: DataFormat;
110
109
  errorHandler: (error: AxiosError) => void;
111
110
  axiosInstance: AxiosInstance | null;
111
+ format: DataFormat;
112
112
  beforeSubmit: (next: () => void) => void;
113
113
  successHandler: (response: any) => void;
114
114
  loadingMaskClass: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.0.174",
3
+ "version": "0.0.175",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build-fast": "rimraf dist && vite build",
@@ -67,7 +67,6 @@ Multiple.args = {
67
67
  export const DateAndTime = Template.bind({});
68
68
  DateAndTime.args = {
69
69
  enableTime: true,
70
- format: 'Y-m-d H:i',
71
70
  };
72
71
 
73
72
  export const DisableDates = Template.bind({});
@@ -56,7 +56,6 @@ const props = withDefaults(
56
56
  name?: string;
57
57
  inline?: boolean;
58
58
  enableTime?: boolean;
59
- format?: string;
60
59
  mode?: 'single' | 'multiple' | 'range' | 'time';
61
60
  noCalendar?: boolean;
62
61
  disableDates?: string[] | Date[];
@@ -71,7 +70,6 @@ const props = withDefaults(
71
70
  name: undefined,
72
71
  inline: false,
73
72
  enableTime: false,
74
- format: 'Y-m-d',
75
73
  mode: 'single',
76
74
  noCalendar: false,
77
75
  disableDates() {
@@ -84,6 +82,14 @@ const i18n = useI18n();
84
82
 
85
83
  const emit = defineEmits(['update:modelValue']);
86
84
 
85
+ const formatInternal = computed(() => {
86
+ if (props.enableTime) {
87
+ return 'Y-m-d H:i';
88
+ }
89
+
90
+ return 'Y-m-d';
91
+ });
92
+
87
93
  const { hasErrorInternal, emitUpdate } = useField({
88
94
  name: computed(() => props.name),
89
95
  required: computed(() => props.required),
@@ -148,7 +154,7 @@ let picker = null as Instance | null;
148
154
  const flatpickrConfig = computed(() => {
149
155
  return {
150
156
  enableTime: props.enableTime,
151
- dateFormat: props.format,
157
+ dateFormat: formatInternal.value,
152
158
  mode: props.mode,
153
159
  locale: locale.value,
154
160
  minDate: props.minDate ?? undefined,