mol_view_tree2_lib 1.0.53 → 1.0.54

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
@@ -3457,15 +3457,15 @@ var $;
3457
3457
  "use strict";
3458
3458
  var $;
3459
3459
  (function ($) {
3460
- const catched = new WeakMap();
3460
+ const catched = new WeakSet();
3461
3461
  function $mol_fail_catch(error) {
3462
3462
  if (typeof error !== 'object')
3463
3463
  return false;
3464
3464
  if ($mol_promise_like(error))
3465
3465
  $mol_fail_hidden(error);
3466
- if (catched.get(error))
3466
+ if (catched.has(error))
3467
3467
  return false;
3468
- catched.set(error, true);
3468
+ catched.add(error);
3469
3469
  return true;
3470
3470
  }
3471
3471
  $.$mol_fail_catch = $mol_fail_catch;
package/node.test.js CHANGED
@@ -3448,15 +3448,15 @@ var $;
3448
3448
  "use strict";
3449
3449
  var $;
3450
3450
  (function ($) {
3451
- const catched = new WeakMap();
3451
+ const catched = new WeakSet();
3452
3452
  function $mol_fail_catch(error) {
3453
3453
  if (typeof error !== 'object')
3454
3454
  return false;
3455
3455
  if ($mol_promise_like(error))
3456
3456
  $mol_fail_hidden(error);
3457
- if (catched.get(error))
3457
+ if (catched.has(error))
3458
3458
  return false;
3459
- catched.set(error, true);
3459
+ catched.add(error);
3460
3460
  return true;
3461
3461
  }
3462
3462
  $.$mol_fail_catch = $mol_fail_catch;
@@ -9667,6 +9667,16 @@ var $;
9667
9667
  $.$mol_dom_render_events = $mol_dom_render_events;
9668
9668
  })($ || ($ = {}));
9669
9669
 
9670
+ ;
9671
+ "use strict";
9672
+ var $;
9673
+ (function ($) {
9674
+ function $mol_error_message(error) {
9675
+ return String((error instanceof Error ? error.message : null) || error) || 'Unknown';
9676
+ }
9677
+ $.$mol_error_message = $mol_error_message;
9678
+ })($ || ($ = {}));
9679
+
9670
9680
  ;
9671
9681
  "use strict";
9672
9682
  var $;
@@ -9911,8 +9921,8 @@ var $;
9911
9921
  if ($mol_promise_like(error))
9912
9922
  break render;
9913
9923
  try {
9914
- const message = error.message || error;
9915
- node.innerText = message.replace(/^|$/mg, '\xA0\xA0');
9924
+ ;
9925
+ node.innerText = this.$.$mol_error_message(error).replace(/^|$/mg, '\xA0\xA0');
9916
9926
  }
9917
9927
  catch { }
9918
9928
  }
@@ -11023,6 +11033,10 @@ var $;
11023
11033
  if(next !== undefined) return next;
11024
11034
  return null;
11025
11035
  }
11036
+ status(next){
11037
+ if(next !== undefined) return next;
11038
+ return [];
11039
+ }
11026
11040
  event(){
11027
11041
  return {
11028
11042
  ...(super.event()),
@@ -11054,6 +11068,7 @@ var $;
11054
11068
  ($mol_mem(($.$mol_button.prototype), "event_key_press"));
11055
11069
  ($mol_mem(($.$mol_button.prototype), "click"));
11056
11070
  ($mol_mem(($.$mol_button.prototype), "event_click"));
11071
+ ($mol_mem(($.$mol_button.prototype), "status"));
11057
11072
  ($mol_mem(($.$mol_button.prototype), "Speck"));
11058
11073
 
11059
11074
 
@@ -11113,7 +11128,6 @@ var $;
11113
11128
  var $$;
11114
11129
  (function ($$) {
11115
11130
  class $mol_button extends $.$mol_button {
11116
- status(next = [null]) { return next; }
11117
11131
  disabled() {
11118
11132
  return !this.enabled();
11119
11133
  }
@@ -11141,13 +11155,13 @@ var $;
11141
11155
  return this.enabled() ? super.tab_index() : -1;
11142
11156
  }
11143
11157
  error() {
11144
- const [error] = this.status();
11158
+ const error = this.status()?.[0];
11145
11159
  if (!error)
11146
11160
  return '';
11147
- if (error instanceof Promise) {
11161
+ if ($mol_promise_like(error)) {
11148
11162
  return $mol_fail_hidden(error);
11149
11163
  }
11150
- return String(error.message ?? error);
11164
+ return this.$.$mol_error_message(error);
11151
11165
  }
11152
11166
  hint_safe() {
11153
11167
  try {
@@ -11165,9 +11179,6 @@ var $;
11165
11179
  ];
11166
11180
  }
11167
11181
  }
11168
- __decorate([
11169
- $mol_mem
11170
- ], $mol_button.prototype, "status", null);
11171
11182
  $$.$mol_button = $mol_button;
11172
11183
  })($$ = $.$$ || ($.$$ = {}));
11173
11184
  })($ || ($ = {}));