frint-component-handlers
Advanced tools
Comparing version 2.8.1 to 2.9.0-alpha.2d26e4d7
@@ -86,3 +86,3 @@ this["FrintComponentHandlers"] = | ||
var _RegionService = __webpack_require__(4); | ||
var _RegionService = __webpack_require__(5); | ||
@@ -147,8 +147,14 @@ var _RegionService2 = _interopRequireDefault(_RegionService); | ||
var _lodash = __webpack_require__(3); | ||
var _isEqual = __webpack_require__(3); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
var _isEqual2 = _interopRequireDefault(_isEqual); | ||
var _zipWith = __webpack_require__(4); | ||
var _zipWith2 = _interopRequireDefault(_zipWith); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/* global window */ | ||
/* eslint-disable no-console */ | ||
exports.default = { | ||
@@ -234,3 +240,3 @@ getInitialData: function getInitialData() { | ||
shouldUpdate: function shouldUpdate(nextProps, nextData) { | ||
var shouldUpdate = !_lodash2.default.isEqual(this.getProps(), nextProps); | ||
var shouldUpdate = !(0, _isEqual2.default)(this.getProps(), nextProps); | ||
@@ -241,3 +247,3 @@ if (!shouldUpdate) { | ||
shouldUpdate = shouldUpdate || this.getData('listForRendering').length !== listForRendering.length; | ||
shouldUpdate = shouldUpdate || _lodash2.default.zipWith(this.getData('listForRendering'), listForRendering, function (a, b) { | ||
shouldUpdate = shouldUpdate || (0, _zipWith2.default)(this.getData('listForRendering'), listForRendering, function (a, b) { | ||
return a.name === b.name; | ||
@@ -289,5 +295,3 @@ }).some(function (value) { | ||
} | ||
}; /* global window */ | ||
/* eslint-disable no-console */ | ||
}; | ||
module.exports = exports['default']; | ||
@@ -299,6 +303,12 @@ | ||
(function() { module.exports = this["_"]; }()); | ||
(function() { module.exports = this[undefined]; }()); | ||
/***/ }), | ||
/* 4 */ | ||
/***/ (function(module, exports) { | ||
(function() { module.exports = this[undefined]; }()); | ||
/***/ }), | ||
/* 5 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -315,4 +325,6 @@ | ||
var _rxjs = __webpack_require__(5); | ||
var _BehaviorSubject = __webpack_require__(6); | ||
var _map = __webpack_require__(7); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -324,3 +336,3 @@ | ||
this.props$ = new _rxjs.BehaviorSubject({}); | ||
this.props$ = new _BehaviorSubject.BehaviorSubject({}); | ||
} | ||
@@ -348,3 +360,5 @@ | ||
value: function getData$() { | ||
return this.props$.map(function (props) { | ||
var _context; | ||
return (_context = this.props$, _map.map).call(_context, function (props) { | ||
return props.data; | ||
@@ -362,8 +376,14 @@ }); | ||
/***/ }), | ||
/* 5 */ | ||
/* 6 */ | ||
/***/ (function(module, exports) { | ||
(function() { module.exports = this["Rx"]; }()); | ||
(function() { module.exports = this[undefined]; }()); | ||
/***/ }), | ||
/* 7 */ | ||
/***/ (function(module, exports) { | ||
(function() { module.exports = this[undefined]; }()); | ||
/***/ }) | ||
/******/ ]); |
@@ -1,1 +0,1 @@ | ||
this.FrintComponentHandlers=function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),u=n(2),a=r(u),s=n(4),p=r(s);e.default={ObserveHandler:o.default,RegionHandler:a.default,RegionService:p.default},t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={getProps$:null,getInitialData:function(){return{computedProps:{}}},beforeMount:function(){var t=this;"function"==typeof this.getProps$&&(this._subscription=this.getProps$(this.app).subscribe(function(e){t.setData("computedProps",e)}))},beforeDestroy:function(){this._subscription&&this._subscription.unsubscribe()}},t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),i=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default={getInitialData:function(){return{list:[],listForRendering:[]}},sendProps:function(t,e){var n=t.get(t.options.providerNames.region);n&&n.emit(e)},beforeMount:function(){var t=this,e=this.app?this.app.getRootApp():window.app;if(e){this.rootApp=e;var n=e.getApps$(this.getProp("name"),this.getProp("uniqueKey"));this._subscription=n.subscribe({next:function(n){t.setDataWithCallback("list",n,function(){t.getData("list").forEach(function(n){var r=n.name,i=n.weight,o=n.multi;if(!t.getData("listForRendering").some(function(t){return t.name===r})){var u=t.getProp("uniqueKey")?[t.getProp("name"),t.getProp("uniqueKey")]:[t.getProp("name")];t.getProp("uniqueKey")&&!e.hasAppInstance.apply(e,[r].concat(u))&&e.instantiateApp.apply(e,[r].concat(u));var a=e.getAppInstance.apply(e,[r].concat(u));a&&t.sendProps(a,{name:t.getProp("name"),uniqueKey:t.getProp("uniqueKey"),data:t.getProp("data")}),t.setData("listForRendering",t.getData("listForRendering").concat({name:r,weight:i,instance:a,multi:o,Component:t.getMountableComponent(a)}).sort(function(t,e){return t.weight-e.weight}))}})})},error:function(e){console.warn('Subscription error for <Region name="'+t.name+'" />:',e)}})}},shouldUpdate:function(t,e){var n=!i.default.isEqual(this.getProps(),t);if(!n){var r=e.listForRendering;n=n||this.getData("listForRendering").length!==r.length,n=n||i.default.zipWith(this.getData("listForRendering"),r,function(t,e){return t.name===e.name}).some(function(t){return!t})}return n},afterUpdate:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=e||{},r=n.name,i=void 0===r?this.getProp("name"):r,o=n.uniqueKey,u=void 0===o?this.getProp("uniqueKey"):o,a=n.data,s=void 0===a?this.getProp("data"):a;this.getData("listForRendering").filter(function(t){return t.instance}).forEach(function(e){return t.sendProps(e.instance,{name:i,uniqueKey:u,data:s})})},beforeDestroy:function(){var t=this;this._subscription&&this._subscription.unsubscribe(),this.rootApp&&this.getData("listForRendering").filter(function(t){return t.multi}).forEach(function(e){t.rootApp.destroyApp(e.name,t.getProp("name"),t.getProp("uniqueKey"))})}},t.exports=e.default},function(t,e){!function(){t.exports=this._}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(5),u=function(){function t(){r(this,t),this.props$=new o.BehaviorSubject({})}return i(t,[{key:"emit",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.props$.next(t)}},{key:"getProps$",value:function(){return this.props$}},{key:"getData$",value:function(){return this.props$.map(function(t){return t.data})}}]),t}();e.default=u,t.exports=e.default},function(t,e){!function(){t.exports=this.Rx}()}]); | ||
this.FrintComponentHandlers=function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),u=n(2),a=r(u),s=n(5),p=r(s);e.default={ObserveHandler:o.default,RegionHandler:a.default,RegionService:p.default},t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={getProps$:null,getInitialData:function(){return{computedProps:{}}},beforeMount:function(){var t=this;"function"==typeof this.getProps$&&(this._subscription=this.getProps$(this.app).subscribe(function(e){t.setData("computedProps",e)}))},beforeDestroy:function(){this._subscription&&this._subscription.unsubscribe()}},t.exports=e.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),o=r(i),u=n(4),a=r(u);e.default={getInitialData:function(){return{list:[],listForRendering:[]}},sendProps:function(t,e){var n=t.get(t.options.providerNames.region);n&&n.emit(e)},beforeMount:function(){var t=this,e=this.app?this.app.getRootApp():window.app;if(e){this.rootApp=e;var n=e.getApps$(this.getProp("name"),this.getProp("uniqueKey"));this._subscription=n.subscribe({next:function(n){t.setDataWithCallback("list",n,function(){t.getData("list").forEach(function(n){var r=n.name,i=n.weight,o=n.multi;if(!t.getData("listForRendering").some(function(t){return t.name===r})){var u=t.getProp("uniqueKey")?[t.getProp("name"),t.getProp("uniqueKey")]:[t.getProp("name")];t.getProp("uniqueKey")&&!e.hasAppInstance.apply(e,[r].concat(u))&&e.instantiateApp.apply(e,[r].concat(u));var a=e.getAppInstance.apply(e,[r].concat(u));a&&t.sendProps(a,{name:t.getProp("name"),uniqueKey:t.getProp("uniqueKey"),data:t.getProp("data")}),t.setData("listForRendering",t.getData("listForRendering").concat({name:r,weight:i,instance:a,multi:o,Component:t.getMountableComponent(a)}).sort(function(t,e){return t.weight-e.weight}))}})})},error:function(e){console.warn('Subscription error for <Region name="'+t.name+'" />:',e)}})}},shouldUpdate:function(t,e){var n=!(0,o.default)(this.getProps(),t);if(!n){var r=e.listForRendering;n=n||this.getData("listForRendering").length!==r.length,n=n||(0,a.default)(this.getData("listForRendering"),r,function(t,e){return t.name===e.name}).some(function(t){return!t})}return n},afterUpdate:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=e||{},r=n.name,i=void 0===r?this.getProp("name"):r,o=n.uniqueKey,u=void 0===o?this.getProp("uniqueKey"):o,a=n.data,s=void 0===a?this.getProp("data"):a;this.getData("listForRendering").filter(function(t){return t.instance}).forEach(function(e){return t.sendProps(e.instance,{name:i,uniqueKey:u,data:s})})},beforeDestroy:function(){var t=this;this._subscription&&this._subscription.unsubscribe(),this.rootApp&&this.getData("listForRendering").filter(function(t){return t.multi}).forEach(function(e){t.rootApp.destroyApp(e.name,t.getProp("name"),t.getProp("uniqueKey"))})}},t.exports=e.default},function(t,e){!function(){t.exports=this[void 0]}()},function(t,e){!function(){t.exports=this[void 0]}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(6),u=n(7),a=function(){function t(){r(this,t),this.props$=new o.BehaviorSubject({})}return i(t,[{key:"emit",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.props$.next(t)}},{key:"getProps$",value:function(){return this.props$}},{key:"getData$",value:function(){var t;return(t=this.props$,u.map).call(t,function(t){return t.data})}}]),t}();e.default=a,t.exports=e.default},function(t,e){!function(){t.exports=this[void 0]}()},function(t,e){!function(){t.exports=this[void 0]}()}]); |
@@ -7,8 +7,14 @@ 'use strict'; | ||
var _lodash = require('lodash'); | ||
var _isEqual = require('lodash/isEqual'); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
var _isEqual2 = _interopRequireDefault(_isEqual); | ||
var _zipWith = require('lodash/zipWith'); | ||
var _zipWith2 = _interopRequireDefault(_zipWith); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/* global window */ | ||
/* eslint-disable no-console */ | ||
exports.default = { | ||
@@ -94,3 +100,3 @@ getInitialData: function getInitialData() { | ||
shouldUpdate: function shouldUpdate(nextProps, nextData) { | ||
var shouldUpdate = !_lodash2.default.isEqual(this.getProps(), nextProps); | ||
var shouldUpdate = !(0, _isEqual2.default)(this.getProps(), nextProps); | ||
@@ -101,3 +107,3 @@ if (!shouldUpdate) { | ||
shouldUpdate = shouldUpdate || this.getData('listForRendering').length !== listForRendering.length; | ||
shouldUpdate = shouldUpdate || _lodash2.default.zipWith(this.getData('listForRendering'), listForRendering, function (a, b) { | ||
shouldUpdate = shouldUpdate || (0, _zipWith2.default)(this.getData('listForRendering'), listForRendering, function (a, b) { | ||
return a.name === b.name; | ||
@@ -149,5 +155,3 @@ }).some(function (value) { | ||
} | ||
}; /* global window */ | ||
/* eslint-disable no-console */ | ||
}; | ||
module.exports = exports['default']; |
@@ -9,4 +9,6 @@ 'use strict'; | ||
var _rxjs = require('rxjs'); | ||
var _BehaviorSubject = require('rxjs/BehaviorSubject'); | ||
var _map = require('rxjs/operator/map'); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -18,3 +20,3 @@ | ||
this.props$ = new _rxjs.BehaviorSubject({}); | ||
this.props$ = new _BehaviorSubject.BehaviorSubject({}); | ||
} | ||
@@ -42,3 +44,5 @@ | ||
value: function getData$() { | ||
return this.props$.map(function (props) { | ||
var _context; | ||
return (_context = this.props$, _map.map).call(_context, function (props) { | ||
return props.data; | ||
@@ -45,0 +49,0 @@ }); |
{ | ||
"name": "frint-component-handlers", | ||
"version": "2.8.1", | ||
"version": "2.9.0-alpha.2d26e4d7", | ||
"description": "Component handlers package for Frint", | ||
@@ -36,4 +36,5 @@ "main": "lib/index.js", | ||
"cross-env": "^5.0.5", | ||
"frint": "^2.8.1", | ||
"frint-component-utils": "^2.8.1" | ||
"frint": "^2.9.0-alpha.2d26e4d7", | ||
"frint-component-utils": "^2.9.0-alpha.2d26e4d7", | ||
"frint-config": "^2.9.0-alpha.2d26e4d7" | ||
}, | ||
@@ -40,0 +41,0 @@ "bugs": { |
var webpack = require('webpack'); | ||
var externals = require('frint-config').externals; | ||
@@ -26,6 +27,6 @@ var minify = process.env.DIST_MIN; | ||
}, | ||
externals: { | ||
externals: Object.assign({}, { | ||
'lodash': '_', | ||
'rxjs': 'Rx', | ||
}, | ||
}, externals), | ||
target: 'web', | ||
@@ -32,0 +33,0 @@ plugins: plugins, |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
35162
783
4
1