@open-xamu-co/ui-components-vue 4.0.0-next.2 → 4.0.0-next.21

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 (54) hide show
  1. package/CHANGELOG.md +327 -0
  2. package/dist/components/action/ButtonLink.vue.d.ts +7 -1
  3. package/dist/components/base/Box.vue.d.ts +3 -3
  4. package/dist/components/base/Wrapper.vue.d.ts +1 -1
  5. package/dist/components/box/Editor.stories.d.ts +6 -0
  6. package/dist/components/box/Editor.vue.d.ts +33 -0
  7. package/dist/components/collapse/Simple.vue.d.ts +10 -2
  8. package/dist/components/form/Input.stories.d.ts +1 -0
  9. package/dist/components/form/InputLoop.vue.d.ts +1 -1
  10. package/dist/components/form/InputNValues.vue.d.ts +1 -1
  11. package/dist/components/form/InputOptions.vue.d.ts +9 -0
  12. package/dist/components/form/Simple.vue.d.ts +2 -2
  13. package/dist/components/input/Code.stories.d.ts +6 -0
  14. package/dist/components/input/Code.vue.d.ts +42 -0
  15. package/dist/components/input/File.stories.d.ts +1 -0
  16. package/dist/components/input/File.vue.d.ts +3 -1
  17. package/dist/components/loader/ContentFetch.vue.d.ts +10 -4
  18. package/dist/components/modal/Simple.stories.d.ts +1 -0
  19. package/dist/components/modal/Simple.vue.d.ts +9 -2
  20. package/dist/components/pagination/Content.vue.d.ts +10 -4
  21. package/dist/components/pagination/ContentTable.vue.d.ts +24 -11
  22. package/dist/components/pagination/Simple.vue.d.ts +2 -2
  23. package/dist/components/table/Body.vue.d.ts +1 -1
  24. package/dist/components/table/HeadActions.vue.d.ts +1 -1
  25. package/dist/components/table/HeadContent.vue.d.ts +1 -1
  26. package/dist/components/table/Simple.stories.d.ts +4 -0
  27. package/dist/components/table/Simple.vue.d.ts +2 -2
  28. package/dist/components/value/Complex.vue.d.ts +10 -1
  29. package/dist/components/value/List.vue.d.ts +13 -2
  30. package/dist/components/value/Simple.vue.d.ts +1 -1
  31. package/dist/composables/async.d.ts +4 -1
  32. package/dist/composables/markdown.d.ts +8 -0
  33. package/dist/composables/theme.d.ts +3 -1
  34. package/dist/index-BkugQnzT.cjs +75 -0
  35. package/dist/index-DJHxJ3Bp.js +83445 -0
  36. package/dist/index.cjs +1 -1
  37. package/dist/index.d.ts +3 -0
  38. package/dist/index.js +39 -36
  39. package/dist/plugin.cjs +1 -1
  40. package/dist/plugin.js +118 -110
  41. package/dist/{theme-DWMJmaKP.js → theme-CDT3li7P.js} +1 -0
  42. package/dist/{theme-CChhGSbE.cjs → theme-DQ7tgo8n.cjs} +1 -1
  43. package/dist/theme.cjs +1 -1
  44. package/dist/theme.js +3 -2
  45. package/dist/types/plugin.d.ts +8 -0
  46. package/dist/types/props/base.d.ts +106 -0
  47. package/dist/types/props/index.d.ts +4 -0
  48. package/dist/types/props/modal.d.ts +67 -0
  49. package/dist/types/props/table.d.ts +253 -0
  50. package/dist/types/props/value.d.ts +37 -0
  51. package/package.json +20 -7
  52. package/dist/index-C46FseEI.js +0 -7098
  53. package/dist/index-w1g0Tp05.cjs +0 -4
  54. package/dist/types/props.d.ts +0 -408
@@ -5,11 +5,11 @@ export interface iPCProps<Ti, Ci extends string | number = string, Ri = never> e
5
5
  /**
6
6
  * Function used to fetch the page
7
7
  */
