vuiii 1.0.0-beta.6 → 1.0.0-beta.8

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.
Files changed (35) hide show
  1. package/dist/components/Breadcrumbs.vue.d.ts +79 -15
  2. package/dist/components/Button.vue.d.ts +94 -69
  3. package/dist/components/Checkbox.vue.d.ts +91 -25
  4. package/dist/components/CheckboxGroup.vue.d.ts +92 -57
  5. package/dist/components/Form.vue.d.ts +184 -82
  6. package/dist/components/FormFields.vue.d.ts +99 -50
  7. package/dist/components/FormGroup.vue.d.ts +85 -45
  8. package/dist/components/Icon.vue.d.ts +59 -14
  9. package/dist/components/Input.vue.d.ts +109 -55
  10. package/dist/components/Radio.vue.d.ts +91 -61
  11. package/dist/components/Select.vue.d.ts +147 -82
  12. package/dist/components/Table.vue.d.ts +69 -48
  13. package/dist/components/Textarea.vue.d.ts +77 -18
  14. package/dist/components/modal/ModalLayout.vue.d.ts +1 -1
  15. package/dist/components/modal/ModalStack.vue.d.ts +2 -2
  16. package/dist/hooks/useOnClickOutside.d.ts +2 -0
  17. package/dist/hooks/useOnKeyPress.d.ts +1 -0
  18. package/dist/hooks/useRouteQuery.d.ts +17 -0
  19. package/dist/hooks/useSubmitAction.d.ts +1 -7
  20. package/dist/icons/mail.vue.d.ts +2 -0
  21. package/dist/index.d.ts +7 -6
  22. package/dist/stories/Button.stories.d.ts +449 -0
  23. package/dist/stories/Icon.stories.d.ts +128 -0
  24. package/dist/stories/Input.stories.d.ts +422 -0
  25. package/dist/stories/icons.d.ts +1 -0
  26. package/dist/style.css +1 -1
  27. package/dist/types.d.ts +51 -4
  28. package/dist/utils/generateId.d.ts +1 -0
  29. package/dist/utils/iconsResolver.d.ts +5 -0
  30. package/dist/utils/normalizeOptions.d.ts +11 -8
  31. package/dist/validations/validator.d.ts +2 -0
  32. package/dist/vuiii.mjs +1488 -0
  33. package/dist/vuiii.umd.js +1 -1
  34. package/package.json +24 -9
  35. package/dist/vuiii.es.js +0 -1882
@@ -1,51 +1,72 @@
1
1
  import '../assets/css/table.css';
2
2
  import '../assets/css/typography.css';
