From dff2a271c2add6efbf164d0669e55cee71f38b14 Mon Sep 17 00:00:00 2001 From: Iris Ibekwe Date: Mon, 23 Oct 2017 15:49:25 -0400 Subject: [PATCH 1/5] 0.7.2 release --- dist/react-dashboard.min.css | 1 + dist/react-dashboard.min.js | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 dist/react-dashboard.min.css create mode 100644 dist/react-dashboard.min.js diff --git a/dist/react-dashboard.min.css b/dist/react-dashboard.min.css new file mode 100644 index 00000000..40315445 --- /dev/null +++ b/dist/react-dashboard.min.css @@ -0,0 +1 @@ +@import url(https://fonts.googleapis.com/css?family=Open+Sans);body{font-family:Open Sans,sans-serif}h1{font-size:1.75em;border-bottom:1px solid #eee;margin-bottom:10px;border:none;font-size:36px;margin:25px 0}h1,h2{padding:0;color:#000}h2{border-bottom:1px solid #eee}h2,h3{font-size:1.75em;margin-bottom:10px}h3{padding:0;color:#000;border-bottom:1px solid #eee;border:none;font-size:1.15em}body{background:#fff}.glyphicon{top:3px}a{color:#0a77bd}a:focus,a:hover{color:#002245}.loader{position:relative;min-height:30px}.sp{width:32px;height:32px;position:absolute;left:50%;margin-left:-16px;z-index:2}.sp.sp-slices{border-radius:50%;border-top:16px solid rgba(0,0,0,.75);border-left:16px solid rgba(0,0,0,.25);border-bottom:16px solid rgba(0,0,0,.25);border-right:16px solid rgba(0,0,0,.25);-webkit-animation:spSlices 1s infinite linear;animation:spSlices 1s infinite linear}@-webkit-keyframes spSlices{0%{border-top:16px solid rgba(0,0,0,.75);border-right:16px solid rgba(0,0,0,.25);border-bottom:16px solid rgba(0,0,0,.25);border-left:16px solid rgba(0,0,0,.25)}25%{border-top:16px solid rgba(0,0,0,.25);border-right:16px solid rgba(0,0,0,.75);border-bottom:16px solid rgba(0,0,0,.25);border-left:16px solid rgba(0,0,0,.25)}50%{border-top:16px solid rgba(0,0,0,.25);border-right:16px solid rgba(0,0,0,.25);border-bottom:16px solid rgba(0,0,0,.75);border-left:16px solid rgba(0,0,0,.25)}75%{border-top:16px solid rgba(0,0,0,.25);border-right:16px solid rgba(0,0,0,.25);border-bottom:16px solid rgba(0,0,0,.25);border-left:16px solid rgba(0,0,0,.75)}to{border-top:16px solid rgba(0,0,0,.75);border-right:16px solid rgba(0,0,0,.25);border-bottom:16px solid rgba(0,0,0,.25);border-left:16px solid rgba(0,0,0,.25)}}@keyframes spSlices{0%{border-top:16px solid rgba(0,0,0,.75);border-right:16px solid rgba(0,0,0,.25);border-bottom:16px solid rgba(0,0,0,.25);border-left:16px solid rgba(0,0,0,.25)}25%{border-top:16px solid rgba(0,0,0,.25);border-right:16px solid rgba(0,0,0,.75);border-bottom:16px solid rgba(0,0,0,.25);border-left:16px solid rgba(0,0,0,.25)}50%{border-top:16px solid rgba(0,0,0,.25);border-right:16px solid rgba(0,0,0,.25);border-bottom:16px solid rgba(0,0,0,.75);border-left:16px solid rgba(0,0,0,.25)}75%{border-top:16px solid rgba(0,0,0,.25);border-right:16px solid rgba(0,0,0,.25);border-bottom:16px solid rgba(0,0,0,.25);border-left:16px solid rgba(0,0,0,.75)}to{border-top:16px solid rgba(0,0,0,.75);border-right:16px solid rgba(0,0,0,.25);border-bottom:16px solid rgba(0,0,0,.25);border-left:16px solid rgba(0,0,0,.25)}}.card-header{font-size:1.75em;padding:0;color:#000;border-bottom:1px solid #eee;margin-bottom:10px}.card-header .glyphicon{margin-right:12px}.card-header .fa{padding-right:10px}.card-card{margin:20px 0}.card-card .card-content{padding-bottom:10px;padding-top:5px}.Select-control,.Select-menu-outer{border-radius:0}.public_fixedDataTable_header,.public_fixedDataTable_header .public_fixedDataTableCell_main{background-color:#eee;background-image:none}.fixedDataTableLayout_hasBottomBorder{border:none}.legend{width:auto;min-width:120px}.legend-container div{text-align:left!important}.hoverinfo{position:fixed;width:100px;min-height:50px;background-color:#fff;box-shadow:1px 1px 3px grey;padding:10px}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{background-color:#0a77bd;border-color:#0a77bd}.pagination>li>a,.pagination>li>span{color:#0a77bd}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{color:#002245}.goal{color:#333;background:#9f3e69;padding-bottom:17px;padding-top:17px;margin:20px 0}@media (max-width:991px){.goal{text-align:center}}.card-goal-icon{text-align:center;background:rgba(0,0,0,.1);border-radius:50%;height:70px;width:70px;margin:0 auto}.card-goal-icon span{height:70px;width:70px;line-height:2em;font-size:2em}.card-goal-icon .glyphicon:before{position:absolute;left:20px;height:30px;width:30px;top:18px;line-height:30px}@media (max-width:767px){.card-goal-icon{margin:0 auto}}.card-goal-progress{font-size:2.4em;font-weight:700;text-align:center}@media (max-width:991px){.card-goal-progress{text-align:center}}.card-goal-status{font-size:1.2em;font-weight:700;text-transform:uppercase}.card-goal-end-date{font-size:.9em}.card-goal-caption{display:table-cell;font-weight:700;height:70px;vertical-align:middle}@media (max-width:991px){.card-goal-caption{display:block;margin:1em 0;text-align:center;height:auto}}.card-goal-end-number{font-size:.7em;color:#999}.metric{background:#9f3e69;color:#fff;padding-bottom:17px;padding-top:17px;margin:20px 0;overflow:auto}.card-metric-icon{position:relative;text-align:center;background:rgba(0,0,0,.3);border-radius:50%;height:70px;width:70px;margin-left:10px}@media (max-width:767px){.card-metric-icon{margin:0 auto}}.card-metric-icon[class$=-icon] .glyphicon{position:absolute;height:70px;width:70px;line-height:2em;font-size:30px;text-align:center;top:0;left:0}.card-metric-icon[class$=-icon] .glyphicon:before{position:absolute;left:20px;height:30px;width:30px;top:20px;line-height:30px}.card-metric-number{font-size:2.5em;font-weight:700}@media (max-width:767px){.card-metric-number{text-align:center}}.card-metric-caption{text-transform:uppercase;opacity:.7}@media (max-width:767px){.card-metric-caption{text-align:center}}.metric-without-icon .card-metric-number{margin:auto;text-align:center}#main-wrapper .card-header{padding:10px 0}#main-wrapper .card-header .glyphicon{top:4px}#main-wrapper .card-goal-metric,#main-wrapper .card-metric-number{font-weight:600;line-height:1.25em}#main-wrapper .card-goal-end-number{line-height:1em;margin:-.3em;padding-left:5px}.react-dash-checkbox input[type=checkbox]{-ms-transform:scale(2);-moz-transform:scale(2);-webkit-transform:scale(2);-o-transform:scale(2);padding:10px;margin-right:1em}.react-dash-checkbox li{font-size:2.5em;list-style:none;float:left;margin-right:2em}.react-dash-checkbox li label{font-weight:300}.highlight-col{float:left}.highlight-label{font-weight:600;margin-right:1em}.highlight-cols-2{width:50%} \ No newline at end of file diff --git a/dist/react-dashboard.min.js b/dist/react-dashboard.min.js new file mode 100644 index 00000000..522e811c --- /dev/null +++ b/dist/react-dashboard.min.js @@ -0,0 +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("dkan-es6-data-backend"),require("fixed-data-table-2"),require("flux"),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","dkan-es6-data-backend","fixed-data-table-2","flux","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("dkan-es6-data-backend"),require("fixed-data-table-2"),require("flux"),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["dkan-es6-data-backend"],e["fixed-data-table-2"],e.flux,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,c,l,f,p,d){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(8)},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/civicactions/workspace/dkan-sites/react-dash/src/utils/Registry.js"),__REACT_HOT_LOADER__.register(s,"Registry","/Users/civicactions/workspace/dkan-sites/react-dash/src/utils/Registry.js"),__REACT_HOT_LOADER__.register(u,"default","/Users/civicactions/workspace/dkan-sites/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 b.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,l.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}(c.Component),O=g;t.default=O;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(b,"CARD_VARS","/Users/civicactions/workspace/dkan-sites/react-dash/src/components/BaseComponent.js"),__REACT_HOT_LOADER__.register(g,"BaseComponent","/Users/civicactions/workspace/dkan-sites/react-dash/src/components/BaseComponent.js"),__REACT_HOT_LOADER__.register(O,"default","/Users/civicactions/workspace/dkan-sites/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/civicactions/workspace/dkan-sites/react-dash/src/components/BaseFilter.js"),__REACT_HOT_LOADER__.register(_,"default","/Users/civicactions/workspace/dkan-sites/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(55),s=n(i),u=s.default,c=u;t.default=c,o.default.set("ReactSelect",s.default);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(u,"ReactSelect","/Users/civicactions/workspace/dkan-sites/react-dash/src/components/ReactSelect.js"),__REACT_HOT_LOADER__.register(c,"default","/Users/civicactions/workspace/dkan-sites/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(v.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,b.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/civicactions/workspace/dkan-sites/react-dash/src/components/Dashboard.js"),__REACT_HOT_LOADER__.register(O,"default","/Users/civicactions/workspace/dkan-sites/react-dash/src/components/Dashboard.js"))})()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52),a=new n.Dispatcher,o=a;t.default=o;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(a,"EventDispatcher","/Users/civicactions/workspace/dkan-sites/react-dash/src/dispatcher/EventDispatcher.js"),__REACT_HOT_LOADER__.register(o,"default","/Users/civicactions/workspace/dkan-sites/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=l[e.field].type||"string";return c[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),c=i(a?"":t.to);return!!(n&&a||""!==s)&&((n||s>=u)&&(a||s<=c))}var s=t.filters||[],u={term:n,terms:a,range:i},c={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()}},l=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/civicactions/workspace/dkan-sites/react-dash/src/models/MemoryStore.js"),__REACT_HOT_LOADER__.register(s,"default","/Users/civicactions/workspace/dkan-sites/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,k.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,l.default.createElement(m.default,s({key:"card_"+this.state.key},this.state.cardVariables),l.default.createElement(h.default,t))}}]),t}(y.default),w=T;t.default=w,p.default.set("Chart",T);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(T,"Chart","/Users/civicactions/workspace/dkan-sites/react-dash/src/components/Chart.js"),__REACT_HOT_LOADER__.register(w,"default","/Users/civicactions/workspace/dkan-sites/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]||{}),l=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(c.Column,s({header:h.default.createElement(c.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(c.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(m.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(c.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:l&&this.state.currentPage!==l?"":"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:l&&this.state.currentPage!==l?"":"hide"},h.default.createElement("a",{onClick:(0,O.partialRight)(this._onPageChange,l).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 k=E;t.default=k,f.default.set("DataTable",E);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(E,"DataTable","/Users/civicactions/workspace/dkan-sites/react-dash/src/components/DataTable.js"),__REACT_HOT_LOADER__.register(k,"default","/Users/civicactions/workspace/dkan-sites/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,b.capitalize)(this.props.action.replace("_"," "))}},{key:"getCaption",value:function(){var e={action:this.formatActionName(this.props.action),caption:this.props.caption,startNumber:(0,T.formatNumber)(this.props.startNumber,this.state.numberFormat),endNumber:(0,T.formatNumber)(this.props.endNumber,this.state.numberFormat),startDate:(0,T.formatDate)(new Date(this.props.startDate),this.state.dateFormat),endDate:(0,T.formatDate)(new Date(this.props.endDate),this.state.dateFormat)},t=(0,b.template)(this.props.captionTemplates[this.props.action]);return t(e)}},{key:"render",value:function(){var e=s({},(0,b.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=l.default.createElement(O.default,s({type:"sparklinePlus",datum:this.state.data,showLastValue:!1,color:["#333333"]},a))}return this.state.showEndNumber&&(n=l.default.createElement("span",{className:"card-goal-end-number"}," ",this.props.divider," ",(0,T.formatNumber)(this.props.endNumber,this.state.numberFormat))),l.default.createElement(y.default,this.state.cardVariables,l.default.createElement(m.default,{isFetching:this.props.isFetching},l.default.createElement("div",{className:"goal",style:t},l.default.createElement("div",{className:"row"},l.default.createElement("div",{className:"col-md-4"},l.default.createElement("div",{className:"card-goal-icon"},l.default.createElement("span",{className:(0,k.default)("glyphicon",this.props.icon)}))),l.default.createElement("div",{className:"col-md-8"},l.default.createElement("div",{className:"card-goal-caption"},this.getCaption()))),l.default.createElement("div",{className:"row"},l.default.createElement("div",{className:"col-md-4"},l.default.createElement("div",{className:"card-goal-progress"},l.default.createElement("span",{className:"card-goal-metric"},(0,T.formatNumber)(this.getMetric(this.state.data),this.state.numberFormat)),n)),l.default.createElement("div",{className:"col-md-8"},l.default.createElement("div",{className:"card-goal-status"},l.default.createElement("a",{style:{color:e.color},href:this.props.link},e.label)),l.default.createElement("div",{className:"card-goal-end-date"},(0,T.formatDate)(new Date(this.props.endDate),this.state.dateFormat)))),l.default.createElement("div",{className:"row"},l.default.createElement("div",{className:"col-md-12"},l.default.createElement("div",{className:"spline"},r))))))}}]),t}(h.default);R.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=R;t.default=C,p.default.set("Goal",R);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(R,"Goal","/Users/civicactions/workspace/dkan-sites/react-dash/src/components/Goal.js"),__REACT_HOT_LOADER__.register(C,"default","/Users/civicactions/workspace/dkan-sites/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 c.default.createElement(_.default,this.state.cardVariables,c.default.createElement("div",{dangerouslySetInnerHTML:{__html:this.getContent()}}))}}]),t}(d.default),m=v;t.default=m,f.default.set("Markup",v);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(v,"Markup","/Users/civicactions/workspace/dkan-sites/react-dash/src/components/Markup.js"),__REACT_HOT_LOADER__.register(m,"default","/Users/civicactions/workspace/dkan-sites/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,l.default.createElement(p.default.get(t.type),n)})),t}},{key:"render",value:function(){var e=this.getChildren();return l.default.createElement("div",{className:this.props.className},e)}}]),t}(c.Component)),y=_;t.default=y,p.default.set("Region",_);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(_,"Region","/Users/civicactions/workspace/dkan-sites/react-dash/src/components/Region.js"),__REACT_HOT_LOADER__.register(y,"default","/Users/civicactions/workspace/dkan-sites/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?i[0]:[]}};o.default.setLib("NVD3",s);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"LibName","/Users/civicactions/workspace/dkan-sites/react-dash/src/datahandlers/NVD3DataHandlers.js"),__REACT_HOT_LOADER__.register(s,"dataHandlers","/Users/civicactions/workspace/dkan-sites/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 c=u;t.default=c;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(s,"libName","/Users/civicactions/workspace/dkan-sites/react-dash/src/datahandlers/common.js"),__REACT_HOT_LOADER__.register(u,"dataHandlers","/Users/civicactions/workspace/dkan-sites/react-dash/src/datahandlers/common.js"),__REACT_HOT_LOADER__.register(c,"default","/Users/civicactions/workspace/dkan-sites/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(44);Object.defineProperty(t,"NVD3DataHandlers",{enumerable:!0,get:function(){return n(a).default}});var o=r(45);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"===l(e[a]))r?n=e[a]:e[a].forEach(function(e){var t=e.split("__");if(n[t[0]]&&"object"===l(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=c(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 Date: Mon, 23 Oct 2017 16:30:35 -0400 Subject: [PATCH 2/5] Update react-dash version. --- .gitignore | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 943c8419..b376b364 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ bower_components build *.sw* dist/ +package-lock.json +.idea diff --git a/package.json b/package.json index 8623e4b8..f4f53f7a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-dash", - "version": "0.6.14.2", + "version": "0.7.1", "description": "Another react dashboard component", "main": "./dist/react-dashboard.min.js", "style": "./dist/react-dashboard.min.css", From 2b81a961afada6ba3395a69c2209374cb4ad9c5f Mon Sep 17 00:00:00 2001 From: Iris Ibekwe Date: Mon, 23 Oct 2017 17:57:36 -0400 Subject: [PATCH 3/5] 0.7.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f4f53f7a..ca93b7a1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-dash", - "version": "0.7.1", + "version": "0.7.2", "description": "Another react dashboard component", "main": "./dist/react-dashboard.min.js", "style": "./dist/react-dashboard.min.css", From 887c15fbfc1249d0b6e27cd219a7eb1151313520 Mon Sep 17 00:00:00 2001 From: Iris Ibekwe Date: Mon, 30 Oct 2017 09:56:37 -0400 Subject: [PATCH 4/5] Updating release management doc. --- docs/development/workflows/publish.md | 50 +++++++++++++++++---------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/docs/development/workflows/publish.md b/docs/development/workflows/publish.md index 798d9480..8cbaab92 100644 --- a/docs/development/workflows/publish.md +++ b/docs/development/workflows/publish.md @@ -1,5 +1,5 @@ # NPM Publication -**NOTE** that this page relate to internal react-dash development workflows, not to implementations or library usage +**NOTE** that this page relates to internal react-dash development workflows, not to implementations or library usage ## Versioning Info We use semver http://semver.org/ : @@ -7,21 +7,33 @@ x.y.z x = major version (not currently implemented), y = minor version, z = minor versions are NOT backward compatible before v1.0.0 (0.7.x is not guaranteed to be backwards compatible with 0.6.x) patch versions should maintain backwards compatibility (0.7.2 should be compatible with 0.7.3) -##Workflow -* Do development -* Test / QA -* update changelog -* `git commit -am "Commit message - includes build"` -* `git push origin my-dev-branch` -* Submit PR - include description of work done, include acceptance criteria -* Confirm that PR is merged, then... -* `git pull` -* `npm run build` -* `git add --force dist/` -* `git co -b release.x.y.z` -* `git ci -a` -* `git br -D release.x.y.z` -* `npm version patch/minor` -* `npm publish` -* `git push --tags` -* confirm that publication was successful (eg: `npm install react-dash@0.3.5` then confirm that code updates are valid) +## Dependencies + +1. Set up an account on npm +1. Get added as maintainer on https://www.npmjs.com/package/react-dash and on the github repository +1. Identify the next release based on semantic versioning, in the form of `x.y.z` +1. Verify you have the appropriate git remotes, both an `origin` for your fork and an `upstream` for the React Dash repository +1. A GPG key setup in github. How to generate a GPG key: https://help.github.com/articles/generating-a-new-gpg-key/ + + +## Creating a new release + +** All dev branches should be pushed to and tested in the integration branch. Each dev branch should contain changelog.md notes of changes made/features added in the ticket. + +1. After all the dev branches slated for release have been merged into integration , confirm that the updates in the changelog from individual branches completely describes the new release. +1. In ReactDashboard.js, update the version number in the console.log statement (line 2, for now) to reflect the react-dash version that you are about release. `console.log('React Dashboard -- 0.7.2');` +1. Check the status of your local repository for any unwanted changes: `git status` (please note: you should not have any unexpected local changes that have not been code reviewed within a pull request) +1. Commit the changelog and any final changes: `git commit -a -m "Changelog for the [x.y.z] release"` (please substitute x.y.z for the new release) +1. Verify that you are in the integration branch: `git branch -v`. +1. If you are not on the master branch, please merge your current branch (which should be your release candidate) into master: `git checkout master && git merge [branch from previous step]` (please substitute the [branch from previous step] with the output from the aforementioned branch verification step) +1. Update the version of the package: `npm version [ patch | minor ]` (please substitute specifically with the word `patch` or `minor`). + **NOTE:** This step cannot be successfully completed without an existing GPG key in github. +1. Publish the package: `npm publish` +1. Commit the package and tag: `git commit -a -m "Package info for the [x.y.z] release" && git push upstream master --tags` (please substitute x.y.z for the new release) +1. Go to the github releases page, confirm that the `npm publish` step created a new release from the x.y.z tag. + +## Release verification + +Confirm that publication was successful (eg: `npm install react-dash@0.3.5` then confirm that code updates are valid) + +maintain backwards compatibility (0.7.2 should be compatible with 0.7.3) From 2e73e73585e5f9f551b8a1b3caed0333aaa053af Mon Sep 17 00:00:00 2001 From: Iris Ibekwe Date: Mon, 30 Oct 2017 09:59:52 -0400 Subject: [PATCH 5/5] Remove compiled css & js --- dist/react-dashboard.min.css | 1 - dist/react-dashboard.min.js | 4 ---- 2 files changed, 5 deletions(-) delete mode 100644 dist/react-dashboard.min.css delete mode 100644 dist/react-dashboard.min.js diff --git a/dist/react-dashboard.min.css b/dist/react-dashboard.min.css deleted file mode 100644 index 40315445..00000000 --- a/dist/react-dashboard.min.css +++ /dev/null @@ -1 +0,0 @@ -@import url(https://fonts.googleapis.com/css?family=Open+Sans);body{font-family:Open Sans,sans-serif}h1{font-size:1.75em;border-bottom:1px solid #eee;margin-bottom:10px;border:none;font-size:36px;margin:25px 0}h1,h2{padding:0;color:#000}h2{border-bottom:1px solid #eee}h2,h3{font-size:1.75em;margin-bottom:10px}h3{padding:0;color:#000;border-bottom:1px solid #eee;border:none;font-size:1.15em}body{background:#fff}.glyphicon{top:3px}a{color:#0a77bd}a:focus,a:hover{color:#002245}.loader{position:relative;min-height:30px}.sp{width:32px;height:32px;position:absolute;left:50%;margin-left:-16px;z-index:2}.sp.sp-slices{border-radius:50%;border-top:16px solid rgba(0,0,0,.75);border-left:16px solid rgba(0,0,0,.25);border-bottom:16px solid rgba(0,0,0,.25);border-right:16px solid rgba(0,0,0,.25);-webkit-animation:spSlices 1s infinite linear;animation:spSlices 1s infinite linear}@-webkit-keyframes spSlices{0%{border-top:16px solid rgba(0,0,0,.75);border-right:16px solid rgba(0,0,0,.25);border-bottom:16px solid rgba(0,0,0,.25);border-left:16px solid rgba(0,0,0,.25)}25%{border-top:16px solid rgba(0,0,0,.25);border-right:16px solid rgba(0,0,0,.75);border-bottom:16px solid rgba(0,0,0,.25);border-left:16px solid rgba(0,0,0,.25)}50%{border-top:16px solid rgba(0,0,0,.25);border-right:16px solid rgba(0,0,0,.25);border-bottom:16px solid rgba(0,0,0,.75);border-left:16px solid rgba(0,0,0,.25)}75%{border-top:16px solid rgba(0,0,0,.25);border-right:16px solid rgba(0,0,0,.25);border-bottom:16px solid rgba(0,0,0,.25);border-left:16px solid rgba(0,0,0,.75)}to{border-top:16px solid rgba(0,0,0,.75);border-right:16px solid rgba(0,0,0,.25);border-bottom:16px solid rgba(0,0,0,.25);border-left:16px solid rgba(0,0,0,.25)}}@keyframes spSlices{0%{border-top:16px solid rgba(0,0,0,.75);border-right:16px solid rgba(0,0,0,.25);border-bottom:16px solid rgba(0,0,0,.25);border-left:16px solid rgba(0,0,0,.25)}25%{border-top:16px solid rgba(0,0,0,.25);border-right:16px solid rgba(0,0,0,.75);border-bottom:16px solid rgba(0,0,0,.25);border-left:16px solid rgba(0,0,0,.25)}50%{border-top:16px solid rgba(0,0,0,.25);border-right:16px solid rgba(0,0,0,.25);border-bottom:16px solid rgba(0,0,0,.75);border-left:16px solid rgba(0,0,0,.25)}75%{border-top:16px solid rgba(0,0,0,.25);border-right:16px solid rgba(0,0,0,.25);border-bottom:16px solid rgba(0,0,0,.25);border-left:16px solid rgba(0,0,0,.75)}to{border-top:16px solid rgba(0,0,0,.75);border-right:16px solid rgba(0,0,0,.25);border-bottom:16px solid rgba(0,0,0,.25);border-left:16px solid rgba(0,0,0,.25)}}.card-header{font-size:1.75em;padding:0;color:#000;border-bottom:1px solid #eee;margin-bottom:10px}.card-header .glyphicon{margin-right:12px}.card-header .fa{padding-right:10px}.card-card{margin:20px 0}.card-card .card-content{padding-bottom:10px;padding-top:5px}.Select-control,.Select-menu-outer{border-radius:0}.public_fixedDataTable_header,.public_fixedDataTable_header .public_fixedDataTableCell_main{background-color:#eee;background-image:none}.fixedDataTableLayout_hasBottomBorder{border:none}.legend{width:auto;min-width:120px}.legend-container div{text-align:left!important}.hoverinfo{position:fixed;width:100px;min-height:50px;background-color:#fff;box-shadow:1px 1px 3px grey;padding:10px}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{background-color:#0a77bd;border-color:#0a77bd}.pagination>li>a,.pagination>li>span{color:#0a77bd}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{color:#002245}.goal{color:#333;background:#9f3e69;padding-bottom:17px;padding-top:17px;margin:20px 0}@media (max-width:991px){.goal{text-align:center}}.card-goal-icon{text-align:center;background:rgba(0,0,0,.1);border-radius:50%;height:70px;width:70px;margin:0 auto}.card-goal-icon span{height:70px;width:70px;line-height:2em;font-size:2em}.card-goal-icon .glyphicon:before{position:absolute;left:20px;height:30px;width:30px;top:18px;line-height:30px}@media (max-width:767px){.card-goal-icon{margin:0 auto}}.card-goal-progress{font-size:2.4em;font-weight:700;text-align:center}@media (max-width:991px){.card-goal-progress{text-align:center}}.card-goal-status{font-size:1.2em;font-weight:700;text-transform:uppercase}.card-goal-end-date{font-size:.9em}.card-goal-caption{display:table-cell;font-weight:700;height:70px;vertical-align:middle}@media (max-width:991px){.card-goal-caption{display:block;margin:1em 0;text-align:center;height:auto}}.card-goal-end-number{font-size:.7em;color:#999}.metric{background:#9f3e69;color:#fff;padding-bottom:17px;padding-top:17px;margin:20px 0;overflow:auto}.card-metric-icon{position:relative;text-align:center;background:rgba(0,0,0,.3);border-radius:50%;height:70px;width:70px;margin-left:10px}@media (max-width:767px){.card-metric-icon{margin:0 auto}}.card-metric-icon[class$=-icon] .glyphicon{position:absolute;height:70px;width:70px;line-height:2em;font-size:30px;text-align:center;top:0;left:0}.card-metric-icon[class$=-icon] .glyphicon:before{position:absolute;left:20px;height:30px;width:30px;top:20px;line-height:30px}.card-metric-number{font-size:2.5em;font-weight:700}@media (max-width:767px){.card-metric-number{text-align:center}}.card-metric-caption{text-transform:uppercase;opacity:.7}@media (max-width:767px){.card-metric-caption{text-align:center}}.metric-without-icon .card-metric-number{margin:auto;text-align:center}#main-wrapper .card-header{padding:10px 0}#main-wrapper .card-header .glyphicon{top:4px}#main-wrapper .card-goal-metric,#main-wrapper .card-metric-number{font-weight:600;line-height:1.25em}#main-wrapper .card-goal-end-number{line-height:1em;margin:-.3em;padding-left:5px}.react-dash-checkbox input[type=checkbox]{-ms-transform:scale(2);-moz-transform:scale(2);-webkit-transform:scale(2);-o-transform:scale(2);padding:10px;margin-right:1em}.react-dash-checkbox li{font-size:2.5em;list-style:none;float:left;margin-right:2em}.react-dash-checkbox li label{font-weight:300}.highlight-col{float:left}.highlight-label{font-weight:600;margin-right:1em}.highlight-cols-2{width:50%} \ No newline at end of file diff --git a/dist/react-dashboard.min.js b/dist/react-dashboard.min.js deleted file mode 100644 index 522e811c..00000000 --- a/dist/react-dashboard.min.js +++ /dev/null @@ -1,4 +0,0 @@ -!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("dkan-es6-data-backend"),require("fixed-data-table-2"),require("flux"),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","dkan-es6-data-backend","fixed-data-table-2","flux","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("dkan-es6-data-backend"),require("fixed-data-table-2"),require("flux"),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["dkan-es6-data-backend"],e["fixed-data-table-2"],e.flux,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,c,l,f,p,d){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(8)},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/civicactions/workspace/dkan-sites/react-dash/src/utils/Registry.js"),__REACT_HOT_LOADER__.register(s,"Registry","/Users/civicactions/workspace/dkan-sites/react-dash/src/utils/Registry.js"),__REACT_HOT_LOADER__.register(u,"default","/Users/civicactions/workspace/dkan-sites/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 b.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,l.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}(c.Component),O=g;t.default=O;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(b,"CARD_VARS","/Users/civicactions/workspace/dkan-sites/react-dash/src/components/BaseComponent.js"),__REACT_HOT_LOADER__.register(g,"BaseComponent","/Users/civicactions/workspace/dkan-sites/react-dash/src/components/BaseComponent.js"),__REACT_HOT_LOADER__.register(O,"default","/Users/civicactions/workspace/dkan-sites/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/civicactions/workspace/dkan-sites/react-dash/src/components/BaseFilter.js"),__REACT_HOT_LOADER__.register(_,"default","/Users/civicactions/workspace/dkan-sites/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(55),s=n(i),u=s.default,c=u;t.default=c,o.default.set("ReactSelect",s.default);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(u,"ReactSelect","/Users/civicactions/workspace/dkan-sites/react-dash/src/components/ReactSelect.js"),__REACT_HOT_LOADER__.register(c,"default","/Users/civicactions/workspace/dkan-sites/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(v.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,b.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/civicactions/workspace/dkan-sites/react-dash/src/components/Dashboard.js"),__REACT_HOT_LOADER__.register(O,"default","/Users/civicactions/workspace/dkan-sites/react-dash/src/components/Dashboard.js"))})()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52),a=new n.Dispatcher,o=a;t.default=o;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(a,"EventDispatcher","/Users/civicactions/workspace/dkan-sites/react-dash/src/dispatcher/EventDispatcher.js"),__REACT_HOT_LOADER__.register(o,"default","/Users/civicactions/workspace/dkan-sites/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=l[e.field].type||"string";return c[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),c=i(a?"":t.to);return!!(n&&a||""!==s)&&((n||s>=u)&&(a||s<=c))}var s=t.filters||[],u={term:n,terms:a,range:i},c={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()}},l=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/civicactions/workspace/dkan-sites/react-dash/src/models/MemoryStore.js"),__REACT_HOT_LOADER__.register(s,"default","/Users/civicactions/workspace/dkan-sites/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,k.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,l.default.createElement(m.default,s({key:"card_"+this.state.key},this.state.cardVariables),l.default.createElement(h.default,t))}}]),t}(y.default),w=T;t.default=w,p.default.set("Chart",T);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(T,"Chart","/Users/civicactions/workspace/dkan-sites/react-dash/src/components/Chart.js"),__REACT_HOT_LOADER__.register(w,"default","/Users/civicactions/workspace/dkan-sites/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]||{}),l=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(c.Column,s({header:h.default.createElement(c.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(c.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(m.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(c.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:l&&this.state.currentPage!==l?"":"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:l&&this.state.currentPage!==l?"":"hide"},h.default.createElement("a",{onClick:(0,O.partialRight)(this._onPageChange,l).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 k=E;t.default=k,f.default.set("DataTable",E);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(E,"DataTable","/Users/civicactions/workspace/dkan-sites/react-dash/src/components/DataTable.js"),__REACT_HOT_LOADER__.register(k,"default","/Users/civicactions/workspace/dkan-sites/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,b.capitalize)(this.props.action.replace("_"," "))}},{key:"getCaption",value:function(){var e={action:this.formatActionName(this.props.action),caption:this.props.caption,startNumber:(0,T.formatNumber)(this.props.startNumber,this.state.numberFormat),endNumber:(0,T.formatNumber)(this.props.endNumber,this.state.numberFormat),startDate:(0,T.formatDate)(new Date(this.props.startDate),this.state.dateFormat),endDate:(0,T.formatDate)(new Date(this.props.endDate),this.state.dateFormat)},t=(0,b.template)(this.props.captionTemplates[this.props.action]);return t(e)}},{key:"render",value:function(){var e=s({},(0,b.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=l.default.createElement(O.default,s({type:"sparklinePlus",datum:this.state.data,showLastValue:!1,color:["#333333"]},a))}return this.state.showEndNumber&&(n=l.default.createElement("span",{className:"card-goal-end-number"}," ",this.props.divider," ",(0,T.formatNumber)(this.props.endNumber,this.state.numberFormat))),l.default.createElement(y.default,this.state.cardVariables,l.default.createElement(m.default,{isFetching:this.props.isFetching},l.default.createElement("div",{className:"goal",style:t},l.default.createElement("div",{className:"row"},l.default.createElement("div",{className:"col-md-4"},l.default.createElement("div",{className:"card-goal-icon"},l.default.createElement("span",{className:(0,k.default)("glyphicon",this.props.icon)}))),l.default.createElement("div",{className:"col-md-8"},l.default.createElement("div",{className:"card-goal-caption"},this.getCaption()))),l.default.createElement("div",{className:"row"},l.default.createElement("div",{className:"col-md-4"},l.default.createElement("div",{className:"card-goal-progress"},l.default.createElement("span",{className:"card-goal-metric"},(0,T.formatNumber)(this.getMetric(this.state.data),this.state.numberFormat)),n)),l.default.createElement("div",{className:"col-md-8"},l.default.createElement("div",{className:"card-goal-status"},l.default.createElement("a",{style:{color:e.color},href:this.props.link},e.label)),l.default.createElement("div",{className:"card-goal-end-date"},(0,T.formatDate)(new Date(this.props.endDate),this.state.dateFormat)))),l.default.createElement("div",{className:"row"},l.default.createElement("div",{className:"col-md-12"},l.default.createElement("div",{className:"spline"},r))))))}}]),t}(h.default);R.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=R;t.default=C,p.default.set("Goal",R);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(R,"Goal","/Users/civicactions/workspace/dkan-sites/react-dash/src/components/Goal.js"),__REACT_HOT_LOADER__.register(C,"default","/Users/civicactions/workspace/dkan-sites/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 c.default.createElement(_.default,this.state.cardVariables,c.default.createElement("div",{dangerouslySetInnerHTML:{__html:this.getContent()}}))}}]),t}(d.default),m=v;t.default=m,f.default.set("Markup",v);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(v,"Markup","/Users/civicactions/workspace/dkan-sites/react-dash/src/components/Markup.js"),__REACT_HOT_LOADER__.register(m,"default","/Users/civicactions/workspace/dkan-sites/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,l.default.createElement(p.default.get(t.type),n)})),t}},{key:"render",value:function(){var e=this.getChildren();return l.default.createElement("div",{className:this.props.className},e)}}]),t}(c.Component)),y=_;t.default=y,p.default.set("Region",_);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(_,"Region","/Users/civicactions/workspace/dkan-sites/react-dash/src/components/Region.js"),__REACT_HOT_LOADER__.register(y,"default","/Users/civicactions/workspace/dkan-sites/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?i[0]:[]}};o.default.setLib("NVD3",s);(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"LibName","/Users/civicactions/workspace/dkan-sites/react-dash/src/datahandlers/NVD3DataHandlers.js"),__REACT_HOT_LOADER__.register(s,"dataHandlers","/Users/civicactions/workspace/dkan-sites/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 c=u;t.default=c;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(s,"libName","/Users/civicactions/workspace/dkan-sites/react-dash/src/datahandlers/common.js"),__REACT_HOT_LOADER__.register(u,"dataHandlers","/Users/civicactions/workspace/dkan-sites/react-dash/src/datahandlers/common.js"),__REACT_HOT_LOADER__.register(c,"default","/Users/civicactions/workspace/dkan-sites/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(44);Object.defineProperty(t,"NVD3DataHandlers",{enumerable:!0,get:function(){return n(a).default}});var o=r(45);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"===l(e[a]))r?n=e[a]:e[a].forEach(function(e){var t=e.split("__");if(n[t[0]]&&"object"===l(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=c(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