infinity-forge 0.16.3 → 0.16.4
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.
|
@@ -44,10 +44,10 @@ var react_select_1 = __importDefault(require("react-select"));
|
|
|
44
44
|
var ui_1 = require("../../../../ui/index.js");
|
|
45
45
|
var S = __importStar(require("./styles.js"));
|
|
46
46
|
function Select(props) {
|
|
47
|
-
var _a;
|
|
48
|
-
var
|
|
47
|
+
var _a, _b, _c;
|
|
48
|
+
var _d = (0, formik_1.useField)({
|
|
49
49
|
name: props.name,
|
|
50
|
-
}), field =
|
|
50
|
+
}), field = _d[0], _ = _d[1], helpers = _d[2];
|
|
51
51
|
var fieldValue = field.value || [];
|
|
52
52
|
var value = !props.onlyOneValue
|
|
53
53
|
? fieldValue && (fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.length) > 0 && props.isGroup
|
|
@@ -58,9 +58,8 @@ function Select(props) {
|
|
|
58
58
|
})
|
|
59
59
|
.options.find(function (opt) { return opt.value === defaultValueForm; });
|
|
60
60
|
})
|
|
61
|
-
: fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.map(function (valueForm) { return props.options.find(function (option) { return option.value === valueForm; }); })
|
|
62
|
-
: [props.options.find(function (option) { return option.value === fieldValue; })];
|
|
63
|
-
console.log(value);
|
|
61
|
+
: (_a = fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.map(function (valueForm) { return props.options.find(function (option) { return option.value === valueForm; }); })) === null || _a === void 0 ? void 0 : _a.value
|
|
62
|
+
: [(_b = props.options.find(function (option) { return option.value === fieldValue; })) === null || _b === void 0 ? void 0 : _b.value];
|
|
64
63
|
return ((0, jsx_runtime_1.jsx)(S.SelectWrapper, { children: (0, jsx_runtime_1.jsx)(ui_1.InputControl, __assign({}, props, { children: (0, jsx_runtime_1.jsx)(react_select_1.default, { isSearchable: props.isSearchable, menuPlacement: props.menuPlacement || 'auto', menuIsOpen: props.forceOpenToDevelop ? props.forceOpenToDevelop : undefined, placeholder: props.placeholder, name: field.name, noOptionsMessage: function () { return props.noOptionMessage || 'Nenhuma opção encontrada.'; }, onChange: function (ev) {
|
|
65
64
|
var value = props.onlyOneValue
|
|
66
65
|
? ev.value
|
|
@@ -73,7 +72,7 @@ function Select(props) {
|
|
|
73
72
|
props.onChangeSelect && props.onChangeSelect(value);
|
|
74
73
|
}, value: value, isMulti: props.isMultiple, options: props.options, components: props.CustomOption
|
|
75
74
|
? { Option: props.CustomOption, SingleValue: props.CustomOption }
|
|
76
|
-
: undefined, className: ((
|
|
75
|
+
: undefined, className: ((_c = field === null || field === void 0 ? void 0 : field.value) === null || _c === void 0 ? void 0 : _c.length) > 0 ? 'open' : '' }) })) }));
|
|
77
76
|
}
|
|
78
77
|
exports.Select = Select;
|
|
79
78
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ui/components/form/select/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAiC;AACjC,8DAAsC;AACtC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ui/components/form/select/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAiC;AACjC,8DAAsC;AACtC,2BAAkC;AAIlC,0CAA6B;AAE7B,SAAgB,MAAM,CAAC,KAAmB;;IAClC,IAAA,KAAsB,IAAA,iBAAQ,EAAC;QACnC,IAAI,EAAE,KAAK,CAAC,IAAI;KACjB,CAAC,EAFK,KAAK,QAAA,EAAE,CAAC,QAAA,EAAE,OAAO,QAEtB,CAAA;IAEF,IAAM,UAAU,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAA;IAEpC,IAAM,KAAK,GAAG,CAAC,KAAK,CAAC,YAAY;QAC/B,CAAC,CAAC,UAAU,IAAI,CA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