@smurfox/proxy-ui 0.4.2 → 0.4.3
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
|
@@ -758,7 +758,7 @@ A responsive data table that renders as a normal `<table>` on `md+` viewports an
|
|
|
758
758
|
|
|
759
759
|
| Prop | Type | Default | Description |
|
|
760
760
|
| ---------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|
|
761
|
-
| `items` | `
|
|
761
|
+
| `items` | `TItem[]` where `TItem extends { id: string \| number }` | `[]` | Row data. `PUTable` is generic in `TItem`, so passing `SaleOrder[]`, `User[]`, etc. is type-safe — `row-click` and the `cell-{id}` slot scope infer your interface. |
|
|
762
762
|
| `columns` | `{ name: string, id: string, width?: string }[]` | `[]` | Column definitions. `id` is the row key to read, `width` is CSS width. |
|
|
763
763
|
| `rounded` | `'none' \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| '2xl' \| '3xl' \| 'full'` | `'lg'` | Border radius of the outer container. |
|
|
764
764
|
| `isBordered` | `boolean` | `false` | Adds an outer border around the table. |
|
|
@@ -778,7 +778,7 @@ A responsive data table that renders as a normal `<table>` on `md+` viewports an
|
|
|
778
778
|
|
|
779
779
|
| Event | Payload | Description |
|
|
780
780
|
| ----------- | -------------------------------------------------------- | ------------------------------------------------------------------------ |
|
|
781
|
-
| `row-click` | `item:
|
|
781
|
+
| `row-click` | `item: TItem` | Emitted when a row is clicked (only when `isSelectable` is `true`). `TItem` is inferred from `items`. |
|
|
782
782
|
|
|
783
783
|
**Slots**
|
|
784
784
|
|
package/dist/module.json
CHANGED
|
@@ -1,112 +1,61 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
id: string | number;
|
|
1
|
+
declare const __VLS_export: <TItem extends {
|
|
2
|
+
id: string | number;
|
|
3
|
+
}>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
5
|
+
items?: TItem[];
|
|
6
|
+
columns?: {
|
|
7
|
+
name: string;
|
|
8
|
+
id: string;
|
|
9
|
+
width?: string;
|
|
10
|
+
}[];
|
|
11
|
+
rounded?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full";
|
|
12
|
+
isBordered?: boolean;
|
|
13
|
+
isSelectable?: boolean;
|
|
14
|
+
headerColor?: string;
|
|
15
|
+
isBodyColored?: boolean;
|
|
16
|
+
bodyColor?: string;
|
|
17
|
+
itemsSize?: "sm" | "md" | "lg";
|
|
18
|
+
hasShadow?: boolean;
|
|
19
|
+
emptyStateTitle?: string;
|
|
20
|
+
emptyStateDescription?: string;
|
|
21
|
+
showEmptyAnimation?: boolean;
|
|
22
|
+
emptyAnimationData?: object;
|
|
23
|
+
emptyAnimationSize?: number;
|
|
24
|
+
} & {
|
|
25
|
+
"onRow-click"?: ((item: TItem) => any) | undefined;
|
|
26
|
+
}> & (typeof globalThis extends {
|
|
27
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
28
|
+
} ? P : {});
|
|
29
|
+
expose: (exposed: {}) => void;
|
|
30
|
+
attrs: any;
|
|
31
|
+
slots: {
|
|
32
|
+
[x: `cell-${string}`]: ((props: {
|
|
33
|
+
item: TItem;
|
|
34
|
+
value: unknown;
|
|
35
|
+
}) => any) | undefined;
|
|
36
|
+
} & {
|
|
37
|
+
[x: `cell-${string}`]: ((props: {
|
|
38
|
+
item: TItem;
|
|
39
|
+
value: unknown;
|
|
40
|
+
}) => any) | undefined;
|
|
41
|
+
} & {
|
|
42
|
+
'mobile-card'?: (props: {
|
|
43
|
+
item: TItem;
|
|
44
|
+
columns: {
|
|
45
|
+
name: string;
|
|
46
|
+
id: string;
|
|
47
|
+
width?: string;
|
|
48
|
+
}[];
|
|
49
|
+
}) => any;
|
|
51
50
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
width?: string;
|
|
56
|
-
}[];
|
|
57
|
-
}, __VLS_29: `cell-${string}`, __VLS_30: {
|
|
58
|
-
item: {
|
|
59
|
-
[key: string]: unknown;
|
|
60
|
-
id: string | number;
|
|
61
|
-
};
|
|
62
|
-
value: unknown;
|
|
63
|
-
};
|
|
64
|
-
type __VLS_Slots = {} & {
|
|
65
|
-
[K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any;
|
|
66
|
-
} & {
|
|
67
|
-
[K in NonNullable<typeof __VLS_29>]?: (props: typeof __VLS_30) => any;
|
|
68
|
-
} & {
|
|
69
|
-
'mobile-card'?: (props: typeof __VLS_26) => any;
|
|
51
|
+
emit: (evt: "row-click", item: TItem) => void;
|
|
52
|
+
}>) => import("vue").VNode & {
|
|
53
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
70
54
|
};
|
|
71
|
-
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
72
|
-
"row-click": (item: {
|
|
73
|
-
[key: string]: unknown;
|
|
74
|
-
id: string | number;
|
|
75
|
-
}) => any;
|
|
76
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
77
|
-
"onRow-click"?: ((item: {
|
|
78
|
-
[key: string]: unknown;
|
|
79
|
-
id: string | number;
|
|
80
|
-
}) => any) | undefined;
|
|
81
|
-
}>, {
|
|
82
|
-
rounded: keyof typeof roundedClasses;
|
|
83
|
-
columns: {
|
|
84
|
-
name: string;
|
|
85
|
-
id: string;
|
|
86
|
-
width?: string;
|
|
87
|
-
}[];
|
|
88
|
-
isBordered: boolean;
|
|
89
|
-
hasShadow: boolean;
|
|
90
|
-
items: Array<{
|
|
91
|
-
id: string | number;
|
|
92
|
-
[key: string]: unknown;
|
|
93
|
-
}>;
|
|
94
|
-
isSelectable: boolean;
|
|
95
|
-
headerColor: string;
|
|
96
|
-
isBodyColored: boolean;
|
|
97
|
-
bodyColor: string;
|
|
98
|
-
itemsSize: keyof typeof sizes;
|
|
99
|
-
emptyStateTitle: string;
|
|
100
|
-
emptyStateDescription: string;
|
|
101
|
-
showEmptyAnimation: boolean;
|
|
102
|
-
emptyAnimationData: object;
|
|
103
|
-
emptyAnimationSize: number;
|
|
104
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
105
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
106
55
|
declare const _default: typeof __VLS_export;
|
|
107
56
|
export default _default;
|
|
108
|
-
type
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
};
|
|
57
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
58
|
+
[K in keyof T]: T[K];
|
|
59
|
+
} : {
|
|
60
|
+
[K in keyof T as K]: T[K];
|
|
61
|
+
}) & {};
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
<slot
|
|
51
51
|
:name="`cell-${column.id}`"
|
|
52
52
|
:item="item"
|
|
53
|
-
:value="item
|
|
53
|
+
:value="getCellValue(item, column.id)"
|
|
54
54
|
>
|
|
55
|
-
{{ item
|
|
55
|
+
{{ getCellValue(item, column.id) }}
|
|
56
56
|
</slot>
|
|
57
57
|
</td>
|
|
58
58
|
</motion.tr>
|
|
@@ -122,9 +122,9 @@
|
|
|
122
122
|
<slot
|
|
123
123
|
:name="`cell-${column.id}`"
|
|
124
124
|
:item="item"
|
|
125
|
-
:value="item
|
|
125
|
+
:value="getCellValue(item, column.id)"
|
|
126
126
|
>
|
|
127
|
-
{{ item
|
|
127
|
+
{{ getCellValue(item, column.id) }}
|
|
128
128
|
</slot>
|
|
129
129
|
</div>
|
|
130
130
|
</div>
|
|
@@ -239,6 +239,9 @@ const props = defineProps({
|
|
|
239
239
|
emptyAnimationSize: { type: Number, required: false, default: 220 }
|
|
240
240
|
});
|
|
241
241
|
const emit = defineEmits(["row-click"]);
|
|
242
|
+
function getCellValue(item, key) {
|
|
243
|
+
return item[key];
|
|
244
|
+
}
|
|
242
245
|
</script>
|
|
243
246
|
|
|
244
247
|
<style scoped>
|
|
@@ -1,112 +1,61 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
id: string | number;
|
|
1
|
+
declare const __VLS_export: <TItem extends {
|
|
2
|
+
id: string | number;
|
|
3
|
+
}>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
5
|
+
items?: TItem[];
|
|
6
|
+
columns?: {
|
|
7
|
+
name: string;
|
|
8
|
+
id: string;
|
|
9
|
+
width?: string;
|
|
10
|
+
}[];
|
|
11
|
+
rounded?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full";
|
|
12
|
+
isBordered?: boolean;
|
|
13
|
+
isSelectable?: boolean;
|
|
14
|
+
headerColor?: string;
|
|
15
|
+
isBodyColored?: boolean;
|
|
16
|
+
bodyColor?: string;
|
|
17
|
+
itemsSize?: "sm" | "md" | "lg";
|
|
18
|
+
hasShadow?: boolean;
|
|
19
|
+
emptyStateTitle?: string;
|
|
20
|
+
emptyStateDescription?: string;
|
|
21
|
+
showEmptyAnimation?: boolean;
|
|
22
|
+
emptyAnimationData?: object;
|
|
23
|
+
emptyAnimationSize?: number;
|
|
24
|
+
} & {
|
|
25
|
+
"onRow-click"?: ((item: TItem) => any) | undefined;
|
|
26
|
+
}> & (typeof globalThis extends {
|
|
27
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
28
|
+
} ? P : {});
|
|
29
|
+
expose: (exposed: {}) => void;
|
|
30
|
+
attrs: any;
|
|
31
|
+
slots: {
|
|
32
|
+
[x: `cell-${string}`]: ((props: {
|
|
33
|
+
item: TItem;
|
|
34
|
+
value: unknown;
|
|
35
|
+
}) => any) | undefined;
|
|
36
|
+
} & {
|
|
37
|
+
[x: `cell-${string}`]: ((props: {
|
|
38
|
+
item: TItem;
|
|
39
|
+
value: unknown;
|
|
40
|
+
}) => any) | undefined;
|
|
41
|
+
} & {
|
|
42
|
+
'mobile-card'?: (props: {
|
|
43
|
+
item: TItem;
|
|
44
|
+
columns: {
|
|
45
|
+
name: string;
|
|
46
|
+
id: string;
|
|
47
|
+
width?: string;
|
|
48
|
+
}[];
|
|
49
|
+
}) => any;
|
|
51
50
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
width?: string;
|
|
56
|
-
}[];
|
|
57
|
-
}, __VLS_29: `cell-${string}`, __VLS_30: {
|
|
58
|
-
item: {
|
|
59
|
-
[key: string]: unknown;
|
|
60
|
-
id: string | number;
|
|
61
|
-
};
|
|
62
|
-
value: unknown;
|
|
63
|
-
};
|
|
64
|
-
type __VLS_Slots = {} & {
|
|
65
|
-
[K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any;
|
|
66
|
-
} & {
|
|
67
|
-
[K in NonNullable<typeof __VLS_29>]?: (props: typeof __VLS_30) => any;
|
|
68
|
-
} & {
|
|
69
|
-
'mobile-card'?: (props: typeof __VLS_26) => any;
|
|
51
|
+
emit: (evt: "row-click", item: TItem) => void;
|
|
52
|
+
}>) => import("vue").VNode & {
|
|
53
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
70
54
|
};
|
|
71
|
-
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
72
|
-
"row-click": (item: {
|
|
73
|
-
[key: string]: unknown;
|
|
74
|
-
id: string | number;
|
|
75
|
-
}) => any;
|
|
76
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
77
|
-
"onRow-click"?: ((item: {
|
|
78
|
-
[key: string]: unknown;
|
|
79
|
-
id: string | number;
|
|
80
|
-
}) => any) | undefined;
|
|
81
|
-
}>, {
|
|
82
|
-
rounded: keyof typeof roundedClasses;
|
|
83
|
-
columns: {
|
|
84
|
-
name: string;
|
|
85
|
-
id: string;
|
|
86
|
-
width?: string;
|
|
87
|
-
}[];
|
|
88
|
-
isBordered: boolean;
|
|
89
|
-
hasShadow: boolean;
|
|
90
|
-
items: Array<{
|
|
91
|
-
id: string | number;
|
|
92
|
-
[key: string]: unknown;
|
|
93
|
-
}>;
|
|
94
|
-
isSelectable: boolean;
|
|
95
|
-
headerColor: string;
|
|
96
|
-
isBodyColored: boolean;
|
|
97
|
-
bodyColor: string;
|
|
98
|
-
itemsSize: keyof typeof sizes;
|
|
99
|
-
emptyStateTitle: string;
|
|
100
|
-
emptyStateDescription: string;
|
|
101
|
-
showEmptyAnimation: boolean;
|
|
102
|
-
emptyAnimationData: object;
|
|
103
|
-
emptyAnimationSize: number;
|
|
104
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
105
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
106
55
|
declare const _default: typeof __VLS_export;
|
|
107
56
|
export default _default;
|
|
108
|
-
type
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
};
|
|
57
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
58
|
+
[K in keyof T]: T[K];
|
|
59
|
+
} : {
|
|
60
|
+
[K in keyof T as K]: T[K];
|
|
61
|
+
}) & {};
|