Comparing version 0.0.0-beta.6 to 0.0.0-beta.7
@@ -10,2 +10,3 @@ import React from 'react'; | ||
width?: number; | ||
render?: Function; | ||
}; | ||
@@ -36,5 +37,5 @@ interface TabsProps { | ||
f_checked: (v: string | number) => boolean; | ||
r_button: () => JSX.Element[]; | ||
r_button: () => any[]; | ||
render(): JSX.Element; | ||
} | ||
export default Tabs; |
@@ -29,2 +29,7 @@ var __rest = | ||
let value = ev.target.value; | ||
if (value === undefined) return; | ||
const disabled = options.some( | ||
(o) => o.value === value && o.disabled === true | ||
); | ||
if (disabled) return; | ||
if (multi) { | ||
@@ -84,4 +89,13 @@ if (value === 'all') { | ||
const cls = classNames({ | ||
['swc-tabs-checked']: checked | ||
['swc-tabs-checked']: checked, | ||
['swc-tabs-disabled']: o.disabled | ||
}); | ||
if (typeof o.render === 'function') { | ||
const props = { | ||
style, | ||
className: cls, | ||
children: o.label | ||
}; | ||
return o.render(Button, props); | ||
} | ||
return React.createElement( | ||
@@ -88,0 +102,0 @@ Button, |
@@ -191,2 +191,7 @@ 'use strict'; | ||
var value = ev.target.value; | ||
if (value === undefined) return; | ||
var disabled = options.some(function(o) { | ||
return o.value === value && o.disabled === true; | ||
}); | ||
if (disabled) return; | ||
@@ -274,2 +279,4 @@ if (multi) { | ||
return (options || []).map(function(o) { | ||
var _classNames; | ||
var style = { | ||
@@ -287,4 +294,17 @@ width: _this.props.itemWidth | ||
var cls = (0, _classnames['default'])( | ||
_defineProperty({}, 'swc-tabs-checked', checked) | ||
((_classNames = {}), | ||
_defineProperty(_classNames, 'swc-tabs-checked', checked), | ||
_defineProperty(_classNames, 'swc-tabs-disabled', o.disabled), | ||
_classNames) | ||
); | ||
if (typeof o.render === 'function') { | ||
var _props = { | ||
style: style, | ||
className: cls, | ||
children: o.label | ||
}; | ||
return o.render(Button, _props); | ||
} | ||
return _react['default'].createElement( | ||
@@ -291,0 +311,0 @@ Button, |
{ | ||
"name": "frc-ui", | ||
"version": "0.0.0-beta.6", | ||
"version": "0.0.0-beta.7", | ||
"description": "React Web UI", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
61906
1953