@a-vision-software/vue-input-components 1.4.9 → 1.4.11

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
@@ -51,6 +51,18 @@ A flexible and customizable list component that supports sorting, filtering, and
51
51
  ```bash
52
52
  npm install @a-vision-software/vue-input-components
53
53
  ```
54
+ ### Declare global types
55
+ Add the global types to your `tsconfig.app.json`
56
+
57
+ ```
58
+ {
59
+ ...
60
+ "compilerOptions": {
61
+ ...
62
+ "types": ["@a-vision-software/vue-input-components/global"],
63
+ }
64
+ }
65
+ ```
54
66
 
55
67
  ## Quick Start
56
68
 
@@ -1,95 +1,3 @@
1
- import { TextInputProps } from '../types/textinput';
2
1
 
3
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TextInputProps>, {
4
- modelValue: string;
5
- type: string;
6
- placeholder: string;
7
- label: string;
8
- icon: undefined;
9
- disabled: boolean;
10
- readonly: boolean;
11
- maxlength: undefined;
12
- error: string;
13
- min: undefined;
14
- max: undefined;
15
- labelPosition: string;
16
- labelAlign: string;
17
- labelWidth: string;
18
- height: string;
19
- maxHeight: string;
20
- bgColor: string;
21
- width: (props: any) => "100%" | "10rem";
22
- }>>, {
23
- focus: () => void | undefined;
24
- blur: () => void | undefined;
25
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
26
- "update:modelValue": (value: string) => void;
27
- changed: () => void;
28
- saved: () => void;
29
- focus: () => void;
30
- blur: () => void;
31
- keydown: (event: KeyboardEvent) => void;
32
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TextInputProps>, {
33
- modelValue: string;
34
- type: string;
35
- placeholder: string;
36
- label: string;
37
- icon: undefined;
38
- disabled: boolean;
39
- readonly: boolean;
40
- maxlength: undefined;
41
- error: string;
42
- min: undefined;
43
- max: undefined;
44
- labelPosition: string;
45
- labelAlign: string;
46
- labelWidth: string;
47
- height: string;
48
- maxHeight: string;
49
- bgColor: string;
50
- width: (props: any) => "100%" | "10rem";
51
- }>>> & Readonly<{
52
- onBlur?: (() => any) | undefined;
53
- onFocus?: (() => any) | undefined;
54
- onKeydown?: ((event: KeyboardEvent) => any) | undefined;
55
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
56
- onChanged?: (() => any) | undefined;
57
- onSaved?: (() => any) | undefined;
58
- }>, {
59
- error: string;
60
- disabled: boolean;
61
- max: string | Date;
62
- type: "number" | "textarea" | "text" | "date" | "email" | "password" | "tel" | "url";
63
- icon: string;
64
- label: string;
65
- modelValue: string;
66
- width: string;
67
- labelPosition: "top" | "left";
68
- labelAlign: "left" | "center" | "right";
69
- labelWidth: string;
70
- placeholder: string;
71
- maxHeight: string;
72
- readonly: boolean;
73
- maxlength: number;
74
- min: string | Date;
75
- height: string;
76
- bgColor: string;
77
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: import('vue').DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import('vue').PublicProps>;
78
3
  export default _default;
79
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
80
- type __VLS_TypePropsToRuntimeProps<T> = {
81
- [K in keyof T]-?: {} extends Pick<T, K> ? {
82
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
83
- } : {
84
- type: import('vue').PropType<T[K]>;
85
- required: true;
86
- };
87
- };
88
- type __VLS_WithDefaults<P, D> = {
89
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
90
- default: D[K];
91
- }> : P[K];
92
- };
93
- type __VLS_Prettify<T> = {
94
- [K in keyof T]: T[K];
95
- } & {};
@@ -0,0 +1,22 @@
1
+ import { default as TextInput } from './components/TextInput.vue';
2
+ import { default as FileUpload } from './components/FileUpload.vue';
3
+ import { default as Navigation } from './components/Navigation.vue';
4
+ import { default as Action } from './components/Action.vue';
5
+ import { default as Dropdown } from './components/Dropdown.vue';
6
+ import { default as Checkbox } from './components/Checkbox.vue';
7
+ import { default as List } from './components/List.vue';
8
+ import { default as Modal } from './components/Modal.vue';
9
+
10
+ declare module '@vue/runtime-core' {
11
+ interface GlobalComponents {
12
+ TextInput: typeof TextInput;
13
+ FileUpload: typeof FileUpload;
14
+ Navigation: typeof Navigation;
15
+ Action: typeof Action;
16
+ Dropdown: typeof Dropdown;
17
+ Checkbox: typeof Checkbox;
18
+ List: typeof List;
19
+ Modal: typeof Modal;
20
+ }
21
+ }
22
+ export {};
@@ -5,7 +5,7 @@ export interface DropdownOption {
5
5
  }
6
6
  export interface DropdownProps {
7
7
  options: DropdownOption[];
8
- modelValue: string | string[];
8
+ modelValue: string | string[] | null;
9
9
  multiple?: boolean;
10
10
  placeholder?: string;
11
11
  filterable?: boolean;
@@ -1,6 +1,6 @@
1
1
  export interface NavigationItem {
2
2
  id: string;
3
- label: string;
3
+ label?: string;
4
4
  url?: string;
5
5
  icon?: string;
6
6
  disabled?: boolean;
@@ -1,7 +1,5 @@
1
- export interface TextInputProps {
2
- modelValue: string;
1
+ export type TextInputProps = {
3
2
  required?: boolean;
4
- type?: 'text' | 'textarea' | 'password' | 'email' | 'tel' | 'url' | 'date' | 'number';
5
3
  placeholder?: string;
6
4
  label?: string;
7
5
  labelPosition?: 'top' | 'left';
@@ -19,7 +17,13 @@ export interface TextInputProps {
19
17
  bgColor?: string;
20
18
  autosave?: (value: string) => Promise<void>;
21
19
  error?: string;
22
- }
20
+ } & ({
21
+ modelValue: string;
22
+ type?: 'text' | 'textarea' | 'password' | 'email' | 'tel' | 'url' | 'date';
23
+ } | {
24
+ modelValue: number;
25
+ type: 'number';
26
+ });
23
27
  export interface TextInputEmits {
24
28
  (e: 'update:modelValue', value: string): void;
25
29
  (e: 'changed'): void;