mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
3 lines
14 KiB
JavaScript
3 lines
14 KiB
JavaScript
!function e(t,r,n){function o(i,u){if(!r[i]){if(!t[i]){var c="function"==typeof require&&require;if(!u&&c)return c(i,!0);if(a)return a(i,!0);var s=new Error("Cannot find module '"+i+"'");throw s.code="MODULE_NOT_FOUND",s}var d=r[i]={exports:{}};t[i][0].call(d.exports,function(e){var r=t[i][1][e];return o(r?r:e)},d,d.exports,e,t,r,n)}return r[i].exports}for(var a="function"==typeof require&&require,i=0;i<n.length;i++)o(n[i]);return o}({1:[function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":e}}function a(){E["default"].add("config",v["default"]),E["default"].add("schemas",m["default"]),E["default"].add("records",b["default"]);var e={},t=(0,c.combineReducers)(E["default"].getAll()),r=(0,c.applyMiddleware)(d["default"],(0,f["default"])())(c.createStore);window.store=r(t,e),window.store.dispatch(h.setConfig(window.ss.config))}var i=e("jQuery"),u=o(i),c=e("redux"),s=e("redux-thunk"),d=o(s),l=e("redux-logger"),f=o(l),p=e("reducer-register"),E=o(p),y=e("state/config/actions"),h=n(y),g=e("state/config/reducer"),v=o(g),_=e("state/schema/reducer"),m=o(_),C=e("state/records/reducer"),b=o(C),O=e("sections/campaign-admin/index");o(O);(0,u["default"])("body").entwine({onadd:function(){return a()}})},{jQuery:"jQuery","reducer-register":"reducer-register",redux:"redux","redux-logger":12,"redux-thunk":"redux-thunk","sections/campaign-admin/index":4,"state/config/actions":6,"state/config/reducer":7,"state/records/reducer":9,"state/schema/reducer":11}],2:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var o=r[n],a=Object.getOwnPropertyDescriptor(t,o);a&&a.configurable&&void 0===e[o]&&Object.defineProperty(e,o,a)}return e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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 u(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):o(e,t))}Object.defineProperty(r,"__esModule",{value:!0});var c=e("react"),s=n(c),d=e("silverstripe-component"),l=n(d),f=function(e){function t(r){a(this,t);var n=i(this,e.call(this,r));return n.handleClick=n.handleClick.bind(n),n}return u(t,e),t.prototype.render=function(){var e={type:this.props.type,className:this.getButtonClasses(),disabled:this.props.disabled};return"undefined"!=typeof this.props.id&&(e.id=this.props.id),s["default"].createElement("button",e,this.getLoadingIcon(),this.props.label)},t.prototype.getButtonClasses=function(){var e=["btn"];return e.push("btn-"+this.props.style),"undefined"==typeof this.props.label&&e.push("no-text"),"undefined"!=typeof this.props.icon&&e.push("font-icon-"+this.props.icon),this.props.loading===!0&&e.push("btn--loading"),this.props.disabled===!0&&e.push("disabled"),"undefined"!=typeof this.props.extraClass&&e.push(this.props.extraClass),e.join(" ")},t.prototype.getLoadingIcon=function(){return this.props.loading?s["default"].createElement("div",{className:"btn__loading-icon"},s["default"].createElement("svg",{viewBox:"0 0 44 12"},s["default"].createElement("circle",{cx:"6",cy:"6",r:"6"}),s["default"].createElement("circle",{cx:"22",cy:"6",r:"6"}),s["default"].createElement("circle",{cx:"38",cy:"6",r:"6"}))):null},t.prototype.handleClick=function(e){this.props.handleClick(e)},t}(l["default"]);f.propTypes={id:s["default"].PropTypes.string,handleClick:s["default"].PropTypes.func.isRequired,label:s["default"].PropTypes.string,type:s["default"].PropTypes.string,loading:s["default"].PropTypes.bool,icon:s["default"].PropTypes.string,disabled:s["default"].PropTypes.bool,style:s["default"].PropTypes.string,extraClass:s["default"].PropTypes.string},f.defaultProps={type:"button",style:"secondary",disabled:!1},r["default"]=f},{react:"react","silverstripe-component":"silverstripe-component"}],3:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var o=r[n],a=Object.getOwnPropertyDescriptor(t,o);a&&a.configurable&&void 0===e[o]&&Object.defineProperty(e,o,a)}return e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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 u(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):o(e,t))}function c(e,t){return{config:e.config.sections[t.sectionConfigKey]}}Object.defineProperty(r,"__esModule",{value:!0});var s=e("react"),d=n(s),l=e("react-redux"),f=e("silverstripe-component"),p=n(f),E=e("components/form-action/index"),y=n(E),h=e("i18n"),g=n(h),v=e("components/north-header/index"),_=n(v),m=e("components/form-builder/index"),C=n(m),b=function(e){function t(r){a(this,t);var n=i(this,e.call(this,r));return n.addCampaign=n.addCampaign.bind(n),n}return u(t,e),t.prototype.render=function(){var e=this.props.config.forms.editForm.schemaUrl;return d["default"].createElement("div",null,d["default"].createElement(_["default"],null),d["default"].createElement(y["default"],{label:g["default"]._t("Campaigns.ADDCAMPAIGN"),icon:"plus-circled",handleClick:this.addCampaign}),d["default"].createElement(C["default"],{schemaUrl:e}))},t.prototype.addCampaign=function(){},t}(p["default"]);b.propTypes={config:d["default"].PropTypes.shape({forms:d["default"].PropTypes.shape({editForm:d["default"].PropTypes.shape({schemaUrl:d["default"].PropTypes.string})})}),sectionConfigKey:d["default"].PropTypes.string.isRequired},r["default"]=(0,l.connect)(c)(b)},{"components/form-action/index":2,"components/form-builder/index":"components/form-builder/index","components/north-header/index":"components/north-header/index",i18n:"i18n",react:"react","react-redux":"react-redux","silverstripe-component":"silverstripe-component"}],4:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var o=e("jQuery"),a=n(o),i=e("react"),u=n(i),c=e("react-dom"),s=n(c),d=e("react-redux"),l=e("./controller"),f=n(l);a["default"].entwine("ss",function(e){e(".cms-content.CampaignAdmin").entwine({onadd:function(){s["default"].render(u["default"].createElement(d.Provider,{store:window.store},u["default"].createElement(f["default"],{sectionConfigKey:"CampaignAdmin"})),this[0])},onremove:function(){s["default"].unmountComponentAtNode(this[0])}})})},{"./controller":3,jQuery:"jQuery",react:"react","react-dom":"react-dom","react-redux":"react-redux"}],5:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r["default"]={SET_CONFIG:"SET_CONFIG"}},{}],6:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return{type:i["default"].SET_CONFIG,payload:{config:e}}}Object.defineProperty(r,"__esModule",{value:!0}),r.setConfig=o;var a=e("./action-types"),i=n(a)},{"./action-types":5}],7:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=arguments[1];switch(t.type){case s["default"].SET_CONFIG:return(0,u["default"])(a({},e,t.payload.config));default:return e}}Object.defineProperty(r,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i=e("deep-freeze"),u=n(i),c=e("./action-types"),s=n(c);r["default"]=o},{"./action-types":5,"deep-freeze":"deep-freeze"}],8:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r["default"]={CREATE_RECORD:"CREATE_RECORD",UPDATE_RECORD:"UPDATE_RECORD",DELETE_RECORD:"DELETE_RECORD",FETCH_RECORDS_REQUEST:"FETCH_RECORDS_REQUEST",FETCH_RECORDS_FAILURE:"FETCH_RECORDS_FAILURE",FETCH_RECORDS_SUCCESS:"FETCH_RECORDS_SUCCESS",DELETE_RECORD_REQUEST:"DELETE_RECORD_REQUEST",DELETE_RECORD_FAILURE:"DELETE_RECORD_FAILURE",DELETE_RECORD_SUCCESS:"DELETE_RECORD_SUCCESS"}},{}],9:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(){var e=arguments.length<=0||void 0===arguments[0]?l:arguments[0],t=arguments[1],r=void 0,n=void 0;switch(t.type){case d["default"].CREATE_RECORD:return(0,c["default"])(i({},e,{}));case d["default"].UPDATE_RECORD:return(0,c["default"])(i({},e,{}));case d["default"].DELETE_RECORD:return(0,c["default"])(i({},e,{}));case d["default"].FETCH_RECORDS_REQUEST:return e;case d["default"].FETCH_RECORDS_FAILURE:return e;case d["default"].FETCH_RECORDS_SUCCESS:return n=t.payload.recordType,r=t.payload.data._embedded[n+"s"],(0,c["default"])(i({},e,o({},n,r)));case d["default"].DELETE_RECORD_REQUEST:return e;case d["default"].DELETE_RECORD_FAILURE:return e;case d["default"].DELETE_RECORD_SUCCESS:return n=t.payload.recordType,r=e[n].filter(function(e){return e.ID!==t.payload.id}),(0,c["default"])(i({},e,o({},n,r)));default:return e}}Object.defineProperty(r,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u=e("deep-freeze"),c=n(u),s=e("./action-types"),d=n(s),l={};r["default"]=a},{"./action-types":8,"deep-freeze":"deep-freeze"}],10:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={SET_SCHEMA:"SET_SCHEMA"};r["default"]=n},{}],11:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(){var e=arguments.length<=0||void 0===arguments[0]?l:arguments[0],t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];switch(t.type){case d["default"].SET_SCHEMA:var r=t.payload.schema.schema_url;return(0,c["default"])(i({},e,o({},r,t.payload)));default:return e}}Object.defineProperty(r,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};r["default"]=a;var u=e("deep-freeze"),c=n(u),s=e("./action-types"),d=n(s),l=(0,c["default"])({})},{"./action-types":10,"deep-freeze":"deep-freeze"}],12:[function(e,t,r){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function o(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function a(e,t,r,a){switch("undefined"==typeof e?"undefined":o(e)){case"object":return"function"==typeof e[a]?e[a].apply(e,n(r)):e[a];case"function":return e(t);default:return e}}function i(){function e(){S.forEach(function(e,t){var r=e.started,o=e.startedTime,u=e.action,c=e.prevState,d=e.error,f=e.took,p=e.nextState,y=S[t+1];y&&(p=y.prevState,f=y.started-r);var g=C(u),v="function"==typeof l?l(function(){return p},u):l,_=s(o),m=T.title?"color: "+T.title(g)+";":null,b="action "+(h?_:"")+" "+g.type+" "+(E?"(in "+f.toFixed(2)+" ms)":"");try{v?T.title?i.groupCollapsed("%c "+b,m):i.groupCollapsed(b):T.title?i.group("%c "+b,m):i.group(b)}catch(O){i.log(b)}var R=a(n,g,[c],"prevState"),w=a(n,g,[g],"action"),D=a(n,g,[d,c],"error"),x=a(n,g,[p],"nextState");R&&(T.prevState?i[R]("%c prev state","color: "+T.prevState(c)+"; font-weight: bold",c):i[R]("prev state",c)),w&&(T.action?i[w]("%c action","color: "+T.action(g)+"; font-weight: bold",g):i[w]("action",g)),d&&D&&(T.error?i[D]("%c error","color: "+T.error(d,c)+"; font-weight: bold",d):i[D]("error",d)),x&&(T.nextState?i[x]("%c next state","color: "+T.nextState(p)+"; font-weight: bold",p):i[x]("next state",p));try{i.groupEnd()}catch(O){i.log("—— log end ——")}}),S.length=0}var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],r=t.level,n=void 0===r?"log":r,o=t.logger,i=void 0===o?console:o,u=t.logErrors,c=void 0===u?!0:u,l=t.collapsed,f=t.predicate,p=t.duration,E=void 0===p?!1:p,y=t.timestamp,h=void 0===y?!0:y,g=t.transformer,v=t.stateTransformer,_=void 0===v?function(e){return e}:v,m=t.actionTransformer,C=void 0===m?function(e){return e}:m,b=t.errorTransformer,O=void 0===b?function(e){return e}:b,R=t.colors,T=void 0===R?{title:function(){return"#000000"},prevState:function(){return"#9E9E9E"},action:function(){return"#03A9F4"},nextState:function(){return"#4CAF50"},error:function(){return"#F20404"}}:R;if("undefined"==typeof i)return function(){return function(e){return function(t){return e(t)}}};g&&console.error("Option 'transformer' is deprecated, use stateTransformer instead");var S=[];return function(t){var r=t.getState;return function(t){return function(n){if("function"==typeof f&&!f(r,n))return t(n);var o={};S.push(o),o.started=d.now(),o.startedTime=new Date,o.prevState=_(r()),o.action=n;var a=void 0;if(c)try{a=t(n)}catch(i){o.error=O(i)}else a=t(n);if(o.took=d.now()-o.started,o.nextState=_(r()),e(),o.error)throw o.error;return a}}}}var u=function(e,t){return new Array(t+1).join(e)},c=function(e,t){return u("0",t-e.toString().length)+e},s=function(e){return"@ "+c(e.getHours(),2)+":"+c(e.getMinutes(),2)+":"+c(e.getSeconds(),2)+"."+c(e.getMilliseconds(),3)},d="undefined"!=typeof performance&&"function"==typeof performance.now?performance:Date;t.exports=i},{}]},{},[1]);
|
|
//# sourceMappingURL=bundle-framework.js.map
|