@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.
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +10 -42
- package/dist/components/styles.js +3 -9
- package/dist/components/types/avatar/index.d.ts +1 -1
- package/dist/components/types/avatar/index.js +15 -21
- package/dist/components/types/avatar/styles.js +2 -8
- package/dist/components/types/badge/index.d.ts +1 -1
- package/dist/components/types/badge/index.js +7 -13
- package/dist/components/types/badge/styles.js +2 -8
- package/dist/components/types/block/index.d.ts +1 -1
- package/dist/components/types/block/index.js +6 -9
- package/dist/components/types/block/styles.js +3 -9
- package/dist/components/types/chart/index.d.ts +1 -1
- package/dist/components/types/chart/index.js +15 -21
- package/dist/components/types/chart/styles.js +2 -8
- package/dist/components/types/credit-card/assets/index.js +1 -3
- package/dist/components/types/credit-card/card/index.d.ts +1 -1
- package/dist/components/types/credit-card/card/index.js +12 -18
- package/dist/components/types/credit-card/card/styles.js +2 -8
- package/dist/components/types/credit-card/functions/index.d.ts +1 -1
- package/dist/components/types/credit-card/functions/index.js +6 -12
- package/dist/components/types/credit-card/functions/styles.js +2 -8
- package/dist/components/types/credit-card/index.d.ts +1 -1
- package/dist/components/types/credit-card/index.js +6 -12
- package/dist/components/types/credit-card/styles.js +2 -8
- package/dist/components/types/credit-card/tools/index.js +8 -15
- package/dist/components/types/form/index.d.ts +1 -1
- package/dist/components/types/form/index.js +24 -56
- package/dist/components/types/form/styles.js +2 -8
- package/dist/components/types/form/types/button/index.d.ts +1 -1
- package/dist/components/types/form/types/button/index.js +6 -12
- package/dist/components/types/form/types/button/loading/index.js +4 -7
- package/dist/components/types/form/types/button/loading/styles.js +2 -8
- package/dist/components/types/form/types/button/styles.js +2 -8
- package/dist/components/types/form/types/datetime/index.d.ts +1 -1
- package/dist/components/types/form/types/datetime/index.js +7 -13
- package/dist/components/types/form/types/datetime/styles.js +2 -8
- package/dist/components/types/form/types/file/index.d.ts +1 -1
- package/dist/components/types/form/types/file/index.js +8 -11
- package/dist/components/types/form/types/file/styles.js +2 -8
- package/dist/components/types/form/types/index.js +7 -23
- package/dist/components/types/form/types/input/index.d.ts +1 -1
- package/dist/components/types/form/types/input/index.js +9 -15
- package/dist/components/types/form/types/input/styles.js +2 -8
- package/dist/components/types/form/types/label/index.d.ts +1 -1
- package/dist/components/types/form/types/label/index.js +4 -7
- package/dist/components/types/form/types/label/styles.js +2 -8
- package/dist/components/types/form/types/select/index.d.ts +1 -1
- package/dist/components/types/form/types/select/index.js +9 -15
- package/dist/components/types/form/types/select/styles.js +2 -8
- package/dist/components/types/form/types/textarea/index.d.ts +1 -1
- package/dist/components/types/form/types/textarea/index.js +7 -13
- package/dist/components/types/form/types/textarea/styles.js +2 -8
- package/dist/components/types/index.js +11 -27
- package/dist/components/types/loading/app/index.d.ts +1 -1
- package/dist/components/types/loading/app/index.js +5 -8
- package/dist/components/types/loading/app/styles.js +2 -8
- package/dist/components/types/loading/bar/index.d.ts +1 -1
- package/dist/components/types/loading/bar/index.js +4 -7
- package/dist/components/types/loading/bar/styles.js +2 -8
- package/dist/components/types/loading/index.js +2 -18
- package/dist/components/types/logo/index.d.ts +1 -1
- package/dist/components/types/logo/index.js +4 -7
- package/dist/components/types/logo/styles.js +2 -8
- package/dist/components/types/lottie/animations/index.js +2 -7
- package/dist/components/types/lottie/index.d.ts +1 -1
- package/dist/components/types/lottie/index.js +8 -14
- package/dist/components/types/lottie/styles.js +2 -8
- package/dist/components/types/modal/index.d.ts +1 -1
- package/dist/components/types/modal/index.js +9 -15
- package/dist/components/types/modal/styles.js +2 -8
- package/dist/components/types/table/index.d.ts +1 -1
- package/dist/components/types/table/index.js +34 -54
- package/dist/components/types/table/modal/actions.js +3 -5
- package/dist/components/types/table/modal/index.d.ts +1 -1
- package/dist/components/types/table/modal/index.js +14 -20
- package/dist/components/types/table/modal/styles.js +2 -8
- package/dist/components/types/table/paginate/index.d.ts +1 -1
- package/dist/components/types/table/paginate/index.js +10 -16
- package/dist/components/types/table/paginate/styles.js +2 -8
- package/dist/components/types/table/styles.js +2 -8
- package/dist/contexts/icon/assets/brands/index.js +1 -3
- package/dist/contexts/icon/assets/index.js +7 -12
- package/dist/contexts/icon/assets/regular/index.js +1 -3
- package/dist/contexts/icon/assets/solid/index.js +1 -3
- package/dist/contexts/icon/index.d.ts +1 -1
- package/dist/contexts/icon/index.js +18 -25
- package/dist/contexts/icon/styles.js +2 -8
- package/dist/contexts/index.js +4 -20
- package/dist/contexts/modal/index.d.ts +1 -1
- package/dist/contexts/modal/index.js +19 -26
- package/dist/contexts/modal/styles.js +2 -8
- package/dist/contexts/theme/content.d.ts +1 -1
- package/dist/contexts/theme/content.js +4 -7
- package/dist/contexts/theme/index.d.ts +1 -1
- package/dist/contexts/theme/index.js +17 -21
- package/dist/contexts/theme/styles.js +2 -8
- package/dist/contexts/tooltip/index.js +12 -19
- package/dist/contexts/tooltip/styles.js +2 -8
- package/dist/index.js +4 -20
- package/dist/interfaces/components/avatar/index.js +1 -2
- package/dist/interfaces/components/badge/index.js +1 -2
- package/dist/interfaces/components/block/index.d.ts +1 -1
- package/dist/interfaces/components/block/index.js +1 -2
- package/dist/interfaces/components/chart/index.js +1 -2
- package/dist/interfaces/components/credit-card/index.js +1 -2
- package/dist/interfaces/components/form/button/index.js +1 -2
- package/dist/interfaces/components/form/datetime/index.js +1 -2
- package/dist/interfaces/components/form/file/index.js +1 -2
- package/dist/interfaces/components/form/index.js +7 -23
- package/dist/interfaces/components/form/input/index.js +1 -2
- package/dist/interfaces/components/form/label/index.js +1 -2
- package/dist/interfaces/components/form/select/index.js +1 -2
- package/dist/interfaces/components/form/textarea/index.js +1 -2
- package/dist/interfaces/components/index.js +11 -27
- package/dist/interfaces/components/loading/app/index.js +1 -2
- package/dist/interfaces/components/loading/bar/index.js +1 -2
- package/dist/interfaces/components/loading/index.js +2 -18
- package/dist/interfaces/components/logo/index.js +1 -2
- package/dist/interfaces/components/lottie/index.js +1 -2
- package/dist/interfaces/components/modal/index.d.ts +1 -1
- package/dist/interfaces/components/modal/index.js +1 -2
- package/dist/interfaces/components/table/index.js +1 -17
- package/dist/interfaces/components/table/paginate/index.js +1 -2
- package/dist/interfaces/contexts/icon/index.js +1 -2
- package/dist/interfaces/contexts/index.js +4 -20
- package/dist/interfaces/contexts/modal/index.js +1 -2
- package/dist/interfaces/contexts/theme/index.js +1 -2
- package/dist/interfaces/contexts/tooltip/index.js +1 -2
- package/dist/interfaces/index.js +2 -18
- package/dist/styled.d.ts +1 -1
- package/dist/styled.js +1 -3
- package/dist/tsup.config.js +2 -4
- package/package.json +1 -1
|
@@ -1,85 +1,53 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
-
if (mod && mod.__esModule) return mod;
|
|
21
|
-
var result = {};
|
|
22
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
-
__setModuleDefault(result, mod);
|
|
24
|
-
return result;
|
|
25
|
-
};
|
|
26
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
27
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
28
|
-
};
|
|
29
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
31
|
-
};
|
|
32
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.Form = Form;
|
|
34
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
35
|
-
const react_1 = __importStar(require("react"));
|
|
36
|
-
const styles_1 = require("./styles");
|
|
37
|
-
const zod_1 = require("zod");
|
|
38
|
-
const react_hook_form_1 = require("react-hook-form");
|
|
39
|
-
const zod_2 = require("@hookform/resolvers/zod");
|
|
40
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
41
|
-
const Types = __importStar(require("./types"));
|
|
42
|
-
__exportStar(require("./types"), exports);
|
|
43
|
-
function Form(props) {
|
|
44
|
-
const formRef = props.formRef || (0, react_1.useRef)({});
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React, { useEffect, useRef } from "react";
|
|
4
|
+
import { Container } from "./styles";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { useForm } from "react-hook-form";
|
|
7
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
8
|
+
import _ from "lodash";
|
|
9
|
+
import * as Types from "./types";
|
|
10
|
+
export * from "./types";
|
|
11
|
+
export function Form(props) {
|
|
12
|
+
const formRef = props.formRef || useRef({});
|
|
45
13
|
const setSchema = () => {
|
|
46
14
|
const schema = {};
|
|
47
|
-
|
|
15
|
+
_.forEach(props.inputs, (data) => {
|
|
48
16
|
if (!data.validation)
|
|
49
17
|
return;
|
|
50
18
|
schema[data.name] = data.validation;
|
|
51
19
|
});
|
|
52
20
|
if (props.validation)
|
|
53
|
-
return props.validation(
|
|
54
|
-
return
|
|
21
|
+
return props.validation(z.object(schema));
|
|
22
|
+
return z.object(schema);
|
|
55
23
|
};
|
|
56
24
|
const schema = setSchema();
|
|
57
|
-
const { register, handleSubmit, reset, formState: { errors } } =
|
|
58
|
-
resolver:
|
|
25
|
+
const { register, handleSubmit, reset, formState: { errors } } = useForm({
|
|
26
|
+
resolver: zodResolver(schema),
|
|
59
27
|
defaultValues: props.defaultValues,
|
|
60
28
|
mode: "all"
|
|
61
29
|
});
|
|
62
|
-
|
|
30
|
+
useEffect(() => {
|
|
63
31
|
if (!props.clearWhen)
|
|
64
32
|
return;
|
|
65
33
|
reset(undefined, { keepErrors: false });
|
|
66
34
|
}, [props.clearWhen]);
|
|
67
|
-
|
|
35
|
+
useEffect(() => {
|
|
68
36
|
var _a;
|
|
69
37
|
if (!props.defaultValues || !((_a = Object.keys(props.defaultValues || {})) === null || _a === void 0 ? void 0 : _a.length))
|
|
70
38
|
return;
|
|
71
|
-
|
|
72
|
-
const input =
|
|
39
|
+
_.forEach(props.defaultValues, (value, key) => {
|
|
40
|
+
const input = _.find(props.inputs, (data) => data.name === key);
|
|
73
41
|
props.defaultValues[key] = input.mask ? input.mask(value) : value;
|
|
74
42
|
});
|
|
75
43
|
reset(props.defaultValues, { keepErrors: false });
|
|
76
44
|
}, [props.defaultValues]);
|
|
77
45
|
const component = (data) => {
|
|
78
46
|
var _a;
|
|
79
|
-
const component = Types[
|
|
47
|
+
const component = Types[_.camelCase(data.type)];
|
|
80
48
|
const TypeComponent = component || Types.InputText;
|
|
81
|
-
return (
|
|
49
|
+
return _jsx(TypeComponent, { ..._.omit(data, ["validation"]), id: data.name, type: component ? undefined : data.type, error: (_a = errors[data.name]) === null || _a === void 0 ? void 0 : _a.message, register: register });
|
|
82
50
|
};
|
|
83
|
-
return ((
|
|
84
|
-
(
|
|
51
|
+
return (_jsxs(Container, { ref: formRef, onSubmit: handleSubmit(props.onSubmit), children: [_.map(props.inputs, (data, index) => _jsx(React.Fragment, { children: component(data) }, index)), _.isArray(props.buttons) &&
|
|
52
|
+
_jsx("div", { className: "form-buttons", children: _.map(props.buttons, (data, index) => _jsx(Types.Button, { ...data }, index)) })] }));
|
|
85
53
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
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.form `
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
export const Container = styled.form `
|
|
10
4
|
width: 100%;
|
|
11
5
|
|
|
12
6
|
.form-buttons {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IButton } from "interfaces";
|
|
1
|
+
import { IButton } from "@interfaces";
|
|
2
2
|
export declare function Button(props: IButton): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
-
const styles_1 = require("./styles");
|
|
10
|
-
const loading_1 = require("./loading");
|
|
11
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
12
|
-
function Button(props) {
|
|
13
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.Container, { loading: String(!!props.loading), disabled: props.disabled, type: props.type || "button", ...lodash_1.default.omit(props, ["loading", "type"]), children: [!!props.loading && (0, jsx_runtime_1.jsx)(loading_1.Loading, {}), (0, jsx_runtime_1.jsx)("span", { children: props.label })] }));
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Container } from "./styles";
|
|
4
|
+
import { Loading } from "./loading";
|
|
5
|
+
import _ from "lodash";
|
|
6
|
+
export function Button(props) {
|
|
7
|
+
return (_jsxs(Container, { loading: String(!!props.loading), disabled: props.disabled, type: props.type || "button", ..._.omit(props, ["loading", "type"]), children: [!!props.loading && _jsx(Loading, {}), _jsx("span", { children: props.label })] }));
|
|
14
8
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const styles_1 = require("./styles");
|
|
7
|
-
function Loading() {
|
|
8
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.Container, { children: [(0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)("div", {})] }));
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Container } from "./styles";
|
|
4
|
+
export function Loading() {
|
|
5
|
+
return (_jsxs(Container, { children: [_jsx("div", {}), _jsx("div", {}), _jsx("div", {})] }));
|
|
9
6
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
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
|
justify-content: space-between;
|
|
12
6
|
align-items: center;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
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.button `
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
export const Container = styled.button `
|
|
10
4
|
border-radius: 5px;
|
|
11
5
|
font-size: .8rem;
|
|
12
6
|
font-weight: 500;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IInputDateTime } from "interfaces";
|
|
1
|
+
import { IInputDateTime } from "@interfaces";
|
|
2
2
|
export declare function InputDateTime(props: IInputDateTime): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.InputDateTime = InputDateTime;
|
|
8
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
-
const styles_1 = require("./styles");
|
|
10
|
-
const label_1 = require("../label");
|
|
11
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
12
|
-
function InputDateTime(props) {
|
|
2
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Container } from "./styles";
|
|
4
|
+
import { InputLabel } from "../label";
|
|
5
|
+
import _ from "lodash";
|
|
6
|
+
export function InputDateTime(props) {
|
|
13
7
|
const register = (props.register || ((name) => ({})))(props.name || "");
|
|
14
8
|
const onChange = (event) => {
|
|
15
9
|
const value = event.target.value || "";
|
|
@@ -19,8 +13,8 @@ function InputDateTime(props) {
|
|
|
19
13
|
if (props.onChange)
|
|
20
14
|
props.onChange(event);
|
|
21
15
|
};
|
|
22
|
-
return ((
|
|
16
|
+
return (_jsxs(Container, { className: props.className, error: props.error, children: [!!props.label && _jsxs(InputLabel, { children: [props.label, props.required ? "*" : ""] }), _jsx("div", { className: "iz-input-content", children: _jsx("input", { ..._.omit(props, ["className", "onChange", "mask", "type", "required", "register"]), type: "datetime-local", onFocus: () => {
|
|
23
17
|
if (props.onFocus)
|
|
24
18
|
props.onFocus(props.name);
|
|
25
|
-
}, maxLength: props.maxLength || 255, ...register, onChange: onChange }) }), !!props.error && ((
|
|
19
|
+
}, maxLength: props.maxLength || 255, ...register, onChange: onChange }) }), !!props.error && (_jsx("div", { className: "iz-input-error", children: props.error }))] }));
|
|
26
20
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
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
|
padding-top: .3rem;
|
|
12
6
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IInputFile } from "interfaces";
|
|
1
|
+
import { IInputFile } from "@interfaces";
|
|
2
2
|
export declare function InputFile(props: IInputFile): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const styles_1 = require("./styles");
|
|
8
|
-
const label_1 = require("../label");
|
|
9
|
-
function InputFile(props) {
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useRef } from "react";
|
|
4
|
+
import { Container } from "./styles";
|
|
5
|
+
import { InputLabel } from "../label";
|
|
6
|
+
export function InputFile(props) {
|
|
10
7
|
var _a;
|
|
11
|
-
const inputRef =
|
|
8
|
+
const inputRef = useRef({});
|
|
12
9
|
const register = (props.register || ((name) => ({})))(props.name || "");
|
|
13
10
|
const readImage = (data) => {
|
|
14
11
|
if (props.onPreview)
|
|
@@ -16,12 +13,12 @@ function InputFile(props) {
|
|
|
16
13
|
if (props.onChange)
|
|
17
14
|
props.onChange(data);
|
|
18
15
|
};
|
|
19
|
-
return ((
|
|
16
|
+
return (_jsxs(Container, { className: props.className, error: props.error, disabled: props.disabled, children: [_jsx("input", { hidden: true, type: "file", id: "file", accept: "image/*", ref: inputRef, disabled: props.disabled, name: props.name, onFocus: () => {
|
|
20
17
|
if (props.onFocus)
|
|
21
18
|
props.onFocus(props.name);
|
|
22
19
|
}, ...register, onChange: (e) => {
|
|
23
20
|
var _a;
|
|
24
21
|
register.onChange(e);
|
|
25
22
|
readImage((_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0]);
|
|
26
|
-
} }), !!props.label && (
|
|
23
|
+
} }), !!props.label && _jsxs(InputLabel, { children: [props.label, props.required ? "*" : ""] }), _jsx("div", { className: "iz-image-content", onClick: () => inputRef.current.click(), children: ((_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.value) || "selecione uma imagem" }), !!props.error && (_jsx("div", { className: "iz-input-error", children: props.error }))] }));
|
|
27
24
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
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
|
padding-top: .3rem;
|
|
12
6
|
|
|
@@ -1,23 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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("./file"), exports);
|
|
18
|
-
__exportStar(require("./label"), exports);
|
|
19
|
-
__exportStar(require("./input"), exports);
|
|
20
|
-
__exportStar(require("./select"), exports);
|
|
21
|
-
__exportStar(require("./button"), exports);
|
|
22
|
-
__exportStar(require("./datetime"), exports);
|
|
23
|
-
__exportStar(require("./textarea"), exports);
|
|
1
|
+
export * from "./file";
|
|
2
|
+
export * from "./label";
|
|
3
|
+
export * from "./input";
|
|
4
|
+
export * from "./select";
|
|
5
|
+
export * from "./button";
|
|
6
|
+
export * from "./datetime";
|
|
7
|
+
export * from "./textarea";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IInputText } from "interfaces";
|
|
1
|
+
import { IInputText } from "@interfaces";
|
|
2
2
|
export declare function InputText(props: IInputText): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const react_1 = require("react");
|
|
10
|
-
const styles_1 = require("./styles");
|
|
11
|
-
const label_1 = require("../label");
|
|
12
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
13
|
-
function InputText(props) {
|
|
14
|
-
const [showPassword, setShowPassword] = (0, react_1.useState)(false);
|
|
2
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Container } from "./styles";
|
|
5
|
+
import { InputLabel } from "../label";
|
|
6
|
+
import _ from "lodash";
|
|
7
|
+
export function InputText(props) {
|
|
8
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
15
9
|
const register = (props.register || ((name) => ({})))(props.name || "");
|
|
16
10
|
const onChange = (event) => {
|
|
17
11
|
const value = event.target.value || "";
|
|
@@ -21,8 +15,8 @@ function InputText(props) {
|
|
|
21
15
|
if (props.onChange)
|
|
22
16
|
props.onChange(value);
|
|
23
17
|
};
|
|
24
|
-
return ((
|
|
18
|
+
return (_jsxs(Container, { className: props.className, error: props.error, password: props.type === "password", children: [!!props.label && _jsxs(InputLabel, { children: [props.label, props.required ? "*" : ""] }), _jsxs("div", { className: "iz-input-content", children: [_jsx("input", { ..._.omit(props, ["className", "register", "mask"]), type: props.type === "password" ? showPassword ? "text" : "password" : props.type, maxLength: props.maxLength || 255, onFocus: () => {
|
|
25
19
|
if (props.onFocus)
|
|
26
20
|
props.onFocus(props.name);
|
|
27
|
-
}, ...register, onChange: onChange }), props.type === "password" && ((
|
|
21
|
+
}, ...register, onChange: onChange }), props.type === "password" && (_jsx("i", { "aria-hidden": true, className: showPassword ? "fa-solid fa-eye-slash" : "fa-solid fa-eye", onClick: () => setShowPassword(!showPassword) }))] }), !!props.error && (_jsx("div", { className: "iz-input-error", children: props.error }))] }));
|
|
28
22
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
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
|
padding-top: .3rem;
|
|
12
6
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IInputLabel } from "interfaces";
|
|
1
|
+
import { IInputLabel } from "@interfaces";
|
|
2
2
|
export declare function InputLabel(props: IInputLabel): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const styles_1 = require("./styles");
|
|
7
|
-
function InputLabel(props) {
|
|
8
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.Container, { className: props.className, children: props.children }));
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Container } from "./styles";
|
|
4
|
+
export function InputLabel(props) {
|
|
5
|
+
return (_jsx(Container, { className: props.className, children: props.children }));
|
|
9
6
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
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.label `
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
export const Container = styled.label `
|
|
10
4
|
font-size: .8rem;
|
|
11
5
|
font-weight: 500;
|
|
12
6
|
color: ${({ theme }) => theme.t6};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IInputSelect } from "interfaces";
|
|
1
|
+
import { IInputSelect } from "@interfaces";
|
|
2
2
|
export declare function InputSelect(props: IInputSelect): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const react_1 = require("react");
|
|
10
|
-
const styles_1 = require("./styles");
|
|
11
|
-
const label_1 = require("../label");
|
|
12
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
13
|
-
function InputSelect(props) {
|
|
14
|
-
const [focus, setFocus] = (0, react_1.useState)(false);
|
|
2
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Container } from "./styles";
|
|
5
|
+
import { InputLabel } from "../label";
|
|
6
|
+
import _ from "lodash";
|
|
7
|
+
export function InputSelect(props) {
|
|
8
|
+
const [focus, setFocus] = useState(false);
|
|
15
9
|
const register = (props.register || ((name) => ({})))(props.name || "");
|
|
16
10
|
const onChange = (event) => {
|
|
17
11
|
const value = event.target.value || "";
|
|
@@ -20,12 +14,12 @@ function InputSelect(props) {
|
|
|
20
14
|
if (props.onChange)
|
|
21
15
|
props.onChange(value);
|
|
22
16
|
};
|
|
23
|
-
return ((
|
|
17
|
+
return (_jsxs(Container, { className: props.className, error: props.error, children: [!!props.label && _jsxs(InputLabel, { children: [props.label, props.required ? "*" : ""] }), _jsxs("div", { className: "iz-input-content", children: [_jsx("select", { ..._.omit(props, ["className", "onChange", "onFocus", "options", "onMouseDown", "onBlur", "maxLength", "required", "register"]), onMouseDown: () => setFocus(!focus), onFocus: () => {
|
|
24
18
|
if (props.onFocus)
|
|
25
19
|
props.onFocus(props.name);
|
|
26
20
|
}, ...register, onBlur: (event) => {
|
|
27
21
|
if (register.onBlur)
|
|
28
22
|
register.onBlur(event);
|
|
29
23
|
setFocus(false);
|
|
30
|
-
}, onChange: onChange, children:
|
|
24
|
+
}, onChange: onChange, children: _.map(props.options, (data, index) => _jsx("option", { value: Object.keys(data), children: Object.values(data) }, index)) }), _jsx("i", { "aria-hidden": true, className: focus ? "fa-solid fa-chevron-up" : "fa-solid fa-chevron-down" })] }), !!props.error && (_jsx("div", { className: "iz-input-error", children: props.error }))] }));
|
|
31
25
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
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
|
padding-top: .3rem;
|
|
12
6
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IInputTextarea } from "interfaces";
|
|
1
|
+
import { IInputTextarea } from "@interfaces";
|
|
2
2
|
export declare function InputTextarea(props: IInputTextarea): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.InputTextarea = InputTextarea;
|
|
8
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
-
const styles_1 = require("./styles");
|
|
10
|
-
const label_1 = require("../label");
|
|
11
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
12
|
-
function InputTextarea(props) {
|
|
2
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Container } from "./styles";
|
|
4
|
+
import { InputLabel } from "../label";
|
|
5
|
+
import _ from "lodash";
|
|
6
|
+
export function InputTextarea(props) {
|
|
13
7
|
const register = (props.register || ((name) => ({})))(props.name || "");
|
|
14
8
|
const onChange = (event) => {
|
|
15
9
|
const value = event.target.value || "";
|
|
@@ -19,8 +13,8 @@ function InputTextarea(props) {
|
|
|
19
13
|
if (props.onChange)
|
|
20
14
|
props.onChange(value);
|
|
21
15
|
};
|
|
22
|
-
return ((
|
|
16
|
+
return (_jsxs(Container, { className: props.className, error: props.error, children: [!!props.label && _jsxs(InputLabel, { children: [props.label, props.required ? "*" : ""] }), _jsx("div", { className: "iz-input-content", children: _jsx("textarea", { ..._.omit(props, ["onFocus", "maxLength", "className", "onChange", "mask", "rows", "required", "register"]), maxLength: props.maxLength, rows: props.rows || 5, onFocus: () => {
|
|
23
17
|
if (props.onFocus)
|
|
24
18
|
props.onFocus(props.name);
|
|
25
|
-
}, ...register, onChange: onChange }) }), !!props.error && ((
|
|
19
|
+
}, ...register, onChange: onChange }) }), !!props.error && (_jsx("div", { className: "iz-input-error", children: props.error }))] }));
|
|
26
20
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
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
|
padding-top: .3rem;
|
|
12
6
|
|
|
@@ -1,27 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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("./table"), exports);
|
|
18
|
-
__exportStar(require("./loading"), exports);
|
|
19
|
-
__exportStar(require("./modal"), exports);
|
|
20
|
-
__exportStar(require("./badge"), exports);
|
|
21
|
-
__exportStar(require("./logo"), exports);
|
|
22
|
-
__exportStar(require("./form"), exports);
|
|
23
|
-
__exportStar(require("./chart"), exports);
|
|
24
|
-
__exportStar(require("./avatar"), exports);
|
|
25
|
-
__exportStar(require("./lottie"), exports);
|
|
26
|
-
__exportStar(require("./credit-card"), exports);
|
|
27
|
-
__exportStar(require("./block"), exports);
|
|
1
|
+
export * from "./table";
|
|
2
|
+
export * from "./loading";
|
|
3
|
+
export * from "./modal";
|
|
4
|
+
export * from "./badge";
|
|
5
|
+
export * from "./logo";
|
|
6
|
+
export * from "./form";
|
|
7
|
+
export * from "./chart";
|
|
8
|
+
export * from "./avatar";
|
|
9
|
+
export * from "./lottie";
|
|
10
|
+
export * from "./credit-card";
|
|
11
|
+
export * from "./block";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ILoadingApp } from "interfaces";
|
|
1
|
+
import { ILoadingApp } from "@interfaces";
|
|
2
2
|
export declare function LoadingApp(props: ILoadingApp): import("react/jsx-runtime").JSX.Element;
|