2 lines
4.3 KiB
JavaScript
2 lines
4.3 KiB
JavaScript
this.primereact=this.primereact||{},this.primereact.breadcrumb=function(e,t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(t);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(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 i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function u(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&&i(e,t)}function s(e){return s="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},s(e)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){if(t&&("object"===s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},m(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 d,b,y,h=function(e){u(b,e);var t,n,i,s,c,d=(t=b,n=f(),function(){var e,r=m(t);if(n){var o=m(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return p(this,e)});function b(){return a(this,b),d.apply(this,arguments)}return i=b,(s=[{key:"itemClick",value:function(e,t){t.disabled?e.preventDefault():(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}))}},{key:"renderHome",value:function(){var e=this;if(this.props.home){var t=r.classNames("p-breadcrumb-home",{"p-disabled":this.props.home.disabled},this.props.home.className),n=r.classNames("p-menuitem-icon",this.props.home.icon);return o.default.createElement("li",{className:t,style:this.props.home.style},o.default.createElement("a",{href:this.props.home.url||"#",className:"p-menuitem-link","aria-disabled":this.props.home.disabled,target:this.props.home.target,onClick:function(t){return e.itemClick(t,e.props.home)}},o.default.createElement("span",{className:n})))}return null}},{key:"renderSeparator",value:function(){return o.default.createElement("li",{className:"p-breadcrumb-chevron pi pi-chevron-right"})}},{key:"renderMenuitem",value:function(e){var t=this,n=r.classNames(e.className,{"p-disabled":e.disabled}),a=o.default.createElement("a",{href:e.url||"#",className:"p-menuitem-link",target:e.target,onClick:function(r){return t.itemClick(r,e)},"aria-disabled":e.disabled},e.label&&o.default.createElement("span",{className:"p-menuitem-text"},e.label));return e.template&&(a=r.ObjectUtils.getJSXElement(e.template,e,{onClick:function(r){return t.itemClick(r,e)},className:"p-menuitem-link",labelClassName:"p-menuitem-text",element:a,props:this.props})),o.default.createElement("li",{className:n,style:e.style},a)}},{key:"renderMenuitems",value:function(){var e=this;return this.props.model?this.props.model.map((function(t,r){var n=e.renderMenuitem(t),a=r===e.props.model.length-1?null:e.renderSeparator();return o.default.createElement(o.default.Fragment,{key:t.label+"_"+r},n,a)})):null}},{key:"render",value:function(){var e=r.classNames("p-breadcrumb p-component",this.props.className),t=this.renderHome(),n=this.renderMenuitems(),a=this.renderSeparator();return o.default.createElement("nav",{id:this.props.id,className:e,style:this.props.style,"aria-label":"Breadcrumb"},o.default.createElement("ul",null,t,a,n))}}])&&l(i.prototype,s),c&&l(i,c),Object.defineProperty(i,"prototype",{writable:!1}),b}(t.Component);return y={id:null,model:null,home:null,style:null,className:null},(b="defaultProps")in(d=h)?Object.defineProperty(d,b,{value:y,enumerable:!0,configurable:!0,writable:!0}):d[b]=y,e.BreadCrumb=h,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.utils);
|