Socket
Socket
Sign inDemoInstall

@blueprintjs/core

Package Overview
Dependencies
Maintainers
1
Versions
298
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blueprintjs/core - npm Package Compare versions

Comparing version 1.14.0 to 1.15.0

3

dist/common/abstractComponent.d.ts

@@ -7,3 +7,4 @@ import * as React from "react";

export declare abstract class AbstractComponent<P, S> extends React.Component<P, S> {
displayName: string;
/** Component displayName should be `public static`. This property exists to prevent incorrect usage. */
protected displayName: never;
private timeoutIds;

@@ -10,0 +11,0 @@ constructor(props?: P, context?: any);

@@ -11,2 +11,3 @@ /*

var React = require("react");
var utils_1 = require("./utils");
/**

@@ -34,7 +35,11 @@ * An abstract component that Blueprint components can extend

};
_this.validateProps(_this.props);
if (!utils_1.isNodeEnv("production")) {
_this.validateProps(_this.props);
}
return _this;
}
AbstractComponent.prototype.componentWillReceiveProps = function (nextProps) {
this.validateProps(nextProps);
if (!utils_1.isNodeEnv("production")) {
this.validateProps(nextProps);
}
};

@@ -41,0 +46,0 @@ AbstractComponent.prototype.componentWillUnmount = function () {

@@ -1,6 +0,7 @@

export declare function deprecationWarning(oldName: string, newName: string, message?: string): string;
export declare const ALERT_CANCEL_PROPS: string;
export declare const DEPRECATION_SHOULD_ATTACH_TO_BODY: string;
export declare const CLAMP_MIN_MAX: string;
export declare const ALERT_WARN_CANCEL_PROPS: string;
export declare const COLLAPSIBLE_LIST_INVALID_CHILD: string;
export declare const MENU_CHILDREN_SUBMENU_MUTEX: string;
export declare const CONTEXTMENU_WARN_DECORATOR_NO_METHOD: string;
export declare const HOTKEYS_HOTKEY_CHILDREN: string;
export declare const MENU_WARN_CHILDREN_SUBMENU_MUTEX: string;
export declare const NUMERIC_INPUT_MIN_MAX: string;

@@ -14,8 +15,8 @@ export declare const NUMERIC_INPUT_MINOR_STEP_SIZE_BOUND: string;

export declare const POPOVER_ONE_CHILD: string;
export declare const POPOVER_UNCONTROLLED_ONINTERACTION: string;
export declare const POPOVER_MODAL_INLINE: string;
export declare const POPOVER_MODAL_INTERACTION: string;
export declare const POPOVER_SMART_POSITIONING_INLINE: string;
export declare const RADIOGROUP_RADIO_CHILDREN: string;
export declare const RADIOGROUP_CHILDREN_OPTIONS_MUTEX: string;
export declare const POPOVER_WARN_MODAL_INLINE: string;
export declare const POPOVER_WARN_DEPRECATED_CONSTRAINTS: string;
export declare const POPOVER_WARN_INLINE_NO_TETHER: string;
export declare const POPOVER_WARN_UNCONTROLLED_ONINTERACTION: string;
export declare const RADIOGROUP_WARN_CHILDREN_OPTIONS_MUTEX: string;
export declare const SLIDER_ZERO_STEP: string;

@@ -26,6 +27,7 @@ export declare const SLIDER_ZERO_LABEL_STEP: string;

export declare const TABS_MISMATCH: string;
export declare const TABS_DEPRECATED: string;
export declare const TOASTER_INLINE_WARNING: string;
export declare const TOOLTIP_EMPTY_WARNING: string;
export declare const WARNING_DIALOG_NO_HEADER_ICON: string;
export declare const WARNING_DIALOG_NO_HEADER_CLOSE_BUTTON: string;
export declare const TABS_WARN_DEPRECATED: string;
export declare const TOASTER_WARN_INLINE: string;
export declare const TOASTER_WARN_LEFT_RIGHT: string;
export declare const TOOLTIP_WARN_EMPTY_CONTENT: string;
export declare const DIALOG_WARN_NO_HEADER_ICON: string;
export declare const DIALOG_WARN_NO_HEADER_CLOSE_BUTTON: string;

@@ -11,37 +11,35 @@ /*

var deprec = ns + " DEPRECATION:";
function deprecationWarning(oldName, newName, message) {
if (message === void 0) { message = ""; }
return deprec + " '" + oldName + "' prop has been replaced by the '" + newName + "' prop. " + message + "\nIt will be removed in the next major version of blueprint.";
}
exports.deprecationWarning = deprecationWarning;
exports.ALERT_CANCEL_PROPS = ns + " If either cancelButtonText or onCancel are set in <Alert>, both must be set.";
exports.DEPRECATION_SHOULD_ATTACH_TO_BODY = deprecationWarning("shouldAttachToBody", "inline");
exports.CLAMP_MIN_MAX = ns + " clamp: max cannot be less than min";
exports.ALERT_WARN_CANCEL_PROPS = ns + " <Alert> cancelButtonText and onCancel should be set together.";
exports.COLLAPSIBLE_LIST_INVALID_CHILD = ns + " <CollapsibleList> children must be <MenuItem>s";
exports.MENU_CHILDREN_SUBMENU_MUTEX = ns + " <MenuItem> children and submenu props are mutually exclusive";
exports.NUMERIC_INPUT_MIN_MAX = ns + " <NumericInput> requires min to be strictly less than max if both are defined";
exports.NUMERIC_INPUT_MINOR_STEP_SIZE_BOUND = ns + " <NumericInput> requires minorStepSize to be strictly less than stepSize";
exports.NUMERIC_INPUT_MAJOR_STEP_SIZE_BOUND = ns + " <NumericInput> requires majorStepSize to be strictly greater than stepSize";
exports.NUMERIC_INPUT_MINOR_STEP_SIZE_NON_POSITIVE = ns + " <NumericInput> requires minorStepSize to be strictly greater than zero";
exports.NUMERIC_INPUT_MAJOR_STEP_SIZE_NON_POSITIVE = ns + " <NumericInput> requires majorStepSize to be strictly greater than zero";
exports.NUMERIC_INPUT_STEP_SIZE_NON_POSITIVE = ns + " <NumericInput> requires stepSize to be strictly greater than zero";
exports.NUMERIC_INPUT_STEP_SIZE_NULL = ns + " <NumericInput> requires stepSize to be defined";
exports.CONTEXTMENU_WARN_DECORATOR_NO_METHOD = ns + " @ContextMenuTarget-decorated class should implement renderContextMenu.";
exports.HOTKEYS_HOTKEY_CHILDREN = ns + " <Hotkeys> only accepts <Hotkey> children.";
exports.MENU_WARN_CHILDREN_SUBMENU_MUTEX = ns + " <MenuItem> children and submenu props are mutually exclusive, with children taking priority.";
exports.NUMERIC_INPUT_MIN_MAX = ns + " <NumericInput> requires min to be strictly less than max if both are defined.";
exports.NUMERIC_INPUT_MINOR_STEP_SIZE_BOUND = ns + " <NumericInput> requires minorStepSize to be strictly less than stepSize.";
exports.NUMERIC_INPUT_MAJOR_STEP_SIZE_BOUND = ns + " <NumericInput> requires majorStepSize to be strictly greater than stepSize.";
exports.NUMERIC_INPUT_MINOR_STEP_SIZE_NON_POSITIVE = ns + " <NumericInput> requires minorStepSize to be strictly greater than zero.";
exports.NUMERIC_INPUT_MAJOR_STEP_SIZE_NON_POSITIVE = ns + " <NumericInput> requires majorStepSize to be strictly greater than zero.";
exports.NUMERIC_INPUT_STEP_SIZE_NON_POSITIVE = ns + " <NumericInput> requires stepSize to be strictly greater than zero.";
exports.NUMERIC_INPUT_STEP_SIZE_NULL = ns + " <NumericInput> requires stepSize to be defined.";
exports.POPOVER_ONE_CHILD = ns + " <Popover> requires exactly one target element";
exports.POPOVER_UNCONTROLLED_ONINTERACTION = ns + " <Popover> onInteraction is ignored when uncontrolled";
exports.POPOVER_MODAL_INLINE = ns + " <Popover isModal={true}> requires inline={false}.";
exports.POPOVER_MODAL_INTERACTION = ns + " <Popover isModal={true}> requires interactionKind={PopoverInteractionKind.CLICK}.";
exports.POPOVER_SMART_POSITIONING_INLINE = ns + " <Popover useSmartPositioning={true}> requires inline={false}.";
exports.RADIOGROUP_RADIO_CHILDREN = ns + " <RadioGroup> only supports <Radio> children";
exports.RADIOGROUP_CHILDREN_OPTIONS_MUTEX = ns + " <RadioGroup> children and options props are mutually exclusive.";
exports.POPOVER_WARN_MODAL_INLINE = ns + " <Popover inline={true}> ignores isModal";
exports.POPOVER_WARN_DEPRECATED_CONSTRAINTS = deprec + " <Popover> constraints and useSmartPositioning are deprecated. Use tetherOptions directly.";
exports.POPOVER_WARN_INLINE_NO_TETHER = ns + " <Popover inline={true}> ignores tetherOptions, constraints, and useSmartPositioning.";
exports.POPOVER_WARN_UNCONTROLLED_ONINTERACTION = ns + " <Popover> onInteraction is ignored when uncontrolled.";
exports.RADIOGROUP_WARN_CHILDREN_OPTIONS_MUTEX = ns + " <RadioGroup> children and options prop are mutually exclusive, with options taking priority.";
exports.SLIDER_ZERO_STEP = ns + " <Slider> stepSize must be greater than zero.";
exports.SLIDER_ZERO_LABEL_STEP = ns + " <Slider> labelStepSize must be greater than zero.";
exports.RANGESLIDER_NULL_VALUE = ns + " <RangeSlider> value prop must be an array of two non-null numbers.";
exports.TABS_FIRST_CHILD = ns + " First child of <Tabs> component should be a <TabList>";
exports.TABS_MISMATCH = ns + " Number of <Tab> components should equal number of <TabPanel> components";
exports.TABS_DEPRECATED = ns + " <Tabs> is deprecated since v1.11.0; consider upgrading to <Tabs2>."
exports.TABS_FIRST_CHILD = ns + " First child of <Tabs> component must be a <TabList>";
exports.TABS_MISMATCH = ns + " Number of <Tab> components must equal number of <TabPanel> components";
exports.TABS_WARN_DEPRECATED = deprec + " <Tabs> is deprecated since v1.11.0; consider upgrading to <Tabs2>."
+ " https://blueprintjs.com/#components.tabs.js";
exports.TOASTER_INLINE_WARNING = ns + " Toaster.create() ignores inline prop as it always creates a new element";
exports.TOOLTIP_EMPTY_WARNING = ns + " Disabling empty <Tooltip>";
exports.WARNING_DIALOG_NO_HEADER_ICON = ns + " Warning: Dialog iconName prop is ignored if title prop is omitted";
exports.WARNING_DIALOG_NO_HEADER_CLOSE_BUTTON = ns + " Warning: Dialog isCloseButtonShown prop is ignored if title prop is omitted";
exports.TOASTER_WARN_INLINE = ns + " Toaster.create() ignores inline prop as it always creates a new element.";
exports.TOASTER_WARN_LEFT_RIGHT = ns + " Toaster does not support LEFT or RIGHT positions.";
exports.TOOLTIP_WARN_EMPTY_CONTENT = ns + " Disabling <Tooltip> with empty content...";
exports.DIALOG_WARN_NO_HEADER_ICON = ns + " <Dialog> iconName is ignored if title is omitted.";
exports.DIALOG_WARN_NO_HEADER_CLOSE_BUTTON = ns + " <Dialog> isCloseButtonShown prop is ignored if title is omitted.";
//# sourceMappingURL=errors.js.map

@@ -11,6 +11,2 @@ /*

var position_1 = require("./position");
var DEFAULT_CONSTRAINTS = {
attachment: "together",
to: "scrollParent",
};
// per https://github.com/HubSpot/tether/pull/204, Tether now exposes a `bodyElement` option that,

@@ -25,10 +21,6 @@ // when present, gets the tethered element injected into *it* instead of into the document body.

/** @internal */
function createTetherOptions(element, target, position, useSmartPositioning, tetherOptions) {
function createTetherOptions(element, target, position, tetherOptions) {
if (tetherOptions === void 0) { tetherOptions = {}; }
if (tetherOptions.constraints == null && useSmartPositioning) {
tetherOptions.constraints = [DEFAULT_CONSTRAINTS];
}
var options = tslib_1.__assign({}, tetherOptions, { attachment: getPopoverAttachment(position), bodyElement: fakeHtmlElement, classPrefix: "pt-tether", element: element,
return tslib_1.__assign({}, tetherOptions, { attachment: getPopoverAttachment(position), bodyElement: fakeHtmlElement, classPrefix: "pt-tether", element: element,
target: target, targetAttachment: getTargetAttachment(position) });
return options;
}

@@ -35,0 +27,0 @@ exports.createTetherOptions = createTetherOptions;

@@ -9,2 +9,3 @@ /*

Object.defineProperty(exports, "__esModule", { value: true });
var errors_1 = require("./errors");
/** Returns whether `process.env.NODE_ENV` exists and equals `env`. */

@@ -59,3 +60,3 @@ function isNodeEnv(env) {

if (max < min) {
throw new Error("clamp: max cannot be less than min");
throw new Error(errors_1.CLAMP_MIN_MAX);
}

@@ -62,0 +63,0 @@ return Math.min(Math.max(val, min), max);

@@ -13,3 +13,3 @@ /*

var common_1 = require("../../common");
var Errors = require("../../common/errors");
var errors_1 = require("../../common/errors");
var buttons_1 = require("../button/buttons");

@@ -35,3 +35,3 @@ var dialog_1 = require("../dialog/dialog");

props.cancelButtonText == null && props.onCancel != null) {
throw new Error(Errors.ALERT_CANCEL_PROPS);
console.warn(errors_1.ALERT_WARN_CANCEL_PROPS);
}

@@ -38,0 +38,0 @@ };

@@ -10,2 +10,3 @@ /*

var React = require("react");
var errors_1 = require("../../common/errors");
var utils_1 = require("../../common/utils");

@@ -16,3 +17,3 @@ var ContextMenu = require("./contextMenu");

if (!utils_1.isFunction(renderContextMenu)) {
throw new Error("@ContextMenuTarget-decorated class must implement `renderContextMenu`. " + constructor);
console.warn(errors_1.CONTEXTMENU_WARN_DECORATOR_NO_METHOD);
}

@@ -35,6 +36,8 @@ // patching classes like this requires preserving function context

}
var menu = _this.renderContextMenu(e);
if (menu != null) {
e.preventDefault();
ContextMenu.show(menu, { left: e.clientX, top: e.clientY }, onContextMenuClose);
if (utils_1.isFunction(_this.renderContextMenu)) {
var menu = _this.renderContextMenu(e);
if (menu != null) {
e.preventDefault();
ContextMenu.show(menu, { left: e.clientX, top: e.clientY }, onContextMenuClose);
}
}

@@ -41,0 +44,0 @@ utils_1.safeInvoke(oldOnContextMenu, e);

@@ -37,3 +37,3 @@ import * as React from "react";

static defaultProps: IDialogProps;
displayName: string;
static displayName: string;
render(): JSX.Element;

@@ -40,0 +40,0 @@ protected validateProps(props: IDialogProps): void;

@@ -19,5 +19,3 @@ /*

function Dialog() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.displayName = "Blueprint.Dialog";
return _this;
return _super !== null && _super.apply(this, arguments) || this;
}

@@ -34,6 +32,6 @@ Dialog.prototype.render = function () {

if (props.iconName != null) {
console.error(Errors.WARNING_DIALOG_NO_HEADER_ICON);
console.warn(Errors.DIALOG_WARN_NO_HEADER_ICON);
}
if (props.isCloseButtonShown != null) {
console.error(Errors.WARNING_DIALOG_NO_HEADER_CLOSE_BUTTON);
console.warn(Errors.DIALOG_WARN_NO_HEADER_CLOSE_BUTTON);
}

@@ -71,2 +69,3 @@ }

};
Dialog.displayName = "Blueprint.Dialog";
exports.Dialog = Dialog;

@@ -73,0 +72,0 @@ exports.DialogFactory = React.createFactory(Dialog);

@@ -32,12 +32,4 @@ /*

RadioGroup.prototype.validateProps = function () {
if (this.props.children != null) {
if (this.props.options != null) {
throw new Error(Errors.RADIOGROUP_CHILDREN_OPTIONS_MUTEX);
}
React.Children.forEach(this.props.children, function (child) {
var radio = child;
if (radio.type !== controls_1.Radio) {
throw new Error(Errors.RADIOGROUP_RADIO_CHILDREN);
}
});
if (this.props.children != null && this.props.options != null) {
console.warn(Errors.RADIOGROUP_WARN_CHILDREN_OPTIONS_MUTEX);
}

@@ -48,4 +40,8 @@ };

return React.Children.map(this.props.children, function (child) {
var radio = child;
return React.cloneElement(radio, _this.getRadioProps(radio.props));
if (isRadio(child)) {
return React.cloneElement(child, _this.getRadioProps(child.props));
}
else {
return child;
}
});

@@ -72,3 +68,6 @@ };

;
function isRadio(child) {
return child != null && child.type === controls_1.Radio;
}
//# sourceMappingURL=radioGroup.js.map

@@ -38,5 +38,5 @@ import { ReactElement } from "react";

};
static isInstance(element: ReactElement<any>): element is ReactElement<IHotkeyProps>;
static isInstance(element: any): element is ReactElement<IHotkeyProps>;
render(): JSX.Element;
protected validateProps(props: IHotkeyProps): void;
}

@@ -19,3 +19,3 @@ /*

Hotkey.isInstance = function (element) {
return element.type === Hotkey;
return element != null && element.type === Hotkey;
};

@@ -22,0 +22,0 @@ Hotkey.prototype.render = function () {

@@ -28,2 +28,3 @@ /*

exports.setHotkeysDialogProps = hotkeysDialog_1.setHotkeysDialogProps;
var errors_1 = require("../../common/errors");
var Hotkeys = (function (_super) {

@@ -61,4 +62,4 @@ tslib_1.__extends(Hotkeys, _super);

react_1.Children.forEach(props.children, function (child) {
if (typeof child !== "object" || !hotkey_1.Hotkey.isInstance(child)) {
throw new Error("Hotkeys only accepts <Hotkey> children");
if (!hotkey_1.Hotkey.isInstance(child)) {
throw new Error(errors_1.HOTKEYS_HOTKEY_CHILDREN);
}

@@ -65,0 +66,0 @@ });

@@ -138,3 +138,3 @@ /*

if (props.children != null && props.submenu != null) {
throw new Error(Errors.MENU_CHILDREN_SUBMENU_MUTEX);
console.warn(Errors.MENU_WARN_CHILDREN_SUBMENU_MUTEX);
}

@@ -141,0 +141,0 @@ };

@@ -92,6 +92,6 @@ import * as React from "react";

export declare class Overlay extends React.Component<IOverlayProps, IOverlayState> {
static displayName: string;
static defaultProps: IOverlayProps;
private static openStack;
private static getLastOpened;
displayName: string;
private containerElement;

@@ -98,0 +98,0 @@ private refHandlers;

@@ -22,3 +22,2 @@ /*

var _this = _super.call(this, props, context) || this;
_this.displayName = "Blueprint.Overlay";
_this.refHandlers = {

@@ -191,2 +190,3 @@ container: function (ref) { return _this.containerElement = ref; },

}(React.Component));
Overlay.displayName = "Blueprint.Overlay";
Overlay.defaultProps = {

@@ -193,0 +193,0 @@ autoFocus: true,

@@ -25,3 +25,3 @@ import * as React from "react";

* See http://tether.io/#constraints.
* @deprecated since v1.12.0; use `tetherOptions` instead.
* @deprecated since v1.12.0; use `tetherOptions.constraints` instead.
*/

@@ -134,7 +134,11 @@ constraints?: TetherUtils.ITetherConstraint[];

/**
* Whether the popover will try to reposition itself
* if there isn't room for it in its current position.
* The popover will try to flip to the opposite side of the target element but
* will not move to an adjacent side.
* Whether the popover will flip to the opposite side of the target element if there is not
* enough room in the viewport. This is equivalent to:
* ```
* const tetherOptions = {
* constraints: { attachment: "together", to: "scrollParent" },
* };
* ```
* @default false
* @deprecated since v1.15.0; use `tetherOptions.constraints` directly.
*/

@@ -151,3 +155,3 @@ useSmartPositioning?: boolean;

static defaultProps: IPopoverProps;
displayName: string;
static displayName: string;
private hasDarkParent;

@@ -154,0 +158,0 @@ private isContentMounting;

@@ -28,2 +28,6 @@ /*

"c0-1.654-.983-3.9-2.21-5.03l-7.183-6.616c-.81-.746-.802-1.96 0-2.7l7.183-6.614z";
var SMART_POSITIONING = {
attachment: "together",
to: "scrollParent",
};
var PopoverInteractionKind;

@@ -40,3 +44,2 @@ (function (PopoverInteractionKind) {

var _this = _super.call(this, props, context) || this;
_this.displayName = "Blueprint.Popover";
_this.hasDarkParent = false;

@@ -207,15 +210,18 @@ // a flag that is set to true while we are waiting for the underlying Portal to complete rendering

Popover.prototype.validateProps = function (props) {
if (props.useSmartPositioning || props.constraints != null) {
console.warn(Errors.POPOVER_WARN_DEPRECATED_CONSTRAINTS);
}
if (props.isOpen == null && props.onInteraction != null) {
console.warn(Errors.POPOVER_UNCONTROLLED_ONINTERACTION);
console.warn(Errors.POPOVER_WARN_UNCONTROLLED_ONINTERACTION);
}
if (props.isModal && props.interactionKind !== PopoverInteractionKind.CLICK) {
throw new Error(Errors.POPOVER_MODAL_INTERACTION);
if (props.inline && (props.useSmartPositioning || props.constraints != null || props.tetherOptions != null)) {
console.warn(Errors.POPOVER_WARN_INLINE_NO_TETHER);
}
if (props.isModal && props.inline) {
throw new Error(Errors.POPOVER_MODAL_INLINE);
console.warn(Errors.POPOVER_WARN_MODAL_INLINE);
}
if (props.useSmartPositioning && props.inline) {
throw new Error(Errors.POPOVER_SMART_POSITIONING_INLINE);
if (props.isModal && props.interactionKind !== PopoverInteractionKind.CLICK) {
throw new Error(Errors.POPOVER_MODAL_INTERACTION);
}
if (typeof props.children !== "string") {
if (typeof props.children === "object") {
try {

@@ -225,2 +231,3 @@ React.Children.only(props.children);

catch (e) {
console.error(props);
throw new Error(Errors.POPOVER_ONE_CHILD);

@@ -279,3 +286,3 @@ }

Popover.prototype.getPopoverTransformOrigin = function () {
// if smart positioning is enabled then we must rely CSS classes to put transform origin
// if smart positioning is enabled then we must rely on CSS classes to put transform origin
// on the correct side and cannot override it in JS. (https://github.com/HubSpot/tether/issues/154)

@@ -310,2 +317,3 @@ if (this.props.useSmartArrowPositioning && !this.props.useSmartPositioning) {

if (this.state.isOpen && !this.props.inline && this.popoverElement != null) {
var _a = this.props, constraints = _a.constraints, position = _a.position, _b = _a.tetherOptions, tetherOptions = _b === void 0 ? {} : _b, useSmartPositioning = _a.useSmartPositioning;
// the .pt-popover-target span we wrap the children in won't always be as big as its children

@@ -316,11 +324,11 @@ // so instead, we'll position tether based off of its first child.

// constraints is deprecated but must still be supported through tetherOptions until v2.0
if (this.props.constraints != null) {
this.props.tetherOptions.constraints = this.props.constraints;
}
var tetherOptions = TetherUtils.createTetherOptions(this.popoverElement, target, this.props.position, this.props.useSmartPositioning, this.props.tetherOptions);
var options = (constraints == null && !useSmartPositioning)
? tetherOptions
: tslib_1.__assign({}, tetherOptions, { constraints: useSmartPositioning ? [SMART_POSITIONING] : constraints });
var finalTetherOptions = TetherUtils.createTetherOptions(this.popoverElement, target, position, options);
if (this.tether == null) {
this.tether = new Tether(tetherOptions);
this.tether = new Tether(finalTetherOptions);
}
else {
this.tether.setOptions(tetherOptions);
this.tether.setOptions(finalTetherOptions);
}

@@ -386,3 +394,2 @@ // if props.position has just changed, Tether unfortunately positions the popover based

rootElementTag: "span",
tetherOptions: {},
transitionDuration: 300,

@@ -392,2 +399,3 @@ useSmartArrowPositioning: true,

};
Popover.displayName = "Blueprint.Popover";
Popover = tslib_1.__decorate([

@@ -394,0 +402,0 @@ PureRender

@@ -21,3 +21,3 @@ import * as React from "react";

export declare class Portal extends React.Component<IPortalProps, {}> {
displayName: string;
static displayName: string;
private targetElement;

@@ -24,0 +24,0 @@ render(): JSX.Element;

@@ -23,5 +23,3 @@ /*

function Portal() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.displayName = "Blueprint.Portal";
return _this;
return _super !== null && _super.apply(this, arguments) || this;
}

@@ -50,4 +48,5 @@ Portal.prototype.render = function () {

}(React.Component));
Portal.displayName = "Blueprint.Portal";
exports.Portal = Portal;
//# sourceMappingURL=portal.js.map

@@ -20,3 +20,3 @@ import * as React from "react";

export declare class Handle extends AbstractComponent<IHandleProps, IHandleState> {
displayName: string;
static displayName: string;
state: {

@@ -23,0 +23,0 @@ isMoving: boolean;

@@ -23,3 +23,2 @@ /*

var _this = _super !== null && _super.apply(this, arguments) || this;
_this.displayName = "Blueprint.SliderHandle";
_this.state = {

@@ -120,3 +119,3 @@ isMoving: false,

if (typeof props[prop] !== "number") {
throw new Error("Handle requires number for " + prop + " prop");
throw new Error("[Blueprint] <Handle> requires number value for " + prop + " prop");
}

@@ -146,2 +145,3 @@ }

}(abstractComponent_1.AbstractComponent));
Handle.displayName = "Blueprint.SliderHandle";
Handle = tslib_1.__decorate([

@@ -148,0 +148,0 @@ PureRender

@@ -18,3 +18,3 @@ import * as React from "react";

static defaultProps: IRangeSliderProps;
displayName: string;
static displayName: string;
className: string;

@@ -21,0 +21,0 @@ private handles;

@@ -26,3 +26,2 @@ /*

var _this = _super !== null && _super.apply(this, arguments) || this;
_this.displayName = "Blueprint.RangeSlider";
_this.className = classNames(Classes.SLIDER, Classes.RANGE_SLIDER);

@@ -112,2 +111,3 @@ _this.handles = [];

};
RangeSlider.displayName = "Blueprint.RangeSlider";
exports.RangeSlider = RangeSlider;

@@ -114,0 +114,0 @@ exports.RangeSliderFactory = React.createFactory(RangeSlider);

@@ -21,3 +21,3 @@ import * as React from "react";

static defaultProps: ISliderProps;
displayName: "Blueprint.Slider";
static displayName: "Blueprint.Slider";
private handle;

@@ -24,0 +24,0 @@ protected renderFill(): JSX.Element;

@@ -12,3 +12,3 @@ import * as React from "react";

static defaultProps: ITabProps;
displayName: string;
static displayName: string;
render(): JSX.Element;

@@ -15,0 +15,0 @@ }

@@ -17,5 +17,3 @@ /*

function Tab() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.displayName = "Blueprint.Tab";
return _this;
return _super !== null && _super.apply(this, arguments) || this;
}

@@ -31,2 +29,3 @@ Tab.prototype.render = function () {

};
Tab.displayName = "Blueprint.Tab";
Tab = tslib_1.__decorate([

@@ -33,0 +32,0 @@ PureRender

@@ -13,3 +13,3 @@ import * as React from "react";

export declare class TabList extends AbstractComponent<ITabListProps, {}> {
displayName: string;
static displayName: string;
state: ITabListState;

@@ -16,0 +16,0 @@ render(): JSX.Element;

@@ -19,3 +19,2 @@ /*

var _this = _super !== null && _super.apply(this, arguments) || this;
_this.displayName = "Blueprint.TabList";
_this.state = {

@@ -40,2 +39,3 @@ shouldAnimate: false,

}(abstractComponent_1.AbstractComponent));
TabList.displayName = "Blueprint.TabList";
TabList = tslib_1.__decorate([

@@ -42,0 +42,0 @@ PureRender

@@ -14,3 +14,3 @@ import * as React from "react";

export declare class TabPanel extends React.Component<ITabPanelProps, {}> {
displayName: string;
static displayName: string;
render(): JSX.Element;

@@ -17,0 +17,0 @@ }

@@ -17,5 +17,3 @@ /*

function TabPanel() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.displayName = "Blueprint.TabPanel";
return _this;
return _super !== null && _super.apply(this, arguments) || this;
}

@@ -27,2 +25,3 @@ TabPanel.prototype.render = function () {

}(React.Component));
TabPanel.displayName = "Blueprint.TabPanel";
TabPanel = tslib_1.__decorate([

@@ -29,0 +28,0 @@ PureRender

@@ -37,3 +37,3 @@ import * as React from "react";

static defaultProps: ITabsProps;
displayName: string;
static displayName: string;
state: ITabsState;

@@ -40,0 +40,0 @@ private panelIds;

@@ -27,3 +27,2 @@ /*

var _this = _super.call(this, props, context) || this;
_this.displayName = "Blueprint.Tabs";
// state is initialized in the constructor but getStateFromProps needs state defined

@@ -93,3 +92,3 @@ _this.state = {};

if (!Utils.isNodeEnv("production")) {
console.warn(Errors.TABS_DEPRECATED);
console.warn(Errors.TABS_WARN_DEPRECATED);
}

@@ -292,2 +291,3 @@ return _this;

};
Tabs.displayName = "Blueprint.Tabs";
Tabs = tslib_1.__decorate([

@@ -294,0 +294,0 @@ PureRender

@@ -28,3 +28,3 @@ import * as React from "react";

static defaultProps: ITab2Props;
displayName: string;
static displayName: string;
render(): JSX.Element;

@@ -31,0 +31,0 @@ }

@@ -17,5 +17,3 @@ /*

function Tab2() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.displayName = "Blueprint.Tab2";
return _this;
return _super !== null && _super.apply(this, arguments) || this;
}

@@ -34,2 +32,3 @@ // this component is never rendered directly; see Tabs2#renderTabPanel()

};
Tab2.displayName = "Blueprint.Tab2";
Tab2 = tslib_1.__decorate([

@@ -36,0 +35,0 @@ PureRender

@@ -56,3 +56,3 @@ import * as React from "react";

static defaultProps: Partial<ITabs2Props>;
displayName: string;
static displayName: string;
private tablistElement;

@@ -59,0 +59,0 @@ private refHandlers;

@@ -25,3 +25,2 @@ /*

var _this = _super.call(this, props) || this;
_this.displayName = "Blueprint.Tabs2";
_this.refHandlers = {

@@ -179,2 +178,3 @@ tablist: function (tabElement) { return _this.tablistElement = tabElement; },

};
Tabs2.displayName = "Blueprint.Tabs2";
Tabs2 = tslib_1.__decorate([

@@ -181,0 +181,0 @@ PureRender

@@ -11,3 +11,3 @@ import * as React from "react";

export declare class Tag extends React.Component<ITagProps, {}> {
displayName: string;
static displayName: string;
render(): JSX.Element;

@@ -14,0 +14,0 @@ }

@@ -19,5 +19,3 @@ /*

function Tag() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.displayName = "Blueprint.Tag";
return _this;
return _super !== null && _super.apply(this, arguments) || this;
}

@@ -37,2 +35,3 @@ Tag.prototype.render = function () {

}(React.Component));
Tag.displayName = "Blueprint.Tag";
Tag = tslib_1.__decorate([

@@ -39,0 +38,0 @@ PureRender

@@ -30,3 +30,3 @@ import * as React from "react";

static defaultProps: IToastProps;
displayName: string;
static displayName: string;
render(): JSX.Element;

@@ -33,0 +33,0 @@ componentDidMount(): void;

@@ -21,3 +21,2 @@ /*

var _this = _super !== null && _super.apply(this, arguments) || this;
_this.displayName = "Blueprint.Toast";
_this.handleActionClick = function (e) {

@@ -87,2 +86,3 @@ utils_1.safeInvoke(_this.props.action.onClick, e);

};
Toast.displayName = "Blueprint.Toast";
Toast = tslib_1.__decorate([

@@ -89,0 +89,0 @@ PureRender

@@ -48,4 +48,4 @@ /*

if (container === void 0) { container = document.body; }
if (props != null && props.inline != null) {
console.warn(errors_1.TOASTER_INLINE_WARNING);
if (props != null && props.inline != null && !utils_1.isNodeEnv("production")) {
console.warn(errors_1.TOASTER_WARN_INLINE);
}

@@ -98,3 +98,3 @@ var containerElement = document.createElement("div");

if (props.position === position_1.Position.LEFT || props.position === position_1.Position.RIGHT) {
throw new Error("Toaster does not support LEFT or RIGHT positions.");
console.warn(errors_1.TOASTER_WARN_LEFT_RIGHT);
}

@@ -101,0 +101,0 @@ };

@@ -36,2 +36,7 @@ import * as React from "react";

/**
* Whether a non-inline tooltip should automatically inherit the dark theme from its parent.
* @default true
*/
inheritDarkTheme?: boolean;
/**
* Whether the tooltip is rendered inline (as a sibling of the target element).

@@ -111,5 +116,5 @@ * If false, it is attached to a new element appended to `<body>`.

static defaultProps: Partial<ITooltipProps>;
displayName: string;
static displayName: string;
render(): JSX.Element;
}
export declare const TooltipFactory: React.Factory<Partial<ITooltipProps>>;

@@ -21,14 +21,12 @@ /*

function Tooltip() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.displayName = "Blueprint.Tooltip";
return _this;
return _super !== null && _super.apply(this, arguments) || this;
}
Tooltip.prototype.render = function () {
var _a = this.props, content = _a.content, children = _a.children, intent = _a.intent, openOnTargetFocus = _a.openOnTargetFocus, tooltipClassName = _a.tooltipClassName;
var _a = this.props, content = _a.content, children = _a.children, intent = _a.intent, isDisabled = _a.isDisabled, isOpen = _a.isOpen, openOnTargetFocus = _a.openOnTargetFocus, tooltipClassName = _a.tooltipClassName;
var classes = classNames(Classes.TOOLTIP, Classes.intentClass(intent), tooltipClassName);
var isEmpty = content == null || (typeof content === "string" && content.trim() === "");
if (isEmpty && !utils_1.isNodeEnv("production")) {
console.warn(errors_1.TOOLTIP_EMPTY_WARNING);
if (isEmpty && !isDisabled && isOpen !== false && !utils_1.isNodeEnv("production")) {
console.warn(errors_1.TOOLTIP_WARN_EMPTY_CONTENT);
}
return (React.createElement(popover_1.Popover, tslib_1.__assign({}, this.props, { arrowSize: 22, autoFocus: false, canEscapeKeyClose: false, isDisabled: this.props.isDisabled || isEmpty, enforceFocus: false, interactionKind: popover_1.PopoverInteractionKind.HOVER_TARGET_ONLY, lazy: true, openOnTargetFocus: openOnTargetFocus, popoverClassName: classes }), children));
return (React.createElement(popover_1.Popover, tslib_1.__assign({}, this.props, { arrowSize: 22, autoFocus: false, canEscapeKeyClose: false, isDisabled: isDisabled || isEmpty, enforceFocus: false, interactionKind: popover_1.PopoverInteractionKind.HOVER_TARGET_ONLY, lazy: true, openOnTargetFocus: openOnTargetFocus, popoverClassName: classes }), children));
};

@@ -48,2 +46,3 @@ return Tooltip;

};
Tooltip.displayName = "Blueprint.Tooltip";
Tooltip = tslib_1.__decorate([

@@ -50,0 +49,0 @@ PureRender

{
"name": "@blueprintjs/core",
"version": "1.14.0",
"version": "1.15.0",
"description": "Core styles & components",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -9,2 +9,3 @@ /*

import * as React from "react";
import { isNodeEnv } from "./utils";

@@ -16,3 +17,4 @@ /**

export abstract class AbstractComponent<P, S> extends React.Component<P, S> {
public displayName: string;
/** Component displayName should be `public static`. This property exists to prevent incorrect usage. */
protected displayName: never;

@@ -24,7 +26,11 @@ // Not bothering to remove entries when their timeouts finish because clearing invalid ID is a no-op

super(props, context);
this.validateProps(this.props);
if (!isNodeEnv("production")) {
this.validateProps(this.props);
}
}
public componentWillReceiveProps(nextProps: P & {children?: React.ReactNode}) {
this.validateProps(nextProps);
if (!isNodeEnv("production")) {
this.validateProps(nextProps);
}
}

@@ -31,0 +37,0 @@

@@ -11,42 +11,44 @@ /*

export function deprecationWarning(oldName: string, newName: string, message: string = "") {
return `${deprec} '${oldName}' prop has been replaced by the '${newName}' prop. ${message}
It will be removed in the next major version of blueprint.`;
}
export const CLAMP_MIN_MAX = `${ns} clamp: max cannot be less than min`;
export const ALERT_CANCEL_PROPS = `${ns} If either cancelButtonText or onCancel are set in <Alert>, both must be set.`;
export const ALERT_WARN_CANCEL_PROPS =
`${ns} <Alert> cancelButtonText and onCancel should be set together.`;
export const DEPRECATION_SHOULD_ATTACH_TO_BODY = deprecationWarning("shouldAttachToBody", "inline");
export const COLLAPSIBLE_LIST_INVALID_CHILD = `${ns} <CollapsibleList> children must be <MenuItem>s`;
export const MENU_CHILDREN_SUBMENU_MUTEX = `${ns} <MenuItem> children and submenu props are mutually exclusive`;
export const CONTEXTMENU_WARN_DECORATOR_NO_METHOD =
`${ns} @ContextMenuTarget-decorated class should implement renderContextMenu.`;
export const HOTKEYS_HOTKEY_CHILDREN = `${ns} <Hotkeys> only accepts <Hotkey> children.`;
export const MENU_WARN_CHILDREN_SUBMENU_MUTEX =
`${ns} <MenuItem> children and submenu props are mutually exclusive, with children taking priority.`;
export const NUMERIC_INPUT_MIN_MAX =
`${ns} <NumericInput> requires min to be strictly less than max if both are defined`;
`${ns} <NumericInput> requires min to be strictly less than max if both are defined.`;
export const NUMERIC_INPUT_MINOR_STEP_SIZE_BOUND =
`${ns} <NumericInput> requires minorStepSize to be strictly less than stepSize`;
`${ns} <NumericInput> requires minorStepSize to be strictly less than stepSize.`;
export const NUMERIC_INPUT_MAJOR_STEP_SIZE_BOUND =
`${ns} <NumericInput> requires majorStepSize to be strictly greater than stepSize`;
`${ns} <NumericInput> requires majorStepSize to be strictly greater than stepSize.`;
export const NUMERIC_INPUT_MINOR_STEP_SIZE_NON_POSITIVE =
`${ns} <NumericInput> requires minorStepSize to be strictly greater than zero`;
`${ns} <NumericInput> requires minorStepSize to be strictly greater than zero.`;
export const NUMERIC_INPUT_MAJOR_STEP_SIZE_NON_POSITIVE =
`${ns} <NumericInput> requires majorStepSize to be strictly greater than zero`;
`${ns} <NumericInput> requires majorStepSize to be strictly greater than zero.`;
export const NUMERIC_INPUT_STEP_SIZE_NON_POSITIVE =
`${ns} <NumericInput> requires stepSize to be strictly greater than zero`;
`${ns} <NumericInput> requires stepSize to be strictly greater than zero.`;
export const NUMERIC_INPUT_STEP_SIZE_NULL =
`${ns} <NumericInput> requires stepSize to be defined`;
`${ns} <NumericInput> requires stepSize to be defined.`;
export const POPOVER_ONE_CHILD = `${ns} <Popover> requires exactly one target element`;
export const POPOVER_UNCONTROLLED_ONINTERACTION = `${ns} <Popover> onInteraction is ignored when uncontrolled`;
export const POPOVER_MODAL_INLINE =
`${ns} <Popover isModal={true}> requires inline={false}.`;
export const POPOVER_MODAL_INTERACTION =
`${ns} <Popover isModal={true}> requires interactionKind={PopoverInteractionKind.CLICK}.`;
export const POPOVER_SMART_POSITIONING_INLINE =
`${ns} <Popover useSmartPositioning={true}> requires inline={false}.`;
export const POPOVER_WARN_MODAL_INLINE = `${ns} <Popover inline={true}> ignores isModal`;
export const POPOVER_WARN_DEPRECATED_CONSTRAINTS =
`${deprec} <Popover> constraints and useSmartPositioning are deprecated. Use tetherOptions directly.`;
export const POPOVER_WARN_INLINE_NO_TETHER =
`${ns} <Popover inline={true}> ignores tetherOptions, constraints, and useSmartPositioning.`;
export const POPOVER_WARN_UNCONTROLLED_ONINTERACTION = `${ns} <Popover> onInteraction is ignored when uncontrolled.`;
export const RADIOGROUP_RADIO_CHILDREN = `${ns} <RadioGroup> only supports <Radio> children`;
export const RADIOGROUP_CHILDREN_OPTIONS_MUTEX =
`${ns} <RadioGroup> children and options props are mutually exclusive.`;
export const RADIOGROUP_WARN_CHILDREN_OPTIONS_MUTEX =
`${ns} <RadioGroup> children and options prop are mutually exclusive, with options taking priority.`;

@@ -57,13 +59,14 @@ export const SLIDER_ZERO_STEP = `${ns} <Slider> stepSize must be greater than zero.`;

export const TABS_FIRST_CHILD = `${ns} First child of <Tabs> component should be a <TabList>`;
export const TABS_MISMATCH = `${ns} Number of <Tab> components should equal number of <TabPanel> components`;
export const TABS_DEPRECATED = `${ns} <Tabs> is deprecated since v1.11.0; consider upgrading to <Tabs2>.`
export const TABS_FIRST_CHILD = `${ns} First child of <Tabs> component must be a <TabList>`;
export const TABS_MISMATCH = `${ns} Number of <Tab> components must equal number of <TabPanel> components`;
export const TABS_WARN_DEPRECATED = `${deprec} <Tabs> is deprecated since v1.11.0; consider upgrading to <Tabs2>.`
+ " https://blueprintjs.com/#components.tabs.js";
export const TOASTER_INLINE_WARNING = `${ns} Toaster.create() ignores inline prop as it always creates a new element`;
export const TOASTER_WARN_INLINE = `${ns} Toaster.create() ignores inline prop as it always creates a new element.`;
export const TOASTER_WARN_LEFT_RIGHT = `${ns} Toaster does not support LEFT or RIGHT positions.`;
export const TOOLTIP_EMPTY_WARNING = `${ns} Disabling empty <Tooltip>`;
export const TOOLTIP_WARN_EMPTY_CONTENT = `${ns} Disabling <Tooltip> with empty content...`;
export const WARNING_DIALOG_NO_HEADER_ICON = `${ns} Warning: Dialog iconName prop is ignored if title prop is omitted`;
export const WARNING_DIALOG_NO_HEADER_CLOSE_BUTTON =
`${ns} Warning: Dialog isCloseButtonShown prop is ignored if title prop is omitted`;
export const DIALOG_WARN_NO_HEADER_ICON = `${ns} <Dialog> iconName is ignored if title is omitted.`;
export const DIALOG_WARN_NO_HEADER_CLOSE_BUTTON =
`${ns} <Dialog> isCloseButtonShown prop is ignored if title is omitted.`;

@@ -20,7 +20,2 @@ /*

const DEFAULT_CONSTRAINTS = {
attachment: "together",
to: "scrollParent",
};
// per https://github.com/HubSpot/tether/pull/204, Tether now exposes a `bodyElement` option that,

@@ -44,12 +39,9 @@ // when present, gets the tethered element injected into *it* instead of into the document body.

/** @internal */
export function createTetherOptions(element: Element,
target: Node,
position: Position,
useSmartPositioning: boolean,
tetherOptions: Partial<Tether.ITetherOptions> = {}) {
if (tetherOptions.constraints == null && useSmartPositioning) {
tetherOptions.constraints = [DEFAULT_CONSTRAINTS];
}
const options: Tether.ITetherOptions = {
export function createTetherOptions(
element: Element,
target: Node,
position: Position,
tetherOptions: Partial<Tether.ITetherOptions> = {},
): Tether.ITetherOptions {
return {
...tetherOptions,

@@ -63,3 +55,2 @@ attachment: getPopoverAttachment(position),

};
return options;
}

@@ -66,0 +57,0 @@

@@ -8,2 +8,4 @@ /*

import { CLAMP_MIN_MAX } from "./errors";
// only accessible within this file, so use `Utils.isNodeEnv` from the outside.

@@ -64,3 +66,3 @@ declare var process: { env: any };

if (max < min) {
throw new Error("clamp: max cannot be less than min");
throw new Error(CLAMP_MIN_MAX);
}

@@ -67,0 +69,0 @@ return Math.min(Math.max(val, min), max);

@@ -86,2 +86,5 @@ @# Typography

I18n in Blueprint is straightforward. React components expose props for customizing any strings;
use the library of your choice for managing internationalized strings.
@### Right-to-left text

@@ -88,0 +91,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc