@caido-utils/components 0.1.0

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 (42) hide show
  1. package/dist/ButtonGroup/Container.d.vue.ts +34 -0
  2. package/dist/ButtonGroup/Container.vue +36 -0
  3. package/dist/ButtonGroup/Container.vue.d.ts +34 -0
  4. package/dist/Card/Container.d.vue.ts +12 -0
  5. package/dist/Card/Container.vue +21 -0
  6. package/dist/Card/Container.vue.d.ts +12 -0
  7. package/dist/ContextMenu/Container.d.vue.ts +9 -0
  8. package/dist/ContextMenu/Container.vue +38 -0
  9. package/dist/ContextMenu/Container.vue.d.ts +9 -0
  10. package/dist/DataTable/Container.d.vue.ts +68 -0
  11. package/dist/DataTable/Container.vue +295 -0
  12. package/dist/DataTable/Container.vue.d.ts +68 -0
  13. package/dist/Dialog/Container.d.vue.ts +64 -0
  14. package/dist/Dialog/Container.vue +89 -0
  15. package/dist/Dialog/Container.vue.d.ts +64 -0
  16. package/dist/HttpqlInput/Container.d.vue.ts +33 -0
  17. package/dist/HttpqlInput/Container.vue +225 -0
  18. package/dist/HttpqlInput/Container.vue.d.ts +33 -0
  19. package/dist/HttpqlInput/suggestions.d.ts +24 -0
  20. package/dist/HttpqlInput/suggestions.js +325 -0
  21. package/dist/Menu/Container.d.vue.ts +11 -0
  22. package/dist/Menu/Container.vue +40 -0
  23. package/dist/Menu/Container.vue.d.ts +11 -0
  24. package/dist/MenuButton/Container.d.vue.ts +43 -0
  25. package/dist/MenuButton/Container.vue +42 -0
  26. package/dist/MenuButton/Container.vue.d.ts +43 -0
  27. package/dist/MultiSelect/Container.d.vue.ts +54 -0
  28. package/dist/MultiSelect/Container.vue +57 -0
  29. package/dist/MultiSelect/Container.vue.d.ts +54 -0
  30. package/dist/RequestEditor/Container.d.vue.ts +30 -0
  31. package/dist/RequestEditor/Container.vue +67 -0
  32. package/dist/RequestEditor/Container.vue.d.ts +30 -0
  33. package/dist/ResponseEditor/Container.d.vue.ts +30 -0
  34. package/dist/ResponseEditor/Container.vue +67 -0
  35. package/dist/ResponseEditor/Container.vue.d.ts +30 -0
  36. package/dist/Table/Container.d.vue.ts +36 -0
  37. package/dist/Table/Container.vue +512 -0
  38. package/dist/Table/Container.vue.d.ts +36 -0
  39. package/dist/env.d.ts +5 -0
  40. package/dist/index.d.ts +12 -0
  41. package/dist/index.js +12 -0
  42. package/package.json +32 -0
