infinity-forge 8.7.0 → 8.7.1
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.
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { InputProps } from '../interfaces.js';
|
|
1
2
|
export type OptionInputRadio = {
|
|
2
3
|
label: string;
|
|
3
4
|
value: string;
|
|
5
|
+
readOnly?: boolean;
|
|
4
6
|
CustomOption?: (props: {
|
|
5
7
|
isActive: boolean;
|
|
6
8
|
name: string;
|
|
@@ -15,5 +17,5 @@ interface InputRadioProps {
|
|
|
15
17
|
export declare function InputRadioComponent(props: {
|
|
16
18
|
name: string;
|
|
17
19
|
} & OptionInputRadio): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export declare function InputRadio({ name, options, ...props }: InputRadioProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare function InputRadio({ name, options, ...props }: InputRadioProps & InputProps): import("react/jsx-runtime").JSX.Element;
|
|
19
21
|
export {};
|
|
@@ -64,10 +64,10 @@ var input_control_1 = require("../input-control/index.js");
|
|
|
64
64
|
function InputRadioComponent(props) {
|
|
65
65
|
var field = (0, formik_1.useField)({ name: props.name })[0];
|
|
66
66
|
var isActive = field.value === props.value;
|
|
67
|
-
return ((0, jsx_runtime_1.jsxs)("label", { htmlFor: props.name + props.label, children: [(0, jsx_runtime_1.jsx)("input", __assign({ id: props.name + props.label }, field, { checked: isActive, type: 'radio', value: props.value, style: { display: props.CustomOption ? 'none' : 'block' } })), props.CustomOption ? (0, jsx_runtime_1.jsx)(props.CustomOption, __assign({}, props, { isActive: isActive })) : (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: props.label && props.label })] }));
|
|
67
|
+
return ((0, jsx_runtime_1.jsxs)("label", { htmlFor: props.name + props.label, children: [(0, jsx_runtime_1.jsx)("input", __assign({ id: props.name + props.label }, field, { checked: isActive, type: 'radio', readOnly: props.readOnly, value: props.value, style: { display: props.CustomOption ? 'none' : 'block' } })), props.CustomOption ? (0, jsx_runtime_1.jsx)(props.CustomOption, __assign({}, props, { isActive: isActive })) : (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: props.label && props.label })] }));
|
|
68
68
|
}
|
|
69
69
|
function InputRadio(_a) {
|
|
70
70
|
var name = _a.name, options = _a.options, props = __rest(_a, ["name", "options"]);
|
|
71
|
-
return ((0, jsx_runtime_1.jsx)(input_control_1.InputControl, __assign({}, props, { name: name, children: (0, jsx_runtime_1.jsx)(S.InputRadio, { children: (0, jsx_runtime_1.jsx)("div", { className: 'list-radios', children: options.map(function (option) { return ((0, jsx_runtime_1.jsx)(InputRadioComponent, __assign({}, option, { name: name }), option.value)); }) }) }) })));
|
|
71
|
+
return ((0, jsx_runtime_1.jsx)(input_control_1.InputControl, __assign({}, props, { name: name, children: (0, jsx_runtime_1.jsx)(S.InputRadio, { children: (0, jsx_runtime_1.jsx)("div", { className: 'list-radios', children: options.map(function (option) { return ((0, jsx_runtime_1.jsx)(InputRadioComponent, __assign({ readOnly: props.readOnly }, option, { name: name }), option.value)); }) }) }) })));
|
|
72
72
|
}
|
|
73
73
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ui/components/form/radio/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ui/components/form/radio/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,kDAoBC;AAED,gCAYC;;AAtDD,iCAAiC;AAEjC,0CAA6B;AAC7B,kDAA+C;AAiB/C,SAAgB,mBAAmB,CAAC,KAA0C;IACrE,IAAA,KAAK,GAAI,IAAA,iBAAQ,EAAC,EAAE,IAAI,EAAE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