@datability/8ui 0.1.21 → 0.1.22
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.
|
@@ -6,11 +6,11 @@ import { getIn, useFormikContext } from 'formik';
|
|
|
6
6
|
import './index.scss';
|
|
7
7
|
import InputBase from '../InputBase';
|
|
8
8
|
var InputRadio = function (_a) {
|
|
9
|
-
var name = _a.name, label = _a.label, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.require, require = _c === void 0 ? false : _c, _d = _a.fullWidth, fullWidth = _d === void 0 ? false : _d, options = _a.options;
|
|
10
|
-
var
|
|
9
|
+
var name = _a.name, label = _a.label, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.require, require = _c === void 0 ? false : _c, _d = _a.fullWidth, fullWidth = _d === void 0 ? false : _d, _e = _a.isVertical, isVertical = _e === void 0 ? false : _e, options = _a.options;
|
|
10
|
+
var _f = useFormikContext(), values = _f.values, touched = _f.touched, errors = _f.errors, handleChange = _f.handleChange;
|
|
11
11
|
var isInvalid = getIn(touched, name) && Boolean(getIn(errors, name));
|
|
12
12
|
return (React.createElement(InputBase, { name: name, label: label, require: require, fullWidth: fullWidth, isInvalid: isInvalid },
|
|
13
|
-
React.createElement("div", { className: "DBui-wrapInputRadioList" }, options.map(function (data, index) { return (React.createElement("div", { key: index, className: "DBui-wrapInputRadio" },
|
|
13
|
+
React.createElement("div", { className: "DBui-wrapInputRadioList", "data-vertical": isVertical }, options.map(function (data, index) { return (React.createElement("div", { key: index, className: "DBui-wrapInputRadio" },
|
|
14
14
|
React.createElement("input", { className: "DBui-inputRadio", type: "radio", disabled: disabled, value: data.value, onChange: handleChange, name: name, checked: getIn(values, name) === data.value }),
|
|
15
15
|
React.createElement("p", { className: "DBui-labelRadio", "data-invalid": isInvalid },
|
|
16
16
|
React.createElement("small", null, data.label)))); }))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Input/InputRadio/index.tsx"],"names":[],"mappings":"AAAA,MAAM;AACN,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAEhD,SAAS;AAET,qBAAqB;AACrB,OAAO,cAAc,CAAA;AACrB,OAAO,SAAS,MAAM,cAAc,CAAA;AAGpC,IAAM,UAAU,GAA8B,UAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Input/InputRadio/index.tsx"],"names":[],"mappings":"AAAA,MAAM;AACN,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAEhD,SAAS;AAET,qBAAqB;AACrB,OAAO,cAAc,CAAA;AACrB,OAAO,SAAS,MAAM,cAAc,CAAA;AAGpC,IAAM,UAAU,GAA8B,UAAC,EAQ9C;QAPC,IAAI,UAAA,EACJ,KAAK,WAAA,EACL,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,eAAe,EAAf,OAAO,mBAAG,KAAK,KAAA,EACf,iBAAiB,EAAjB,SAAS,mBAAG,KAAK,KAAA,EACjB,kBAAkB,EAAlB,UAAU,mBAAG,KAAK,KAAA,EAClB,OAAO,aAAA;IAED,IAAA,KAA4C,gBAAgB,EAAE,EAA5D,MAAM,YAAA,EAAE,OAAO,aAAA,EAAE,MAAM,YAAA,EAAE,YAAY,kBAAuB,CAAA;IACpE,IAAM,SAAS,GAAG,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAA;IAEtE,OAAO,CACL,oBAAC,SAAS,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QA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