diff --git a/dist/react-dashboard.min.js b/dist/react-dashboard.min.js index 071c060e..b04f2a19 100644 --- a/dist/react-dashboard.min.js +++ b/dist/react-dashboard.min.js @@ -1,4 +1,4 @@ -!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"),require("lodash"),require("d3"),require("react-router"),require("classnames"),require("react-nvd3"),require("csv-es6-data-backend"),require("datatables.net-responsive-bs"),require("dkan-es6-data-backend"),require("fixed-data-table-2"),require("flux"),require("jquery"),require("react-dom"),require("react-responsive-accordion"),require("react-select"),require("topojson"));else if("function"==typeof define&&define.amd)define(["react","lodash","d3","react-router","classnames","react-nvd3","csv-es6-data-backend","datatables.net-responsive-bs","dkan-es6-data-backend","fixed-data-table-2","flux","jquery","react-dom","react-responsive-accordion","react-select","topojson"],t);else{var r="object"==typeof exports?t(require("react"),require("lodash"),require("d3"),require("react-router"),require("classnames"),require("react-nvd3"),require("csv-es6-data-backend"),require("datatables.net-responsive-bs"),require("dkan-es6-data-backend"),require("fixed-data-table-2"),require("flux"),require("jquery"),require("react-dom"),require("react-responsive-accordion"),require("react-select"),require("topojson")):t(e.react,e.lodash,e.d3,e["react-router"],e.classnames,e["react-nvd3"],e["csv-es6-data-backend"],e["datatables.net-responsive-bs"],e["dkan-es6-data-backend"],e["fixed-data-table-2"],e.flux,e.jquery,e["react-dom"],e["react-responsive-accordion"],e["react-select"],e.topojson);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,function(e,t,r,n,a,o,i,s,u,l,c,f,p,d,h,_){return function(e){function t(n){if(r[n])return r[n].exports;var a=r[n]={exports:{},id:n,loaded:!1};return e[n].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var r={};return t.m=e,t.c=r,t.p="/static/",t(0)}([function(e,t,r){e.exports=r(9)},function(e,t){e.exports=require("react")},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r=0?t:(0,o.get)(e.root,t)}}]),e}(),u=s;t.default=u;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"reactEls","/Users/alex/react-dash/src/utils/Registry.js"),__REACT_HOT_LOADER__.register(s,"Registry","/Users/alex/react-dash/src/utils/Registry.js"),__REACT_HOT_LOADER__.register(u,"default","/Users/alex/react-dash/src/utils/Registry.js"))})()},function(e,t){e.exports=require("lodash")},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t0){var t=y.default.handle(this.props.stateHandlers,this.props.data,this.state.dashboardData);e=s(e,t)}return e}},{key:"getCardVariables",value:function(){var e=this,t={};return v.forEach(function(r){t[r]=e.state[r]||e.props[r]}),t}},{key:"addResizeListener",value:function(){var e=this;this._resizeHandler=function(t){var r=(0,c.findDOMNode)(e).getBoundingClientRect().width;e.setState({componentWidth:r}),e.onResize(t)},window.addEventListener("resize",this._resizeHandler)}},{key:"onResize",value:function(){}},{key:"onAction",value:function(){}}]),t}(l.Component),O=g;t.default=O;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(v,"CARD_VARS","/Users/alex/react-dash/src/components/BaseComponent.js"),__REACT_HOT_LOADER__.register(g,"BaseComponent","/Users/alex/react-dash/src/components/BaseComponent.js"),__REACT_HOT_LOADER__.register(O,"default","/Users/alex/react-dash/src/components/BaseComponent.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:5,t="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",n=0;n=0)&&e.replace("fid","")}Object.defineProperty(t,"__esModule",{value:!0});var f=Object.assign||function(e){for(var t=1;t=0&&(e=!0)}),e}},{key:"getData",value:function(){var e=this.props.data;return e}},{key:"getOptions",value:function(e){var t=this.getData();return this.props.options?this.props.options:t&&t[0]?this.props.data[0]:[]}}]),t}(d.default)),_=h;t.default=_,f.default.set("BaseFilter",h);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(h,"BaseFilter","/Users/alex/react-dash/src/components/BaseFilter.js"),__REACT_HOT_LOADER__.register(_,"default","/Users/alex/react-dash/src/components/BaseFilter.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),o=n(a),i=r(57),s=n(i),u=s.default,l=u;t.default=l,o.default.set("ReactSelect",s.default);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(u,"ReactSelect","/Users/alex/react-dash/src/components/ReactSelect.js"),__REACT_HOT_LOADER__.register(l,"default","/Users/alex/react-dash/src/components/ReactSelect.js"))})()},function(e,t){e.exports=require("react-router")},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:[],r=e,n=this.state.appliedFilters||{},a=d.DataHandler.handle.call(this,r,t,this.state.data,{e:"foo"},n);return a}},{key:"getUrlFilters",value:function(){var e=this,t=this.props.location.query,r={};return Object.keys(t).forEach(function(n){var a={};a.field=n,a.value=t[n].split(","),a.vals=a.value.map(function(e){return isNaN(e)||parseInt(e),e}),r=e.getUpdatedAppliedFilters(a,r)}),r}},{key:"getDashboardData",value:function(){console.log("Warning. getDashboardData should be defined in your application which extends this dashboard component. getDashboardData should return an object with dataKeys. See @@LINK")}},{key:"getChildData",value:function(e){var t=[];return e.dataHandlers?t=this._applyDataHandlers(e.dataHandlers,e.data):e.data&&e.data.length>0&&(t=e.data),t}},{key:"getFilters",value:function(e,t){return Object.keys(t).map(function(r){var n=t[r];if(n&&n.willFilter&&n.willFilter.length>0){var a=n.willFilter.indexOf(e);if(a>=0)return t[r]}})}},{key:"getFilterByField",value:function(e){var t=void 0;return this.props.regions.forEach(function(r){return r.children?r.children.forEach(function(r){r.field===e&&(t=r)}):void(r.elements&&Object.keys(r.elements).forEach(function(n){r.elements[n].forEach(function(r){r.field===e&&(t=r)})}))}),t}},{key:"onAction",value:function(e){switch(e.actionType){case"AUTOCOMPLETE_CHANGE":var t=s({},this.state.appliedFilters),r=this.getUpdatedAppliedFilters(e,t),n=(0,_.appliedFiltersToQueryString)(r),a=this.props.basePath||"";this.props.doFilterRouting!==!1&&p.browserHistory.push(a+"?"+n),this.setState({appliedFilters:r,isFetching:!0}),this.getDashboardData(r);break;case"MULTICHECKBOX_CHANGE":break;default:console.warn("Actions should define an actionType. See docs @@LINK")}}},{key:"getUpdatedAppliedFilters",value:function(e,t){var r=e.field,n=this.getFilterByField(r),a=s(e,n);return(0,h.isArray)(a.value)&&a.value.length>0?(a.vals=a.value.map(function(e){return isNaN(e)?isNaN(e.value)?e.value:parseInt(e.value):parseInt(e)}),t[r]=a):a.value&&a.value.value?(isNaN(a.value.value)||(a.value.value=parseInt(a.value.value)),a.value=[a.value],t[r]=a):a.value&&"string"==typeof a.value||"number"==typeof a.value?(a.value=[a.value],t[r]=a):delete t[r],t}},{key:"updateProps",value:function(e){var t=f.default.isValidElement(e)?e.props:e,r=[];return this.props.doFilterRouting&&(r=(0,h.pick)(this.props,["history","location","params","route","routeParams","routes"])),t.data=this.getChildData(e)||[],t.globalData=s({},this.state.data||{}),t.appliedFilters=s({},this.state.appliedFilters||{}),t.vars=s({},this.props.vars||{}),t.routeParams=r,t}},{key:"getRegion",value:function(e){var t=this;return f.default.createElement("div",{key:e.id,id:e.id,className:e.className},e.children.map(function(e,r){var n=t.updateProps(e);e.isFetching=t.state.isFetching;var a=f.default.isValidElement(e)?e:f.default.createElement(d.Registry.get(e.type),n);return a}))}},{key:"getAccordionRegion",value:function(e){var t=this;return f.default.createElement("div",{id:e.id,className:e.className,key:e.id},f.default.createElement(m.default,{key:e.id,closeable:!0},e.children.map(function(e,r){var n=t.updateProps(e),a=f.default.isValidElement(e)?e:f.default.createElement(d.Registry.get(e.type),n);return f.default.createElement("div",{"data-trigger":e.dataTrigger,key:"wrap_"+r},a)})))}},{key:"getRegions",value:function(){var e=this,t=void 0;return t=this.props.regions?this.props.regions.map(function(t,r){if(t.multi){var n=e.getChildData(t);t.key=r,t.children=t.elements[n]}return t.accordion?e.getAccordionRegion(t):e.getRegion(t)}):this.props.children}},{key:"render",value:function(){var e=void 0,t=["container-fluid"],r=(0,v.default)(this.props.dashWrapperClass,t);return this.props.title&&(e=f.default.createElement("h1",{className:"dashboard-title"}," + ",this.props.title," + ")),f.default.createElement("div",{className:r,key:"dashboard-container"},f.default.createElement("link",{rel:"stylesheet",type:"text/css",href:this.props.faPath}),e,this.getRegions())}}]),t}(d.BaseComponent),O=g;t.default=O;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(g,"Dashboard","/Users/alex/react-dash/src/components/Dashboard.js"),__REACT_HOT_LOADER__.register(O,"default","/Users/alex/react-dash/src/components/Dashboard.js"))})()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(53),a=new n.Dispatcher,o=a;t.default=o;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(a,"EventDispatcher","/Users/alex/react-dash/src/dispatcher/EventDispatcher.js"),__REACT_HOT_LOADER__.register(o,"default","/Users/alex/react-dash/src/dispatcher/EventDispatcher.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(r,n){var a=t.size||e.records.length,o=t.from||0,i=e.records;i=e._applyFilters(i,t),i=e._applyFreeTextQuery(i,t);var s={total:i.length,hits:i.slice(o,o+a)};r(s)})}},{key:"_applyFreeTextQuery",value:function(e,t){var r=this;if(t.q){var n=t.q.split(" "),a=n.map(function(e){return new RegExp(e.toLowerCase())});e=e.filter(function(e){var t=!0;return a.forEach(function(n){var a=!1;r.fields.forEach(function(t){var r=e[t.id];r=null!==r&&void 0!==r?r.toString():"",a=a||n.test(r.toLowerCase())}),t=t&&a}),t})}return e}},{key:"_applyFilters",value:function(e,t){function r(e){var t=c[e.field].type||"string";return l[t]}function n(e,t){var n=r(t),a=n(e[t.field]),o=n(t.term);return a===o}function a(e,t){var n=r(t),a=n(e[t.field]),o=n(t.terms).split(",");return o.indexOf(a)>=0}function i(e,t){var n=(0,o.isUndefined)(t.from)||null===t.from||""===t.from,a=(0,o.isUndefined)(t.to)||null===t.to||""===t.to,i=r(t),s=i(e[t.field]),u=i(n?"":t.from),l=i(a?"":t.to);return!!(n&&a||""!==s)&&((n||s>=u)&&(a||s<=l))}var s=t.filters||[],u={term:n,terms:a,range:i},l={integer:function(e){return parseFloat(e,10)},float:function(e){return parseFloat(e,10)},number:function(e){return parseFloat(e,10)},string:function(e){return e.toString()},date:function(e){return Date.parse(e)},datetime:function(e){return new Date(e).valueOf()}},c=this.fields.reduce(function(e,t){return e[t.id]=t,e},{});return e.filter(function(e){var t=s.map(function(t){ -return u[t.type](e,t)});return(0,o.every)(t,o.identity)})}}]),e}(),s=i;t.default=s;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"MemoryStore","/Users/alex/react-dash/src/models/MemoryStore.js"),__REACT_HOT_LOADER__.register(s,"default","/Users/alex/react-dash/src/models/MemoryStore.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r1&&void 0!==arguments[1]&&arguments[1];return"string"==typeof e?(0,T.format)(e):(0,E.isFunction)(e)?e:void 0}},{key:"getFormattedSettings",value:function(){var e=this,t=s({},this.props.settings);if(t.color&&!Array.isArray(t.color)){var r=void 0;r=this.props.data.length&&this.props.data[0].values?(0,E.map)((0,E.flatten)((0,E.map)(this.props.data,"values")),t.x):(0,E.uniq)((0,E.map)(this.props.data,t.x)),t.color=(0,E.values)((0,E.pick)(t.color,r))}return Object.keys(t).forEach(function(r){t[r].tickFormat&&(t[r].tickFormat=e.getFormatter(t[r].tickFormat))}),t}},{key:"render",value:function(){var e=s({},this.props),t=s({datum:this.props.data,key:this.state.key},this.getFormattedSettings());return e.header=this.state.header||e.header,e.footer=this.state.footer||e.footer,c.default.createElement(b.default,s({key:"card_"+this.state.key},this.state.cardVariables),c.default.createElement(h.default,t))}}]),t}(y.default),R=j;t.default=R,p.default.set("Chart",j);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(j,"Chart","/Users/alex/react-dash/src/components/Chart.js"),__REACT_HOT_LOADER__.register(R,"default","/Users/alex/react-dash/src/components/Chart.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;rn?(i=Math.max(n-a,1),s=r+o>n?n:r+o):(i=r-o,s=r+o),(0,O.range)(i,s+1)}},{key:"getPageNumbers",value:function(e,t,r){var n=this;if(this.getTotalPages()&&!(this.getTotalPages()<2))return this.getPages(e,t,r).map(function(e){return h.default.createElement("li",{className:e==n.state.currentPage?"active":"",key:"page-"+e},h.default.createElement("a",{onClick:(0,O.partialRight)(n._onPageChange,e).bind(n),href:"#"},e))})}},{key:"getLastPage",value:function(e,t){var r=getTotalPages(e,t);return r[r.length-1]}},{key:"getTotalPages",value:function(e,t){return Math.ceil(t/e)}},{key:"onResize",value:function(){var e=this.table,t=e.offsetWidth,r=e.offsetHeight;this.setState({gridWidth:t,gridHeight:r})}},{key:"_onPageChange",value:function(e,t,r,n){e.preventDefault();var a=this.state.rowsPerPage,o=s({},this.state.queryObj,{size:a,from:n*a-a});this.query(o),this.setState({currentPage:n,queryObj:o})}},{key:"_onFilterChange",value:function(e){var t=this.state.rowsPerPage,r=s({},this.state.queryObj,{size:t,from:this.state.currentPage*t-t,q:e.target.value});this.query(r),this.setState({currentPage:1})}},{key:"_onRowsPerPageChange",value:function(e){var t=s({},this.state.queryObj);t.size=Number(e.target.value),t.from=0,this.query(t),this.setState({rowsPerPage:Number(e.target.value),currentPage:1})}},{key:"render",value:function(){var e=this,t=this.state,r=t.gridWidth,n=(t.gridHeight,this.props.data[0]||[]),a=(0,p.getProp)("settings.table",this.props),o=(0,p.getProp)("settings.columns",this.props),i=(0,p.getProp)("settings.rows",this.props),u=Object.keys(n[0]||{}),c=this.getTotalPages(this.state.rowsPerPage,this.state.total),f=u.map(function(t,r){var a=(0,p.getProp)("columns."+t,e.props.overrides);return h.default.createElement(l.Column,s({header:h.default.createElement(l.Cell,null,t),key:t+r,columnKey:t,flexGrow:1,cell:function(r){var o=(0,p.getProp)("rows."+r.rowIndex,e.props.overrides),u=(0,p.getProp)("cells."+t+"_"+r.rowIndex,e.props.overrides);return h.default.createElement(l.Cell,s({},r,a,i,o,u),n[r.rowIndex][r.columnKey])}},o,a))}),d="",_="";return this.props.hideFilterHeader||(d=h.default.createElement("div",{className:"col-md-10"},h.default.createElement("div",{className:"form-group"},h.default.createElement("input",{onChange:this._onFilterChange.bind(this),placeholder:"Filter",className:"form-control"})))),this.props.hideControls||(_=h.default.createElement("div",{className:"col-md-2"},h.default.createElement("div",{onChange:this._onRowsPerPageChange.bind(this),className:"form-group"},h.default.createElement("select",{className:"form-control"},h.default.createElement("option",{value:"10"},"10"),h.default.createElement("option",{value:"25"},"25"),h.default.createElement("option",{value:"50"},"50"),h.default.createElement("option",{value:"100"},"100"),h.default.createElement("option",{value:"500"},"500"))))),h.default.createElement(b.default,s({key:"card_"+this.state.key},this.state.cardVariables),h.default.createElement("div",{ref:function(t){return e.table=t},className:"table-wrapper"},h.default.createElement("div",{className:"row"},d,_),h.default.createElement(g.default,{isFetching:this.props.isFetching||!n.length},h.default.createElement("div",{className:"table-container"},h.default.createElement(l.Table,s({rowsCount:n.length},a,{width:r,rowHeightGetter:this.rowHeightGetter}),f)),h.default.createElement("nav",null,h.default.createElement("ul",{className:"pagination"},h.default.createElement("li",{className:1===this.state.currentPage?"hide":""},h.default.createElement("a",{onClick:(0,O.partialRight)(this._onPageChange,1).bind(this),href:"#","aria-label":"Previous"},h.default.createElement("span",{"aria-hidden":"true"},"«"))),h.default.createElement("li",{className:1===this.state.currentPage?"hide":""},h.default.createElement("a",{onClick:(0,O.partialRight)(this._onPageChange,this.state.currentPage-1).bind(this),href:"#","aria-label":"Previous"},h.default.createElement("span",{"aria-hidden":"true"},"«"))),this.getPageNumbers(this.state.rowsPerPage,this.state.total,this.state.currentPage),h.default.createElement("li",{className:c&&this.state.currentPage!==c?"":"hide"},h.default.createElement("a",{onClick:(0,O.partialRight)(this._onPageChange,this.state.currentPage+1).bind(this),href:"#","aria-label":"Next"},h.default.createElement("span",{"aria-hidden":"true"},"»"))),h.default.createElement("li",{className:c&&this.state.currentPage!==c?"":"hide"},h.default.createElement("a",{onClick:(0,O.partialRight)(this._onPageChange,c).bind(this),href:"#","aria-label":"Next"},h.default.createElement("span",{"aria-hidden":"true"},"»"))))))))}}]),t}(y.default);E.defaultProps={rowsPerPage:10,queryObj:{size:10,from:0}};var T=E;t.default=T,f.default.set("DataTable",E);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(E,"DataTable","/Users/alex/react-dash/src/components/DataTable.js"),__REACT_HOT_LOADER__.register(T,"default","/Users/alex/react-dash/src/components/DataTable.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var 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},u=function(){function e(e,t){for(var r=0;re.from&&n<=e.to})}},{key:"trackStatus",value:function(){var e=Date.parse(this.props.startDate),t=Date.parse(this.props.endDate),r=Number(this.props.startNumber),n=Number(this.props.endNumber),a=this.getTracker(e,t,r,n),o=a(Date.now()),i=o-this.getMetric(this.state.data),s={increase:i<=0,decrease:i>=0,maintain_above:i<=0,maintain_below:i>=0,maintain:!0,mesure:!0};return this.getTolerance(i,s[this.props.action])}},{key:"getTracker",value:function(e,t,r,n){return function(a){var o=(n-r)/(t-e),i=o*(a-e);return i}}},{key:"formatActionName",value:function(e){return(0,v.capitalize)(this.props.action.replace("_"," "))}},{key:"getCaption",value:function(){var e={action:this.formatActionName(this.props.action),caption:this.props.caption,startNumber:(0,j.formatNumber)(this.props.startNumber,this.state.numberFormat),endNumber:(0,j.formatNumber)(this.props.endNumber,this.state.numberFormat),startDate:(0,j.formatDate)(new Date(this.props.startDate),this.state.dateFormat),endDate:(0,j.formatDate)(new Date(this.props.endDate),this.state.dateFormat)},t=(0,v.template)(this.props.captionTemplates[this.props.action]);return t(e)}},{key:"render",value:function(){var e=s({},(0,v.head)(this.trackStatus())),t={background:this.props.background},r=void 0,n=void 0;if(t=s({},t,this.props.style),this.props.spline){var a=s({},this.props.spline);r=c.default.createElement(O.default,s({type:"sparklinePlus",datum:this.state.data,showLastValue:!1,color:["#333333"]},a))}return this.state.showEndNumber&&(n=c.default.createElement("span",{className:"card-goal-end-number"}," ",this.props.divider," ",(0,j.formatNumber)(this.props.endNumber,this.state.numberFormat))),c.default.createElement(y.default,this.state.cardVariables,c.default.createElement(b.default,{isFetching:this.props.isFetching},c.default.createElement("div",{className:"goal",style:t},c.default.createElement("div",{className:"row"},c.default.createElement("div",{className:"col-md-4"},c.default.createElement("div",{className:"card-goal-icon"},c.default.createElement("span",{className:(0,T.default)("glyphicon",this.props.icon)}))),c.default.createElement("div",{className:"col-md-8"},c.default.createElement("div",{className:"card-goal-caption"},this.getCaption()))),c.default.createElement("div",{className:"row"},c.default.createElement("div",{className:"col-md-4"},c.default.createElement("div",{className:"card-goal-progress"},c.default.createElement("span",{className:"card-goal-metric"},(0,j.formatNumber)(this.getMetric(this.state.data),this.state.numberFormat)),n)),c.default.createElement("div",{className:"col-md-8"},c.default.createElement("div",{className:"card-goal-status"},c.default.createElement("a",{style:{color:e.color},href:this.props.link},e.label)),c.default.createElement("div",{className:"card-goal-end-date"},(0,j.formatDate)(new Date(this.props.endDate),this.state.dateFormat)))),c.default.createElement("div",{className:"row"},c.default.createElement("div",{className:"col-md-12"},c.default.createElement("div",{className:"spline"},r))))))}}]),t}(h.default);w.defaultProps={captionTemplates:{increase:"${action} ${caption} ${endNumber} by ${endDate}",decrease:"${action} ${caption} ${endNumber} by ${endDate}",maintain:"${action} at ${endNumber} ${caption} by ${endDate}",maintain_above:"${action} ${endNumber} ${caption} by ${endDate}",maintain_below:"${action} ${endNumber} ${caption} by ${endDate}",mesure:"${caption}"},divider:" / ",style:{color:"black",background:"white"}};var C=w;t.default=C,p.default.set("Goal",w);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(w,"Goal","/Users/alex/react-dash/src/components/Goal.js"),__REACT_HOT_LOADER__.register(C,"default","/Users/alex/react-dash/src/components/Goal.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r0?this.props.data[0]:this.props.data&&!(0,y.isArray)(this.props.data)?this.props.data:this.props.content?this.props.content:""}},{key:"render",value:function(){return l.default.createElement(_.default,this.state.cardVariables,l.default.createElement("div",{dangerouslySetInnerHTML:{__html:this.getContent()}}))}}]),t}(d.default),b=m;t.default=b,f.default.set("Markup",m);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(m,"Markup","/Users/alex/react-dash/src/components/Markup.js"),__REACT_HOT_LOADER__.register(b,"default","/Users/alex/react-dash/src/components/Markup.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:[];return d.DataHandler.handle.call(this,e,r,this.props.globalData,{},t)}},{key:"getChildren",value:function(){var e=this,t=void 0;return this.props.children&&(t=this.props.children.map(function(t,r){var n=s(t,{globalData:e.props.globalData,appliedFilters:e.props.appliedFilters});return t.dataHandlers?n.data=e._applyDataHandlers(t.dataHandlers,t.appliedFilters,t.data):t.data&&t.data.length>0&&(n.data=t.data),n.key=r,c.default.createElement(p.default.get(t.type),n)})),t}},{key:"render",value:function(){var e=this.getChildren();return c.default.createElement("div",{className:this.props.className},e)}}]),t}(l.Component)),y=_;t.default=y,p.default.set("Region",_);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(_,"Region","/Users/alex/react-dash/src/components/Region.js"),__REACT_HOT_LOADER__.register(y,"default","/Users/alex/react-dash/src/components/Region.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t0&&(e=this.props.data[0]),e}},{key:"prepareDataCols",value:function(e){var t=[],r=void 0;return r=(0,g.isArray)(e)&&e.length>0?Object.keys(e[0]):[],r.forEach(function(e){var r={};r.data=e,r.title=e,t.push(r)}),t}},{key:"clearDataTable",value:function(){var e=(0,E.default)(this.refs.main);e.DataTable().clear().draw()}},{key:"buildDataTable",value:function(e){var t=(0,E.default)(this.refs.main),r=this.prepareDataCols(e),n=this;t.DataTable({columnDefs:[{targets:"_all",createdCell:function(e,t,r,a,o){var i=Object.keys(r)[o],s=(0,f.getProp)("columns."+i,n.props.overrides),u=(0,f.getProp)("cells."+i+"_"+a,n.props.overrides);(0,g.isEmpty)(s)||(0,E.default)(e).addClass(s.className),(0,g.isEmpty)(u)||(0,E.default)(e).addClass(u.className)}}],dom:'<"datatablewrapper"t>',paging:!1,ordering:!1,info:!1,searching:!1,autoWidth:!1,data:e,columns:r,responsive:{details:{display:E.default.fn.dataTable.Responsive.display.childRowImmediate,type:""}}})}},{key:"updateDataTable",value:function(e){var t=(0,E.default)(this.refs.main).DataTable();t.rows.add(e),t.columns.adjust().draw()}},{key:"componentDidUpdate",value:function(e,t){var r=this.getDataFromProps();"undefined"==typeof r||r.length<1||(E.default.fn.DataTable.isDataTable(this.refs.main)?(this.clearDataTable(),this.updateDataTable(r)):this.buildDataTable(r))}},{key:"render",value:function(){var e=this.getCardVariables()||{};return d.default.createElement(m.default,s({key:"card_"+this.state.key},e),d.default.createElement(v.default,{isFetching:this.props.isFetching},d.default.createElement("table",{ref:"main",className:"table-striped table-bordered table"})))}}]),t}(_.default),j=T;t.default=j,c.default.set("ResponsiveDataTable",T);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(T,"ResponsiveDataTable","/Users/alex/react-dash/src/components/ResponsiveDataTable.js"),__REACT_HOT_LOADER__.register(j,"default","/Users/alex/react-dash/src/components/ResponsiveDataTable.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t0?i[0]:[]}};o.default.setLib("NVD3",s);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"LibName","/Users/alex/react-dash/src/datahandlers/NVD3DataHandlers.js"),__REACT_HOT_LOADER__.register(s,"dataHandlers","/Users/alex/react-dash/src/datahandlers/NVD3DataHandlers.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=r(10),o=n(a),i=r(7),s="common",u={fieldsToXYSeries:function(e,t,r,n,a,o){var i=o||e;if(!i.length)return[];Array.isArray(i[1])||(i=[i]);var s=i.map(function(e){var t=r.xField||"x";r.field;return e.map(function(e){return{y:e[r.field],x:e[t]}})});return s},fieldToD3Format:function(e,t,r,n,a,o){var s=o||e||[],u=(0,i.format)(r.format);return s.map(function(e){return e.map(function(e){return e[r.field]=u(e[r.field]),e})}),s},filterDashboardDataByParamEquals:function(e,t,r,n,a,o){var i=t,s=i.filter(function(e){return e[r.field]===r.value});return[s]},parseDateField:function(e,t,r,n,a,o){var i=o||e;return i.map(function(e){return e[r.field]=Date.parse(e[r.field]),e})},getEventReturn:function(e,t,r,n,a,o){return n?n.value:e},getXYByQueryData:function(e,t,r,n,a,o){if(t&&t[r.dataKey]&&t[r.dataKey][r.queryKey]){var i=t[r.dataKey][r.queryKey].result.records,s=i.map(function(e){var t={};return t[r.xField]=e[r.xField],t[r.yField]=e[r.yField],t});return[s]}return[]},getXYByQueryDataWhere:function(e,t,r,n,a,o){if(t&&t[r.dataKey]&&t[r.dataKey][r.queryKey]){var i=t[r.dataKey][r.queryKey].result.records,s=i.filter(function(e){var t=r.whereFieldValueIn.indexOf(e[r.whereField])>=0;return t}),u=s.map(function(e){var t={};return t[r.xField]=e[r.xField],t[r.yField]=e[r.yField],t});return[u]}return[]},getXYByQueryDataWhereFieldsIn:function(e,t,r,n,a,o){if(t&&t[r.dataKey]&&t[r.dataKey][r.queryKey]){var i=t[r.dataKey][r.queryKey].result.records,s=i.filter(function(e){var t=void 0;return r.whereField.forEach(function(n){t=r.whereFieldValueIn.indexOf(e[n])>=0}),t}),u=s.map(function(e){var t={};return t[r.xField]=e[r.xField],t[r.yField]=e[r.yField],t});return[u]}return[]},getPercentileSeries:function(e,t,r,n,a,o){},groupByRange:function(e,t,r,n,a,o){var i=o||e,s=[];return i.forEach(function(e){var t=[],n=function(n){var a=r.ranges[n][0],o=r.ranges[n][1],i=a+" - "+o,s=0,u={};e.forEach(function(e){e[r.xField]>=a&&e[r.xField]<=o&&(s+=parseInt(e[r.yField]))}),u[r.xField]=i,u[r.yField]=s,t.push(u)};for(var a in r.ranges)n(a);s.push(t)}),s},seriesFromRanges:function(e,t,r,n,a,o){var i=o||e;if(i.length>0){var s=i[0].map(function(e,t){var n={},a=[],o={};return n.key=e[r.xField],n.color=r.colors[t],o.label=r.xLabel,o.value=e[r.yField],a.push(o),n.values=a,n});return s}return i},rekeySeries:function(e,t,r,n,a,o){var i=o||e;if(i.length>0){var s=i[0].map(function(e){var t={};return Object.keys(e).forEach(function(n,a){t[r.newKeys[a]]=e[n]}),t});return[s]}return[]},parseInts:function(e,t,r,n,a,o){var i=o||e;return i.forEach(function(e){e.forEach(function(e){r.fields.forEach(function(t){e[t]=parseInt(e[t])})})}),i},toPieChartSeries:function(e,t,r,n,a,o){var i=o||e;return i.length>0?i[0]:[]},changeFieldNames:function(e,t,r,n,a,o){var i=o||e,s=[];return i.forEach(function(e){var t=void 0;t=e.map(function(e){return e[r.xField]=r.fields[e[r.xField]],e}),s.push(t)}),s},whitelistValues:function(e,t,r,n,a,o){var i=o||e,s=void 0;return i.length>0?s=i.map(function(e){return e.filter(function(e){if(r.whiteList.indexOf(e[r.field])>=0)return!0})}):i},inspect:function(e,t,r,n,a,o){var i=o||e;return console.log("INSPECT>>",this,i,arguments),i}};o.default.setLib("common",u);var l=u;t.default=l;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(s,"libName","/Users/alex/react-dash/src/datahandlers/common.js"),__REACT_HOT_LOADER__.register(u,"dataHandlers","/Users/alex/react-dash/src/datahandlers/common.js"),__REACT_HOT_LOADER__.register(l,"default","/Users/alex/react-dash/src/datahandlers/common.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=r(45);Object.defineProperty(t,"NVD3DataHandlers",{enumerable:!0,get:function(){return n(a).default}});var o=r(46);Object.defineProperty(t,"common",{enumerable:!0,get:function(){return n(o).default}});(function(){"undefined"==typeof __REACT_HOT_LOADER__})()},function(e,t,r){"use strict";function n(e){var t=[];for(var r in e)t.push(r+"="+e[r]);return"?"+t.join("&")}function a(e){return!!(e.indexOf&&e.indexOf("fid")>=0)&&e.replace("fid","")}function o(e){return JSON.parse('{"'+decodeURI(e).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}')}function i(e,t,r){var n={};if(Object.keys(e).forEach(function(a){if(a===t)if("object"===c(e[a]))r?n=e[a]:e[a].forEach(function(e){var t=e.split("__");if(n[t[0]]&&"object"===c(n[t[0]]))n[t[0]].push(t[1]);else if(n[t[0]]&&"string"==typeof n[t[0]]){var r={},a=[];a.push(n[t[0]]),a.push(t[1]),r[t[0]]=a,n=l(n,r)}else n[t[0]]=t[1]});else if(e[a].indexOf("__")<0)console.log("gop",e[a],n),n[a]=e[a];else{var o=e[a].split("__");n[o[0]]=o[1]}}),!(0,f.isEmpty)(n))return n}function s(e){var t,r,n,a,o,i;if(r=[],o=/%20/g,n=function(e,t){t="function"==typeof t?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)},e instanceof Array)for(a in e)n(a,e[a]);else for(t in e)u(t,e[t],n);return i=r.join("&").replace(o,"+")}function u(e,t,r){var n,a,o,i;if(i=/\[\]$/,t instanceof Array)for(a=0,o=t.length;a=0?t:(0,o.get)(e.root,t)}}]),e}(),u=s;t.default=u;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"reactEls","/Users/alex/react-dash/src/utils/Registry.js"),__REACT_HOT_LOADER__.register(s,"Registry","/Users/alex/react-dash/src/utils/Registry.js"),__REACT_HOT_LOADER__.register(u,"default","/Users/alex/react-dash/src/utils/Registry.js"))})()},function(e,t){e.exports=require("lodash")},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t0){var t=y.default.handle(this.props.stateHandlers,this.props.data,this.state.dashboardData);e=s(e,t)}return e}},{key:"getCardVariables",value:function(){var e=this,t={};return v.forEach(function(r){t[r]=e.state[r]||e.props[r]}),t}},{key:"addResizeListener",value:function(){var e=this;this._resizeHandler=function(t){var r=(0,c.findDOMNode)(e).getBoundingClientRect().width;e.setState({componentWidth:r}),e.onResize(t)},window.addEventListener("resize",this._resizeHandler)}},{key:"onResize",value:function(){}},{key:"onAction",value:function(){}}]),t}(l.Component),O=g;t.default=O;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(v,"CARD_VARS","/Users/alex/react-dash/src/components/BaseComponent.js"),__REACT_HOT_LOADER__.register(g,"BaseComponent","/Users/alex/react-dash/src/components/BaseComponent.js"),__REACT_HOT_LOADER__.register(O,"default","/Users/alex/react-dash/src/components/BaseComponent.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:5,t="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",n=0;n=0)&&e.replace("fid","")}Object.defineProperty(t,"__esModule",{value:!0});var f=Object.assign||function(e){for(var t=1;t=0&&(e=!0)}),e}},{key:"getData",value:function(){var e=this.props.data;return e}},{key:"getOptions",value:function(e){var t=this.getData();return this.props.options?this.props.options:t&&t[0]?this.props.data[0]:[]}}]),t}(d.default)),_=h;t.default=_,f.default.set("BaseFilter",h);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(h,"BaseFilter","/Users/alex/react-dash/src/components/BaseFilter.js"),__REACT_HOT_LOADER__.register(_,"default","/Users/alex/react-dash/src/components/BaseFilter.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),o=n(a),i=r(57),s=n(i),u=s.default,l=u;t.default=l,o.default.set("ReactSelect",s.default);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(u,"ReactSelect","/Users/alex/react-dash/src/components/ReactSelect.js"),__REACT_HOT_LOADER__.register(l,"default","/Users/alex/react-dash/src/components/ReactSelect.js"))})()},function(e,t){e.exports=require("react-router")},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:[],r=e,n=this.state.appliedFilters||{},a=d.DataHandler.handle.call(this,r,t,this.state.data,{e:"foo"},n);return a}},{key:"getUrlFilters",value:function(){var e=this,t=this.props.location.query,r={};return Object.keys(t).forEach(function(n){var a={};a.field=n,a.value=t[n].split(","),a.vals=a.value.map(function(e){return isNaN(e)||parseInt(e),e}),r=e.getUpdatedAppliedFilters(a,r)}),r}},{key:"getDashboardData",value:function(){console.log("Warning. getDashboardData should be defined in your application which extends this dashboard component. getDashboardData should return an object with dataKeys. See @@LINK")}},{key:"getChildData",value:function(e){var t=[];return e.dataHandlers?t=this._applyDataHandlers(e.dataHandlers,e.data):e.data&&e.data.length>0&&(t=e.data),t}},{key:"getFilters",value:function(e,t){return Object.keys(t).map(function(r){var n=t[r];if(n&&n.willFilter&&n.willFilter.length>0){var a=n.willFilter.indexOf(e);if(a>=0)return t[r]}})}},{key:"getFilterByField",value:function(e){var t=void 0;return this.props.regions.forEach(function(r){return r.children?r.children.forEach(function(r){r.field===e&&(t=r)}):void(r.elements&&Object.keys(r.elements).forEach(function(n){r.elements[n].forEach(function(r){r.field===e&&(t=r)})}))}),t}},{key:"onAction",value:function(e){switch(e.actionType){case"AUTOCOMPLETE_CHANGE":var t=s({},this.state.appliedFilters),r=this.getUpdatedAppliedFilters(e,t),n=(0,_.appliedFiltersToQueryString)(r),a=this.props.basePath||"";this.props.doFilterRouting!==!1&&p.browserHistory.push(a+"?"+n),this.setState({appliedFilters:r,isFetching:!0}),this.getDashboardData(r);break;case"MULTICHECKBOX_CHANGE":break;default:console.warn("Actions should define an actionType. See docs @@LINK")}}},{key:"getUpdatedAppliedFilters",value:function(e,t){var r=e.field,n=this.getFilterByField(r),a=s(e,n);return(0,h.isArray)(a.value)&&a.value.length>0?(a.vals=a.value.map(function(e){return isNaN(e)?isNaN(e.value)?e.value:parseInt(e.value):parseInt(e)}),t[r]=a):a.value&&a.value.value?(isNaN(a.value.value)||(a.value.value=parseInt(a.value.value)),a.value=[a.value],t[r]=a):a.value&&"string"==typeof a.value||"number"==typeof a.value?(a.value=[a.value],t[r]=a):delete t[r],t}},{key:"updateProps",value:function(e){var t=f.default.isValidElement(e)?e.props:e,r=[];return this.props.doFilterRouting&&(r=(0,h.pick)(this.props,["history","location","params","route","routeParams","routes"])),t.data=this.getChildData(e)||[],t.globalData=s({},this.state.data||{}),t.appliedFilters=s({},this.state.appliedFilters||{}),t.vars=s({},this.props.vars||{}),t.routeParams=r,t}},{key:"getRegion",value:function(e){var t=this;return f.default.createElement("div",{key:e.id,id:e.id,className:e.className},e.children.map(function(e,r){var n=t.updateProps(e);e.isFetching=t.state.isFetching;var a=f.default.isValidElement(e)?e:f.default.createElement(d.Registry.get(e.type),n);return a}))}},{key:"getAccordionRegion",value:function(e){var t=this;return f.default.createElement("div",{id:e.id,className:e.className,key:e.id},f.default.createElement(m.default,{key:e.id,closeable:!0},e.children.map(function(e,r){var n=t.updateProps(e),a=f.default.isValidElement(e)?e:f.default.createElement(d.Registry.get(e.type),n);return f.default.createElement("div",{"data-trigger":e.dataTrigger,key:"wrap_"+r},a)})))}},{key:"getRegions",value:function(){var e=this,t=void 0;return t=this.props.regions?this.props.regions.map(function(t,r){if(t.multi){var n=e.getChildData(t);t.key=r,t.children=t.elements[n]}return t.accordion?e.getAccordionRegion(t):e.getRegion(t)}):this.props.children}},{key:"render",value:function(){var e=void 0,t=["container-fluid"],r=(0,v.default)(this.props.dashWrapperClass,t);return this.props.title&&(e=f.default.createElement("h1",{className:"dashboard-title"}," + ",this.props.title," + ")),f.default.createElement("div",{className:r,key:"dashboard-container"},f.default.createElement("link",{rel:"stylesheet",type:"text/css",href:this.props.faPath}),e,this.getRegions())}}]),t}(d.BaseComponent),O=g;t.default=O;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(g,"Dashboard","/Users/alex/react-dash/src/components/Dashboard.js"),__REACT_HOT_LOADER__.register(O,"default","/Users/alex/react-dash/src/components/Dashboard.js"))})()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(53),a=new n.Dispatcher,o=a;t.default=o;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(a,"EventDispatcher","/Users/alex/react-dash/src/dispatcher/EventDispatcher.js"),__REACT_HOT_LOADER__.register(o,"default","/Users/alex/react-dash/src/dispatcher/EventDispatcher.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(r,n){var a=t.size||e.records.length,o=t.from||0,i=e.records;i=e._applyFilters(i,t),i=e._applyFreeTextQuery(i,t);var s={total:i.length,hits:i.slice(o,o+a)};r(s)})}},{key:"_applyFreeTextQuery",value:function(e,t){var r=this;if(t.q){var n=t.q.split(" "),a=n.map(function(e){return new RegExp(e.toLowerCase())});e=e.filter(function(e){var t=!0;return a.forEach(function(n){var a=!1;r.fields.forEach(function(t){var r=e[t.id];r=null!==r&&void 0!==r?r.toString():"",a=a||n.test(r.toLowerCase())}),t=t&&a}),t})}return e}},{key:"_applyFilters",value:function(e,t){function r(e){var t=c[e.field].type||"string";return l[t]}function n(e,t){var n=r(t),a=n(e[t.field]),o=n(t.term);return a===o}function a(e,t){var n=r(t),a=n(e[t.field]),o=n(t.terms).split(",");return o.indexOf(a)>=0}function i(e,t){var n=(0,o.isUndefined)(t.from)||null===t.from||""===t.from,a=(0,o.isUndefined)(t.to)||null===t.to||""===t.to,i=r(t),s=i(e[t.field]),u=i(n?"":t.from),l=i(a?"":t.to);return!!(n&&a||""!==s)&&((n||s>=u)&&(a||s<=l))}var s=t.filters||[],u={term:n,terms:a,range:i},l={integer:function(e){return parseFloat(e,10)},float:function(e){return parseFloat(e,10)},number:function(e){return parseFloat(e,10)},string:function(e){return e.toString()},date:function(e){return Date.parse(e)},datetime:function(e){return new Date(e).valueOf()}},c=this.fields.reduce(function(e,t){return e[t.id]=t,e},{});return e.filter(function(e){var t=s.map(function(t){ +return u[t.type](e,t)});return(0,o.every)(t,o.identity)})}}]),e}(),s=i;t.default=s;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"MemoryStore","/Users/alex/react-dash/src/models/MemoryStore.js"),__REACT_HOT_LOADER__.register(s,"default","/Users/alex/react-dash/src/models/MemoryStore.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r1&&void 0!==arguments[1]&&arguments[1];return"string"==typeof e?(0,T.format)(e):(0,E.isFunction)(e)?e:void 0}},{key:"getFormattedSettings",value:function(){var e=this,t=s({},this.props.settings);if(t.color&&!Array.isArray(t.color)){var r=void 0;r=this.props.data.length&&this.props.data[0].values?(0,E.map)((0,E.flatten)((0,E.map)(this.props.data,"values")),t.x):(0,E.uniq)((0,E.map)(this.props.data,t.x)),t.color=(0,E.values)((0,E.pick)(t.color,r))}return Object.keys(t).forEach(function(r){t[r].tickFormat&&(t[r].tickFormat=e.getFormatter(t[r].tickFormat))}),t}},{key:"render",value:function(){var e=s({},this.props),t=s({datum:this.props.data,key:this.state.key},this.getFormattedSettings());return e.header=this.state.header||e.header,e.footer=this.state.footer||e.footer,c.default.createElement(b.default,s({key:"card_"+this.state.key},this.state.cardVariables),c.default.createElement(h.default,t))}}]),t}(y.default),R=j;t.default=R,p.default.set("Chart",j);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(j,"Chart","/Users/alex/react-dash/src/components/Chart.js"),__REACT_HOT_LOADER__.register(R,"default","/Users/alex/react-dash/src/components/Chart.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;rn?(i=Math.max(n-a,1),s=r+o>n?n:r+o):(i=r-o,s=r+o),(0,O.range)(i,s+1)}},{key:"getPageNumbers",value:function(e,t,r){var n=this;if(this.getTotalPages()&&!(this.getTotalPages()<2))return this.getPages(e,t,r).map(function(e){return h.default.createElement("li",{className:e==n.state.currentPage?"active":"",key:"page-"+e},h.default.createElement("a",{onClick:(0,O.partialRight)(n._onPageChange,e).bind(n),href:"#"},e))})}},{key:"getLastPage",value:function(e,t){var r=getTotalPages(e,t);return r[r.length-1]}},{key:"getTotalPages",value:function(e,t){return Math.ceil(t/e)}},{key:"onResize",value:function(){var e=this.table,t=e.offsetWidth,r=e.offsetHeight;this.setState({gridWidth:t,gridHeight:r})}},{key:"_onPageChange",value:function(e,t,r,n){e.preventDefault();var a=this.state.rowsPerPage,o=s({},this.state.queryObj,{size:a,from:n*a-a});this.query(o),this.setState({currentPage:n,queryObj:o})}},{key:"_onFilterChange",value:function(e){var t=this.state.rowsPerPage,r=s({},this.state.queryObj,{size:t,from:this.state.currentPage*t-t,q:e.target.value});this.query(r),this.setState({currentPage:1})}},{key:"_onRowsPerPageChange",value:function(e){var t=s({},this.state.queryObj);t.size=Number(e.target.value),t.from=0,this.query(t),this.setState({rowsPerPage:Number(e.target.value),currentPage:1})}},{key:"render",value:function(){var e=this,t=this.state,r=t.gridWidth,n=(t.gridHeight,this.props.data[0]||[]),a=(0,p.getProp)("settings.table",this.props),o=(0,p.getProp)("settings.columns",this.props),i=(0,p.getProp)("settings.rows",this.props),u=Object.keys(n[0]||{}),c=this.getTotalPages(this.state.rowsPerPage,this.state.total),f=u.map(function(t,r){var a=(0,p.getProp)("columns."+t,e.props.overrides);return h.default.createElement(l.Column,s({header:h.default.createElement(l.Cell,null,t),key:t+r,columnKey:t,flexGrow:1,cell:function(r){var o=(0,p.getProp)("rows."+r.rowIndex,e.props.overrides),u=(0,p.getProp)("cells."+t+"_"+r.rowIndex,e.props.overrides);return h.default.createElement(l.Cell,s({},r,a,i,o,u),n[r.rowIndex][r.columnKey])}},o,a))}),d="",_="";return this.props.hideFilterHeader||(d=h.default.createElement("div",{className:"col-md-10"},h.default.createElement("div",{className:"form-group"},h.default.createElement("input",{onChange:this._onFilterChange.bind(this),placeholder:"Filter",className:"form-control"})))),this.props.hideControls||(_=h.default.createElement("div",{className:"col-md-2"},h.default.createElement("div",{onChange:this._onRowsPerPageChange.bind(this),className:"form-group"},h.default.createElement("select",{className:"form-control"},h.default.createElement("option",{value:"10"},"10"),h.default.createElement("option",{value:"25"},"25"),h.default.createElement("option",{value:"50"},"50"),h.default.createElement("option",{value:"100"},"100"),h.default.createElement("option",{value:"500"},"500"))))),h.default.createElement(b.default,s({key:"card_"+this.state.key},this.state.cardVariables),h.default.createElement("div",{ref:function(t){return e.table=t},className:"table-wrapper"},h.default.createElement("div",{className:"row"},d,_),h.default.createElement(g.default,{isFetching:this.props.isFetching||!n.length},h.default.createElement("div",{className:"table-container"},h.default.createElement(l.Table,s({rowsCount:n.length},a,{width:r,rowHeightGetter:this.rowHeightGetter}),f)),h.default.createElement("nav",null,h.default.createElement("ul",{className:"pagination"},h.default.createElement("li",{className:1===this.state.currentPage?"hide":""},h.default.createElement("a",{onClick:(0,O.partialRight)(this._onPageChange,1).bind(this),href:"#","aria-label":"Previous"},h.default.createElement("span",{"aria-hidden":"true"},"«"))),h.default.createElement("li",{className:1===this.state.currentPage?"hide":""},h.default.createElement("a",{onClick:(0,O.partialRight)(this._onPageChange,this.state.currentPage-1).bind(this),href:"#","aria-label":"Previous"},h.default.createElement("span",{"aria-hidden":"true"},"«"))),this.getPageNumbers(this.state.rowsPerPage,this.state.total,this.state.currentPage),h.default.createElement("li",{className:c&&this.state.currentPage!==c?"":"hide"},h.default.createElement("a",{onClick:(0,O.partialRight)(this._onPageChange,this.state.currentPage+1).bind(this),href:"#","aria-label":"Next"},h.default.createElement("span",{"aria-hidden":"true"},"»"))),h.default.createElement("li",{className:c&&this.state.currentPage!==c?"":"hide"},h.default.createElement("a",{onClick:(0,O.partialRight)(this._onPageChange,c).bind(this),href:"#","aria-label":"Next"},h.default.createElement("span",{"aria-hidden":"true"},"»"))))))))}}]),t}(y.default);E.defaultProps={rowsPerPage:10,queryObj:{size:10,from:0}};var T=E;t.default=T,f.default.set("DataTable",E);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(E,"DataTable","/Users/alex/react-dash/src/components/DataTable.js"),__REACT_HOT_LOADER__.register(T,"default","/Users/alex/react-dash/src/components/DataTable.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var 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},u=function(){function e(e,t){for(var r=0;re.from&&n<=e.to})}},{key:"trackStatus",value:function(){var e=Date.parse(this.props.startDate),t=Date.parse(this.props.endDate),r=Number(this.props.startNumber),n=Number(this.props.endNumber),a=this.getTracker(e,t,r,n),o=a(Date.now()),i=o-this.getMetric(this.state.data),s={increase:i<=0,decrease:i>=0,maintain_above:i<=0,maintain_below:i>=0,maintain:!0,mesure:!0};return this.getTolerance(i,s[this.props.action])}},{key:"getTracker",value:function(e,t,r,n){return function(a){var o=(n-r)/(t-e),i=o*(a-e);return i}}},{key:"formatActionName",value:function(e){return(0,v.capitalize)(this.props.action.replace("_"," "))}},{key:"getCaption",value:function(){var e={action:this.formatActionName(this.props.action),caption:this.props.caption,startNumber:(0,j.formatNumber)(this.props.startNumber,this.state.numberFormat),endNumber:(0,j.formatNumber)(this.props.endNumber,this.state.numberFormat),startDate:(0,j.formatDate)(new Date(this.props.startDate),this.state.dateFormat),endDate:(0,j.formatDate)(new Date(this.props.endDate),this.state.dateFormat)},t=(0,v.template)(this.props.captionTemplates[this.props.action]);return t(e)}},{key:"render",value:function(){var e=s({},(0,v.head)(this.trackStatus())),t={background:this.props.background},r=void 0,n=void 0;if(t=s({},t,this.props.style),this.props.spline){var a=s({},this.props.spline);r=c.default.createElement(O.default,s({type:"sparklinePlus",datum:this.state.data,showLastValue:!1,color:["#333333"]},a))}return this.state.showEndNumber&&(n=c.default.createElement("span",{className:"card-goal-end-number"}," ",this.props.divider," ",(0,j.formatNumber)(this.props.endNumber,this.state.numberFormat))),c.default.createElement(y.default,this.state.cardVariables,c.default.createElement(b.default,{isFetching:this.props.isFetching},c.default.createElement("div",{className:"goal",style:t},c.default.createElement("div",{className:"row"},c.default.createElement("div",{className:"col-md-4"},c.default.createElement("div",{className:"card-goal-icon"},c.default.createElement("span",{className:(0,T.default)("glyphicon",this.props.icon)}))),c.default.createElement("div",{className:"col-md-8"},c.default.createElement("div",{className:"card-goal-caption"},this.getCaption()))),c.default.createElement("div",{className:"row"},c.default.createElement("div",{className:"col-md-4"},c.default.createElement("div",{className:"card-goal-progress"},c.default.createElement("span",{className:"card-goal-metric"},(0,j.formatNumber)(this.getMetric(this.state.data),this.state.numberFormat)),n)),c.default.createElement("div",{className:"col-md-8"},c.default.createElement("div",{className:"card-goal-status"},c.default.createElement("a",{style:{color:e.color},href:this.props.link},e.label)),c.default.createElement("div",{className:"card-goal-end-date"},(0,j.formatDate)(new Date(this.props.endDate),this.state.dateFormat)))),c.default.createElement("div",{className:"row"},c.default.createElement("div",{className:"col-md-12"},c.default.createElement("div",{className:"spline"},r))))))}}]),t}(h.default);C.defaultProps={captionTemplates:{increase:"${action} ${caption} ${endNumber} by ${endDate}",decrease:"${action} ${caption} ${endNumber} by ${endDate}",maintain:"${action} at ${endNumber} ${caption} by ${endDate}",maintain_above:"${action} ${endNumber} ${caption} by ${endDate}",maintain_below:"${action} ${endNumber} ${caption} by ${endDate}",mesure:"${caption}"},divider:" / ",style:{color:"black",background:"white"}};var w=C;t.default=w,p.default.set("Goal",C);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(C,"Goal","/Users/alex/react-dash/src/components/Goal.js"),__REACT_HOT_LOADER__.register(w,"default","/Users/alex/react-dash/src/components/Goal.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r0?this.props.data[0]:this.props.data&&!(0,y.isArray)(this.props.data)?this.props.data:this.props.content?this.props.content:""}},{key:"render",value:function(){return l.default.createElement(_.default,this.state.cardVariables,l.default.createElement("div",{dangerouslySetInnerHTML:{__html:this.getContent()}}))}}]),t}(d.default),b=m;t.default=b,f.default.set("Markup",m);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(m,"Markup","/Users/alex/react-dash/src/components/Markup.js"),__REACT_HOT_LOADER__.register(b,"default","/Users/alex/react-dash/src/components/Markup.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:[];return d.DataHandler.handle.call(this,e,r,this.props.globalData,{},t)}},{key:"getChildren",value:function(){var e=this,t=void 0;return this.props.children&&(t=this.props.children.map(function(t,r){var n=s(t,{globalData:e.props.globalData,appliedFilters:e.props.appliedFilters});return t.dataHandlers?n.data=e._applyDataHandlers(t.dataHandlers,t.appliedFilters,t.data):t.data&&t.data.length>0&&(n.data=t.data),n.key=r,c.default.createElement(p.default.get(t.type),n)})),t}},{key:"render",value:function(){var e=this.getChildren();return c.default.createElement("div",{className:this.props.className},e)}}]),t}(l.Component)),y=_;t.default=y,p.default.set("Region",_);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(_,"Region","/Users/alex/react-dash/src/components/Region.js"),__REACT_HOT_LOADER__.register(y,"default","/Users/alex/react-dash/src/components/Region.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t0&&(e=this.props.data[0]),e}},{key:"prepareDataCols",value:function(e){var t=[],r=void 0;return r=(0,g.isArray)(e)&&e.length>0?Object.keys(e[0]):[],r.forEach(function(e){var r={};r.data=e,r.title=e,t.push(r)}),t}},{key:"buildDataTable",value:function(e){E.default.fn.dataTable.ext.errMode="none",E.default.fn.DataTable.isDataTable(this.refs.main)&&((0,E.default)(this.refs.main).DataTable().destroy(),(0,E.default)(this.refs.main).empty());var t=(0,E.default)(this.refs.main),r=this.prepareDataCols(e),n=this;t.DataTable({columnDefs:[{targets:"_all",createdCell:function(e,t,r,a,o){var i=Object.keys(r)[o],s=(0,f.getProp)("columns."+i,n.props.overrides),u=(0,f.getProp)("cells."+i+"_"+a,n.props.overrides);(0,g.isEmpty)(s)||(0,E.default)(e).addClass(s.className),(0,g.isEmpty)(u)||(0,E.default)(e).addClass(u.className)}}],dom:'<"datatablewrapper"t>',paging:!1,ordering:!1,info:!1,searching:!1,autoWidth:!1,data:e,columns:r,responsive:{details:{display:E.default.fn.dataTable.Responsive.display.childRowImmediate,type:""}}})}},{key:"componentDidUpdate",value:function(e,t){var r=this.getDataFromProps();"undefined"==typeof r||r.length<1||this.buildDataTable(r)}},{key:"render",value:function(){var e=this.getCardVariables()||{};return d.default.createElement(m.default,s({key:"card_"+this.state.key},e),d.default.createElement(v.default,{isFetching:this.props.isFetching},d.default.createElement("table",{ref:"main",className:"table-striped table-bordered table"})))}}]),t}(_.default),j=T;t.default=j,c.default.set("ResponsiveDataTable",T);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(T,"ResponsiveDataTable","/Users/alex/react-dash/src/components/ResponsiveDataTable.js"),__REACT_HOT_LOADER__.register(j,"default","/Users/alex/react-dash/src/components/ResponsiveDataTable.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t0?i[0]:[]}};o.default.setLib("NVD3",s);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"LibName","/Users/alex/react-dash/src/datahandlers/NVD3DataHandlers.js"),__REACT_HOT_LOADER__.register(s,"dataHandlers","/Users/alex/react-dash/src/datahandlers/NVD3DataHandlers.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=r(10),o=n(a),i=r(7),s="common",u={fieldsToXYSeries:function(e,t,r,n,a,o){var i=o||e;if(!i.length)return[];Array.isArray(i[1])||(i=[i]);var s=i.map(function(e){var t=r.xField||"x";r.field;return e.map(function(e){return{y:e[r.field],x:e[t]}})});return s},fieldToD3Format:function(e,t,r,n,a,o){var s=o||e||[],u=(0,i.format)(r.format);return s.map(function(e){return e.map(function(e){return e[r.field]=u(e[r.field]),e})}),s},filterDashboardDataByParamEquals:function(e,t,r,n,a,o){var i=t,s=i.filter(function(e){return e[r.field]===r.value});return[s]},parseDateField:function(e,t,r,n,a,o){var i=o||e;return i.map(function(e){return e[r.field]=Date.parse(e[r.field]),e})},getEventReturn:function(e,t,r,n,a,o){return n?n.value:e},getXYByQueryData:function(e,t,r,n,a,o){if(t&&t[r.dataKey]&&t[r.dataKey][r.queryKey]){var i=t[r.dataKey][r.queryKey].result.records,s=i.map(function(e){var t={};return t[r.xField]=e[r.xField],t[r.yField]=e[r.yField],t});return[s]}return[]},getXYByQueryDataWhere:function(e,t,r,n,a,o){if(t&&t[r.dataKey]&&t[r.dataKey][r.queryKey]){var i=t[r.dataKey][r.queryKey].result.records,s=i.filter(function(e){var t=r.whereFieldValueIn.indexOf(e[r.whereField])>=0;return t}),u=s.map(function(e){var t={};return t[r.xField]=e[r.xField],t[r.yField]=e[r.yField],t});return[u]}return[]},getXYByQueryDataWhereFieldsIn:function(e,t,r,n,a,o){if(t&&t[r.dataKey]&&t[r.dataKey][r.queryKey]){var i=t[r.dataKey][r.queryKey].result.records,s=i.filter(function(e){var t=void 0;return r.whereField.forEach(function(n){t=r.whereFieldValueIn.indexOf(e[n])>=0}),t}),u=s.map(function(e){var t={};return t[r.xField]=e[r.xField],t[r.yField]=e[r.yField],t});return[u]}return[]},getPercentileSeries:function(e,t,r,n,a,o){},groupByRange:function(e,t,r,n,a,o){var i=o||e,s=[];return i.forEach(function(e){var t=[],n=function(n){var a=r.ranges[n][0],o=r.ranges[n][1],i=a+" - "+o,s=0,u={};e.forEach(function(e){e[r.xField]>=a&&e[r.xField]<=o&&(s+=parseInt(e[r.yField]))}),u[r.xField]=i,u[r.yField]=s,t.push(u)};for(var a in r.ranges)n(a);s.push(t)}),s},seriesFromRanges:function(e,t,r,n,a,o){var i=o||e;if(i.length>0){var s=i[0].map(function(e,t){var n={},a=[],o={};return n.key=e[r.xField],n.color=r.colors[t],o.label=r.xLabel,o.value=e[r.yField],a.push(o),n.values=a,n});return s}return i},rekeySeries:function(e,t,r,n,a,o){var i=o||e;if(i.length>0){var s=i[0].map(function(e){var t={};return Object.keys(e).forEach(function(n,a){t[r.newKeys[a]]=e[n]}),t});return[s]}return[]},parseInts:function(e,t,r,n,a,o){var i=o||e;return i.forEach(function(e){e.forEach(function(e){r.fields.forEach(function(t){e[t]=parseInt(e[t])})})}),i},toPieChartSeries:function(e,t,r,n,a,o){var i=o||e;return i.length>0?i[0]:[]},changeFieldNames:function(e,t,r,n,a,o){var i=o||e,s=[];return i.forEach(function(e){var t=void 0;t=e.map(function(e){return e[r.xField]=r.fields[e[r.xField]],e}),s.push(t)}),s},whitelistValues:function(e,t,r,n,a,o){var i=o||e,s=void 0;return i.length>0?s=i.map(function(e){return e.filter(function(e){if(r.whiteList.indexOf(e[r.field])>=0)return!0})}):i},inspect:function(e,t,r,n,a,o){var i=o||e;return console.log("INSPECT>>",this,i,arguments),i}};o.default.setLib("common",u);var l=u;t.default=l;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(s,"libName","/Users/alex/react-dash/src/datahandlers/common.js"),__REACT_HOT_LOADER__.register(u,"dataHandlers","/Users/alex/react-dash/src/datahandlers/common.js"),__REACT_HOT_LOADER__.register(l,"default","/Users/alex/react-dash/src/datahandlers/common.js"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=r(45);Object.defineProperty(t,"NVD3DataHandlers",{enumerable:!0,get:function(){return n(a).default}});var o=r(46);Object.defineProperty(t,"common",{enumerable:!0,get:function(){return n(o).default}});(function(){"undefined"==typeof __REACT_HOT_LOADER__})()},function(e,t,r){"use strict";function n(e){var t=[];for(var r in e)t.push(r+"="+e[r]);return"?"+t.join("&")}function a(e){return!!(e.indexOf&&e.indexOf("fid")>=0)&&e.replace("fid","")}function o(e){return JSON.parse('{"'+decodeURI(e).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}')}function i(e,t,r){var n={};if(Object.keys(e).forEach(function(a){if(a===t)if("object"===c(e[a]))r?n=e[a]:e[a].forEach(function(e){var t=e.split("__");if(n[t[0]]&&"object"===c(n[t[0]]))n[t[0]].push(t[1]);else if(n[t[0]]&&"string"==typeof n[t[0]]){var r={},a=[];a.push(n[t[0]]),a.push(t[1]),r[t[0]]=a,n=l(n,r)}else n[t[0]]=t[1]});else if(e[a].indexOf("__")<0)console.log("gop",e[a],n),n[a]=e[a];else{var o=e[a].split("__");n[o[0]]=o[1]}}),!(0,f.isEmpty)(n))return n}function s(e){var t,r,n,a,o,i;if(r=[],o=/%20/g,n=function(e,t){t="function"==typeof t?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)},e instanceof Array)for(a in e)n(a,e[a]);else for(t in e)u(t,e[t],n);return i=r.join("&").replace(o,"+")}function u(e,t,r){var n,a,o,i;if(i=/\[\]$/,t instanceof Array)for(a=0,o=t.length;a