tntd
Version:
tntd是基于 TNT Design 设计体系的 React UI 组件库,主要用于研发企业级中后台产品。
105 lines (104 loc) • 5.25 kB
JavaScript
;
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
Object.defineProperty(exports, "__esModule", {
value: true
});
var _exportNames = {};
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _notification = _interopRequireWildcard(require("antd/es/notification"));
Object.keys(_notification).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _notification[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _notification[key];
}
});
});
var _icon = _interopRequireDefault(require("../icon"));
var _classnames = _interopRequireDefault(require("classnames"));
var _assets = require("./assets");
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
var prefixCls = 'ant-notification-notice';
var tntPrefixCls = 'tnt-notification-notice';
var api = Object.assign(Object.assign({}, _notification["default"]), {
successInfo: function successInfo(args) {
return _notification["default"].open(Object.assign(Object.assign({}, args), {
icon: _react["default"].createElement(_icon["default"], {
className: "img-icon",
component: function component() {
return _react["default"].createElement(_assets.SvgSuccessTip, {
fill: "currentColor",
width: 46,
height: 46
});
}
}),
type: 'success',
className: (0, _classnames["default"])(args.className, tntPrefixCls)
}));
},
errorInfo: function errorInfo(args) {
return _notification["default"].open(Object.assign(Object.assign({}, args), {
icon: _react["default"].createElement(_icon["default"], {
className: "img-icon",
component: function component() {
return _react["default"].createElement(_assets.SvgErrorTip, {
fill: "currentColor",
width: 46,
height: 46
});
}
}),
type: 'success',
className: (0, _classnames["default"])(args.className, tntPrefixCls)
}));
},
success: function success(args) {
return _notification["default"].success(Object.assign(Object.assign({}, args), {
icon: !args.icon && _react["default"].createElement(_icon["default"], {
theme: "filled",
className: "".concat(prefixCls, "-icon ").concat(prefixCls, "-icon-success ").concat(tntPrefixCls, "-icon"),
type: "check-circle-o"
}),
className: (0, _classnames["default"])(args.className, tntPrefixCls)
}));
},
error: function error(args) {
return _notification["default"].error(Object.assign(Object.assign({}, args), {
icon: !args.icon && _react["default"].createElement(_icon["default"], {
theme: "filled",
className: "".concat(prefixCls, "-icon ").concat(prefixCls, "-icon-error ").concat(tntPrefixCls, "-icon"),
type: "close-circle-o"
}),
className: (0, _classnames["default"])(args.className, tntPrefixCls)
}));
},
info: function info(args) {
return _notification["default"].info(Object.assign(Object.assign({}, args), {
icon: !args.icon && _react["default"].createElement(_icon["default"], {
theme: "filled",
className: "".concat(prefixCls, "-icon ").concat(prefixCls, "-icon-info ").concat(tntPrefixCls, "-icon"),
type: "info-circle-o"
}),
className: (0, _classnames["default"])(args.className, tntPrefixCls)
}));
},
warning: function warning(args) {
return _notification["default"].warning(Object.assign(Object.assign({}, args), {
icon: !args.icon && _react["default"].createElement(_icon["default"], {
theme: "filled",
className: "".concat(prefixCls, "-icon ").concat(prefixCls, "-icon-warning ").concat(tntPrefixCls, "-icon"),
type: "exclamation-circle-o"
}),
className: (0, _classnames["default"])(args.className, tntPrefixCls)
}));
}
});
api.warn = api.warning;
var _default = exports["default"] = api;