@gustavo-valsechi/client 1.3.63 → 1.4.1
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/dist/components/types/avatar/index.js +1 -1
- package/dist/components/types/avatar/index.mjs +1 -1
- package/dist/components/types/block/styles.js +1 -1
- package/dist/components/types/block/styles.mjs +1 -1
- package/dist/components/types/table/index.js +2 -1
- package/dist/components/types/table/index.mjs +2 -1
- package/dist/components/types/table/modal/index.js +1 -1
- package/dist/components/types/table/modal/index.mjs +1 -1
- package/dist/contexts/modal/index.js +8 -1
- package/dist/contexts/modal/index.mjs +8 -1
- package/dist/interfaces/components/modal/index.d.ts +1 -1
- package/dist/interfaces/contexts/modal/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -47,7 +47,7 @@ function Avatar(props) {
|
|
|
47
47
|
}, [color, props.name]);
|
|
48
48
|
const name = () => {
|
|
49
49
|
const [first, secound] = import_lodash.default.split(props.name, " ") || [];
|
|
50
|
-
if (first && secound) return `${first.substring(0, 1)}
|
|
50
|
+
if (first && secound) return `${first.substring(0, 1)}${secound.substring(0, 1)}`;
|
|
51
51
|
if (first) return first.substring(0, 1);
|
|
52
52
|
return "IZ";
|
|
53
53
|
};
|
|
@@ -14,7 +14,7 @@ function Avatar(props) {
|
|
|
14
14
|
}, [color, props.name]);
|
|
15
15
|
const name = () => {
|
|
16
16
|
const [first, secound] = _.split(props.name, " ") || [];
|
|
17
|
-
if (first && secound) return `${first.substring(0, 1)}
|
|
17
|
+
if (first && secound) return `${first.substring(0, 1)}${secound.substring(0, 1)}`;
|
|
18
18
|
if (first) return first.substring(0, 1);
|
|
19
19
|
return "IZ";
|
|
20
20
|
};
|
|
@@ -60,7 +60,8 @@ function Table(props) {
|
|
|
60
60
|
const columnName = !import_lodash.default.isString(column) ? props.options.length - 1 === index ? "actions" : "" : column;
|
|
61
61
|
content[columnName] = columnName === "actions" ? (_b2 = data.row) == null ? void 0 : _b2.actions : renderRowContainer(props.content[key], data);
|
|
62
62
|
});
|
|
63
|
-
modal.
|
|
63
|
+
modal.toggle("table");
|
|
64
|
+
modal.setProps("table", { content });
|
|
64
65
|
};
|
|
65
66
|
const renderRowContainer = (data, option) => {
|
|
66
67
|
var _a2, _b2, _c2, _d2;
|
|
@@ -26,7 +26,8 @@ function Table(props) {
|
|
|
26
26
|
const columnName = !_.isString(column) ? props.options.length - 1 === index ? "actions" : "" : column;
|
|
27
27
|
content[columnName] = columnName === "actions" ? (_b2 = data.row) == null ? void 0 : _b2.actions : renderRowContainer(props.content[key], data);
|
|
28
28
|
});
|
|
29
|
-
modal.
|
|
29
|
+
modal.toggle("table");
|
|
30
|
+
modal.setProps("table", { content });
|
|
30
31
|
};
|
|
31
32
|
const renderRowContainer = (data, option) => {
|
|
32
33
|
var _a2, _b2, _c2, _d2;
|
|
@@ -44,7 +44,7 @@ function Modal(props) {
|
|
|
44
44
|
const content = import_lodash.default.omit(props.content, ["actions"]);
|
|
45
45
|
const actions = Object.values(import_lodash.default.pick(props.content, ["actions"]))[0];
|
|
46
46
|
const onClose = () => {
|
|
47
|
-
modal.
|
|
47
|
+
modal.toggle("table");
|
|
48
48
|
};
|
|
49
49
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
50
|
import__.Component,
|
|
@@ -11,7 +11,7 @@ function Modal(props) {
|
|
|
11
11
|
const content = _.omit(props.content, ["actions"]);
|
|
12
12
|
const actions = Object.values(_.pick(props.content, ["actions"]))[0];
|
|
13
13
|
const onClose = () => {
|
|
14
|
-
modal.
|
|
14
|
+
modal.toggle("table");
|
|
15
15
|
};
|
|
16
16
|
return /* @__PURE__ */ jsx(
|
|
17
17
|
Component,
|
|
@@ -64,6 +64,12 @@ const ModalProviderContainer = ({ children }) => {
|
|
|
64
64
|
settedModals.splice(index, 1, { ...content, props: { ...content.props, ...props } });
|
|
65
65
|
setModals(settedModals);
|
|
66
66
|
};
|
|
67
|
+
const toggle = (modalName) => {
|
|
68
|
+
var _a;
|
|
69
|
+
const content = import_lodash.default.find(modals, (modal) => modal.name === modalName);
|
|
70
|
+
if (!content) return;
|
|
71
|
+
setProps(modalName, { toggle: !((_a = content == null ? void 0 : content.props) == null ? void 0 : _a.toggle) });
|
|
72
|
+
};
|
|
67
73
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
68
74
|
ModalContext.Provider,
|
|
69
75
|
{
|
|
@@ -71,7 +77,8 @@ const ModalProviderContainer = ({ children }) => {
|
|
|
71
77
|
value: modals,
|
|
72
78
|
add,
|
|
73
79
|
remove,
|
|
74
|
-
setProps
|
|
80
|
+
setProps,
|
|
81
|
+
toggle
|
|
75
82
|
},
|
|
76
83
|
children: [
|
|
77
84
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.Container, { children: import_lodash.default.map(modals, (modal, index) => {
|
|
@@ -30,6 +30,12 @@ const ModalProviderContainer = ({ children }) => {
|
|
|
30
30
|
settedModals.splice(index, 1, { ...content, props: { ...content.props, ...props } });
|
|
31
31
|
setModals(settedModals);
|
|
32
32
|
};
|
|
33
|
+
const toggle = (modalName) => {
|
|
34
|
+
var _a;
|
|
35
|
+
const content = _.find(modals, (modal) => modal.name === modalName);
|
|
36
|
+
if (!content) return;
|
|
37
|
+
setProps(modalName, { toggle: !((_a = content == null ? void 0 : content.props) == null ? void 0 : _a.toggle) });
|
|
38
|
+
};
|
|
33
39
|
return /* @__PURE__ */ jsxs(
|
|
34
40
|
ModalContext.Provider,
|
|
35
41
|
{
|
|
@@ -37,7 +43,8 @@ const ModalProviderContainer = ({ children }) => {
|
|
|
37
43
|
value: modals,
|
|
38
44
|
add,
|
|
39
45
|
remove,
|
|
40
|
-
setProps
|
|
46
|
+
setProps,
|
|
47
|
+
toggle
|
|
41
48
|
},
|
|
42
49
|
children: [
|
|
43
50
|
/* @__PURE__ */ jsx(Container, { children: _.map(modals, (modal, index) => {
|