web-component-wrapper 0.0.619 → 0.0.620
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 +18 -6
- package/dist/Web.js +18 -6
- package/dist/bundle/ReactWeb.js +398 -385
- package/dist/bundle/Web.js +398 -385
- package/dist/bundle/compatible/ReactWeb.js +398 -385
- package/dist/bundle/compatible/Web.js +398 -385
- package/dist/bundle/compatible/decorator.js +390 -381
- package/dist/bundle/compatible/index.js +398 -385
- package/dist/bundle/decorator.js +390 -381
- package/dist/bundle/index.js +398 -385
- package/dist/compatible/ReactWeb.js +18 -6
- package/dist/compatible/Web.js +18 -6
- package/dist/compatible/decorator.js +10 -2
- package/dist/compatible/index.js +18 -6
- package/dist/decorator.js +10 -2
- package/dist/index.js +18 -6
- package/package.json +10 -10
|
@@ -47,7 +47,15 @@ module.exports = x({ ["NullSymbol"]: function() { return __WEBPACK_EXTERNAL_MODU
|
|
|
47
47
|
endregion
|
|
48
48
|
*/// region imports
|
|
49
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){var e="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(Array.isArray(r)&&(null==e||e===("undefined"!=typeof Symbol&&[][Symbol.iterator])||e===[]["@@iterator"]))return r;if(null!=e){for(var t,o=[],a=e.call(r);!(t=a.next()).done;)o.push(t.value);return o}}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
|
+
NOTE: Every class owns these members, so they do not indicate an existing
|
|
52
|
+
static configuration.
|
|
53
|
+
*/var INTRINSIC_CLASS_MEMBER_NAMES=["length","name","prototype"];/**
|
|
54
|
+
* Checks if given class defines an own static member with given name.
|
|
55
|
+
* @param self - Class to check.
|
|
56
|
+
* @param name - Member name to check.
|
|
57
|
+
* @returns A boolean indicating whether given member exists.
|
|
58
|
+
*/var hasOwnStaticMember=function hasOwnStaticMember(self,name){return Object.prototype.hasOwnProperty.call(self,name)&&!INTRINSIC_CLASS_MEMBER_NAMES.includes(name)};/**
|
|
51
59
|
* Generates a decorator based on given configuration.
|
|
52
60
|
* @param options - Property configuration to define how to transfer attributes
|
|
53
61
|
* and properties into each other.
|
|
@@ -68,7 +76,7 @@ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof
|
|
|
68
76
|
* "hasOwnProperty" for existence in this decorator.
|
|
69
77
|
* @param target - Instance to apply given property to.
|
|
70
78
|
* @param name - Field name to apply.
|
|
71
|
-
*/return function(target,name){if(typeof name!=="string")return;var self=target.self||target.constructor;if(options.readAttribute){if(!Object.prototype.hasOwnProperty.call(self,"observedAttributes"))self.observedAttributes=self.observedAttributes?_toConsumableArray(self.observedAttributes):[];var attributeName=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.camelCaseToDelimited)(name);if(self.observedAttributes&&!self.observedAttributes.includes(attributeName))self.observedAttributes.push(attributeName)}if(options.type){if(!Object.prototype.hasOwnProperty.call(self,"propertyTypes"))self.propertyTypes=self.propertyTypes?_objectSpread({},self.propertyTypes):{};if(self.propertyTypes&&(options.update||!
|
|
79
|
+
*/return function(target,name){if(typeof name!=="string")return;var self=target.self||target.constructor;if(options.readAttribute){if(!Object.prototype.hasOwnProperty.call(self,"observedAttributes"))self.observedAttributes=self.observedAttributes?_toConsumableArray(self.observedAttributes):[];var attributeName=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.camelCaseToDelimited)(name);if(self.observedAttributes&&!self.observedAttributes.includes(attributeName))self.observedAttributes.push(attributeName)}if(options.type){if(!Object.prototype.hasOwnProperty.call(self,"propertyTypes"))self.propertyTypes=self.propertyTypes?_objectSpread({},self.propertyTypes):{};if(self.propertyTypes&&(options.update||!hasOwnStaticMember(self,name)))self.propertyTypes[name]=options.type}if(options.writeAttribute){if(!Object.prototype.hasOwnProperty.call(self,"propertiesToReflectAsAttributes"))self.propertiesToReflectAsAttributes=self.propertiesToReflectAsAttributes?(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.copy)(self.propertiesToReflectAsAttributes):[];var reflectionConfiguration=self.propertiesToReflectAsAttributes;if(options.update||(reflectionConfiguration instanceof Map?!reflectionConfiguration.has(name):Array.isArray(reflectionConfiguration)?!reflectionConfiguration.includes(name):_typeof(reflectionConfiguration)==="object"&&!Object.prototype.hasOwnProperty.call(reflectionConfiguration,name))){var result;if(typeof options.writeAttribute==="boolean"){if(options.writeAttribute&&self.propertyTypes&&Object.prototype.hasOwnProperty.call(self.propertyTypes,name))result=self.propertyTypes[name]}else result=options.writeAttribute;if(result!==undefined){if(Array.isArray(self.propertiesToReflectAsAttributes))if(options.writeAttribute===true){if(!self.propertiesToReflectAsAttributes.includes(name))self.propertiesToReflectAsAttributes.push(name)}else if(self.normalizePropertyTypeList)self.propertiesToReflectAsAttributes=self.normalizePropertyTypeList(self.propertiesToReflectAsAttributes);if(self.propertiesToReflectAsAttributes instanceof Map)self.propertiesToReflectAsAttributes.set(name,result);else if(!Array.isArray(self.propertiesToReflectAsAttributes)&&_typeof(self.propertiesToReflectAsAttributes)==="object")self.propertiesToReflectAsAttributes[name]=result}}}if(options.alias){if(!Object.prototype.hasOwnProperty.call(self,"propertyAliases"))self.propertyAliases=self.propertyAliases?_objectSpread({},self.propertyAliases):{};if(self.propertyAliases&&(options.update||!hasOwnStaticMember(self,name)))self.propertyAliases[name]=options.alias}}}/* harmony default export */ __webpack_exports__.A = (property);
|
|
72
80
|
|
|
73
81
|
/***/ }),
|
|
74
82
|
/* 3 */
|
|
@@ -245,7 +253,7 @@ if(Object.prototype.hasOwnProperty.call(_this4,propertyName))_this4.setPropertyV
|
|
|
245
253
|
* @param name - Property name to retrieve.
|
|
246
254
|
* @returns Retrieved property value.
|
|
247
255
|
*/},{key:"getPropertyValue",value:function getPropertyValue(name){var _this$instance,_name,_this$instance2;var result=(_this$instance=this.instance)!==null&&_this$instance!==void 0&&(_this$instance=_this$instance.current)!==null&&_this$instance!==void 0&&_this$instance.properties&&(// NOTE: Base properties should not be shadowed.
|
|
248
|
-
Object.prototype.hasOwnProperty.call(
|
|
256
|
+
!Object.prototype.hasOwnProperty.call(Web.propertyTypes,name)||Object.prototype.hasOwnProperty.call(this.instance.current.properties,name))?this.instance.current.properties[name]:(_name=this.internalProperties[name])!==null&&_name!==void 0?_name:this.externalProperties[name];if((_this$instance2=this.instance)!==null&&_this$instance2!==void 0&&(_this$instance2=_this$instance2.current)!==null&&_this$instance2!==void 0&&_this$instance2.state&&Object.prototype.hasOwnProperty.call(this.instance.current.state,name))return this.instance.current.state[name];return result}/**
|
|
249
257
|
* External property setter. Respects configured aliases.
|
|
250
258
|
* @param name - Property name to write.
|
|
251
259
|
* @param value - New value to write.
|
|
@@ -341,8 +349,12 @@ var currentDomNode=domNode.firstChild;while(currentDomNode){if(!options.filter||
|
|
|
341
349
|
* @param options - Add event listener options.
|
|
342
350
|
* @param removeOptions - Remove event listener options.
|
|
343
351
|
* @returns Deregister function.
|
|
344
|
-
*/},{key:"addSecureEventListener",value:function addSecureEventListener(domNode,name,handler,options,removeOptions){var _this8=this
|
|
345
|
-
|
|
352
|
+
*/},{key:"addSecureEventListener",value:function addSecureEventListener(domNode,name,handler,options,removeOptions){var _this$domNodeEventBin,_this$domNodeEventBin2,_this8=this;/*
|
|
353
|
+
NOTE: Has to be done before retrieving the event map since it may
|
|
354
|
+
be removed when the old handler was the last one registered.
|
|
355
|
+
*/(_this$domNodeEventBin=this.domNodeEventBindings.get(domNode))===null||_this$domNodeEventBin===void 0||(_this$domNodeEventBin2=_this$domNodeEventBin.get(name))===null||_this$domNodeEventBin2===void 0||_this$domNodeEventBin2();if(!this.domNodeEventBindings.has(domNode))this.domNodeEventBindings.set(// eslint-disable-next-line func-call-spacing
|
|
356
|
+
domNode,new Map);var eventMap=this.domNodeEventBindings.get(domNode);var _deregister=function deregister(){domNode.removeEventListener(name,handler,removeOptions);// NOTE: An outdated deregister should not remove its successor.
|
|
357
|
+
if(eventMap.get(name)===_deregister)eventMap.delete(name);if(eventMap.size===0&&_this8.domNodeEventBindings.get(domNode)===eventMap)_this8.domNodeEventBindings.delete(domNode)};eventMap.set(name,_deregister);domNode.addEventListener(name,handler,options);return _deregister}//// endregion
|
|
346
358
|
/**
|
|
347
359
|
* Determines initial root which initializes rendering digest.
|
|
348
360
|
*/},{key:"determineRootBinding",value:function determineRootBinding(){/*
|
|
@@ -405,7 +417,7 @@ for(var _i2=0,_Object$entries=Object.entries(this.self.propertyTypes);_i2<_Objec
|
|
|
405
417
|
If real (template) code is wrapped in a "textarea" tag, unwrap it
|
|
406
418
|
now. This extra wrapping can be used to avoid first dom rendering
|
|
407
419
|
before template code has been evaluated.
|
|
408
|
-
*/var element=
|
|
420
|
+
*/var element=slot.firstElementChild?slot:null;if(element&&((_element$firstElement=element.firstElementChild)===null||_element$firstElement===void 0?void 0:_element$firstElement.nodeName.toLowerCase())==="textarea"&&(!element.firstElementChild.hasAttribute("data-no-template")||element.firstElementChild.getAttribute("data-no-template")==="false")){var content=element.firstElementChild.value;/*
|
|
409
421
|
NOTE: These kinds of slots are always used as a template and
|
|
410
422
|
should therefore be copied in every case.
|
|
411
423
|
NOTE: A flat copy should suffice since we will replace nested
|
package/dist/compatible/Web.js
CHANGED
|
@@ -44,7 +44,15 @@ module.exports = x({ ["any"]: function() { return __WEBPACK_EXTERNAL_MODULE_clie
|
|
|
44
44
|
endregion
|
|
45
45
|
*/// region imports
|
|
46
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){var e="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(Array.isArray(r)&&(null==e||e===("undefined"!=typeof Symbol&&[][Symbol.iterator])||e===[]["@@iterator"]))return r;if(null!=e){for(var t,o=[],a=e.call(r);!(t=a.next()).done;)o.push(t.value);return o}}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
|
+
NOTE: Every class owns these members, so they do not indicate an existing
|
|
49
|
+
static configuration.
|
|
50
|
+
*/var INTRINSIC_CLASS_MEMBER_NAMES=["length","name","prototype"];/**
|
|
51
|
+
* Checks if given class defines an own static member with given name.
|
|
52
|
+
* @param self - Class to check.
|
|
53
|
+
* @param name - Member name to check.
|
|
54
|
+
* @returns A boolean indicating whether given member exists.
|
|
55
|
+
*/var hasOwnStaticMember=function hasOwnStaticMember(self,name){return Object.prototype.hasOwnProperty.call(self,name)&&!INTRINSIC_CLASS_MEMBER_NAMES.includes(name)};/**
|
|
48
56
|
* Generates a decorator based on given configuration.
|
|
49
57
|
* @param options - Property configuration to define how to transfer attributes
|
|
50
58
|
* and properties into each other.
|
|
@@ -65,7 +73,7 @@ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof
|
|
|
65
73
|
* "hasOwnProperty" for existence in this decorator.
|
|
66
74
|
* @param target - Instance to apply given property to.
|
|
67
75
|
* @param name - Field name to apply.
|
|
68
|
-
*/return function(target,name){if(typeof name!=="string")return;var self=target.self||target.constructor;if(options.readAttribute){if(!Object.prototype.hasOwnProperty.call(self,"observedAttributes"))self.observedAttributes=self.observedAttributes?_toConsumableArray(self.observedAttributes):[];var attributeName=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.camelCaseToDelimited)(name);if(self.observedAttributes&&!self.observedAttributes.includes(attributeName))self.observedAttributes.push(attributeName)}if(options.type){if(!Object.prototype.hasOwnProperty.call(self,"propertyTypes"))self.propertyTypes=self.propertyTypes?_objectSpread({},self.propertyTypes):{};if(self.propertyTypes&&(options.update||!
|
|
76
|
+
*/return function(target,name){if(typeof name!=="string")return;var self=target.self||target.constructor;if(options.readAttribute){if(!Object.prototype.hasOwnProperty.call(self,"observedAttributes"))self.observedAttributes=self.observedAttributes?_toConsumableArray(self.observedAttributes):[];var attributeName=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.camelCaseToDelimited)(name);if(self.observedAttributes&&!self.observedAttributes.includes(attributeName))self.observedAttributes.push(attributeName)}if(options.type){if(!Object.prototype.hasOwnProperty.call(self,"propertyTypes"))self.propertyTypes=self.propertyTypes?_objectSpread({},self.propertyTypes):{};if(self.propertyTypes&&(options.update||!hasOwnStaticMember(self,name)))self.propertyTypes[name]=options.type}if(options.writeAttribute){if(!Object.prototype.hasOwnProperty.call(self,"propertiesToReflectAsAttributes"))self.propertiesToReflectAsAttributes=self.propertiesToReflectAsAttributes?(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.copy)(self.propertiesToReflectAsAttributes):[];var reflectionConfiguration=self.propertiesToReflectAsAttributes;if(options.update||(reflectionConfiguration instanceof Map?!reflectionConfiguration.has(name):Array.isArray(reflectionConfiguration)?!reflectionConfiguration.includes(name):_typeof(reflectionConfiguration)==="object"&&!Object.prototype.hasOwnProperty.call(reflectionConfiguration,name))){var result;if(typeof options.writeAttribute==="boolean"){if(options.writeAttribute&&self.propertyTypes&&Object.prototype.hasOwnProperty.call(self.propertyTypes,name))result=self.propertyTypes[name]}else result=options.writeAttribute;if(result!==undefined){if(Array.isArray(self.propertiesToReflectAsAttributes))if(options.writeAttribute===true){if(!self.propertiesToReflectAsAttributes.includes(name))self.propertiesToReflectAsAttributes.push(name)}else if(self.normalizePropertyTypeList)self.propertiesToReflectAsAttributes=self.normalizePropertyTypeList(self.propertiesToReflectAsAttributes);if(self.propertiesToReflectAsAttributes instanceof Map)self.propertiesToReflectAsAttributes.set(name,result);else if(!Array.isArray(self.propertiesToReflectAsAttributes)&&_typeof(self.propertiesToReflectAsAttributes)==="object")self.propertiesToReflectAsAttributes[name]=result}}}if(options.alias){if(!Object.prototype.hasOwnProperty.call(self,"propertyAliases"))self.propertyAliases=self.propertyAliases?_objectSpread({},self.propertyAliases):{};if(self.propertyAliases&&(options.update||!hasOwnStaticMember(self,name)))self.propertyAliases[name]=options.alias}}}/* harmony default export */ __webpack_exports__.A = (property);
|
|
69
77
|
|
|
70
78
|
/***/ })
|
|
71
79
|
/******/ ]);
|
|
@@ -279,7 +287,7 @@ if(Object.prototype.hasOwnProperty.call(_this4,propertyName))_this4.setPropertyV
|
|
|
279
287
|
* @param name - Property name to retrieve.
|
|
280
288
|
* @returns Retrieved property value.
|
|
281
289
|
*/},{key:"getPropertyValue",value:function getPropertyValue(name){var _this$instance,_name,_this$instance2;var result=(_this$instance=this.instance)!==null&&_this$instance!==void 0&&(_this$instance=_this$instance.current)!==null&&_this$instance!==void 0&&_this$instance.properties&&(// NOTE: Base properties should not be shadowed.
|
|
282
|
-
Object.prototype.hasOwnProperty.call(
|
|
290
|
+
!Object.prototype.hasOwnProperty.call(Web.propertyTypes,name)||Object.prototype.hasOwnProperty.call(this.instance.current.properties,name))?this.instance.current.properties[name]:(_name=this.internalProperties[name])!==null&&_name!==void 0?_name:this.externalProperties[name];if((_this$instance2=this.instance)!==null&&_this$instance2!==void 0&&(_this$instance2=_this$instance2.current)!==null&&_this$instance2!==void 0&&_this$instance2.state&&Object.prototype.hasOwnProperty.call(this.instance.current.state,name))return this.instance.current.state[name];return result}/**
|
|
283
291
|
* External property setter. Respects configured aliases.
|
|
284
292
|
* @param name - Property name to write.
|
|
285
293
|
* @param value - New value to write.
|
|
@@ -375,8 +383,12 @@ var currentDomNode=domNode.firstChild;while(currentDomNode){if(!options.filter||
|
|
|
375
383
|
* @param options - Add event listener options.
|
|
376
384
|
* @param removeOptions - Remove event listener options.
|
|
377
385
|
* @returns Deregister function.
|
|
378
|
-
*/},{key:"addSecureEventListener",value:function addSecureEventListener(domNode,name,handler,options,removeOptions){var _this8=this
|
|
379
|
-
|
|
386
|
+
*/},{key:"addSecureEventListener",value:function addSecureEventListener(domNode,name,handler,options,removeOptions){var _this$domNodeEventBin,_this$domNodeEventBin2,_this8=this;/*
|
|
387
|
+
NOTE: Has to be done before retrieving the event map since it may
|
|
388
|
+
be removed when the old handler was the last one registered.
|
|
389
|
+
*/(_this$domNodeEventBin=this.domNodeEventBindings.get(domNode))===null||_this$domNodeEventBin===void 0||(_this$domNodeEventBin2=_this$domNodeEventBin.get(name))===null||_this$domNodeEventBin2===void 0||_this$domNodeEventBin2();if(!this.domNodeEventBindings.has(domNode))this.domNodeEventBindings.set(// eslint-disable-next-line func-call-spacing
|
|
390
|
+
domNode,new Map);var eventMap=this.domNodeEventBindings.get(domNode);var _deregister=function deregister(){domNode.removeEventListener(name,handler,removeOptions);// NOTE: An outdated deregister should not remove its successor.
|
|
391
|
+
if(eventMap.get(name)===_deregister)eventMap.delete(name);if(eventMap.size===0&&_this8.domNodeEventBindings.get(domNode)===eventMap)_this8.domNodeEventBindings.delete(domNode)};eventMap.set(name,_deregister);domNode.addEventListener(name,handler,options);return _deregister}//// endregion
|
|
380
392
|
/**
|
|
381
393
|
* Determines initial root which initializes rendering digest.
|
|
382
394
|
*/},{key:"determineRootBinding",value:function determineRootBinding(){/*
|
|
@@ -439,7 +451,7 @@ for(var _i2=0,_Object$entries=Object.entries(this.self.propertyTypes);_i2<_Objec
|
|
|
439
451
|
If real (template) code is wrapped in a "textarea" tag, unwrap it
|
|
440
452
|
now. This extra wrapping can be used to avoid first dom rendering
|
|
441
453
|
before template code has been evaluated.
|
|
442
|
-
*/var element=
|
|
454
|
+
*/var element=slot.firstElementChild?slot:null;if(element&&((_element$firstElement=element.firstElementChild)===null||_element$firstElement===void 0?void 0:_element$firstElement.nodeName.toLowerCase())==="textarea"&&(!element.firstElementChild.hasAttribute("data-no-template")||element.firstElementChild.getAttribute("data-no-template")==="false")){var content=element.firstElementChild.value;/*
|
|
443
455
|
NOTE: These kinds of slots are always used as a template and
|
|
444
456
|
should therefore be copied in every case.
|
|
445
457
|
NOTE: A flat copy should suffice since we will replace nested
|
|
@@ -82,7 +82,15 @@ var __webpack_exports__ = {};
|
|
|
82
82
|
endregion
|
|
83
83
|
*/// region imports
|
|
84
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){var e="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(Array.isArray(r)&&(null==e||e===("undefined"!=typeof Symbol&&[][Symbol.iterator])||e===[]["@@iterator"]))return r;if(null!=e){for(var t,o=[],a=e.call(r);!(t=a.next()).done;)o.push(t.value);return o}}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
|
|
85
|
-
|
|
85
|
+
/*
|
|
86
|
+
NOTE: Every class owns these members, so they do not indicate an existing
|
|
87
|
+
static configuration.
|
|
88
|
+
*/var INTRINSIC_CLASS_MEMBER_NAMES=["length","name","prototype"];/**
|
|
89
|
+
* Checks if given class defines an own static member with given name.
|
|
90
|
+
* @param self - Class to check.
|
|
91
|
+
* @param name - Member name to check.
|
|
92
|
+
* @returns A boolean indicating whether given member exists.
|
|
93
|
+
*/var hasOwnStaticMember=function hasOwnStaticMember(self,name){return Object.prototype.hasOwnProperty.call(self,name)&&!INTRINSIC_CLASS_MEMBER_NAMES.includes(name)};/**
|
|
86
94
|
* Generates a decorator based on given configuration.
|
|
87
95
|
* @param options - Property configuration to define how to transfer attributes
|
|
88
96
|
* and properties into each other.
|
|
@@ -103,6 +111,6 @@ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof
|
|
|
103
111
|
* "hasOwnProperty" for existence in this decorator.
|
|
104
112
|
* @param target - Instance to apply given property to.
|
|
105
113
|
* @param name - Field name to apply.
|
|
106
|
-
*/return function(target,name){if(typeof name!=="string")return;var self=target.self||target.constructor;if(options.readAttribute){if(!Object.prototype.hasOwnProperty.call(self,"observedAttributes"))self.observedAttributes=self.observedAttributes?_toConsumableArray(self.observedAttributes):[];var attributeName=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.camelCaseToDelimited)(name);if(self.observedAttributes&&!self.observedAttributes.includes(attributeName))self.observedAttributes.push(attributeName)}if(options.type){if(!Object.prototype.hasOwnProperty.call(self,"propertyTypes"))self.propertyTypes=self.propertyTypes?_objectSpread({},self.propertyTypes):{};if(self.propertyTypes&&(options.update||!
|
|
114
|
+
*/return function(target,name){if(typeof name!=="string")return;var self=target.self||target.constructor;if(options.readAttribute){if(!Object.prototype.hasOwnProperty.call(self,"observedAttributes"))self.observedAttributes=self.observedAttributes?_toConsumableArray(self.observedAttributes):[];var attributeName=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.camelCaseToDelimited)(name);if(self.observedAttributes&&!self.observedAttributes.includes(attributeName))self.observedAttributes.push(attributeName)}if(options.type){if(!Object.prototype.hasOwnProperty.call(self,"propertyTypes"))self.propertyTypes=self.propertyTypes?_objectSpread({},self.propertyTypes):{};if(self.propertyTypes&&(options.update||!hasOwnStaticMember(self,name)))self.propertyTypes[name]=options.type}if(options.writeAttribute){if(!Object.prototype.hasOwnProperty.call(self,"propertiesToReflectAsAttributes"))self.propertiesToReflectAsAttributes=self.propertiesToReflectAsAttributes?(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.copy)(self.propertiesToReflectAsAttributes):[];var reflectionConfiguration=self.propertiesToReflectAsAttributes;if(options.update||(reflectionConfiguration instanceof Map?!reflectionConfiguration.has(name):Array.isArray(reflectionConfiguration)?!reflectionConfiguration.includes(name):_typeof(reflectionConfiguration)==="object"&&!Object.prototype.hasOwnProperty.call(reflectionConfiguration,name))){var result;if(typeof options.writeAttribute==="boolean"){if(options.writeAttribute&&self.propertyTypes&&Object.prototype.hasOwnProperty.call(self.propertyTypes,name))result=self.propertyTypes[name]}else result=options.writeAttribute;if(result!==undefined){if(Array.isArray(self.propertiesToReflectAsAttributes))if(options.writeAttribute===true){if(!self.propertiesToReflectAsAttributes.includes(name))self.propertiesToReflectAsAttributes.push(name)}else if(self.normalizePropertyTypeList)self.propertiesToReflectAsAttributes=self.normalizePropertyTypeList(self.propertiesToReflectAsAttributes);if(self.propertiesToReflectAsAttributes instanceof Map)self.propertiesToReflectAsAttributes.set(name,result);else if(!Array.isArray(self.propertiesToReflectAsAttributes)&&_typeof(self.propertiesToReflectAsAttributes)==="object")self.propertiesToReflectAsAttributes[name]=result}}}if(options.alias){if(!Object.prototype.hasOwnProperty.call(self,"propertyAliases"))self.propertyAliases=self.propertyAliases?_objectSpread({},self.propertyAliases):{};if(self.propertyAliases&&(options.update||!hasOwnStaticMember(self,name)))self.propertyAliases[name]=options.alias}}}/* harmony default export */ __webpack_exports__.A = (property);
|
|
107
115
|
var __webpack_exports__default = __webpack_exports__.A;
|
|
108
116
|
export { __webpack_exports__default as default, property };
|
package/dist/compatible/index.js
CHANGED
|
@@ -47,7 +47,15 @@ module.exports = x({ ["NullSymbol"]: function() { return __WEBPACK_EXTERNAL_MODU
|
|
|
47
47
|
endregion
|
|
48
48
|
*/// region imports
|
|
49
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){var e="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(Array.isArray(r)&&(null==e||e===("undefined"!=typeof Symbol&&[][Symbol.iterator])||e===[]["@@iterator"]))return r;if(null!=e){for(var t,o=[],a=e.call(r);!(t=a.next()).done;)o.push(t.value);return o}}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
|
+
NOTE: Every class owns these members, so they do not indicate an existing
|
|
52
|
+
static configuration.
|
|
53
|
+
*/var INTRINSIC_CLASS_MEMBER_NAMES=["length","name","prototype"];/**
|
|
54
|
+
* Checks if given class defines an own static member with given name.
|
|
55
|
+
* @param self - Class to check.
|
|
56
|
+
* @param name - Member name to check.
|
|
57
|
+
* @returns A boolean indicating whether given member exists.
|
|
58
|
+
*/var hasOwnStaticMember=function hasOwnStaticMember(self,name){return Object.prototype.hasOwnProperty.call(self,name)&&!INTRINSIC_CLASS_MEMBER_NAMES.includes(name)};/**
|
|
51
59
|
* Generates a decorator based on given configuration.
|
|
52
60
|
* @param options - Property configuration to define how to transfer attributes
|
|
53
61
|
* and properties into each other.
|
|
@@ -68,7 +76,7 @@ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof
|
|
|
68
76
|
* "hasOwnProperty" for existence in this decorator.
|
|
69
77
|
* @param target - Instance to apply given property to.
|
|
70
78
|
* @param name - Field name to apply.
|
|
71
|
-
*/return function(target,name){if(typeof name!=="string")return;var self=target.self||target.constructor;if(options.readAttribute){if(!Object.prototype.hasOwnProperty.call(self,"observedAttributes"))self.observedAttributes=self.observedAttributes?_toConsumableArray(self.observedAttributes):[];var attributeName=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.camelCaseToDelimited)(name);if(self.observedAttributes&&!self.observedAttributes.includes(attributeName))self.observedAttributes.push(attributeName)}if(options.type){if(!Object.prototype.hasOwnProperty.call(self,"propertyTypes"))self.propertyTypes=self.propertyTypes?_objectSpread({},self.propertyTypes):{};if(self.propertyTypes&&(options.update||!
|
|
79
|
+
*/return function(target,name){if(typeof name!=="string")return;var self=target.self||target.constructor;if(options.readAttribute){if(!Object.prototype.hasOwnProperty.call(self,"observedAttributes"))self.observedAttributes=self.observedAttributes?_toConsumableArray(self.observedAttributes):[];var attributeName=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.camelCaseToDelimited)(name);if(self.observedAttributes&&!self.observedAttributes.includes(attributeName))self.observedAttributes.push(attributeName)}if(options.type){if(!Object.prototype.hasOwnProperty.call(self,"propertyTypes"))self.propertyTypes=self.propertyTypes?_objectSpread({},self.propertyTypes):{};if(self.propertyTypes&&(options.update||!hasOwnStaticMember(self,name)))self.propertyTypes[name]=options.type}if(options.writeAttribute){if(!Object.prototype.hasOwnProperty.call(self,"propertiesToReflectAsAttributes"))self.propertiesToReflectAsAttributes=self.propertiesToReflectAsAttributes?(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.copy)(self.propertiesToReflectAsAttributes):[];var reflectionConfiguration=self.propertiesToReflectAsAttributes;if(options.update||(reflectionConfiguration instanceof Map?!reflectionConfiguration.has(name):Array.isArray(reflectionConfiguration)?!reflectionConfiguration.includes(name):_typeof(reflectionConfiguration)==="object"&&!Object.prototype.hasOwnProperty.call(reflectionConfiguration,name))){var result;if(typeof options.writeAttribute==="boolean"){if(options.writeAttribute&&self.propertyTypes&&Object.prototype.hasOwnProperty.call(self.propertyTypes,name))result=self.propertyTypes[name]}else result=options.writeAttribute;if(result!==undefined){if(Array.isArray(self.propertiesToReflectAsAttributes))if(options.writeAttribute===true){if(!self.propertiesToReflectAsAttributes.includes(name))self.propertiesToReflectAsAttributes.push(name)}else if(self.normalizePropertyTypeList)self.propertiesToReflectAsAttributes=self.normalizePropertyTypeList(self.propertiesToReflectAsAttributes);if(self.propertiesToReflectAsAttributes instanceof Map)self.propertiesToReflectAsAttributes.set(name,result);else if(!Array.isArray(self.propertiesToReflectAsAttributes)&&_typeof(self.propertiesToReflectAsAttributes)==="object")self.propertiesToReflectAsAttributes[name]=result}}}if(options.alias){if(!Object.prototype.hasOwnProperty.call(self,"propertyAliases"))self.propertyAliases=self.propertyAliases?_objectSpread({},self.propertyAliases):{};if(self.propertyAliases&&(options.update||!hasOwnStaticMember(self,name)))self.propertyAliases[name]=options.alias}}}/* harmony default export */ __webpack_exports__.A = (property);
|
|
72
80
|
|
|
73
81
|
/***/ }),
|
|
74
82
|
/* 3 */
|
|
@@ -247,7 +255,7 @@ if(Object.prototype.hasOwnProperty.call(_this4,propertyName))_this4.setPropertyV
|
|
|
247
255
|
* @param name - Property name to retrieve.
|
|
248
256
|
* @returns Retrieved property value.
|
|
249
257
|
*/},{key:"getPropertyValue",value:function getPropertyValue(name){var _this$instance,_name,_this$instance2;var result=(_this$instance=this.instance)!==null&&_this$instance!==void 0&&(_this$instance=_this$instance.current)!==null&&_this$instance!==void 0&&_this$instance.properties&&(// NOTE: Base properties should not be shadowed.
|
|
250
|
-
Object.prototype.hasOwnProperty.call(
|
|
258
|
+
!Object.prototype.hasOwnProperty.call(Web.propertyTypes,name)||Object.prototype.hasOwnProperty.call(this.instance.current.properties,name))?this.instance.current.properties[name]:(_name=this.internalProperties[name])!==null&&_name!==void 0?_name:this.externalProperties[name];if((_this$instance2=this.instance)!==null&&_this$instance2!==void 0&&(_this$instance2=_this$instance2.current)!==null&&_this$instance2!==void 0&&_this$instance2.state&&Object.prototype.hasOwnProperty.call(this.instance.current.state,name))return this.instance.current.state[name];return result}/**
|
|
251
259
|
* External property setter. Respects configured aliases.
|
|
252
260
|
* @param name - Property name to write.
|
|
253
261
|
* @param value - New value to write.
|
|
@@ -343,8 +351,12 @@ var currentDomNode=domNode.firstChild;while(currentDomNode){if(!options.filter||
|
|
|
343
351
|
* @param options - Add event listener options.
|
|
344
352
|
* @param removeOptions - Remove event listener options.
|
|
345
353
|
* @returns Deregister function.
|
|
346
|
-
*/},{key:"addSecureEventListener",value:function addSecureEventListener(domNode,name,handler,options,removeOptions){var _this8=this
|
|
347
|
-
|
|
354
|
+
*/},{key:"addSecureEventListener",value:function addSecureEventListener(domNode,name,handler,options,removeOptions){var _this$domNodeEventBin,_this$domNodeEventBin2,_this8=this;/*
|
|
355
|
+
NOTE: Has to be done before retrieving the event map since it may
|
|
356
|
+
be removed when the old handler was the last one registered.
|
|
357
|
+
*/(_this$domNodeEventBin=this.domNodeEventBindings.get(domNode))===null||_this$domNodeEventBin===void 0||(_this$domNodeEventBin2=_this$domNodeEventBin.get(name))===null||_this$domNodeEventBin2===void 0||_this$domNodeEventBin2();if(!this.domNodeEventBindings.has(domNode))this.domNodeEventBindings.set(// eslint-disable-next-line func-call-spacing
|
|
358
|
+
domNode,new Map);var eventMap=this.domNodeEventBindings.get(domNode);var _deregister=function deregister(){domNode.removeEventListener(name,handler,removeOptions);// NOTE: An outdated deregister should not remove its successor.
|
|
359
|
+
if(eventMap.get(name)===_deregister)eventMap.delete(name);if(eventMap.size===0&&_this8.domNodeEventBindings.get(domNode)===eventMap)_this8.domNodeEventBindings.delete(domNode)};eventMap.set(name,_deregister);domNode.addEventListener(name,handler,options);return _deregister}//// endregion
|
|
348
360
|
/**
|
|
349
361
|
* Determines initial root which initializes rendering digest.
|
|
350
362
|
*/},{key:"determineRootBinding",value:function determineRootBinding(){/*
|
|
@@ -407,7 +419,7 @@ for(var _i2=0,_Object$entries=Object.entries(this.self.propertyTypes);_i2<_Objec
|
|
|
407
419
|
If real (template) code is wrapped in a "textarea" tag, unwrap it
|
|
408
420
|
now. This extra wrapping can be used to avoid first dom rendering
|
|
409
421
|
before template code has been evaluated.
|
|
410
|
-
*/var element=
|
|
422
|
+
*/var element=slot.firstElementChild?slot:null;if(element&&((_element$firstElement=element.firstElementChild)===null||_element$firstElement===void 0?void 0:_element$firstElement.nodeName.toLowerCase())==="textarea"&&(!element.firstElementChild.hasAttribute("data-no-template")||element.firstElementChild.getAttribute("data-no-template")==="false")){var content=element.firstElementChild.value;/*
|
|
411
423
|
NOTE: These kinds of slots are always used as a template and
|
|
412
424
|
should therefore be copied in every case.
|
|
413
425
|
NOTE: A flat copy should suffice since we will replace nested
|
package/dist/decorator.js
CHANGED
|
@@ -81,7 +81,15 @@ module.exports = x({ ["string"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode_pro
|
|
|
81
81
|
endregion
|
|
82
82
|
*/// region imports
|
|
83
83
|
// endregion
|
|
84
|
-
|
|
84
|
+
/*
|
|
85
|
+
NOTE: Every class owns these members, so they do not indicate an existing
|
|
86
|
+
static configuration.
|
|
87
|
+
*/const INTRINSIC_CLASS_MEMBER_NAMES=["length","name","prototype"];/**
|
|
88
|
+
* Checks if given class defines an own static member with given name.
|
|
89
|
+
* @param self - Class to check.
|
|
90
|
+
* @param name - Member name to check.
|
|
91
|
+
* @returns A boolean indicating whether given member exists.
|
|
92
|
+
*/const hasOwnStaticMember=(self,name)=>Object.prototype.hasOwnProperty.call(self,name)&&!INTRINSIC_CLASS_MEMBER_NAMES.includes(name);/**
|
|
85
93
|
* Generates a decorator based on given configuration.
|
|
86
94
|
* @param options - Property configuration to define how to transfer attributes
|
|
87
95
|
* and properties into each other.
|
|
@@ -102,5 +110,5 @@ module.exports = x({ ["string"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode_pro
|
|
|
102
110
|
* "hasOwnProperty" for existence in this decorator.
|
|
103
111
|
* @param target - Instance to apply given property to.
|
|
104
112
|
* @param name - Field name to apply.
|
|
105
|
-
*/return function(target,name){if(typeof name!=="string")return;const self=target.self||target.constructor;if(options.readAttribute){if(!Object.prototype.hasOwnProperty.call(self,"observedAttributes"))self.observedAttributes=self.observedAttributes?[...self.observedAttributes]:[];const attributeName=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.camelCaseToDelimited)(name);if(self.observedAttributes&&!self.observedAttributes.includes(attributeName))self.observedAttributes.push(attributeName)}if(options.type){if(!Object.prototype.hasOwnProperty.call(self,"propertyTypes"))self.propertyTypes=self.propertyTypes?{...self.propertyTypes}:{};if(self.propertyTypes&&(options.update||!
|
|
113
|
+
*/return function(target,name){if(typeof name!=="string")return;const self=target.self||target.constructor;if(options.readAttribute){if(!Object.prototype.hasOwnProperty.call(self,"observedAttributes"))self.observedAttributes=self.observedAttributes?[...self.observedAttributes]:[];const attributeName=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.camelCaseToDelimited)(name);if(self.observedAttributes&&!self.observedAttributes.includes(attributeName))self.observedAttributes.push(attributeName)}if(options.type){if(!Object.prototype.hasOwnProperty.call(self,"propertyTypes"))self.propertyTypes=self.propertyTypes?{...self.propertyTypes}:{};if(self.propertyTypes&&(options.update||!hasOwnStaticMember(self,name)))self.propertyTypes[name]=options.type}if(options.writeAttribute){if(!Object.prototype.hasOwnProperty.call(self,"propertiesToReflectAsAttributes"))self.propertiesToReflectAsAttributes=self.propertiesToReflectAsAttributes?(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.copy)(self.propertiesToReflectAsAttributes):[];const reflectionConfiguration=self.propertiesToReflectAsAttributes;if(options.update||(reflectionConfiguration instanceof Map?!reflectionConfiguration.has(name):Array.isArray(reflectionConfiguration)?!reflectionConfiguration.includes(name):typeof reflectionConfiguration==="object"&&!Object.prototype.hasOwnProperty.call(reflectionConfiguration,name))){let result;if(typeof options.writeAttribute==="boolean"){if(options.writeAttribute&&self.propertyTypes&&Object.prototype.hasOwnProperty.call(self.propertyTypes,name))result=self.propertyTypes[name]}else result=options.writeAttribute;if(result!==undefined){if(Array.isArray(self.propertiesToReflectAsAttributes))if(options.writeAttribute===true){if(!self.propertiesToReflectAsAttributes.includes(name))self.propertiesToReflectAsAttributes.push(name)}else if(self.normalizePropertyTypeList)self.propertiesToReflectAsAttributes=self.normalizePropertyTypeList(self.propertiesToReflectAsAttributes);if(self.propertiesToReflectAsAttributes instanceof Map)self.propertiesToReflectAsAttributes.set(name,result);else if(!Array.isArray(self.propertiesToReflectAsAttributes)&&typeof self.propertiesToReflectAsAttributes==="object")self.propertiesToReflectAsAttributes[name]=result}}}if(options.alias){if(!Object.prototype.hasOwnProperty.call(self,"propertyAliases"))self.propertyAliases=self.propertyAliases?{...self.propertyAliases}:{};if(self.propertyAliases&&(options.update||!hasOwnStaticMember(self,name)))self.propertyAliases[name]=options.alias}}}/* harmony default export */ const decorator = (property);
|
|
106
114
|
export { decorator as default, property };
|
package/dist/index.js
CHANGED
|
@@ -50,7 +50,15 @@ module.exports = x({ ["NullSymbol"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode
|
|
|
50
50
|
endregion
|
|
51
51
|
*/// region imports
|
|
52
52
|
// endregion
|
|
53
|
-
|
|
53
|
+
/*
|
|
54
|
+
NOTE: Every class owns these members, so they do not indicate an existing
|
|
55
|
+
static configuration.
|
|
56
|
+
*/const INTRINSIC_CLASS_MEMBER_NAMES=["length","name","prototype"];/**
|
|
57
|
+
* Checks if given class defines an own static member with given name.
|
|
58
|
+
* @param self - Class to check.
|
|
59
|
+
* @param name - Member name to check.
|
|
60
|
+
* @returns A boolean indicating whether given member exists.
|
|
61
|
+
*/const hasOwnStaticMember=(self,name)=>Object.prototype.hasOwnProperty.call(self,name)&&!INTRINSIC_CLASS_MEMBER_NAMES.includes(name);/**
|
|
54
62
|
* Generates a decorator based on given configuration.
|
|
55
63
|
* @param options - Property configuration to define how to transfer attributes
|
|
56
64
|
* and properties into each other.
|
|
@@ -71,7 +79,7 @@ module.exports = x({ ["NullSymbol"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode
|
|
|
71
79
|
* "hasOwnProperty" for existence in this decorator.
|
|
72
80
|
* @param target - Instance to apply given property to.
|
|
73
81
|
* @param name - Field name to apply.
|
|
74
|
-
*/return function(target,name){if(typeof name!=="string")return;const self=target.self||target.constructor;if(options.readAttribute){if(!Object.prototype.hasOwnProperty.call(self,"observedAttributes"))self.observedAttributes=self.observedAttributes?[...self.observedAttributes]:[];const attributeName=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.camelCaseToDelimited)(name);if(self.observedAttributes&&!self.observedAttributes.includes(attributeName))self.observedAttributes.push(attributeName)}if(options.type){if(!Object.prototype.hasOwnProperty.call(self,"propertyTypes"))self.propertyTypes=self.propertyTypes?{...self.propertyTypes}:{};if(self.propertyTypes&&(options.update||!
|
|
82
|
+
*/return function(target,name){if(typeof name!=="string")return;const self=target.self||target.constructor;if(options.readAttribute){if(!Object.prototype.hasOwnProperty.call(self,"observedAttributes"))self.observedAttributes=self.observedAttributes?[...self.observedAttributes]:[];const attributeName=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.camelCaseToDelimited)(name);if(self.observedAttributes&&!self.observedAttributes.includes(attributeName))self.observedAttributes.push(attributeName)}if(options.type){if(!Object.prototype.hasOwnProperty.call(self,"propertyTypes"))self.propertyTypes=self.propertyTypes?{...self.propertyTypes}:{};if(self.propertyTypes&&(options.update||!hasOwnStaticMember(self,name)))self.propertyTypes[name]=options.type}if(options.writeAttribute){if(!Object.prototype.hasOwnProperty.call(self,"propertiesToReflectAsAttributes"))self.propertiesToReflectAsAttributes=self.propertiesToReflectAsAttributes?(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.copy)(self.propertiesToReflectAsAttributes):[];const reflectionConfiguration=self.propertiesToReflectAsAttributes;if(options.update||(reflectionConfiguration instanceof Map?!reflectionConfiguration.has(name):Array.isArray(reflectionConfiguration)?!reflectionConfiguration.includes(name):typeof reflectionConfiguration==="object"&&!Object.prototype.hasOwnProperty.call(reflectionConfiguration,name))){let result;if(typeof options.writeAttribute==="boolean"){if(options.writeAttribute&&self.propertyTypes&&Object.prototype.hasOwnProperty.call(self.propertyTypes,name))result=self.propertyTypes[name]}else result=options.writeAttribute;if(result!==undefined){if(Array.isArray(self.propertiesToReflectAsAttributes))if(options.writeAttribute===true){if(!self.propertiesToReflectAsAttributes.includes(name))self.propertiesToReflectAsAttributes.push(name)}else if(self.normalizePropertyTypeList)self.propertiesToReflectAsAttributes=self.normalizePropertyTypeList(self.propertiesToReflectAsAttributes);if(self.propertiesToReflectAsAttributes instanceof Map)self.propertiesToReflectAsAttributes.set(name,result);else if(!Array.isArray(self.propertiesToReflectAsAttributes)&&typeof self.propertiesToReflectAsAttributes==="object")self.propertiesToReflectAsAttributes[name]=result}}}if(options.alias){if(!Object.prototype.hasOwnProperty.call(self,"propertyAliases"))self.propertyAliases=self.propertyAliases?{...self.propertyAliases}:{};if(self.propertyAliases&&(options.update||!hasOwnStaticMember(self,name)))self.propertyAliases[name]=options.alias}}}/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (property);
|
|
75
83
|
|
|
76
84
|
/***/ }),
|
|
77
85
|
/* 3 */
|
|
@@ -251,7 +259,7 @@ if(Object.prototype.hasOwnProperty.call(this,propertyName))this.setPropertyValue
|
|
|
251
259
|
* @param name - Property name to retrieve.
|
|
252
260
|
* @returns Retrieved property value.
|
|
253
261
|
*/getPropertyValue(name){const result=this.instance?.current?.properties&&(// NOTE: Base properties should not be shadowed.
|
|
254
|
-
Object.prototype.hasOwnProperty.call(
|
|
262
|
+
!Object.prototype.hasOwnProperty.call(Web.propertyTypes,name)||Object.prototype.hasOwnProperty.call(this.instance.current.properties,name))?this.instance.current.properties[name]:this.internalProperties[name]??this.externalProperties[name];if(this.instance?.current?.state&&Object.prototype.hasOwnProperty.call(this.instance.current.state,name))return this.instance.current.state[name];return result}/**
|
|
255
263
|
* External property setter. Respects configured aliases.
|
|
256
264
|
* @param name - Property name to write.
|
|
257
265
|
* @param value - New value to write.
|
|
@@ -353,8 +361,12 @@ let currentDomNode=domNode.firstChild;while(currentDomNode){if(!options.filter||
|
|
|
353
361
|
* @param options - Add event listener options.
|
|
354
362
|
* @param removeOptions - Remove event listener options.
|
|
355
363
|
* @returns Deregister function.
|
|
356
|
-
*/addSecureEventListener(domNode,name,handler,options,removeOptions){
|
|
357
|
-
|
|
364
|
+
*/addSecureEventListener(domNode,name,handler,options,removeOptions){/*
|
|
365
|
+
NOTE: Has to be done before retrieving the event map since it may
|
|
366
|
+
be removed when the old handler was the last one registered.
|
|
367
|
+
*/this.domNodeEventBindings.get(domNode)?.get(name)?.();if(!this.domNodeEventBindings.has(domNode))this.domNodeEventBindings.set(// eslint-disable-next-line func-call-spacing
|
|
368
|
+
domNode,new Map);const eventMap=this.domNodeEventBindings.get(domNode);const deregister=()=>{domNode.removeEventListener(name,handler,removeOptions);// NOTE: An outdated deregister should not remove its successor.
|
|
369
|
+
if(eventMap.get(name)===deregister)eventMap.delete(name);if(eventMap.size===0&&this.domNodeEventBindings.get(domNode)===eventMap)this.domNodeEventBindings.delete(domNode)};eventMap.set(name,deregister);domNode.addEventListener(name,handler,options);return deregister}//// endregion
|
|
358
370
|
/**
|
|
359
371
|
* Determines initial root which initializes rendering digest.
|
|
360
372
|
*/determineRootBinding(){/*
|
|
@@ -422,7 +434,7 @@ for(const[name,type]of Object.entries(this.self.propertyTypes))if(!Object.protot
|
|
|
422
434
|
If real (template) code is wrapped in a "textarea" tag, unwrap it
|
|
423
435
|
now. This extra wrapping can be used to avoid first dom rendering
|
|
424
436
|
before template code has been evaluated.
|
|
425
|
-
*/const element=
|
|
437
|
+
*/const element=slot.firstElementChild?slot:null;if(element&&element.firstElementChild?.nodeName.toLowerCase()==="textarea"&&(!element.firstElementChild.hasAttribute("data-no-template")||element.firstElementChild.getAttribute("data-no-template")==="false")){const content=element.firstElementChild.value;/*
|
|
426
438
|
NOTE: These kinds of slots are always used as a template and
|
|
427
439
|
should therefore be copied in every case.
|
|
428
440
|
NOTE: A flat copy should suffice since we will replace nested
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "web-component-wrapper",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.620",
|
|
4
4
|
"description": "Generic web-component base class and framework specific wrapper.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"component",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|
|
28
|
-
"url": "https://github.com/thaibault/web-component-wrapper"
|
|
28
|
+
"url": "git+https://github.com/thaibault/web-component-wrapper.git"
|
|
29
29
|
},
|
|
30
30
|
"type": "module",
|
|
31
31
|
"exports": {
|
|
@@ -81,14 +81,14 @@
|
|
|
81
81
|
"@types/ejs": "^3.1.5",
|
|
82
82
|
"@types/html-minifier": "^4.0.6",
|
|
83
83
|
"@types/jsdom": "^30.0.0",
|
|
84
|
-
"@types/node": "^26.6.
|
|
84
|
+
"@types/node": "^26.6.6",
|
|
85
85
|
"@types/react": "^19.3.0",
|
|
86
86
|
"@types/react-dom": "^19.3.0",
|
|
87
87
|
"@types/webpack-env": "^1.18.8",
|
|
88
|
-
"@typescript-eslint/eslint-plugin": "^8.72.
|
|
89
|
-
"@typescript-eslint/parser": "^8.72.
|
|
88
|
+
"@typescript-eslint/eslint-plugin": "^8.72.1",
|
|
89
|
+
"@typescript-eslint/parser": "^8.72.1",
|
|
90
90
|
"@webcomponents/webcomponentsjs": "^2.8.0",
|
|
91
|
-
"clientnode": "^4.0.
|
|
91
|
+
"clientnode": "^4.0.1527",
|
|
92
92
|
"eslint": "^10.13.0",
|
|
93
93
|
"eslint-config-google": "^0.14.0",
|
|
94
94
|
"eslint-plugin-jsdoc": "^65.4.2",
|
|
@@ -97,9 +97,9 @@
|
|
|
97
97
|
"prop-types": "^15.8.1",
|
|
98
98
|
"react": "^19.3.1",
|
|
99
99
|
"react-dom": "^19.3.1",
|
|
100
|
-
"typescript-eslint": "^8.72.
|
|
101
|
-
"web-documentation": "^1.0.
|
|
102
|
-
"weboptimizer": "^4.0.
|
|
100
|
+
"typescript-eslint": "^8.72.1",
|
|
101
|
+
"web-documentation": "^1.0.68",
|
|
102
|
+
"weboptimizer": "^4.0.96",
|
|
103
103
|
"webpack-dev-server": "^6.1.0"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
@@ -235,4 +235,4 @@
|
|
|
235
235
|
}
|
|
236
236
|
},
|
|
237
237
|
"packageManager": "yarn@4.18.1+sha512.b2e1e7524f654f2749d32b4ebcb4622473cb5bcbc485df2007e12a154e50162a4d795526768bc5f5b8f81717bfd79deb2472813d86fb5ae2eb551fa9c872b08f"
|
|
238
|
-
}
|
|
238
|
+
}
|