8
- page?: Ri extends iGetPage<Ti, Ci> ? iGetPage<Ti, Ci> : (params?: iPagination) => Promise<Ri | undefined>;
8
+ page?: Ri extends iGetPage<Ti, Ci> ? iGetPage<Ti, Ci> : (params?: iPagination, signal?: AbortSignal) => Promise<Ri | undefined>;
9
9
  /**
10
10
  * Function used to fetch the page and hydrate the content
11
11
  */
12
- hydratablePage?: (content: Ref<iPage<Ti, Ci> | null | undefined>, errors: Ref<unknown>) => Ri extends iGetPage<Ti, Ci> ? iGetPage<Ti, Ci> : (params?: iPagination) => Promise<Ri | undefined>;
12
+ hydratablePage?: (content: Ref<iPage<Ti, Ci> | null | undefined>, errors: Ref<unknown>) => Ri extends iGetPage<Ti, Ci> ? iGetPage<Ti, Ci> : (params?: iPagination, signal?: AbortSignal) => Promise<Ri | undefined>;
13
13
  /**
14
14
  * Path used as key for the cache
15
15
  */
@@ -58,6 +58,12 @@ export interface iPCProps<Ti, Ci extends string | number = string, Ri = never> e
58
58
  * Whether to fetch data on client side only
59
59
  */
60
60
  client?: boolean;
61
+ /**
62
+ * Whether to cache data
63
+ *
64
+ * @default true
65
+ */
66
+ cache?: boolean;
61
67
  /**
62
68
  * Additional class for the pagination
63
69
  *
@@ -66,10 +72,10 @@ export interface iPCProps<Ti, Ci extends string | number = string, Ri = never> e
66
72
  paginationClass?: string | string[] | Record<string, boolean>;
67
73
  }
68
74
  declare const __VLS_export: <T, C extends string | number = string, R = never>(__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<{
69
- props: __VLS_PrettifyLocal<iPCProps<T, C, R> & {
75
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<iPCProps<T, C, R> & {
70
76
  onRefresh?: ((...args: any[]) => any) | undefined;
71
77
  "onHas-content"?: ((...args: any[]) => any) | undefined;
72
- }> & import("vue").PublicProps & (typeof globalThis extends {
78
+ }> & (typeof globalThis extends {
73
79
  __VLS_PROPS_FALLBACK: infer P;
74
80
  } ? P : {});
75
81
  expose: (exposed: {}) => void;
@@ -1,4 +1,4 @@
1
- import type { iGetPage, iNodeFn, tThemeModifier, tThemeTuple } from "@open-xamu-co/ui-common-types";
1
+ import type { iGetPage, iNodeFn, iNodeStreamFn, tThemeModifier, tThemeTuple } from "@open-xamu-co/ui-common-types";
2
2
  import type { iTableProps } from "@open-xamu-co/ui-components-vue";
3
3
  export interface iPaginationContentTableProps<Ti extends Record<string, any>, TMi extends Record<string, any>> {
4
4
  /**
@@ -18,7 +18,16 @@ export interface iPaginationContentTableProps<Ti extends Record<string, any>, TM
18
18
  renderErrorMessage?: string;
19
19
  tableProps?: Omit<iTableProps<Ti, TMi>, "nodes" | "refresh">;
20
20
  theme?: tThemeModifier | tThemeTuple;
21
+ /**
22
+ * Whether to fetch data on client side only
23
+ */
21
24
  client?: boolean;
25
+ /**
26
+ * Whether to cache data
27
+ *
28
+ * @default true
29
+ */
30
+ cache?: boolean;
22
31
  /**
23
32
  * Additional class for the table
24
33
  *
@@ -31,19 +40,23 @@ export interface iPaginationContentTableProps<Ti extends Record<string, any>, TM
31
40
  * @example --txtColor
32
41
  */
33
42
  modalClass?: string | string[] | Record<string, boolean>;
