@v1nt1248/3nclient-lib 0.1.0 → 0.1.2

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 (60) hide show
  1. package/README.md +5 -0
  2. package/dist/components/index.d.ts +6 -3
  3. package/dist/components/ui3n-badge-simple.vue.d.ts +13 -13
  4. package/dist/components/ui3n-badge.vue.d.ts +18 -16
  5. package/dist/components/ui3n-breadcrumb.vue.d.ts +15 -13
  6. package/dist/components/ui3n-breadcrumbs.vue.d.ts +17 -15
  7. package/dist/components/ui3n-button.vue.d.ts +23 -19
  8. package/dist/components/ui3n-checkbox.vue.d.ts +17 -15
  9. package/dist/components/ui3n-chip.vue.d.ts +18 -16
  10. package/dist/components/ui3n-dialog.vue.d.ts +4 -5
  11. package/dist/components/ui3n-drop-files.vue.d.ts +16 -14
  12. package/dist/components/ui3n-emoji.vue.d.ts +11 -11
  13. package/dist/components/ui3n-icon.vue.d.ts +12 -12
  14. package/dist/components/ui3n-input.vue.d.ts +12 -5
  15. package/dist/components/ui3n-list.vue.d.ts +12 -39
  16. package/dist/components/ui3n-menu.vue.d.ts +14 -12
  17. package/dist/components/ui3n-notification.vue.d.ts +14 -15
  18. package/dist/components/ui3n-progress-circular.vue.d.ts +43 -0
  19. package/dist/components/ui3n-progress-linear.vue.d.ts +42 -0
  20. package/dist/components/ui3n-step-line-bar.vue.d.ts +30 -0
  21. package/dist/components/ui3n-switch.vue.d.ts +15 -13
  22. package/dist/components/ui3n-table/composables/useTable.d.ts +26 -0
  23. package/dist/components/ui3n-table/types.d.ts +65 -0
  24. package/dist/components/ui3n-table/ui3n-table.vue.d.ts +22 -0
  25. package/dist/components/ui3n-table-sort-icon.vue.d.ts +2 -2
  26. package/dist/components/ui3n-tabs.vue.d.ts +18 -16
  27. package/dist/components/ui3n-text.vue.d.ts +13 -13
  28. package/dist/components/ui3n-virtual-scroll.vue.d.ts +6 -28
  29. package/dist/directives/index.d.ts +0 -1
  30. package/dist/directives/ui3n-click-outside.d.ts +0 -1
  31. package/dist/directives/ui3n-html.d.ts +0 -1
  32. package/dist/index.d.ts +10 -1
  33. package/dist/plugins/dialogs.d.ts +0 -1
  34. package/dist/plugins/i18n.d.ts +0 -1
  35. package/dist/plugins/icons.d.ts +0 -1
  36. package/dist/plugins/index.d.ts +0 -1
  37. package/dist/plugins/notifications.d.ts +0 -1
  38. package/dist/plugins/store-dialogs.d.ts +0 -1
  39. package/dist/plugins/store-notifications.d.ts +0 -1
  40. package/dist/plugins/store-vue-bus.d.ts +0 -1
  41. package/dist/plugins/vue-bus.d.ts +0 -1
  42. package/dist/style.css +1 -1
  43. package/dist/tools/sqlite-on-3nstorage/index.d.ts +0 -1
  44. package/dist/tools/ui.helpers.d.ts +0 -1
  45. package/dist/ui-3n-lib.js +6588 -6551
  46. package/package.json +31 -29
  47. package/src/components/index.ts +46 -4
  48. package/src/components/ui3n-button.vue +6 -0
  49. package/src/components/ui3n-checkbox.vue +1 -1
  50. package/src/components/ui3n-dialog.vue +6 -1
  51. package/src/components/ui3n-input.vue +61 -11
  52. package/src/components/ui3n-progress-circular.vue +188 -0
  53. package/src/components/ui3n-progress-linear.vue +119 -0
  54. package/src/components/ui3n-step-line-bar.vue +66 -0
  55. package/src/components/ui3n-table/composables/useTable.ts +206 -0
  56. package/src/components/ui3n-table/types.ts +80 -0
  57. package/src/components/ui3n-table/ui3n-table.vue +319 -0
  58. package/src/components/{ui3n-table.vue → ui3n-table-simple.vue} +3 -4
  59. package/src/components/ui3n-table-sort-icon.vue +9 -6
  60. package/dist/components/ui3n-table.vue.d.ts +0 -36
