@gustavo-valsechi/client 1.3.4 → 1.3.6

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 (134) hide show
  1. package/dist/components/index.d.ts +1 -1
  2. package/dist/components/index.js +10 -42
  3. package/dist/components/styles.js +3 -9
  4. package/dist/components/types/avatar/index.d.ts +1 -1
  5. package/dist/components/types/avatar/index.js +15 -21
  6. package/dist/components/types/avatar/styles.js +2 -8
  7. package/dist/components/types/badge/index.d.ts +1 -1
  8. package/dist/components/types/badge/index.js +7 -13
  9. package/dist/components/types/badge/styles.js +2 -8
  10. package/dist/components/types/block/index.d.ts +1 -1
  11. package/dist/components/types/block/index.js +6 -9
  12. package/dist/components/types/block/styles.js +3 -9
  13. package/dist/components/types/chart/index.d.ts +1 -1
  14. package/dist/components/types/chart/index.js +15 -21
  15. package/dist/components/types/chart/styles.js +2 -8
  16. package/dist/components/types/credit-card/assets/index.js +1 -3
  17. package/dist/components/types/credit-card/card/index.d.ts +1 -1
  18. package/dist/components/types/credit-card/card/index.js +12 -18
  19. package/dist/components/types/credit-card/card/styles.js +2 -8
  20. package/dist/components/types/credit-card/functions/index.d.ts +1 -1
  21. package/dist/components/types/credit-card/functions/index.js +6 -12
  22. package/dist/components/types/credit-card/functions/styles.js +2 -8
  23. package/dist/components/types/credit-card/index.d.ts +1 -1
  24. package/dist/components/types/credit-card/index.js +6 -12
  25. package/dist/components/types/credit-card/styles.js +2 -8
  26. package/dist/components/types/credit-card/tools/index.js +8 -15
  27. package/dist/components/types/form/index.d.ts +1 -1
  28. package/dist/components/types/form/index.js +24 -56
  29. package/dist/components/types/form/styles.js +2 -8
  30. package/dist/components/types/form/types/button/index.d.ts +1 -1
  31. package/dist/components/types/form/types/button/index.js +6 -12
  32. package/dist/components/types/form/types/button/loading/index.js +4 -7
  33. package/dist/components/types/form/types/button/loading/styles.js +2 -8
  34. package/dist/components/types/form/types/button/styles.js +2 -8
  35. package/dist/components/types/form/types/datetime/index.d.ts +1 -1
  36. package/dist/components/types/form/types/datetime/index.js +7 -13
  37. package/dist/components/types/form/types/datetime/styles.js +2 -8
  38. package/dist/components/types/form/types/file/index.d.ts +1 -1
  39. package/dist/components/types/form/types/file/index.js +8 -11
  40. package/dist/components/types/form/types/file/styles.js +2 -8
  41. package/dist/components/types/form/types/index.js +7 -23
  42. package/dist/components/types/form/types/input/index.d.ts +1 -1
  43. package/dist/components/types/form/types/input/index.js +9 -15
  44. package/dist/components/types/form/types/input/styles.js +2 -8
  45. package/dist/components/types/form/types/label/index.d.ts +1 -1
  46. package/dist/components/types/form/types/label/index.js +4 -7
  47. package/dist/components/types/form/types/label/styles.js +2 -8
  48. package/dist/components/types/form/types/select/index.d.ts +1 -1
  49. package/dist/components/types/form/types/select/index.js +9 -15
  50. package/dist/components/types/form/types/select/styles.js +2 -8
  51. package/dist/components/types/form/types/textarea/index.d.ts +1 -1
  52. package/dist/components/types/form/types/textarea/index.js +7 -13
  53. package/dist/components/types/form/types/textarea/styles.js +2 -8
  54. package/dist/components/types/index.js +11 -27
  55. package/dist/components/types/loading/app/index.d.ts +1 -1
  56. package/dist/components/types/loading/app/index.js +5 -8
  57. package/dist/components/types/loading/app/styles.js +2 -8
  58. package/dist/components/types/loading/bar/index.d.ts +1 -1
  59. package/dist/components/types/loading/bar/index.js +4 -7
  60. package/dist/components/types/loading/bar/styles.js +2 -8
  61. package/dist/components/types/loading/index.js +2 -18
  62. package/dist/components/types/logo/index.d.ts +1 -1
  63. package/dist/components/types/logo/index.js +4 -7
  64. package/dist/components/types/logo/styles.js +2 -8
  65. package/dist/components/types/lottie/animations/index.js +2 -7
  66. package/dist/components/types/lottie/index.d.ts +1 -1
  67. package/dist/components/types/lottie/index.js +8 -14
  68. package/dist/components/types/lottie/styles.js +2 -8
  69. package/dist/components/types/modal/index.d.ts +1 -1
  70. package/dist/components/types/modal/index.js +9 -15
  71. package/dist/components/types/modal/styles.js +2 -8
  72. package/dist/components/types/table/index.d.ts +1 -1
  73. package/dist/components/types/table/index.js +34 -54
  74. package/dist/components/types/table/modal/actions.js +3 -5
  75. package/dist/components/types/table/modal/index.d.ts +1 -1
  76. package/dist/components/types/table/modal/index.js +14 -20
  77. package/dist/components/types/table/modal/styles.js +2 -8
  78. package/dist/components/types/table/paginate/index.d.ts +1 -1
  79. package/dist/components/types/table/paginate/index.js +10 -16
  80. package/dist/components/types/table/paginate/styles.js +2 -8
  81. package/dist/components/types/table/styles.js +2 -8
  82. package/dist/contexts/icon/assets/brands/index.js +1 -3
  83. package/dist/contexts/icon/assets/index.js +7 -12
  84. package/dist/contexts/icon/assets/regular/index.js +1 -3
  85. package/dist/contexts/icon/assets/solid/index.js +1 -3
  86. package/dist/contexts/icon/index.d.ts +1 -1
  87. package/dist/contexts/icon/index.js +18 -25
  88. package/dist/contexts/icon/styles.js +2 -8
  89. package/dist/contexts/index.js +4 -20
  90. package/dist/contexts/modal/index.d.ts +1 -1
  91. package/dist/contexts/modal/index.js +19 -26
  92. package/dist/contexts/modal/styles.js +2 -8
  93. package/dist/contexts/theme/content.d.ts +1 -1
  94. package/dist/contexts/theme/content.js +4 -7
  95. package/dist/contexts/theme/index.d.ts +1 -1
  96. package/dist/contexts/theme/index.js +17 -21
  97. package/dist/contexts/theme/styles.js +2 -8
  98. package/dist/contexts/tooltip/index.js +12 -19
  99. package/dist/contexts/tooltip/styles.js +2 -8
  100. package/dist/index.js +4 -20
  101. package/dist/interfaces/components/avatar/index.js +1 -2
  102. package/dist/interfaces/components/badge/index.js +1 -2
  103. package/dist/interfaces/components/block/index.d.ts +1 -1
  104. package/dist/interfaces/components/block/index.js +1 -2
  105. package/dist/interfaces/components/chart/index.js +1 -2
  106. package/dist/interfaces/components/credit-card/index.js +1 -2
  107. package/dist/interfaces/components/form/button/index.js +1 -2
  108. package/dist/interfaces/components/form/datetime/index.js +1 -2
  109. package/dist/interfaces/components/form/file/index.js +1 -2
  110. package/dist/interfaces/components/form/index.js +7 -23
  111. package/dist/interfaces/components/form/input/index.js +1 -2
  112. package/dist/interfaces/components/form/label/index.js +1 -2
  113. package/dist/interfaces/components/form/select/index.js +1 -2
  114. package/dist/interfaces/components/form/textarea/index.js +1 -2
  115. package/dist/interfaces/components/index.js +11 -27
  116. package/dist/interfaces/components/loading/app/index.js +1 -2
  117. package/dist/interfaces/components/loading/bar/index.js +1 -2
  118. package/dist/interfaces/components/loading/index.js +2 -18
  119. package/dist/interfaces/components/logo/index.js +1 -2
  120. package/dist/interfaces/components/lottie/index.js +1 -2
  121. package/dist/interfaces/components/modal/index.d.ts +1 -1
  122. package/dist/interfaces/components/modal/index.js +1 -2
  123. package/dist/interfaces/components/table/index.js +1 -17
  124. package/dist/interfaces/components/table/paginate/index.js +1 -2
  125. package/dist/interfaces/contexts/icon/index.js +1 -2
  126. package/dist/interfaces/contexts/index.js +4 -20
  127. package/dist/interfaces/contexts/modal/index.js +1 -2
  128. package/dist/interfaces/contexts/theme/index.js +1 -2
  129. package/dist/interfaces/contexts/tooltip/index.js +1 -2
  130. package/dist/interfaces/index.js +2 -18
  131. package/dist/styled.d.ts +1 -1
  132. package/dist/styled.js +1 -3
  133. package/dist/tsup.config.js +2 -4
  134. package/package.json +1 -1
