mol_view_tree2_lib 1.0.196 → 1.0.198
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.d.ts +281 -3
- package/node.d.ts.map +1 -1
- package/node.deps.json +1 -1
- package/node.js +371 -19
- package/node.js.map +1 -1
- package/node.mjs +371 -19
- package/node.test.js +681 -36
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.d.ts +285 -3
- package/web.d.ts.map +1 -1
- package/web.deps.json +1 -1
- package/web.js +364 -16
- package/web.js.map +1 -1
- package/web.mjs +364 -16
- package/web.test.js +310 -17
- package/web.test.js.map +1 -1
package/web.test.js
CHANGED
|
@@ -189,6 +189,12 @@ var $;
|
|
|
189
189
|
createDocumentFragment: () => $mol_dom_context.document.createDocumentFragment(),
|
|
190
190
|
};
|
|
191
191
|
$.$mol_jsx_frag = '';
|
|
192
|
+
/**
|
|
193
|
+
* JSX adapter that makes DOM tree.
|
|
194
|
+
* Generates global unique ids for every DOM-element by components tree with ids.
|
|
195
|
+
* Ensures all local ids are unique.
|
|
196
|
+
* Can reuse an existing nodes by GUIDs when used inside [`mol_jsx_attach`](https://github.com/hyoo-ru/mam_mol/tree/master/jsx/attach).
|
|
197
|
+
*/
|
|
192
198
|
function $mol_jsx(Elem, props, ...childNodes) {
|
|
193
199
|
const id = props && props.id || '';
|
|
194
200
|
const guid = id ? $.$mol_jsx_prefix ? $.$mol_jsx_prefix + '/' + id : id : $.$mol_jsx_prefix;
|
|
@@ -299,6 +305,8 @@ var $;
|
|
|
299
305
|
|
|
300
306
|
;
|
|
301
307
|
"use strict";
|
|
308
|
+
/** @jsx $mol_jsx */
|
|
309
|
+
/** @jsxFrag $mol_jsx_frag */
|
|
302
310
|
var $;
|
|
303
311
|
(function ($) {
|
|
304
312
|
$mol_test({
|
|
@@ -404,6 +412,7 @@ var $;
|
|
|
404
412
|
"use strict";
|
|
405
413
|
var $;
|
|
406
414
|
(function ($) {
|
|
415
|
+
/** Lazy computed lists with native Array interface. $mol_range2_array is mutable but all derived ranges are immutable. */
|
|
407
416
|
function $mol_range2(item = index => index, size = () => Number.POSITIVE_INFINITY) {
|
|
408
417
|
const source = typeof item === 'function' ? new $mol_range2_array() : item;
|
|
409
418
|
if (typeof item !== 'function') {
|
|
@@ -452,6 +461,7 @@ var $;
|
|
|
452
461
|
}
|
|
453
462
|
$.$mol_range2 = $mol_range2;
|
|
454
463
|
class $mol_range2_array extends Array {
|
|
464
|
+
// Lazy
|
|
455
465
|
concat(...tail) {
|
|
456
466
|
if (tail.length === 0)
|
|
457
467
|
return this;
|
|
@@ -463,6 +473,7 @@ var $;
|
|
|
463
473
|
}
|
|
464
474
|
return $mol_range2(index => index < this.length ? this[index] : tail[0][index - this.length], () => this.length + tail[0].length);
|
|
465
475
|
}
|
|
476
|
+
// Lazy
|
|
466
477
|
filter(check, context) {
|
|
467
478
|
const filtered = [];
|
|
468
479
|
let cursor = -1;
|
|
@@ -475,13 +486,16 @@ var $;
|
|
|
475
486
|
return filtered[index];
|
|
476
487
|
}, () => cursor < this.length ? Number.POSITIVE_INFINITY : filtered.length);
|
|
477
488
|
}
|
|
489
|
+
// Diligent
|
|
478
490
|
forEach(proceed, context) {
|
|
479
491
|
for (let [key, value] of this.entries())
|
|
480
492
|
proceed.call(context, value, key, this);
|
|
481
493
|
}
|
|
494
|
+
// Lazy
|
|
482
495
|
map(proceed, context) {
|
|
483
496
|
return $mol_range2(index => proceed.call(context, this[index], index, this), () => this.length);
|
|
484
497
|
}
|
|
498
|
+
// Diligent
|
|
485
499
|
reduce(merge, result) {
|
|
486
500
|
let index = 0;
|
|
487
501
|
if (arguments.length === 1) {
|
|
@@ -492,12 +506,15 @@ var $;
|
|
|
492
506
|
}
|
|
493
507
|
return result;
|
|
494
508
|
}
|
|
509
|
+
// Lazy
|
|
495
510
|
toReversed() {
|
|
496
511
|
return $mol_range2(index => this[this.length - 1 - index], () => this.length);
|
|
497
512
|
}
|
|
513
|
+
// Lazy
|
|
498
514
|
slice(from = 0, to = this.length) {
|
|
499
515
|
return $mol_range2(index => this[from + index], () => Math.min(to, this.length) - from);
|
|
500
516
|
}
|
|
517
|
+
// Lazy
|
|
501
518
|
some(check, context) {
|
|
502
519
|
for (let index = 0; index < this.length; ++index) {
|
|
503
520
|
if (check.call(context, this[index], index, this))
|
|
@@ -690,6 +707,7 @@ var $;
|
|
|
690
707
|
|
|
691
708
|
;
|
|
692
709
|
"use strict";
|
|
710
|
+
/** @jsx $mol_jsx */
|
|
693
711
|
var $;
|
|
694
712
|
(function ($) {
|
|
695
713
|
$mol_test({
|
|
@@ -751,6 +769,7 @@ var $;
|
|
|
751
769
|
const obj3_copy = { test: 3, obj2: obj2_copy };
|
|
752
770
|
obj1.obj3 = obj3;
|
|
753
771
|
obj1_copy.obj3 = obj3_copy;
|
|
772
|
+
// warmup cache
|
|
754
773
|
$mol_assert_not($mol_compare_deep(obj1, {}));
|
|
755
774
|
$mol_assert_not($mol_compare_deep(obj2, {}));
|
|
756
775
|
$mol_assert_not($mol_compare_deep(obj3, {}));
|
|
@@ -820,18 +839,34 @@ var $;
|
|
|
820
839
|
"use strict";
|
|
821
840
|
var $;
|
|
822
841
|
(function ($) {
|
|
842
|
+
/**
|
|
843
|
+
* Argument must be Truthy
|
|
844
|
+
* @deprecated use $mol_assert_equal instead
|
|
845
|
+
*/
|
|
823
846
|
function $mol_assert_ok(value) {
|
|
824
847
|
if (value)
|
|
825
848
|
return;
|
|
826
849
|
$mol_fail(new Error(`${value} ≠ true`));
|
|
827
850
|
}
|
|
828
851
|
$.$mol_assert_ok = $mol_assert_ok;
|
|
852
|
+
/**
|
|
853
|
+
* Argument must be Falsy
|
|
854
|
+
* @deprecated use $mol_assert_equal instead
|
|
855
|
+
*/
|
|
829
856
|
function $mol_assert_not(value) {
|
|
830
857
|
if (!value)
|
|
831
858
|
return;
|
|
832
859
|
$mol_fail(new Error(`${value} ≠ false`));
|
|
833
860
|
}
|
|
834
861
|
$.$mol_assert_not = $mol_assert_not;
|
|
862
|
+
/**
|
|
863
|
+
* Handler must throw an error.
|
|
864
|
+
* @example
|
|
865
|
+
* $mol_assert_fail( ()=>{ throw new Error( 'Parse error' ) } ) // Passes because throws error
|
|
866
|
+
* $mol_assert_fail( ()=>{ throw new Error( 'Parse error' ) } , 'Parse error' ) // Passes because throws right message
|
|
867
|
+
* $mol_assert_fail( ()=>{ throw new Error( 'Parse error' ) } , Error ) // Passes because throws right class
|
|
868
|
+
* @see https://mol.hyoo.ru/#!section=docs/=9q9dv3_fgxjsf
|
|
869
|
+
*/
|
|
835
870
|
function $mol_assert_fail(handler, ErrorRight) {
|
|
836
871
|
const fail = $.$mol_fail;
|
|
837
872
|
try {
|
|
@@ -854,10 +889,18 @@ var $;
|
|
|
854
889
|
$mol_fail(new Error('Not failed', { cause: { expect: ErrorRight } }));
|
|
855
890
|
}
|
|
856
891
|
$.$mol_assert_fail = $mol_assert_fail;
|
|
892
|
+
/** @deprecated Use $mol_assert_equal */
|
|
857
893
|
function $mol_assert_like(...args) {
|
|
858
894
|
$mol_assert_equal(...args);
|
|
859
895
|
}
|
|
860
896
|
$.$mol_assert_like = $mol_assert_like;
|
|
897
|
+
/**
|
|
898
|
+
* All arguments must not be structural equal to each other.
|
|
899
|
+
* @example
|
|
900
|
+
* $mol_assert_unique( 1 , 2 , 3 ) // Passes
|
|
901
|
+
* $mol_assert_unique( 1 , 1 , 2 ) // Fails because 1 === 1
|
|
902
|
+
* @see https://mol.hyoo.ru/#!section=docs/=9q9dv3_fgxjsf
|
|
903
|
+
*/
|
|
861
904
|
function $mol_assert_unique(...args) {
|
|
862
905
|
for (let i = 0; i < args.length; ++i) {
|
|
863
906
|
for (let j = 0; j < args.length; ++j) {
|
|
@@ -870,6 +913,13 @@ var $;
|
|
|
870
913
|
}
|
|
871
914
|
}
|
|
872
915
|
$.$mol_assert_unique = $mol_assert_unique;
|
|
916
|
+
/**
|
|
917
|
+
* All arguments must be structural equal each other.
|
|
918
|
+
* @example
|
|
919
|
+
* $mol_assert_like( [1] , [1] , [1] ) // Passes
|
|
920
|
+
* $mol_assert_like( [1] , [1] , [2] ) // Fails because 1 !== 2
|
|
921
|
+
* @see https://mol.hyoo.ru/#!section=docs/=9q9dv3_fgxjsf
|
|
922
|
+
*/
|
|
873
923
|
function $mol_assert_equal(...args) {
|
|
874
924
|
for (let i = 1; i < args.length; ++i) {
|
|
875
925
|
if ($mol_compare_deep(args[0], args[i]))
|
|
@@ -1377,6 +1427,11 @@ var $;
|
|
|
1377
1427
|
"use strict";
|
|
1378
1428
|
var $;
|
|
1379
1429
|
(function ($) {
|
|
1430
|
+
/**
|
|
1431
|
+
* Combines list of unary functions/classes to one function.
|
|
1432
|
+
*
|
|
1433
|
+
* const reparse = $mol_data_pipe( JSON.stringify , JSON.parse )
|
|
1434
|
+
**/
|
|
1380
1435
|
function $mol_data_pipe(...funcs) {
|
|
1381
1436
|
return $mol_data_setup(function (input) {
|
|
1382
1437
|
let value = input;
|
|
@@ -1393,6 +1448,14 @@ var $;
|
|
|
1393
1448
|
var $;
|
|
1394
1449
|
(function ($) {
|
|
1395
1450
|
$mol_test({
|
|
1451
|
+
// @todo enable on strict
|
|
1452
|
+
// 'no functions'() {
|
|
1453
|
+
// const stringify = $mol_data_pipe()
|
|
1454
|
+
// type Type = $mol_type_assert<
|
|
1455
|
+
// typeof stringify,
|
|
1456
|
+
// ( input : never )=> never
|
|
1457
|
+
// >
|
|
1458
|
+
// },
|
|
1396
1459
|
'single function'() {
|
|
1397
1460
|
const stringify = $mol_data_pipe((input) => input.toString());
|
|
1398
1461
|
$mol_assert_equal(stringify(5), '5');
|
|
@@ -1793,6 +1856,9 @@ var $;
|
|
|
1793
1856
|
;
|
|
1794
1857
|
"use strict";
|
|
1795
1858
|
|
|
1859
|
+
;
|
|
1860
|
+
"use strict";
|
|
1861
|
+
|
|
1796
1862
|
;
|
|
1797
1863
|
"use strict";
|
|
1798
1864
|
var $;
|
|
@@ -2209,6 +2275,10 @@ var $;
|
|
|
2209
2275
|
"use strict";
|
|
2210
2276
|
var $;
|
|
2211
2277
|
(function ($) {
|
|
2278
|
+
/**
|
|
2279
|
+
* CSS Units
|
|
2280
|
+
* @see https://mol.hyoo.ru/#!section=docs/=xwq9q5_f966fg
|
|
2281
|
+
*/
|
|
2212
2282
|
class $mol_style_unit extends $mol_decor {
|
|
2213
2283
|
literal;
|
|
2214
2284
|
constructor(value, literal) {
|
|
@@ -2255,6 +2325,10 @@ var $;
|
|
|
2255
2325
|
var $;
|
|
2256
2326
|
(function ($) {
|
|
2257
2327
|
const { per } = $mol_style_unit;
|
|
2328
|
+
/**
|
|
2329
|
+
* CSS Functions
|
|
2330
|
+
* @see https://mol.hyoo.ru/#!section=docs/=xwq9q5_f966fg
|
|
2331
|
+
*/
|
|
2258
2332
|
class $mol_style_func extends $mol_decor {
|
|
2259
2333
|
name;
|
|
2260
2334
|
constructor(name, value) {
|
|
@@ -2346,6 +2420,7 @@ var $;
|
|
|
2346
2420
|
"use strict";
|
|
2347
2421
|
var $;
|
|
2348
2422
|
(function ($) {
|
|
2423
|
+
/** Create record of CSS variables. */
|
|
2349
2424
|
function $mol_style_prop(prefix, keys) {
|
|
2350
2425
|
const record = keys.reduce((rec, key) => {
|
|
2351
2426
|
rec[key] = $mol_style_func.vary(`--${prefix}_${key}`);
|
|
@@ -2360,6 +2435,10 @@ var $;
|
|
|
2360
2435
|
"use strict";
|
|
2361
2436
|
var $;
|
|
2362
2437
|
(function ($) {
|
|
2438
|
+
/**
|
|
2439
|
+
* Theme css variables
|
|
2440
|
+
* @see https://mol.hyoo.ru/#!section=demos/demo=mol_textarea_demo
|
|
2441
|
+
*/
|
|
2363
2442
|
$.$mol_theme = $mol_style_prop('mol_theme', [
|
|
2364
2443
|
'back',
|
|
2365
2444
|
'hover',
|
|
@@ -2388,11 +2467,18 @@ var $;
|
|
|
2388
2467
|
|
|
2389
2468
|
;
|
|
2390
2469
|
"use strict";
|
|
2470
|
+
// namespace $ {
|
|
2471
|
+
// $mol_style_attach( '$mol_theme_lights', `:root { --mol_theme_back: oklch( ${ $$.$mol_lights() ? 92 : 20 }% .01 var(--mol_theme_hue) ) }` )
|
|
2472
|
+
// }
|
|
2391
2473
|
|
|
2392
2474
|
;
|
|
2393
2475
|
"use strict";
|
|
2394
2476
|
var $;
|
|
2395
2477
|
(function ($) {
|
|
2478
|
+
/**
|
|
2479
|
+
* Gap in CSS
|
|
2480
|
+
* @see https://page.hyoo.ru/#!=msdb74_bm7nsq
|
|
2481
|
+
*/
|
|
2396
2482
|
$.$mol_gap = $mol_style_prop('mol_gap', [
|
|
2397
2483
|
'page',
|
|
2398
2484
|
'block',
|
|
@@ -2499,6 +2585,7 @@ var $;
|
|
|
2499
2585
|
"use strict";
|
|
2500
2586
|
var $;
|
|
2501
2587
|
(function ($) {
|
|
2588
|
+
/// @todo right orderinng
|
|
2502
2589
|
$.$mol_after_mock_queue = [];
|
|
2503
2590
|
function $mol_after_mock_warp() {
|
|
2504
2591
|
const queue = $.$mol_after_mock_queue.splice(0);
|
|
@@ -2837,6 +2924,7 @@ var $;
|
|
|
2837
2924
|
var $;
|
|
2838
2925
|
(function ($_1) {
|
|
2839
2926
|
$mol_test({
|
|
2927
|
+
// https://github.com/nin-jin/slides/tree/master/reactivity#component-states
|
|
2840
2928
|
'Cached channel'($) {
|
|
2841
2929
|
class App extends $mol_object2 {
|
|
2842
2930
|
static $ = $;
|
|
@@ -2894,6 +2982,7 @@ var $;
|
|
|
2894
2982
|
$mol_assert_equal(App.value(5), 21);
|
|
2895
2983
|
$mol_assert_equal(App.value(), 21);
|
|
2896
2984
|
},
|
|
2985
|
+
// https://github.com/nin-jin/slides/tree/master/reactivity#wish-consistency
|
|
2897
2986
|
'Auto recalculation of cached values'($) {
|
|
2898
2987
|
class App extends $mol_object2 {
|
|
2899
2988
|
static $ = $;
|
|
@@ -2921,6 +3010,7 @@ var $;
|
|
|
2921
3010
|
App.xxx(5);
|
|
2922
3011
|
$mol_assert_equal(App.zzz(), 7);
|
|
2923
3012
|
},
|
|
3013
|
+
// https://github.com/nin-jin/slides/tree/master/reactivity#wish-reasonability
|
|
2924
3014
|
'Skip recalculation when actually no dependency changes'($) {
|
|
2925
3015
|
const log = [];
|
|
2926
3016
|
class App extends $mol_object2 {
|
|
@@ -2954,6 +3044,7 @@ var $;
|
|
|
2954
3044
|
App.zzz();
|
|
2955
3045
|
$mol_assert_like(log, ['zzz', 'yyy', 'xxx', 'xxx', 'yyy']);
|
|
2956
3046
|
},
|
|
3047
|
+
// https://github.com/nin-jin/slides/tree/master/reactivity#flow-auto
|
|
2957
3048
|
'Flow: Auto'($) {
|
|
2958
3049
|
class App extends $mol_object2 {
|
|
2959
3050
|
static get $() { return $; }
|
|
@@ -2991,6 +3082,7 @@ var $;
|
|
|
2991
3082
|
$mol_assert_equal(App.result(), 23);
|
|
2992
3083
|
$mol_assert_equal(App.counter, 4);
|
|
2993
3084
|
},
|
|
3085
|
+
// https://github.com/nin-jin/slides/tree/master/reactivity#dupes-equality
|
|
2994
3086
|
'Dupes: Equality'($) {
|
|
2995
3087
|
let counter = 0;
|
|
2996
3088
|
class App extends $mol_object2 {
|
|
@@ -3014,6 +3106,7 @@ var $;
|
|
|
3014
3106
|
App.foo({ numbs: [2] });
|
|
3015
3107
|
$mol_assert_like(App.bar(), { numbs: [2], count: 2 });
|
|
3016
3108
|
},
|
|
3109
|
+
// https://github.com/nin-jin/slides/tree/master/reactivity#cycle-fail
|
|
3017
3110
|
'Cycle: Fail'($) {
|
|
3018
3111
|
class App extends $mol_object2 {
|
|
3019
3112
|
static $ = $;
|
|
@@ -3038,6 +3131,29 @@ var $;
|
|
|
3038
3131
|
], App, "test", null);
|
|
3039
3132
|
App.test();
|
|
3040
3133
|
},
|
|
3134
|
+
// https://github.com/nin-jin/slides/tree/master/reactivity#wish-stability
|
|
3135
|
+
// 'Update deps on push'( $ ) {
|
|
3136
|
+
// class App extends $mol_object2 {
|
|
3137
|
+
// static $ = $
|
|
3138
|
+
// @ $mol_wire_solo
|
|
3139
|
+
// static left( next = false ) {
|
|
3140
|
+
// return next
|
|
3141
|
+
// }
|
|
3142
|
+
// @ $mol_wire_solo
|
|
3143
|
+
// static right( next = false ) {
|
|
3144
|
+
// return next
|
|
3145
|
+
// }
|
|
3146
|
+
// @ $mol_wire_solo
|
|
3147
|
+
// static res( next?: boolean ) {
|
|
3148
|
+
// return this.left( next ) && this.right()
|
|
3149
|
+
// }
|
|
3150
|
+
// }
|
|
3151
|
+
// $mol_assert_equal( App.res(), false )
|
|
3152
|
+
// $mol_assert_equal( App.res( true ), false )
|
|
3153
|
+
// $mol_assert_equal( App.right( true ), true )
|
|
3154
|
+
// $mol_assert_equal( App.res(), true )
|
|
3155
|
+
// } ,
|
|
3156
|
+
// https://github.com/nin-jin/slides/tree/master/reactivity#wish-stability
|
|
3041
3157
|
'Different order of pull and push'($) {
|
|
3042
3158
|
class App extends $mol_object2 {
|
|
3043
3159
|
static $ = $;
|
|
@@ -3049,7 +3165,7 @@ var $;
|
|
|
3049
3165
|
}
|
|
3050
3166
|
static slow(next) {
|
|
3051
3167
|
if (next !== undefined)
|
|
3052
|
-
this.slow();
|
|
3168
|
+
this.slow(); // enforce pull before push
|
|
3053
3169
|
return this.store(next);
|
|
3054
3170
|
}
|
|
3055
3171
|
}
|
|
@@ -3068,6 +3184,7 @@ var $;
|
|
|
3068
3184
|
App.store(777);
|
|
3069
3185
|
$mol_assert_equal(App.fast(), App.slow(), 777);
|
|
3070
3186
|
},
|
|
3187
|
+
// https://github.com/nin-jin/slides/tree/master/reactivity#wish-stability
|
|
3071
3188
|
'Actions inside invariant'($) {
|
|
3072
3189
|
class App extends $mol_object2 {
|
|
3073
3190
|
static $ = $;
|
|
@@ -3107,6 +3224,7 @@ var $;
|
|
|
3107
3224
|
static toggle() {
|
|
3108
3225
|
const prev = this.checked();
|
|
3109
3226
|
$mol_assert_unique(this.checked(!prev), prev);
|
|
3227
|
+
// $mol_assert_equal( this.checked() , prev )
|
|
3110
3228
|
}
|
|
3111
3229
|
static res() {
|
|
3112
3230
|
return this.checked();
|
|
@@ -3131,6 +3249,39 @@ var $;
|
|
|
3131
3249
|
], App, "test", null);
|
|
3132
3250
|
await $mol_wire_async(App).test();
|
|
3133
3251
|
},
|
|
3252
|
+
// // https://github.com/nin-jin/slides/tree/master/reactivity#wish-stability
|
|
3253
|
+
// 'Stable order of multiple root'( $ ) {
|
|
3254
|
+
// class App extends $mol_object2 {
|
|
3255
|
+
// static $ = $
|
|
3256
|
+
// static counter = 0
|
|
3257
|
+
// @ $mol_wire_solo
|
|
3258
|
+
// static left_trigger( next = 0 ) {
|
|
3259
|
+
// return next
|
|
3260
|
+
// }
|
|
3261
|
+
// @ $mol_wire_solo
|
|
3262
|
+
// static left_root() {
|
|
3263
|
+
// this.left_trigger()
|
|
3264
|
+
// return ++ this.counter
|
|
3265
|
+
// }
|
|
3266
|
+
// @ $mol_wire_solo
|
|
3267
|
+
// static right_trigger( next = 0 ) {
|
|
3268
|
+
// return next
|
|
3269
|
+
// }
|
|
3270
|
+
// @ $mol_wire_solo
|
|
3271
|
+
// static right_root() {
|
|
3272
|
+
// this.right_trigger()
|
|
3273
|
+
// return ++ this.counter
|
|
3274
|
+
// }
|
|
3275
|
+
// }
|
|
3276
|
+
// $mol_assert_equal( App.left_root(), 1 )
|
|
3277
|
+
// $mol_assert_equal( App.right_root(), 2 )
|
|
3278
|
+
// App.right_trigger( 1 )
|
|
3279
|
+
// App.left_trigger( 1 )
|
|
3280
|
+
// $mol_wire_fiber.sync()
|
|
3281
|
+
// $mol_assert_equal( App.right_root(), 4 )
|
|
3282
|
+
// $mol_assert_equal( App.left_root(), 3 )
|
|
3283
|
+
// } ,
|
|
3284
|
+
// https://github.com/nin-jin/slides/tree/master/reactivity#error-store
|
|
3134
3285
|
'Restore after error'($) {
|
|
3135
3286
|
class App extends $mol_object2 {
|
|
3136
3287
|
static get $() { return $; }
|
|
@@ -3228,6 +3379,7 @@ var $;
|
|
|
3228
3379
|
App.showing(true);
|
|
3229
3380
|
$mol_assert_unique(App.render(), details);
|
|
3230
3381
|
},
|
|
3382
|
+
// https://github.com/nin-jin/slides/tree/master/reactivity#wish-stability
|
|
3231
3383
|
async 'Hold pubs while wait async task'($) {
|
|
3232
3384
|
class App extends $mol_object2 {
|
|
3233
3385
|
static $ = $;
|
|
@@ -3443,6 +3595,7 @@ var $;
|
|
|
3443
3595
|
|
|
3444
3596
|
;
|
|
3445
3597
|
"use strict";
|
|
3598
|
+
/** @jsx $mol_jsx */
|
|
3446
3599
|
var $;
|
|
3447
3600
|
(function ($) {
|
|
3448
3601
|
$mol_test({
|
|
@@ -3525,6 +3678,12 @@ var $;
|
|
|
3525
3678
|
'return result without errors'() {
|
|
3526
3679
|
$mol_assert_equal($mol_try(() => false), false);
|
|
3527
3680
|
},
|
|
3681
|
+
//'return error if thrown'() {
|
|
3682
|
+
//
|
|
3683
|
+
// const error = new Error( '$mol_try test error' )
|
|
3684
|
+
// $mol_assert_equal( $mol_try( ()=> { throw error } ) , error )
|
|
3685
|
+
//
|
|
3686
|
+
//} ,
|
|
3528
3687
|
});
|
|
3529
3688
|
})($ || ($ = {}));
|
|
3530
3689
|
|
|
@@ -3539,6 +3698,7 @@ var $;
|
|
|
3539
3698
|
"use strict";
|
|
3540
3699
|
var $;
|
|
3541
3700
|
(function ($) {
|
|
3701
|
+
/** Watch and logs reactive states. Logger automatically added to test bundle which is adding to `test.html`. */
|
|
3542
3702
|
class $mol_wire_log extends $mol_object2 {
|
|
3543
3703
|
static watch(task) {
|
|
3544
3704
|
return task;
|
|
@@ -3673,6 +3833,10 @@ var $;
|
|
|
3673
3833
|
"use strict";
|
|
3674
3834
|
var $;
|
|
3675
3835
|
(function ($) {
|
|
3836
|
+
/**
|
|
3837
|
+
* Key names code for hotkey
|
|
3838
|
+
* @see [mol_hotkey](../../hotkey/hotkey.view.ts)
|
|
3839
|
+
*/
|
|
3676
3840
|
let $mol_keyboard_code;
|
|
3677
3841
|
(function ($mol_keyboard_code) {
|
|
3678
3842
|
$mol_keyboard_code[$mol_keyboard_code["backspace"] = 8] = "backspace";
|
|
@@ -4064,6 +4228,10 @@ var $;
|
|
|
4064
4228
|
"use strict";
|
|
4065
4229
|
var $;
|
|
4066
4230
|
(function ($) {
|
|
4231
|
+
/**
|
|
4232
|
+
* Real-time refresh current atom.
|
|
4233
|
+
* Don't use if possible. May reduce performance.
|
|
4234
|
+
*/
|
|
4067
4235
|
function $mol_wire_watch() {
|
|
4068
4236
|
const atom = $mol_wire_auto();
|
|
4069
4237
|
if (atom instanceof $mol_wire_atom) {
|
|
@@ -4177,6 +4345,9 @@ var $;
|
|
|
4177
4345
|
;
|
|
4178
4346
|
"use strict";
|
|
4179
4347
|
|
|
4348
|
+
;
|
|
4349
|
+
"use strict";
|
|
4350
|
+
|
|
4180
4351
|
;
|
|
4181
4352
|
"use strict";
|
|
4182
4353
|
var $;
|
|
@@ -4186,6 +4357,7 @@ var $;
|
|
|
4186
4357
|
|
|
4187
4358
|
;
|
|
4188
4359
|
"use strict";
|
|
4360
|
+
/** @jsx $mol_jsx */
|
|
4189
4361
|
var $;
|
|
4190
4362
|
(function ($) {
|
|
4191
4363
|
function $mol_view_visible_width() {
|
|
@@ -4200,6 +4372,11 @@ var $;
|
|
|
4200
4372
|
return suffix;
|
|
4201
4373
|
}
|
|
4202
4374
|
$.$mol_view_state_key = $mol_view_state_key;
|
|
4375
|
+
/**
|
|
4376
|
+
* The base class for all visual components. It provides the infrastructure for reactive lazy rendering, handling exceptions.
|
|
4377
|
+
* @see https://mol.hyoo.ru/#!section=docs/=vv2nig_s5zr0f
|
|
4378
|
+
*/
|
|
4379
|
+
/// Reactive statefull lazy ViewModel
|
|
4203
4380
|
class $mol_view extends $mol_object {
|
|
4204
4381
|
static Root(id) {
|
|
4205
4382
|
return new this;
|
|
@@ -4264,16 +4441,22 @@ var $;
|
|
|
4264
4441
|
state_key(suffix = '') {
|
|
4265
4442
|
return this.$.$mol_view_state_key(suffix);
|
|
4266
4443
|
}
|
|
4444
|
+
/// Name of element that created when element not found in DOM
|
|
4267
4445
|
dom_name() {
|
|
4268
4446
|
return $mol_dom_qname(this.constructor.toString()) || 'div';
|
|
4269
4447
|
}
|
|
4448
|
+
/// NameSpace of element that created when element not found in DOM
|
|
4270
4449
|
dom_name_space() { return 'http://www.w3.org/1999/xhtml'; }
|
|
4450
|
+
/// Raw child views
|
|
4271
4451
|
sub() {
|
|
4272
4452
|
return [];
|
|
4273
4453
|
}
|
|
4454
|
+
/// Visible sub views with defined ambient context
|
|
4455
|
+
/// Render all by default
|
|
4274
4456
|
sub_visible() {
|
|
4275
4457
|
return this.sub();
|
|
4276
4458
|
}
|
|
4459
|
+
/// Minimal width that used for lazy rendering
|
|
4277
4460
|
minimal_width() {
|
|
4278
4461
|
let min = 0;
|
|
4279
4462
|
try {
|
|
@@ -4295,6 +4478,7 @@ var $;
|
|
|
4295
4478
|
maximal_width() {
|
|
4296
4479
|
return this.minimal_width();
|
|
4297
4480
|
}
|
|
4481
|
+
/// Minimal height that used for lazy rendering
|
|
4298
4482
|
minimal_height() {
|
|
4299
4483
|
let min = 0;
|
|
4300
4484
|
try {
|
|
@@ -4314,11 +4498,11 @@ var $;
|
|
|
4314
4498
|
view_rect() {
|
|
4315
4499
|
if ($mol_wire_probe(() => this.view_rect()) === undefined) {
|
|
4316
4500
|
$mol_wire_watch();
|
|
4317
|
-
return null;
|
|
4501
|
+
return null; // don't touch DOM to prevent instant reflow
|
|
4318
4502
|
}
|
|
4319
4503
|
else {
|
|
4320
4504
|
const { width, height, left, right, top, bottom } = this.dom_node().getBoundingClientRect();
|
|
4321
|
-
return { width, height, left, right, top, bottom };
|
|
4505
|
+
return { width, height, left, right, top, bottom }; // pick to optimize compare
|
|
4322
4506
|
}
|
|
4323
4507
|
}
|
|
4324
4508
|
dom_id() {
|
|
@@ -4508,6 +4692,7 @@ var $;
|
|
|
4508
4692
|
[$mol_dev_format_head]() {
|
|
4509
4693
|
return $mol_dev_format_span({}, $mol_dev_format_native(this));
|
|
4510
4694
|
}
|
|
4695
|
+
/** Deep search view by predicate. */
|
|
4511
4696
|
*view_find(check, path = []) {
|
|
4512
4697
|
if (path.length === 0 && check(this))
|
|
4513
4698
|
return yield [this];
|
|
@@ -4536,6 +4721,7 @@ var $;
|
|
|
4536
4721
|
$mol_fail_log(error);
|
|
4537
4722
|
}
|
|
4538
4723
|
}
|
|
4724
|
+
/** Renders path of views to DOM. */
|
|
4539
4725
|
force_render(path) {
|
|
4540
4726
|
const kids = this.sub();
|
|
4541
4727
|
const index = kids.findIndex(item => {
|
|
@@ -4550,6 +4736,7 @@ var $;
|
|
|
4550
4736
|
kids[index].force_render(path);
|
|
4551
4737
|
}
|
|
4552
4738
|
}
|
|
4739
|
+
/** Renders view to DOM and scroll to it. */
|
|
4553
4740
|
ensure_visible(view, align = "start") {
|
|
4554
4741
|
const path = this.view_find(v => v === view).next().value;
|
|
4555
4742
|
this.force_render(new Set(path));
|
|
@@ -4564,6 +4751,9 @@ var $;
|
|
|
4564
4751
|
const win = this.$.$mol_dom_context;
|
|
4565
4752
|
if (win.parent !== win.self && !win.document.hasFocus())
|
|
4566
4753
|
return;
|
|
4754
|
+
// new this.$.$mol_after_frame( ()=> {
|
|
4755
|
+
// this.dom_node().scrollIntoView({ block: 'start', inline: 'nearest' })
|
|
4756
|
+
// } )
|
|
4567
4757
|
new this.$.$mol_after_timeout(0, () => {
|
|
4568
4758
|
this.focused(true);
|
|
4569
4759
|
});
|
|
@@ -4759,6 +4949,7 @@ var $;
|
|
|
4759
4949
|
"use strict";
|
|
4760
4950
|
var $;
|
|
4761
4951
|
(function ($) {
|
|
4952
|
+
/** Plugin is component without its own DOM element, but instead uses the owner DOM element */
|
|
4762
4953
|
class $mol_plugin extends $mol_view {
|
|
4763
4954
|
dom_node_external(next) {
|
|
4764
4955
|
return next ?? $mol_owning_get(this).host.dom_node();
|
|
@@ -4798,12 +4989,17 @@ var $;
|
|
|
4798
4989
|
;
|
|
4799
4990
|
"use strict";
|
|
4800
4991
|
|
|
4992
|
+
|
|
4801
4993
|
;
|
|
4802
4994
|
"use strict";
|
|
4803
4995
|
var $;
|
|
4804
4996
|
(function ($) {
|
|
4805
4997
|
var $$;
|
|
4806
4998
|
(function ($$) {
|
|
4999
|
+
/**
|
|
5000
|
+
* Plugin which adds handlers for keyboard keys.
|
|
5001
|
+
* @see [mol_keyboard_code](../keyboard/code/code.ts)
|
|
5002
|
+
*/
|
|
4807
5003
|
class $mol_hotkey extends $.$mol_hotkey {
|
|
4808
5004
|
key() {
|
|
4809
5005
|
return super.key();
|
|
@@ -4979,6 +5175,10 @@ var $;
|
|
|
4979
5175
|
"use strict";
|
|
4980
5176
|
var $;
|
|
4981
5177
|
(function ($) {
|
|
5178
|
+
/**
|
|
5179
|
+
* Z-index values for layers
|
|
5180
|
+
* https://page.hyoo.ru/#!=xthcpx_wqmiba
|
|
5181
|
+
*/
|
|
4982
5182
|
$.$mol_layer = $mol_style_prop('mol_layer', [
|
|
4983
5183
|
'hover',
|
|
4984
5184
|
'focus',
|
|
@@ -4998,12 +5198,17 @@ var $;
|
|
|
4998
5198
|
;
|
|
4999
5199
|
"use strict";
|
|
5000
5200
|
|
|
5201
|
+
|
|
5001
5202
|
;
|
|
5002
5203
|
"use strict";
|
|
5003
5204
|
var $;
|
|
5004
5205
|
(function ($) {
|
|
5005
5206
|
var $$;
|
|
5006
5207
|
(function ($$) {
|
|
5208
|
+
/**
|
|
5209
|
+
* An input field for entering single line text.
|
|
5210
|
+
* @see https://mol.hyoo.ru/#!section=demos/demo=mol_string_demo
|
|
5211
|
+
*/
|
|
5007
5212
|
class $mol_string extends $.$mol_string {
|
|
5008
5213
|
event_change(next) {
|
|
5009
5214
|
if (!next)
|
|
@@ -5127,6 +5332,7 @@ var $;
|
|
|
5127
5332
|
;
|
|
5128
5333
|
"use strict";
|
|
5129
5334
|
|
|
5335
|
+
|
|
5130
5336
|
;
|
|
5131
5337
|
"use strict";
|
|
5132
5338
|
var $;
|
|
@@ -5264,12 +5470,17 @@ var $;
|
|
|
5264
5470
|
;
|
|
5265
5471
|
"use strict";
|
|
5266
5472
|
|
|
5473
|
+
|
|
5267
5474
|
;
|
|
5268
5475
|
"use strict";
|
|
5269
5476
|
var $;
|
|
5270
5477
|
(function ($) {
|
|
5271
5478
|
var $$;
|
|
5272
5479
|
(function ($$) {
|
|
5480
|
+
/**
|
|
5481
|
+
* Output text with dimmed mismatched substrings.
|
|
5482
|
+
* @see https://mol.hyoo.ru/#!section=demos/demo=mol_dimmer_demo
|
|
5483
|
+
*/
|
|
5273
5484
|
class $mol_dimmer extends $.$mol_dimmer {
|
|
5274
5485
|
parts() {
|
|
5275
5486
|
const needle = this.needle();
|
|
@@ -5339,6 +5550,7 @@ var $;
|
|
|
5339
5550
|
;
|
|
5340
5551
|
"use strict";
|
|
5341
5552
|
|
|
5553
|
+
|
|
5342
5554
|
;
|
|
5343
5555
|
($.$mol_button) = class $mol_button extends ($.$mol_view) {
|
|
5344
5556
|
event_activate(next){
|
|
@@ -5473,12 +5685,17 @@ var $;
|
|
|
5473
5685
|
;
|
|
5474
5686
|
"use strict";
|
|
5475
5687
|
|
|
5688
|
+
|
|
5476
5689
|
;
|
|
5477
5690
|
"use strict";
|
|
5478
5691
|
var $;
|
|
5479
5692
|
(function ($) {
|
|
5480
5693
|
var $$;
|
|
5481
5694
|
(function ($$) {
|
|
5695
|
+
/**
|
|
5696
|
+
* Simple button.
|
|
5697
|
+
* @see https://mol.hyoo.ru/#!section=demos/demo=mol_button_demo
|
|
5698
|
+
*/
|
|
5482
5699
|
class $mol_button extends $.$mol_button {
|
|
5483
5700
|
disabled() {
|
|
5484
5701
|
return !this.enabled();
|
|
@@ -5494,6 +5711,7 @@ var $;
|
|
|
5494
5711
|
this.status([null]);
|
|
5495
5712
|
}
|
|
5496
5713
|
catch (error) {
|
|
5714
|
+
// Calling actions from catch section, if throwing promise breaks idempotency
|
|
5497
5715
|
Promise.resolve().then(() => this.status([error]));
|
|
5498
5716
|
$mol_fail_hidden(error);
|
|
5499
5717
|
}
|
|
@@ -5563,6 +5781,7 @@ var $;
|
|
|
5563
5781
|
;
|
|
5564
5782
|
"use strict";
|
|
5565
5783
|
|
|
5784
|
+
|
|
5566
5785
|
;
|
|
5567
5786
|
($.$mol_button_minor) = class $mol_button_minor extends ($.$mol_button_typed) {};
|
|
5568
5787
|
|
|
@@ -5577,6 +5796,7 @@ var $;
|
|
|
5577
5796
|
;
|
|
5578
5797
|
"use strict";
|
|
5579
5798
|
|
|
5799
|
+
|
|
5580
5800
|
;
|
|
5581
5801
|
"use strict";
|
|
5582
5802
|
var $;
|
|
@@ -5606,12 +5826,12 @@ var $;
|
|
|
5606
5826
|
`;
|
|
5607
5827
|
const dest = `
|
|
5608
5828
|
query? \\
|
|
5609
|
-
clear?
|
|
5829
|
+
clear? null
|
|
5610
5830
|
Query $mol_string value? <=> query?
|
|
5611
5831
|
Suggest_label $mol_dimmer
|
|
5612
5832
|
needle <= query?
|
|
5613
5833
|
key * escape? <=> clear?
|
|
5614
|
-
Clear $mol_button_minor click?
|
|
5834
|
+
Clear $mol_button_minor click? <=> clear?
|
|
5615
5835
|
`;
|
|
5616
5836
|
const res = normalize($, src, dest);
|
|
5617
5837
|
$mol_assert_equal(res.input, res.output);
|
|
@@ -5633,10 +5853,10 @@ var $;
|
|
|
5633
5853
|
const dest = `
|
|
5634
5854
|
Close_icon ${d}mol_icon_cross
|
|
5635
5855
|
Title ${d}mol_view sub / <= title
|
|
5636
|
-
close?
|
|
5856
|
+
close? null
|
|
5637
5857
|
Close ${d}mol_button
|
|
5638
5858
|
title \\close
|
|
5639
|
-
click?
|
|
5859
|
+
click? <=> close?
|
|
5640
5860
|
title @ \\title
|
|
5641
5861
|
sub2 / <= Close_icon
|
|
5642
5862
|
sub /
|
|
@@ -5682,7 +5902,7 @@ var $;
|
|
|
5682
5902
|
const dest = `
|
|
5683
5903
|
clear? = Suggest_label clear?
|
|
5684
5904
|
Suggest_label $mol_dimmer clear? => clear?
|
|
5685
|
-
Clear $mol_button_minor click?
|
|
5905
|
+
Clear $mol_button_minor click? <=> clear?
|
|
5686
5906
|
`;
|
|
5687
5907
|
const res = normalize($, src, dest);
|
|
5688
5908
|
$mol_assert_equal(res.input, res.output);
|
|
@@ -5698,7 +5918,7 @@ var $;
|
|
|
5698
5918
|
$mol_assert_fail(() => normalize($, src).input, `Need an equal default values at \`/mol/view/tree2/class/props.test.ts#4:16/5\` vs \`/mol/view/tree2/class/props.test.ts#6:23/11\`
|
|
5699
5919
|
<=>
|
|
5700
5920
|
/mol/view/tree2/class/props.test.ts#6:19/3
|
|
5701
|
-
click?
|
|
5921
|
+
click?
|
|
5702
5922
|
/mol/view/tree2/class/props.test.ts#6:7/11
|
|
5703
5923
|
$mol_button_minor
|
|
5704
5924
|
/mol/view/tree2/class/props.test.ts#5:12/17
|
|
@@ -6731,6 +6951,11 @@ var $;
|
|
|
6731
6951
|
"use strict";
|
|
6732
6952
|
var $;
|
|
6733
6953
|
(function ($) {
|
|
6954
|
+
/**
|
|
6955
|
+
* CSS in TS.
|
|
6956
|
+
* Statically typed CSS style sheets. Following samples show which CSS code are generated from TS code.
|
|
6957
|
+
* @see https://mol.hyoo.ru/#!section=docs/=xwq9q5_f966fg
|
|
6958
|
+
*/
|
|
6734
6959
|
function $mol_style_define(Component, config) {
|
|
6735
6960
|
return $mol_style_attach(Component.name, $mol_style_sheet(Component, config));
|
|
6736
6961
|
}
|
|
@@ -6740,12 +6965,17 @@ var $;
|
|
|
6740
6965
|
;
|
|
6741
6966
|
"use strict";
|
|
6742
6967
|
|
|
6968
|
+
|
|
6743
6969
|
;
|
|
6744
6970
|
"use strict";
|
|
6745
6971
|
var $;
|
|
6746
6972
|
(function ($) {
|
|
6747
6973
|
var $$;
|
|
6748
6974
|
(function ($$) {
|
|
6975
|
+
/**
|
|
6976
|
+
* Scrolling pane.
|
|
6977
|
+
* @see https://mol.hyoo.ru/#!section=demos/demo=mol_scroll_demo
|
|
6978
|
+
*/
|
|
6749
6979
|
class $mol_scroll extends $.$mol_scroll {
|
|
6750
6980
|
scroll_top(next, cache) {
|
|
6751
6981
|
const el = this.dom_node();
|
|
@@ -6795,6 +7025,7 @@ var $;
|
|
|
6795
7025
|
direction: 'column',
|
|
6796
7026
|
grow: 1,
|
|
6797
7027
|
shrink: 1,
|
|
7028
|
+
// basis: 0,
|
|
6798
7029
|
},
|
|
6799
7030
|
outline: 'none',
|
|
6800
7031
|
align: {
|
|
@@ -6812,6 +7043,7 @@ var $;
|
|
|
6812
7043
|
contain: 'content',
|
|
6813
7044
|
'>': {
|
|
6814
7045
|
$mol_view: {
|
|
7046
|
+
// transform: 'translateZ(0)', // enforce gpu scroll in all agents
|
|
6815
7047
|
gridArea: '1/1',
|
|
6816
7048
|
},
|
|
6817
7049
|
},
|
|
@@ -6924,6 +7156,7 @@ var $;
|
|
|
6924
7156
|
;
|
|
6925
7157
|
"use strict";
|
|
6926
7158
|
|
|
7159
|
+
|
|
6927
7160
|
;
|
|
6928
7161
|
"use strict";
|
|
6929
7162
|
var $;
|
|
@@ -6944,6 +7177,8 @@ var $;
|
|
|
6944
7177
|
maxHeight: per(100),
|
|
6945
7178
|
boxSizing: 'border-box',
|
|
6946
7179
|
color: $mol_theme.text,
|
|
7180
|
+
// backdropFilter: blur( `3px` ), enforces layering
|
|
7181
|
+
// zIndex: 0 ,
|
|
6947
7182
|
':focus': {
|
|
6948
7183
|
outline: 'none',
|
|
6949
7184
|
},
|
|
@@ -7461,99 +7696,131 @@ var $;
|
|
|
7461
7696
|
;
|
|
7462
7697
|
"use strict";
|
|
7463
7698
|
|
|
7699
|
+
|
|
7464
7700
|
;
|
|
7465
7701
|
"use strict";
|
|
7466
7702
|
|
|
7703
|
+
|
|
7467
7704
|
;
|
|
7468
7705
|
"use strict";
|
|
7469
7706
|
|
|
7707
|
+
|
|
7470
7708
|
;
|
|
7471
7709
|
"use strict";
|
|
7472
7710
|
|
|
7711
|
+
|
|
7473
7712
|
;
|
|
7474
7713
|
"use strict";
|
|
7475
7714
|
|
|
7715
|
+
|
|
7476
7716
|
;
|
|
7477
7717
|
"use strict";
|
|
7478
7718
|
|
|
7719
|
+
|
|
7479
7720
|
;
|
|
7480
7721
|
"use strict";
|
|
7481
7722
|
|
|
7723
|
+
|
|
7482
7724
|
;
|
|
7483
7725
|
"use strict";
|
|
7484
7726
|
|
|
7727
|
+
|
|
7485
7728
|
;
|
|
7486
7729
|
"use strict";
|
|
7487
7730
|
|
|
7731
|
+
|
|
7488
7732
|
;
|
|
7489
7733
|
"use strict";
|
|
7490
7734
|
|
|
7735
|
+
|
|
7491
7736
|
;
|
|
7492
7737
|
"use strict";
|
|
7493
7738
|
|
|
7739
|
+
|
|
7494
7740
|
;
|
|
7495
7741
|
"use strict";
|
|
7496
7742
|
|
|
7743
|
+
|
|
7497
7744
|
;
|
|
7498
7745
|
"use strict";
|
|
7499
7746
|
|
|
7747
|
+
|
|
7500
7748
|
;
|
|
7501
7749
|
"use strict";
|
|
7502
7750
|
|
|
7751
|
+
|
|
7503
7752
|
;
|
|
7504
7753
|
"use strict";
|
|
7505
7754
|
|
|
7755
|
+
|
|
7506
7756
|
;
|
|
7507
7757
|
"use strict";
|
|
7508
7758
|
|
|
7759
|
+
|
|
7509
7760
|
;
|
|
7510
7761
|
"use strict";
|
|
7511
7762
|
|
|
7763
|
+
|
|
7512
7764
|
;
|
|
7513
7765
|
"use strict";
|
|
7514
7766
|
|
|
7767
|
+
|
|
7515
7768
|
;
|
|
7516
7769
|
"use strict";
|
|
7517
7770
|
|
|
7771
|
+
|
|
7518
7772
|
;
|
|
7519
7773
|
"use strict";
|
|
7520
7774
|
|
|
7775
|
+
|
|
7521
7776
|
;
|
|
7522
7777
|
"use strict";
|
|
7523
7778
|
|
|
7779
|
+
|
|
7524
7780
|
;
|
|
7525
7781
|
"use strict";
|
|
7526
7782
|
|
|
7783
|
+
|
|
7527
7784
|
;
|
|
7528
7785
|
"use strict";
|
|
7529
7786
|
|
|
7787
|
+
|
|
7530
7788
|
;
|
|
7531
7789
|
"use strict";
|
|
7532
7790
|
|
|
7791
|
+
|
|
7533
7792
|
;
|
|
7534
7793
|
"use strict";
|
|
7535
7794
|
|
|
7795
|
+
|
|
7536
7796
|
;
|
|
7537
7797
|
"use strict";
|
|
7538
7798
|
|
|
7799
|
+
|
|
7539
7800
|
;
|
|
7540
7801
|
"use strict";
|
|
7541
7802
|
|
|
7803
|
+
|
|
7542
7804
|
;
|
|
7543
7805
|
"use strict";
|
|
7544
7806
|
|
|
7807
|
+
|
|
7545
7808
|
;
|
|
7546
7809
|
"use strict";
|
|
7547
7810
|
|
|
7811
|
+
|
|
7548
7812
|
;
|
|
7549
7813
|
"use strict";
|
|
7550
7814
|
|
|
7815
|
+
|
|
7551
7816
|
;
|
|
7552
7817
|
"use strict";
|
|
7553
7818
|
|
|
7819
|
+
|
|
7554
7820
|
;
|
|
7555
7821
|
"use strict";
|
|
7556
7822
|
|
|
7823
|
+
|
|
7557
7824
|
;
|
|
7558
7825
|
"use strict";
|
|
7559
7826
|
var $;
|
|
@@ -7589,45 +7856,59 @@ var $;
|
|
|
7589
7856
|
;
|
|
7590
7857
|
"use strict";
|
|
7591
7858
|
|
|
7859
|
+
|
|
7592
7860
|
;
|
|
7593
7861
|
"use strict";
|
|
7594
7862
|
|
|
7863
|
+
|
|
7595
7864
|
;
|
|
7596
7865
|
"use strict";
|
|
7597
7866
|
|
|
7867
|
+
|
|
7598
7868
|
;
|
|
7599
7869
|
"use strict";
|
|
7600
7870
|
|
|
7871
|
+
|
|
7601
7872
|
;
|
|
7602
7873
|
"use strict";
|
|
7603
7874
|
|
|
7875
|
+
|
|
7604
7876
|
;
|
|
7605
7877
|
"use strict";
|
|
7606
7878
|
|
|
7879
|
+
|
|
7607
7880
|
;
|
|
7608
7881
|
"use strict";
|
|
7609
7882
|
|
|
7883
|
+
|
|
7610
7884
|
;
|
|
7611
7885
|
"use strict";
|
|
7612
7886
|
|
|
7887
|
+
|
|
7613
7888
|
;
|
|
7614
7889
|
"use strict";
|
|
7615
7890
|
|
|
7891
|
+
|
|
7616
7892
|
;
|
|
7617
7893
|
"use strict";
|
|
7618
7894
|
|
|
7895
|
+
|
|
7619
7896
|
;
|
|
7620
7897
|
"use strict";
|
|
7621
7898
|
|
|
7899
|
+
|
|
7622
7900
|
;
|
|
7623
7901
|
"use strict";
|
|
7624
7902
|
|
|
7903
|
+
|
|
7625
7904
|
;
|
|
7626
7905
|
"use strict";
|
|
7627
7906
|
|
|
7907
|
+
|
|
7628
7908
|
;
|
|
7629
7909
|
"use strict";
|
|
7630
7910
|
|
|
7911
|
+
|
|
7631
7912
|
;
|
|
7632
7913
|
"use strict";
|
|
7633
7914
|
var $;
|
|
@@ -7715,13 +7996,13 @@ var $;
|
|
|
7715
7996
|
$mol_view_tree2_to_js_test_run(`
|
|
7716
7997
|
Foo $mol_view
|
|
7717
7998
|
a!? $mol_view
|
|
7718
|
-
expanded <=> cell_test_expanded!? null
|
|
7999
|
+
expanded? <=> cell_test_expanded!? null
|
|
7719
8000
|
`);
|
|
7720
|
-
}, `Required prop like some*? at \`.view.tree#4:
|
|
8001
|
+
}, `Required prop like some*? at \`.view.tree#4:22/20\`
|
|
7721
8002
|
<=>
|
|
7722
|
-
.view.tree#4:
|
|
7723
|
-
expanded
|
|
7724
|
-
.view.tree#4:8/
|
|
8003
|
+
.view.tree#4:18/3
|
|
8004
|
+
expanded?
|
|
8005
|
+
.view.tree#4:8/9
|
|
7725
8006
|
$mol_view
|
|
7726
8007
|
.view.tree#3:11/9
|
|
7727
8008
|
a!?
|
|
@@ -7755,7 +8036,9 @@ var $;
|
|
|
7755
8036
|
'Left bind read only'($) {
|
|
7756
8037
|
const _foo = $mol_view_tree2_to_js_test_ex_left_read_only_foo;
|
|
7757
8038
|
const foo = _foo.make({ $ });
|
|
7758
|
-
$mol_assert_like(foo.bar1(),
|
|
8039
|
+
$mol_assert_like(foo.bar1(),
|
|
8040
|
+
// @ts-ignore
|
|
8041
|
+
foo.bar1(2), foo.bar1(), foo.bar2(), 1);
|
|
7759
8042
|
$mol_assert_like(foo.bar2(2), foo.bar1(), 2);
|
|
7760
8043
|
},
|
|
7761
8044
|
'Left bind second level index'($) {
|
|
@@ -7782,7 +8065,11 @@ var $;
|
|
|
7782
8065
|
const foo = _foo.make({ $ });
|
|
7783
8066
|
$mol_assert_equal(foo.d(), foo.c(), foo.b(), foo.a(), 0);
|
|
7784
8067
|
$mol_assert_equal(foo.d(1), foo.c(), foo.b(), foo.a(), 1);
|
|
7785
|
-
$mol_assert_equal(
|
|
8068
|
+
$mol_assert_equal(
|
|
8069
|
+
// @ts-ignore
|
|
8070
|
+
foo.a(2),
|
|
8071
|
+
// @ts-ignore
|
|
8072
|
+
foo.b(2), foo.c(), foo.d(), 1);
|
|
7786
8073
|
$mol_assert_equal(foo.c(2), foo.b(), foo.a(), 2);
|
|
7787
8074
|
$mol_assert_equal(foo.d(1), 1);
|
|
7788
8075
|
$mol_assert_equal(foo.d(3), foo.c(), foo.b(), foo.a(), 3);
|
|
@@ -7818,6 +8105,10 @@ var $;
|
|
|
7818
8105
|
'Array of array or object'($) {
|
|
7819
8106
|
const _foo = $mol_view_tree2_to_js_test_ex_array_of_array_or_object_foo;
|
|
7820
8107
|
const foo = _foo.make({ $ });
|
|
8108
|
+
// type a1 = $mol_type_assert<
|
|
8109
|
+
// ReturnType<typeof foo.complex>,
|
|
8110
|
+
// readonly (readonly(number | string)[] | Record<string, number | string>)[]
|
|
8111
|
+
// >
|
|
7821
8112
|
$mol_assert_like(foo.complex(), ['1', [true], ['1', 21], { a: 1, str: 'some' }]);
|
|
7822
8113
|
},
|
|
7823
8114
|
'Array inheritance'($) {
|
|
@@ -7909,7 +8200,9 @@ var $;
|
|
|
7909
8200
|
'simple mutable and read only channels'($) {
|
|
7910
8201
|
const _foo = $mol_view_tree2_to_js_test_ex_simple_mutable_and_read_only_foo;
|
|
7911
8202
|
const foo = _foo.make({ $ });
|
|
7912
|
-
$mol_assert_equal(foo.readonly(),
|
|
8203
|
+
$mol_assert_equal(foo.readonly(),
|
|
8204
|
+
// @ts-ignore
|
|
8205
|
+
foo.readonly(1), foo.readonly(), null);
|
|
7913
8206
|
$mol_assert_equal(foo.mutable(), null);
|
|
7914
8207
|
$mol_assert_equal(foo.mutable(2), foo.mutable(), 2);
|
|
7915
8208
|
},
|