mol_jsx_lib 0.0.63 → 0.0.66
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 +15 -17
- package/node.deps.json +1 -1
- package/node.esm.js +51 -58
- package/node.esm.js.map +1 -1
- package/node.js +51 -58
- package/node.js.map +1 -1
- package/node.test.js +127 -107
- package/node.test.js.map +1 -1
- package/package.json +5 -5
- package/web.d.ts +15 -17
- package/web.deps.json +1 -1
- package/web.esm.js +51 -58
- package/web.esm.js.map +1 -1
- package/web.js +51 -58
- package/web.js.map +1 -1
- package/web.test.js +76 -49
- package/web.test.js.map +1 -1
package/web.test.js
CHANGED
|
@@ -326,7 +326,7 @@ var $;
|
|
|
326
326
|
return $mol_jsx("button", { title: props.hint }, target());
|
|
327
327
|
};
|
|
328
328
|
const dom = $mol_jsx(Button, { id: "foo", hint: "click me" }, () => 'hey!');
|
|
329
|
-
$mol_assert_equal(dom.outerHTML, '<button title="click me"
|
|
329
|
+
$mol_assert_equal(dom.outerHTML, '<button id="foo" title="click me" class="Button">hey!</button>');
|
|
330
330
|
},
|
|
331
331
|
'Nested guid generation'() {
|
|
332
332
|
const Foo = () => {
|
|
@@ -1344,6 +1344,33 @@ var $;
|
|
|
1344
1344
|
$mol_assert_equal(Fib.value(4), 8);
|
|
1345
1345
|
$mol_assert_equal(Fib.sums, 6);
|
|
1346
1346
|
},
|
|
1347
|
+
'Unsubscribe from temp pubs on complete'($) {
|
|
1348
|
+
class Random extends $mol_object2 {
|
|
1349
|
+
static $ = $;
|
|
1350
|
+
static seed() {
|
|
1351
|
+
return Math.random();
|
|
1352
|
+
}
|
|
1353
|
+
static resets(next) {
|
|
1354
|
+
return Math.random();
|
|
1355
|
+
}
|
|
1356
|
+
static value() {
|
|
1357
|
+
this.resets();
|
|
1358
|
+
return this.seed();
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
__decorate([
|
|
1362
|
+
$mol_wire_method
|
|
1363
|
+
], Random, "seed", null);
|
|
1364
|
+
__decorate([
|
|
1365
|
+
$mol_wire_mem(0)
|
|
1366
|
+
], Random, "resets", null);
|
|
1367
|
+
__decorate([
|
|
1368
|
+
$mol_wire_mem(0)
|
|
1369
|
+
], Random, "value", null);
|
|
1370
|
+
const first = Random.value();
|
|
1371
|
+
Random.resets(null);
|
|
1372
|
+
$mol_assert_unique(Random.value(), first);
|
|
1373
|
+
},
|
|
1347
1374
|
});
|
|
1348
1375
|
})($ || ($ = {}));
|
|
1349
1376
|
//mol/wire/mem/mem.test.ts
|
|
@@ -1376,6 +1403,19 @@ var $;
|
|
|
1376
1403
|
;
|
|
1377
1404
|
"use strict";
|
|
1378
1405
|
var $;
|
|
1406
|
+
(function ($) {
|
|
1407
|
+
$mol_test({
|
|
1408
|
+
'const returns stored value'() {
|
|
1409
|
+
const foo = { bar: $mol_const(Math.random()) };
|
|
1410
|
+
$mol_assert_equal(foo.bar(), foo.bar());
|
|
1411
|
+
$mol_assert_equal(foo.bar(), foo.bar['()']);
|
|
1412
|
+
},
|
|
1413
|
+
});
|
|
1414
|
+
})($ || ($ = {}));
|
|
1415
|
+
//mol/const/const.test.ts
|
|
1416
|
+
;
|
|
1417
|
+
"use strict";
|
|
1418
|
+
var $;
|
|
1379
1419
|
(function ($) {
|
|
1380
1420
|
$mol_test({
|
|
1381
1421
|
'Primitives'() {
|
|
@@ -1438,6 +1478,41 @@ var $;
|
|
|
1438
1478
|
;
|
|
1439
1479
|
"use strict";
|
|
1440
1480
|
var $;
|
|
1481
|
+
(function ($_1) {
|
|
1482
|
+
$mol_test({
|
|
1483
|
+
'Cached field'($) {
|
|
1484
|
+
class App extends $mol_object2 {
|
|
1485
|
+
static $ = $;
|
|
1486
|
+
static low = 1;
|
|
1487
|
+
static get high() {
|
|
1488
|
+
return this.low + 1;
|
|
1489
|
+
}
|
|
1490
|
+
static set high(next) {
|
|
1491
|
+
this.low = next - 1;
|
|
1492
|
+
}
|
|
1493
|
+
static test() {
|
|
1494
|
+
$mol_assert_equal(App.high, 2);
|
|
1495
|
+
App.high = 3;
|
|
1496
|
+
$mol_assert_equal(App.high, 3);
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
__decorate([
|
|
1500
|
+
$mol_wire_field
|
|
1501
|
+
], App, "low", void 0);
|
|
1502
|
+
__decorate([
|
|
1503
|
+
$mol_wire_field
|
|
1504
|
+
], App, "high", null);
|
|
1505
|
+
__decorate([
|
|
1506
|
+
$mol_wire_method
|
|
1507
|
+
], App, "test", null);
|
|
1508
|
+
App.test();
|
|
1509
|
+
},
|
|
1510
|
+
});
|
|
1511
|
+
})($ || ($ = {}));
|
|
1512
|
+
//mol/wire/field/field.test.ts
|
|
1513
|
+
;
|
|
1514
|
+
"use strict";
|
|
1515
|
+
var $;
|
|
1441
1516
|
(function ($_1) {
|
|
1442
1517
|
$mol_test({
|
|
1443
1518
|
'Class as component'() {
|
|
@@ -1534,54 +1609,6 @@ var $;
|
|
|
1534
1609
|
;
|
|
1535
1610
|
"use strict";
|
|
1536
1611
|
var $;
|
|
1537
|
-
(function ($) {
|
|
1538
|
-
$mol_test({
|
|
1539
|
-
'const returns stored value'() {
|
|
1540
|
-
const foo = { bar: $mol_const(Math.random()) };
|
|
1541
|
-
$mol_assert_equal(foo.bar(), foo.bar());
|
|
1542
|
-
$mol_assert_equal(foo.bar(), foo.bar['()']);
|
|
1543
|
-
},
|
|
1544
|
-
});
|
|
1545
|
-
})($ || ($ = {}));
|
|
1546
|
-
//mol/const/const.test.ts
|
|
1547
|
-
;
|
|
1548
|
-
"use strict";
|
|
1549
|
-
var $;
|
|
1550
|
-
(function ($_1) {
|
|
1551
|
-
$mol_test({
|
|
1552
|
-
'Cached field'($) {
|
|
1553
|
-
class App extends $mol_object2 {
|
|
1554
|
-
static $ = $;
|
|
1555
|
-
static low = 1;
|
|
1556
|
-
static get high() {
|
|
1557
|
-
return this.low + 1;
|
|
1558
|
-
}
|
|
1559
|
-
static set high(next) {
|
|
1560
|
-
this.low = next - 1;
|
|
1561
|
-
}
|
|
1562
|
-
static test() {
|
|
1563
|
-
$mol_assert_equal(App.high, 2);
|
|
1564
|
-
App.high = 3;
|
|
1565
|
-
$mol_assert_equal(App.high, 3);
|
|
1566
|
-
}
|
|
1567
|
-
}
|
|
1568
|
-
__decorate([
|
|
1569
|
-
$mol_wire_field
|
|
1570
|
-
], App, "low", void 0);
|
|
1571
|
-
__decorate([
|
|
1572
|
-
$mol_wire_field
|
|
1573
|
-
], App, "high", null);
|
|
1574
|
-
__decorate([
|
|
1575
|
-
$mol_wire_method
|
|
1576
|
-
], App, "test", null);
|
|
1577
|
-
App.test();
|
|
1578
|
-
},
|
|
1579
|
-
});
|
|
1580
|
-
})($ || ($ = {}));
|
|
1581
|
-
//mol/wire/field/field.test.ts
|
|
1582
|
-
;
|
|
1583
|
-
"use strict";
|
|
1584
|
-
var $;
|
|
1585
1612
|
(function ($_1) {
|
|
1586
1613
|
$mol_test({
|
|
1587
1614
|
'Watch one value'($) {
|