v-datepicker-lite 0.0.5 → 0.0.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.
- package/README.md +51 -0
- package/components/time-picker/TimePicker.vue.d.ts +50 -0
- package/components/time-picker/TimePickerDropdown.vue.d.ts +29 -0
- package/components/time-picker/TimePickerInput.vue.d.ts +29 -0
- package/index.d.ts +2 -0
- package/index.js +1816 -455
- package/package.json +1 -1
- package/style.css +1 -1
package/README.md
CHANGED
|
@@ -29,6 +29,8 @@ yarn add v-datepicker-lite
|
|
|
29
29
|
pnpm add v-datepicker-lite
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
> Don't forget to follow me on [GitHub](https://github.com/safdar-azeem)!
|
|
33
|
+
|
|
32
34
|
## Usage
|
|
33
35
|
|
|
34
36
|
Below are examples demonstrating different configurations of the Vue DatePicker component.
|
|
@@ -162,6 +164,35 @@ const selectedDate = (ref < Date) | (null > null)
|
|
|
162
164
|
</template>
|
|
163
165
|
```
|
|
164
166
|
|
|
167
|
+
### 6. Standalone Time Picker
|
|
168
|
+
|
|
169
|
+
A time picker component for selecting time only, with dropdown interface.
|
|
170
|
+
|
|
171
|
+
```vue
|
|
172
|
+
<script setup>
|
|
173
|
+
import { ref } from 'vue'
|
|
174
|
+
import { TimePicker } from 'v-datepicker-lite'
|
|
175
|
+
import 'v-datepicker-lite/style.css'
|
|
176
|
+
const selectedTime = (ref < string) | (null > null)
|
|
177
|
+
</script>
|
|
178
|
+
<template>
|
|
179
|
+
<div>
|
|
180
|
+
<h3>Time Picker</h3>
|
|
181
|
+
<TimePicker v-model:model-value="selectedTime" time-format="12h" />
|
|
182
|
+
|
|
183
|
+
<!-- With Custom Trigger -->
|
|
184
|
+
<TimePicker v-model:model-value="selectedTime" time-format="12h" v-slot="{ displayTime }">
|
|
185
|
+
<button>{{ displayTime }}</button>
|
|
186
|
+
</TimePicker>
|
|
187
|
+
|
|
188
|
+
<p>
|
|
189
|
+
Selected:
|
|
190
|
+
{{ selectedTime || 'None' }}
|
|
191
|
+
</p>
|
|
192
|
+
</div>
|
|
193
|
+
</template>
|
|
194
|
+
```
|
|
195
|
+
|
|
165
196
|
## Props
|
|
166
197
|
|
|
167
198
|
| Prop | Type | Default | Description |
|
|
@@ -177,6 +208,13 @@ const selectedDate = (ref < Date) | (null > null)
|
|
|
177
208
|
| `disabled` | `boolean` | `false` | Disables the date picker. |
|
|
178
209
|
| `readonly` | `boolean` | `false` | Makes the date picker read-only. |
|
|
179
210
|
|
|
211
|
+
## Props - TimePicker
|
|
212
|
+
|
|
213
|
+
| Prop | Type | Default | Description |
|
|
214
|
+
| ------------ | ---------------- | ------- | -------------------------------------------------------- |
|
|
215
|
+
| `modelValue` | `string \| null` | `null` | v-model binding for the selected time (format: `HH:mm`). |
|
|
216
|
+
| `timeFormat` | `string` | `'12h'` | Time format: `12h` or `24h`. |
|
|
217
|
+
|
|
180
218
|
## Events
|
|
181
219
|
|
|
182
220
|
| Event | Payload Type | Description |
|
|
@@ -185,6 +223,12 @@ const selectedDate = (ref < Date) | (null > null)
|
|
|
185
223
|
| `change` | `Date \| string \| null` | Emitted when the selected value changes. |
|
|
186
224
|
| `select` | `Date \| string \| null` | Emitted when a date/time is selected. |
|
|
187
225
|
|
|
226
|
+
## Events - TimePicker
|
|
227
|
+
|
|
228
|
+
| Event | Payload Type | Description |
|
|
229
|
+
| ------------------- | ------------ | --------------------------------------- |
|
|
230
|
+
| `update:modelValue` | `string` | Emitted when the selected time changes. |
|
|
231
|
+
|
|
188
232
|
## Styling
|
|
189
233
|
|
|
190
234
|
Customize the appearance using the following CSS variables defined in `style.css`:
|
|
@@ -200,6 +244,13 @@ Customize the appearance using the following CSS variables defined in `style.css
|
|
|
200
244
|
--date-picker-disabled: #000000b4;
|
|
201
245
|
--date-picker-today: #00000010;
|
|
202
246
|
--date-picker-radius: 0.375em;
|
|
247
|
+
--timer-picker-bg: white;
|
|
248
|
+
--timer-picker-input-bg: transparent;
|
|
249
|
+
--timer-picker-input-border: #00000020;
|
|
250
|
+
--timer-picker-input-text: inherit;
|
|
251
|
+
--timer-picker-input-text-size: 0.875em;
|
|
252
|
+
--timer-picker-input-border-radius: 0.375em;
|
|
253
|
+
--timer-picker-input-padding: 0.5em 0.75em;
|
|
203
254
|
}
|
|
204
255
|
```
|
|
205
256
|
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
modelValue?: string | null;
|
|
3
|
+
timeFormat?: '12h' | '24h';
|
|
4
|
+
triggerClass?: string;
|
|
5
|
+
style?: any;
|
|
6
|
+
className?: any;
|
|
7
|
+
}
|
|
8
|
+
declare function __VLS_template(): {
|
|
9
|
+
default?(_: {
|
|
10
|
+
displayTime: string;
|
|
11
|
+
}): any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
14
|
+
modelValue: any;
|
|
15
|
+
timeFormat: string;
|
|
16
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
17
|
+
"update:modelValue": (value: string) => void;
|
|
18
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
19
|
+
modelValue: any;
|
|
20
|
+
timeFormat: string;
|
|
21
|
+
}>>> & Readonly<{
|
|
22
|
+
"onUpdate:modelValue"?: (value: string) => any;
|
|
23
|
+
}>, {
|
|
24
|
+
timeFormat: "12h" | "24h";
|
|
25
|
+
modelValue: string | null;
|
|
26
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
27
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
30
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
31
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
32
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
33
|
+
} : {
|
|
34
|
+
type: import('vue').PropType<T[K]>;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
type __VLS_WithDefaults<P, D> = {
|
|
39
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
40
|
+
default: D[K];
|
|
41
|
+
}> : P[K];
|
|
42
|
+
};
|
|
43
|
+
type __VLS_Prettify<T> = {
|
|
44
|
+
[K in keyof T]: T[K];
|
|
45
|
+
} & {};
|
|
46
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
47
|
+
new (): {
|
|
48
|
+
$slots: S;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
selectedHour: number;
|
|
3
|
+
selectedMinute: number;
|
|
4
|
+
selectedPeriod: 'AM' | 'PM';
|
|
5
|
+
is12Hour: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {
|
|
8
|
+
scrollToSelected: () => void;
|
|
9
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
|
+
"select-hour": (hour: number) => void;
|
|
11
|
+
"select-minute": (minute: number) => void;
|
|
12
|
+
"select-period": (period: "AM" | "PM") => void;
|
|
13
|
+
close: () => void;
|
|
14
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{
|
|
15
|
+
"onSelect-hour"?: (hour: number) => any;
|
|
16
|
+
"onSelect-minute"?: (minute: number) => any;
|
|
17
|
+
"onSelect-period"?: (period: "AM" | "PM") => any;
|
|
18
|
+
onClose?: () => any;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
22
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
23
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
24
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
25
|
+
} : {
|
|
26
|
+
type: import('vue').PropType<T[K]>;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
hour: number;
|
|
3
|
+
minute: number;
|
|
4
|
+
period: 'AM' | 'PM';
|
|
5
|
+
is12Hour: boolean;
|
|
6
|
+
triggerClass?: string;
|
|
7
|
+
}
|
|
8
|
+
declare function __VLS_template(): {
|
|
9
|
+
default?(_: {
|
|
10
|
+
displayTime: string;
|
|
11
|
+
}): any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
14
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
17
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
18
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
19
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
20
|
+
} : {
|
|
21
|
+
type: import('vue').PropType<T[K]>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|