@@ -0,0 +1,30 @@
1
+ type __VLS_Props = {
2
+ sdk: any;
3
+ content: string | undefined;
4
+ emptyMessage?: string;
5
+ };
6
+ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
7
+ emptyMessage: string;
8
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
9
+ emptyMessage: string;
10
+ }>>>, {
11
+ emptyMessage: string;
12
+ }, {}>;
13
+ export default _default;
14
+ type __VLS_WithDefaults<P, D> = {
15
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
16
+ default: D[K];
17
+ }> : P[K];
18
+ };
19
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
20
+ type __VLS_TypePropsToOption<T> = {
21
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
22
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
23
+ } : {
24
+ type: import('vue').PropType<T[K]>;
25
+ required: true;
26
+ };
27
+ };
28
+ type __VLS_PrettifyLocal<T> = {
29
+ [K in keyof T]: T[K];
30
+ } & {};
@@ -0,0 +1,67 @@
1
+ <script setup lang="ts">
2
+ import { nextTick, ref, watch } from "vue";
3
+
4
+ import Card from "../Card/Container.vue";
5
+
6
+ const props = withDefaults(
7
+ defineProps<{
8
+ sdk: any;
9
+ content: string | undefined;
10
+ emptyMessage?: string;
11
+ }>(),
12
+ {
13
+ emptyMessage: "No request available",
14
+ },
15
+ );
16
+
17
+ const container = ref<HTMLDivElement>();
18
+ let editor: HTTPRequestEditor | undefined;
19
+
20
+ function initEditor() {
21
+ if (container.value === undefined) return;
22
+ if (editor !== undefined) return;
23
+
24
+ editor = props.sdk.ui.httpRequestEditor();
25
+ const el = editor.getElement();
26
+ el.style.height = "100%";
27
+ el.style.width = "100%";
28
+ container.value.appendChild(el);
29
+ }
30
+
31
+ function updateEditor(content: string) {
32
+ if (editor === undefined) return;
33
+ const view = editor.getEditorView();
34
+ if (view === undefined) return;
35
+ view.dispatch({
36
+ changes: { from: 0, to: view.state.doc.length, insert: content },
37
+ });
38
+ }
39
+
40
+ watch(
41
+ () => props.content,
42
+ async (content) => {
43
+ if (content === undefined) return;
44
+ await nextTick();
45
+ initEditor();
46
+ updateEditor(content);
47
+ },
48
+ );
49
+ </script>
50
+
51
+ <template>
52
+ <Card class="h-full">
53
+ <template #content>
54
+ <div
55
+ v-show="content === undefined"
56
+ class="h-full flex items-center justify-center text-surface-500 text-xs"
57
+ >
58
+ {{ emptyMessage }}
59
+ </div>
60
+ <div
61
+ v-show="content !== undefined"
62
+ ref="container"
63
+ class="h-full w-full overflow-hidden"
64
+ />
65
+ </template>
66
+ </Card>
67
+ </template>
@@ -0,0 +1,30 @@
1
+ type __VLS_Props = {
2
+ sdk: any;
3
+ content: string | undefined;
4
+ emptyMessage?: string;
5
+ };
6
+ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
7
+ emptyMessage: string;
8
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
9
+ emptyMessage: string;
10
+ }>>>, {
11
+ emptyMessage: string;
12
+ }, {}>;
13
+ export default _default;
14
+ type __VLS_WithDefaults<P, D> = {
15
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
16
+ default: D[K];
17
+ }> : P[K];
18
+ };
19
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
20
+ type __VLS_TypePropsToOption<T> = {
21
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
22
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
23
+ } : {
24
+ type: import('vue').PropType<T[K]>;
25
+ required: true;
26
+ };
27
+ };
28
+ type __VLS_PrettifyLocal<T> = {
29
+ [K in keyof T]: T[K];
30
+ } & {};
@@ -0,0 +1,30 @@
1
+ type __VLS_Props = {
2
+ sdk: any;
3
+ content: string | undefined;
4
+ emptyMessage?: string;
5
+ };
6
+ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
7
+ emptyMessage: string;
8
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
9
+ emptyMessage: string;
10
+ }>>>, {
11
+ emptyMessage: string;
12
+ }, {}>;
13
+ export default _default;
14
+ type __VLS_WithDefaults<P, D> = {
15
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
16
+ default: D[K];
17
+ }> : P[K];
18
+ };
19
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
20
+ type __VLS_TypePropsToOption<T> = {
21
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
22
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
23
+ } : {
24
+ type: import('vue').PropType<T[K]>;
25
+ required: true;
26
+ };
27
+ };
28
+ type __VLS_PrettifyLocal<T> = {
29
+ [K in keyof T]: T[K];
30
+ } & {};
@@ -0,0 +1,67 @@
1
+ <script setup lang="ts">
2
+ import { nextTick, ref, watch } from "vue";
3
+
4
+ import Card from "../Card/Container.vue";
5
+
6
+ const props = withDefaults(
7
+ defineProps<{
8
+ sdk: any;
9
+ content: string | undefined;
10
+ emptyMessage?: string;
11
+ }>(),
12
+ {
13
+ emptyMessage: "No response available",
14
+ },
15
+ );
16
+
17
+ const container = ref<HTMLDivElement>();
18
+ let editor: HTTPResponseEditor | undefined;
19
+
20
+ function initEditor() {
21
+ if (container.value === undefined) return;
22
+ if (editor !== undefined) return;
23
+
24
+ editor = props.sdk.ui.httpResponseEditor();
25
+ const el = editor.getElement();
26
+ el.style.height = "100%";
27
+ el.style.width = "100%";
28
+ container.value.appendChild(el);
29
+ }
30
+
31
+ function updateEditor(content: string) {
32
+ if (editor === undefined) return;
33
+ const view = editor.getEditorView();
34
+ if (view === undefined) return;
35
+ view.dispatch({
36
+ changes: { from: 0, to: view.state.doc.length, insert: content },
37
+ });
38
+ }
39
+
40
+ watch(
41
+ () => props.content,
42
+ async (content) => {
43
+ if (content === undefined) return;
44
+ await nextTick();
45
+ initEditor();
46
+ updateEditor(content);
47
+ },
48
+ );
49
+ </script>
50
+
51
+ <template>
52
+ <Card class="h-full">
53
+ <template #content>
54
+ <div
55
+ v-show="content === undefined"
56
+ class="h-full flex items-center justify-center text-surface-500 text-xs"
57
+ >
58
+ {{ emptyMessage }}
59
+ </div>
60
+ <div
61
+ v-show="content !== undefined"
62
+ ref="container"
63
+ class="h-full w-full overflow-hidden"
64
+ />
65
+ </template>
66
+ </Card>
67
+ </template>
@@ -0,0 +1,30 @@
1
+ type __VLS_Props = {
2
+ sdk: any;
3
+ content: string | undefined;
4
+ emptyMessage?: string;
5
+ };
6
+ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
7
+ emptyMessage: string;
8
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
9
+ emptyMessage: string;
10
+ }>>>, {
11
+ emptyMessage: string;
12
+ }, {}>;
13
+ export default _default;
14
+ type __VLS_WithDefaults<P, D> = {
15
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
16
+ default: D[K];
17
+ }> : P[K];
18
+ };
19
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
20
+ type __VLS_TypePropsToOption<T> = {
21
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
22
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
23
+ } : {
24
+ type: import('vue').PropType<T[K]>;
25
+ required: true;
26
+ };
27
+ };
28
+ type __VLS_PrettifyLocal<T> = {
29
+ [K in keyof T]: T[K];
30
+ } & {};
@@ -0,0 +1,36 @@
1
+ import type { MenuItem } from "primevue/menuitem";
2
+ declare const _default: <T extends Record<string, unknown>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{}>>, never>, never> & {
4
+ items: T[];
5
+ selected: T[];
6
+ columns: {
7
+ key: string;
8
+ header: string;
9
+ width: string;
10
+ sortable?: boolean;
11
+ sortType?: "string" | "number" | "date";
12
+ }[];
13
+ rowKey: (item: T) => string;
14
+ activeKey?: string;
15
+ emptyMessage?: string;
16
+ selectable?: boolean;
17
+ scrollKey?: string;
18
+ contextMenu?: MenuItem[];
19
+ resizable?: boolean;
20
+ } & Partial<{}>> & import("vue").PublicProps;
21
+ expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
22
+ attrs: any;
23
+ slots: {
24
+ [x: string]: ((props: {
25
+ item: any;
26
+ value: any;
27
+ }) => any) | undefined;
28
+ };
29
+ emit: ((evt: "row-click", item: T) => void) & ((evt: "row-contextmenu", item: T, event: MouseEvent) => void) & ((evt: "update:selected", value: T[]) => void);
30
+ }>) => import("vue").VNode & {
31
+ __ctx?: Awaited<typeof __VLS_setup>;
32
+ };
33
+ export default _default;
34
+ type __VLS_PrettifyLocal<T> = {
35
+ [K in keyof T]: T[K];
36
+ } & {};