3
- import { PropType } from 'vue';
4
- import { RouteLocationRaw } from 'vue-router';
5
- declare type ColumnOptions<T = any> = {
6
- label?: string;
7
- align?: 'left' | 'right' | 'center';
8
- width?: string;
9
- value?: (item: T) => unknown;
10
- format?: (...params: any[]) => unknown;
11
- href?: (item: T) => RouteLocationRaw;
12
- };
13
- declare type NormalizedTableColumns<T = any> = Record<keyof T | string, ColumnOptions<T>>;
14
- export declare type TableColumns<T = any> = Record<keyof T | string, string | ColumnOptions<T>>;
15
- declare const _default: import("vue").DefineComponent<{
16
- items: {
17
- type: ArrayConstructor;
18
- default: () => never[];
19
- };
20
- columns: {
21
- type: PropType<TableColumns<any>>;
22
- default: null;
23
- };
24
- rowClass: {
25
- type: (StringConstructor | FunctionConstructor)[];
26
- default: null;
27
- };
28
- }, unknown, unknown, {
29
- normalizedColumns(): NormalizedTableColumns;
30
- }, {
31
- formatValue(item: any, key: keyof NormalizedTableColumns): any;
32
- resolveRowClass(item: any): any;
33
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
34
- items: {
35
- type: ArrayConstructor;
36
- default: () => never[];
37
- };
38
- columns: {
39
- type: PropType<TableColumns<any>>;
40
- default: null;
41
- };
42
- rowClass: {
43
- type: (StringConstructor | FunctionConstructor)[];
44
- default: null;
45
- };
46
- }>>, {
47
- items: unknown[];
48
- columns: TableColumns<any>;
49
- rowClass: string | Function;
50
- }>;
3
+ import { TableColumns } from '@/types';
4
+ declare const _default: {
5
+ new (...args: any[]): {
6
+ $: import("vue").ComponentInternalInstance;
7
+ $data: {};
8
+ $props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
9
+ items: any[];
10
+ columns: TableColumns;
11
+ rowClass?: string | ((item: any) => string) | undefined;
12
+ }>>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
13
+ $attrs: {
14
+ [x: string]: unknown;
15
+ };
16
+ $refs: {
17
+ [x: string]: unknown;
18
+ };
19
+ $slots: Readonly<{
20
+ [name: string]: import("vue").Slot | undefined;
21
+ }>;
22
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
23
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
24
+ $emit: (event: string, ...args: any[]) => void;
25
+ $el: any;
26
+ $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
27
+ items: any[];
28
+ columns: TableColumns;
29
+ rowClass?: string | ((item: any) => string) | undefined;
30
+ }>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string> & {
31
+ beforeCreate?: ((() => void) | (() => void)[]) | undefined;
32
+ created?: ((() => void) | (() => void)[]) | undefined;
33
+ beforeMount?: ((() => void) | (() => void)[]) | undefined;
34
+ mounted?: ((() => void) | (() => void)[]) | undefined;
35
+ beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
36
+ updated?: ((() => void) | (() => void)[]) | undefined;
37
+ activated?: ((() => void) | (() => void)[]) | undefined;
38
+ deactivated?: ((() => void) | (() => void)[]) | undefined;
39
+ beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
40
+ beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
41
+ destroyed?: ((() => void) | (() => void)[]) | undefined;
42
+ unmounted?: ((() => void) | (() => void)[]) | undefined;
43
+ renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
44
+ renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
45
+ errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void)[]) | undefined;
46
+ };
47
+ $forceUpdate: () => void;
48
+ $nextTick: typeof import("vue").nextTick;
49
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
50
+ } & Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
51
+ items: any[];
52
+ columns: TableColumns;
53
+ rowClass?: string | ((item: any) => string) | undefined;
54
+ }>>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {};
55
+ __isFragment?: undefined;
56
+ __isTeleport?: undefined;
57
+ __isSuspense?: undefined;
58
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
59
+ items: any[];
60
+ columns: TableColumns;
61
+ rowClass?: string | ((item: any) => string) | undefined;
62
+ }>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
51
63
  export default _default;