34
- /**
35
- * Function used to create a node
36
- */
37
- createNode?: iNodeFn<NoInfer<Ti>, []>;
43
+ /** Function used to create a node */
44
+ createNode?: iNodeStreamFn<NoInfer<Ti>, []> | iNodeFn<NoInfer<Ti>, []>;
45
+ swal?: {
46
+ createdTitle?: string;
47
+ createdText?: string;
48
+ notCreatedTitle?: string;
49
+ notCreatedText?: string;
50
+ };
38
51
  /**
39
52
  * Prevent node functions from triggering refresh event (useful with firebase hydration)
40
53
  */
41
54
  omitRefresh?: boolean;
42
55
  }
43
56
  declare const __VLS_export: <T extends Record<string, any>, TM extends Record<string, any> = T>(__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<{
44
- props: __VLS_PrettifyLocal<iPaginationContentTableProps<T, TM> & {
57
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<iPaginationContentTableProps<T, TM> & {
45
58
  "onCreate-node-and-refresh"?: ((...args: any[]) => any) | undefined;
46
- }> & import("vue").PublicProps & (typeof globalThis extends {
59
+ }> & (typeof globalThis extends {
47
60
  __VLS_PROPS_FALLBACK: infer P;
48
61
  } ? P : {});
49
62
  expose: (exposed: {}) => void;
@@ -53,21 +66,21 @@ declare const __VLS_export: <T extends Record<string, any>, TM extends Record<st
53
66
  refreshData: () => void;
54
67
  hasContent: boolean | undefined;
55
68
  hydrateData: ((newContent: T[] | null, newErrors?: unknown) => void) | undefined;
56
- createNodeAndRefresh: () => Promise<import("@open-xamu-co/ui-common-types").iNodeFnResponse<NoInfer<T>>>;
69
+ createNodeAndRefresh: iNodeFn<T>;
57
70
  }) => any;
58
71
  } & {
59
72
  headActions?: (props: {
60
73
  refreshData: () => void;
61
74
  hasContent: false | undefined;
62
75
  hydrateData: ((newContent: T[] | null, newErrors?: unknown) => void) | undefined;
63
- createNodeAndRefresh: () => Promise<import("@open-xamu-co/ui-common-types").iNodeFnResponse<NoInfer<T>>>;
76
+ createNodeAndRefresh: iNodeFn<T>;
64
77
  }) => any;
65
78
  } & {
66
79
  headActions?: (props: {
67
80
  refreshData: () => void;
68
81
  hasContent: true;
69
82
  hydrateData: ((newContent: T[] | null, newErrors?: unknown) => void) | undefined;
70
- createNodeAndRefresh: () => Promise<import("@open-xamu-co/ui-common-types").iNodeFnResponse<NoInfer<T>>>;
83
+ createNodeAndRefresh: iNodeFn<T>;
71
84
  nodes: NoInfer<T>[];
72
85
  mappedNodes: import("@open-xamu-co/ui-components-vue").iMappedNodes<NoInfer<T>, TM>;
73
86
  updateNodeAndRefresh: iNodeFn<NoInfer<T>>;
@@ -80,7 +93,7 @@ declare const __VLS_export: <T extends Record<string, any>, TM extends Record<st
80
93
  refreshData: () => void;
81
94
  hasContent: boolean | undefined;
82
95
  hydrateData: ((newContent: T[] | null, newErrors?: unknown) => void) | undefined;
83
- createNodeAndRefresh: () => Promise<import("@open-xamu-co/ui-common-types").iNodeFnResponse<NoInfer<T>>>;
96
+ createNodeAndRefresh: iNodeFn<T>;
84
97
  node: NoInfer<T>;
85
98
  mappedNode: TM;
86
99
  updateNodeAndRefresh: iNodeFn<NoInfer<T>>;
@@ -12,9 +12,9 @@ export interface iPaginationSimpleProps<Ti, Ci extends string | number> extends
12
12
  currentPage?: iPage<Ti, Ci> | null;
13
13
  }
14
14
  declare const __VLS_export: <T, C extends string | number>(__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<{
15
- props: __VLS_PrettifyLocal<iPaginationSimpleProps<T, C> & {
15
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<iPaginationSimpleProps<T, C> & {
16
16
  "onUpdate:model-value"?: ((...args: any[]) => any) | undefined;
17
- }> & import("vue").PublicProps & (typeof globalThis extends {
17
+ }> & (typeof globalThis extends {
18
18
  __VLS_PROPS_FALLBACK: infer P;
19
19
  } ? P : {});
20
20
  expose: (exposed: {}) => void;
@@ -2,7 +2,7 @@ import type { iTableChildProps } from "../../types/props";
2
2
  export interface iTableBodyProps<Ti extends Record<string, any>, TMi extends Record<string, any> = Ti> extends iTableChildProps<Ti, TMi> {
3
3
  }
4
4
  declare const __VLS_export: <T extends Record<string, any>, TM extends Record<string, any> = T>(__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<{
5
- props: __VLS_PrettifyLocal<iTableBodyProps<T, TM>> & import("vue").PublicProps & (typeof globalThis extends {
5
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<iTableBodyProps<T, TM>> & (typeof globalThis extends {
6
6
  __VLS_PROPS_FALLBACK: infer P;
7
7
  } ? P : {});
8
8
  expose: (exposed: {}) => void;
@@ -3,7 +3,7 @@ export interface iTableHeadProps<Ti extends Record<string, any>, TMi extends Rec
3
3
  withDefaultSlot: boolean;
4
4
  }
5
5
  declare const __VLS_export: <T extends Record<string, any>, TM extends Record<string, any> = T>(__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<{
6
- props: __VLS_PrettifyLocal<iTableHeadProps<T, TM>> & import("vue").PublicProps & (typeof globalThis extends {
6
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<iTableHeadProps<T, TM>> & (typeof globalThis extends {
7
7
  __VLS_PROPS_FALLBACK: infer P;
8
8
  } ? P : {});
9
9
  expose: (exposed: {}) => void;
@@ -3,7 +3,7 @@ export interface iTableHeadProps<Ti extends Record<string, any>, TMi extends Rec
3
3
  withDefaultSlot: boolean;
4
4
  }
5
5
  declare const __VLS_export: <T extends Record<string, any>, TM extends Record<string, any> = T>(__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<{
6
- props: __VLS_PrettifyLocal<iTableHeadProps<T, TM>> & import("vue").PublicProps & (typeof globalThis extends {
6
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<iTableHeadProps<T, TM>> & (typeof globalThis extends {
7
7
  __VLS_PROPS_FALLBACK: infer P;
8
8
  } ? P : {});
9
9
  expose: (exposed: {}) => void;
@@ -8,4 +8,8 @@ export declare const Empty: Story;
8
8
  export declare const Opaque: Story;
9
9
  export declare const Nested: Story;
10
10
  export declare const NestedOpaque: Story;
11
+ /**
12
+ * Emulate filtered nodes
13
+ */
14
+ export declare const FilteredNodes: Story;
11
15
  export default meta;
@@ -1,9 +1,9 @@
1
1
  import type { iNodeFn } from "@open-xamu-co/ui-common-types";
2
2
  import type { iTableProps, iMappedNodes } from "../../types/props";
3
3
  declare const __VLS_export: <T extends Record<string, any>, TM extends Record<string, any> = T>(__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: __VLS_PrettifyLocal<iTableProps<T, TM> & {
4
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<iTableProps<T, TM> & {
5
5
  "onUpdate:sort"?: ((...args: any[]) => any) | undefined;
6
- }> & import("vue").PublicProps & (typeof globalThis extends {
6
+ }> & (typeof globalThis extends {
7
7
  __VLS_PROPS_FALLBACK: infer P;
8
8
  } ? P : {});
9
9
  expose: (exposed: {}) => void;
@@ -1,4 +1,13 @@
1
+ import type { iProperty } from "@open-xamu-co/ui-common-types";
2
+ import type { vComponent } from "../../plugin";
1
3
  import type { iValueComplexProps } from "../../types/props";
2
- declare const __VLS_export: import("vue").DefineComponent<iValueComplexProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<iValueComplexProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
+ type __VLS_Props = iValueComplexProps & {
5
+ /**
6
+ * Inherited table properties (Cell properties)
7
+ * @internal
8
+ */
9
+ properties?: iProperty<any, any, vComponent<iValueComplexProps>>[];
10
+ };
11
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
3
12
  declare const _default: typeof __VLS_export;
4
13
  export default _default;
@@ -1,6 +1,7 @@
1
1
  import { type AllowedComponentProps } from "vue";
2
2
  import type { iProperty, tProps } from "@open-xamu-co/ui-common-types";
3
- import type { iModalProps, iUseThemeProps } from "../../types/props";
3
+ import type { iModalProps, iUseThemeProps, iValueComplexProps } from "../../types/props";
4
+ import type { vComponent } from "../../plugin";
4
5
  export interface iValueListProps extends iUseThemeProps {
5
6
  /**
6
7
  * Cell value
@@ -20,6 +21,16 @@ export interface iValueListProps extends iUseThemeProps {
20
21
  classes?: tProps<string>;
21
22
  modalProps?: iModalProps & AllowedComponentProps;
22
23
  }
23
- declare const __VLS_export: import("vue").DefineComponent<iValueListProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<iValueListProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
+ export interface iValueListPropertyList extends iProperty<any, any, vComponent<iValueComplexProps>> {
25
+ key: string;
26
+ }
27
+ type __VLS_Props = iValueListProps & {
28
+ /**
29
+ * Inherited table properties (Cell properties)
30
+ * @internal
31
+ */
32
+ properties?: iProperty<any, any, vComponent<iValueComplexProps>>[];
33
+ };
34
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
35
  declare const _default: typeof __VLS_export;
25
36
  export default _default;
@@ -24,7 +24,7 @@ export interface iValueSimpleProps<Pi extends Record<string, any>> extends iUseT
24
24
  size?: tSizeModifier;
25
25
  }
26
26
  declare const __VLS_export: <P extends Record<string, any>>(__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<{
27
- props: __VLS_PrettifyLocal<iValueSimpleProps<P>> & import("vue").PublicProps & (typeof globalThis extends {
27
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<iValueSimpleProps<P>> & (typeof globalThis extends {
28
28
  __VLS_PROPS_FALLBACK: infer P_1;
29
29
  } ? P_1 : {});
30
30
  expose: (exposed: {}) => void;
@@ -10,8 +10,11 @@ type AsyncDataOptions<T> = {
10
10
  transform?: (input: T) => T | Promise<T>;
11
11
  watch?: WatchSource[];
12
12
  server?: boolean;
13
+ getCachedData?: () => T | null;
13
14
  };
14
- type tAsyncDataHandler<T> = (nuxtApp?: any) => Promise<T>;
15
+ type tAsyncDataHandler<T> = (nuxtApp?: any, options?: {
16
+ signal?: AbortSignal;
17
+ }) => Promise<T>;
15
18
  /**
16
19
  * Replicate nuxt sync data
17
20
  *
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Renders markdown to HTML
3
+ * Opens external links in new tab
4
+ *
5
+ * @param body - Markdown body
6
+ * @returns HTML
7
+ */
8
+ export default function useMarkdown(body: string): string;
@@ -1,7 +1,9 @@
1
- import type { tThemeModifier } from "@open-xamu-co/ui-common-types";
1
+ import type { tProp, tThemeModifier, tThemeTuple } from "@open-xamu-co/ui-common-types";
2
2
  import type { iUseThemeProps, iUseThemeTooltipProps } from "../types/props";
3
3
  interface iAllUseThemeProps extends iUseThemeProps, iUseThemeTooltipProps {
4
4
  }
5
+ /** Return theme tuple */
6
+ export declare function getThemeValues(values: tThemeTuple | tProp<tThemeModifier>): tThemeTuple;
5
7
  /**
6
8
  * Theme composable
7
9
  *