@open-xamu-co/ui-components-vue 3.1.0-next.9 → 3.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 (66) hide show
  1. package/CHANGELOG.md +517 -0
  2. package/dist/components/action/Button.stories.d.ts +4 -4
  3. package/dist/components/action/Button.vue.d.ts +4 -0
  4. package/dist/components/action/ButtonToggle.stories.d.ts +2 -0
  5. package/dist/components/base/Box.vue.d.ts +6 -0
  6. package/dist/components/base/ErrorBoundary.vue.d.ts +7 -2
  7. package/dist/components/base/Img.vue.d.ts +15 -56
  8. package/dist/components/base/Input.vue.d.ts +2 -0
  9. package/dist/components/base/Wrapper.vue.d.ts +3 -2
  10. package/dist/components/box/Action.vue.d.ts +1 -1
  11. package/dist/components/box/Message.stories.d.ts +1 -1
  12. package/dist/components/dropdown/Simple.stories.d.ts +6 -4
  13. package/dist/components/form/InputCountriesAPI.vue.d.ts +2 -6
  14. package/dist/components/form/InputNValues.vue.d.ts +2 -0
  15. package/dist/components/form/Simple.stories.d.ts +5 -3
  16. package/dist/components/form/Simple.vue.d.ts +5 -4
  17. package/dist/components/form/Stages.stories.d.ts +6 -9
  18. package/dist/components/input/Color.stories.d.ts +3 -3
  19. package/dist/components/input/Color.vue.d.ts +10 -2
  20. package/dist/components/input/File.vue.d.ts +4 -0
  21. package/dist/components/input/Toggle.vue.d.ts +2 -2
  22. package/dist/components/loader/ContentFetch.vue.d.ts +6 -3
  23. package/dist/components/modal/Simple.stories.d.ts +13 -4
  24. package/dist/components/pagination/Content.vue.d.ts +16 -4
  25. package/dist/components/pagination/ContentTable.stories.d.ts +4 -3
  26. package/dist/components/pagination/ContentTable.vue.d.ts +43 -14
  27. package/dist/components/pagination/Simple.stories.d.ts +14 -1
  28. package/dist/components/select/Choice.stories.d.ts +6 -5
  29. package/dist/components/select/Filter.stories.d.ts +5 -5
  30. package/dist/components/table/Body.vue.d.ts +17 -12
  31. package/dist/components/table/HeadActions.vue.d.ts +26 -0
  32. package/dist/components/table/HeadContent.vue.d.ts +17 -0
  33. package/dist/components/table/Simple.stories.d.ts +35 -11
  34. package/dist/components/table/Simple.vue.d.ts +22 -15
  35. package/dist/composables/theme.d.ts +8 -1
  36. package/dist/composables/utils.d.ts +2 -1
  37. package/dist/index-BeKPWN3w.js +4 -0
  38. package/dist/index-DPLrKbNp.mjs +8400 -0
  39. package/dist/index.js +1 -1
  40. package/dist/index.mjs +2 -2
  41. package/dist/plugin.js +1 -1
  42. package/dist/plugin.mjs +143 -133
  43. package/dist/theme-CChhGSbE.js +1 -0
  44. package/dist/theme-DWMJmaKP.mjs +83 -0
  45. package/dist/theme.js +1 -1
  46. package/dist/theme.mjs +1 -1
  47. package/dist/types/plugin.d.ts +9 -1
  48. package/dist/types/props.d.ts +59 -16
  49. package/package.json +7 -6
  50. package/dist/components/table/Head.vue.d.ts +0 -25
  51. package/dist/index-BtJc7cX1.js +0 -4
  52. package/dist/index-DTG4ktcY.mjs +0 -6753
  53. package/dist/screens/DropdownWithToggle.stories.d.ts +0 -11
  54. package/dist/screens/DropdownWithToggle.vue.d.ts +0 -2
  55. package/dist/screens/FormWithFetch.stories.d.ts +0 -11
  56. package/dist/screens/FormWithFetch.vue.d.ts +0 -2
  57. package/dist/screens/ModalWithFormStages.stories.d.ts +0 -11
  58. package/dist/screens/ModalWithFormStages.vue.d.ts +0 -2
  59. package/dist/screens/ModalWithToggle.stories.d.ts +0 -11
  60. package/dist/screens/ModalWithToggle.vue.d.ts +0 -2
  61. package/dist/screens/PaginationContentWithTable.stories.d.ts +0 -11
  62. package/dist/screens/PaginationContentWithTable.vue.d.ts +0 -8
  63. package/dist/screens/TableWithNestedTable.stories.d.ts +0 -11
  64. package/dist/screens/TableWithNestedTable.vue.d.ts +0 -8
  65. package/dist/theme-DSVG59vT.js +0 -1
  66. package/dist/theme-DVpUQx-w.mjs +0 -78
