indicator-ui 0.0.149 → 0.0.150
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/index.js +31 -3
- package/dist/index.js.map +1 -1
- package/dist/types/src/ui/InputFields/RadioField/types/RadioFieldItemTypes.d.ts +1 -6
- package/dist/types/src/ui/InputFields/RadioField/ui/RadioField.d.ts +1 -1
- package/dist/types/src/ui/InputFields/RadioField/ui/RadioFieldItem.d.ts +3 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10104,12 +10104,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10104
10104
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
|
|
10105
10105
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
|
10106
10106
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
10107
|
-
/* harmony import */ var
|
|
10107
|
+
/* harmony import */ var _RadioFieldItem__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./RadioFieldItem */ "./src/ui/InputFields/RadioField/ui/RadioFieldItem.tsx");
|
|
10108
10108
|
'use client';
|
|
10109
10109
|
|
|
10110
10110
|
|
|
10111
10111
|
|
|
10112
|
-
function RadioField({ value, onChange, options = [], required = false, multiple = true, disabled = false, width = 'hug',
|
|
10112
|
+
function RadioField({ value, onChange, options = [], required = false, multiple = true, disabled = false, width = 'hug', }) {
|
|
10113
10113
|
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
|
|
10114
10114
|
if (required && options[0] && (value === undefined || Array.isArray(value) && value.length === 0)) {
|
|
10115
10115
|
onChange && onChange(options[0].value);
|
|
@@ -10161,7 +10161,35 @@ function RadioField({ value, onChange, options = [], required = false, multiple
|
|
|
10161
10161
|
return JSON.stringify(value) === JSON.stringify(option.value);
|
|
10162
10162
|
}
|
|
10163
10163
|
};
|
|
10164
|
-
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: options.map((item, idx) => (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
|
|
10164
|
+
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: options.map((item, idx) => (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_RadioFieldItem__WEBPACK_IMPORTED_MODULE_2__["default"], { option: item, onClick: () => handleChange(item), active: isActive(item), disabled: disabled, width: width }, idx)) }));
|
|
10165
|
+
}
|
|
10166
|
+
|
|
10167
|
+
|
|
10168
|
+
/***/ }),
|
|
10169
|
+
|
|
10170
|
+
/***/ "./src/ui/InputFields/RadioField/ui/RadioFieldItem.tsx":
|
|
10171
|
+
/*!*************************************************************!*\
|
|
10172
|
+
!*** ./src/ui/InputFields/RadioField/ui/RadioFieldItem.tsx ***!
|
|
10173
|
+
\*************************************************************/
|
|
10174
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
10175
|
+
|
|
10176
|
+
"use strict";
|
|
10177
|
+
__webpack_require__.r(__webpack_exports__);
|
|
10178
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10179
|
+
/* harmony export */ "default": () => (/* binding */ RadioFieldItem)
|
|
10180
|
+
/* harmony export */ });
|
|
10181
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
|
|
10182
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
|
10183
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
10184
|
+
/* harmony import */ var _ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/ui */ "./src/ui/index.ts");
|
|
10185
|
+
|
|
10186
|
+
|
|
10187
|
+
|
|
10188
|
+
function RadioFieldItem({ option, onClick, active = false, disabled = false, width = 'hug', }) {
|
|
10189
|
+
if (option.component) {
|
|
10190
|
+
return react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(option.component, { onClick: onClick, active: active, disabled: disabled });
|
|
10191
|
+
}
|
|
10192
|
+
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui__WEBPACK_IMPORTED_MODULE_2__.Checkbox, { type: 'radio', text: option.label, onClick: onClick, disabled: disabled, width: width, checked: active });
|
|
10165
10193
|
}
|
|
10166
10194
|
|
|
10167
10195
|
|