64
+ declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
65
+ declare type __VLS_TypePropsToRuntimeProps<T> = {
66
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
67
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
68
+ } : {
69
+ type: import('vue').PropType<T[K]>;
70
+ required: true;
71
+ };
72
+ };
@@ -1,19 +1,78 @@
1
- import '../assets/css/input.css';
2
- declare const _default: import("vue").DefineComponent<{
3
- modelValue: {
4
- type: StringConstructor;
5
- default: string;
6
- };
7
- }, unknown, unknown, {}, {}, import("vue").DefineComponent<{}, {}, {}, {
8
- normalizedAttrs(): any;
9
- }, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
10
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
11
- }, {}>, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
12
- modelValue: {
13
- type: StringConstructor;
14
- default: string;
15
- };
16
- }>>, {
17
- modelValue: string;
18
- }>;
1
+ import { InputSize } from '../types';
2
+ declare const _default: {
3
+ new (...args: any[]): {
4
+ $: import("vue").ComponentInternalInstance;
5
+ $data: {};
6
+ $props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
7
+ modelValue?: string | undefined;
8
+ size?: InputSize | undefined;
9
+ }>>> & {
10
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
11
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
12
+ $attrs: {
13
+ [x: string]: unknown;
14
+ };
15
+ $refs: {
16
+ [x: string]: unknown;
17
+ };
18
+ $slots: Readonly<{
19
+ [name: string]: import("vue").Slot | undefined;
20
+ }>;
21
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
22
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
23
+ $emit: (event: "update:modelValue", value: string) => void;
24
+ $el: any;
25
+ $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
26
+ modelValue?: string | undefined;
27
+ size?: InputSize | undefined;
28
+ }>>> & {
29
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
30
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
31
+ "update:modelValue": (value: string) => void;
32
+ }, string, {}, {}, string> & {
33
+ beforeCreate?: ((() => void) | (() => void)[]) | undefined;
34
+ created?: ((() => void) | (() => void)[]) | undefined;
35
+ beforeMount?: ((() => void) | (() => void)[]) | undefined;
36
+ mounted?: ((() => void) | (() => void)[]) | undefined;
37
+ beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
38
+ updated?: ((() => void) | (() => void)[]) | undefined;
39
+ activated?: ((() => void) | (() => void)[]) | undefined;
40
+ deactivated?: ((() => void) | (() => void)[]) | undefined;
41
+ beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
42
+ beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
43
+ destroyed?: ((() => void) | (() => void)[]) | undefined;
44
+ unmounted?: ((() => void) | (() => void)[]) | undefined;
45
+ renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
46
+ renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
47
+ errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void)[]) | undefined;
48
+ };
49
+ $forceUpdate: () => void;
50
+ $nextTick: typeof import("vue").nextTick;
51
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
52
+ } & Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
53
+ modelValue?: string | undefined;
54
+ size?: InputSize | undefined;
55
+ }>>> & {
56
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
57
+ } & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {};
58
+ __isFragment?: undefined;
59
+ __isTeleport?: undefined;
60
+ __isSuspense?: undefined;
61
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
62
+ modelValue?: string | undefined;
63
+ size?: InputSize | undefined;
64
+ }>>> & {
65
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
66
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
67
+ "update:modelValue": (value: string) => void;
68
+ }, string, {}, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
19
69
  export default _default;