@@ -1,10 +1,7 @@
1
1
  "use client";
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.LoadingApp = LoadingApp;
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const styles_1 = require("./styles");
7
- const logo_1 = require("../../logo");
8
- function LoadingApp(props) {
9
- return ((0, jsx_runtime_1.jsx)(styles_1.Container, { ...props, children: (0, jsx_runtime_1.jsx)(logo_1.Logo, { className: "iz-loading-logo", onlyPrefix: true }) }));
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Container } from "./styles";
4
+ import { Logo } from "../../logo";
5
+ export function LoadingApp(props) {
6
+ return (_jsx(Container, { ...props, children: _jsx(Logo, { className: "iz-loading-logo", onlyPrefix: true }) }));
10
7
  }
@@ -1,12 +1,6 @@
1
1
  "use client";
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.Container = void 0;
8
- const styled_components_1 = __importDefault(require("styled-components"));
9
- exports.Container = styled_components_1.default.div `
2
+ import styled from "styled-components";
3
+ export const Container = styled.div `
10
4
  width: ${({ initialization }) => initialization ? "100vw" : "100%"};
11
5
  height: ${({ initialization }) => initialization ? "100vh" : "calc(100vh - 15rem)"};
12
6
  display: flex;
@@ -1,2 +1,2 @@
1
- import { ILoadingBar } from "interfaces";
1
+ import { ILoadingBar } from "@interfaces";
2
2
  export declare function LoadingBar(props: ILoadingBar): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,6 @@
