v-datepicker-lite 0.0.4 → 0.0.6

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 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,29 @@ 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
+ <p>
183
+ Selected:
184
+ {{ selectedTime || 'None' }}
185
+ </p>
186
+ </div>
187
+ </template>
188
+ ```
189
+
165
190
  ## Props
166
191
 
167
192
  | Prop | Type | Default | Description |
@@ -177,6 +202,13 @@ const selectedDate = (ref < Date) | (null > null)
177
202
  | `disabled` | `boolean` | `false` | Disables the date picker. |
178
203
  | `readonly` | `boolean` | `false` | Makes the date picker read-only. |
179
204
 
205
+ ## Props - TimePicker
206
+
207
+ | Prop | Type | Default | Description |
208
+ | ------------ | ---------------- | ------- | -------------------------------------------------------- |
209
+ | `modelValue` | `string \| null` | `null` | v-model binding for the selected time (format: `HH:mm`). |
210
+ | `timeFormat` | `string` | `'12h'` | Time format: `12h` or `24h`. |
211
+
180
212
  ## Events
181
213
 
182
214
  | Event | Payload Type | Description |
@@ -185,6 +217,12 @@ const selectedDate = (ref < Date) | (null > null)
185
217
  | `change` | `Date \| string \| null` | Emitted when the selected value changes. |
186
218
  | `select` | `Date \| string \| null` | Emitted when a date/time is selected. |
187
219
 
220
+ ## Events - TimePicker
221
+
222
+ | Event | Payload Type | Description |
223
+ | ------------------- | ------------ | --------------------------------------- |
224
+ | `update:modelValue` | `string` | Emitted when the selected time changes. |
225
+
188
226
  ## Styling
189
227
 
190
228
  Customize the appearance using the following CSS variables defined in `style.css`:
@@ -200,6 +238,13 @@ Customize the appearance using the following CSS variables defined in `style.css
200
238
  --date-picker-disabled: #000000b4;
201
239
  --date-picker-today: #00000010;
202
240
  --date-picker-radius: 0.375em;
241
+ --timer-picker-bg: white;
242
+ --timer-picker-input-bg: transparent;
243
+ --timer-picker-input-border: #00000020;
244
+ --timer-picker-input-text: inherit;
245
+ --timer-picker-input-text-size: 0.875em;
246
+ --timer-picker-input-border-radius: 0.375em;
247
+ --timer-picker-input-padding: 0.5em 0.75em;
203
248
  }
204
249
  ```
205
250
 
@@ -0,0 +1,36 @@
1
+ interface Props {
2
+ modelValue?: string | null;
3
+ timeFormat?: '12h' | '24h';
4
+ }
5
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
6
+ modelValue: any;
7
+ timeFormat: string;
8
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
+ "update:modelValue": (value: string) => void;
10
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
11
+ modelValue: any;
12
+ timeFormat: string;
13
+ }>>> & Readonly<{
14
+ "onUpdate:modelValue"?: (value: string) => any;
15
+ }>, {
16
+ timeFormat: "12h" | "24h";
17
+ modelValue: string | null;
18
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
19
+ export default _default;
20
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
21
+ type __VLS_TypePropsToRuntimeProps<T> = {
22
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
23
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
24
+ } : {
25
+ type: import('vue').PropType<T[K]>;
26
+ required: true;
27
+ };
28
+ };
29
+ type __VLS_WithDefaults<P, D> = {
30
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
31
+ default: D[K];
32
+ }> : P[K];
33
+ };
34
+ type __VLS_Prettify<T> = {
35
+ [K in keyof T]: T[K];
36
+ } & {};
@@ -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,21 @@
1
+ interface Props {
2
+ hour: number;
3
+ minute: number;
4
+ period: 'AM' | 'PM';
5
+ is12Hour: boolean;
6
+ }
7
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
8
+ toggle: () => void;
9
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{
10
+ onToggle?: () => any;
11
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
12
+ export default _default;
13
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
14
+ type __VLS_TypePropsToRuntimeProps<T> = {
15
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
16
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
17
+ } : {
18
+ type: import('vue').PropType<T[K]>;
19
+ required: true;
20
+ };
21
+ };
package/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
1
  import { default as DatePicker } from './components/DatePicker.vue';
2
+ import { default as TimePicker } from './components/time-picker/TimePicker.vue';
2
3
 
3
4
  export default DatePicker;
5
+ export { TimePicker };