UNPKG

@arche-mc2/arche-controls

Version:

We know that there are a ton of react UI library projects to choose from. Our hope with this one is to provide the next generation of react components that you can use to bootstrap your next project, or as a reference for building a UIKit. Read on to get

77 lines 5.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var React = require("react"); var classnames = require("classnames"); var Box_1 = require("../../Containers/Box"); var Grid_1 = require("../../Containers/Grid"); var typestyle_1 = require("typestyle"); var styles_1 = require("./styles"); var withTheme_1 = require("../../../Common/theming/withTheme"); var theming_1 = require("../../../Common/theming"); var Box_2 = require("../../Containers/Box"); var utils_1 = require("../../../Common/theming/utils"); var colorMap_1 = require("../../../Common/theming/colorMap"); var SvgIcon = function (props) { var children = props.children, className = props.className, loaderSize = props.loaderSize, theme = props.theme, others = tslib_1.__rest(props, ["children", "className", "loaderSize", "theme"]); return React.createElement("svg", tslib_1.__assign({ className: classnames(typestyle_1.style(styles_1.svgStyle(props)), className) }, others), children); }; var LoadingIndicator = (function (_super) { tslib_1.__extends(LoadingIndicator, _super); function LoadingIndicator() { return _super !== null && _super.apply(this, arguments) || this; } LoadingIndicator.prototype.render = function () { var _displayMode = this.props.displayMode || "inline"; var _title = this.props.title || "Veuillez patienter..."; var _a = this.props, theme = _a.theme, isLoading = _a.isLoading; if (!isLoading && _displayMode != "zone") { return null; } var _b = styles_1.getStyleByMode(this.props, _displayMode), container = _b.container, overlay = _b.overlay, loadingIndicatorStyle = _b.loadingIndicatorStyle; if (_displayMode === "zone") { return (React.createElement("div", { style: container, className: classnames("up-loading-indicator", this.props.className) }, this.props.children, React.createElement("div", { style: overlay }, React.createElement("div", { className: typestyle_1.style(loadingIndicatorStyle) }, React.createElement(Box_1.default, { boxSize: "auto", pad: "none", margin: "none", flexDirection: "column", alignItems: "center", justifyContent: "center", className: classnames("up-loading-indicator", this.props.className) }, React.createElement(SvgIcon, { viewBox: "0 0 64 64", theme: theme, loaderSize: this.props.loaderSize }), this.props.message && React.createElement("p", { style: { color: theme.colorMap.primary } }, this.props.message)))))); } else if (_displayMode === "inline") { return (React.createElement(Box_1.default, { boxSize: "auto", pad: "none", margin: 'none', alignItems: "center", justifyContent: "center", className: classnames('up-loading-indicator', this.props.className) }, React.createElement(SvgIcon, { viewBox: "0 0 " + (this.props.width || 48) + " " + (this.props.width || 48), loaderSize: this.props.loaderSize, theme: theme }), this.props.message && React.createElement("p", { style: { color: theme.colorMap.grey1 } }, this.props.message))); } else { return React.createElement("aside", { className: classnames('up-loading-screen', this.props.className), style: container }, React.createElement(Box_2.default, { boxSize: 'full', justifyContent: 'center', alignItems: 'center' }, React.createElement("div", { style: loadingIndicatorStyle }, React.createElement(Grid_1.UpGrid, null, React.createElement(Grid_1.UpRow, null, React.createElement(Grid_1.UpCol, { span: 6 }, React.createElement(SvgIcon, { theme: theme, loaderSize: this.props.loaderSize, viewBox: "0 0 48 48" })), React.createElement(Grid_1.UpCol, { span: 18 }, React.createElement(Grid_1.UpGrid, null, React.createElement(Grid_1.UpRow, null, React.createElement(Grid_1.UpCol, { span: 24 }, React.createElement("hgroup", { style: { "textShadow": "0px 0px 0.1ex" } }, React.createElement("h3", { style: { "fontSize": utils_1.toRem(22), 'margin': '0px', color: theme.colorMap.primary } }, React.createElement("span", null, _title))))), React.createElement(Grid_1.UpRow, null, React.createElement(Grid_1.UpCol, { span: 24 }, React.createElement("p", { className: "loading-status text-info", style: { "textAlign": "left", color: colorMap_1.colors.pink2 } }, this.props.message)))))))))); } }; LoadingIndicator.defaultProps = { theme: theming_1.default, width: 84 }; return LoadingIndicator; }(React.Component)); exports.LoadingIndicator = LoadingIndicator; ; exports.default = withTheme_1.default(LoadingIndicator); //# sourceMappingURL=UpLoadingIndicator.js.map