@rmwc/checkbox
Advanced tools
Comparing version 14.0.0-alpha.0 to 14.0.1-alpha.0
@@ -10,4 +10,4 @@ "use strict"; | ||
var useCheckboxFoundation = function (props) { | ||
var _a = toggleable_1.useToggleFoundation(props), renderToggle = _a.renderToggle, toggleRootProps = _a.toggleRootProps, id = _a.id; | ||
var _b = base_1.useFoundation({ | ||
var _a = (0, toggleable_1.useToggleFoundation)(props), renderToggle = _a.renderToggle, toggleRootProps = _a.toggleRootProps, id = _a.id; | ||
var _b = (0, base_1.useFoundation)({ | ||
props: props, | ||
@@ -47,3 +47,3 @@ elements: { | ||
// Handles syncing of indeterminate state | ||
var doSync = react_1.useCallback(function () { | ||
var doSync = (0, react_1.useCallback)(function () { | ||
if (checkboxEl.ref) { | ||
@@ -56,3 +56,3 @@ checkboxEl.ref.indeterminate = Boolean(props.indeterminate); | ||
}, [props.indeterminate, foundation, checkboxEl.ref]); | ||
react_1.useEffect(function () { | ||
(0, react_1.useEffect)(function () { | ||
doSync(); | ||
@@ -59,0 +59,0 @@ }, [doSync]); |
@@ -22,7 +22,7 @@ "use strict"; | ||
/** A Checkbox component. */ | ||
exports.Checkbox = base_1.createComponent(function Checkbox(props, ref) { | ||
var _a = foundation_1.useCheckboxFoundation(props), renderToggle = _a.renderToggle, id = _a.id, toggleRootProps = _a.toggleRootProps, rootEl = _a.rootEl, checkboxEl = _a.checkboxEl; | ||
exports.Checkbox = (0, base_1.createComponent)(function Checkbox(props, ref) { | ||
var _a = (0, foundation_1.useCheckboxFoundation)(props), renderToggle = _a.renderToggle, id = _a.id, toggleRootProps = _a.toggleRootProps, rootEl = _a.rootEl, checkboxEl = _a.checkboxEl; | ||
var children = props.children, className = props.className, label = props.label, style = props.style, indeterminate = props.indeterminate, inputRef = props.inputRef, foundationRef = props.foundationRef, rest = tslib_1.__rest(props, ["children", "className", "label", "style", "indeterminate", "inputRef", "foundationRef"]); | ||
var checkbox = (react_1.default.createElement(CheckboxRoot, tslib_1.__assign({}, rootEl.props(tslib_1.__assign({ checked: rest.checked, indeterminate: indeterminate }, toggleRootProps)), { ref: base_1.mergeRefs(rootEl.reactRef, ref) }), | ||
react_1.default.createElement("input", tslib_1.__assign({}, checkboxEl.props(tslib_1.__assign(tslib_1.__assign({}, rest), { className: 'mdc-checkbox__native-control' })), { type: "checkbox", ref: base_1.mergeRefs(checkboxEl.reactRef, inputRef), id: id })), | ||
var checkbox = (react_1.default.createElement(CheckboxRoot, tslib_1.__assign({}, rootEl.props(tslib_1.__assign({ checked: rest.checked, indeterminate: indeterminate }, toggleRootProps)), { ref: (0, base_1.mergeRefs)(rootEl.reactRef, ref) }), | ||
react_1.default.createElement("input", tslib_1.__assign({}, checkboxEl.props(tslib_1.__assign(tslib_1.__assign({}, rest), { className: 'mdc-checkbox__native-control' })), { type: "checkbox", ref: (0, base_1.mergeRefs)(checkboxEl.reactRef, inputRef), id: id })), | ||
react_1.default.createElement(CheckboxBackground, null), | ||
@@ -35,10 +35,10 @@ react_1.default.createElement(CheckboxRipple, null))); | ||
*********************************************************************/ | ||
var CheckboxRoot = ripple_1.withRipple({ | ||
var CheckboxRoot = (0, ripple_1.withRipple)({ | ||
surface: false, | ||
unbounded: true | ||
})(react_1.default.forwardRef(function CheckboxRoot(props, ref) { | ||
var isDataTable = react_1.useContext(base_1.DataTableContext); | ||
var isDataTableHeader = react_1.useContext(base_1.DataTableHeadContext); | ||
var isDataTable = (0, react_1.useContext)(base_1.DataTableContext); | ||
var isDataTableHeader = (0, react_1.useContext)(base_1.DataTableHeadContext); | ||
var disabled = props.disabled, checked = props.checked, indeterminate = props.indeterminate, rest = tslib_1.__rest(props, ["disabled", "checked", "indeterminate"]); | ||
var className = base_1.useClassNames(props, [ | ||
var className = (0, base_1.useClassNames)(props, [ | ||
'mdc-checkbox', | ||
@@ -45,0 +45,0 @@ { |
{ | ||
"name": "@rmwc/checkbox", | ||
"version": "14.0.0-alpha.0", | ||
"version": "14.0.1-alpha.0", | ||
"description": "RMWC Checkbox component", | ||
@@ -41,9 +41,9 @@ "main": "dist/index.js", | ||
"@material/form-field": "^14.0.0", | ||
"@rmwc/base": "^14.0.0-alpha.0", | ||
"@rmwc/formfield": "^14.0.0-alpha.0", | ||
"@rmwc/ripple": "^14.0.0-alpha.0", | ||
"@rmwc/toggleable": "^14.0.0-alpha.0", | ||
"@rmwc/types": "^14.0.0-alpha.0" | ||
"@rmwc/base": "^14.0.1-alpha.0", | ||
"@rmwc/formfield": "^14.0.1-alpha.0", | ||
"@rmwc/ripple": "^14.0.1-alpha.0", | ||
"@rmwc/toggleable": "^14.0.1-alpha.0", | ||
"@rmwc/types": "^14.0.1-alpha.0" | ||
}, | ||
"gitHead": "d9befec0e3b258864b71686eecd16c16feb43cf1" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26823