1
1
  "use client";
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.LoadingBar = LoadingBar;
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const styles_1 = require("./styles");
7
- function LoadingBar(props) {
8
- return (0, jsx_runtime_1.jsx)(styles_1.Container, { ...props });
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Container } from "./styles";
4
+ export function LoadingBar(props) {
5
+ return _jsx(Container, { ...props });
9
6
  }
@@ -1,12 +1,6 @@
1
1
  "use client";
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.Container = void 0;
8
- const styled_components_1 = __importDefault(require("styled-components"));
9
- exports.Container = styled_components_1.default.div `
2
+ import styled from "styled-components";
3
+ export const Container = styled.div `
10
4
  border-radius: ${(props) => props.borderRadius || "10px"};
11
5
  height: ${(props) => props.height || "100%"};
12
6
  width: ${(props) => props.width || "100%"};
@@ -1,18 +1,2 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./bar"), exports);
18
- __exportStar(require("./app"), exports);
1
+ export * from "./bar";
2
+ export * from "./app";
@@ -1,2 +1,2 @@
1
- import { ILogo } from "interfaces";
1
+ import { ILogo } from "@interfaces";
2
2
  export declare function Logo(props: ILogo): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,6 @@
1
1
  "use client";
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Logo = Logo;
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const styles_1 = require("./styles");
7
- function Logo(props) {
8
- return ((0, jsx_runtime_1.jsxs)(styles_1.Container, { ...props, children: [(0, jsx_runtime_1.jsx)("label", { children: "IZ" }), !props.onlyPrefix && (0, jsx_runtime_1.jsx)("label", { children: "Way" })] }));
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Container } from "./styles";
4
+ export function Logo(props) {
5
+ return (_jsxs(Container, { ...props, children: [_jsx("label", { children: "IZ" }), !props.onlyPrefix && _jsx("label", { children: "Way" })] }));
9
6
  }
@@ -1,12 +1,6 @@
1
1
  "use client";
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.Container = void 0;
8
- const styled_components_1 = __importDefault(require("styled-components"));
9
- exports.Container = styled_components_1.default.div `
2
+ import styled from "styled-components";
3
+ export const Container = styled.div `
10
4
  display: flex;
11
5
  align-items: center;
12
6
  justify-content: center;
@@ -1,7 +1,2 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const loader_json_1 = __importDefault(require("./loader.json"));
7
- exports.default = { loader: loader_json_1.default };
1
+ import loader from "./loader.json";
2
+ export default { loader };
@@ -1,2 +1,2 @@
1
- import { ILottie } from "interfaces";
1
+ import { ILottie } from "@interfaces";
2
2
  export declare function Lottie(props: ILottie): import("react/jsx-runtime").JSX.Element;
@@ -1,22 +1,16 @@
1
1
  "use client";
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.Lottie = Lottie;
8
- const jsx_runtime_1 = require("react/jsx-runtime");
9
- const styles_1 = require("./styles");
10
- const react_lottie_1 = __importDefault(require("react-lottie"));
11
- const LottieComponent = react_lottie_1.default;
12
- const animations_1 = __importDefault(require("./animations"));
13
- function Lottie(props) {
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Container } from "./styles";
4
+ import LottieReact from "react-lottie";
5
+ const LottieComponent = LottieReact;
6
+ import animations from "./animations";
7
+ export function Lottie(props) {
14
8
  const getAnimation = () => {
15
9
  let animation;
16
10
  for (const propName of Object.keys(props)) {
17
11
  if (animation)
18
12
  continue;
19
- animation = animations_1.default[propName];
13
+ animation = animations[propName];
20
14
  }
21
15
  return animation;
22
16
  };
@@ -30,5 +24,5 @@ function Lottie(props) {
30
24
  path: props.src,
31
25
  animationData: getAnimation(),
32
26
  };
33
- return ((0, jsx_runtime_1.jsx)(styles_1.Container, { ...props, children: (0, jsx_runtime_1.jsx)(LottieComponent, { width: props.size || 180, height: props.size || 180, options: defaultOptions }) }));
27
+ return (_jsx(Container, { ...props, children: _jsx(LottieComponent, { width: props.size || 180, height: props.size || 180, options: defaultOptions }) }));
34
28
  }
@@ -1,12 +1,6 @@
1
1
  "use client";
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.Container = void 0;
8
- const styled_components_1 = __importDefault(require("styled-components"));
9
- exports.Container = styled_components_1.default.div `
2
+ import styled from "styled-components";
3
+ export const Container = styled.div `
10
4
  display: flex;
11
5
  align-items: center;
12
6
  justify-content: center;
@@ -1,2 +1,2 @@
1
- import { IModal } from "interfaces";
1
+ import { IModal } from "@interfaces";
2
2
  export declare function Modal(props: IModal): import("react/jsx-runtime").JSX.Element;
