@gustavo-valsechi/client 1.3.28 → 1.3.30
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/index.d.ts +3 -10
- package/dist/components/index.js +13 -3070
- package/dist/components/index.mjs +11 -3082
- package/dist/components/styles.d.ts +2 -0
- package/dist/components/styles.js +54 -0
- package/dist/components/styles.mjs +19 -0
- package/dist/components/types/avatar/index.d.ts +2 -0
- package/dist/components/types/avatar/index.js +63 -0
- package/dist/components/types/avatar/index.mjs +29 -0
- package/dist/components/types/avatar/styles.d.ts +1 -0
- package/dist/components/types/avatar/styles.js +93 -0
- package/dist/components/types/avatar/styles.mjs +59 -0
- package/dist/components/types/badge/index.d.ts +2 -0
- package/dist/components/types/badge/index.js +54 -0
- package/dist/components/types/badge/index.mjs +20 -0
- package/dist/components/types/badge/styles.d.ts +1 -0
- package/dist/components/types/badge/styles.js +71 -0
- package/dist/components/types/badge/styles.mjs +37 -0
- package/dist/components/types/block/index.d.ts +2 -0
- package/dist/components/types/block/index.js +44 -0
- package/dist/components/types/block/index.mjs +20 -0
- package/dist/components/types/block/styles.d.ts +2 -0
- package/dist/components/types/block/styles.js +65 -0
- package/dist/components/types/block/styles.mjs +30 -0
- package/dist/components/types/chart/index.d.ts +2 -0
- package/dist/components/types/chart/index.js +80 -0
- package/dist/components/types/chart/index.mjs +46 -0
- package/dist/components/types/chart/styles.d.ts +1 -0
- package/dist/components/types/chart/styles.js +42 -0
- package/dist/components/types/chart/styles.mjs +8 -0
- package/dist/components/types/credit-card/assets/index.d.ts +4 -0
- package/dist/components/types/credit-card/assets/index.js +41 -0
- package/dist/components/types/credit-card/assets/index.mjs +21 -0
- package/dist/components/types/credit-card/card/index.d.ts +2 -0
- package/dist/components/types/credit-card/card/index.js +67 -0
- package/dist/components/types/credit-card/card/index.mjs +37 -0
- package/dist/components/types/credit-card/card/styles.d.ts +1 -0
- package/dist/components/types/credit-card/card/styles.js +170 -0
- package/dist/components/types/credit-card/card/styles.mjs +136 -0
- package/dist/components/types/credit-card/functions/index.d.ts +2 -0
- package/dist/components/types/credit-card/functions/index.js +52 -0
- package/dist/components/types/credit-card/functions/index.mjs +22 -0
- package/dist/components/types/credit-card/functions/styles.d.ts +1 -0
- package/dist/components/types/credit-card/functions/styles.js +75 -0
- package/dist/components/types/credit-card/functions/styles.mjs +41 -0
- package/dist/components/types/credit-card/index.d.ts +2 -0
- package/dist/components/types/credit-card/index.js +70 -0
- package/dist/components/types/credit-card/index.mjs +36 -0
- package/dist/components/types/credit-card/styles.d.ts +1 -0
- package/dist/components/types/credit-card/styles.js +72 -0
- package/dist/components/types/credit-card/styles.mjs +38 -0
- package/dist/components/types/credit-card/tools/index.d.ts +6 -0
- package/dist/components/types/credit-card/tools/index.js +58 -0
- package/dist/components/types/credit-card/tools/index.mjs +23 -0
- package/dist/components/types/form/index.d.ts +3 -0
- package/dist/components/types/form/index.js +111 -0
- package/dist/components/types/form/index.mjs +75 -0
- package/dist/components/types/form/styles.d.ts +1 -0
- package/dist/components/types/form/styles.js +53 -0
- package/dist/components/types/form/styles.mjs +19 -0
- package/dist/components/types/form/types/button/index.d.ts +2 -0
- package/dist/components/types/form/types/button/index.js +58 -0
- package/dist/components/types/form/types/button/index.mjs +24 -0
- package/dist/components/types/form/types/button/loading/index.d.ts +1 -0
- package/dist/components/types/form/types/button/loading/index.js +38 -0
- package/dist/components/types/form/types/button/loading/index.mjs +14 -0
- package/dist/components/types/form/types/button/loading/styles.d.ts +1 -0
- package/dist/components/types/form/types/button/loading/styles.js +126 -0
- package/dist/components/types/form/types/button/loading/styles.mjs +92 -0
- package/dist/components/types/form/types/button/styles.d.ts +1 -0
- package/dist/components/types/form/types/button/styles.js +79 -0
- package/dist/components/types/form/types/button/styles.mjs +45 -0
- package/dist/components/types/form/types/datetime/index.d.ts +2 -0
- package/dist/components/types/form/types/datetime/index.js +72 -0
- package/dist/components/types/form/types/datetime/index.mjs +38 -0
- package/dist/components/types/form/types/datetime/styles.d.ts +1 -0
- package/dist/components/types/form/types/datetime/styles.js +78 -0
- package/dist/components/types/form/types/datetime/styles.mjs +44 -0
- package/dist/components/types/form/types/file/index.d.ts +2 -0
- package/dist/components/types/form/types/file/index.js +71 -0
- package/dist/components/types/form/types/file/index.mjs +47 -0
- package/dist/components/types/form/types/file/styles.d.ts +1 -0
- package/dist/components/types/form/types/file/styles.js +65 -0
- package/dist/components/types/form/types/file/styles.mjs +31 -0
- package/dist/components/types/form/types/index.d.ts +7 -0
- package/dist/components/types/form/types/index.js +35 -0
- package/dist/components/types/form/types/index.mjs +8 -0
- package/dist/components/types/form/types/input/index.d.ts +2 -0
- package/dist/components/types/form/types/input/index.js +84 -0
- package/dist/components/types/form/types/input/index.mjs +50 -0
- package/dist/components/types/form/types/input/styles.d.ts +1 -0
- package/dist/components/types/form/types/input/styles.js +84 -0
- package/dist/components/types/form/types/input/styles.mjs +50 -0
- package/dist/components/types/form/types/label/index.d.ts +2 -0
- package/dist/components/types/form/types/label/index.js +34 -0
- package/dist/components/types/form/types/label/index.mjs +10 -0
- package/dist/components/types/form/types/label/styles.d.ts +1 -0
- package/dist/components/types/form/types/label/styles.js +45 -0
- package/dist/components/types/form/types/label/styles.mjs +11 -0
- package/dist/components/types/form/types/select/index.d.ts +2 -0
- package/dist/components/types/form/types/select/index.js +90 -0
- package/dist/components/types/form/types/select/index.mjs +56 -0
- package/dist/components/types/form/types/select/styles.d.ts +1 -0
- package/dist/components/types/form/types/select/styles.js +90 -0
- package/dist/components/types/form/types/select/styles.mjs +56 -0
- package/dist/components/types/form/types/textarea/index.d.ts +2 -0
- package/dist/components/types/form/types/textarea/index.js +72 -0
- package/dist/components/types/form/types/textarea/index.mjs +38 -0
- package/dist/components/types/form/types/textarea/styles.d.ts +1 -0
- package/dist/components/types/form/types/textarea/styles.js +77 -0
- package/dist/components/types/form/types/textarea/styles.mjs +43 -0
- package/dist/components/types/index.d.ts +11 -0
- package/dist/components/types/index.js +43 -0
- package/dist/components/types/index.mjs +12 -0
- package/dist/components/types/loading/app/index.d.ts +2 -0
- package/dist/components/types/loading/app/index.js +35 -0
- package/dist/components/types/loading/app/index.mjs +11 -0
- package/dist/components/types/loading/app/styles.d.ts +1 -0
- package/dist/components/types/loading/app/styles.js +125 -0
- package/dist/components/types/loading/app/styles.mjs +91 -0
- package/dist/components/types/loading/bar/index.d.ts +2 -0
- package/dist/components/types/loading/bar/index.js +34 -0
- package/dist/components/types/loading/bar/index.mjs +10 -0
- package/dist/components/types/loading/bar/styles.d.ts +1 -0
- package/dist/components/types/loading/bar/styles.js +59 -0
- package/dist/components/types/loading/bar/styles.mjs +25 -0
- package/dist/components/types/loading/index.d.ts +2 -0
- package/dist/components/types/loading/index.js +25 -0
- package/dist/components/types/loading/index.mjs +3 -0
- package/dist/components/types/logo/index.d.ts +2 -0
- package/dist/components/types/logo/index.js +37 -0
- package/dist/components/types/logo/index.mjs +13 -0
- package/dist/components/types/logo/styles.d.ts +1 -0
- package/dist/components/types/logo/styles.js +57 -0
- package/dist/components/types/logo/styles.mjs +23 -0
- package/dist/components/types/lottie/animations/index.d.ts +293 -0
- package/dist/components/types/lottie/animations/index.js +36 -0
- package/dist/components/types/lottie/animations/index.mjs +6 -0
- package/dist/components/types/lottie/index.d.ts +2 -0
- package/dist/components/types/lottie/index.js +72 -0
- package/dist/components/types/lottie/index.mjs +38 -0
- package/dist/components/types/lottie/styles.d.ts +1 -0
- package/dist/components/types/lottie/styles.js +60 -0
- package/dist/components/types/lottie/styles.mjs +26 -0
- package/dist/components/types/modal/index.d.ts +2 -0
- package/dist/components/types/modal/index.js +66 -0
- package/dist/components/types/modal/index.mjs +32 -0
- package/dist/components/types/modal/styles.d.ts +1 -0
- package/dist/components/types/modal/styles.js +167 -0
- package/dist/components/types/modal/styles.mjs +133 -0
- package/dist/components/types/table/index.d.ts +3 -0
- package/dist/components/types/table/index.js +171 -0
- package/dist/components/types/table/index.mjs +135 -0
- package/dist/components/types/table/modal/actions.d.ts +10 -0
- package/dist/components/types/table/modal/actions.js +30 -0
- package/dist/components/types/table/modal/actions.mjs +10 -0
- package/dist/components/types/table/modal/index.d.ts +2 -0
- package/dist/components/types/table/modal/index.js +91 -0
- package/dist/components/types/table/modal/index.mjs +61 -0
- package/dist/components/types/table/modal/styles.d.ts +1 -0
- package/dist/components/types/table/modal/styles.js +90 -0
- package/dist/components/types/table/modal/styles.mjs +56 -0
- package/dist/components/types/table/paginate/index.d.ts +2 -0
- package/dist/components/types/table/paginate/index.js +92 -0
- package/dist/components/types/table/paginate/index.mjs +58 -0
- package/dist/components/types/table/paginate/styles.d.ts +1 -0
- package/dist/components/types/table/paginate/styles.js +74 -0
- package/dist/components/types/table/paginate/styles.mjs +40 -0
- package/dist/components/types/table/styles.d.ts +5 -0
- package/dist/components/types/table/styles.js +300 -0
- package/dist/components/types/table/styles.mjs +266 -0
- package/dist/contexts/icon/assets/brands/index.d.ts +2 -0
- package/dist/contexts/icon/assets/brands/index.js +31 -0
- package/dist/contexts/icon/assets/brands/index.mjs +11 -0
- package/dist/contexts/icon/assets/index.d.ts +6 -0
- package/dist/contexts/icon/assets/index.js +42 -0
- package/dist/contexts/icon/assets/index.mjs +12 -0
- package/dist/contexts/icon/assets/regular/index.d.ts +2 -0
- package/dist/contexts/icon/assets/regular/index.js +31 -0
- package/dist/contexts/icon/assets/regular/index.mjs +11 -0
- package/dist/contexts/icon/assets/solid/index.d.ts +2 -0
- package/dist/contexts/icon/assets/solid/index.js +31 -0
- package/dist/contexts/icon/assets/solid/index.mjs +11 -0
- package/dist/contexts/icon/index.d.ts +4 -0
- package/dist/contexts/icon/index.js +107 -0
- package/dist/contexts/icon/index.mjs +72 -0
- package/dist/contexts/icon/styles.d.ts +1 -0
- package/dist/contexts/icon/styles.js +42 -0
- package/dist/contexts/icon/styles.mjs +8 -0
- package/dist/contexts/index.d.ts +4 -20
- package/dist/contexts/index.js +9 -504
- package/dist/contexts/index.mjs +4 -486
- package/dist/contexts/modal/index.d.ts +4 -0
- package/dist/contexts/modal/index.js +92 -0
- package/dist/contexts/modal/index.mjs +57 -0
- package/dist/contexts/modal/styles.d.ts +1 -0
- package/dist/contexts/modal/styles.js +42 -0
- package/dist/contexts/modal/styles.mjs +8 -0
- package/dist/contexts/theme/content.d.ts +3 -0
- package/dist/contexts/theme/content.js +104 -0
- package/dist/contexts/theme/content.mjs +79 -0
- package/dist/contexts/theme/index.d.ts +4 -0
- package/dist/contexts/theme/index.js +68 -0
- package/dist/contexts/theme/index.mjs +43 -0
- package/dist/contexts/theme/styles.d.ts +1 -0
- package/dist/contexts/theme/styles.js +116 -0
- package/dist/contexts/theme/styles.mjs +82 -0
- package/dist/contexts/tooltip/index.d.ts +6 -0
- package/dist/contexts/tooltip/index.js +107 -0
- package/dist/contexts/tooltip/index.mjs +72 -0
- package/dist/contexts/tooltip/styles.d.ts +1 -0
- package/dist/contexts/tooltip/styles.js +78 -0
- package/dist/contexts/tooltip/styles.mjs +44 -0
- package/dist/index.d.ts +4 -17
- package/dist/index.js +8 -3325
- package/dist/index.mjs +4 -3312
- package/dist/interfaces/components/avatar/index.d.ts +6 -0
- package/dist/interfaces/components/avatar/index.js +17 -0
- package/dist/interfaces/components/avatar/index.mjs +1 -0
- package/dist/interfaces/components/badge/index.d.ts +3 -0
- package/dist/interfaces/components/badge/index.js +17 -0
- package/dist/interfaces/components/badge/index.mjs +1 -0
- package/dist/interfaces/components/block/index.d.ts +16 -0
- package/dist/interfaces/components/block/index.js +17 -0
- package/dist/interfaces/components/block/index.mjs +1 -0
- package/dist/interfaces/components/chart/index.d.ts +9 -0
- package/dist/interfaces/components/chart/index.js +17 -0
- package/dist/interfaces/components/chart/index.mjs +1 -0
- package/dist/interfaces/components/credit-card/index.d.ts +16 -0
- package/dist/interfaces/components/credit-card/index.js +17 -0
- package/dist/interfaces/components/credit-card/index.mjs +1 -0
- package/dist/interfaces/components/form/button/index.d.ts +7 -0
- package/dist/interfaces/components/form/button/index.js +17 -0
- package/dist/interfaces/components/form/button/index.mjs +1 -0
- package/dist/interfaces/components/form/datetime/index.d.ts +15 -0
- package/dist/interfaces/components/form/datetime/index.js +17 -0
- package/dist/interfaces/components/form/datetime/index.mjs +1 -0
- package/dist/interfaces/components/form/file/index.d.ts +14 -0
- package/dist/interfaces/components/form/file/index.js +17 -0
- package/dist/interfaces/components/form/file/index.mjs +1 -0
- package/dist/interfaces/components/form/index.d.ts +16 -0
- package/dist/interfaces/components/form/index.js +35 -0
- package/dist/interfaces/components/form/index.mjs +8 -0
- package/dist/interfaces/components/form/input/index.d.ts +17 -0
- package/dist/interfaces/components/form/input/index.js +17 -0
- package/dist/interfaces/components/form/input/index.mjs +1 -0
- package/dist/interfaces/components/form/label/index.d.ts +5 -0
- package/dist/interfaces/components/form/label/index.js +17 -0
- package/dist/interfaces/components/form/label/index.mjs +1 -0
- package/dist/interfaces/components/form/select/index.d.ts +14 -0
- package/dist/interfaces/components/form/select/index.js +17 -0
- package/dist/interfaces/components/form/select/index.mjs +1 -0
- package/dist/interfaces/components/form/textarea/index.d.ts +16 -0
- package/dist/interfaces/components/form/textarea/index.js +17 -0
- package/dist/interfaces/components/form/textarea/index.mjs +1 -0
- package/dist/interfaces/components/index.d.ts +26 -0
- package/dist/interfaces/components/index.js +43 -0
- package/dist/interfaces/components/index.mjs +12 -0
- package/dist/interfaces/components/loading/app/index.d.ts +3 -0
- package/dist/interfaces/components/loading/app/index.js +17 -0
- package/dist/interfaces/components/loading/app/index.mjs +1 -0
- package/dist/interfaces/components/loading/bar/index.d.ts +7 -0
- package/dist/interfaces/components/loading/bar/index.js +17 -0
- package/dist/interfaces/components/loading/bar/index.mjs +1 -0
- package/dist/interfaces/components/loading/index.d.ts +2 -0
- package/dist/interfaces/components/loading/index.js +25 -0
- package/dist/interfaces/components/loading/index.mjs +3 -0
- package/dist/interfaces/components/logo/index.d.ts +6 -0
- package/dist/interfaces/components/logo/index.js +17 -0
- package/dist/interfaces/components/logo/index.mjs +1 -0
- package/dist/interfaces/components/lottie/index.d.ts +12 -0
- package/dist/interfaces/components/lottie/index.js +17 -0
- package/dist/interfaces/components/lottie/index.mjs +1 -0
- package/dist/interfaces/components/modal/index.d.ts +16 -0
- package/dist/interfaces/components/modal/index.js +17 -0
- package/dist/interfaces/components/modal/index.mjs +1 -0
- package/dist/interfaces/components/table/index.d.ts +46 -0
- package/dist/interfaces/components/table/index.js +23 -0
- package/dist/interfaces/components/table/index.mjs +2 -0
- package/dist/interfaces/components/table/paginate/index.d.ts +7 -0
- package/dist/interfaces/components/table/paginate/index.js +17 -0
- package/dist/interfaces/components/table/paginate/index.mjs +1 -0
- package/dist/interfaces/contexts/icon/index.d.ts +3 -0
- package/dist/interfaces/contexts/icon/index.js +17 -0
- package/dist/interfaces/contexts/icon/index.mjs +1 -0
- package/dist/interfaces/contexts/index.d.ts +8 -0
- package/dist/interfaces/contexts/index.js +29 -0
- package/dist/interfaces/contexts/index.mjs +5 -0
- package/dist/interfaces/contexts/modal/index.d.ts +16 -0
- package/dist/interfaces/contexts/modal/index.js +18 -0
- package/dist/interfaces/contexts/modal/index.mjs +2 -0
- package/dist/interfaces/contexts/theme/index.d.ts +42 -0
- package/dist/interfaces/contexts/theme/index.js +17 -0
- package/dist/interfaces/contexts/theme/index.mjs +1 -0
- package/dist/interfaces/contexts/tooltip/index.d.ts +3 -0
- package/dist/interfaces/contexts/tooltip/index.js +17 -0
- package/dist/interfaces/contexts/tooltip/index.mjs +1 -0
- package/dist/interfaces/index.d.ts +2 -12
- package/dist/interfaces/index.js +8 -2
- package/dist/interfaces/index.mjs +2 -0
- package/dist/styled.d.ts +6 -0
- package/dist/tsup.config.d.ts +2 -0
- package/package.json +5 -5
- package/dist/components/index.d.mts +0 -10
- package/dist/contexts/index.d.mts +0 -20
- package/dist/index-BhaGW0O1.d.ts +0 -601
- package/dist/index-BxA8LyyD.d.mts +0 -68
- package/dist/index-DDi0w5pw.d.mts +0 -601
- package/dist/index-DT7VKE7H.d.ts +0 -68
- package/dist/index-Da-DtPS-.d.mts +0 -29
- package/dist/index-Da-DtPS-.d.ts +0 -29
- package/dist/index.d.mts +0 -17
- package/dist/interfaces/index.d.mts +0 -12
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { useEffect } from "react";
|
|
5
|
+
import { Container } from "./styles";
|
|
6
|
+
import { LoadingBar } from "@components";
|
|
7
|
+
import { Paginate } from "./paginate";
|
|
8
|
+
import { useModal, useTheme } from "@contexts";
|
|
9
|
+
import _ from "lodash";
|
|
10
|
+
import Modal from "./modal";
|
|
11
|
+
export * from "./paginate";
|
|
12
|
+
function Table(props) {
|
|
13
|
+
var _a, _b, _c, _d, _e, _f;
|
|
14
|
+
const theme = useTheme();
|
|
15
|
+
const modal = useModal();
|
|
16
|
+
const loading = ((_a = props.loading) == null ? void 0 : _a.is) || props.loading;
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
modal.add({ component: Modal, name: "table" });
|
|
19
|
+
return () => modal.remove("table");
|
|
20
|
+
}, []);
|
|
21
|
+
const onShowLine = (key) => {
|
|
22
|
+
if (window.innerWidth > Number(_.replace(theme.content.mobileMaxWidth, "px", ""))) return;
|
|
23
|
+
let content = {};
|
|
24
|
+
_.forEach(props.options, (data, index) => {
|
|
25
|
+
var _a2, _b2;
|
|
26
|
+
const column = ((_a2 = data.column) == null ? void 0 : _a2.name) || data.column;
|
|
27
|
+
const columnName = !_.isString(column) ? props.options.length - 1 === index ? "actions" : "" : column;
|
|
28
|
+
content[columnName] = columnName === "actions" ? (_b2 = data.row) == null ? void 0 : _b2.actions : renderRowContainer(props.content[key], data);
|
|
29
|
+
});
|
|
30
|
+
modal.setProps("table", { toggle: true, content });
|
|
31
|
+
};
|
|
32
|
+
const renderRowContainer = (data, option) => {
|
|
33
|
+
var _a2, _b2, _c2, _d2;
|
|
34
|
+
return /* @__PURE__ */ jsx(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
className: `
|
|
38
|
+
iz-table-content
|
|
39
|
+
${((_a2 = option.row) == null ? void 0 : _a2.actions) ? "iz-table-action" : ""}
|
|
40
|
+
${((_b2 = option.row) == null ? void 0 : _b2.icon) ? "iz-table-identifier" : ""}
|
|
41
|
+
`,
|
|
42
|
+
style: _.isFunction((_c2 = option.row) == null ? void 0 : _c2.style) ? option.row.style(data, option) : (_d2 = option.row) == null ? void 0 : _d2.style,
|
|
43
|
+
children: renderRowContent(data, option)
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
const renderRowContent = (data, option) => {
|
|
48
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
49
|
+
if (!!((_a2 = option.row) == null ? void 0 : _a2.actions)) {
|
|
50
|
+
return /* @__PURE__ */ jsx("div", { className: "iz-table-actions", children: _.map(
|
|
51
|
+
(_b2 = option.row) == null ? void 0 : _b2.actions,
|
|
52
|
+
(action, index) => renderButton(action, data, index)
|
|
53
|
+
) });
|
|
54
|
+
}
|
|
55
|
+
if ((_c2 = option.row) == null ? void 0 : _c2.icon) {
|
|
56
|
+
return /* @__PURE__ */ jsx("div", { className: "iz-table-icon", children: /* @__PURE__ */ jsx(
|
|
57
|
+
"i",
|
|
58
|
+
{
|
|
59
|
+
"aria-hidden": true,
|
|
60
|
+
className: _.isFunction((_d2 = option.row) == null ? void 0 : _d2.icon) ? option.row.icon(data) || "fa-solid fa-circle-user" : ((_e2 = option.row) == null ? void 0 : _e2.icon) || "fa-solid fa-circle-user"
|
|
61
|
+
}
|
|
62
|
+
) });
|
|
63
|
+
}
|
|
64
|
+
return renderRowText(data, option);
|
|
65
|
+
};
|
|
66
|
+
const renderButton = (action, data, index) => {
|
|
67
|
+
return /* @__PURE__ */ jsx(
|
|
68
|
+
"button",
|
|
69
|
+
{
|
|
70
|
+
className: `iz-table-button ${_.includes(action.icon, "trash") ? "negative" : ""}`,
|
|
71
|
+
onClick: () => action.function ? action.function(data) : null,
|
|
72
|
+
disabled: action.disabled,
|
|
73
|
+
"data-tooltip": action.tooltip,
|
|
74
|
+
children: /* @__PURE__ */ jsx("i", { "aria-hidden": true, className: action.icon || "fa-solid fa-eye" })
|
|
75
|
+
},
|
|
76
|
+
index
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
const renderRowText = (data, option) => {
|
|
80
|
+
const row = option.row || {};
|
|
81
|
+
const content = data[row.name] || data;
|
|
82
|
+
let body;
|
|
83
|
+
while (!body) {
|
|
84
|
+
if (_.isString(row)) body = data[row];
|
|
85
|
+
if (_.isString(content)) body = content;
|
|
86
|
+
if (_.isFunction(row.mask)) body = row.mask(content);
|
|
87
|
+
if (_.isFunction(row.custom)) body = row.custom(content);
|
|
88
|
+
body = body != null ? body : "---";
|
|
89
|
+
}
|
|
90
|
+
return /* @__PURE__ */ jsx(
|
|
91
|
+
"div",
|
|
92
|
+
{
|
|
93
|
+
className: "iz-table-content-elipse",
|
|
94
|
+
title: _.isString(body) ? body : "",
|
|
95
|
+
children: body
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
};
|
|
99
|
+
return /* @__PURE__ */ jsxs(Container, { notFound: !((_b = props.content) == null ? void 0 : _b.length) && !props.loading, children: [
|
|
100
|
+
/* @__PURE__ */ jsx("div", { className: "iz-table-container", children: /* @__PURE__ */ jsxs("table", { children: [
|
|
101
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: _.map(
|
|
102
|
+
props.options,
|
|
103
|
+
(option, index) => {
|
|
104
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i;
|
|
105
|
+
return /* @__PURE__ */ jsx("th", { style: (_a2 = option.column) == null ? void 0 : _a2.style, children: /* @__PURE__ */ jsx(
|
|
106
|
+
"div",
|
|
107
|
+
{
|
|
108
|
+
className: `iz-table-content ${((_b2 = option.column) == null ? void 0 : _b2.action) ? `iz-table-action ${((_d2 = (_c2 = option.column) == null ? void 0 : _c2.action) == null ? void 0 : _d2.position) ? (_f2 = (_e2 = option.column) == null ? void 0 : _e2.action) == null ? void 0 : _f2.position : ""}` : ""}`,
|
|
109
|
+
children: !!((_g = option.column) == null ? void 0 : _g.action) ? renderButton(option.column.action) : _.isString(((_h = option.column) == null ? void 0 : _h.name) || option.column) ? ((_i = option.column) == null ? void 0 : _i.name) || option.column : ""
|
|
110
|
+
}
|
|
111
|
+
) }, index);
|
|
112
|
+
}
|
|
113
|
+
) }) }),
|
|
114
|
+
/* @__PURE__ */ jsx("tbody", { children: loading ? _.map(((_c = props.loading) == null ? void 0 : _c.items) || [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], (data, key) => /* @__PURE__ */ jsx("tr", { children: _.map(props.options, (data2, index) => {
|
|
115
|
+
var _a2;
|
|
116
|
+
return /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(
|
|
117
|
+
LoadingBar,
|
|
118
|
+
{
|
|
119
|
+
height: "2.5rem",
|
|
120
|
+
borderRadius: index === 0 ? "5px 0 0 5px" : ((_a2 = props.options) == null ? void 0 : _a2.length) - 1 === index ? "0 5px 5px 0" : "0",
|
|
121
|
+
margin: key === 0 ? "1.5rem 0 0" : ".5rem 0 0"
|
|
122
|
+
}
|
|
123
|
+
) }, index);
|
|
124
|
+
}) }, key)) : _.map(props.content, (data, key) => /* @__PURE__ */ jsx("tr", { children: _.map(props.options, (option, index) => /* @__PURE__ */ jsx("td", { onClick: () => index < 2 ? onShowLine(key) : null, children: renderRowContainer(data, option) }, index)) }, key)) })
|
|
125
|
+
] }) }),
|
|
126
|
+
!((_d = props.content) == null ? void 0 : _d.length) && !props.loading && /* @__PURE__ */ jsxs("div", { className: "iz-table-not-found", children: [
|
|
127
|
+
/* @__PURE__ */ jsx("p", { children: ((_e = props.notFound) == null ? void 0 : _e.title) || "Nenhuma campanha encontrado" }),
|
|
128
|
+
/* @__PURE__ */ jsx("p", { children: ((_f = props.notFound) == null ? void 0 : _f.message) || "Envie uma campanha de marketing para aparecer algum registro" })
|
|
129
|
+
] }),
|
|
130
|
+
!!props.paginate && /* @__PURE__ */ jsx(Paginate, { ...props.paginate })
|
|
131
|
+
] });
|
|
132
|
+
}
|
|
133
|
+
export {
|
|
134
|
+
Table
|
|
135
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var actions_exports = {};
|
|
21
|
+
__export(actions_exports, {
|
|
22
|
+
default: () => actions_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(actions_exports);
|
|
25
|
+
var import_content = require("@contexts/theme/content");
|
|
26
|
+
const actionConfig = {
|
|
27
|
+
"fa-solid fa-pen-to-square": { label: "editar" },
|
|
28
|
+
"fa-solid fa-trash-can": { label: "remover", color: import_content.CommonTheme.negative }
|
|
29
|
+
};
|
|
30
|
+
var actions_default = actionConfig;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { CommonTheme } from "@contexts/theme/content";
|
|
3
|
+
const actionConfig = {
|
|
4
|
+
"fa-solid fa-pen-to-square": { label: "editar" },
|
|
5
|
+
"fa-solid fa-trash-can": { label: "remover", color: CommonTheme.negative }
|
|
6
|
+
};
|
|
7
|
+
var actions_default = actionConfig;
|
|
8
|
+
export {
|
|
9
|
+
actions_default as default
|
|
10
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
"use client";
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all)
|
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
+
var modal_exports = {};
|
|
32
|
+
__export(modal_exports, {
|
|
33
|
+
default: () => Modal
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(modal_exports);
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
+
var import_styles = require("./styles");
|
|
38
|
+
var import_styles2 = require("../styles");
|
|
39
|
+
var import__ = require("../../..");
|
|
40
|
+
var import_contexts = require("@contexts");
|
|
41
|
+
var import_lodash = __toESM(require("lodash"));
|
|
42
|
+
var import_actions = __toESM(require("./actions"));
|
|
43
|
+
function Modal(props) {
|
|
44
|
+
const modal = (0, import_contexts.useModal)();
|
|
45
|
+
const content = import_lodash.default.omit(props.content, ["actions"]);
|
|
46
|
+
const actions = Object.values(import_lodash.default.pick(props.content, ["actions"]))[0];
|
|
47
|
+
const onClose = () => {
|
|
48
|
+
modal.setProps("table", { toggle: false });
|
|
49
|
+
};
|
|
50
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51
|
+
import__.Component,
|
|
52
|
+
{
|
|
53
|
+
content: [{
|
|
54
|
+
type: "Modal",
|
|
55
|
+
props: {
|
|
56
|
+
toggle: props.toggle,
|
|
57
|
+
onClose,
|
|
58
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles2.Container, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Content, { children: [
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "iz-table-modal-title", children: "Conte\xFAdo" }),
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "iz-table-modal-content", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { children: import_lodash.default.map(
|
|
61
|
+
content,
|
|
62
|
+
(value, key) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { children: [
|
|
63
|
+
!!key && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "iz-table-modal-column", children: key }),
|
|
64
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "iz-table-modal-row", children: value })
|
|
65
|
+
] }, key)
|
|
66
|
+
) }) }),
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "iz-table-modal-actions", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
68
|
+
import__.Component,
|
|
69
|
+
{
|
|
70
|
+
content: import_lodash.default.concat(import_lodash.default.map(actions, (data) => ({
|
|
71
|
+
type: "Button",
|
|
72
|
+
props: {
|
|
73
|
+
...import_actions.default[data.icon] || {},
|
|
74
|
+
onClick: data.function
|
|
75
|
+
}
|
|
76
|
+
})), {
|
|
77
|
+
type: "Button",
|
|
78
|
+
props: {
|
|
79
|
+
label: "fechar",
|
|
80
|
+
outline: true,
|
|
81
|
+
onClick: onClose
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
) })
|
|
86
|
+
] }) })
|
|
87
|
+
}
|
|
88
|
+
}]
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Content } from "./styles";
|
|
5
|
+
import { Container } from "../styles";
|
|
6
|
+
import { Component } from "../../..";
|
|
7
|
+
import { useModal } from "@contexts";
|
|
8
|
+
import _ from "lodash";
|
|
9
|
+
import actionConfig from "./actions";
|
|
10
|
+
function Modal(props) {
|
|
11
|
+
const modal = useModal();
|
|
12
|
+
const content = _.omit(props.content, ["actions"]);
|
|
13
|
+
const actions = Object.values(_.pick(props.content, ["actions"]))[0];
|
|
14
|
+
const onClose = () => {
|
|
15
|
+
modal.setProps("table", { toggle: false });
|
|
16
|
+
};
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
|
+
Component,
|
|
19
|
+
{
|
|
20
|
+
content: [{
|
|
21
|
+
type: "Modal",
|
|
22
|
+
props: {
|
|
23
|
+
toggle: props.toggle,
|
|
24
|
+
onClose,
|
|
25
|
+
children: /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsxs(Content, { children: [
|
|
26
|
+
/* @__PURE__ */ jsx("div", { className: "iz-table-modal-title", children: "Conte\xFAdo" }),
|
|
27
|
+
/* @__PURE__ */ jsx("div", { className: "iz-table-modal-content", children: /* @__PURE__ */ jsx("ul", { children: _.map(
|
|
28
|
+
content,
|
|
29
|
+
(value, key) => /* @__PURE__ */ jsxs("li", { children: [
|
|
30
|
+
!!key && /* @__PURE__ */ jsx("div", { className: "iz-table-modal-column", children: key }),
|
|
31
|
+
/* @__PURE__ */ jsx("div", { className: "iz-table-modal-row", children: value })
|
|
32
|
+
] }, key)
|
|
33
|
+
) }) }),
|
|
34
|
+
/* @__PURE__ */ jsx("div", { className: "iz-table-modal-actions", children: /* @__PURE__ */ jsx(
|
|
35
|
+
Component,
|
|
36
|
+
{
|
|
37
|
+
content: _.concat(_.map(actions, (data) => ({
|
|
38
|
+
type: "Button",
|
|
39
|
+
props: {
|
|
40
|
+
...actionConfig[data.icon] || {},
|
|
41
|
+
onClick: data.function
|
|
42
|
+
}
|
|
43
|
+
})), {
|
|
44
|
+
type: "Button",
|
|
45
|
+
props: {
|
|
46
|
+
label: "fechar",
|
|
47
|
+
outline: true,
|
|
48
|
+
onClick: onClose
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
) })
|
|
53
|
+
] }) })
|
|
54
|
+
}
|
|
55
|
+
}]
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
Modal as default
|
|
61
|
+
};
|
|
@@ -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,90 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
"use client";
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all)
|
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
+
var styles_exports = {};
|
|
32
|
+
__export(styles_exports, {
|
|
33
|
+
Content: () => Content
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(styles_exports);
|
|
36
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
37
|
+
const Content = import_styled_components.default.div`
|
|
38
|
+
padding: 1.5rem;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
gap: 1.5rem;
|
|
42
|
+
|
|
43
|
+
.iz-table-modal-title {
|
|
44
|
+
font-size: 1.2rem;
|
|
45
|
+
font-weight: 500;
|
|
46
|
+
width: 100%;
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
color: ${({ theme }) => theme.t6};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.iz-table-modal-content {
|
|
54
|
+
ul {
|
|
55
|
+
li {
|
|
56
|
+
border-bottom: solid 1px ${({ theme }) => theme.t05};
|
|
57
|
+
padding: .8rem 0;
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: space-between;
|
|
61
|
+
gap: 1rem;
|
|
62
|
+
font-size: .8rem;
|
|
63
|
+
color: ${({ theme }) => theme.t6};
|
|
64
|
+
|
|
65
|
+
&:last-child {
|
|
66
|
+
border-bottom: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.iz-table-modal-column {
|
|
70
|
+
background: ${({ theme }) => theme.t05};
|
|
71
|
+
padding: .5rem .8rem;
|
|
72
|
+
font-weight: 600;
|
|
73
|
+
border-radius: 5px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.iz-table-modal-row {
|
|
77
|
+
text-align: right;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.iz-table-modal-actions {
|
|
84
|
+
margin-top: 1rem;
|
|
85
|
+
}
|
|
86
|
+
`;
|
|
87
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
88
|
+
0 && (module.exports = {
|
|
89
|
+
Content
|
|
90
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
const Content = styled.div`
|
|
5
|
+
padding: 1.5rem;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: 1.5rem;
|
|
9
|
+
|
|
10
|
+
.iz-table-modal-title {
|
|
11
|
+
font-size: 1.2rem;
|
|
12
|
+
font-weight: 500;
|
|
13
|
+
width: 100%;
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
color: ${({ theme }) => theme.t6};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.iz-table-modal-content {
|
|
21
|
+
ul {
|
|
22
|
+
li {
|
|
23
|
+
border-bottom: solid 1px ${({ theme }) => theme.t05};
|
|
24
|
+
padding: .8rem 0;
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
gap: 1rem;
|
|
29
|
+
font-size: .8rem;
|
|
30
|
+
color: ${({ theme }) => theme.t6};
|
|
31
|
+
|
|
32
|
+
&:last-child {
|
|
33
|
+
border-bottom: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.iz-table-modal-column {
|
|
37
|
+
background: ${({ theme }) => theme.t05};
|
|
38
|
+
padding: .5rem .8rem;
|
|
39
|
+
font-weight: 600;
|
|
40
|
+
border-radius: 5px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.iz-table-modal-row {
|
|
44
|
+
text-align: right;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.iz-table-modal-actions {
|
|
51
|
+
margin-top: 1rem;
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
export {
|
|
55
|
+
Content
|
|
56
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
"use client";
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all)
|
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
+
var paginate_exports = {};
|
|
32
|
+
__export(paginate_exports, {
|
|
33
|
+
Paginate: () => Paginate
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(paginate_exports);
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
+
var import_styles = require("./styles");
|
|
38
|
+
var import_lodash = __toESM(require("lodash"));
|
|
39
|
+
function Paginate(props) {
|
|
40
|
+
const pages = () => {
|
|
41
|
+
const offset = Number(props.page.value) - 4;
|
|
42
|
+
let page = offset > 0 ? offset + 1 : 1;
|
|
43
|
+
let pages2 = [];
|
|
44
|
+
while (Number(props.total) >= page) {
|
|
45
|
+
pages2.push(page);
|
|
46
|
+
page++;
|
|
47
|
+
}
|
|
48
|
+
pages2 = import_lodash.default.slice(pages2, 0, 5);
|
|
49
|
+
if (Number(props.page.value) + 1 > 5) pages2 = import_lodash.default.concat(["1.."], pages2);
|
|
50
|
+
if (Number(props.total) > 6 && Number(props.page.value) + 1 < Number(props.total)) return import_lodash.default.concat(pages2, `..${props.total}`);
|
|
51
|
+
return pages2;
|
|
52
|
+
};
|
|
53
|
+
return Number(props.total) > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Container, { children: [
|
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
className: "paginate back",
|
|
58
|
+
onClick: () => props.page.set ? props.page.set(
|
|
59
|
+
props.page.value ? props.page.value - 1 : props.page.value
|
|
60
|
+
) : null,
|
|
61
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { "aria-hidden": true, className: "fa-solid fa-chevron-left" })
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
import_lodash.default.map(
|
|
65
|
+
pages(),
|
|
66
|
+
(page, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
className: "paginate page",
|
|
70
|
+
"data-current": String(props.page.value === Number(import_lodash.default.replace(page, /\D/g, "")) - 1),
|
|
71
|
+
onClick: () => props.page.set ? props.page.set(Number(import_lodash.default.replace(page, /\D/g, "")) - 1) : null,
|
|
72
|
+
children: page
|
|
73
|
+
},
|
|
74
|
+
index
|
|
75
|
+
)
|
|
76
|
+
),
|
|
77
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
78
|
+
"div",
|
|
79
|
+
{
|
|
80
|
+
className: "paginate next",
|
|
81
|
+
onClick: () => props.page.set ? props.page.set(
|
|
82
|
+
props.page.value !== props.total - 1 ? props.page.value + 1 : props.page.value
|
|
83
|
+
) : null,
|
|
84
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { "aria-hidden": true, className: "fa-solid fa-chevron-right" })
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
] });
|
|
88
|
+
}
|
|
89
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
90
|
+
0 && (module.exports = {
|
|
91
|
+
Paginate
|
|
92
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Container } from "./styles";
|
|
5
|
+
import _ from "lodash";
|
|
6
|
+
function Paginate(props) {
|
|
7
|
+
const pages = () => {
|
|
8
|
+
const offset = Number(props.page.value) - 4;
|
|
9
|
+
let page = offset > 0 ? offset + 1 : 1;
|
|
10
|
+
let pages2 = [];
|
|
11
|
+
while (Number(props.total) >= page) {
|
|
12
|
+
pages2.push(page);
|
|
13
|
+
page++;
|
|
14
|
+
}
|
|
15
|
+
pages2 = _.slice(pages2, 0, 5);
|
|
16
|
+
if (Number(props.page.value) + 1 > 5) pages2 = _.concat(["1.."], pages2);
|
|
17
|
+
if (Number(props.total) > 6 && Number(props.page.value) + 1 < Number(props.total)) return _.concat(pages2, `..${props.total}`);
|
|
18
|
+
return pages2;
|
|
19
|
+
};
|
|
20
|
+
return Number(props.total) > 1 && /* @__PURE__ */ jsxs(Container, { children: [
|
|
21
|
+
/* @__PURE__ */ jsx(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
className: "paginate back",
|
|
25
|
+
onClick: () => props.page.set ? props.page.set(
|
|
26
|
+
props.page.value ? props.page.value - 1 : props.page.value
|
|
27
|
+
) : null,
|
|
28
|
+
children: /* @__PURE__ */ jsx("i", { "aria-hidden": true, className: "fa-solid fa-chevron-left" })
|
|
29
|
+
}
|
|
30
|
+
),
|
|
31
|
+
_.map(
|
|
32
|
+
pages(),
|
|
33
|
+
(page, index) => /* @__PURE__ */ jsx(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
className: "paginate page",
|
|
37
|
+
"data-current": String(props.page.value === Number(_.replace(page, /\D/g, "")) - 1),
|
|
38
|
+
onClick: () => props.page.set ? props.page.set(Number(_.replace(page, /\D/g, "")) - 1) : null,
|
|
39
|
+
children: page
|
|
40
|
+
},
|
|
41
|
+
index
|
|
42
|
+
)
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ jsx(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
className: "paginate next",
|
|
48
|
+
onClick: () => props.page.set ? props.page.set(
|
|
49
|
+
props.page.value !== props.total - 1 ? props.page.value + 1 : props.page.value
|
|
50
|
+
) : null,
|
|
51
|
+
children: /* @__PURE__ */ jsx("i", { "aria-hidden": true, className: "fa-solid fa-chevron-right" })
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
] });
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
Paginate
|
|
58
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Container: any;
|