@gustavo-valsechi/client 1.4.321 → 1.4.323

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.
@@ -49,11 +49,12 @@ function Table(props) {
49
49
  const modal = (0, import_contexts.useModal)();
50
50
  const loading = ((_a = props.loading) == null ? void 0 : _a.is) || props.loading;
51
51
  (0, import_react.useEffect)(() => {
52
+ if (!theme.content.isMobile) return;
52
53
  modal.add({ component: import_modal.default, name: "table" });
53
54
  return () => modal.remove("table");
54
- }, []);
55
+ }, [theme.content.isMobile]);
55
56
  const onShowLine = (key) => {
56
- if (window.innerWidth > Number(import_lodash.default.replace(theme.content.mobileMaxWidth, "px", ""))) return;
57
+ if (!theme.content.isMobile) return;
57
58
  let content = {};
58
59
  import_lodash.default.forEach(props.options, (data, index) => {
59
60
  var _a2, _b2;
@@ -81,7 +82,7 @@ function Table(props) {
81
82
  `,
82
83
  style,
83
84
  "data-tooltip": !((_g = option.row) == null ? void 0 : _g.actions) ? import_lodash.default.isFunction((_h = option.row) == null ? void 0 : _h.info) ? option.row.info(data, option) : (_i = option.row) == null ? void 0 : _i.info : "",
84
- "data-tooltip-props": '{"position":"bottom"}',
85
+ "data-tooltip-props": '{"position":"bottom","align":"start"}',
85
86
  children: renderRowContent(data, option)
86
87
  }
87
88
  );
@@ -15,11 +15,12 @@ function Table(props) {
15
15
  const modal = useModal();
16
16
  const loading = ((_a = props.loading) == null ? void 0 : _a.is) || props.loading;
17
17
  useEffect(() => {
18
+ if (!theme.content.isMobile) return;
18
19
  modal.add({ component: Modal, name: "table" });
19
20
  return () => modal.remove("table");
20
- }, []);
21
+ }, [theme.content.isMobile]);
21
22
  const onShowLine = (key) => {
22
- if (window.innerWidth > Number(_.replace(theme.content.mobileMaxWidth, "px", ""))) return;
23
+ if (!theme.content.isMobile) return;
23
24
  let content = {};
24
25
  _.forEach(props.options, (data, index) => {
25
26
  var _a2, _b2;
@@ -47,7 +48,7 @@ function Table(props) {
47
48
  `,
48
49
  style,
49
50
  "data-tooltip": !((_g = option.row) == null ? void 0 : _g.actions) ? _.isFunction((_h = option.row) == null ? void 0 : _h.info) ? option.row.info(data, option) : (_i = option.row) == null ? void 0 : _i.info : "",
50
- "data-tooltip-props": '{"position":"bottom"}',
51
+ "data-tooltip-props": '{"position":"bottom","align":"start"}',
51
52
  children: renderRowContent(data, option)
52
53
  }
53
54
  );
@@ -36,7 +36,7 @@ __reExport(contexts_exports, require("./tooltip"), module.exports);
36
36
  __reExport(contexts_exports, require("./modal"), module.exports);
37
37
  __reExport(contexts_exports, require("./target"), module.exports);
38
38
  function Context(props) {
39
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_theme.ThemeProvider, { theme: props.theme, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.IconProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tooltip.TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_target.TargetProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_modal.ModalProvider, { children: props.children }) }) }) }) });
39
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_theme.ThemeProvider, { theme: props.theme, common: props.commonTheme, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.IconProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tooltip.TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_target.TargetProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_modal.ModalProvider, { children: props.children }) }) }) }) });
40
40
  }
41
41
  // Annotate the CommonJS export names for ESM import in node:
42
42
  0 && (module.exports = {
@@ -12,7 +12,7 @@ export * from "./tooltip";
12
12
  export * from "./modal";
13
13
  export * from "./target";
14
14
  function Context(props) {
15
- return /* @__PURE__ */ jsx(ThemeProvider, { theme: props.theme, children: /* @__PURE__ */ jsx(IconProvider, { children: /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(TargetProvider, { children: /* @__PURE__ */ jsx(ModalProvider, { children: props.children }) }) }) }) });
15
+ return /* @__PURE__ */ jsx(ThemeProvider, { theme: props.theme, common: props.commonTheme, children: /* @__PURE__ */ jsx(IconProvider, { children: /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(TargetProvider, { children: /* @__PURE__ */ jsx(ModalProvider, { children: props.children }) }) }) }) });
16
16
  }
17
17
  export {
18
18
  Context as default
@@ -73,10 +73,10 @@ const ThemeProviderContainer = (props) => {
73
73
  value: {
74
74
  theme: theme || defaultTheme,
75
75
  setTheme,
76
- content: import_content.Themes[theme || defaultTheme],
76
+ content: { ...import_content.Themes[theme || defaultTheme], ...props.common || {} },
77
77
  Switcher: SwitcherComponent
78
78
  },
79
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_registry.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled_components.ThemeProvider, { theme: import_content.Themes[theme || defaultTheme], children: [
79
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_registry.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled_components.ThemeProvider, { theme: { ...import_content.Themes[theme || defaultTheme], ...props.common || {} }, children: [
80
80
  props.children,
81
81
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_global.default, {})
82
82
  ] }) })
@@ -39,10 +39,10 @@ const ThemeProviderContainer = (props) => {
39
39
  value: {
40
40
  theme: theme || defaultTheme,
41
41
  setTheme,
42
- content: Themes[theme || defaultTheme],
42
+ content: { ...Themes[theme || defaultTheme], ...props.common || {} },
43
43
  Switcher: SwitcherComponent
44
44
  },
45
- children: /* @__PURE__ */ jsx(StyledComponentsRegistry, { children: /* @__PURE__ */ jsxs(ThemeProvider, { theme: Themes[theme || defaultTheme], children: [
45
+ children: /* @__PURE__ */ jsx(StyledComponentsRegistry, { children: /* @__PURE__ */ jsxs(ThemeProvider, { theme: { ...Themes[theme || defaultTheme], ...props.common || {} }, children: [
46
46
  props.children,
47
47
  /* @__PURE__ */ jsx(GlobalStyles, {})
48
48
  ] }) })
@@ -9,4 +9,7 @@ export interface IBaseProvider {
9
9
  children: React.ReactNode;
10
10
  }
11
11
  export interface IContext extends IThemeProvider {
12
+ commonTheme?: {
13
+ [key: string]: any;
14
+ };
12
15
  }
@@ -1,6 +1,9 @@
1
1
  import { IBaseProvider } from "../..";
2
2
  export interface IThemeProvider extends IBaseProvider {
3
3
  theme?: keyof ITheme;
4
+ common?: {
5
+ [key: string]: any;
6
+ };
4
7
  }
5
8
  export interface ICommonTheme {
6
9
  secondary: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/client",
3
- "version": "1.4.321",
3
+ "version": "1.4.323",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",