Fix a few incorrect exports in typings and build with updated Babel
parent
deb36306ce
commit
68926f8289
|
@ -33,6 +33,21 @@ export interface Props {
|
|||
*/
|
||||
tooltipHideOnClick?: boolean,
|
||||
}
|
||||
export interface Iconic {
|
||||
/**
|
||||
* Value of the icon (See icon component).
|
||||
*/
|
||||
icon?: string | __React.ReactElement<any> | __React.ReactHTMLElement<any>,
|
||||
}
|
||||
|
||||
export interface Conditional {
|
||||
/**
|
||||
* If true, component will be disabled
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Properties of components that can be clicked
|
||||
*/
|
||||
|
@ -42,6 +57,56 @@ export interface Clickable {
|
|||
*/
|
||||
onClick?: Function
|
||||
}
|
||||
export interface ButtonProps extends Props, Clickable, Conditional, Iconic {
|
||||
/**
|
||||
* Indicates if the button should have accent color.
|
||||
* @default false
|
||||
*/
|
||||
accent?: boolean,
|
||||
/**
|
||||
* If true, the button will have a flat look.
|
||||
* @default false
|
||||
*/
|
||||
flat?: boolean,
|
||||
/**
|
||||
* If true, the button will have a floating look.
|
||||
* @default false
|
||||
*/
|
||||
floating?: boolean,
|
||||
/**
|
||||
* If specified, the button will be rendered as an <a>
|
||||
*/
|
||||
href?: string,
|
||||
/**
|
||||
* The text string to use for the name of the button.
|
||||
*/
|
||||
label?: string,
|
||||
/**
|
||||
* If true, component will be disabled and show a loading animation.
|
||||
* @default false
|
||||
*/
|
||||
loading?: boolean,
|
||||
/**
|
||||
* To be used with floating button. If true the button will be smaller.
|
||||
* @default false
|
||||
*/
|
||||
mini?: boolean,
|
||||
/**
|
||||
* Indicates if the button should have primary color.
|
||||
* @default false
|
||||
*/
|
||||
primary?: boolean,
|
||||
/**
|
||||
* If true, the button will have a raised look.
|
||||
* @default false
|
||||
*/
|
||||
raised?: boolean,
|
||||
/**
|
||||
* If true, component will have a ripple effect on click.
|
||||
* @default true
|
||||
*/
|
||||
ripple?: boolean,
|
||||
}
|
||||
export interface CardProps extends Props, Clickable {
|
||||
/**
|
||||
* Child components, usually Card subcomponents.
|
||||
|
|
|
@ -33,6 +33,30 @@ export interface Props {
|
|||
*/
|
||||
tooltipHideOnClick?: boolean,
|
||||
}
|
||||
export interface Iconic {
|
||||
/**
|
||||
* Value of the icon (See icon component).
|
||||
*/
|
||||
icon?: string | __React.ReactElement<any> | __React.ReactHTMLElement<any>,
|
||||
}
|
||||
|
||||
export interface Conditional {
|
||||
/**
|
||||
* If true, component will be disabled
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Properties of components that can be clicked
|
||||
*/
|
||||
export interface Clickable {
|
||||
/**
|
||||
* Callback called when the button is clicked.
|
||||
*/
|
||||
onClick?: Function
|
||||
}
|
||||
/**
|
||||
* Properties of modal components (Drawer, Dialog)
|
||||
*/
|
||||
|
@ -62,6 +86,56 @@ export interface Modal {
|
|||
*/
|
||||
onOverlayMouseUp?: Function,
|
||||
}
|
||||
export interface ButtonProps extends Props, Clickable, Conditional, Iconic {
|
||||
/**
|
||||
* Indicates if the button should have accent color.
|
||||
* @default false
|
||||
*/
|
||||
accent?: boolean,
|
||||
/**
|
||||
* If true, the button will have a flat look.
|
||||
* @default false
|
||||
*/
|
||||
flat?: boolean,
|
||||
/**
|
||||
* If true, the button will have a floating look.
|
||||
* @default false
|
||||
*/
|
||||
floating?: boolean,
|
||||
/**
|
||||
* If specified, the button will be rendered as an <a>
|
||||
*/
|
||||
href?: string,
|
||||
/**
|
||||
* The text string to use for the name of the button.
|
||||
*/
|
||||
label?: string,
|
||||
/**
|
||||
* If true, component will be disabled and show a loading animation.
|
||||
* @default false
|
||||
*/
|
||||
loading?: boolean,
|
||||
/**
|
||||
* To be used with floating button. If true the button will be smaller.
|
||||
* @default false
|
||||
*/
|
||||
mini?: boolean,
|
||||
/**
|
||||
* Indicates if the button should have primary color.
|
||||
* @default false
|
||||
*/
|
||||
primary?: boolean,
|
||||
/**
|
||||
* If true, the button will have a raised look.
|
||||
* @default false
|
||||
*/
|
||||
raised?: boolean,
|
||||
/**
|
||||
* If true, component will have a ripple effect on click.
|
||||
* @default true
|
||||
*/
|
||||
ripple?: boolean,
|
||||
}
|
||||
export interface DialogProps extends Props, Modal {
|
||||
/**
|
||||
* An array of objects representing the buttons for the dialog navigation area. The properties will be transferred to the buttons.
|
||||
|
|
|
@ -40,7 +40,10 @@ export interface Conditional {
|
|||
*/
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
export interface Option<T> {
|
||||
label: string,
|
||||
value: T,
|
||||
}
|
||||
/**
|
||||
* Properties of components that have values that can be changed (T is the type of the value)
|
||||
*/
|
||||
|
|
|
@ -160,7 +160,7 @@ export interface ListCheckboxProps extends Props, Conditional, Changeable<boolea
|
|||
export class ListCheckbox extends React.Component<ListCheckboxProps, {}> {
|
||||
render(): React.DOMElement<any, any>;
|
||||
}
|
||||
export export interface ListSubHeaderProps extends Props {
|
||||
export interface ListSubHeaderProps extends Props {
|
||||
/**
|
||||
* List header caption.
|
||||
*/
|
||||
|
|
|
@ -68,7 +68,11 @@ export interface RadioButtonProps extends Props, Conditional {
|
|||
/**
|
||||
* If true, the input element will be selected by default. Transferred from the parent.
|
||||
*/
|
||||
checked: boolean,
|
||||
checked?: boolean,
|
||||
/**
|
||||
* Label for the radio button.
|
||||
*/
|
||||
label?: string;
|
||||
/**
|
||||
* Name for the input element.
|
||||
*/
|
||||
|
|
|
@ -92,6 +92,6 @@ export interface SnackbarProps extends Props, Modal, Iconic {
|
|||
*/
|
||||
type?: string,
|
||||
}
|
||||
export class Snackbar extends React.Component<SnackbarProps, {}> {
|
||||
export default class Snackbar extends React.Component<SnackbarProps, {}> {
|
||||
render(): React.DOMElement<any, any>;
|
||||
}
|
|
@ -33,6 +33,21 @@ export interface Props {
|
|||
*/
|
||||
tooltipHideOnClick?: boolean,
|
||||
}
|
||||
export interface Iconic {
|
||||
/**
|
||||
* Value of the icon (See icon component).
|
||||
*/
|
||||
icon?: string | __React.ReactElement<any> | __React.ReactHTMLElement<any>,
|
||||
}
|
||||
|
||||
export interface Conditional {
|
||||
/**
|
||||
* If true, component will be disabled
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Properties of components that can be clicked
|
||||
*/
|
||||
|
@ -42,6 +57,56 @@ export interface Clickable {
|
|||
*/
|
||||
onClick?: Function
|
||||
}
|
||||
export interface ButtonProps extends Props, Clickable, Conditional, Iconic {
|
||||
/**
|
||||
* Indicates if the button should have accent color.
|
||||
* @default false
|
||||
*/
|
||||
accent?: boolean,
|
||||
/**
|
||||
* If true, the button will have a flat look.
|
||||
* @default false
|
||||
*/
|
||||
flat?: boolean,
|
||||
/**
|
||||
* If true, the button will have a floating look.
|
||||
* @default false
|
||||
*/
|
||||
floating?: boolean,
|
||||
/**
|
||||
* If specified, the button will be rendered as an <a>
|
||||
*/
|
||||
href?: string,
|
||||
/**
|
||||
* The text string to use for the name of the button.
|
||||
*/
|
||||
label?: string,
|
||||
/**
|
||||
* If true, component will be disabled and show a loading animation.
|
||||
* @default false
|
||||
*/
|
||||
loading?: boolean,
|
||||
/**
|
||||
* To be used with floating button. If true the button will be smaller.
|
||||
* @default false
|
||||
*/
|
||||
mini?: boolean,
|
||||
/**
|
||||
* Indicates if the button should have primary color.
|
||||
* @default false
|
||||
*/
|
||||
primary?: boolean,
|
||||
/**
|
||||
* If true, the button will have a raised look.
|
||||
* @default false
|
||||
*/
|
||||
raised?: boolean,
|
||||
/**
|
||||
* If true, component will have a ripple effect on click.
|
||||
* @default true
|
||||
*/
|
||||
ripple?: boolean,
|
||||
}
|
||||
export interface CardProps extends Props, Clickable {
|
||||
/**
|
||||
* Child components, usually Card subcomponents.
|
||||
|
|
|
@ -33,6 +33,30 @@ export interface Props {
|
|||
*/
|
||||
tooltipHideOnClick?: boolean,
|
||||
}
|
||||
export interface Iconic {
|
||||
/**
|
||||
* Value of the icon (See icon component).
|
||||
*/
|
||||
icon?: string | __React.ReactElement<any> | __React.ReactHTMLElement<any>,
|
||||
}
|
||||
|
||||
export interface Conditional {
|
||||
/**
|
||||
* If true, component will be disabled
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Properties of components that can be clicked
|
||||
*/
|
||||
export interface Clickable {
|
||||
/**
|
||||
* Callback called when the button is clicked.
|
||||
*/
|
||||
onClick?: Function
|
||||
}
|
||||
/**
|
||||
* Properties of modal components (Drawer, Dialog)
|
||||
*/
|
||||
|
@ -62,6 +86,56 @@ export interface Modal {
|
|||
*/
|
||||
onOverlayMouseUp?: Function,
|
||||
}
|
||||
export interface ButtonProps extends Props, Clickable, Conditional, Iconic {
|
||||
/**
|
||||
* Indicates if the button should have accent color.
|
||||
* @default false
|
||||
*/
|
||||
accent?: boolean,
|
||||
/**
|
||||
* If true, the button will have a flat look.
|
||||
* @default false
|
||||
*/
|
||||
flat?: boolean,
|
||||
/**
|
||||
* If true, the button will have a floating look.
|
||||
* @default false
|
||||
*/
|
||||
floating?: boolean,
|
||||
/**
|
||||
* If specified, the button will be rendered as an <a>
|
||||
*/
|
||||
href?: string,
|
||||
/**
|
||||
* The text string to use for the name of the button.
|
||||
*/
|
||||
label?: string,
|
||||
/**
|
||||
* If true, component will be disabled and show a loading animation.
|
||||
* @default false
|
||||
*/
|
||||
loading?: boolean,
|
||||
/**
|
||||
* To be used with floating button. If true the button will be smaller.
|
||||
* @default false
|
||||
*/
|
||||
mini?: boolean,
|
||||
/**
|
||||
* Indicates if the button should have primary color.
|
||||
* @default false
|
||||
*/
|
||||
primary?: boolean,
|
||||
/**
|
||||
* If true, the button will have a raised look.
|
||||
* @default false
|
||||
*/
|
||||
raised?: boolean,
|
||||
/**
|
||||
* If true, component will have a ripple effect on click.
|
||||
* @default true
|
||||
*/
|
||||
ripple?: boolean,
|
||||
}
|
||||
export interface DialogProps extends Props, Modal {
|
||||
/**
|
||||
* An array of objects representing the buttons for the dialog navigation area. The properties will be transferred to the buttons.
|
||||
|
|
|
@ -40,7 +40,10 @@ export interface Conditional {
|
|||
*/
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
export interface Option<T> {
|
||||
label: string,
|
||||
value: T,
|
||||
}
|
||||
/**
|
||||
* Properties of components that have values that can be changed (T is the type of the value)
|
||||
*/
|
||||
|
|
112
lib/index.js
112
lib/index.js
|
@ -7,129 +7,87 @@ exports.TimePicker = exports.Tooltip = exports.Table = exports.Switch = exports.
|
|||
|
||||
var _button = require('./button');
|
||||
|
||||
var _loop = function _loop(_key8) {
|
||||
if (_key8 === "default") return 'continue';
|
||||
Object.defineProperty(exports, _key8, {
|
||||
Object.keys(_button).forEach(function (key) {
|
||||
if (key === "default") return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _button[_key8];
|
||||
return _button[key];
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
for (var _key8 in _button) {
|
||||
var _ret = _loop(_key8);
|
||||
|
||||
if (_ret === 'continue') continue;
|
||||
}
|
||||
});
|
||||
|
||||
var _card = require('./card');
|
||||
|
||||
var _loop2 = function _loop2(_key9) {
|
||||
if (_key9 === "default") return 'continue';
|
||||
Object.defineProperty(exports, _key9, {
|
||||
Object.keys(_card).forEach(function (key) {
|
||||
if (key === "default") return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _card[_key9];
|
||||
return _card[key];
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
for (var _key9 in _card) {
|
||||
var _ret2 = _loop2(_key9);
|
||||
|
||||
if (_ret2 === 'continue') continue;
|
||||
}
|
||||
});
|
||||
|
||||
var _layout = require('./layout');
|
||||
|
||||
var _loop3 = function _loop3(_key10) {
|
||||
if (_key10 === "default") return 'continue';
|
||||
Object.defineProperty(exports, _key10, {
|
||||
Object.keys(_layout).forEach(function (key) {
|
||||
if (key === "default") return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _layout[_key10];
|
||||
return _layout[key];
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
for (var _key10 in _layout) {
|
||||
var _ret3 = _loop3(_key10);
|
||||
|
||||
if (_ret3 === 'continue') continue;
|
||||
}
|
||||
});
|
||||
|
||||
var _list = require('./list');
|
||||
|
||||
var _loop4 = function _loop4(_key11) {
|
||||
if (_key11 === "default") return 'continue';
|
||||
Object.defineProperty(exports, _key11, {
|
||||
Object.keys(_list).forEach(function (key) {
|
||||
if (key === "default") return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _list[_key11];
|
||||
return _list[key];
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
for (var _key11 in _list) {
|
||||
var _ret4 = _loop4(_key11);
|
||||
|
||||
if (_ret4 === 'continue') continue;
|
||||
}
|
||||
});
|
||||
|
||||
var _menu = require('./menu');
|
||||
|
||||
var _loop5 = function _loop5(_key12) {
|
||||
if (_key12 === "default") return 'continue';
|
||||
Object.defineProperty(exports, _key12, {
|
||||
Object.keys(_menu).forEach(function (key) {
|
||||
if (key === "default") return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _menu[_key12];
|
||||
return _menu[key];
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
for (var _key12 in _menu) {
|
||||
var _ret5 = _loop5(_key12);
|
||||
|
||||
if (_ret5 === 'continue') continue;
|
||||
}
|
||||
});
|
||||
|
||||
var _radio = require('./radio');
|
||||
|
||||
var _loop6 = function _loop6(_key13) {
|
||||
if (_key13 === "default") return 'continue';
|
||||
Object.defineProperty(exports, _key13, {
|
||||
Object.keys(_radio).forEach(function (key) {
|
||||
if (key === "default") return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _radio[_key13];
|
||||
return _radio[key];
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
for (var _key13 in _radio) {
|
||||
var _ret6 = _loop6(_key13);
|
||||
|
||||
if (_ret6 === 'continue') continue;
|
||||
}
|
||||
});
|
||||
|
||||
var _tabs = require('./tabs');
|
||||
|
||||
var _loop7 = function _loop7(_key14) {
|
||||
if (_key14 === "default") return 'continue';
|
||||
Object.defineProperty(exports, _key14, {
|
||||
Object.keys(_tabs).forEach(function (key) {
|
||||
if (key === "default") return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _tabs[_key14];
|
||||
return _tabs[key];
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
for (var _key14 in _tabs) {
|
||||
var _ret7 = _loop7(_key14);
|
||||
|
||||
if (_ret7 === 'continue') continue;
|
||||
}
|
||||
});
|
||||
|
||||
require('./utils/polyfills');
|
||||
|
||||
|
|
|
@ -160,7 +160,7 @@ export interface ListCheckboxProps extends Props, Conditional, Changeable<boolea
|
|||
export class ListCheckbox extends React.Component<ListCheckboxProps, {}> {
|
||||
render(): React.DOMElement<any, any>;
|
||||
}
|
||||
export export interface ListSubHeaderProps extends Props {
|
||||
export interface ListSubHeaderProps extends Props {
|
||||
/**
|
||||
* List header caption.
|
||||
*/
|
||||
|
|
|
@ -27,7 +27,7 @@ var _testing2 = _interopRequireDefault(_testing);
|
|||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
describe('ProgressBar', function () {
|
||||
var progressBar = undefined;
|
||||
var progressBar = void 0;
|
||||
|
||||
describe('#calculateRatio', function () {
|
||||
before(function () {
|
||||
|
@ -49,11 +49,11 @@ describe('ProgressBar', function () {
|
|||
});
|
||||
|
||||
describe('#render', function () {
|
||||
var buffer = undefined,
|
||||
value = undefined,
|
||||
wrapper = undefined,
|
||||
circle = undefined,
|
||||
strokeLength = undefined;
|
||||
var buffer = void 0,
|
||||
value = void 0,
|
||||
wrapper = void 0,
|
||||
circle = void 0,
|
||||
strokeLength = void 0;
|
||||
|
||||
it('renders the value and buffer bars when it is linear', function () {
|
||||
wrapper = _testing2.default.shallowRenderComponent(_ProgressBar.ProgressBar, { theme: _theme2.default }).props.children;
|
||||
|
|
|
@ -68,7 +68,11 @@ export interface RadioButtonProps extends Props, Conditional {
|
|||
/**
|
||||
* If true, the input element will be selected by default. Transferred from the parent.
|
||||
*/
|
||||
checked: boolean,
|
||||
checked?: boolean,
|
||||
/**
|
||||
* Label for the radio button.
|
||||
*/
|
||||
label?: string;
|
||||
/**
|
||||
* Name for the input element.
|
||||
*/
|
||||
|
|
|
@ -37,10 +37,10 @@ var _theme2 = _interopRequireDefault(_theme);
|
|||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
describe('Slider', function () {
|
||||
var slider = undefined,
|
||||
progress = undefined,
|
||||
input = undefined,
|
||||
onChange = undefined;
|
||||
var slider = void 0,
|
||||
progress = void 0,
|
||||
input = void 0,
|
||||
onChange = void 0;
|
||||
|
||||
describe('#positionToValue', function () {
|
||||
before(function () {
|
||||
|
|
|
@ -92,6 +92,6 @@ export interface SnackbarProps extends Props, Modal, Iconic {
|
|||
*/
|
||||
type?: string,
|
||||
}
|
||||
export class Snackbar extends React.Component<SnackbarProps, {}> {
|
||||
export default class Snackbar extends React.Component<SnackbarProps, {}> {
|
||||
render(): React.DOMElement<any, any>;
|
||||
}
|
|
@ -21,7 +21,7 @@ var factory = function factory(Checkbox) {
|
|||
var selected = _ref.selected;
|
||||
var theme = _ref.theme;
|
||||
|
||||
var selectCell = undefined;
|
||||
var selectCell = void 0;
|
||||
var contentCells = Object.keys(model).map(function (key) {
|
||||
var name = model[key].title || key;
|
||||
return _react2.default.createElement(
|
||||
|
|
|
@ -39,8 +39,8 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
|
|||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
describe('Tabs', function () {
|
||||
var tabContents = undefined,
|
||||
composition = undefined;
|
||||
var tabContents = void 0,
|
||||
composition = void 0;
|
||||
|
||||
it('only renders the current tab', function () {
|
||||
var Composition = function (_Component) {
|
||||
|
|
Loading…
Reference in New Issue