@@ -1,18 +1,12 @@
1
1
  "use client";
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.Modal = Modal;
8
- const jsx_runtime_1 = require("react/jsx-runtime");
9
- const styles_1 = require("./styles");
10
- const __1 = require("../..");
11
- const lodash_1 = __importDefault(require("lodash"));
12
- function Modal(props) {
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Container } from "./styles";
4
+ import { Button } from "../..";
5
+ import _ from "lodash";
6
+ export function Modal(props) {
13
7
  var _a, _b, _c;
14
- return ((0, jsx_runtime_1.jsxs)(styles_1.Container, { ...props, position: props.position || "center", children: [(0, jsx_runtime_1.jsx)("div", { className: "iz-modal-back", onClick: props.onClose }), (0, jsx_runtime_1.jsxs)("div", { className: "iz-modal-container", children: [(!!props.title || !!props.header) &&
15
- (0, jsx_runtime_1.jsxs)("div", { className: "iz-modal-header", children: [(0, jsx_runtime_1.jsxs)("div", { className: "iz-modal-title", children: [((_a = props.header) === null || _a === void 0 ? void 0 : _a.icon) && (0, jsx_runtime_1.jsx)("i", { "aria-hidden": true, className: (_b = props.header) === null || _b === void 0 ? void 0 : _b.icon }), (0, jsx_runtime_1.jsx)("span", { children: props.title || ((_c = props.header) === null || _c === void 0 ? void 0 : _c.title) })] }), (0, jsx_runtime_1.jsx)("i", { "aria-hidden": true, className: "fa-solid fa-xmark", onClick: props.onClose })] }), (0, jsx_runtime_1.jsxs)("div", { className: "iz-modal-content", children: [props.onClose && !props.title && !props.header && !props.noCloseIcon &&
16
- (0, jsx_runtime_1.jsx)("div", { className: "iz-modal-close", onClick: props.onClose, children: (0, jsx_runtime_1.jsx)("i", { "aria-hidden": true, className: "fa-solid fa-xmark" }) }), props.children] }), props.buttons &&
17
- (0, jsx_runtime_1.jsx)("div", { className: "iz-modal-buttons", children: lodash_1.default.map(props.buttons, (button, index) => (0, jsx_runtime_1.jsx)(__1.Button, { ...button }, index)) })] })] }));
8
+ return (_jsxs(Container, { ...props, position: props.position || "center", children: [_jsx("div", { className: "iz-modal-back", onClick: props.onClose }), _jsxs("div", { className: "iz-modal-container", children: [(!!props.title || !!props.header) &&
9
+ _jsxs("div", { className: "iz-modal-header", children: [_jsxs("div", { className: "iz-modal-title", children: [((_a = props.header) === null || _a === void 0 ? void 0 : _a.icon) && _jsx("i", { "aria-hidden": true, className: (_b = props.header) === null || _b === void 0 ? void 0 : _b.icon }), _jsx("span", { children: props.title || ((_c = props.header) === null || _c === void 0 ? void 0 : _c.title) })] }), _jsx("i", { "aria-hidden": true, className: "fa-solid fa-xmark", onClick: props.onClose })] }), _jsxs("div", { className: "iz-modal-content", children: [props.onClose && !props.title && !props.header && !props.noCloseIcon &&
10
+ _jsx("div", { className: "iz-modal-close", onClick: props.onClose, children: _jsx("i", { "aria-hidden": true, className: "fa-solid fa-xmark" }) }), props.children] }), props.buttons &&
11
+ _jsx("div", { className: "iz-modal-buttons", children: _.map(props.buttons, (button, index) => _jsx(Button, { ...button }, index)) })] })] }));
18
12
  }
@@ -1,12 +1,6 @@
1
1
  "use client";
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.Container = void 0;
8
- const styled_components_1 = __importDefault(require("styled-components"));
9
- exports.Container = styled_components_1.default.div `
2
+ import styled from "styled-components";
3
+ export const Container = styled.div `
10
4
  width: 100%;
11
5
  height: 100%;
12
6
  top: 0;
@@ -1,3 +1,3 @@
1
- import { ITable } from "interfaces";
1
+ import { ITable } from "@interfaces";
2
2
  export * from "./paginate";
3
3
  export declare function Table(props: ITable): import("react/jsx-runtime").JSX.Element;
@@ -1,113 +1,93 @@
1
1
  "use client";
