@gustavo-valsechi/client 1.3.63 → 1.4.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.
- package/dist/components/types/avatar/index.js +1 -1
- package/dist/components/types/avatar/index.mjs +1 -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/contexts/modal/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -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
|
};
|
|
@@ -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) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gustavo-valsechi/client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"build:remodel": "node scripts/remodel.js",
|
|
16
16
|
"build:assets": "node scripts/assets.js",
|
|
17
17
|
"build": "npm run clean && npm run build:js && npm run build:types && npm run build:assets && npm run build:remodel",
|
|
18
|
-
"commit": "npm run build && npm
|
|
18
|
+
"commit": "npm run build && npm publish --access public"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"react": "18.3.1",
|