@@ -1,15 +1,20 @@
1
1
  export interface Ui3nInputProps {
2
2
  modelValue: string;
3
3
  label?: string;
4
+ type?: 'text' | 'password';
4
5
  placeholder?: string;
5
6
  clearable?: boolean;
6
7
  autofocus?: boolean;
7
- rules?: Array<(v: string) => any>;
8
- disabled?: boolean;
9
8
  icon?: string;
10
9
  iconColor?: string;
10
+ rules?: Array<(v: string) => any>;
11
+ displayStateMode?: 'error' | 'success';
12
+ displayStateWithIcon?: boolean;
13
+ displayStateMessage?: string;
14
+ disabled?: boolean;
11
15
  }
12
16
  export interface Ui3nInputEmits {
17
+ (ev: 'init', value: HTMLInputElement): void;
13
18
  (ev: 'input', value: string): void;
14
19
  (ev: 'focus', value: Event): void;
15
20
  (ev: 'blur', value: Event): void;
@@ -18,7 +23,8 @@ export interface Ui3nInputEmits {
18
23
  (ev: 'update:modelValue', value: string): void;
19
24
  (ev: 'update:valid', value: boolean): void;
20
25
  }
21
- declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<Ui3nInputProps>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
26
+ declare const _default: import('vue').DefineComponent<__VLS_TypePropsToOption<Ui3nInputProps>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
27
+ init: (value: HTMLInputElement) => void;
22
28
  input: (value: string) => void;
23
29
  focus: (value: Event) => void;
24
30
  blur: (value: Event) => void;
@@ -26,7 +32,8 @@ declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimePr
26
32
  change: (value: string) => void;
27
33
  "update:modelValue": (value: string) => void;
28
34
  "update:valid": (value: boolean) => void;
29
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Ui3nInputProps>>> & {
35
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<Ui3nInputProps>>> & {
36
+ onInit?: ((value: HTMLInputElement) => any) | undefined;
30
37
  onFocus?: ((value: Event) => any) | undefined;
31
38
  onBlur?: ((value: Event) => any) | undefined;
32
39
  onChange?: ((value: string) => any) | undefined;
@@ -37,7 +44,7 @@ declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimePr
37
44
  }, {}, {}>;
38
45
  export default _default;
39
46
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
40
- type __VLS_TypePropsToRuntimeProps<T> = {
47
+ type __VLS_TypePropsToOption<T> = {
41
48
  [K in keyof T]-?: {} extends Pick<T, K> ? {
42
49
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
43
50
  } : {
@@ -18,54 +18,27 @@ export interface Ui3nListSlots<T> {
18
18
  }) => any;
19
19
  }
20
20
  declare const _default: <T extends {
21
- id?: string | undefined;
22
- }>(__VLS_props: {
23
- title?: string | undefined;
24
- onSelect?: ((value: {
25
- value: T;
26
- index: number;
27
- }) => any) | undefined;
28
- disabled?: boolean | undefined;
29
- sticky?: boolean | undefined;
30
- items: T[];
31
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, __VLS_ctx?: {
32
- attrs: any;
33
- slots: Readonly<Ui3nListSlots<T>> & Ui3nListSlots<T>;
34
- emit: Ui3nListEmits<T>;
35
- } | undefined, __VLS_expose?: ((exposed: import('vue').ShallowUnwrapRef<{}>) => void) | undefined, __VLS_setup?: Promise<{
36
- props: {
37
- title?: string | undefined;
21
+ id?: string;
22
+ }>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_Prettify<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
23
+ props: __VLS_Prettify<Pick<Partial<{}> & Omit<{
24
+ onSelect?: ((value: {
25
+ value: T;
26
+ index: number;
27
+ }) => any) | undefined;
28
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{}>> & {
38
29
  onSelect?: ((value: {
39
30
  value: T;
40
31
  index: number;
41
32
  }) => any) | undefined;
42
- disabled?: boolean | undefined;
43
- sticky?: boolean | undefined;
44
- items: T[];
45
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
33
+ }, never>, "onSelect"> & Ui3nListProps<T>> & import('vue').PublicProps;
46
34
  expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
47
35
  attrs: any;
48
- slots: Readonly<Ui3nListSlots<T>> & Ui3nListSlots<T>;
49
- emit: Ui3nListEmits<T>;
36
+ slots: ReturnType<() => Readonly<Ui3nListSlots<T>> & Ui3nListSlots<T>>;
37
+ emit: Ui3nListEmits<T> & {};
50
38
  }>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
51
39
  [key: string]: any;
52
40
  }> & {
53
- __ctx?: {
54
- props: {
55
- title?: string | undefined;
56
- onSelect?: ((value: {
57
- value: T;
58
- index: number;
59
- }) => any) | undefined;
60
- disabled?: boolean | undefined;
61
- sticky?: boolean | undefined;
62
- items: T[];
63
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
64
- expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
65
- attrs: any;
66
- slots: Readonly<Ui3nListSlots<T>> & Ui3nListSlots<T>;
67
- emit: Ui3nListEmits<T>;
68
- } | undefined;
41
+ __ctx?: Awaited<typeof __VLS_setup>;
69
42
  };
70
43
  export default _default;
71
44
  type __VLS_Prettify<T> = {
@@ -16,7 +16,8 @@ export interface Ui3nMenuSlots {
16
16
  default: () => any;
17
17
  menu?: () => any;
18
18
  }
19
- declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Ui3nMenuProps>, {
19
+ declare function __VLS_template(): Readonly<Ui3nMenuSlots> & Ui3nMenuSlots;
20
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Ui3nMenuProps>, {
20
21
  offsetX: number;
21
22
  offsetY: number;
22
23
  closeOnClick: boolean;
@@ -28,7 +29,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
28
29
  close: () => void;
29
30
  closed: () => void;
30
31
  "click-outside": () => void;
31
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Ui3nMenuProps>, {
32
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Ui3nMenuProps>, {
32
33
  offsetX: number;
33
34
  offsetY: number;
34
35
  closeOnClick: boolean;
@@ -46,17 +47,9 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
46
47
  offsetY: number;
47
48
  closeOnClick: boolean;
48
49
  closeOnClickOutside: boolean;
49
- }, {}>, Readonly<Ui3nMenuSlots> & Ui3nMenuSlots>;
50
+ }, {}>;
51
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
50
52
  export default _default;
51
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
52
- type __VLS_TypePropsToRuntimeProps<T> = {
53
- [K in keyof T]-?: {} extends Pick<T, K> ? {
54
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
55
- } : {
56
- type: import('vue').PropType<T[K]>;
57
- required: true;
58
- };
59
- };
60
53
  type __VLS_WithDefaults<P, D> = {
61
54
  [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
62
55
  default: D[K];
@@ -70,3 +63,12 @@ type __VLS_WithTemplateSlots<T, S> = T & {
70
63
  $slots: S;
71
64
  };
72
65
  };
66
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
67
+ type __VLS_TypePropsToOption<T> = {
68
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
69
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
70
+ } : {
71
+ type: import('vue').PropType<T[K]>;
72
+ required: true;
73
+ };
74
+ };
@@ -1,13 +1,12 @@
1
1
  import { Ui3nNotificationProps } from '../constants';
2
-
3
- declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Ui3nNotificationProps>, {
2
+ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Ui3nNotificationProps>, {
4
3
  type: string;
5
4
  position: string;
6
5
  duration: number;
7
6
  withIcon: boolean;
8
7
  onOpen: () => undefined;
9
8
  onClose: () => undefined;
10
- }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Ui3nNotificationProps>, {
9
+ }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Ui3nNotificationProps>, {
11
10
  type: string;
12
11
  position: string;
13
12
  duration: number;
@@ -15,23 +14,14 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
15
14
  onOpen: () => undefined;
16
15
  onClose: () => undefined;
17
16
  }>>>, {
18
- type: "error" | "success" | "warning" | "info";
19
- position: "right" | "left" | "center";
17
+ type: "success" | "warning" | "info" | "error";
20
18
  onClose: () => void;
21
- withIcon: boolean;
22
19
  onOpen: () => void;
20
+ withIcon: boolean;
23
21
  duration: number;
22
+ position: "left" | "center" | "right";
24
23
  }, {}>;
25
24
  export default _default;
26
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
27
- type __VLS_TypePropsToRuntimeProps<T> = {
28
- [K in keyof T]-?: {} extends Pick<T, K> ? {
29
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
30
- } : {
31
- type: import('vue').PropType<T[K]>;
32
- required: true;
33
- };
34
- };
35
25
  type __VLS_WithDefaults<P, D> = {
36
26
  [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
37
27
  default: D[K];
@@ -40,3 +30,12 @@ type __VLS_WithDefaults<P, D> = {
40
30
  type __VLS_Prettify<T> = {
41
31
  [K in keyof T]: T[K];
42
32
  } & {};
33
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
34
+ type __VLS_TypePropsToOption<T> = {
35
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
36
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
37
+ } : {
38
+ type: import('vue').PropType<T[K]>;
39
+ required: true;
40
+ };
41
+ };
@@ -0,0 +1,43 @@
1
+ export interface Ui3nProgressCircularProps {
2
+ value?: number | string;
3
+ size?: number | string;
4
+ width?: number | string;
5
+ withText?: boolean;
6
+ bgColor?: string;
7
+ color?: string;
8
+ indeterminate?: boolean;
9
+ }
10
+ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Ui3nProgressCircularProps>, {
11
+ value: number;
12
+ size: number;
13
+ bgColor: string;
14
+ color: string;
15
+ }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Ui3nProgressCircularProps>, {
16
+ value: number;
17
+ size: number;
18
+ bgColor: string;
19
+ color: string;
20
+ }>>>, {
21
+ color: string;
22
+ size: number | string;
23
+ value: number | string;
24
+ bgColor: string;
25
+ }, {}>;
26
+ export default _default;
27
+ type __VLS_WithDefaults<P, D> = {
28
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
29
+ default: D[K];
30
+ }> : P[K];
31
+ };
32
+ type __VLS_Prettify<T> = {
33
+ [K in keyof T]: T[K];
34
+ } & {};
35
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
36
+ type __VLS_TypePropsToOption<T> = {
37
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
38
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
39
+ } : {
40
+ type: import('vue').PropType<T[K]>;
41
+ required: true;
42
+ };
43
+ };
@@ -0,0 +1,42 @@
1
+ export interface Ui3nProgressLinearProps {
2
+ value?: number | string;
3
+ height?: number | string;
4
+ withText?: boolean;
5
+ bgColor?: string;
6
+ color?: string;
7
+ indeterminate?: boolean;
8
+ }
9
+ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Ui3nProgressLinearProps>, {
10
+ value: number;
11
+ height: number;
12
+ bgColor: string;
13
+ color: string;
14
+ }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Ui3nProgressLinearProps>, {
15
+ value: number;
16
+ height: number;
17
+ bgColor: string;
18
+ color: string;
19
+ }>>>, {
20
+ height: number | string;
21
+ color: string;
22
+ value: number | string;
23
+ bgColor: string;
24
+ }, {}>;
25
+ export default _default;
26
+ type __VLS_WithDefaults<P, D> = {
27
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
28
+ default: D[K];
29
+ }> : P[K];
30
+ };
31
+ type __VLS_Prettify<T> = {
32
+ [K in keyof T]: T[K];
33
+ } & {};
34
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
35
+ type __VLS_TypePropsToOption<T> = {
36
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
37
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
38
+ } : {
39
+ type: import('vue').PropType<T[K]>;
40
+ required: true;
41
+ };
42
+ };
@@ -0,0 +1,30 @@
1
+ export interface Ui3nStepLineBarProps {
2
+ label: string;
3
+ current: number;
4
+ steps: number;
5
+ }
6
+ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Ui3nStepLineBarProps>, {
7
+ current: number;
8
+ }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Ui3nStepLineBarProps>, {
9
+ current: number;
10
+ }>>>, {
11
+ current: number;
12
+ }, {}>;
13
+ export default _default;
14
+ type __VLS_WithDefaults<P, D> = {
15
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
16
+ default: D[K];
17
+ }> : P[K];
18
+ };
19
+ type __VLS_Prettify<T> = {
20
+ [K in keyof T]: T[K];
21
+ } & {};
22
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
23
+ type __VLS_TypePropsToOption<T> = {
24
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
25
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
26
+ } : {
27
+ type: import('vue').PropType<T[K]>;
28
+ required: true;
29
+ };
30
+ };
@@ -11,14 +11,15 @@ export interface Ui3nSwitchEmits {
11
11
  export interface Ui3nSwitchSlots {
12
12
  default: () => any;
13
13
  }
14
- declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Ui3nSwitchProps>, {
14
+ declare function __VLS_template(): Readonly<Ui3nSwitchSlots> & Ui3nSwitchSlots;
15
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Ui3nSwitchProps>, {
15
16
  size: number;
16
17
  color: string;
17
18
  disabled: boolean;
18
19
  }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
19
20
  change: (value: boolean) => void;
20
21
  "update:modelValue": (value: boolean) => void;
21
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Ui3nSwitchProps>, {
22
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Ui3nSwitchProps>, {
22
23
  size: number;
23
24
  color: string;
24
25
  disabled: boolean;
@@ -27,19 +28,11 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
27
28
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
28
29
  }, {
29
30
  color: string;
31
+ size: number | string;
30
32
  disabled: boolean;
31
- size: string | number;
32
- }, {}>, Readonly<Ui3nSwitchSlots> & Ui3nSwitchSlots>;
33
+ }, {}>;
34
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
33
35
  export default _default;
34
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
35
- type __VLS_TypePropsToRuntimeProps<T> = {
36
- [K in keyof T]-?: {} extends Pick<T, K> ? {
37
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
38
- } : {
39
- type: import('vue').PropType<T[K]>;
40
- required: true;
41
- };
42
- };
43
36
  type __VLS_WithDefaults<P, D> = {
44
37
  [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
45
38
  default: D[K];
@@ -53,3 +46,12 @@ type __VLS_WithTemplateSlots<T, S> = T & {
53
46
  $slots: S;
54
47
  };
55
48
  };
49
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
50
+ type __VLS_TypePropsToOption<T> = {
51
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
52
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
53
+ } : {
54
+ type: import('vue').PropType<T[K]>;
55
+ required: true;
56
+ };
57
+ };
@@ -0,0 +1,26 @@
1
+ import { Ref, UnwrapRef } from 'vue';
2
+ import { Ui3nTableBodyBaseItem, Ui3nTableEmits, Ui3nTableProps } from '../types';
3
+ import { Ui3nCheckboxValue } from '../../ui3n-checkbox.vue';
4
+ export declare function useTable<T extends Ui3nTableBodyBaseItem>(props: Ui3nTableProps<T>, emits: Ui3nTableEmits<T>): {
5
+ tableEl: Ref<HTMLDivElement | null>;
6
+ currentConfig: Ref<{
7
+ sortOrder?: {
8
+ field: UnwrapRef<keyof T>;
9
+ direction: "asc" | "desc";
10
+ } | undefined;
11
+ fieldAsRowKey?: UnwrapRef<keyof T> | undefined;
12
+ }>;
13
+ visibleColumns: import('vue').ComputedRef<import('../types').Ui3nTableHeadProps<T>[]>;
14
+ hasGroupActionsRow: Ref<boolean>;
15
+ showGroupActionsRow: import('vue').ComputedRef<boolean>;
16
+ selectedRows: Ref<Set<T> | T[keyof T][]>;
17
+ selectedRowsArray: import('vue').ComputedRef<T[]>;
18
+ selectedRowsSize: import('vue').ComputedRef<number>;
19
+ closeGroupActionsRow: () => void;
20
+ getRowKey: (row: T, index: number) => string | number;
21
+ isRowSelected: (row: T) => boolean;
22
+ getRowStyle: (row: T) => Record<string, string>;
23
+ processSelection: (row: T, withoutEvents?: boolean) => void;
24
+ toggleSelectedRows: (val: Ui3nCheckboxValue) => void;
25
+ changeSortOrder: (field: keyof T) => void;
26
+ };
@@ -0,0 +1,65 @@
1
+ import { VNode } from 'vue';
2
+ export interface Ui3nTableBodyBaseItem {
3
+ id?: string | number | symbol;
4
+ }
5
+ export type Ui3nTableSort<T extends Ui3nTableBodyBaseItem> = {
6
+ field: keyof T;
7
+ direction: 'asc' | 'desc';
8
+ };
9
+ export type Ui3nTableConfig<T extends Ui3nTableBodyBaseItem, K extends keyof T = keyof T> = {
10
+ tableName?: string;
11
+ sortOrder?: Ui3nTableSort<T>;
12
+ selectable?: 'single' | 'multiple';
13
+ columnStyle?: {
14
+ [P in Omit<K, 'id'> as string | number]: Record<string, string>;
15
+ };
16
+ fieldAsRowKey?: keyof T;
17
+ };
18
+ export type Ui3nTableHeadProps<T extends Ui3nTableBodyBaseItem> = {
19
+ key: keyof T;
20
+ text: string;
21
+ sortable?: boolean;
22
+ headCellStyle?: Record<string, string>;
23
+ format?: (content: unknown) => string;
24
+ hidden?: boolean;
25
+ index?: number;
26
+ };
27
+ export type Ui3nTableBodyProps<T extends Ui3nTableBodyBaseItem, K extends keyof T = keyof T> = {
28
+ content: T[];
29
+ rowsStyle?: {
30
+ [P in T[K] as string | number]: Record<string, string>;
31
+ };
32
+ };
33
+ export interface Ui3nTableProps<T extends Ui3nTableBodyBaseItem> {
34
+ config: Ui3nTableConfig<T>;
35
+ head: Ui3nTableHeadProps<T>[];
36
+ body: Ui3nTableBodyProps<T>;
37
+ }
38
+ export interface Ui3nTableEmits<T extends Ui3nTableBodyBaseItem> {
39
+ (ev: 'change:sort', val: Ui3nTableSort<T>): void;
40
+ (ev: 'select:row', val: T[]): void;
41
+ }
42
+ export type Ui3nTableGroupActionsSlot = {
43
+ 'group-actions': () => VNode;
44
+ };
45
+ export type Ui3nTableHeaderCellSlot<T extends Ui3nTableBodyBaseItem, K extends string & keyof T> = {
46
+ [p in `header-cell-${K}`]: () => VNode;
47
+ };
48
+ export type Ui3nTableBodyRowSlotScope<T extends Ui3nTableBodyBaseItem> = {
49
+ row: T;
50
+ rowStyle?: Record<string, string>;
51
+ rowIndex: number;
52
+ events?: Record<string, (value: unknown) => unknown>;
53
+ };
54
+ export type Ui3nTableBodyRowSlot<T extends Ui3nTableBodyBaseItem> = {
55
+ 'body-row': (scope: Ui3nTableBodyRowSlotScope<T>) => VNode;
56
+ };
57
+ export type Ui3nTableBodyRowCellSlotScope<T extends Ui3nTableBodyBaseItem, K extends string & keyof T> = {
58
+ row: T;
59
+ rowIndex: number;
60
+ cell: T[K];
61
+ };
62
+ export type Ui3nTableBodyRowCellSlot<T extends Ui3nTableBodyBaseItem, K extends string & keyof T> = {
63
+ [p in `body-row-cell-${K}`]: (scope: Ui3nTableBodyRowCellSlotScope<T, K>) => VNode;
64
+ };
65
+ export type Ui3nTableSlots<T extends Ui3nTableBodyBaseItem, K extends string & keyof T> = Ui3nTableGroupActionsSlot & Ui3nTableHeaderCellSlot<T, K> & Ui3nTableBodyRowSlot<T> & Ui3nTableBodyRowCellSlot<T, K>;
@@ -0,0 +1,22 @@
1
+ import { Ui3nTableBodyBaseItem, Ui3nTableEmits, Ui3nTableProps } from './types';
2
+ declare const _default: <T extends Ui3nTableBodyBaseItem>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_Prettify<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
+ props: __VLS_Prettify<Pick<Partial<{}> & Omit<{
4
+ "onChange:sort"?: ((val: import('./types').Ui3nTableSort<T>) => any) | undefined;
5
+ "onSelect:row"?: ((val: T[]) => any) | undefined;
6
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{}>> & {
7
+ "onChange:sort"?: ((val: import('./types').Ui3nTableSort<T>) => any) | undefined;
8
+ "onSelect:row"?: ((val: T[]) => any) | undefined;
9
+ }, never>, "onChange:sort" | "onSelect:row"> & Ui3nTableProps<T>> & import('vue').PublicProps;
10
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
11
+ attrs: any;
12
+ slots: ReturnType<() => Readonly<import('./types').Ui3nTableGroupActionsSlot & import('./types').Ui3nTableHeaderCellSlot<T, string & keyof T> & import('./types').Ui3nTableBodyRowSlot<T> & import('./types').Ui3nTableBodyRowCellSlot<T, string & keyof T>> & import('./types').Ui3nTableGroupActionsSlot & import('./types').Ui3nTableHeaderCellSlot<T, string & keyof T> & import('./types').Ui3nTableBodyRowSlot<T> & import('./types').Ui3nTableBodyRowCellSlot<T, string & keyof T>>;
13
+ emit: Ui3nTableEmits<T> & {};
14
+ }>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
15
+ [key: string]: any;
16
+ }> & {
17
+ __ctx?: Awaited<typeof __VLS_setup>;
18
+ };
19
+ export default _default;
20
+ type __VLS_Prettify<T> = {
21
+ [K in keyof T]: T[K];
22
+ } & {};
@@ -3,10 +3,10 @@ export interface Ui3nTableSortIconProps {
3
3
  color?: string;
4
4
  value: 'asc' | 'desc';
5
5
  }
6
- declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<Ui3nTableSortIconProps>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Ui3nTableSortIconProps>>>, {}, {}>;
6
+ declare const _default: import('vue').DefineComponent<__VLS_TypePropsToOption<Ui3nTableSortIconProps>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<Ui3nTableSortIconProps>>>, {}, {}>;
7
7
  export default _default;
8
8
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
9
- type __VLS_TypePropsToRuntimeProps<T> = {
9
+ type __VLS_TypePropsToOption<T> = {
10
10
  [K in keyof T]-?: {} extends Pick<T, K> ? {
11
11
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
12
12
  } : {
@@ -13,7 +13,10 @@ export interface Ui3nTabsEmits {
13
13
  export interface Ui3nTabsSlots {
14
14
  default: () => any;
15
15
  }
16
- declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Ui3nTabsProps>, {
16
+ declare function __VLS_template(): {
17
+ default?(_: {}): any;
18
+ };
19
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Ui3nTabsProps>, {
17
20
  modelValue: number;
18
21
  itemDirection: string;
19
22
  activeColor: string;
@@ -23,7 +26,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
23
26
  indicatorPosition: string;
24
27
  }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
25
28
  "update:modelValue": (val: number) => void;
26
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Ui3nTabsProps>, {
29
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Ui3nTabsProps>, {
27
30
  modelValue: number;
28
31
  itemDirection: string;
29
32
  activeColor: string;
@@ -39,21 +42,11 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
39
42
  activeColor: string;
40
43
  inactiveColor: string;
41
44
  indicatorColor: string;
42
- indicatorSize: string | number;
43
- indicatorPosition: "reverse" | "normal";
44
- }, {}>, {
45
- default?(_: {}): any;
46
- }>;
45
+ indicatorSize: number | string;
46
+ indicatorPosition: "normal" | "reverse";
47
+ }, {}>;
48
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
47
49
  export default _default;
48
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
49
- type __VLS_TypePropsToRuntimeProps<T> = {
50
- [K in keyof T]-?: {} extends Pick<T, K> ? {
51
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
52
- } : {
53
- type: import('vue').PropType<T[K]>;
54
- required: true;
55
- };
56
- };
57
50
  type __VLS_WithDefaults<P, D> = {
58
51
  [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
59
52
  default: D[K];
@@ -67,3 +60,12 @@ type __VLS_WithTemplateSlots<T, S> = T & {
67
60
  $slots: S;
68
61
  };
69
62
  };
63
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
64
+ type __VLS_TypePropsToOption<T> = {
65
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
66
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
67
+ } : {
68
+ type: import('vue').PropType<T[K]>;
69
+ required: true;
70
+ };
71
+ };
@@ -15,7 +15,7 @@ export interface Ui3nTextEmits {
15
15
  (ev: 'update:text', value: string): void;
16
16
  (ev: 'update:valid', value: boolean): void;
17
17
  }
18
- declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Ui3nTextProps>, {
18
+ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Ui3nTextProps>, {
19
19
  rows: number;
20
20
  maxRows: number;
21
21
  label: string;
@@ -28,36 +28,27 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
28
28
  blur: (value: Event) => void;
29
29
  "update:text": (value: string) => void;
30
30
  "update:valid": (value: boolean) => void;
31
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Ui3nTextProps>, {
31
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Ui3nTextProps>, {
32
32
  rows: number;
33
33
  maxRows: number;
34
34
  label: string;
35
35
  placeholder: string;
36
36
  disabled: boolean;
37
37
  }>>> & {
38
+ onInit?: ((value: HTMLTextAreaElement) => any) | undefined;
38
39
  onFocus?: ((value: Event) => any) | undefined;
39
40
  onBlur?: ((value: Event) => any) | undefined;
40
41
  onInput?: ((value: string) => any) | undefined;
41
- onInit?: ((value: HTMLTextAreaElement) => any) | undefined;
42
42
  "onUpdate:valid"?: ((value: boolean) => any) | undefined;
43
43
  "onUpdate:text"?: ((value: string) => any) | undefined;
44
44
  }, {
45
- label: string;
46
45
  disabled: boolean;
46
+ label: string;
47
47
  placeholder: string;
48
48
  rows: number;
49
49
  maxRows: number;
50
50
  }, {}>;
51
51
  export default _default;
52
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
53
- type __VLS_TypePropsToRuntimeProps<T> = {
54
- [K in keyof T]-?: {} extends Pick<T, K> ? {
55
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
56
- } : {
57
- type: import('vue').PropType<T[K]>;
58
- required: true;
59
- };
60
- };
61
52
  type __VLS_WithDefaults<P, D> = {
62
53
  [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
63
54
  default: D[K];
@@ -66,3 +57,12 @@ type __VLS_WithDefaults<P, D> = {
66
57
  type __VLS_Prettify<T> = {
67
58
  [K in keyof T]: T[K];
68
59
  } & {};
60
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
61
+ type __VLS_TypePropsToOption<T> = {
62
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
63
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
64
+ } : {
65
+ type: import('vue').PropType<T[K]>;
66
+ required: true;
67
+ };
68
+ };