2 lines
3.5 KiB
JavaScript
2 lines
3.5 KiB
JavaScript
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/utils");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(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 n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t){return l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},l(e,t)}function a(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&&l(e,t)}function c(e){return c="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},c(e)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e,t){if(t&&("object"===c(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return u(e)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(){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 m=function(n){a(b,e.Component);var l,c,u,m,d,v=(l=b,c=y(),function(){var e,t=p(l);if(c){var n=p(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return s(this,e)});function b(){return o(this,b),v.apply(this,arguments)}return u=b,(m=[{key:"getKey",value:function(e,n){return this.props.dataKey?t.ObjectUtils.resolveFieldData(e,this.props.dataKey):"pr_id__".concat(n)}},{key:"renderEvents",value:function(){var e=this;return this.props.value&&this.props.value.map((function(n,o){var i=t.ObjectUtils.getJSXElement(e.props.opposite,n,o),l=t.ObjectUtils.getJSXElement(e.props.marker,n,o)||r.default.createElement("div",{className:"p-timeline-event-marker"}),a=o!==e.props.value.length-1&&r.default.createElement("div",{className:"p-timeline-event-connector"}),c=t.ObjectUtils.getJSXElement(e.props.content,n,o);return r.default.createElement("div",{key:e.getKey(n,o),className:"p-timeline-event"},r.default.createElement("div",{className:"p-timeline-event-opposite"},i),r.default.createElement("div",{className:"p-timeline-event-separator"},l,a),r.default.createElement("div",{className:"p-timeline-event-content"},c))}))}},{key:"render",value:function(){var e,n=t.classNames("p-timeline p-component",(f(e={},"p-timeline-".concat(this.props.align),!0),f(e,"p-timeline-".concat(this.props.layout),!0),e),this.props.className),o=this.renderEvents();return r.default.createElement("div",{id:this.props.id,className:n,style:this.props.style},o)}}])&&i(u.prototype,m),d&&i(u,d),Object.defineProperty(u,"prototype",{writable:!1}),b}();f(m,"defaultProps",{id:null,value:null,align:"left",layout:"vertical",dataKey:null,className:null,style:null,opposite:null,marker:null,content:null}),exports.Timeline=m;
|