@gustavo-valsechi/client 1.4.367 → 1.4.369

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.
@@ -68,17 +68,34 @@ const ModalProviderContainer = ({ children }) => {
68
68
  };
69
69
  const setProps = (modalName, props) => {
70
70
  const index = import_lodash.default.findIndex(memory, (modal) => modal.name === modalName);
71
- const content = import_lodash.default.find(memory, (modal) => modal.name === modalName);
72
- if (!content) return;
71
+ const data = import_lodash.default.find(memory, (modal) => modal.name === modalName);
72
+ if (!data) return;
73
73
  memory.splice(index, 1, {
74
- ...content,
74
+ ...data,
75
75
  props: {
76
- ...content.props,
76
+ ...data.props,
77
77
  ...props
78
78
  }
79
79
  });
80
80
  setModals([...memory]);
81
81
  };
82
+ const setContent = (modalName, content) => {
83
+ var _a;
84
+ const index = import_lodash.default.findIndex(memory, (modal) => modal.name === modalName);
85
+ const data = import_lodash.default.find(memory, (modal) => modal.name === modalName);
86
+ if (!data) return;
87
+ memory.splice(index, 1, {
88
+ ...data,
89
+ props: {
90
+ ...data.props,
91
+ content: ((_a = data.props) == null ? void 0 : _a.content) ? {
92
+ ...data.props.content,
93
+ ...content
94
+ } : content
95
+ }
96
+ });
97
+ setModals([...memory]);
98
+ };
82
99
  const toggle = (modalName) => {
83
100
  var _a;
84
101
  const content = import_lodash.default.find(memory, (modal) => modal.name === modalName);
@@ -92,6 +109,7 @@ const ModalProviderContainer = ({ children }) => {
92
109
  add,
93
110
  remove,
94
111
  setProps,
112
+ setContent,
95
113
  toggle
96
114
  },
97
115
  children: [
@@ -34,17 +34,34 @@ const ModalProviderContainer = ({ children }) => {
34
34
  };
35
35
  const setProps = (modalName, props) => {
36
36
  const index = _.findIndex(memory, (modal) => modal.name === modalName);
37
- const content = _.find(memory, (modal) => modal.name === modalName);
38
- if (!content) return;
37
+ const data = _.find(memory, (modal) => modal.name === modalName);
38
+ if (!data) return;
39
39
  memory.splice(index, 1, {
40
- ...content,
40
+ ...data,
41
41
  props: {
42
- ...content.props,
42
+ ...data.props,
43
43
  ...props
44
44
  }
45
45
  });
46
46
  setModals([...memory]);
47
47
  };
48
+ const setContent = (modalName, content) => {
49
+ var _a;
50
+ const index = _.findIndex(memory, (modal) => modal.name === modalName);
51
+ const data = _.find(memory, (modal) => modal.name === modalName);
52
+ if (!data) return;
53
+ memory.splice(index, 1, {
54
+ ...data,
55
+ props: {
56
+ ...data.props,
57
+ content: ((_a = data.props) == null ? void 0 : _a.content) ? {
58
+ ...data.props.content,
59
+ ...content
60
+ } : content
61
+ }
62
+ });
63
+ setModals([...memory]);
64
+ };
48
65
  const toggle = (modalName) => {
49
66
  var _a;
50
67
  const content = _.find(memory, (modal) => modal.name === modalName);
@@ -58,6 +75,7 @@ const ModalProviderContainer = ({ children }) => {
58
75
  add,
59
76
  remove,
60
77
  setProps,
78
+ setContent,
61
79
  toggle
62
80
  },
63
81
  children: [
@@ -11,5 +11,6 @@ export interface IModalContext {
11
11
  add: (config: IModalConfig | IModalConfig[]) => void;
12
12
  remove: (modalName: string | string[]) => void;
13
13
  setProps: (modalName: string, props: IModal) => void;
14
+ setContent: (modalName: string, props: IModal) => void;
14
15
  toggle: (modalName: string) => void;
15
16
  }
@@ -1,12 +1,10 @@
1
1
  export interface IRequestCredentials {
2
- limit?: number | "infinity";
2
+ take?: number;
3
3
  page?: number;
4
- fields?: string[];
4
+ select?: string[];
5
5
  relations?: string[];
6
- filters?: any;
7
- order?: {
8
- [field: string]: "asc" | "desc";
9
- };
6
+ where?: any;
7
+ order?: any;
10
8
  }
11
9
  export interface IRequestPagination {
12
10
  content: Array<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/client",
3
- "version": "1.4.367",
3
+ "version": "1.4.369",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",