@gustavo-valsechi/client 1.4.356 → 1.4.358
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/src/components/types/form/types/datetime/picker/index.js +0 -2
- package/dist/src/components/types/form/types/datetime/picker/index.mjs +0 -2
- package/dist/src/components/types/form/types/select/index.js +13 -15
- package/dist/src/components/types/form/types/select/index.mjs +15 -17
- package/dist/src/components/types/form/types/select/options/index.d.ts +1 -1
- package/dist/src/components/types/form/types/select/options/index.js +13 -8
- package/dist/src/components/types/form/types/select/options/index.mjs +14 -9
- package/dist/src/components/types/form/types/select/options/option/index.d.ts +3 -0
- package/dist/src/components/types/form/types/select/options/option/index.js +52 -0
- package/dist/src/components/types/form/types/select/options/option/index.mjs +22 -0
- package/dist/src/components/types/form/types/select/options/option/styles.d.ts +1 -0
- package/dist/src/components/types/form/types/select/options/option/styles.js +76 -0
- package/dist/src/components/types/form/types/select/options/option/styles.mjs +42 -0
- package/dist/src/components/types/form/types/select/options/styles.js +4 -0
- package/dist/src/components/types/form/types/select/options/styles.mjs +4 -0
- package/package.json +2 -2
|
@@ -49,8 +49,6 @@ function InputDateTimePicker(props) {
|
|
|
49
49
|
const theme = (0, import_contexts.useTheme)();
|
|
50
50
|
const [dateTime, setDateTime] = (0, import_react.useState)(import_utils.default.moment().startOf("minutes"));
|
|
51
51
|
(0, import_react.useEffect)(() => {
|
|
52
|
-
const valueMoment = import_utils.default.moment(props.value || void 0).format("YYYY-MM-DD HH:mm");
|
|
53
|
-
if (valueMoment === memory.format("YYYY-MM-DD HH:mm")) return;
|
|
54
52
|
setDateTime(import_utils.default.moment(props.value || void 0).startOf("minutes"));
|
|
55
53
|
}, [props.value]);
|
|
56
54
|
const onChange = (value) => {
|
|
@@ -16,8 +16,6 @@ function InputDateTimePicker(props) {
|
|
|
16
16
|
const theme = useTheme();
|
|
17
17
|
const [dateTime, setDateTime] = useState(Utils.moment().startOf("minutes"));
|
|
18
18
|
useEffect(() => {
|
|
19
|
-
const valueMoment = Utils.moment(props.value || void 0).format("YYYY-MM-DD HH:mm");
|
|
20
|
-
if (valueMoment === memory.format("YYYY-MM-DD HH:mm")) return;
|
|
21
19
|
setDateTime(Utils.moment(props.value || void 0).startOf("minutes"));
|
|
22
20
|
}, [props.value]);
|
|
23
21
|
const onChange = (value) => {
|
|
@@ -41,6 +41,8 @@ var import_error = require("../error");
|
|
|
41
41
|
var import_contexts = require("../../../../../contexts");
|
|
42
42
|
var import_lodash = __toESM(require("lodash"));
|
|
43
43
|
var import_options = __toESM(require("./options"));
|
|
44
|
+
var import_option = __toESM(require("./options/option"));
|
|
45
|
+
var import_utils = __toESM(require("@gustavo-valsechi/utils"));
|
|
44
46
|
function InputSelect(props) {
|
|
45
47
|
var _a, _b;
|
|
46
48
|
const containerRef = (0, import_react.useRef)(null);
|
|
@@ -50,7 +52,7 @@ function InputSelect(props) {
|
|
|
50
52
|
const [filter, setFilter] = (0, import_react.useState)("");
|
|
51
53
|
const register = (props.register || ((name) => ({})))(props.name || "");
|
|
52
54
|
const inputValue = ((_a = props.watch) == null ? void 0 : _a.call(props, props.name)) || "";
|
|
53
|
-
const
|
|
55
|
+
const inputLabel = (0, import_option.default)({ content: (_b = props.options) == null ? void 0 : _b[inputValue] }) || /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "input-label-value-placeholder", children: "selecione" });
|
|
54
56
|
(0, import_react.useEffect)(() => {
|
|
55
57
|
var _a2;
|
|
56
58
|
if (!(inputRef == null ? void 0 : inputRef.current) || !(containerRef == null ? void 0 : containerRef.current)) return;
|
|
@@ -62,20 +64,16 @@ function InputSelect(props) {
|
|
|
62
64
|
...props,
|
|
63
65
|
inputRef,
|
|
64
66
|
register,
|
|
65
|
-
width: ((_a2 = containerRef == null ? void 0 : containerRef.current) == null ? void 0 : _a2.offsetWidth) - 1 || 0
|
|
67
|
+
width: ((_a2 = containerRef == null ? void 0 : containerRef.current) == null ? void 0 : _a2.offsetWidth) - 1 || 0,
|
|
68
|
+
value: inputValue
|
|
66
69
|
}
|
|
67
70
|
)
|
|
68
71
|
});
|
|
69
|
-
}, [containerRef, inputRef, props.options]);
|
|
70
|
-
(0, import_react.useEffect)(() => {
|
|
71
|
-
if (!inputRef.current || !inputValue) return;
|
|
72
|
-
target.close(inputRef);
|
|
73
|
-
}, [inputValue, inputRef]);
|
|
72
|
+
}, [containerRef, inputRef, props.options, inputValue]);
|
|
74
73
|
const onBlur = (event) => {
|
|
75
74
|
setFocus(false);
|
|
76
75
|
setFilter("");
|
|
77
76
|
if (props.onBlur) props.onBlur(event);
|
|
78
|
-
if (register.onBlur) register.onBlur(event);
|
|
79
77
|
const optionsElement = document.getElementById(`input[${props.name}-options]`);
|
|
80
78
|
if (!optionsElement) return;
|
|
81
79
|
optionsElement.setAttribute("value", "");
|
|
@@ -85,13 +83,13 @@ function InputSelect(props) {
|
|
|
85
83
|
if (register.onFocus) register.onFocus(event);
|
|
86
84
|
};
|
|
87
85
|
const onChange = (event) => {
|
|
88
|
-
const
|
|
89
|
-
setFilter(
|
|
90
|
-
if (props.onFilter) props.onFilter(
|
|
86
|
+
const value = event.target.value || "";
|
|
87
|
+
setFilter(value);
|
|
88
|
+
if (props.onFilter) props.onFilter(value);
|
|
91
89
|
if (register.onChange) register.onChange(event);
|
|
92
90
|
const optionsElement = document.getElementById(`input[${props.name}-options]`);
|
|
93
91
|
if (!optionsElement) return;
|
|
94
|
-
optionsElement.setAttribute("value",
|
|
92
|
+
optionsElement.setAttribute("value", value);
|
|
95
93
|
};
|
|
96
94
|
const onClick = (event) => {
|
|
97
95
|
inputRef.current.focus();
|
|
@@ -119,7 +117,7 @@ function InputSelect(props) {
|
|
|
119
117
|
type: "text",
|
|
120
118
|
maxLength: props.maxLength || 255,
|
|
121
119
|
value: focus ? filter : inputValue,
|
|
122
|
-
placeholder: import_lodash.default.isString(
|
|
120
|
+
placeholder: import_lodash.default.isString(inputLabel) ? inputLabel : import_utils.default.format.textIntoElement(inputLabel) || "",
|
|
123
121
|
...register,
|
|
124
122
|
ref: inputRef,
|
|
125
123
|
onBlur,
|
|
@@ -132,9 +130,9 @@ function InputSelect(props) {
|
|
|
132
130
|
"div",
|
|
133
131
|
{
|
|
134
132
|
className: "input-label-value",
|
|
135
|
-
"data-string": import_lodash.default.isString(
|
|
133
|
+
"data-string": import_lodash.default.isString(inputLabel),
|
|
136
134
|
onClick: () => inputRef.current.click(),
|
|
137
|
-
children:
|
|
135
|
+
children: inputLabel
|
|
138
136
|
}
|
|
139
137
|
),
|
|
140
138
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
@@ -7,7 +7,9 @@ import { InputLabel } from "../label";
|
|
|
7
7
|
import { InputError } from "../error";
|
|
8
8
|
import { useTarget } from "../../../../../contexts";
|
|
9
9
|
import _ from "lodash";
|
|
10
|
-
import
|
|
10
|
+
import InputSelectOptions from "./options";
|
|
11
|
+
import InputSelectOption from "./options/option";
|
|
12
|
+
import Utils from "@gustavo-valsechi/utils";
|
|
11
13
|
function InputSelect(props) {
|
|
12
14
|
var _a, _b;
|
|
13
15
|
const containerRef = useRef(null);
|
|
@@ -17,32 +19,28 @@ function InputSelect(props) {
|
|
|
17
19
|
const [filter, setFilter] = useState("");
|
|
18
20
|
const register = (props.register || ((name) => ({})))(props.name || "");
|
|
19
21
|
const inputValue = ((_a = props.watch) == null ? void 0 : _a.call(props, props.name)) || "";
|
|
20
|
-
const
|
|
22
|
+
const inputLabel = InputSelectOption({ content: (_b = props.options) == null ? void 0 : _b[inputValue] }) || /* @__PURE__ */ jsx("div", { className: "input-label-value-placeholder", children: "selecione" });
|
|
21
23
|
useEffect(() => {
|
|
22
24
|
var _a2;
|
|
23
25
|
if (!(inputRef == null ? void 0 : inputRef.current) || !(containerRef == null ? void 0 : containerRef.current)) return;
|
|
24
26
|
target.save({
|
|
25
27
|
ref: inputRef,
|
|
26
28
|
component: /* @__PURE__ */ jsx(
|
|
27
|
-
|
|
29
|
+
InputSelectOptions,
|
|
28
30
|
{
|
|
29
31
|
...props,
|
|
30
32
|
inputRef,
|
|
31
33
|
register,
|
|
32
|
-
width: ((_a2 = containerRef == null ? void 0 : containerRef.current) == null ? void 0 : _a2.offsetWidth) - 1 || 0
|
|
34
|
+
width: ((_a2 = containerRef == null ? void 0 : containerRef.current) == null ? void 0 : _a2.offsetWidth) - 1 || 0,
|
|
35
|
+
value: inputValue
|
|
33
36
|
}
|
|
34
37
|
)
|
|
35
38
|
});
|
|
36
|
-
}, [containerRef, inputRef, props.options]);
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
if (!inputRef.current || !inputValue) return;
|
|
39
|
-
target.close(inputRef);
|
|
40
|
-
}, [inputValue, inputRef]);
|
|
39
|
+
}, [containerRef, inputRef, props.options, inputValue]);
|
|
41
40
|
const onBlur = (event) => {
|
|
42
41
|
setFocus(false);
|
|
43
42
|
setFilter("");
|
|
44
43
|
if (props.onBlur) props.onBlur(event);
|
|
45
|
-
if (register.onBlur) register.onBlur(event);
|
|
46
44
|
const optionsElement = document.getElementById(`input[${props.name}-options]`);
|
|
47
45
|
if (!optionsElement) return;
|
|
48
46
|
optionsElement.setAttribute("value", "");
|
|
@@ -52,13 +50,13 @@ function InputSelect(props) {
|
|
|
52
50
|
if (register.onFocus) register.onFocus(event);
|
|
53
51
|
};
|
|
54
52
|
const onChange = (event) => {
|
|
55
|
-
const
|
|
56
|
-
setFilter(
|
|
57
|
-
if (props.onFilter) props.onFilter(
|
|
53
|
+
const value = event.target.value || "";
|
|
54
|
+
setFilter(value);
|
|
55
|
+
if (props.onFilter) props.onFilter(value);
|
|
58
56
|
if (register.onChange) register.onChange(event);
|
|
59
57
|
const optionsElement = document.getElementById(`input[${props.name}-options]`);
|
|
60
58
|
if (!optionsElement) return;
|
|
61
|
-
optionsElement.setAttribute("value",
|
|
59
|
+
optionsElement.setAttribute("value", value);
|
|
62
60
|
};
|
|
63
61
|
const onClick = (event) => {
|
|
64
62
|
inputRef.current.focus();
|
|
@@ -86,7 +84,7 @@ function InputSelect(props) {
|
|
|
86
84
|
type: "text",
|
|
87
85
|
maxLength: props.maxLength || 255,
|
|
88
86
|
value: focus ? filter : inputValue,
|
|
89
|
-
placeholder: _.isString(
|
|
87
|
+
placeholder: _.isString(inputLabel) ? inputLabel : Utils.format.textIntoElement(inputLabel) || "",
|
|
90
88
|
...register,
|
|
91
89
|
ref: inputRef,
|
|
92
90
|
onBlur,
|
|
@@ -99,9 +97,9 @@ function InputSelect(props) {
|
|
|
99
97
|
"div",
|
|
100
98
|
{
|
|
101
99
|
className: "input-label-value",
|
|
102
|
-
"data-string": _.isString(
|
|
100
|
+
"data-string": _.isString(inputLabel),
|
|
103
101
|
onClick: () => inputRef.current.click(),
|
|
104
|
-
children:
|
|
102
|
+
children: inputLabel
|
|
105
103
|
}
|
|
106
104
|
),
|
|
107
105
|
/* @__PURE__ */ jsxs(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IInputSelect } from "../../../../../../interfaces";
|
|
2
|
-
export default function
|
|
2
|
+
export default function InputSelectOptions(props: IInputSelect & {
|
|
3
3
|
inputRef: any;
|
|
4
4
|
width: number;
|
|
5
5
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -30,7 +30,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
31
|
var options_exports = {};
|
|
32
32
|
__export(options_exports, {
|
|
33
|
-
default: () =>
|
|
33
|
+
default: () => InputSelectOptions
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(options_exports);
|
|
36
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -39,8 +39,10 @@ var import_styles = require("./styles");
|
|
|
39
39
|
var import_contexts = require("../../../../../../contexts");
|
|
40
40
|
var import_utils = __toESM(require("@gustavo-valsechi/utils"));
|
|
41
41
|
var import_lodash = __toESM(require("lodash"));
|
|
42
|
-
|
|
42
|
+
var import_option = __toESM(require("./option"));
|
|
43
|
+
function InputSelectOptions(props) {
|
|
43
44
|
const theme = (0, import_contexts.useTheme)();
|
|
45
|
+
const target = (0, import_contexts.useTarget)();
|
|
44
46
|
const [options, setOptions] = (0, import_react.useState)(props.options);
|
|
45
47
|
(0, import_react.useEffect)(() => {
|
|
46
48
|
const optionsElement = document.getElementById(`input[${props.name}-options]`);
|
|
@@ -53,7 +55,8 @@ function InputSelectOption(props) {
|
|
|
53
55
|
const filtredValues = import_lodash.default.filter(props.options, (value) => {
|
|
54
56
|
const normalize = (text2) => import_lodash.default.deburr(text2 == null ? void 0 : text2.toLowerCase());
|
|
55
57
|
if (import_lodash.default.isString(value)) return import_lodash.default.includes(normalize(value), normalize(filter));
|
|
56
|
-
const text = import_utils.default.format.textIntoElement(value);
|
|
58
|
+
const text = import_utils.default.format.textIntoElement((0, import_option.default)({ content: value }));
|
|
59
|
+
console.log(text);
|
|
57
60
|
return import_lodash.default.includes(normalize(text), normalize(filter));
|
|
58
61
|
});
|
|
59
62
|
const filtredOptions = {};
|
|
@@ -89,6 +92,7 @@ function InputSelectOption(props) {
|
|
|
89
92
|
}, [props.name]);
|
|
90
93
|
const onSelect = (value) => {
|
|
91
94
|
var _a;
|
|
95
|
+
setTimeout(() => target.close(props.inputRef), 10);
|
|
92
96
|
(_a = props.setValue) == null ? void 0 : _a.call(props, props.name, value);
|
|
93
97
|
if (props.onChange) props.onChange(value);
|
|
94
98
|
const optionsElement = document.getElementById(`input[${props.name}-options]`);
|
|
@@ -117,15 +121,16 @@ function InputSelectOption(props) {
|
|
|
117
121
|
className: "input-option-content-mask",
|
|
118
122
|
children: !Object.keys(options || {}).length ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "input-option empty", children: "Nenhuma op\xE7\xE3o encontrada" }) : import_lodash.default.map(
|
|
119
123
|
options,
|
|
120
|
-
(
|
|
124
|
+
(data, value) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
121
125
|
"div",
|
|
122
126
|
{
|
|
123
127
|
className: "input-option",
|
|
124
|
-
onClick: () => onSelect(
|
|
125
|
-
"data-string": import_lodash.default.isString(
|
|
126
|
-
|
|
128
|
+
onClick: () => onSelect(value),
|
|
129
|
+
"data-string": import_lodash.default.isString(data),
|
|
130
|
+
"data-selected": value === props.value,
|
|
131
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_option.default, { content: data })
|
|
127
132
|
},
|
|
128
|
-
|
|
133
|
+
value
|
|
129
134
|
)
|
|
130
135
|
)
|
|
131
136
|
}
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { useEffect, useState } from "react";
|
|
5
5
|
import { Container } from "./styles";
|
|
6
|
-
import { useTheme } from "../../../../../../contexts";
|
|
6
|
+
import { useTarget, useTheme } from "../../../../../../contexts";
|
|
7
7
|
import Utils from "@gustavo-valsechi/utils";
|
|
8
8
|
import _ from "lodash";
|
|
9
|
-
|
|
9
|
+
import InputSelectOption from "./option";
|
|
10
|
+
function InputSelectOptions(props) {
|
|
10
11
|
const theme = useTheme();
|
|
12
|
+
const target = useTarget();
|
|
11
13
|
const [options, setOptions] = useState(props.options);
|
|
12
14
|
useEffect(() => {
|
|
13
15
|
const optionsElement = document.getElementById(`input[${props.name}-options]`);
|
|
@@ -20,7 +22,8 @@ function InputSelectOption(props) {
|
|
|
20
22
|
const filtredValues = _.filter(props.options, (value) => {
|
|
21
23
|
const normalize = (text2) => _.deburr(text2 == null ? void 0 : text2.toLowerCase());
|
|
22
24
|
if (_.isString(value)) return _.includes(normalize(value), normalize(filter));
|
|
23
|
-
const text = Utils.format.textIntoElement(value);
|
|
25
|
+
const text = Utils.format.textIntoElement(InputSelectOption({ content: value }));
|
|
26
|
+
console.log(text);
|
|
24
27
|
return _.includes(normalize(text), normalize(filter));
|
|
25
28
|
});
|
|
26
29
|
const filtredOptions = {};
|
|
@@ -56,6 +59,7 @@ function InputSelectOption(props) {
|
|
|
56
59
|
}, [props.name]);
|
|
57
60
|
const onSelect = (value) => {
|
|
58
61
|
var _a;
|
|
62
|
+
setTimeout(() => target.close(props.inputRef), 10);
|
|
59
63
|
(_a = props.setValue) == null ? void 0 : _a.call(props, props.name, value);
|
|
60
64
|
if (props.onChange) props.onChange(value);
|
|
61
65
|
const optionsElement = document.getElementById(`input[${props.name}-options]`);
|
|
@@ -84,15 +88,16 @@ function InputSelectOption(props) {
|
|
|
84
88
|
className: "input-option-content-mask",
|
|
85
89
|
children: !Object.keys(options || {}).length ? /* @__PURE__ */ jsx("div", { className: "input-option empty", children: "Nenhuma op\xE7\xE3o encontrada" }) : _.map(
|
|
86
90
|
options,
|
|
87
|
-
(
|
|
91
|
+
(data, value) => /* @__PURE__ */ jsx(
|
|
88
92
|
"div",
|
|
89
93
|
{
|
|
90
94
|
className: "input-option",
|
|
91
|
-
onClick: () => onSelect(
|
|
92
|
-
"data-string": _.isString(
|
|
93
|
-
|
|
95
|
+
onClick: () => onSelect(value),
|
|
96
|
+
"data-string": _.isString(data),
|
|
97
|
+
"data-selected": value === props.value,
|
|
98
|
+
children: /* @__PURE__ */ jsx(InputSelectOption, { content: data })
|
|
94
99
|
},
|
|
95
|
-
|
|
100
|
+
value
|
|
96
101
|
)
|
|
97
102
|
)
|
|
98
103
|
}
|
|
@@ -104,5 +109,5 @@ function InputSelectOption(props) {
|
|
|
104
109
|
);
|
|
105
110
|
}
|
|
106
111
|
export {
|
|
107
|
-
|
|
112
|
+
InputSelectOptions as default
|
|
108
113
|
};
|
|
@@ -0,0 +1,52 @@
|
|
|
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 option_exports = {};
|
|
32
|
+
__export(option_exports, {
|
|
33
|
+
default: () => InputSelectOption
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(option_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 InputSelectOption(props) {
|
|
40
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
41
|
+
if (import_lodash.default.isArray(props.content)) return "";
|
|
42
|
+
if (!!((_a = props.content) == null ? void 0 : _a.icon) || !!((_b = props.content) == null ? void 0 : _b.flag)) {
|
|
43
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Container, { color: (_c = props.content) == null ? void 0 : _c.color, flag: (_d = props.content) == null ? void 0 : _d.flag, children: [
|
|
44
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "select-option-identifier", children: [
|
|
45
|
+
!!((_e = props.content) == null ? void 0 : _e.icon) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { "aria-hidden": true, className: (_f = props.content) == null ? void 0 : _f.icon }),
|
|
46
|
+
!!((_g = props.content) == null ? void 0 : _g.flag) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "select-option-flag" })
|
|
47
|
+
] }),
|
|
48
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: (_h = props.content) == null ? void 0 : _h.label })
|
|
49
|
+
] });
|
|
50
|
+
}
|
|
51
|
+
return props.content || "";
|
|
52
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 InputSelectOption(props) {
|
|
7
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
8
|
+
if (_.isArray(props.content)) return "";
|
|
9
|
+
if (!!((_a = props.content) == null ? void 0 : _a.icon) || !!((_b = props.content) == null ? void 0 : _b.flag)) {
|
|
10
|
+
return /* @__PURE__ */ jsxs(Container, { color: (_c = props.content) == null ? void 0 : _c.color, flag: (_d = props.content) == null ? void 0 : _d.flag, children: [
|
|
11
|
+
/* @__PURE__ */ jsxs("div", { className: "select-option-identifier", children: [
|
|
12
|
+
!!((_e = props.content) == null ? void 0 : _e.icon) && /* @__PURE__ */ jsx("i", { "aria-hidden": true, className: (_f = props.content) == null ? void 0 : _f.icon }),
|
|
13
|
+
!!((_g = props.content) == null ? void 0 : _g.flag) && /* @__PURE__ */ jsx("div", { className: "select-option-flag" })
|
|
14
|
+
] }),
|
|
15
|
+
/* @__PURE__ */ jsx("span", { children: (_h = props.content) == null ? void 0 : _h.label })
|
|
16
|
+
] });
|
|
17
|
+
}
|
|
18
|
+
return props.content || "";
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
InputSelectOption as default
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Container: any;
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
Container: () => Container
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(styles_exports);
|
|
36
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
37
|
+
const Container = import_styled_components.default.div`
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
gap: .5rem;
|
|
41
|
+
margin-left: -0.5rem;
|
|
42
|
+
|
|
43
|
+
.select-option-identifier {
|
|
44
|
+
width: 1.3rem;
|
|
45
|
+
height: 1.3rem;
|
|
46
|
+
border-radius: 5px;
|
|
47
|
+
background: ${(props) => props.theme.t05};
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
|
|
52
|
+
i {
|
|
53
|
+
font-size: .7rem;
|
|
54
|
+
color: ${(props) => props.theme[props.color || ""] || props.theme.t6};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.select-option-flag {
|
|
58
|
+
width: .8rem;
|
|
59
|
+
height: .8rem;
|
|
60
|
+
background-image: url(${(props) => props.flag});
|
|
61
|
+
background-size: contain;
|
|
62
|
+
background-repeat: no-repeat;
|
|
63
|
+
background-position: center;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
span {
|
|
68
|
+
font-size: .75rem;
|
|
69
|
+
font-weight: 500;
|
|
70
|
+
color: ${(props) => props.theme[props.color || ""] || props.theme.t6};
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
74
|
+
0 && (module.exports = {
|
|
75
|
+
Container
|
|
76
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
const Container = styled.div`
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: .5rem;
|
|
8
|
+
margin-left: -0.5rem;
|
|
9
|
+
|
|
10
|
+
.select-option-identifier {
|
|
11
|
+
width: 1.3rem;
|
|
12
|
+
height: 1.3rem;
|
|
13
|
+
border-radius: 5px;
|
|
14
|
+
background: ${(props) => props.theme.t05};
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
|
|
19
|
+
i {
|
|
20
|
+
font-size: .7rem;
|
|
21
|
+
color: ${(props) => props.theme[props.color || ""] || props.theme.t6};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.select-option-flag {
|
|
25
|
+
width: .8rem;
|
|
26
|
+
height: .8rem;
|
|
27
|
+
background-image: url(${(props) => props.flag});
|
|
28
|
+
background-size: contain;
|
|
29
|
+
background-repeat: no-repeat;
|
|
30
|
+
background-position: center;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
span {
|
|
35
|
+
font-size: .75rem;
|
|
36
|
+
font-weight: 500;
|
|
37
|
+
color: ${(props) => props.theme[props.color || ""] || props.theme.t6};
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
export {
|
|
41
|
+
Container
|
|
42
|
+
};
|
|
@@ -72,6 +72,10 @@ const Container = import_styled_components.default.div`
|
|
|
72
72
|
cursor: pointer;
|
|
73
73
|
max-height: 36px;
|
|
74
74
|
|
|
75
|
+
&[data-selected="true"] {
|
|
76
|
+
background-color: ${({ theme }) => theme.t03};
|
|
77
|
+
}
|
|
78
|
+
|
|
75
79
|
&[data-string="true"] {
|
|
76
80
|
font-size: .8rem;
|
|
77
81
|
color: ${({ theme }) => theme.t6};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gustavo-valsechi/client",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.358",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@emotion/react": "11.14.0",
|
|
29
29
|
"@emotion/styled": "11.14.1",
|
|
30
30
|
"@gustavo-valsechi/server": "1.0.13",
|
|
31
|
-
"@gustavo-valsechi/utils": "1.0.
|
|
31
|
+
"@gustavo-valsechi/utils": "1.0.19",
|
|
32
32
|
"@hookform/resolvers": "5.2.2",
|
|
33
33
|
"@mui/material": "7.3.7",
|
|
34
34
|
"@mui/x-date-pickers": "8.24.0",
|