web-component-wrapper 0.0.614 → 0.0.616
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ReactWeb.js +20 -20
- package/dist/Web.js +14 -23
- package/dist/bundle/ReactWeb.js +325 -305
- package/dist/bundle/Web.js +302 -291
- package/dist/bundle/compatible/ReactWeb.js +325 -305
- package/dist/bundle/compatible/Web.js +301 -287
- package/dist/bundle/compatible/decorator.js +289 -272
- package/dist/bundle/compatible/index.js +332 -320
- package/dist/bundle/decorator.js +289 -275
- package/dist/bundle/index.js +333 -325
- package/dist/compatible/ReactWeb.js +20 -20
- package/dist/compatible/Web.js +13 -19
- package/dist/compatible/decorator.js +3 -6
- package/dist/compatible/index.js +26 -34
- package/dist/decorator.js +3 -9
- package/dist/index.js +27 -39
- package/package.json +24 -24
- package/readme.md +23 -26
|
@@ -34,9 +34,9 @@ module.exports = x({ ["NullSymbol"]: function() { return __WEBPACK_EXTERNAL_MODU
|
|
|
34
34
|
// -*- coding: utf-8 -*-
|
|
35
35
|
/** @module decorator *//* !
|
|
36
36
|
region header
|
|
37
|
-
[Project page](https://
|
|
37
|
+
[Project page](https://tsickert.com/web-component-wrapper)
|
|
38
38
|
|
|
39
|
-
Copyright Torben Sickert (info["~at~"]
|
|
39
|
+
Copyright Torben Sickert (info["~at~"]tsickert.com) 16.12.2012
|
|
40
40
|
|
|
41
41
|
License
|
|
42
42
|
-------
|
|
@@ -46,7 +46,7 @@ module.exports = x({ ["NullSymbol"]: function() { return __WEBPACK_EXTERNAL_MODU
|
|
|
46
46
|
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
47
47
|
endregion
|
|
48
48
|
*/// region imports
|
|
49
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,
|
|
49
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var r;if("undefined"!=typeof Symbol&&void 0!==(r=t[Symbol.toPrimitive])){var i=r.call(t,e||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)};// endregion
|
|
50
50
|
/**
|
|
51
51
|
* Generates a decorator based on given configuration.
|
|
52
52
|
* @param options - Property configuration to define how to transfer attributes
|
|
@@ -78,14 +78,14 @@ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof
|
|
|
78
78
|
/* unused harmony import specifier */ var camelCaseToDelimited;
|
|
79
79
|
/* harmony import */ var clientnode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
80
80
|
/* harmony import */ var clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
|
81
|
-
/* harmony import */ var _decorator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);
|
|
81
|
+
/* harmony import */ var _decorator_js__WEBPACK_IMPORTED_MODULE_2__ = /*#__PURE__*/__webpack_require__(2);
|
|
82
82
|
// #!/usr/bin/env babel-node
|
|
83
83
|
// -*- coding: utf-8 -*-
|
|
84
84
|
/** @module web *//* !
|
|
85
85
|
region header
|
|
86
|
-
[Project page](https://
|
|
86
|
+
[Project page](https://tsickert.com/web-component-wrapper)
|
|
87
87
|
|
|
88
|
-
Copyright Torben Sickert (info["~at~"]
|
|
88
|
+
Copyright Torben Sickert (info["~at~"]tsickert.com) 16.12.2012
|
|
89
89
|
|
|
90
90
|
License
|
|
91
91
|
-------
|
|
@@ -95,7 +95,7 @@ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof
|
|
|
95
95
|
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
96
96
|
endregion
|
|
97
97
|
*/// region imports
|
|
98
|
-
var _dec,_class,_descriptor,_Web;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0))}if(o||r>1)return a;throw y=!0,n}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break}catch(t){i=e,c=1,u=t}finally{f=1}}return{value:t,done:y}}}(r,o,i),!0),u}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]"}),(_regenerator=function _regenerator(){return{w:i,m:f}})()}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e)})}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},_regeneratorDefine2(e,r,n,t)}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)})}}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a
|
|
98
|
+
var _dec,_class,_descriptor,_Web;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0))}if(o||r>1)return a;throw y=!0,n}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break}catch(t){i=e,c=1,u=t}finally{f=1}}return{value:t,done:y}}}(r,o,i),!0),u}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]"}),(_regenerator=function _regenerator(){return{w:i,m:f}})()}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e)})}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},_regeneratorDefine2(e,r,n,t)}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)})}}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a,u=!0;return{s:function s(){t=t.call(r)},n:function n(){u=!0;var r=t.next();return r.done?{done:!0}:{value:r.value,done:u=!1}},e:function e(r){o=!0,a=r},f:function f(){try{u||null==t.return||t.return()}finally{if(o)throw a}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _initializerDefineProperty(e,i,r,l){r&&Object.defineProperty(e,i,{enumerable:r.enumerable,configurable:r.configurable,writable:r.writable,value:r.initializer?r.initializer.call(l):void 0})}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _applyDecoratedDescriptor(i,e,r,n,l){var a={};return Object.keys(n).forEach(function(i){a[i]=n[i]}),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=r.slice().reverse().reduce(function(r,n){return n(i,e,r)||r},a),l&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(l):void 0,a.initializer=void 0),void 0===a.initializer?(Object.defineProperty(i,e,a),null):a}function _initializerWarningHelper(r,e){throw Error("Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var r;if("undefined"!=typeof Symbol&&void 0!==(r=t[Symbol.toPrimitive])){var i=r.call(t,e||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")};// endregion
|
|
99
99
|
var log=new clientnode__WEBPACK_IMPORTED_MODULE_0__.Logger({name:"web-component-wrapper.web"});/*
|
|
100
100
|
NOTE: We mock HTMLElement to be able to load this class and derived one
|
|
101
101
|
into node environments.
|
|
@@ -274,14 +274,14 @@ try{this.isConnected=false}catch(_unused2){// Ignore error.
|
|
|
274
274
|
* @param domNode - Node to start traversing from.
|
|
275
275
|
* @param scope - Scope to render property value again.
|
|
276
276
|
*/},{key:"applyBinding",value:function applyBinding(domNode,scope){var _this6=this;if(!domNode.getAttributeNames)return;var _iterator4=_createForOfIteratorHelper(domNode.getAttributeNames()),_step4;try{var _loop2=function _loop2(){var attributeName=_step4.value;var name;if(attributeName.startsWith("data-bind-"))name=attributeName.substring("data-bind-".length);else if(attributeName.startsWith("bind-"))name=attributeName.substring("bind-".length);if(name){var value=domNode.getAttribute(attributeName);if(value===null)return 0;// continue
|
|
277
|
-
if(name.startsWith("attribute-")||name.startsWith("property-")){var evaluated=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluate)(value,{scope:scope,binding:domNode});if(evaluated.error){log.warn("Error occurred during processing given","attribute binding \"".concat(attributeName,"\" on node:"),domNode,evaluated.error);return 0;// continue
|
|
277
|
+
if(name.startsWith("attribute-")||name.startsWith("property-")){var evaluated=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluate)(value,{scope:scope,binding:domNode});if(evaluated.error){void log.warn("Error occurred during processing given","attribute binding \"".concat(attributeName,"\" on node:"),domNode,evaluated.error);return 0;// continue
|
|
278
278
|
}if(name.startsWith("attribute-"))domNode.setAttribute(name.substring("attribute-".length),evaluated.result);else/*
|
|
279
279
|
NOTE: Cast to "textContent" to have a writable
|
|
280
280
|
property here.
|
|
281
281
|
*/domNode[(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.delimitedToCamelCase)(name.substring("property-".length))]=evaluated.result}else if(name.startsWith("on-")){name=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.delimitedToCamelCase)(name.substring("on-".length));scope=_objectSpread({log:log,event:undefined,parameters:undefined},scope);/*
|
|
282
282
|
NOTE: We pre-compile event listener since they should
|
|
283
283
|
usually be called more often than binded.
|
|
284
|
-
*/var compilation=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.compile)(value,{scope:scope,execute:true,binding:domNode});if(compilation.error)log.warn("Error occurred during compiling given event","binding \"".concat(attributeName,"\" on node:"),domNode,compilation.error);else _this6.addSecureEventListener(domNode,name,function(){for(var _len=arguments.length,parameters=new Array(_len),_key=0;_key<_len;_key++){parameters[_key]=arguments[_key]}scope.event=parameters[0];scope.parameters=parameters;try{compilation.templateFunction.apply(compilation,_toConsumableArray(compilation.originalScopeNames.map(function(name){return scope[name]})))}catch(error){log.warn("Error occurred during processing","given event binding","\"".concat(attributeName,"\" on node:"),domNode,"Given expression \"".concat(value,"\" could"),"not be evaluated with given scope","names \""+compilation.scopeNames.join("\", \"")+"\": ".concat((0,clientnode__WEBPACK_IMPORTED_MODULE_0__.represent)(error)))}})}}},_ret;for(_iterator4.s();!(_step4=_iterator4.n()).done;){_ret=_loop2();if(_ret===0)continue}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}/**
|
|
284
|
+
*/var compilation=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.compile)(value,{scope:scope,execute:true,binding:domNode});if(compilation.error)void log.warn("Error occurred during compiling given event","binding \"".concat(attributeName,"\" on node:"),domNode,compilation.error);else _this6.addSecureEventListener(domNode,name,function(){for(var _len=arguments.length,parameters=new Array(_len),_key=0;_key<_len;_key++){parameters[_key]=arguments[_key]}scope.event=parameters[0];scope.parameters=parameters;try{compilation.templateFunction.apply(compilation,_toConsumableArray(compilation.originalScopeNames.map(function(name){return scope[name]})))}catch(error){void log.warn("Error occurred during processing","given event binding","\"".concat(attributeName,"\" on node:"),domNode,"Given expression \"".concat(value,"\" could"),"not be evaluated with given scope","names \""+compilation.scopeNames.join("\", \"")+"\": ".concat((0,clientnode__WEBPACK_IMPORTED_MODULE_0__.represent)(error)))}})}}},_ret;for(_iterator4.s();!(_step4=_iterator4.n()).done;){_ret=_loop2();if(_ret===0)continue}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}/**
|
|
285
285
|
* Binds properties and event handler to given, sibling, and nested nodes.
|
|
286
286
|
* @param domNode - Node to start traversing from.
|
|
287
287
|
* @param scope - Scope to render property value again.
|
|
@@ -314,7 +314,7 @@ var currentDomNode=domNode.firstChild;while(currentDomNode){if(!options.filter||
|
|
|
314
314
|
* @param options - Evaluation options.
|
|
315
315
|
* @param scope - Scope to evaluate against.
|
|
316
316
|
* @returns Evaluated string result or null.
|
|
317
|
-
*/},{key:"evaluateCompiledDomNodeTemplate",value:function evaluateCompiledDomNodeTemplate(options,scope){var domNode=options.domNode,error=options.error,templateFunction=options.templateFunction,scopeNames=options.scopeNames;if(!(templateFunction&&scopeNames))return null;if(error){log.warn("Error occurred during compiling node content:",error);return null}var output=null;try{output=templateFunction.apply(void 0,_toConsumableArray(scopeNames.map(function(name){return scope[name]})))}catch(error){log.warn("Error occurred when \"".concat(this.self._name,"\" is running"),"\"".concat(String(templateFunction),"\": with bound"),"names \"".concat(scopeNames.join("\", \""),"\":"),"\"".concat(error,"\". Rendering node:"),domNode)}return output}/**
|
|
317
|
+
*/},{key:"evaluateCompiledDomNodeTemplate",value:function evaluateCompiledDomNodeTemplate(options,scope){var domNode=options.domNode,error=options.error,templateFunction=options.templateFunction,scopeNames=options.scopeNames;if(!(templateFunction&&scopeNames))return null;if(error){void log.warn("Error occurred during compiling node content:",error);return null}var output=null;try{output=templateFunction.apply(void 0,_toConsumableArray(scopeNames.map(function(name){return scope[name]})))}catch(error){void log.warn("Error occurred when \"".concat(this.self._name,"\" is running"),"\"".concat(String(templateFunction),"\": with bound"),"names \"".concat(scopeNames.join("\", \""),"\":"),"\"".concat(error,"\". Rendering node:"),domNode)}return output}/**
|
|
318
318
|
* Compiles and evaluates given node content and their children. Replaces
|
|
319
319
|
* each node content with their evaluated representation.
|
|
320
320
|
* @param domNode - Node to evaluate.
|
|
@@ -475,12 +475,12 @@ if(!handled&¶meters.length>0&&(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.isO
|
|
|
475
475
|
* and registers in a property mapping object.
|
|
476
476
|
* @param attributeName - Name of given value.
|
|
477
477
|
* @param value - Value to evaluate.
|
|
478
|
-
*/)},{key:"evaluateStringOrNullAndSetAsProperty",value:function evaluateStringOrNullAndSetAsProperty(attributeName,value){var _this11=this;var preEvaluate=attributeName.startsWith("-");var effectiveAttributeName=preEvaluate?attributeName.substring(1):attributeName;var name=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.delimitedToCamelCase)(effectiveAttributeName);var alias=this.getPropertyAlias(name);if(alias&&Object.prototype.hasOwnProperty.call(this.self.propertyTypes,alias))name=alias;if(Object.prototype.hasOwnProperty.call(this.self.propertyTypes,name)){var type=this.self.propertyTypes[name];if(preEvaluate){if(value){var result=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluate)(value,{scope:_objectSpread({},clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE),binding:this});if(result.error){log.warn("Failed to process pre-evaluation attribute","\"".concat(attributeName,"\": ").concat(result.error,". Will be"),"set to \"undefined\".");this.setInternalPropertyValue(name,undefined)}else{this.setInternalPropertyValue(name,result.result);this.setExternalPropertyValue(name,result.result)}}}else switch(type){case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.boolean:case"boolean":{var booleanValue=![null,"false"].includes(value);this.setInternalPropertyValue(name,booleanValue);this.setExternalPropertyValue(name,booleanValue);break}case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.func:case"function":{var error=null;var templateFunction;var scopeNames=["data","event","firstArgument","firstParameter","options"];if(value){var _result3=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.compile)(value,{scope:scopeNames.concat("parameters","scope",clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE_NAMES),execute:true,binding:this});error=_result3.error;templateFunction=_result3.templateFunction;if(error)log.warn("Failed to compile given handler","\"".concat(attributeName,"\": ").concat(error,"."))}this.setInternalPropertyValue(name,function(){for(var _len4=arguments.length,parameters=new Array(_len4),_key4=0;_key4<_len4;_key4++){parameters[_key4]=arguments[_key4]}if(_this11.outputEventNames.has(name))void _this11.reflectEventToProperties(name,parameters);var result=undefined;if(!error){var scope=_objectSpread({parameters:parameters},clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE);for(var _i8=0,_scopeNames=scopeNames;_i8<_scopeNames.length;_i8++){var _name4=_scopeNames[_i8];scope[_name4]=parameters[0]}try{var _templateFunction;result=(_templateFunction=templateFunction)===null||_templateFunction===void 0?void 0:_templateFunction.apply(void 0,_toConsumableArray(scopeNames.map(function(name){return scope[name]})).concat([parameters,scope],_toConsumableArray(clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE_NAMES.map(function(name){return clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE[name]}))))}catch(error){log.warn("Failed to evaluate function","\"".concat(attributeName,"\" with expression"),"\"".concat(value,"\" and scope"),"variables","\"".concat(scopeNames.join("\", \""),"\" set to"),"\"".concat((0,clientnode__WEBPACK_IMPORTED_MODULE_0__.represent)(parameters),"\":"),"".concat(error,". Set property"),"to \"undefined\".")}}if(!_this11.self.renderProperties.includes(name))_this11.forwardEvent(name,parameters);return result});if(!error)this.setExternalPropertyValue(name,templateFunction);break}case"json":{if(value){var evaluated;try{evaluated=JSON.parse(value)}catch(error){log.warn("Error occurred during parsing given json","attribute \"".concat(attributeName,"\":"),(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.represent)(error));break}// NOTE: That both values do have to be avoided.
|
|
478
|
+
*/)},{key:"evaluateStringOrNullAndSetAsProperty",value:function evaluateStringOrNullAndSetAsProperty(attributeName,value){var _this11=this;var preEvaluate=attributeName.startsWith("-");var effectiveAttributeName=preEvaluate?attributeName.substring(1):attributeName;var name=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.delimitedToCamelCase)(effectiveAttributeName);var alias=this.getPropertyAlias(name);if(alias&&Object.prototype.hasOwnProperty.call(this.self.propertyTypes,alias))name=alias;if(Object.prototype.hasOwnProperty.call(this.self.propertyTypes,name)){var type=this.self.propertyTypes[name];if(preEvaluate){if(value){var result=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluate)(value,{scope:_objectSpread({},clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE),binding:this});if(result.error){void log.warn("Failed to process pre-evaluation attribute","\"".concat(attributeName,"\": ").concat(result.error,". Will be"),"set to \"undefined\".");this.setInternalPropertyValue(name,undefined)}else{this.setInternalPropertyValue(name,result.result);this.setExternalPropertyValue(name,result.result)}}}else switch(type){case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.boolean:case"boolean":{var booleanValue=![null,"false"].includes(value);this.setInternalPropertyValue(name,booleanValue);this.setExternalPropertyValue(name,booleanValue);break}case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.func:case"function":{var error=null;var templateFunction;var scopeNames=["data","event","firstArgument","firstParameter","options"];if(value){var _result3=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.compile)(value,{scope:scopeNames.concat("parameters","scope",clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE_NAMES),execute:true,binding:this});error=_result3.error;templateFunction=_result3.templateFunction;if(error)void log.warn("Failed to compile given handler","\"".concat(attributeName,"\": ").concat(error,"."))}this.setInternalPropertyValue(name,function(){for(var _len4=arguments.length,parameters=new Array(_len4),_key4=0;_key4<_len4;_key4++){parameters[_key4]=arguments[_key4]}if(_this11.outputEventNames.has(name))void _this11.reflectEventToProperties(name,parameters);var result=undefined;if(!error){var scope=_objectSpread({parameters:parameters},clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE);for(var _i8=0,_scopeNames=scopeNames;_i8<_scopeNames.length;_i8++){var _name4=_scopeNames[_i8];scope[_name4]=parameters[0]}try{var _templateFunction;result=(_templateFunction=templateFunction)===null||_templateFunction===void 0?void 0:_templateFunction.apply(void 0,_toConsumableArray(scopeNames.map(function(name){return scope[name]})).concat([parameters,scope],_toConsumableArray(clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE_NAMES.map(function(name){return clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE[name]}))))}catch(error){void log.warn("Failed to evaluate function","\"".concat(attributeName,"\" with expression"),"\"".concat(value,"\" and scope"),"variables","\"".concat(scopeNames.join("\", \""),"\" set to"),"\"".concat((0,clientnode__WEBPACK_IMPORTED_MODULE_0__.represent)(parameters),"\":"),"".concat(error,". Set property"),"to \"undefined\".")}}if(!_this11.self.renderProperties.includes(name))_this11.forwardEvent(name,parameters);return result});if(!error)this.setExternalPropertyValue(name,templateFunction);break}case"json":{if(value){var evaluated;try{evaluated=JSON.parse(value)}catch(error){void log.warn("Error occurred during parsing given json","attribute \"".concat(attributeName,"\":"),(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.represent)(error));break}// NOTE: That both values do have to be avoided.
|
|
479
479
|
this.setInternalPropertyValue(name,evaluated);this.setExternalPropertyValue(name,(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.copy)(evaluated,false,1))}else{this.setInternalPropertyValue(name,null);this.setExternalPropertyValue(name,null)}break}case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.number:case"number":{if(value===null){this.setInternalPropertyValue(name,value);this.setExternalPropertyValue(name,value);break}/*
|
|
480
480
|
NOTE: You should not name this variable "number" since
|
|
481
481
|
babel gets confused caused by existing module wide
|
|
482
482
|
property type variable "number".
|
|
483
|
-
*/var numberValue=parseFloat(value);if(isNaN(numberValue))numberValue=undefined;this.setInternalPropertyValue(name,numberValue);this.setExternalPropertyValue(name,numberValue);break}case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.string:case"string":{this.setInternalPropertyValue(name,value);this.setExternalPropertyValue(name,value);break}case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.any:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.array:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.arrayOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.element:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.elementType:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.instanceOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.node:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.object:case"object":case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.objectOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.oneOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.oneOfType:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.shape:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.exact:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.symbol:default:{if(value){var _evaluated=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluate)(value,{binding:this});if(_evaluated.error){log.warn("Error occurred during processing given","attribute configuration \"".concat(attributeName,"\":"),_evaluated.error);break}// NOTE: That both values do have to be avoided.
|
|
483
|
+
*/var numberValue=parseFloat(value);if(isNaN(numberValue))numberValue=undefined;this.setInternalPropertyValue(name,numberValue);this.setExternalPropertyValue(name,numberValue);break}case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.string:case"string":{this.setInternalPropertyValue(name,value);this.setExternalPropertyValue(name,value);break}case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.any:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.array:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.arrayOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.element:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.elementType:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.instanceOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.node:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.object:case"object":case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.objectOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.oneOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.oneOfType:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.shape:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.exact:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.symbol:default:{if(value){var _evaluated=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluate)(value,{binding:this});if(_evaluated.error){void log.warn("Error occurred during processing given","attribute configuration \"".concat(attributeName,"\":"),_evaluated.error);break}// NOTE: That both values do have to be avoided.
|
|
484
484
|
this.setInternalPropertyValue(name,_evaluated.result);this.setExternalPropertyValue(name,(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.copy)(_evaluated.result,false,1))}else if(this.hasAttribute(attributeName)){this.setInternalPropertyValue(name,true);this.setExternalPropertyValue(name,true)}else{this.setInternalPropertyValue(name,null);this.setExternalPropertyValue(name,null)}break}}}}/// endregion
|
|
485
485
|
/// region render
|
|
486
486
|
/**
|
|
@@ -518,7 +518,7 @@ this.setInternalPropertyValue(name,_evaluated.result);this.setExternalPropertyVa
|
|
|
518
518
|
* rendering process by their own.
|
|
519
519
|
* @returns A promise resolving when rendering has been finished. A promise
|
|
520
520
|
* may be needed for classes inheriting from this class.
|
|
521
|
-
*/},{key:"render",value:(function(){var _render=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(reason,resolveRendering){var _this14=this;var evaluated,renderTargetDomNode;return _regenerator().w(function(_context5){while(1)switch(_context5.n){case 0:if(reason===void 0){reason="unknown"}if(resolveRendering===void 0){resolveRendering=true}this.unRender("reRender",reason);this.childComponentInstances=[];this.renderState.pending=true;if(!this.isRoot){_context5.n=3;break}_context5.n=1;return this.resolveRenderingPromiseIfSet(reason,resolveRendering);case 1:if(!resolveRendering){_context5.n=3;break}_context5.n=2;return Promise.all(this.self.pendingRenderPromises);case 2:this.self.pendingRenderPromises=[];case 3:this.self.pendingRenderPromises.push(this.renderState.promise);this.determineRenderScope();if(this.self.doRender&&this.dispatchEvent(new CustomEvent("render",{detail:{reason:reason,scope:this.scope}}))){_context5.n=5;break}_context5.n=4;return this.resolveRenderingPromiseIfSet(reason,resolveRendering);case 4:return _context5.a(2);case 5:evaluated=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluate)("`".concat(this.self.content,"`"),{scope:this.scope});if(!evaluated.error){_context5.n=7;break}log.warn("Failed to process template: ".concat(evaluated.error));this.renderState.resolve(reason);_context5.n=6;return Promise.all(this.self.pendingRenderPromises);case 6:return _context5.a(2);case 7:this.applyShadowRootIfNotExisting();/*
|
|
521
|
+
*/},{key:"render",value:(function(){var _render=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(reason,resolveRendering){var _this14=this;var evaluated,renderTargetDomNode;return _regenerator().w(function(_context5){while(1)switch(_context5.n){case 0:if(reason===void 0){reason="unknown"}if(resolveRendering===void 0){resolveRendering=true}this.unRender("reRender",reason);this.childComponentInstances=[];this.renderState.pending=true;if(!this.isRoot){_context5.n=3;break}_context5.n=1;return this.resolveRenderingPromiseIfSet(reason,resolveRendering);case 1:if(!resolveRendering){_context5.n=3;break}_context5.n=2;return Promise.all(this.self.pendingRenderPromises);case 2:this.self.pendingRenderPromises=[];case 3:this.self.pendingRenderPromises.push(this.renderState.promise);this.determineRenderScope();if(this.self.doRender&&this.dispatchEvent(new CustomEvent("render",{detail:{reason:reason,scope:this.scope}}))){_context5.n=5;break}_context5.n=4;return this.resolveRenderingPromiseIfSet(reason,resolveRendering);case 4:return _context5.a(2);case 5:evaluated=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluate)("`".concat(this.self.content,"`"),{scope:this.scope});if(!evaluated.error){_context5.n=7;break}void log.warn("Failed to process template: ".concat(evaluated.error));this.renderState.resolve(reason);_context5.n=6;return Promise.all(this.self.pendingRenderPromises);case 6:return _context5.a(2);case 7:this.applyShadowRootIfNotExisting();/*
|
|
522
522
|
NOTE: We first render into an intermediate render target and apply
|
|
523
523
|
slot content until we finally publish everything to the document.
|
|
524
524
|
This avoids painting twice and internetexplorer bugs with an empty
|
|
@@ -593,15 +593,15 @@ var property_types_ = __webpack_require__(1);
|
|
|
593
593
|
;// external "react-dom/client"
|
|
594
594
|
|
|
595
595
|
// EXTERNAL MODULE: ./src/Web.ts
|
|
596
|
-
var Web = __webpack_require__(3);
|
|
596
|
+
var Web = /*#__PURE__*/__webpack_require__(3);
|
|
597
597
|
;// ./src/ReactWeb.ts
|
|
598
598
|
// #!/usr/bin/env babel-node
|
|
599
599
|
// -*- coding: utf-8 -*-
|
|
600
600
|
/** @module react *//* !
|
|
601
601
|
region header
|
|
602
|
-
[Project page](https://
|
|
602
|
+
[Project page](https://tsickert.com/web-component-wrapper)
|
|
603
603
|
|
|
604
|
-
Copyright Torben Sickert (info["~at~"]
|
|
604
|
+
Copyright Torben Sickert (info["~at~"]tsickert.com) 16.12.2012
|
|
605
605
|
|
|
606
606
|
License
|
|
607
607
|
-------
|
|
@@ -611,7 +611,7 @@ var Web = __webpack_require__(3);
|
|
|
611
611
|
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
612
612
|
endregion
|
|
613
613
|
*/// region imports
|
|
614
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a
|
|
614
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a,u=!0;return{s:function s(){t=t.call(r)},n:function n(){u=!0;var r=t.next();return r.done?{done:!0}:{value:r.value,done:u=!1}},e:function e(r){o=!0,a=r},f:function f(){try{u||null==t.return||t.return()}finally{if(o)throw a}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0))}if(o||r>1)return a;throw y=!0,n}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break}catch(t){i=e,c=1,u=t}finally{f=1}}return{value:t,done:y}}}(r,o,i),!0),u}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]"}),(_regenerator=function _regenerator(){return{w:i,m:f}})()}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e)})}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},_regeneratorDefine2(e,r,n,t)}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)})}}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var r;if("undefined"!=typeof Symbol&&void 0!==(r=t[Symbol.toPrimitive])){var i=r.call(t,e||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)};// endregion
|
|
615
615
|
var log=new external_clientnode_.Logger({name:"web-component-wrapper.react-web"});/*
|
|
616
616
|
Live cycle:
|
|
617
617
|
|
|
@@ -737,12 +737,12 @@ domNode.determineRenderScope();if(Object.keys(this.compiledSlots).length===0)dom
|
|
|
737
737
|
*/if(key&&!Object.prototype.hasOwnProperty.call(staticProperties,"key"))staticProperties.key=key;target=domNode.constructor.content}else{staticProperties.key=key;target=domNode.tagName.toLowerCase()}/// endregion
|
|
738
738
|
/// region pre-compile dynamic properties
|
|
739
739
|
var knownScopeNames=Object.keys(scope);var compiledProperties={};var _iterator3=_createForOfIteratorHelper(domNode.getAttributeNames()),_step3;try{var _loop=function _loop(){var _value3;var attributeName=_step3.value;var _value2=domNode.getAttribute(attributeName);if(_value2===null)return 0;// continue
|
|
740
|
-
var extend=false;var name="";if(attributeName.startsWith("data-bind-"))name=attributeName.substring("data-bind-".length);else if(attributeName.startsWith("bind-"))name=attributeName.substring("bind-".length);if(name.startsWith("attribute-")||name==="attributes"||name.startsWith("property-")||name==="properties"){var _compile=(0,external_clientnode_.compile)(_value2,{scope:knownScopeNames}),error=_compile.error,originalScopeNames=_compile.originalScopeNames,templateFunction=_compile.templateFunction;if(error){log.warn("Error occurred during compiling given attribute","binding \"".concat(attributeName,"\" on node:"),domNode,error);return 0;// continue
|
|
740
|
+
var extend=false;var name="";if(attributeName.startsWith("data-bind-"))name=attributeName.substring("data-bind-".length);else if(attributeName.startsWith("bind-"))name=attributeName.substring("bind-".length);if(name.startsWith("attribute-")||name==="attributes"||name.startsWith("property-")||name==="properties"){var _compile=(0,external_clientnode_.compile)(_value2,{scope:knownScopeNames}),error=_compile.error,originalScopeNames=_compile.originalScopeNames,templateFunction=_compile.templateFunction;if(error){void log.warn("Error occurred during compiling given attribute","binding \"".concat(attributeName,"\" on node:"),domNode,error);return 0;// continue
|
|
741
741
|
}if(name==="attributes"||name==="properties")extend=true;else name=name.startsWith("attribute-")?name.substring("attribute-".length):name.substring("property-".length);_value2={originalScopeNames:originalScopeNames,templateFunction:templateFunction.bind(_this3)}}else if(name.startsWith("on-")){name=(0,external_clientnode_.delimitedToCamelCase)(name);if(!Object.prototype.hasOwnProperty.call(scope,"event"))knownScopeNames=[].concat(_toConsumableArray(knownScopeNames),["event"]);if(!Object.prototype.hasOwnProperty.call(scope,"parameters"))knownScopeNames=[].concat(_toConsumableArray(knownScopeNames),["parameters"]);/*
|
|
742
742
|
NOTE: We pre-compile event listener since they should
|
|
743
743
|
usually be called more than it would be re-rendered.
|
|
744
|
-
*/var _compile2=(0,external_clientnode_.compile)(_value2,{scope:knownScopeNames,execute:true}),_error=_compile2.error,_originalScopeNames=_compile2.originalScopeNames,scopeNames=_compile2.scopeNames,_templateFunction=_compile2.templateFunction;if(_error){log.warn("Error occurred during compiling given event","binding \"".concat(attributeName,"\" on node:"),domNode,_error);return 0;// continue
|
|
745
|
-
}var eventHandler=_templateFunction.bind(_this3);_value2=function value(){for(var _len3=arguments.length,parameters=new Array(_len3),_key3=0;_key3<_len3;_key3++){parameters[_key3]=arguments[_key3]}scope.event=parameters[0];scope.parameters=parameters;try{eventHandler.apply(void 0,_toConsumableArray(_originalScopeNames.map(function(name){return scope[name]})))}catch(error){log.warn("Error occurred during processing given","event binding \"".concat(attributeName,"\" on node: "),domNode,"Given expression \"".concat(_value2,"\" could"),"not be evaluated with given scope names","\"".concat(scopeNames.join("\", \""),"\":"),(0,external_clientnode_.represent)(error))}}}else name=attributeName;var mapping={class:"className",for:"htmlFor"};if(Object.prototype.hasOwnProperty.call(mapping,name))name=mapping[name];name=(0,external_clientnode_.delimitedToCamelCase)(name);if((_value3=_value2)!==null&&_value3!==void 0&&_value3.originalScopeNames)// NOTE: "''" marks a property set like in JSX "{...props}".
|
|
744
|
+
*/var _compile2=(0,external_clientnode_.compile)(_value2,{scope:knownScopeNames,execute:true}),_error=_compile2.error,_originalScopeNames=_compile2.originalScopeNames,scopeNames=_compile2.scopeNames,_templateFunction=_compile2.templateFunction;if(_error){void log.warn("Error occurred during compiling given event","binding \"".concat(attributeName,"\" on node:"),domNode,_error);return 0;// continue
|
|
745
|
+
}var eventHandler=_templateFunction.bind(_this3);_value2=function value(){for(var _len3=arguments.length,parameters=new Array(_len3),_key3=0;_key3<_len3;_key3++){parameters[_key3]=arguments[_key3]}scope.event=parameters[0];scope.parameters=parameters;try{eventHandler.apply(void 0,_toConsumableArray(_originalScopeNames.map(function(name){return scope[name]})))}catch(error){void log.warn("Error occurred during processing given","event binding \"".concat(attributeName,"\" on node: "),domNode,"Given expression \"".concat(_value2,"\" could"),"not be evaluated with given scope names","\"".concat(scopeNames.join("\", \""),"\":"),(0,external_clientnode_.represent)(error))}}}else name=attributeName;var mapping={class:"className",for:"htmlFor"};if(Object.prototype.hasOwnProperty.call(mapping,name))name=mapping[name];name=(0,external_clientnode_.delimitedToCamelCase)(name);if((_value3=_value2)!==null&&_value3!==void 0&&_value3.originalScopeNames)// NOTE: "''" marks a property set like in JSX "{...props}".
|
|
746
746
|
compiledProperties[extend?"":name]=_value2;else if(!isComponent)/*
|
|
747
747
|
NOTE: Properties of components are evaluated already by
|
|
748
748
|
them self and set as "internalProperties". Those
|
package/dist/compatible/Web.js
CHANGED
|
@@ -31,9 +31,9 @@ module.exports = x({ ["any"]: function() { return __WEBPACK_EXTERNAL_MODULE_clie
|
|
|
31
31
|
// -*- coding: utf-8 -*-
|
|
32
32
|
/** @module decorator *//* !
|
|
33
33
|
region header
|
|
34
|
-
[Project page](https://
|
|
34
|
+
[Project page](https://tsickert.com/web-component-wrapper)
|
|
35
35
|
|
|
36
|
-
Copyright Torben Sickert (info["~at~"]
|
|
36
|
+
Copyright Torben Sickert (info["~at~"]tsickert.com) 16.12.2012
|
|
37
37
|
|
|
38
38
|
License
|
|
39
39
|
-------
|
|
@@ -43,7 +43,7 @@ module.exports = x({ ["any"]: function() { return __WEBPACK_EXTERNAL_MODULE_clie
|
|
|
43
43
|
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
44
44
|
endregion
|
|
45
45
|
*/// region imports
|
|
46
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,
|
|
46
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var r;if("undefined"!=typeof Symbol&&void 0!==(r=t[Symbol.toPrimitive])){var i=r.call(t,e||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)};// endregion
|
|
47
47
|
/**
|
|
48
48
|
* Generates a decorator based on given configuration.
|
|
49
49
|
* @param options - Property configuration to define how to transfer attributes
|
|
@@ -110,22 +110,16 @@ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof
|
|
|
110
110
|
/******/
|
|
111
111
|
/************************************************************************/
|
|
112
112
|
var __webpack_exports__ = {};
|
|
113
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
114
|
-
/* harmony export */ FH: function() { return /* binding */ api; },
|
|
115
|
-
/* harmony export */ Hh: function() { return /* binding */ GenericHTMLElement; },
|
|
116
|
-
/* harmony export */ Nc: function() { return /* binding */ Web; },
|
|
117
|
-
/* harmony export */ Rm: function() { return /* binding */ log; }
|
|
118
|
-
/* harmony export */ });
|
|
119
113
|
/* harmony import */ var clientnode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
120
114
|
/* harmony import */ var clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
|
121
|
-
/* harmony import */ var _decorator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);
|
|
115
|
+
/* harmony import */ var _decorator_js__WEBPACK_IMPORTED_MODULE_2__ = /*#__PURE__*/__webpack_require__(2);
|
|
122
116
|
// #!/usr/bin/env babel-node
|
|
123
117
|
// -*- coding: utf-8 -*-
|
|
124
118
|
/** @module web *//* !
|
|
125
119
|
region header
|
|
126
|
-
[Project page](https://
|
|
120
|
+
[Project page](https://tsickert.com/web-component-wrapper)
|
|
127
121
|
|
|
128
|
-
Copyright Torben Sickert (info["~at~"]
|
|
122
|
+
Copyright Torben Sickert (info["~at~"]tsickert.com) 16.12.2012
|
|
129
123
|
|
|
130
124
|
License
|
|
131
125
|
-------
|
|
@@ -135,7 +129,7 @@ var __webpack_exports__ = {};
|
|
|
135
129
|
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
136
130
|
endregion
|
|
137
131
|
*/// region imports
|
|
138
|
-
var _dec,_class,_descriptor,_Web;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0))}if(o||r>1)return a;throw y=!0,n}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break}catch(t){i=e,c=1,u=t}finally{f=1}}return{value:t,done:y}}}(r,o,i),!0),u}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]"}),(_regenerator=function _regenerator(){return{w:i,m:f}})()}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e)})}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},_regeneratorDefine2(e,r,n,t)}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)})}}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a
|
|
132
|
+
var _dec,_class,_descriptor,_Web;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0))}if(o||r>1)return a;throw y=!0,n}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break}catch(t){i=e,c=1,u=t}finally{f=1}}return{value:t,done:y}}}(r,o,i),!0),u}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]"}),(_regenerator=function _regenerator(){return{w:i,m:f}})()}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e)})}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},_regeneratorDefine2(e,r,n,t)}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)})}}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a,u=!0;return{s:function s(){t=t.call(r)},n:function n(){u=!0;var r=t.next();return r.done?{done:!0}:{value:r.value,done:u=!1}},e:function e(r){o=!0,a=r},f:function f(){try{u||null==t.return||t.return()}finally{if(o)throw a}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _initializerDefineProperty(e,i,r,l){r&&Object.defineProperty(e,i,{enumerable:r.enumerable,configurable:r.configurable,writable:r.writable,value:r.initializer?r.initializer.call(l):void 0})}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _applyDecoratedDescriptor(i,e,r,n,l){var a={};return Object.keys(n).forEach(function(i){a[i]=n[i]}),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=r.slice().reverse().reduce(function(r,n){return n(i,e,r)||r},a),l&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(l):void 0,a.initializer=void 0),void 0===a.initializer?(Object.defineProperty(i,e,a),null):a}function _initializerWarningHelper(r,e){throw Error("Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var r;if("undefined"!=typeof Symbol&&void 0!==(r=t[Symbol.toPrimitive])){var i=r.call(t,e||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")};// endregion
|
|
139
133
|
var log=new clientnode__WEBPACK_IMPORTED_MODULE_0__.Logger({name:"web-component-wrapper.web"});/*
|
|
140
134
|
NOTE: We mock HTMLElement to be able to load this class and derived one
|
|
141
135
|
into node environments.
|
|
@@ -314,14 +308,14 @@ try{this.isConnected=false}catch(_unused2){// Ignore error.
|
|
|
314
308
|
* @param domNode - Node to start traversing from.
|
|
315
309
|
* @param scope - Scope to render property value again.
|
|
316
310
|
*/},{key:"applyBinding",value:function applyBinding(domNode,scope){var _this6=this;if(!domNode.getAttributeNames)return;var _iterator4=_createForOfIteratorHelper(domNode.getAttributeNames()),_step4;try{var _loop2=function _loop2(){var attributeName=_step4.value;var name;if(attributeName.startsWith("data-bind-"))name=attributeName.substring("data-bind-".length);else if(attributeName.startsWith("bind-"))name=attributeName.substring("bind-".length);if(name){var value=domNode.getAttribute(attributeName);if(value===null)return 0;// continue
|
|
317
|
-
if(name.startsWith("attribute-")||name.startsWith("property-")){var evaluated=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluate)(value,{scope:scope,binding:domNode});if(evaluated.error){log.warn("Error occurred during processing given","attribute binding \"".concat(attributeName,"\" on node:"),domNode,evaluated.error);return 0;// continue
|
|
311
|
+
if(name.startsWith("attribute-")||name.startsWith("property-")){var evaluated=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluate)(value,{scope:scope,binding:domNode});if(evaluated.error){void log.warn("Error occurred during processing given","attribute binding \"".concat(attributeName,"\" on node:"),domNode,evaluated.error);return 0;// continue
|
|
318
312
|
}if(name.startsWith("attribute-"))domNode.setAttribute(name.substring("attribute-".length),evaluated.result);else/*
|
|
319
313
|
NOTE: Cast to "textContent" to have a writable
|
|
320
314
|
property here.
|
|
321
315
|
*/domNode[(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.delimitedToCamelCase)(name.substring("property-".length))]=evaluated.result}else if(name.startsWith("on-")){name=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.delimitedToCamelCase)(name.substring("on-".length));scope=_objectSpread({log:log,event:undefined,parameters:undefined},scope);/*
|
|
322
316
|
NOTE: We pre-compile event listener since they should
|
|
323
317
|
usually be called more often than binded.
|
|
324
|
-
*/var compilation=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.compile)(value,{scope:scope,execute:true,binding:domNode});if(compilation.error)log.warn("Error occurred during compiling given event","binding \"".concat(attributeName,"\" on node:"),domNode,compilation.error);else _this6.addSecureEventListener(domNode,name,function(){for(var _len=arguments.length,parameters=new Array(_len),_key=0;_key<_len;_key++){parameters[_key]=arguments[_key]}scope.event=parameters[0];scope.parameters=parameters;try{compilation.templateFunction.apply(compilation,_toConsumableArray(compilation.originalScopeNames.map(function(name){return scope[name]})))}catch(error){log.warn("Error occurred during processing","given event binding","\"".concat(attributeName,"\" on node:"),domNode,"Given expression \"".concat(value,"\" could"),"not be evaluated with given scope","names \""+compilation.scopeNames.join("\", \"")+"\": ".concat((0,clientnode__WEBPACK_IMPORTED_MODULE_0__.represent)(error)))}})}}},_ret;for(_iterator4.s();!(_step4=_iterator4.n()).done;){_ret=_loop2();if(_ret===0)continue}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}/**
|
|
318
|
+
*/var compilation=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.compile)(value,{scope:scope,execute:true,binding:domNode});if(compilation.error)void log.warn("Error occurred during compiling given event","binding \"".concat(attributeName,"\" on node:"),domNode,compilation.error);else _this6.addSecureEventListener(domNode,name,function(){for(var _len=arguments.length,parameters=new Array(_len),_key=0;_key<_len;_key++){parameters[_key]=arguments[_key]}scope.event=parameters[0];scope.parameters=parameters;try{compilation.templateFunction.apply(compilation,_toConsumableArray(compilation.originalScopeNames.map(function(name){return scope[name]})))}catch(error){void log.warn("Error occurred during processing","given event binding","\"".concat(attributeName,"\" on node:"),domNode,"Given expression \"".concat(value,"\" could"),"not be evaluated with given scope","names \""+compilation.scopeNames.join("\", \"")+"\": ".concat((0,clientnode__WEBPACK_IMPORTED_MODULE_0__.represent)(error)))}})}}},_ret;for(_iterator4.s();!(_step4=_iterator4.n()).done;){_ret=_loop2();if(_ret===0)continue}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}/**
|
|
325
319
|
* Binds properties and event handler to given, sibling, and nested nodes.
|
|
326
320
|
* @param domNode - Node to start traversing from.
|
|
327
321
|
* @param scope - Scope to render property value again.
|
|
@@ -354,7 +348,7 @@ var currentDomNode=domNode.firstChild;while(currentDomNode){if(!options.filter||
|
|
|
354
348
|
* @param options - Evaluation options.
|
|
355
349
|
* @param scope - Scope to evaluate against.
|
|
356
350
|
* @returns Evaluated string result or null.
|
|
357
|
-
*/},{key:"evaluateCompiledDomNodeTemplate",value:function evaluateCompiledDomNodeTemplate(options,scope){var domNode=options.domNode,error=options.error,templateFunction=options.templateFunction,scopeNames=options.scopeNames;if(!(templateFunction&&scopeNames))return null;if(error){log.warn("Error occurred during compiling node content:",error);return null}var output=null;try{output=templateFunction.apply(void 0,_toConsumableArray(scopeNames.map(function(name){return scope[name]})))}catch(error){log.warn("Error occurred when \"".concat(this.self._name,"\" is running"),"\"".concat(String(templateFunction),"\": with bound"),"names \"".concat(scopeNames.join("\", \""),"\":"),"\"".concat(error,"\". Rendering node:"),domNode)}return output}/**
|
|
351
|
+
*/},{key:"evaluateCompiledDomNodeTemplate",value:function evaluateCompiledDomNodeTemplate(options,scope){var domNode=options.domNode,error=options.error,templateFunction=options.templateFunction,scopeNames=options.scopeNames;if(!(templateFunction&&scopeNames))return null;if(error){void log.warn("Error occurred during compiling node content:",error);return null}var output=null;try{output=templateFunction.apply(void 0,_toConsumableArray(scopeNames.map(function(name){return scope[name]})))}catch(error){void log.warn("Error occurred when \"".concat(this.self._name,"\" is running"),"\"".concat(String(templateFunction),"\": with bound"),"names \"".concat(scopeNames.join("\", \""),"\":"),"\"".concat(error,"\". Rendering node:"),domNode)}return output}/**
|
|
358
352
|
* Compiles and evaluates given node content and their children. Replaces
|
|
359
353
|
* each node content with their evaluated representation.
|
|
360
354
|
* @param domNode - Node to evaluate.
|
|
@@ -515,12 +509,12 @@ if(!handled&¶meters.length>0&&(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.isO
|
|
|
515
509
|
* and registers in a property mapping object.
|
|
516
510
|
* @param attributeName - Name of given value.
|
|
517
511
|
* @param value - Value to evaluate.
|
|
518
|
-
*/)},{key:"evaluateStringOrNullAndSetAsProperty",value:function evaluateStringOrNullAndSetAsProperty(attributeName,value){var _this11=this;var preEvaluate=attributeName.startsWith("-");var effectiveAttributeName=preEvaluate?attributeName.substring(1):attributeName;var name=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.delimitedToCamelCase)(effectiveAttributeName);var alias=this.getPropertyAlias(name);if(alias&&Object.prototype.hasOwnProperty.call(this.self.propertyTypes,alias))name=alias;if(Object.prototype.hasOwnProperty.call(this.self.propertyTypes,name)){var type=this.self.propertyTypes[name];if(preEvaluate){if(value){var result=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluate)(value,{scope:_objectSpread({},clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE),binding:this});if(result.error){log.warn("Failed to process pre-evaluation attribute","\"".concat(attributeName,"\": ").concat(result.error,". Will be"),"set to \"undefined\".");this.setInternalPropertyValue(name,undefined)}else{this.setInternalPropertyValue(name,result.result);this.setExternalPropertyValue(name,result.result)}}}else switch(type){case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.boolean:case"boolean":{var booleanValue=![null,"false"].includes(value);this.setInternalPropertyValue(name,booleanValue);this.setExternalPropertyValue(name,booleanValue);break}case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.func:case"function":{var error=null;var templateFunction;var scopeNames=["data","event","firstArgument","firstParameter","options"];if(value){var _result3=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.compile)(value,{scope:scopeNames.concat("parameters","scope",clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE_NAMES),execute:true,binding:this});error=_result3.error;templateFunction=_result3.templateFunction;if(error)log.warn("Failed to compile given handler","\"".concat(attributeName,"\": ").concat(error,"."))}this.setInternalPropertyValue(name,function(){for(var _len4=arguments.length,parameters=new Array(_len4),_key4=0;_key4<_len4;_key4++){parameters[_key4]=arguments[_key4]}if(_this11.outputEventNames.has(name))void _this11.reflectEventToProperties(name,parameters);var result=undefined;if(!error){var scope=_objectSpread({parameters:parameters},clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE);for(var _i8=0,_scopeNames=scopeNames;_i8<_scopeNames.length;_i8++){var _name4=_scopeNames[_i8];scope[_name4]=parameters[0]}try{var _templateFunction;result=(_templateFunction=templateFunction)===null||_templateFunction===void 0?void 0:_templateFunction.apply(void 0,_toConsumableArray(scopeNames.map(function(name){return scope[name]})).concat([parameters,scope],_toConsumableArray(clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE_NAMES.map(function(name){return clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE[name]}))))}catch(error){log.warn("Failed to evaluate function","\"".concat(attributeName,"\" with expression"),"\"".concat(value,"\" and scope"),"variables","\"".concat(scopeNames.join("\", \""),"\" set to"),"\"".concat((0,clientnode__WEBPACK_IMPORTED_MODULE_0__.represent)(parameters),"\":"),"".concat(error,". Set property"),"to \"undefined\".")}}if(!_this11.self.renderProperties.includes(name))_this11.forwardEvent(name,parameters);return result});if(!error)this.setExternalPropertyValue(name,templateFunction);break}case"json":{if(value){var evaluated;try{evaluated=JSON.parse(value)}catch(error){log.warn("Error occurred during parsing given json","attribute \"".concat(attributeName,"\":"),(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.represent)(error));break}// NOTE: That both values do have to be avoided.
|
|
512
|
+
*/)},{key:"evaluateStringOrNullAndSetAsProperty",value:function evaluateStringOrNullAndSetAsProperty(attributeName,value){var _this11=this;var preEvaluate=attributeName.startsWith("-");var effectiveAttributeName=preEvaluate?attributeName.substring(1):attributeName;var name=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.delimitedToCamelCase)(effectiveAttributeName);var alias=this.getPropertyAlias(name);if(alias&&Object.prototype.hasOwnProperty.call(this.self.propertyTypes,alias))name=alias;if(Object.prototype.hasOwnProperty.call(this.self.propertyTypes,name)){var type=this.self.propertyTypes[name];if(preEvaluate){if(value){var result=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluate)(value,{scope:_objectSpread({},clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE),binding:this});if(result.error){void log.warn("Failed to process pre-evaluation attribute","\"".concat(attributeName,"\": ").concat(result.error,". Will be"),"set to \"undefined\".");this.setInternalPropertyValue(name,undefined)}else{this.setInternalPropertyValue(name,result.result);this.setExternalPropertyValue(name,result.result)}}}else switch(type){case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.boolean:case"boolean":{var booleanValue=![null,"false"].includes(value);this.setInternalPropertyValue(name,booleanValue);this.setExternalPropertyValue(name,booleanValue);break}case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.func:case"function":{var error=null;var templateFunction;var scopeNames=["data","event","firstArgument","firstParameter","options"];if(value){var _result3=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.compile)(value,{scope:scopeNames.concat("parameters","scope",clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE_NAMES),execute:true,binding:this});error=_result3.error;templateFunction=_result3.templateFunction;if(error)void log.warn("Failed to compile given handler","\"".concat(attributeName,"\": ").concat(error,"."))}this.setInternalPropertyValue(name,function(){for(var _len4=arguments.length,parameters=new Array(_len4),_key4=0;_key4<_len4;_key4++){parameters[_key4]=arguments[_key4]}if(_this11.outputEventNames.has(name))void _this11.reflectEventToProperties(name,parameters);var result=undefined;if(!error){var scope=_objectSpread({parameters:parameters},clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE);for(var _i8=0,_scopeNames=scopeNames;_i8<_scopeNames.length;_i8++){var _name4=_scopeNames[_i8];scope[_name4]=parameters[0]}try{var _templateFunction;result=(_templateFunction=templateFunction)===null||_templateFunction===void 0?void 0:_templateFunction.apply(void 0,_toConsumableArray(scopeNames.map(function(name){return scope[name]})).concat([parameters,scope],_toConsumableArray(clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE_NAMES.map(function(name){return clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE[name]}))))}catch(error){void log.warn("Failed to evaluate function","\"".concat(attributeName,"\" with expression"),"\"".concat(value,"\" and scope"),"variables","\"".concat(scopeNames.join("\", \""),"\" set to"),"\"".concat((0,clientnode__WEBPACK_IMPORTED_MODULE_0__.represent)(parameters),"\":"),"".concat(error,". Set property"),"to \"undefined\".")}}if(!_this11.self.renderProperties.includes(name))_this11.forwardEvent(name,parameters);return result});if(!error)this.setExternalPropertyValue(name,templateFunction);break}case"json":{if(value){var evaluated;try{evaluated=JSON.parse(value)}catch(error){void log.warn("Error occurred during parsing given json","attribute \"".concat(attributeName,"\":"),(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.represent)(error));break}// NOTE: That both values do have to be avoided.
|
|
519
513
|
this.setInternalPropertyValue(name,evaluated);this.setExternalPropertyValue(name,(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.copy)(evaluated,false,1))}else{this.setInternalPropertyValue(name,null);this.setExternalPropertyValue(name,null)}break}case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.number:case"number":{if(value===null){this.setInternalPropertyValue(name,value);this.setExternalPropertyValue(name,value);break}/*
|
|
520
514
|
NOTE: You should not name this variable "number" since
|
|
521
515
|
babel gets confused caused by existing module wide
|
|
522
516
|
property type variable "number".
|
|
523
|
-
*/var numberValue=parseFloat(value);if(isNaN(numberValue))numberValue=undefined;this.setInternalPropertyValue(name,numberValue);this.setExternalPropertyValue(name,numberValue);break}case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.string:case"string":{this.setInternalPropertyValue(name,value);this.setExternalPropertyValue(name,value);break}case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.any:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.array:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.arrayOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.element:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.elementType:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.instanceOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.node:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.object:case"object":case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.objectOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.oneOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.oneOfType:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.shape:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.exact:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.symbol:default:{if(value){var _evaluated=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluate)(value,{binding:this});if(_evaluated.error){log.warn("Error occurred during processing given","attribute configuration \"".concat(attributeName,"\":"),_evaluated.error);break}// NOTE: That both values do have to be avoided.
|
|
517
|
+
*/var numberValue=parseFloat(value);if(isNaN(numberValue))numberValue=undefined;this.setInternalPropertyValue(name,numberValue);this.setExternalPropertyValue(name,numberValue);break}case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.string:case"string":{this.setInternalPropertyValue(name,value);this.setExternalPropertyValue(name,value);break}case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.any:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.array:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.arrayOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.element:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.elementType:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.instanceOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.node:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.object:case"object":case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.objectOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.oneOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.oneOfType:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.shape:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.exact:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.symbol:default:{if(value){var _evaluated=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluate)(value,{binding:this});if(_evaluated.error){void log.warn("Error occurred during processing given","attribute configuration \"".concat(attributeName,"\":"),_evaluated.error);break}// NOTE: That both values do have to be avoided.
|
|
524
518
|
this.setInternalPropertyValue(name,_evaluated.result);this.setExternalPropertyValue(name,(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.copy)(_evaluated.result,false,1))}else if(this.hasAttribute(attributeName)){this.setInternalPropertyValue(name,true);this.setExternalPropertyValue(name,true)}else{this.setInternalPropertyValue(name,null);this.setExternalPropertyValue(name,null)}break}}}}/// endregion
|
|
525
519
|
/// region render
|
|
526
520
|
/**
|
|
@@ -558,7 +552,7 @@ this.setInternalPropertyValue(name,_evaluated.result);this.setExternalPropertyVa
|
|
|
558
552
|
* rendering process by their own.
|
|
559
553
|
* @returns A promise resolving when rendering has been finished. A promise
|
|
560
554
|
* may be needed for classes inheriting from this class.
|
|
561
|
-
*/},{key:"render",value:(function(){var _render=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(reason,resolveRendering){var _this14=this;var evaluated,renderTargetDomNode;return _regenerator().w(function(_context5){while(1)switch(_context5.n){case 0:if(reason===void 0){reason="unknown"}if(resolveRendering===void 0){resolveRendering=true}this.unRender("reRender",reason);this.childComponentInstances=[];this.renderState.pending=true;if(!this.isRoot){_context5.n=3;break}_context5.n=1;return this.resolveRenderingPromiseIfSet(reason,resolveRendering);case 1:if(!resolveRendering){_context5.n=3;break}_context5.n=2;return Promise.all(this.self.pendingRenderPromises);case 2:this.self.pendingRenderPromises=[];case 3:this.self.pendingRenderPromises.push(this.renderState.promise);this.determineRenderScope();if(this.self.doRender&&this.dispatchEvent(new CustomEvent("render",{detail:{reason:reason,scope:this.scope}}))){_context5.n=5;break}_context5.n=4;return this.resolveRenderingPromiseIfSet(reason,resolveRendering);case 4:return _context5.a(2);case 5:evaluated=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluate)("`".concat(this.self.content,"`"),{scope:this.scope});if(!evaluated.error){_context5.n=7;break}log.warn("Failed to process template: ".concat(evaluated.error));this.renderState.resolve(reason);_context5.n=6;return Promise.all(this.self.pendingRenderPromises);case 6:return _context5.a(2);case 7:this.applyShadowRootIfNotExisting();/*
|
|
555
|
+
*/},{key:"render",value:(function(){var _render=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(reason,resolveRendering){var _this14=this;var evaluated,renderTargetDomNode;return _regenerator().w(function(_context5){while(1)switch(_context5.n){case 0:if(reason===void 0){reason="unknown"}if(resolveRendering===void 0){resolveRendering=true}this.unRender("reRender",reason);this.childComponentInstances=[];this.renderState.pending=true;if(!this.isRoot){_context5.n=3;break}_context5.n=1;return this.resolveRenderingPromiseIfSet(reason,resolveRendering);case 1:if(!resolveRendering){_context5.n=3;break}_context5.n=2;return Promise.all(this.self.pendingRenderPromises);case 2:this.self.pendingRenderPromises=[];case 3:this.self.pendingRenderPromises.push(this.renderState.promise);this.determineRenderScope();if(this.self.doRender&&this.dispatchEvent(new CustomEvent("render",{detail:{reason:reason,scope:this.scope}}))){_context5.n=5;break}_context5.n=4;return this.resolveRenderingPromiseIfSet(reason,resolveRendering);case 4:return _context5.a(2);case 5:evaluated=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluate)("`".concat(this.self.content,"`"),{scope:this.scope});if(!evaluated.error){_context5.n=7;break}void log.warn("Failed to process template: ".concat(evaluated.error));this.renderState.resolve(reason);_context5.n=6;return Promise.all(this.self.pendingRenderPromises);case 6:return _context5.a(2);case 7:this.applyShadowRootIfNotExisting();/*
|
|
562
556
|
NOTE: We first render into an intermediate render target and apply
|
|
563
557
|
slot content until we finally publish everything to the document.
|
|
564
558
|
This avoids painting twice and internetexplorer bugs with an empty
|
|
@@ -63,18 +63,15 @@ module.exports = x({ ["string"]: function() { return __WEBPACK_EXTERNAL_MODULE_c
|
|
|
63
63
|
/******/
|
|
64
64
|
/************************************************************************/
|
|
65
65
|
var __webpack_exports__ = {};
|
|
66
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
67
|
-
/* harmony export */ M: function() { return /* binding */ property; }
|
|
68
|
-
/* harmony export */ });
|
|
69
66
|
/* harmony import */ var clientnode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
70
67
|
/* harmony import */ var clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
|
71
68
|
// #!/usr/bin/env babel-node
|
|
72
69
|
// -*- coding: utf-8 -*-
|
|
73
70
|
/** @module decorator *//* !
|
|
74
71
|
region header
|
|
75
|
-
[Project page](https://
|
|
72
|
+
[Project page](https://tsickert.com/web-component-wrapper)
|
|
76
73
|
|
|
77
|
-
Copyright Torben Sickert (info["~at~"]
|
|
74
|
+
Copyright Torben Sickert (info["~at~"]tsickert.com) 16.12.2012
|
|
78
75
|
|
|
79
76
|
License
|
|
80
77
|
-------
|
|
@@ -84,7 +81,7 @@ var __webpack_exports__ = {};
|
|
|
84
81
|
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
85
82
|
endregion
|
|
86
83
|
*/// region imports
|
|
87
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,
|
|
84
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var r;if("undefined"!=typeof Symbol&&void 0!==(r=t[Symbol.toPrimitive])){var i=r.call(t,e||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)};// endregion
|
|
88
85
|
/**
|
|
89
86
|
* Generates a decorator based on given configuration.
|
|
90
87
|
* @param options - Property configuration to define how to transfer attributes
|