-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
1 lines (1 loc) · 2.78 KB
/
index.js
1
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ReduxAxiosMiddleware=t():e.ReduxAxiosMiddleware=t()}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(e,t){e.exports=require("axios")},function(e,t){e.exports=require("qs")},function(e,t,r){"use strict";r.r(t),r.d(t,"axiosConfigForAgGrid",(function(){return u})),r.d(t,"axiosInstanceForAgGrid",(function(){return a})),r.d(t,"DataSource",(function(){return l})),r.d(t,"Request",(function(){return f})),r.d(t,"Response",(function(){return c})),r.d(t,"queryParamFromSortFilterModel",(function(){return s}));var n=r(0),o=r.n(n),i=r(1),u={paramsSerializer:function(e){return Object(i.stringify)(e,{arrayFormat:"repeat"})},headers:{"Cache-Control":"no-cache,no-store,must-revalidate,max-age=-1,private",Expires:-1,Pragma:"no-cache"}},a=o.a.create(u),f=function(){this.sortColId=[],this.sortType=[],this.filterColId=[],this.filterType=[],this.filterWord=[],this.filterTo=[],this.filterCategory=[]},c=function(){};function s(e,t){void 0===e&&(e=[]),void 0===t&&(t={});var r=new f;e.length>0&&(r.sortColId=e.map((function(e){return e.colId})),r.sortType=e.map((function(e){return e.sort})));var n=Object.keys(t);return r.filterColId=n,r.filterType=n.map((function(e){return t[e].type})),r.filterWord=n.map((function(e){return t[e].filter})),r.filterTo=n.map((function(e){return t[e].filterTo})),r.filterCategory=n.map((function(e){return t[e].filterType})),r}var l=function(){function e(e,t){this.urlTemplate=e,this.axiosInstance=t}return e.prototype.getRows=function(e){var t=this.urlTemplate.replace("{{startRow}}",""+e.startRow).replace("{{endRow}}",""+e.endRow),r=s(e.sortModel,e.filterModel);this.axiosInstance.get(t,{params:r}).then((function(t){e.successCallback(t.data.rowsThisBlock,t.data.lastRow)}))},e.factory=function(t,r){return void 0===r&&(r=a),new e(t,r)},e}()}])}));