mol_dump_lib 0.0.402 → 0.0.404

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/node.mjs CHANGED
@@ -3108,14 +3108,13 @@ var $;
3108
3108
  return;
3109
3109
  class Component extends HTMLElement {
3110
3110
  static tag = $$.$mol_func_name(View).replace(/\W/g, '').replace(/^(?=\d+)/, '-').replace(/_/g, '-');
3111
- static observedAttributes = new Set;
3111
+ static observedAttributes = new Set();
3112
3112
  view = new View;
3113
3113
  root;
3114
3114
  connectedCallback() {
3115
3115
  if (!this.shadowRoot) {
3116
3116
  this.attachShadow({ mode: 'open' });
3117
3117
  const node = this.view.dom_node();
3118
- node.setAttribute('mol_view_root', '');
3119
3118
  for (const style of $mol_dom_context.document.getElementsByTagName('style')) {
3120
3119
  this.shadowRoot.append(style.cloneNode(true));
3121
3120
  }
@@ -3136,7 +3135,10 @@ var $;
3136
3135
  this.root = undefined;
3137
3136
  }
3138
3137
  attributeChangedCallback(name, prev, next) {
3139
- this.view[name](JSON.parse(next));
3138
+ if (name[0] === '#')
3139
+ this.view[name.slice(1)](JSON.parse(next));
3140
+ else
3141
+ this.view[name](next);
3140
3142
  }
3141
3143
  toString() {
3142
3144
  return '<' + this.constructor.tag + '#' + this.id + '/>';
@@ -3155,6 +3157,7 @@ var $;
3155
3157
  if (typeof descr.value !== 'function')
3156
3158
  continue;
3157
3159
  Component.observedAttributes.add(field);
3160
+ Component.observedAttributes.add('#' + field);
3158
3161
  }
3159
3162
  attributes_observe(Reflect.getPrototypeOf(proto));
3160
3163
  }
package/node.test.js CHANGED
@@ -3099,14 +3099,13 @@ var $;
3099
3099
  return;
3100
3100
  class Component extends HTMLElement {
3101
3101
  static tag = $$.$mol_func_name(View).replace(/\W/g, '').replace(/^(?=\d+)/, '-').replace(/_/g, '-');
3102
- static observedAttributes = new Set;
3102
+ static observedAttributes = new Set();
3103
3103
  view = new View;
3104
3104
  root;
3105
3105
  connectedCallback() {
3106
3106
  if (!this.shadowRoot) {
3107
3107
  this.attachShadow({ mode: 'open' });
3108
3108
  const node = this.view.dom_node();
3109
- node.setAttribute('mol_view_root', '');
3110
3109
  for (const style of $mol_dom_context.document.getElementsByTagName('style')) {
3111
3110
  this.shadowRoot.append(style.cloneNode(true));
3112
3111
  }
@@ -3127,7 +3126,10 @@ var $;
3127
3126
  this.root = undefined;
3128
3127
  }
3129
3128
  attributeChangedCallback(name, prev, next) {
3130
- this.view[name](JSON.parse(next));
3129
+ if (name[0] === '#')
3130
+ this.view[name.slice(1)](JSON.parse(next));
3131
+ else
3132
+ this.view[name](next);
3131
3133
  }
3132
3134
  toString() {
3133
3135
  return '<' + this.constructor.tag + '#' + this.id + '/>';
@@ -3146,6 +3148,7 @@ var $;
3146
3148
  if (typeof descr.value !== 'function')
3147
3149
  continue;
3148
3150
  Component.observedAttributes.add(field);
3151
+ Component.observedAttributes.add('#' + field);
3149
3152
  }
3150
3153
  attributes_observe(Reflect.getPrototypeOf(proto));
3151
3154
  }