@gustavo-valsechi/client 1.3.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.
Files changed (207) hide show
  1. package/README.md +0 -0
  2. package/dist/components/index.d.ts +3 -0
  3. package/dist/components/index.js +49 -0
  4. package/dist/components/styles.d.ts +2 -0
  5. package/dist/components/styles.js +20 -0
  6. package/dist/components/types/avatar/index.d.ts +2 -0
  7. package/dist/components/types/avatar/index.js +39 -0
  8. package/dist/components/types/avatar/styles.d.ts +1 -0
  9. package/dist/components/types/avatar/styles.js +61 -0
  10. package/dist/components/types/badge/index.d.ts +2 -0
  11. package/dist/components/types/badge/index.js +22 -0
  12. package/dist/components/types/badge/styles.d.ts +1 -0
  13. package/dist/components/types/badge/styles.js +39 -0
  14. package/dist/components/types/block/index.d.ts +2 -0
  15. package/dist/components/types/block/index.js +11 -0
  16. package/dist/components/types/block/styles.d.ts +2 -0
  17. package/dist/components/types/block/styles.js +31 -0
  18. package/dist/components/types/chart/index.d.ts +2 -0
  19. package/dist/components/types/chart/index.js +39 -0
  20. package/dist/components/types/chart/styles.d.ts +1 -0
  21. package/dist/components/types/chart/styles.js +10 -0
  22. package/dist/components/types/credit-card/assets/index.d.ts +4 -0
  23. package/dist/components/types/credit-card/assets/index.js +19 -0
  24. package/dist/components/types/credit-card/card/index.d.ts +2 -0
  25. package/dist/components/types/credit-card/card/index.js +29 -0
  26. package/dist/components/types/credit-card/card/styles.d.ts +1 -0
  27. package/dist/components/types/credit-card/card/styles.js +138 -0
  28. package/dist/components/types/credit-card/functions/index.d.ts +2 -0
  29. package/dist/components/types/credit-card/functions/index.js +14 -0
  30. package/dist/components/types/credit-card/functions/styles.d.ts +1 -0
  31. package/dist/components/types/credit-card/functions/styles.js +43 -0
  32. package/dist/components/types/credit-card/index.d.ts +2 -0
  33. package/dist/components/types/credit-card/index.js +35 -0
  34. package/dist/components/types/credit-card/styles.d.ts +1 -0
  35. package/dist/components/types/credit-card/styles.js +40 -0
  36. package/dist/components/types/credit-card/tools/index.d.ts +6 -0
  37. package/dist/components/types/credit-card/tools/index.js +26 -0
  38. package/dist/components/types/form/index.d.ts +3 -0
  39. package/dist/components/types/form/index.js +85 -0
  40. package/dist/components/types/form/styles.d.ts +1 -0
  41. package/dist/components/types/form/styles.js +21 -0
  42. package/dist/components/types/form/types/button/index.d.ts +2 -0
  43. package/dist/components/types/form/types/button/index.js +14 -0
  44. package/dist/components/types/form/types/button/loading/index.d.ts +1 -0
  45. package/dist/components/types/form/types/button/loading/index.js +9 -0
  46. package/dist/components/types/form/types/button/loading/styles.d.ts +1 -0
  47. package/dist/components/types/form/types/button/loading/styles.js +94 -0
  48. package/dist/components/types/form/types/button/styles.d.ts +1 -0
  49. package/dist/components/types/form/types/button/styles.js +61 -0
  50. package/dist/components/types/form/types/datetime/index.d.ts +2 -0
  51. package/dist/components/types/form/types/datetime/index.js +26 -0
  52. package/dist/components/types/form/types/datetime/styles.d.ts +1 -0
  53. package/dist/components/types/form/types/datetime/styles.js +46 -0
  54. package/dist/components/types/form/types/file/index.d.ts +2 -0
  55. package/dist/components/types/form/types/file/index.js +27 -0
  56. package/dist/components/types/form/types/file/styles.d.ts +1 -0
  57. package/dist/components/types/form/types/file/styles.js +33 -0
  58. package/dist/components/types/form/types/index.d.ts +7 -0
  59. package/dist/components/types/form/types/index.js +23 -0
  60. package/dist/components/types/form/types/input/index.d.ts +2 -0
  61. package/dist/components/types/form/types/input/index.js +28 -0
  62. package/dist/components/types/form/types/input/styles.d.ts +1 -0
  63. package/dist/components/types/form/types/input/styles.js +52 -0
  64. package/dist/components/types/form/types/label/index.d.ts +2 -0
  65. package/dist/components/types/form/types/label/index.js +9 -0
  66. package/dist/components/types/form/types/label/styles.d.ts +1 -0
  67. package/dist/components/types/form/types/label/styles.js +13 -0
  68. package/dist/components/types/form/types/select/index.d.ts +2 -0
  69. package/dist/components/types/form/types/select/index.js +31 -0
  70. package/dist/components/types/form/types/select/styles.d.ts +1 -0
  71. package/dist/components/types/form/types/select/styles.js +58 -0
  72. package/dist/components/types/form/types/textarea/index.d.ts +2 -0
  73. package/dist/components/types/form/types/textarea/index.js +26 -0
  74. package/dist/components/types/form/types/textarea/styles.d.ts +1 -0
  75. package/dist/components/types/form/types/textarea/styles.js +45 -0
  76. package/dist/components/types/index.d.ts +11 -0
  77. package/dist/components/types/index.js +27 -0
  78. package/dist/components/types/loading/app/index.d.ts +2 -0
  79. package/dist/components/types/loading/app/index.js +10 -0
  80. package/dist/components/types/loading/app/styles.d.ts +1 -0
  81. package/dist/components/types/loading/app/styles.js +93 -0
  82. package/dist/components/types/loading/bar/index.d.ts +2 -0
  83. package/dist/components/types/loading/bar/index.js +9 -0
  84. package/dist/components/types/loading/bar/styles.d.ts +1 -0
  85. package/dist/components/types/loading/bar/styles.js +27 -0
  86. package/dist/components/types/loading/index.d.ts +2 -0
  87. package/dist/components/types/loading/index.js +18 -0
  88. package/dist/components/types/logo/index.d.ts +2 -0
  89. package/dist/components/types/logo/index.js +9 -0
  90. package/dist/components/types/logo/styles.d.ts +1 -0
  91. package/dist/components/types/logo/styles.js +25 -0
  92. package/dist/components/types/lottie/animations/index.d.ts +293 -0
  93. package/dist/components/types/lottie/animations/index.js +7 -0
  94. package/dist/components/types/lottie/animations/loader.json +1 -0
  95. package/dist/components/types/lottie/index.d.ts +2 -0
  96. package/dist/components/types/lottie/index.js +34 -0
  97. package/dist/components/types/lottie/styles.d.ts +1 -0
  98. package/dist/components/types/lottie/styles.js +28 -0
  99. package/dist/components/types/modal/index.d.ts +2 -0
  100. package/dist/components/types/modal/index.js +18 -0
  101. package/dist/components/types/modal/styles.d.ts +1 -0
  102. package/dist/components/types/modal/styles.js +159 -0
  103. package/dist/components/types/table/index.d.ts +3 -0
  104. package/dist/components/types/table/index.js +113 -0
  105. package/dist/components/types/table/modal/actions.d.ts +10 -0
  106. package/dist/components/types/table/modal/actions.js +8 -0
  107. package/dist/components/types/table/modal/index.d.ts +2 -0
  108. package/dist/components/types/table/modal/index.js +43 -0
  109. package/dist/components/types/table/modal/styles.d.ts +1 -0
  110. package/dist/components/types/table/modal/styles.js +58 -0
  111. package/dist/components/types/table/paginate/index.d.ts +2 -0
  112. package/dist/components/types/table/paginate/index.js +36 -0
  113. package/dist/components/types/table/paginate/styles.d.ts +1 -0
  114. package/dist/components/types/table/paginate/styles.js +42 -0
  115. package/dist/components/types/table/styles.d.ts +5 -0
  116. package/dist/components/types/table/styles.js +268 -0
  117. package/dist/contexts/icon/assets/brands/index.d.ts +2 -0
  118. package/dist/contexts/icon/assets/brands/index.js +9 -0
  119. package/dist/contexts/icon/assets/index.d.ts +6 -0
  120. package/dist/contexts/icon/assets/index.js +13 -0
  121. package/dist/contexts/icon/assets/regular/index.d.ts +2 -0
  122. package/dist/contexts/icon/assets/regular/index.js +9 -0
  123. package/dist/contexts/icon/assets/solid/index.d.ts +2 -0
  124. package/dist/contexts/icon/assets/solid/index.js +9 -0
  125. package/dist/contexts/icon/index.d.ts +4 -0
  126. package/dist/contexts/icon/index.js +82 -0
  127. package/dist/contexts/icon/styles.d.ts +1 -0
  128. package/dist/contexts/icon/styles.js +10 -0
  129. package/dist/contexts/index.d.ts +4 -0
  130. package/dist/contexts/index.js +21 -0
  131. package/dist/contexts/modal/index.d.ts +4 -0
  132. package/dist/contexts/modal/index.js +53 -0
  133. package/dist/contexts/modal/styles.d.ts +1 -0
  134. package/dist/contexts/modal/styles.js +10 -0
  135. package/dist/contexts/theme/content.d.ts +3 -0
  136. package/dist/contexts/theme/content.js +77 -0
  137. package/dist/contexts/theme/index.d.ts +4 -0
  138. package/dist/contexts/theme/index.js +32 -0
  139. package/dist/contexts/theme/styles.d.ts +1 -0
  140. package/dist/contexts/theme/styles.js +84 -0
  141. package/dist/contexts/tooltip/index.d.ts +6 -0
  142. package/dist/contexts/tooltip/index.js +65 -0
  143. package/dist/contexts/tooltip/styles.d.ts +1 -0
  144. package/dist/contexts/tooltip/styles.js +46 -0
  145. package/dist/index.d.ts +4 -0
  146. package/dist/index.js +20 -0
  147. package/dist/interfaces/components/avatar/index.d.ts +6 -0
  148. package/dist/interfaces/components/avatar/index.js +2 -0
  149. package/dist/interfaces/components/badge/index.d.ts +3 -0
  150. package/dist/interfaces/components/badge/index.js +2 -0
  151. package/dist/interfaces/components/block/index.d.ts +16 -0
  152. package/dist/interfaces/components/block/index.js +2 -0
  153. package/dist/interfaces/components/chart/index.d.ts +9 -0
  154. package/dist/interfaces/components/chart/index.js +2 -0
  155. package/dist/interfaces/components/credit-card/index.d.ts +16 -0
  156. package/dist/interfaces/components/credit-card/index.js +2 -0
  157. package/dist/interfaces/components/form/button/index.d.ts +7 -0
  158. package/dist/interfaces/components/form/button/index.js +2 -0
  159. package/dist/interfaces/components/form/datetime/index.d.ts +15 -0
  160. package/dist/interfaces/components/form/datetime/index.js +2 -0
  161. package/dist/interfaces/components/form/file/index.d.ts +14 -0
  162. package/dist/interfaces/components/form/file/index.js +2 -0
  163. package/dist/interfaces/components/form/index.d.ts +16 -0
  164. package/dist/interfaces/components/form/index.js +23 -0
  165. package/dist/interfaces/components/form/input/index.d.ts +17 -0
  166. package/dist/interfaces/components/form/input/index.js +2 -0
  167. package/dist/interfaces/components/form/label/index.d.ts +5 -0
  168. package/dist/interfaces/components/form/label/index.js +2 -0
  169. package/dist/interfaces/components/form/select/index.d.ts +14 -0
  170. package/dist/interfaces/components/form/select/index.js +2 -0
  171. package/dist/interfaces/components/form/textarea/index.d.ts +16 -0
  172. package/dist/interfaces/components/form/textarea/index.js +2 -0
  173. package/dist/interfaces/components/index.d.ts +26 -0
  174. package/dist/interfaces/components/index.js +27 -0
  175. package/dist/interfaces/components/loading/app/index.d.ts +3 -0
  176. package/dist/interfaces/components/loading/app/index.js +2 -0
  177. package/dist/interfaces/components/loading/bar/index.d.ts +7 -0
  178. package/dist/interfaces/components/loading/bar/index.js +2 -0
  179. package/dist/interfaces/components/loading/index.d.ts +2 -0
  180. package/dist/interfaces/components/loading/index.js +18 -0
  181. package/dist/interfaces/components/logo/index.d.ts +6 -0
  182. package/dist/interfaces/components/logo/index.js +2 -0
  183. package/dist/interfaces/components/lottie/index.d.ts +12 -0
  184. package/dist/interfaces/components/lottie/index.js +2 -0
  185. package/dist/interfaces/components/modal/index.d.ts +16 -0
  186. package/dist/interfaces/components/modal/index.js +2 -0
  187. package/dist/interfaces/components/table/index.d.ts +46 -0
  188. package/dist/interfaces/components/table/index.js +17 -0
  189. package/dist/interfaces/components/table/paginate/index.d.ts +7 -0
  190. package/dist/interfaces/components/table/paginate/index.js +2 -0
  191. package/dist/interfaces/contexts/icon/index.d.ts +3 -0
  192. package/dist/interfaces/contexts/icon/index.js +2 -0
  193. package/dist/interfaces/contexts/index.d.ts +8 -0
  194. package/dist/interfaces/contexts/index.js +20 -0
  195. package/dist/interfaces/contexts/modal/index.d.ts +16 -0
  196. package/dist/interfaces/contexts/modal/index.js +3 -0
  197. package/dist/interfaces/contexts/theme/index.d.ts +42 -0
  198. package/dist/interfaces/contexts/theme/index.js +2 -0
  199. package/dist/interfaces/contexts/tooltip/index.d.ts +3 -0
  200. package/dist/interfaces/contexts/tooltip/index.js +2 -0
  201. package/dist/interfaces/index.d.ts +2 -0
  202. package/dist/interfaces/index.js +18 -0
  203. package/dist/styled.d.ts +6 -0
  204. package/dist/styled.js +3 -0
  205. package/dist/tsup.config.d.ts +2 -0
  206. package/dist/tsup.config.js +21 -0
  207. package/package.json +69 -0