70
+ declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
71
+ declare type __VLS_TypePropsToRuntimeProps<T> = {
72
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
73
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
74
+ } : {
75
+ type: import('vue').PropType<T[K]>;
76
+ required: true;
77
+ };
78
+ };
@@ -17,7 +17,7 @@ declare const _default: import("vue").DefineComponent<{
17
17
  computedStyle(): Partial<CSSProperties>;
18
18
  }, {
19
19
  close(): void;
20
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
20
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
21
21
  title: {
22
22
  type: StringConstructor;
23
23
  default: string;
@@ -6,8 +6,8 @@ declare const _default: import("vue").DefineComponent<{
6
6
  default: () => never[];
7
7
  };
8
8
  }, unknown, {
9
- modalInstances: Record<number, ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>>;
10
- registerReference(modalId: number): (instance: ComponentPublicInstance) => ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
9
+ modalInstances: Record<number, ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>>;
10
+ registerReference(modalId: number): (instance: ComponentPublicInstance) => ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>;
11
11
  }, {
12
12
  activeModal(): Modal | null;
13
13
  }, {
@@ -0,0 +1,2 @@
1
+ import { Ref } from 'vue';
2
+ export declare function useOnClickOutside(element: Ref<HTMLElement | null>, callback: () => void): void;
@@ -0,0 +1 @@
1
+ export declare function useOnKeyPress(key: KeyboardEvent['code'], callback: (event?: KeyboardEvent) => boolean | void): void;
@@ -0,0 +1,17 @@
1
+ import { Ref } from 'vue';
2
+ export declare type QueryParams = Record<string, string | string[]>;
3
+ export declare function useRouteQuery(onChange: (params: QueryParams) => void, options?: {
4
+ filter?: string[];
5
+ parse?: Record<string, (value: string | string[]) => any>;
6
+ serialize?: Record<string, (value: any) => string | string[]>;
7
+ immediate?: boolean;
8
+ }): {
9
+ params: Ref<QueryParams>;
10
+ setQuery: (params: QueryParams) => void;
11
+ };
12
+ export declare function usePageFromRouteQuery(onChange: (page: number) => void, options?: {
13
+ immediate?: boolean;
14
+ }): {
15
+ page: Ref<number>;
16
+ setPage: (page: number) => void;
17
+ };
@@ -2,13 +2,7 @@ import { Ref } from 'vue';
2
2
  import { RouteLocationRaw, Router } from 'vue-router';
3
3
  import { useModal } from '../modal';
4
4
  import { Snackbar } from '../snackbar';
5
- export declare type ValidationErrors<T = any> = {
6
- [key in keyof T]?: any;
7
- };
8
- export declare type ValidationResults<T = any> = {
9
- isValid: boolean;
10
- errors: ValidationErrors<T>;
11
- };
5
+ import { ValidationErrors, ValidationResults } from '../types';
12
6
  declare type ConfirmParams = Parameters<ReturnType<typeof useModal>['confirm']>[0];
13
7
  export declare function useSubmitAction<D = unknown, R = unknown>(action: (data: D) => any | Promise<any>, options?: {
14
8
  validator?: (data: D) => boolean | Promise<ValidationResults<D> | boolean>;
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
package/dist/index.d.ts CHANGED
@@ -1,24 +1,25 @@
1
1
  import './assets/css/style.css';
2
- export type { BreadcrumbItems } from './components/Breadcrumbs.vue';
3
2
  export { default as Breadcrumbs } from './components/Breadcrumbs.vue';
4
3
  export { default as Button } from './components/Button.vue';
5
4
  export { default as Checkbox } from './components/Checkbox.vue';
6
5
  export { default as CheckboxGroup } from './components/CheckboxGroup.vue';
7
- export type { FormStructure } from './components/Form.vue';
8
6
  export { default as Form } from './components/Form.vue';
9
- export type { FormFieldsStructure } from './components/FormFields.vue';
10
7
  export { default as FormFields } from './components/FormFields.vue';
11
8
  export { default as FormGroup } from './components/FormGroup.vue';
12
- export { default as Icon, registerCustomIconResolver } from './components/Icon.vue';
9
+ export { default as Icon } from './components/Icon.vue';
13
10
  export { default as Input } from './components/Input.vue';
14
11
  export { default as ModalLayout } from './components/modal/ModalLayout.vue';
15
12
  export { default as Radio } from './components/Radio.vue';
16
13
  export { default as Select } from './components/Select.vue';
17
- export type { TableColumns } from './components/Table.vue';
18
14
  export { default as Table } from './components/Table.vue';
19
15
  export { default as Textarea } from './components/Textarea.vue';
20
16
  export { useLoadData } from './hooks/useLoadData';
17
+ export { useOnClickOutside } from './hooks/useOnClickOutside';
18
+ export { useOnKeyPress } from './hooks/useOnKeyPress';
19
+ export { usePageFromRouteQuery, useRouteQuery } from './hooks/useRouteQuery';
21
20
  export { useSubmitAction } from './hooks/useSubmitAction';
22
21
  export { modal, useModal } from './modal';
23
22
  export { snackbar, useSnackbar } from './snackbar';
24
- export type { ButtonSize, ButtonVariant } from './types';
23
+ export type { BreadcrumbItems, ButtonSize, ButtonVariant, FormFieldsStructure, FormStructure, TableColumns, ValidationErrors, ValidationResults } from './types';
24
+ export { registerCustomIconResolver } from './utils/iconsResolver';
25
+ export { ValidationError } from './validations/validator';