2
- "use strict";
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
- };
17
- var __importDefault = (this && this.__importDefault) || function (mod) {
18
- return (mod && mod.__esModule) ? mod : { "default": mod };
19
- };
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.Table = Table;
22
- const jsx_runtime_1 = require("react/jsx-runtime");
23
- const react_1 = require("react");
24
- const styles_1 = require("./styles");
25
- const bar_1 = require("../loading/bar");
26
- const paginate_1 = require("./paginate");
27
- const contexts_1 = require("contexts");
28
- const lodash_1 = __importDefault(require("lodash"));
29
- const modal_1 = __importDefault(require("./modal"));
30
- __exportStar(require("./paginate"), exports);
31
- function Table(props) {
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect } from "react";
4
+ import { Container } from "./styles";
5
+ import { LoadingBar } from "../loading/bar";
6
+ import { Paginate } from "./paginate";
7
+ import { useModal, useTheme } from "@contexts";
8
+ import _ from "lodash";
9
+ import Modal from "./modal";
10
+ export * from "./paginate";
11
+ export function Table(props) {
32
12
  var _a, _b, _c, _d, _e, _f;
33
- const theme = (0, contexts_1.useTheme)();
34
- const modal = (0, contexts_1.useModal)();
13
+ const theme = useTheme();
14
+ const modal = useModal();
35
15
  const loading = ((_a = props.loading) === null || _a === void 0 ? void 0 : _a.is) || props.loading;
36
- (0, react_1.useEffect)(() => {
37
- modal.add({ component: modal_1.default, name: "table" });
16
+ useEffect(() => {
17
+ modal.add({ component: Modal, name: "table" });
38
18
  return () => modal.remove("table");
39
19
  }, []);
40
20
  const onShowLine = (key) => {
41
- if (window.innerWidth > Number(lodash_1.default.replace(theme.content.mobileMaxWidth, "px", "")))
21
+ if (window.innerWidth > Number(_.replace(theme.content.mobileMaxWidth, "px", "")))
42
22
  return;
43
23
  let content = {};
44
- lodash_1.default.forEach(props.options, (data, index) => {
24
+ _.forEach(props.options, (data, index) => {
45
25
  var _a, _b;
46
26
  const column = ((_a = data.column) === null || _a === void 0 ? void 0 : _a.name) || data.column;
47
- const columnName = !lodash_1.default.isString(column) ? props.options.length - 1 === index ? "actions" : "" : column;
27
+ const columnName = !_.isString(column) ? props.options.length - 1 === index ? "actions" : "" : column;
48
28
  content[columnName] = columnName === "actions" ? (_b = data.row) === null || _b === void 0 ? void 0 : _b.actions : renderRowContainer(props.content[key], data);
49
29
  });
50
30
  modal.setProps("table", { toggle: true, content });
51
31
  };
52
32
  const renderRowContainer = (data, option) => {
53
33
  var _a, _b, _c, _d;
54
- return ((0, jsx_runtime_1.jsx)("div", { className: `
34
+ return (_jsx("div", { className: `
55
35
  iz-table-content
56
36
  ${((_a = option.row) === null || _a === void 0 ? void 0 : _a.actions) ? "iz-table-action" : ""}
57
37
  ${((_b = option.row) === null || _b === void 0 ? void 0 : _b.icon) ? "iz-table-identifier" : ""}
58
- `, style: lodash_1.default.isFunction((_c = option.row) === null || _c === void 0 ? void 0 : _c.style)
38
+ `, style: _.isFunction((_c = option.row) === null || _c === void 0 ? void 0 : _c.style)
59
39
  ? option.row.style(data, option)
60
40
  : (_d = option.row) === null || _d === void 0 ? void 0 : _d.style, children: renderRowContent(data, option) }));
61
41
  };
62
42
  const renderRowContent = (data, option) => {
63
43
  var _a, _b, _c, _d, _e;
64
44
  if (!!((_a = option.row) === null || _a === void 0 ? void 0 : _a.actions)) {
65
- return ((0, jsx_runtime_1.jsx)("div", { className: "iz-table-actions", children: lodash_1.default.map((_b = option.row) === null || _b === void 0 ? void 0 : _b.actions, (action, index) => renderButton(action, data, index)) }));
45
+ return (_jsx("div", { className: "iz-table-actions", children: _.map((_b = option.row) === null || _b === void 0 ? void 0 : _b.actions, (action, index) => renderButton(action, data, index)) }));
66
46
  }
67
47
  if ((_c = option.row) === null || _c === void 0 ? void 0 : _c.icon) {
68
- return ((0, jsx_runtime_1.jsx)("div", { className: "iz-table-icon", children: (0, jsx_runtime_1.jsx)("i", { "aria-hidden": true, className: lodash_1.default.isFunction((_d = option.row) === null || _d === void 0 ? void 0 : _d.icon)
48
+ return (_jsx("div", { className: "iz-table-icon", children: _jsx("i", { "aria-hidden": true, className: _.isFunction((_d = option.row) === null || _d === void 0 ? void 0 : _d.icon)
69
49
  ? option.row.icon(data) || "fa-solid fa-circle-user"
70
50
  : ((_e = option.row) === null || _e === void 0 ? void 0 : _e.icon) || "fa-solid fa-circle-user" }) }));
71
51
  }
72
52
  return renderRowText(data, option);
73
53
  };
74
54
  const renderButton = (action, data, index) => {
75
- return ((0, jsx_runtime_1.jsx)("button", { className: `iz-table-button ${lodash_1.default.includes(action.icon, "trash") ? "negative" : ""}`, onClick: () => action.function ? action.function(data) : null, disabled: action.disabled, "data-tooltip": action.tooltip, children: (0, jsx_runtime_1.jsx)("i", { "aria-hidden": true, className: action.icon || "fa-solid fa-eye" }) }, index));
55
+ return (_jsx("button", { className: `iz-table-button ${_.includes(action.icon, "trash") ? "negative" : ""}`, onClick: () => action.function ? action.function(data) : null, disabled: action.disabled, "data-tooltip": action.tooltip, children: _jsx("i", { "aria-hidden": true, className: action.icon || "fa-solid fa-eye" }) }, index));
76
56
  };
77
57
  const renderRowText = (data, option) => {
78
58
  const row = option.row || {};
79
59
  const content = data[row.name] || data;
80
60
  let body;
81
61
  while (!body) {
82
- if (lodash_1.default.isString(row))
62
+ if (_.isString(row))
83
63
  body = data[row];
84
- if (lodash_1.default.isString(content))
64
+ if (_.isString(content))
85
65
  body = content;
86
- if (lodash_1.default.isFunction(row.mask))
66
+ if (_.isFunction(row.mask))
87
67
  body = row.mask(content);
88
- if (lodash_1.default.isFunction(row.custom))
68
+ if (_.isFunction(row.custom))
89
69
  body = row.custom(content);
90
70
  body = body !== null && body !== void 0 ? body : "---";
91
71
  }
92
- return ((0, jsx_runtime_1.jsx)("div", { className: "iz-table-content-elipse", title: lodash_1.default.isString(body) ? body : "", children: body }));
72
+ return (_jsx("div", { className: "iz-table-content-elipse", title: _.isString(body) ? body : "", children: body }));
93
73
  };
94
- return ((0, jsx_runtime_1.jsxs)(styles_1.Container, { notFound: !((_b = props.content) === null || _b === void 0 ? void 0 : _b.length) && !props.loading, children: [(0, jsx_runtime_1.jsx)("div", { className: "iz-table-container", children: (0, jsx_runtime_1.jsxs)("table", { children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsx)("tr", { children: lodash_1.default.map(props.options, (option, index) => {
74
+ return (_jsxs(Container, { notFound: !((_b = props.content) === null || _b === void 0 ? void 0 : _b.length) && !props.loading, children: [_jsx("div", { className: "iz-table-container", children: _jsxs("table", { children: [_jsx("thead", { children: _jsx("tr", { children: _.map(props.options, (option, index) => {
95
75
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
96
- return (0, jsx_runtime_1.jsx)("th", { style: (_a = option.column) === null || _a === void 0 ? void 0 : _a.style, children: (0, jsx_runtime_1.jsx)("div", { className: `iz-table-content ${((_b = option.column) === null || _b === void 0 ? void 0 : _b.action)
76
+ return _jsx("th", { style: (_a = option.column) === null || _a === void 0 ? void 0 : _a.style, children: _jsx("div", { className: `iz-table-content ${((_b = option.column) === null || _b === void 0 ? void 0 : _b.action)
97
77
  ? `iz-table-action ${((_d = (_c = option.column) === null || _c === void 0 ? void 0 : _c.action) === null || _d === void 0 ? void 0 : _d.position)
98
78
  ? (_f = (_e = option.column) === null || _e === void 0 ? void 0 : _e.action) === null || _f === void 0 ? void 0 : _f.position
99
79
  : ""}`
100
80
  : ""}`, children: !!((_g = option.column) === null || _g === void 0 ? void 0 : _g.action)
101
81
  ? renderButton(option.column.action)
102
- : lodash_1.default.isString(((_h = option.column) === null || _h === void 0 ? void 0 : _h.name) || option.column) ? ((_j = option.column) === null || _j === void 0 ? void 0 : _j.name) || option.column : "" }) }, index);
103
- }) }) }), (0, jsx_runtime_1.jsx)("tbody", { children: loading
104
- ? lodash_1.default.map(((_c = props.loading) === null || _c === void 0 ? void 0 : _c.items) || [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], (data, key) => (0, jsx_runtime_1.jsx)("tr", { children: lodash_1.default.map(props.options, (data, index) => {
82
+ : _.isString(((_h = option.column) === null || _h === void 0 ? void 0 : _h.name) || option.column) ? ((_j = option.column) === null || _j === void 0 ? void 0 : _j.name) || option.column : "" }) }, index);
83
+ }) }) }), _jsx("tbody", { children: loading
84
+ ? _.map(((_c = props.loading) === null || _c === void 0 ? void 0 : _c.items) || [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], (data, key) => _jsx("tr", { children: _.map(props.options, (data, index) => {
105
85
  var _a;
106
- return ((0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(bar_1.LoadingBar, { height: "2.5rem", borderRadius: index === 0
86
+ return (_jsx("td", { children: _jsx(LoadingBar, { height: "2.5rem", borderRadius: index === 0
107
87
  ? "5px 0 0 5px"
108
88
  : ((_a = props.options) === null || _a === void 0 ? void 0 : _a.length) - 1 === index
109
89
  ? "0 5px 5px 0"
110
90
  : "0", margin: key === 0 ? "1.5rem 0 0" : ".5rem 0 0" }) }, index));
111
91
  }) }, key))
112
- : lodash_1.default.map(props.content, (data, key) => (0, jsx_runtime_1.jsx)("tr", { children: lodash_1.default.map(props.options, (option, index) => ((0, jsx_runtime_1.jsx)("td", { onClick: () => index < 2 ? onShowLine(key) : null, children: renderRowContainer(data, option) }, index))) }, key)) })] }) }), !((_d = props.content) === null || _d === void 0 ? void 0 : _d.length) && !props.loading && ((0, jsx_runtime_1.jsxs)("div", { className: "iz-table-not-found", children: [(0, jsx_runtime_1.jsx)("p", { children: ((_e = props.notFound) === null || _e === void 0 ? void 0 : _e.title) || "Nenhuma campanha encontrado" }), (0, jsx_runtime_1.jsx)("p", { children: ((_f = props.notFound) === null || _f === void 0 ? void 0 : _f.message) || "Envie uma campanha de marketing para aparecer algum registro" })] })), !!props.paginate && (0, jsx_runtime_1.jsx)(paginate_1.Paginate, { ...props.paginate })] }));
92
+ : _.map(props.content, (data, key) => _jsx("tr", { children: _.map(props.options, (option, index) => (_jsx("td", { onClick: () => index < 2 ? onShowLine(key) : null, children: renderRowContainer(data, option) }, index))) }, key)) })] }) }), !((_d = props.content) === null || _d === void 0 ? void 0 : _d.length) && !props.loading && (_jsxs("div", { className: "iz-table-not-found", children: [_jsx("p", { children: ((_e = props.notFound) === null || _e === void 0 ? void 0 : _e.title) || "Nenhuma campanha encontrado" }), _jsx("p", { children: ((_f = props.notFound) === null || _f === void 0 ? void 0 : _f.message) || "Envie uma campanha de marketing para aparecer algum registro" })] })), !!props.paginate && _jsx(Paginate, { ...props.paginate })] }));
113
93
  }
@@ -1,8 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const content_1 = require("contexts/theme/content");
1
+ import { CommonTheme } from "@contexts/theme/content";
4
2
  const actionConfig = {
5
3
  "fa-solid fa-pen-to-square": { label: "editar" },
6
- "fa-solid fa-trash-can": { label: "remover", color: content_1.CommonTheme.negative },
4
+ "fa-solid fa-trash-can": { label: "remover", color: CommonTheme.negative },
7
5
  };
8
- exports.default = actionConfig;
6
+ export default actionConfig;
@@ -1,2 +1,2 @@
1
- import { IModal } from "interfaces";
1
+ import { IModal } from "@interfaces";
2
2
  export default function Modal(props: IModal): import("react/jsx-runtime").JSX.Element;
@@ -1,33 +1,27 @@
1
1
  "use client";
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.default = Modal;
8
- const jsx_runtime_1 = require("react/jsx-runtime");
9
- const styles_1 = require("./styles");
10
- const styles_2 = require("../styles");
11
- const __1 = require("../../..");
12
- const contexts_1 = require("contexts");
13
- const lodash_1 = __importDefault(require("lodash"));
14
- const actions_1 = __importDefault(require("./actions"));
15
- function Modal(props) {
16
- const modal = (0, contexts_1.useModal)();
17
- const content = lodash_1.default.omit(props.content, ["actions"]);
18
- const actions = Object.values(lodash_1.default.pick(props.content, ["actions"]))[0];
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Content } from "./styles";
4
+ import { Container } from "../styles";
5
+ import { Component } from "../../..";
6
+ import { useModal } from "@contexts";
7
+ import _ from "lodash";
8
+ import actionConfig from "./actions";
9
+ export default function Modal(props) {
10
+ const modal = useModal();
11
+ const content = _.omit(props.content, ["actions"]);
12
+ const actions = Object.values(_.pick(props.content, ["actions"]))[0];
19
13
  const onClose = () => {
20
14
  modal.setProps("table", { toggle: false });
21
15
  };
22
- return ((0, jsx_runtime_1.jsx)(__1.Component, { content: [{
16
+ return (_jsx(Component, { content: [{
23
17
  type: "Modal",
24
18
  props: {
25
19
  toggle: props.toggle,
26
20
  onClose,
27
- children: ((0, jsx_runtime_1.jsx)(styles_2.Container, { children: (0, jsx_runtime_1.jsxs)(styles_1.Content, { children: [(0, jsx_runtime_1.jsx)("div", { className: "iz-table-modal-title", children: "Conte\u00FAdo" }), (0, jsx_runtime_1.jsx)("div", { className: "iz-table-modal-content", children: (0, jsx_runtime_1.jsx)("ul", { children: lodash_1.default.map(content, (value, key) => (0, jsx_runtime_1.jsxs)("li", { children: [!!key && (0, jsx_runtime_1.jsx)("div", { className: "iz-table-modal-column", children: key }), (0, jsx_runtime_1.jsx)("div", { className: "iz-table-modal-row", children: value })] }, key)) }) }), (0, jsx_runtime_1.jsx)("div", { className: "iz-table-modal-actions", children: (0, jsx_runtime_1.jsx)(__1.Component, { content: lodash_1.default.concat(lodash_1.default.map(actions, (data) => ({
21
+ children: (_jsx(Container, { children: _jsxs(Content, { children: [_jsx("div", { className: "iz-table-modal-title", children: "Conte\u00FAdo" }), _jsx("div", { className: "iz-table-modal-content", children: _jsx("ul", { children: _.map(content, (value, key) => _jsxs("li", { children: [!!key && _jsx("div", { className: "iz-table-modal-column", children: key }), _jsx("div", { className: "iz-table-modal-row", children: value })] }, key)) }) }), _jsx("div", { className: "iz-table-modal-actions", children: _jsx(Component, { content: _.concat(_.map(actions, (data) => ({
28
22
  type: "Button",
29
23
  props: {
30
- ...actions_1.default[data.icon] || {},
24
+ ...actionConfig[data.icon] || {},
31
25
  onClick: data.function
32
26
  }
33
27
  })), {
@@ -1,12 +1,6 @@
1
1
  "use client";
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.Content = void 0;
8
- const styled_components_1 = __importDefault(require("styled-components"));
9
- exports.Content = styled_components_1.default.div `
2
+ import styled from "styled-components";
3
+ export const Content = styled.div `
10
4
  padding: 1.5rem;
11
5
  display: flex;
12
6
  flex-direction: column;
@@ -1,2 +1,2 @@
1
- import { IPaginate } from "interfaces";
1
+ import { IPaginate } from "@interfaces";
2
2
  export declare function Paginate(props: IPaginate): false | import("react/jsx-runtime").JSX.Element;
@@ -1,14 +1,8 @@
1
1
  "use client";
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.Paginate = Paginate;
8
- const jsx_runtime_1 = require("react/jsx-runtime");
9
- const styles_1 = require("./styles");
10
- const lodash_1 = __importDefault(require("lodash"));
11
- function Paginate(props) {
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Container } from "./styles";
4
+ import _ from "lodash";
5
+ export function Paginate(props) {
12
6
  const pages = () => {
13
7
  const offset = Number(props.page.value) - 4;
14
8
  let page = offset > 0 ? offset + 1 : 1;
@@ -17,20 +11,20 @@ function Paginate(props) {
17
11
  pages.push(page);
18
12
  page++;
19
13
  }
20
- pages = lodash_1.default.slice(pages, 0, 5);
14
+ pages = _.slice(pages, 0, 5);
21
15
  if ((Number(props.page.value) + 1) > 5)
22
- pages = lodash_1.default.concat(["1.."], pages);
16
+ pages = _.concat(["1.."], pages);
23
17
  if (Number(props.total) > 6 && (Number(props.page.value) + 1) < Number(props.total))
24
- return lodash_1.default.concat(pages, `..${props.total}`);
18
+ return _.concat(pages, `..${props.total}`);
25
19
  return pages;
26
20
  };
27
- return Number(props.total) > 1 && ((0, jsx_runtime_1.jsxs)(styles_1.Container, { children: [(0, jsx_runtime_1.jsx)("div", { className: "paginate back", onClick: () => props.page.set
21
+ return Number(props.total) > 1 && (_jsxs(Container, { children: [_jsx("div", { className: "paginate back", onClick: () => props.page.set
28
22
  ? props.page.set(props.page.value
29
23
  ? props.page.value - 1
30
24
  : props.page.value)
31
- : null, children: (0, jsx_runtime_1.jsx)("i", { "aria-hidden": true, className: "fa-solid fa-chevron-left" }) }), lodash_1.default.map(pages(), (page, index) => (0, jsx_runtime_1.jsx)("div", { className: "paginate page", "data-current": String(props.page.value === (Number(lodash_1.default.replace(page, /\D/g, "")) - 1)), onClick: () => props.page.set ? props.page.set(Number(lodash_1.default.replace(page, /\D/g, "")) - 1) : null, children: page }, index)), (0, jsx_runtime_1.jsx)("div", { className: "paginate next", onClick: () => props.page.set
25
+ : null, children: _jsx("i", { "aria-hidden": true, className: "fa-solid fa-chevron-left" }) }), _.map(pages(), (page, index) => _jsx("div", { className: "paginate page", "data-current": String(props.page.value === (Number(_.replace(page, /\D/g, "")) - 1)), onClick: () => props.page.set ? props.page.set(Number(_.replace(page, /\D/g, "")) - 1) : null, children: page }, index)), _jsx("div", { className: "paginate next", onClick: () => props.page.set
32
26
  ? props.page.set(props.page.value !== (props.total - 1)
33
27
  ? props.page.value + 1
34
28
  : props.page.value)
35
- : null, children: (0, jsx_runtime_1.jsx)("i", { "aria-hidden": true, className: "fa-solid fa-chevron-right" }) })] }));
29
+ : null, children: _jsx("i", { "aria-hidden": true, className: "fa-solid fa-chevron-right" }) })] }));
36
30
  }
@@ -1,12 +1,6 @@
1
1
  "use client";
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.Container = void 0;
8
- const styled_components_1 = __importDefault(require("styled-components"));
9
- exports.Container = styled_components_1.default.div `
2
+ import styled from "styled-components";
3
+ export const Container = styled.div `
10
4
  width: 100%;
11
5
  display: flex;
12
6
  align-items: center;
@@ -1,12 +1,6 @@
1
1
  "use client";
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.Container = void 0;
8
- const styled_components_1 = __importDefault(require("styled-components"));
9
- exports.Container = styled_components_1.default.div `
2
+ import styled from "styled-components";
3
+ export const Container = styled.div `
10
4
  .iz-table-container {
11
5
  overflow-x: auto;
12
6
 
@@ -1,9 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  const req = require.context("./", false, /\.svg$/);
4
2
  const brands = {};
5
3
  req.keys().forEach((key) => {
6
4
  const name = key.replace("./", "").replace(".svg", "");
7
5
  brands[name] = req(key).default;
8
6
  });
9
- exports.default = brands;
7
+ export default brands;