indicator-ui 0.0.271 → 0.0.273
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
CHANGED
|
@@ -26272,7 +26272,11 @@ function Checkbox(_ref) {
|
|
|
26272
26272
|
_ref$height = _ref.height,
|
|
26273
26273
|
height = _ref$height === void 0 ? 'hug' : _ref$height,
|
|
26274
26274
|
onCheckboxMarkClick = _ref.onCheckboxMarkClick,
|
|
26275
|
-
additionStyle = _ref.additionStyle
|
|
26275
|
+
additionStyle = _ref.additionStyle,
|
|
26276
|
+
beforeElement = _ref.beforeElement,
|
|
26277
|
+
afterElement = _ref.afterElement,
|
|
26278
|
+
textBeforeElement = _ref.textBeforeElement,
|
|
26279
|
+
textAfterElement = _ref.textAfterElement;
|
|
26276
26280
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
|
|
26277
26281
|
_useState2 = _slicedToArray(_useState, 2),
|
|
26278
26282
|
isHover = _useState2[0],
|
|
@@ -26282,9 +26286,30 @@ function Checkbox(_ref) {
|
|
|
26282
26286
|
isFocused = _useState4[0],
|
|
26283
26287
|
setIsFocused = _useState4[1];
|
|
26284
26288
|
var clickHandler = function clickHandler() {
|
|
26285
|
-
|
|
26289
|
+
onClick === null || onClick === void 0 || onClick();
|
|
26286
26290
|
setIsFocused(false);
|
|
26287
26291
|
};
|
|
26292
|
+
var cloneElement = function cloneElement(element) {
|
|
26293
|
+
if (! /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(element)) return element;
|
|
26294
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(element, {
|
|
26295
|
+
isHover: isHover,
|
|
26296
|
+
disabled: disabled,
|
|
26297
|
+
checked: checked
|
|
26298
|
+
});
|
|
26299
|
+
};
|
|
26300
|
+
var getContent = function getContent() {
|
|
26301
|
+
if (text == null) return undefined;
|
|
26302
|
+
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
|
|
26303
|
+
className: (0,clsx__WEBPACK_IMPORTED_MODULE_2__["default"])(_styles__WEBPACK_IMPORTED_MODULE_4__.CheckboxStyle.textBlock, _defineProperty(_defineProperty({}, _styles__WEBPACK_IMPORTED_MODULE_4__.CheckboxStyle.hover, isHover), _styles__WEBPACK_IMPORTED_MODULE_4__.CheckboxStyle.focus, isFocused)),
|
|
26304
|
+
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
|
|
26305
|
+
className: (0,clsx__WEBPACK_IMPORTED_MODULE_2__["default"])(_styles__WEBPACK_IMPORTED_MODULE_4__.CheckboxStyle.text, _defineProperty({}, _styles__WEBPACK_IMPORTED_MODULE_4__.CheckboxStyle.textBold, indeterminate || subtype)),
|
|
26306
|
+
children: [cloneElement(textBeforeElement), text, cloneElement(textAfterElement)]
|
|
26307
|
+
}), supportingText && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
|
|
26308
|
+
className: _styles__WEBPACK_IMPORTED_MODULE_4__.CheckboxStyle.supportingText,
|
|
26309
|
+
children: supportingText
|
|
26310
|
+
})]
|
|
26311
|
+
});
|
|
26312
|
+
};
|
|
26288
26313
|
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", {
|
|
26289
26314
|
onClick: clickHandler,
|
|
26290
26315
|
onMouseEnter: function onMouseEnter() {
|
|
@@ -26315,16 +26340,7 @@ function Checkbox(_ref) {
|
|
|
26315
26340
|
}
|
|
26316
26341
|
},
|
|
26317
26342
|
relation: subtype
|
|
26318
|
-
}),
|
|
26319
|
-
className: (0,clsx__WEBPACK_IMPORTED_MODULE_2__["default"])(_styles__WEBPACK_IMPORTED_MODULE_4__.CheckboxStyle.textBlock, _defineProperty(_defineProperty({}, _styles__WEBPACK_IMPORTED_MODULE_4__.CheckboxStyle.hover, isHover), _styles__WEBPACK_IMPORTED_MODULE_4__.CheckboxStyle.focus, isFocused)),
|
|
26320
|
-
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
|
|
26321
|
-
className: (0,clsx__WEBPACK_IMPORTED_MODULE_2__["default"])(_styles__WEBPACK_IMPORTED_MODULE_4__.CheckboxStyle.text, _defineProperty({}, _styles__WEBPACK_IMPORTED_MODULE_4__.CheckboxStyle.textBold, indeterminate || subtype)),
|
|
26322
|
-
children: text
|
|
26323
|
-
}), supportingText && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
|
|
26324
|
-
className: _styles__WEBPACK_IMPORTED_MODULE_4__.CheckboxStyle.supportingText,
|
|
26325
|
-
children: supportingText
|
|
26326
|
-
})]
|
|
26327
|
-
})]
|
|
26343
|
+
}), cloneElement(beforeElement), getContent(), cloneElement(afterElement)]
|
|
26328
26344
|
});
|
|
26329
26345
|
}
|
|
26330
26346
|
|