mol_view_tree2_lib 1.0.217 → 1.0.219

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/web.mjs CHANGED
@@ -2201,12 +2201,15 @@ var $;
2201
2201
  return result;
2202
2202
  }
2203
2203
  function primitive_type(input) {
2204
- let type = 'string';
2205
- if (input.type && $mol_tree2_js_is_number(input.type))
2206
- type = 'number';
2204
+ if (!input.type)
2205
+ return input.data('string');
2207
2206
  if (input.type === 'true' || input.type === 'false')
2208
- type = 'boolean';
2209
- return input.data(type);
2207
+ return input.data('boolean');
2208
+ if ($mol_tree2_js_is_number(input.type))
2209
+ return input.data('number');
2210
+ if (/^[+-]?[\d_]+n$/.test(input.type))
2211
+ return input.data('bigint');
2212
+ return $mol_fail(new Error('Wrong primitive type', { cause: { type: input.type } }));
2210
2213
  }
2211
2214
  function readonly_arr(input, infered) {
2212
2215
  return [
package/web.test.js CHANGED
@@ -5216,22 +5216,27 @@ var $;
5216
5216
  const el = this.dom_node();
5217
5217
  const from = el.selectionStart;
5218
5218
  const to = el.selectionEnd;
5219
+ el.value = this.value_changed(el.value);
5220
+ if (to === null)
5221
+ return;
5222
+ el.selectionEnd = to;
5223
+ el.selectionStart = from;
5224
+ this.selection_change(next);
5225
+ }
5226
+ value_changed(next) {
5227
+ const el = this.dom_node();
5219
5228
  try {
5220
- el.value = this.value_changed(el.value);
5229
+ el.setCustomValidity('');
5230
+ return this.value(next);
5221
5231
  }
5222
5232
  catch (error) {
5223
- const el = this.dom_node();
5233
+ $mol_fail_log(error);
5224
5234
  if (error instanceof Error) {
5225
5235
  el.setCustomValidity(error.message);
5226
5236
  el.reportValidity();
5227
5237
  }
5228
- $mol_fail_hidden(error);
5238
+ return next ?? $mol_mem_cached(() => this.value_changed()) ?? '';
5229
5239
  }
5230
- if (to === null)
5231
- return;
5232
- el.selectionEnd = to;
5233
- el.selectionStart = from;
5234
- this.selection_change(next);
5235
5240
  }
5236
5241
  error_report() {
5237
5242
  try {
@@ -5292,6 +5297,9 @@ var $;
5292
5297
  __decorate([
5293
5298
  $mol_action
5294
5299
  ], $mol_string.prototype, "event_change", null);
5300
+ __decorate([
5301
+ $mol_mem
5302
+ ], $mol_string.prototype, "value_changed", null);
5295
5303
  __decorate([
5296
5304
  $mol_mem
5297
5305
  ], $mol_string.prototype, "error_report", null);