2 lines
3.4 KiB
JavaScript
2 lines
3.4 KiB
JavaScript
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/utils");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=r(e);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t){if(t&&("object"===l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return p(e)}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function f(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var y,m,b,h=function(r){c(h,e.Component);var s,l,p,y,m,b=(s=h,l=f(),function(){var e,t=a(s);if(l){var r=a(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return u(this,e)});function h(){return o(this,h),b.apply(this,arguments)}return p=h,(y=[{key:"getContent",value:function(){if(this.props.content)return t.ObjectUtils.getJSXElement(this.props.content,this.props);var e=t.ObjectUtils.getJSXElement(this.props.text,this.props),r=t.classNames("p-inline-message-icon pi",{"pi-info-circle":"info"===this.props.severity,"pi-exclamation-triangle":"warn"===this.props.severity,"pi-times-circle":"error"===this.props.severity,"pi-check":"success"===this.props.severity});return n.default.createElement(n.default.Fragment,null,n.default.createElement("span",{className:r}),n.default.createElement("span",{className:"p-inline-message-text"},e))}},{key:"render",value:function(){var e=t.classNames("p-inline-message p-component",{"p-inline-message-info":"info"===this.props.severity,"p-inline-message-warn":"warn"===this.props.severity,"p-inline-message-error":"error"===this.props.severity,"p-inline-message-success":"success"===this.props.severity,"p-inline-message-icon-only":!this.props.text},this.props.className),r=this.getContent();return n.default.createElement("div",{id:this.props.id,"aria-live":"polite",className:e,style:this.props.style,role:"alert"},r)}}])&&i(p.prototype,y),m&&i(p,m),Object.defineProperty(p,"prototype",{writable:!1}),h}();b={id:null,className:null,style:null,text:null,severity:"info",content:null},(m="defaultProps")in(y=h)?Object.defineProperty(y,m,{value:b,enumerable:!0,configurable:!0,writable:!0}):y[m]=b,exports.Message=h;
|