@@ -21,8 +21,10 @@ declare function __VLS_template(): {
21
21
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
22
22
  declare const __VLS_component: import("vue").DefineComponent<iBaseInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
23
23
  "update:model-value": (...args: any[]) => void;
24
+ change: (...args: any[]) => void;
24
25
  }, string, import("vue").PublicProps, Readonly<iBaseInputProps> & Readonly<{
25
26
  "onUpdate:model-value"?: ((...args: any[]) => any) | undefined;
27
+ onChange?: ((...args: any[]) => any) | undefined;
26
28
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
29
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
28
30
  export default _default;
@@ -1,9 +1,10 @@
1
+ import type { Teleport } from "vue";
1
2
  import type { vComponent } from "../../types/plugin";
2
3
  type __VLS_Props = {
3
4
  /** Wheter or not render the wrapper */
4
5
  wrap: boolean;
5
6
  /** Component or tag to render as wrapper */
6
- wrapper?: vComponent | string;
7
+ wrapper?: vComponent | typeof Teleport | string;
7
8
  };
8
9
  declare function __VLS_template(): {
9
10
  attrs: Partial<{}>;
@@ -17,7 +18,7 @@ declare function __VLS_template(): {
17
18
  };
18
19
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
19
20
  declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
20
- wrapper: vComponent | string;
21
+ wrapper: vComponent | typeof Teleport | string;
21
22
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
23
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
23
24
  export default _default;
@@ -7,7 +7,7 @@ interface iBoxActionProps extends iActionProps, iUseModifiersProps, iUseStatePro
7
7
  */
8
8
  icon?: IconName;
9
9
  iconProps?: iFormIconProps & {
10
- size: number;
10
+ size?: number;
11
11
  };
12
12
  /**
13
13
  * image url or path
@@ -4,7 +4,7 @@ declare const meta: {
4
4
  title: string;
5
5
  component: Record<keyof typeof Message, unknown>;
6
6
  args: {
7
- default: string;
7
+ text: string;
8
8
  };
9
9
  };
10
10
  type Story = StoryObj<typeof Message>;
@@ -1,10 +1,12 @@
1
1
  import type { StoryObj } from "@storybook/vue3";
2
- import Simple from "./Simple.vue";
2
+ import DropdownSimple from "./Simple.vue";
3
3
  declare const meta: {
4
4
  title: string;
5
- component: Record<keyof typeof Simple, unknown>;
6
- args: {};
5
+ component: Record<keyof typeof DropdownSimple, unknown>;
6
+ args: {
7
+ invertTheme: true;
8
+ };
7
9
  };
8
- type Story = StoryObj<typeof Simple>;
10
+ type Story = StoryObj<typeof DropdownSimple>;
9
11
  export declare const Sample: Story;
10
12
  export default meta;
@@ -4,6 +4,7 @@ interface iFormInputCountriesApi extends iUseThemeProps {
4
4
  model: string[];
5
5
  countries?: iCountry[];
6
6
  states?: iState[];
7
+ /** Loading countries and states */
7
8
  loading?: boolean;
8
9
  errors?: unknown;
9
10
  refresh?: (...args: any[]) => any;
@@ -13,12 +14,7 @@ declare function __VLS_template(): {
13
14
  slots: {
14
15
  default?(_: {
15
16
  statesReq: Record<string, any>;
16
- citiesReq: {
17
- content: import("../../types/countries").iCity[];
18
- refresh: (opts?: any) => Promise<void>;
19
- loading: boolean;
20
- errors: unknown;
21
- };
17
+ citiesReq: Record<string, any>;
22
18
  }): any;
23
19
  };
24
20
  refs: {};
@@ -5,6 +5,8 @@ export interface iFormInputNValues<Ti> {
5
5
  content?: boolean;
6
6
  loading?: boolean;
7
7
  errors?: unknown;
8
+ /** Loader label */
9
+ label?: string;
8
10
  refresh?: (...args: any[]) => any;
9
11
  }
10
12
  declare const _default: <T>(__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<{
@@ -1,7 +1,9 @@
1
1
  import type { Meta, StoryObj } from "@storybook/vue3";
2
2
  declare const meta: Meta;
3
3
  type Story = StoryObj<typeof meta>;
4
- export declare const Form: Story;
5
- export declare const FormUsingLocationField: Story;
6
- export declare const FormUsingPhoneField: Story;
4
+ export declare const Sample: Story;
5
+ export declare const WithInputs: Story;
6
+ export declare const WithLocationField: Story;
7
+ export declare const WithPhoneField: Story;
8
+ export declare const Make: Story;
7
9
  export default meta;
@@ -1,5 +1,6 @@
1
1
  import type { iInvalidInput } from "@open-xamu-co/ui-common-types";
2
2
  import type { tFormInput } from "@open-xamu-co/ui-common-types";
3
+ import { eFormTypeSimple } from "@open-xamu-co/ui-common-enums";
3
4
  import type { iUseThemeProps } from "../../types/props";
4
5
  export interface iFormSimple<P extends any[]> extends iUseThemeProps {
5
6
  title?: string;
@@ -14,21 +15,21 @@ export interface iFormSimple<P extends any[]> extends iUseThemeProps {
14
15
  /**
15
16
  * Make model
16
17
  */
17
- make?: (...args: P) => tFormInput[];
18
+ make?: ((...args: P) => tFormInput[]) | ((...args: P) => Promise<tFormInput[]>);
18
19
  /** Make all inputs read only by disabling them */
19
20
  readonly?: boolean;
20
21
  }
21
22
  declare const _default: <P extends any[] = any[]>(__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<{
22
23
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
23
- readonly "onUpdate:model-value"?: ((...args: any[]) => any) | undefined;
24
- readonly "onUpdate:invalid"?: ((...args: any[]) => any) | undefined;
24
+ readonly "onUpdate:model-value"?: ((args_0: tFormInput<import("@open-xamu-co/ui-common-types").iFormValue | import("@open-xamu-co/ui-common-types").iFormValue[], import("@open-xamu-co/ui-common-enums").eFormTypeBase | eFormTypeSimple | import("@open-xamu-co/ui-common-enums").eFormTypeComplex>[]) => any) | undefined;
25
+ readonly "onUpdate:invalid"?: ((args_0: iInvalidInput[]) => any) | undefined;
25
26
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:model-value" | "onUpdate:invalid"> & Partial<{}> & iFormSimple<P>> & import("vue").PublicProps;
26
27
  expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
27
28
  attrs: any;
28
29
  slots: {
29
30
  default?(_: {}): any;
30
31
  };
31
- emit: (event: "update:model-value" | "update:invalid", ...args: any[]) => void;
32
+ emit: ((evt: "update:model-value", args_0: tFormInput<import("@open-xamu-co/ui-common-types").iFormValue | import("@open-xamu-co/ui-common-types").iFormValue[], import("@open-xamu-co/ui-common-enums").eFormTypeBase | eFormTypeSimple | import("@open-xamu-co/ui-common-enums").eFormTypeComplex>[]) => void) & ((evt: "update:invalid", args_0: iInvalidInput[]) => void);
32
33
  }>) => import("vue").VNode & {
33
34
  __ctx?: Awaited<typeof __VLS_setup>;
34
35
  };
@@ -1,8 +1,6 @@
1
1
  import type { StoryObj } from "@storybook/vue3";
2
- import type { iForm, iInvalidInput, tFormInput } from "@open-xamu-co/ui-common-types";
2
+ import type { iForm } from "@open-xamu-co/ui-common-types";
3
3
  import StagesComponent from "./Stages.vue";
4
- export declare const stagesData: iForm[][];
5
- declare function submitFn(inputs: tFormInput[]): Promise<boolean | iInvalidInput[]>;
6
4
  declare const meta: {
7
5
  title: string;
8
6
  component: {
@@ -59,13 +57,12 @@ declare const meta: {
59
57
  "secondary-actions"?(_: {}): any;
60
58
  };
61
59
  });
62
- args: {
63
- stages: iForm[][];
64
- submitFn: typeof submitFn;
65
- };
60
+ args: {};
66
61
  excludeStories: RegExp;
67
62
  };
68
63
  type Story = StoryObj<typeof StagesComponent>;
69
- export declare const Stages: Story;
70
- export declare const StagesWithInvalidStage: Story;
64
+ export declare const Sample: Story;
65
+ export declare const stagesData: iForm[][];
66
+ export declare const WithStages: Story;
67
+ export declare const WithInvalidStage: Story;
71
68
  export default meta;
@@ -1,10 +1,10 @@
1
1
  import type { StoryObj } from "@storybook/vue3";
2
- import Color from "./Color.vue";
2
+ import InputColor from "./Color.vue";
3
3
  declare const meta: {
4
4
  title: string;
5
- component: Record<keyof typeof Color, unknown>;
5
+ component: Record<keyof typeof InputColor, unknown>;
6
6
  args: {};
7
7
  };
8
- type Story = StoryObj<typeof Color>;
8
+ type Story = StoryObj<typeof InputColor>;
9
9
  export declare const Sample: Story;
10
10
  export default meta;
@@ -1,5 +1,13 @@
1
1
  import type { iUseModifiersProps, iUseStateProps, iUseThemeProps, iInputProps } from "../../types/props";
2
- interface iInputTextProps extends iInputProps, iUseModifiersProps, iUseStateProps, iUseThemeProps {
2
+ interface iInputColorProps extends iInputProps, iUseModifiersProps, iUseStateProps, iUseThemeProps {
3
+ /**
4
+ * @private
5
+ */
6
+ modelValue?: number | string;
3
7
  }
4
- declare const _default: import("vue").DefineComponent<iInputTextProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<iInputTextProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ declare const _default: import("vue").DefineComponent<iInputColorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ "update:model-value": (...args: any[]) => void;
10
+ }, string, import("vue").PublicProps, Readonly<iInputColorProps> & Readonly<{
11
+ "onUpdate:model-value"?: ((...args: any[]) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
13
  export default _default;
@@ -13,6 +13,10 @@ interface iInputFileProps extends iInputProps, iUseModifiersProps, iUseStateProp
13
13
  * default: all image types
14
14
  */
15
15
  accept?: string[];
16
+ /**
17
+ * Capture files directly from camera
18
+ */
19
+ capture?: "environment" | "user";
16
20
  modelValue: File[];
17
21
  }
18
22
  declare const _default: import("vue").DefineComponent<iInputFileProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -1,5 +1,5 @@
1
- import type { iUseModifiersProps, iUseStateProps, iUseThemeProps, iInputProps } from "../../types/props";
2
- interface iInputToggleProps extends iInputProps, iUseModifiersProps, iUseStateProps, iUseThemeProps {
1
+ import type { iUseModifiersProps, iUseStateProps, iUseThemeProps, iInputProps, iUseThemeTooltipProps } from "../../types/props";
2
+ interface iInputToggleProps extends iInputProps, iUseModifiersProps, iUseStateProps, iUseThemeProps, iUseThemeTooltipProps {
3
3
  type?: "checkbox" | "radio" | "switch";
4
4
  label?: string;
5
5
  showPlaceholder?: boolean;
@@ -26,7 +26,7 @@ export interface iLoaderContentFetchProps<Ti, Pi extends any[]> extends iUseThem
26
26
  *
27
27
  * Hydration is conditioned to the context (disabled, loading...)
28
28
  */
29
- hydratablePromise?: false | ((content: Ref<Ti | null | undefined>, errors: Ref<unknown>) => (...args: Pi) => Promise<Ti>);
29
+ hydratablePromise?: false | ((content: Ref<Ti | null>, errors: Ref<unknown>) => (...args: Pi) => Promise<Ti>);
30
30
  payload?: Pi;
31
31
  /**
32
32
  * Component or tag to render on loader
@@ -45,7 +45,9 @@ export interface iLoaderContentFetchProps<Ti, Pi extends any[]> extends iUseThem
45
45
  declare const _default: <T, P extends any[] = any[]>(__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<{
46
46
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
47
47
  readonly onRefresh?: ((...args: any[]) => any) | undefined;
48
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onRefresh"> & Partial<{}> & iLoaderContentFetchProps<T, P>> & import("vue").PublicProps;
48
+ readonly "onHas-content"?: ((...args: any[]) => any) | undefined;
49
+ readonly onHydrate?: ((...args: any[]) => any) | undefined;
50
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onRefresh" | "onHas-content" | "onHydrate"> & Partial<{}> & iLoaderContentFetchProps<T, P>> & import("vue").PublicProps;
49
51
  expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
50
52
  attrs: any;
51
53
  slots: {
@@ -54,9 +56,10 @@ declare const _default: <T, P extends any[] = any[]>(__VLS_props: NonNullable<Aw
54
56
  refresh: (opts?: any) => Promise<void>;
55
57
  loading: boolean;
56
58
  errors: unknown;
59
+ hydrate: (newContent: T | null, newErrors?: unknown) => void;
57
60
  }): any;
58
61
  };
59
- emit: (event: "refresh", ...args: any[]) => void;
62
+ emit: (event: "refresh" | "has-content" | "hydrate", ...args: any[]) => void;
60
63
  }>) => import("vue").VNode & {
61
64
  __ctx?: Awaited<typeof __VLS_setup>;
62
65
  };
@@ -1,10 +1,19 @@
1
1
  import type { StoryObj } from "@storybook/vue3";
2
- import Simple from "./Simple.vue";
2
+ import ModalSimple from "./Simple.vue";
3
3
  declare const meta: {
4
4
  title: string;
5
- component: Record<keyof typeof Simple, unknown>;
6
- args: {};
5
+ component: Record<keyof typeof ModalSimple, unknown>;
6
+ args: {
7
+ title: string;
8
+ subtitle: string;
9
+ class: string;
10
+ invertTheme: true;
11
+ saveButton: {
12
+ title: string;
13
+ };
14
+ };
7
15
  };
8
- type Story = StoryObj<typeof Simple>;
16
+ type Story = StoryObj<typeof ModalSimple>;
9
17
  export declare const Sample: Story;
18
+ export declare const WithFormStages: Story;
10
19
  export default meta;
@@ -1,10 +1,15 @@
1
+ import { type Ref } from "vue";
1
2
  import type { iGetPage, iPage, iPagination } from "@open-xamu-co/ui-common-types";
2
3
  import type { iUseThemeProps } from "../../types/props";
3
4
  export interface iPCProps<Ti, Ci extends string | number = string, Ri = never> extends iPagination, iUseThemeProps {
4
5
  /**
5
6
  * Function used to fetch the page
6
7
  */
7
- 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) => Promise<Ri | undefined>;
9
+ /**
10
+ * Function used to fetch the page and hydrate the content
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>;
8
13
  /**
9
14
  * Path used as key for the cache
10
15
  */
@@ -50,23 +55,30 @@ export interface iPCProps<Ti, Ci extends string | number = string, Ri = never> e
50
55
  * Whether to fetch data on client side only
51
56
  */
52
57
  client?: boolean;
58
+ /**
59
+ * Additional class for the pagination
60
+ *
61
+ * @example --txtColor
62
+ */
63
+ paginationClass?: string | string[] | Record<string, boolean>;
53
64
  }
54
65
  declare const _default: <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_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
55
66
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
56
67
  readonly onRefresh?: ((...args: any[]) => any) | undefined;
57
- readonly onHasContent?: ((...args: any[]) => any) | undefined;
58
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onRefresh" | "onHasContent"> & Partial<{}> & iPCProps<T, C, R>> & import("vue").PublicProps;
68
+ readonly "onHas-content"?: ((...args: any[]) => any) | undefined;
69
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onRefresh" | "onHas-content"> & Partial<{}> & iPCProps<T, C, R>> & import("vue").PublicProps;
59
70
  expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
60
71
  attrs: any;
61
72
  slots: {
62
73
  default?(_: {
74
+ hydrateNodes: ((newContent: T[] | null, newErrors?: unknown) => void) | undefined;
63
75
  content: NoInfer<T>[];
64
76
  pagination: iPagination;
65
77
  currentPage: iPage<T, C>;
66
78
  refresh: (opts?: any) => Promise<void>;
67
79
  }): any;
68
80
  };
69
- emit: (event: "refresh" | "hasContent", ...args: any[]) => void;
81
+ emit: (event: "refresh" | "has-content", ...args: any[]) => void;
70
82
  }>) => import("vue").VNode & {
71
83
  __ctx?: Awaited<typeof __VLS_setup>;
72
84
  };
@@ -1,10 +1,11 @@
1
1
  import type { StoryObj } from "@storybook/vue3";
2
- import ContentTable from "./ContentTable.vue";
2
+ import PaginationContentTable from "./ContentTable.vue";
3
3
  declare const meta: {
4
4
  title: string;
5
- component: Record<keyof typeof ContentTable, unknown>;
5
+ component: Record<keyof typeof PaginationContentTable, unknown>;
6
6
  args: {};
7
7
  };
8
- type Story = StoryObj<typeof ContentTable>;
8
+ type Story = StoryObj<typeof PaginationContentTable>;
9
9
  export declare const Sample: Story;
10
+ export declare const Data: Story;
10
11
  export default meta;
@@ -1,4 +1,4 @@
1
- import type { iGetPage, tThemeModifier, tThemeTuple } from "@open-xamu-co/ui-common-types";
1
+ import type { iGetPage, iNodeFn, 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
  /**
@@ -7,6 +7,7 @@ export interface iPaginationContentTableProps<Ti extends Record<string, any>, TM
7
7
  url: string;
8
8
  page: iGetPage<Ti>;
9
9
  defaults?: Record<string, any>;
10
+ /** Map node data as required */
10
11
  mapNode?: (node: Ti) => TMi;
11
12
  preventAutoload?: boolean;
12
13
  /**
@@ -14,7 +15,8 @@ export interface iPaginationContentTableProps<Ti extends Record<string, any>, TM
14
15
  */
15
16
  refresh?: () => void;
16
17
  noContentMessage?: string;
17
- tableProps?: Omit<iTableProps<TMi>, "nodes" | "refresh">;
18
+ renderErrorMessage?: string;
19
+ tableProps?: Omit<iTableProps<Ti, TMi>, "nodes" | "refresh">;
18
20
  theme?: tThemeModifier | tThemeTuple;
19
21
  client?: boolean;
20
22
  /**
@@ -29,36 +31,63 @@ export interface iPaginationContentTableProps<Ti extends Record<string, any>, TM
29
31
  * @example --txtColor
30
32
  */
31
33
  modalClass?: string | string[] | Record<string, boolean>;
34
+ /**
35
+ * Function used to create a node
36
+ */
37
+ createNode?: iNodeFn<NoInfer<Ti>, []>;
38
+ /**
39
+ * Prevent node functions from triggering refresh event (useful with firebase hydration)
40
+ */
41
+ omitRefresh?: boolean;
32
42
  }
33
- declare const _default: <T extends Record<string, any>, TM 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_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
34
- props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & Partial<{}> & iPaginationContentTableProps<T, TM>> & import("vue").PublicProps;
43
+ declare const _default: <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_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
44
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
45
+ readonly "onCreate-node-and-refresh"?: ((...args: any[]) => any) | undefined;
46
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onCreate-node-and-refresh"> & Partial<{}> & iPaginationContentTableProps<T, TM>> & import("vue").PublicProps;
35
47
  expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
36
48
  attrs: any;
37
49
  slots: {
38
50
  default?(_: {
39
- hasContent: boolean;
40
51
  refreshData: () => void;
52
+ hasContent: boolean | undefined;
53
+ hydrateData: ((newContent: T[] | null, newErrors?: unknown) => void) | undefined;
54
+ createNodeAndRefresh: () => Promise<import("@open-xamu-co/ui-common-types").iNodeFnResponse<NoInfer<T>>>;
41
55
  }): any;
42
56
  headActions?(_: {
43
- hasContent: false;
44
57
  refreshData: () => void;
58
+ hasContent: false | undefined;
59
+ hydrateData: ((newContent: T[] | null, newErrors?: unknown) => void) | undefined;
60
+ createNodeAndRefresh: () => Promise<import("@open-xamu-co/ui-common-types").iNodeFnResponse<NoInfer<T>>>;
45
61
  }): any;
46
62
  headActions?(_: {
47
- hasContent: boolean;
48
63
  refreshData: () => void;
64
+ hasContent: true;
65
+ hydrateData: ((newContent: T[] | null, newErrors?: unknown) => void) | undefined;
66
+ createNodeAndRefresh: () => Promise<import("@open-xamu-co/ui-common-types").iNodeFnResponse<NoInfer<T>>>;
67
+ nodes: NoInfer<T>[];
68
+ mappedNodes: import("@open-xamu-co/ui-components-vue").iMappedNodes<NoInfer<T>, TM>;
69
+ updateNodeAndRefresh: iNodeFn<NoInfer<T>>;
70
+ cloneNodeAndRefresh: iNodeFn<NoInfer<T>, [NoInfer<T>, ((m?: boolean) => any) | undefined, (HTMLElement | undefined)?]>;
71
+ deleteNodeAndRefresh: iNodeFn<NoInfer<T>, [NoInfer<T>, ((m?: boolean) => any) | undefined, (HTMLElement | undefined)?]>;
72
+ deleteNodesAndRefresh: (nodes?: NoInfer<T>[] | undefined) => Promise<void>;
49
73
  }): any;
50
74
  tableChildren?(_: {
51
- hasContent: boolean;
52
75
  refreshData: () => void;
53
- node: TM;
54
- updateNodeAndRefresh: (node: TM) => Promise<void>;
55
- cloneNodeAndRefresh: (node: TM, toggleModal?: (m?: boolean) => any) => Promise<void>;
56
- deleteNodeAndRefresh: (node: TM, toggleModal?: (m?: boolean) => any, modalRef?: HTMLElement) => Promise<void>;
57
- deleteNodesAndRefresh: (nodes?: TM[] | undefined) => Promise<void>;
76
+ hasContent: boolean | undefined;
77
+ hydrateData: ((newContent: T[] | null, newErrors?: unknown) => void) | undefined;
78
+ createNodeAndRefresh: () => Promise<import("@open-xamu-co/ui-common-types").iNodeFnResponse<NoInfer<T>>>;
79
+ node: NoInfer<T>;
80
+ mappedNode: TM;
81
+ updateNodeAndRefresh: iNodeFn<NoInfer<T>>;
82
+ cloneNodeAndRefresh: iNodeFn<NoInfer<T>, [NoInfer<T>, ((m?: boolean) => any) | undefined, (HTMLElement | undefined)?]>;
83
+ deleteNodeAndRefresh: iNodeFn<NoInfer<T>, [NoInfer<T>, ((m?: boolean) => any) | undefined, (HTMLElement | undefined)?]>;
84
+ deleteNodesAndRefresh: (nodes?: NoInfer<T>[] | undefined) => Promise<void>;
85
+ createNodeChildrenAndRefresh: iNodeFn<NoInfer<T>>;
58
86
  show: boolean;
87
+ hydrateParentNode: (newNode: NoInfer<T> | null, _newErrors?: unknown) => void;
59
88
  }): any;
60
89
  };
61
- emit: {};
90
+ emit: (event: "create-node-and-refresh", ...args: any[]) => void;
62
91
  }>) => import("vue").VNode & {
63
92
  __ctx?: Awaited<typeof __VLS_setup>;
64
93
  };
@@ -3,7 +3,20 @@ import Simple from "./Simple.vue";
3
3
  declare const meta: {
4
4
  title: string;
5
5
  component: Record<keyof typeof Simple, unknown>;
6
- args: {};
6
+ args: {
7
+ modelValue: {
8
+ at: number;
9
+ first: number;
10
+ };
11
+ currentPage: {
12
+ edges: never[];
13
+ pageInfo: {
14
+ hasNextPage: false;
15
+ hasPreviousPage: false;
16
+ };
17
+ totalCount: number;
18
+ };
19
+ };
7
20
  };
8
21
  type Story = StoryObj<typeof Simple>;
9
22
  export declare const Sample: Story;
@@ -1,13 +1,14 @@
1
1
  import type { StoryObj } from "@storybook/vue3";
2
- import type { iSelectOption } from "@open-xamu-co/ui-common-types";
3
- import Choice from "./Choice.vue";
2
+ import SelectChoice from "./Choice.vue";
4
3
  declare const meta: {
5
4
  title: string;
6
- component: Record<keyof typeof Choice, unknown>;
5
+ component: Record<keyof typeof SelectChoice, unknown>;
7
6
  args: {
8
- options: iSelectOption[];
7
+ options: string[];
9
8
  };
10
9
  };
11
- type Story = StoryObj<typeof Choice>;
10
+ type Story = StoryObj<typeof SelectChoice>;
12
11
  export declare const Sample: Story;
12
+ export declare const WithOptions: Story;
13
+ export declare const WithMultipleOptions: Story;
13
14
  export default meta;
@@ -1,13 +1,13 @@
1
1
  import type { StoryObj } from "@storybook/vue3";
2
- import type { iSelectOption } from "@open-xamu-co/ui-common-types";
3
- import Filter from "./Filter.vue";
2
+ import SelectFilter from "./Filter.vue";
4
3
  declare const meta: {
5
4
  title: string;
6
- component: Record<keyof typeof Filter, unknown>;
5
+ component: Record<keyof typeof SelectFilter, unknown>;
7
6
  args: {
8
- options: iSelectOption[];
7
+ options: string[];
9
8
  };
10
9
  };
11
- type Story = StoryObj<typeof Filter>;
10
+ type Story = StoryObj<typeof SelectFilter>;
12
11
  export declare const Sample: Story;
12
+ export declare const WithOptions: Story;
13
13
  export default meta;
@@ -1,34 +1,39 @@
1
1
  import type { iTableChildProps } from "../../types/props";
2
- export interface iTableBodyProps<Ti extends Record<string, any>> extends iTableChildProps<Ti> {
2
+ export interface iTableBodyProps<Ti extends Record<string, any>, TMi extends Record<string, any> = Ti> extends iTableChildProps<Ti, TMi> {
3
3
  }
4
- declare const _default: <T 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_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
5
- props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & Partial<{}> & iTableBodyProps<T>> & import("vue").PublicProps;
4
+ declare const _default: <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_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
5
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & Partial<{}> & iTableBodyProps<T, TM>> & import("vue").PublicProps;
6
6
  expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
7
7
  attrs: any;
8
8
  slots: {
9
9
  modifyActions?(_: {
10
10
  node: T;
11
- updateNodeAndRefresh: (node: T) => Promise<void>;
12
- cloneNodeAndRefresh: (node: T, toggleModal?: (m?: boolean) => any) => Promise<void>;
13
- deleteNodeAndRefresh: (node: T, toggleModal?: (m?: boolean) => any, modalRef?: HTMLElement) => Promise<void>;
11
+ mappedNode: TM;
12
+ updateNodeAndRefresh: import("@open-xamu-co/ui-common-types").iNodeFn<T>;
13
+ cloneNodeAndRefresh: import("@open-xamu-co/ui-common-types").iNodeFn<T, [T, ((m?: boolean) => any) | undefined, (HTMLElement | undefined)?]>;
14
+ deleteNodeAndRefresh: import("@open-xamu-co/ui-common-types").iNodeFn<T, [T, ((m?: boolean) => any) | undefined, (HTMLElement | undefined)?]>;
14
15
  deleteNodesAndRefresh: (nodes?: T[] | undefined) => Promise<void>;
15
16
  show: boolean;
16
17
  }): any;
17
18
  modifyDropdownActions?(_: {
18
19
  node: T;
19
- updateNodeAndRefresh: (node: T) => Promise<void>;
20
- cloneNodeAndRefresh: (node: T, toggleModal?: (m?: boolean) => any) => Promise<void>;
21
- deleteNodeAndRefresh: (node: T, toggleModal?: (m?: boolean) => any, modalRef?: HTMLElement) => Promise<void>;
20
+ mappedNode: TM;
21
+ updateNodeAndRefresh: import("@open-xamu-co/ui-common-types").iNodeFn<T>;
22
+ cloneNodeAndRefresh: import("@open-xamu-co/ui-common-types").iNodeFn<T, [T, ((m?: boolean) => any) | undefined, (HTMLElement | undefined)?]>;
23
+ deleteNodeAndRefresh: import("@open-xamu-co/ui-common-types").iNodeFn<T, [T, ((m?: boolean) => any) | undefined, (HTMLElement | undefined)?]>;
22
24
  deleteNodesAndRefresh: (nodes?: T[] | undefined) => Promise<void>;
23
25
  show: boolean;
24
26
  }): any;
25
27
  default?(_: {
26
28
  node: T;
27
- updateNodeAndRefresh: (node: T) => Promise<void>;
28
- cloneNodeAndRefresh: (node: T, toggleModal?: (m?: boolean) => any) => Promise<void>;
29
- deleteNodeAndRefresh: (node: T, toggleModal?: (m?: boolean) => any, modalRef?: HTMLElement) => Promise<void>;
29
+ mappedNode: TM;
30
+ updateNodeAndRefresh: import("@open-xamu-co/ui-common-types").iNodeFn<T>;
31
+ cloneNodeAndRefresh: import("@open-xamu-co/ui-common-types").iNodeFn<T, [T, ((m?: boolean) => any) | undefined, (HTMLElement | undefined)?]>;
32
+ deleteNodeAndRefresh: import("@open-xamu-co/ui-common-types").iNodeFn<T, [T, ((m?: boolean) => any) | undefined, (HTMLElement | undefined)?]>;
30
33
  deleteNodesAndRefresh: (nodes?: T[] | undefined) => Promise<void>;
34
+ createNodeChildrenAndRefresh: import("@open-xamu-co/ui-common-types").iNodeFn<T>;
31
35
  show: boolean;
36
+ hydrateParentNode: (newNode: T | null, _newErrors?: unknown) => void;
32
37
  }): any;
33
38
  };
34
39
  emit: {};
@@ -0,0 +1,26 @@
1
+ import type { iTableChildProps } from "../../types/props";
2
+ export interface iTableHeadProps<Ti extends Record<string, any>, TMi extends Record<string, any> = Ti> extends iTableChildProps<Ti, TMi> {
3
+ withDefaultSlot: boolean;
4
+ }
5
+ declare const _default: <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_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
6
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & Partial<{}> & iTableHeadProps<T, TM>> & import("vue").PublicProps;
7
+ expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
8
+ attrs: any;
9
+ slots: {
10
+ headActions?(_: {
11
+ nodes: T[];
12
+ mappedNodes: import("../../index.js").iMappedNodes<T, TM>;
13
+ updateNodeAndRefresh: import("@open-xamu-co/ui-common-types").iNodeFn<T>;
14
+ cloneNodeAndRefresh: import("@open-xamu-co/ui-common-types").iNodeFn<T, [T, ((m?: boolean) => any) | undefined, (HTMLElement | undefined)?]>;
15
+ deleteNodeAndRefresh: import("@open-xamu-co/ui-common-types").iNodeFn<T, [T, ((m?: boolean) => any) | undefined, (HTMLElement | undefined)?]>;
16
+ deleteNodesAndRefresh: (nodes?: T[] | undefined) => Promise<void>;
17
+ }): any;
18
+ };
19
+ emit: {};
20
+ }>) => import("vue").VNode & {
21
+ __ctx?: Awaited<typeof __VLS_setup>;
22
+ };
23
+ export default _default;
24
+ type __VLS_PrettifyLocal<T> = {
25
+ [K in keyof T]: T[K];
26
+ } & {};
@@ -0,0 +1,17 @@
1
+ import type { iTableChildProps } from "../../types/props";
2
+ export interface iTableHeadProps<Ti extends Record<string, any>, TMi extends Record<string, any> = Ti> extends iTableChildProps<Ti, TMi> {
3
+ withDefaultSlot: boolean;
4
+ }
5
+ declare const _default: <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_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
6
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & Partial<{}> & iTableHeadProps<T, TM>> & import("vue").PublicProps;
7
+ expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
8
+ attrs: any;
9
+ slots: {};
10
+ emit: {};
11
+ }>) => import("vue").VNode & {
12
+ __ctx?: Awaited<typeof __VLS_setup>;
13
+ };
14
+ export default _default;
15
+ type __VLS_PrettifyLocal<T> = {
16
+ [K in keyof T]: T[K];
17
+ } & {};