@@ -0,0 +1,159 @@
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 `
10
+ width: 100%;
11
+ height: 100%;
12
+ top: 0;
13
+ right: 0;
14
+ display: flex !important;
15
+ position: fixed;
16
+ z-index: ${(props) => (props.toggle ? "9" : "-1")};
17
+ flex-direction: ${(props) => (props.position === "left" ? "row-reverse" : "row")} !important;
18
+ transform: ${(props) => (props.toggle ? "translateX(0%)" : "translateX(100%)")};
19
+ transition: ${(props) => (props.toggle ? ".0s ease .0s" : ".3s ease .3s")};
20
+
21
+ .iz-modal-back {
22
+ width: 100%;
23
+ height: 100%;
24
+ background: rgb(0, 0, 0, 0.3);
25
+ opacity: ${(props) => (props.toggle ? "1" : "0")};
26
+ transition: ease 0.3s;
27
+ position: absolute;
28
+ }
29
+
30
+ .iz-modal-container {
31
+ display: flex;
32
+ flex-direction: column;
33
+ height: ${(props) => props.position !== "center" ? "100%" : undefined};
34
+ width: ${(props) => props.position !== "center" ? "18rem" : undefined};
35
+ border-radius: ${(props) => props.position === "center" ? "10px" : undefined};
36
+ max-height: ${(props) => props.position === "center" ? "95%" : "100%"};
37
+ max-width: ${(props) => props.position === "center" ? "95%" : "100%"};
38
+ background: ${({ theme }) => theme.primary};
39
+ transform: ${(props) => props.toggle
40
+ ? props.position === "right" || props.position === "left"
41
+ ? "translateX(0rem)"
42
+ : "translateX(-50%) translateY(50%)"
43
+ : props.position === "right"
44
+ ? "translateX(18rem)"
45
+ : props.position === "left"
46
+ ? "translateX(-18rem)"
47
+ : "translateX(-50%) translateY(43%)"};
48
+ opacity: ${(props) => props.position === "center" && !props.toggle ? "0" : "1"};
49
+ transition: ease 0.3s;
50
+ position: absolute;
51
+
52
+ ${(props) => (props.position === "right"
53
+ ? "right: 0;"
54
+ : props.position === "left"
55
+ ? "left: 0;"
56
+ : "left: 50%; bottom: 50%;")}
57
+
58
+ @media(max-width: ${({ theme }) => theme.mobileMaxWidth}) {
59
+ border-radius: ${(props) => props.position === "center" ? "10px 10px 0 0" : undefined};
60
+ width: ${(props) => props.position !== "center" ? "18rem" : "100%"};
61
+ max-width: 100%;
62
+ padding-bottom: 3rem !important;
63
+
64
+ transform: ${(props) => props.toggle
65
+ ? props.position === "right" || props.position === "left"
66
+ ? "translateX(0rem)"
67
+ : "translateX(-50%) translateY(0)"
68
+ : props.position === "right"
69
+ ? "translateX(18rem)"
70
+ : props.position === "left"
71
+ ? "translateX(-18rem)"
72
+ : "translateX(-50%) translateY(50%)"};
73
+
74
+ ${(props) => (props.position === "right"
75
+ ? "right: 0;"
76
+ : props.position === "left"
77
+ ? "left: 0;"
78
+ : "left: 50%; bottom: 0;")}
79
+ }
80
+
81
+ .iz-modal-header {
82
+ padding: 1.5rem 2rem;
83
+ display: flex;
84
+ align-items: center;
85
+ justify-content: space-between;
86
+ border-bottom: 1px solid rgb(0, 0, 0, 0.2);
87
+
88
+ .iz-modal-title {
89
+ color: ${({ theme }) => theme.t6};
90
+ font-size: 1rem;
91
+ font-weight: 500;
92
+
93
+ i {
94
+ margin-right: .5rem;
95
+ }
96
+
97
+ span {
98
+ word-break: break-word;
99
+ }
100
+ }
101
+
102
+ .fa-xmark {
103
+ color: ${({ theme }) => theme.t6};
104
+ margin-left: .5rem;
105
+ cursor: pointer;
106
+
107
+ &:hover {
108
+ color: ${({ theme }) => theme.t8};
109
+ }
110
+ }
111
+ }
112
+
113
+ .iz-modal-content {
114
+ overflow-x: hidden;
115
+ overflow-y: overlay;
116
+ position: relative;
117
+ height: ${(props) => props.position === "center" ? "initial" : "100%"};
118
+
119
+ .iz-modal-close {
120
+ position: absolute;
121
+ color: ${(props) => props.light ? "rgb(255, 255, 255, 0.6)" : "rgb(0, 0, 0, 0.6)"};
122
+ top: ${(props) => props.position === "center" ? "1rem" : "1.5rem"};
123
+ right: ${(props) => props.position === "center" ? "1rem" : "1.5rem"};
124
+ width: 1rem;
125
+ height: 1rem;
126
+ cursor: pointer;
127
+ z-index: 9;
128
+ display: flex;
129
+ align-items: center;
130
+ justify-content: center;
131
+
132
+ @media(max-width: ${({ theme }) => theme.mobileMaxWidth}) {
133
+ display: none;
134
+ }
135
+
136
+ &:hover {
137
+ color: ${(props) => props.light ? "rgb(255, 255, 255, 1)" : "rgb(0, 0, 0, 1)"};
138
+ }
139
+ }
140
+ }
141
+
142
+ .iz-modal-buttons {
143
+ padding: 1rem 2rem;
144
+
145
+ @media(max-width: ${({ theme }) => theme.mobileMaxWidth}) {
146
+ padding: 1rem 2rem 2rem;
147
+ }
148
+
149
+ button {
150
+ width: 100%;
151
+ margin-bottom: .5rem;
152
+ }
153
+
154
+ button:last-child {
155
+ margin-bottom: 0;
156
+ }
157
+ }
158
+ }
159
+ `;
@@ -0,0 +1,3 @@
1
+ import { ITable } from "@interfaces";
2
+ export * from "./paginate";
3
+ export declare function Table(props: ITable): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,113 @@
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) {
32
+ var _a, _b, _c, _d, _e, _f;
33
+ const theme = (0, _contexts_1.useTheme)();
34
+ const modal = (0, _contexts_1.useModal)();
35
+ 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" });
38
+ return () => modal.remove("table");
39
+ }, []);
40
+ const onShowLine = (key) => {
41
+ if (window.innerWidth > Number(lodash_1.default.replace(theme.content.mobileMaxWidth, "px", "")))
42
+ return;
43
+ let content = {};
44
+ lodash_1.default.forEach(props.options, (data, index) => {
45
+ var _a, _b;
46
+ 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;
48
+ content[columnName] = columnName === "actions" ? (_b = data.row) === null || _b === void 0 ? void 0 : _b.actions : renderRowContainer(props.content[key], data);
49
+ });
50
+ modal.setProps("table", { toggle: true, content });
51
+ };
52
+ const renderRowContainer = (data, option) => {
53
+ var _a, _b, _c, _d;
54
+ return ((0, jsx_runtime_1.jsx)("div", { className: `
55
+ iz-table-content
56
+ ${((_a = option.row) === null || _a === void 0 ? void 0 : _a.actions) ? "iz-table-action" : ""}
57
+ ${((_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)
59
+ ? option.row.style(data, option)
60
+ : (_d = option.row) === null || _d === void 0 ? void 0 : _d.style, children: renderRowContent(data, option) }));
61
+ };
62
+ const renderRowContent = (data, option) => {
63
+ var _a, _b, _c, _d, _e;
64
+ 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)) }));
66
+ }
67
+ 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)
69
+ ? option.row.icon(data) || "fa-solid fa-circle-user"
70
+ : ((_e = option.row) === null || _e === void 0 ? void 0 : _e.icon) || "fa-solid fa-circle-user" }) }));
71
+ }
72
+ return renderRowText(data, option);
73
+ };
74
+ 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));
76
+ };
77
+ const renderRowText = (data, option) => {
78
+ const row = option.row || {};
79
+ const content = data[row.name] || data;
80
+ let body;
81
+ while (!body) {
82
+ if (lodash_1.default.isString(row))
83
+ body = data[row];
84
+ if (lodash_1.default.isString(content))
85
+ body = content;
86
+ if (lodash_1.default.isFunction(row.mask))
87
+ body = row.mask(content);
88
+ if (lodash_1.default.isFunction(row.custom))
89
+ body = row.custom(content);
90
+ body = body !== null && body !== void 0 ? body : "---";
91
+ }
92
+ return ((0, jsx_runtime_1.jsx)("div", { className: "iz-table-content-elipse", title: lodash_1.default.isString(body) ? body : "", children: body }));
93
+ };
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) => {
95
+ 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)
97
+ ? `iz-table-action ${((_d = (_c = option.column) === null || _c === void 0 ? void 0 : _c.action) === null || _d === void 0 ? void 0 : _d.position)
98
+ ? (_f = (_e = option.column) === null || _e === void 0 ? void 0 : _e.action) === null || _f === void 0 ? void 0 : _f.position
99
+ : ""}`
100
+ : ""}`, children: !!((_g = option.column) === null || _g === void 0 ? void 0 : _g.action)
101
+ ? 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) => {
105
+ 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
107
+ ? "5px 0 0 5px"
108
+ : ((_a = props.options) === null || _a === void 0 ? void 0 : _a.length) - 1 === index
109
+ ? "0 5px 5px 0"
110
+ : "0", margin: key === 0 ? "1.5rem 0 0" : ".5rem 0 0" }) }, index));
111
+ }) }, 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 })] }));
113
+ }
@@ -0,0 +1,10 @@
1
+ declare const actionConfig: {
2
+ "fa-solid fa-pen-to-square": {
3
+ label: string;
4
+ };
5
+ "fa-solid fa-trash-can": {
6
+ label: string;
7
+ color: string;
8
+ };
9
+ };
10
+ export default actionConfig;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const content_1 = require("@contexts/theme/content");
4
+ const actionConfig = {
5
+ "fa-solid fa-pen-to-square": { label: "editar" },
6
+ "fa-solid fa-trash-can": { label: "remover", color: content_1.CommonTheme.negative },
7
+ };
8
+ exports.default = actionConfig;
@@ -0,0 +1,2 @@
1
+ import { IModal } from "@interfaces";
2
+ export default function Modal(props: IModal): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,43 @@
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];
19
+ const onClose = () => {
20
+ modal.setProps("table", { toggle: false });
21
+ };
22
+ return ((0, jsx_runtime_1.jsx)(__1.Component, { content: [{
23
+ type: "Modal",
24
+ props: {
25
+ toggle: props.toggle,
26
+ 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) => ({
28
+ type: "Button",
29
+ props: {
30
+ ...actions_1.default[data.icon] || {},
31
+ onClick: data.function
32
+ }
33
+ })), {
34
+ type: "Button",
35
+ props: {
36
+ label: "fechar",
37
+ outline: true,
38
+ onClick: onClose
39
+ }
40
+ }) }) })] }) }))
41
+ }
42
+ }] }));
43
+ }
@@ -0,0 +1 @@
1
+ export declare const Content: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -0,0 +1,58 @@
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 `
10
+ padding: 1.5rem;
11
+ display: flex;
12
+ flex-direction: column;
13
+ gap: 1.5rem;
14
+
15
+ .iz-table-modal-title {
16
+ font-size: 1.2rem;
17
+ font-weight: 500;
18
+ width: 100%;
19
+ display: flex;
20
+ align-items: center;
21
+ justify-content: center;
22
+ color: ${({ theme }) => theme.t6};
23
+ }
24
+
25
+ .iz-table-modal-content {
26
+ ul {
27
+ li {
28
+ border-bottom: solid 1px ${({ theme }) => theme.t05};
29
+ padding: .8rem 0;
30
+ display: flex;
31
+ align-items: center;
32
+ justify-content: space-between;
33
+ gap: 1rem;
34
+ font-size: .8rem;
35
+ color: ${({ theme }) => theme.t6};
36
+
37
+ &:last-child {
38
+ border-bottom: none;
39
+ }
40
+
41
+ .iz-table-modal-column {
42
+ background: ${({ theme }) => theme.t05};
43
+ padding: .5rem .8rem;
44
+ font-weight: 600;
45
+ border-radius: 5px;
46
+ }
47
+
48
+ .iz-table-modal-row {
49
+ text-align: right;
50
+ }
51
+ }
52
+ }
53
+ }
54
+
55
+ .iz-table-modal-actions {
56
+ margin-top: 1rem;
57
+ }
58
+ `;
@@ -0,0 +1,2 @@
1
+ import { IPaginate } from "@interfaces";
2
+ export declare function Paginate(props: IPaginate): false | import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,36 @@
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) {
12
+ const pages = () => {
13
+ const offset = Number(props.page.value) - 4;
14
+ let page = offset > 0 ? offset + 1 : 1;
15
+ let pages = [];
16
+ while (Number(props.total) >= page) {
17
+ pages.push(page);
18
+ page++;
19
+ }
20
+ pages = lodash_1.default.slice(pages, 0, 5);
21
+ if ((Number(props.page.value) + 1) > 5)
22
+ pages = lodash_1.default.concat(["1.."], pages);
23
+ if (Number(props.total) > 6 && (Number(props.page.value) + 1) < Number(props.total))
24
+ return lodash_1.default.concat(pages, `..${props.total}`);
25
+ return pages;
26
+ };
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
28
+ ? props.page.set(props.page.value
29
+ ? props.page.value - 1
30
+ : 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
32
+ ? props.page.set(props.page.value !== (props.total - 1)
33
+ ? props.page.value + 1
34
+ : props.page.value)
35
+ : null, children: (0, jsx_runtime_1.jsx)("i", { "aria-hidden": true, className: "fa-solid fa-chevron-right" }) })] }));
36
+ }
@@ -0,0 +1 @@
1
+ export declare const Container: any;
@@ -0,0 +1,42 @@
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 `
10
+ width: 100%;
11
+ display: flex;
12
+ align-items: center;
13
+ justify-content: center;
14
+ margin-top: 1.5rem;
15
+
16
+ .paginate {
17
+ font-size: .8rem;
18
+ font-weight: 500;
19
+ height: 1.5rem;
20
+ padding: 0 .6rem;
21
+ border-radius: 1rem;
22
+ transition: ease .3s;
23
+ color: ${({ theme }) => theme.t6};
24
+ display: flex;
25
+ align-items: center;
26
+ justify-content: center;
27
+ cursor: pointer;
28
+
29
+ &[data-current="true"] {
30
+ background: ${({ theme }) => theme.tertiary};
31
+ color: ${({ theme }) => theme.secondary};
32
+
33
+ &:hover {
34
+ background: ${({ theme }) => theme.tertiary};
35
+ }
36
+ }
37
+
38
+ &:hover {
39
+ background: ${({ theme }) => theme.t05};
40
+ }
41
+ }
42
+ `;
@@ -0,0 +1,5 @@
1
+ interface IProps {
2
+ notFound?: boolean;
3
+ }
4
+ export declare const Container: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, IProps>> & string;
5
+ export {};