mol_jsx_lib 0.0.58 → 0.0.61
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 +2 -0
- package/node.deps.json +1 -1
- package/node.esm.js +16 -0
- package/node.esm.js.map +1 -1
- package/node.js +16 -0
- package/node.js.map +1 -1
- package/node.test.js +30 -12
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.d.ts +2 -0
- package/web.deps.json +1 -1
- package/web.esm.js +16 -0
- package/web.esm.js.map +1 -1
- package/web.js +16 -0
- package/web.js.map +1 -1
- package/web.test.js +14 -12
- 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" id="foo">hey!</button>');
|
|
329
|
+
$mol_assert_equal(dom.outerHTML, '<button title="click me" id="foo" class="Button">hey!</button>');
|
|
330
330
|
},
|
|
331
331
|
'Nested guid generation'() {
|
|
332
332
|
const Foo = () => {
|
|
@@ -335,10 +335,12 @@ var $;
|
|
|
335
335
|
$mol_jsx("img", { id: "icon" })));
|
|
336
336
|
};
|
|
337
337
|
const Bar = (props, icon) => {
|
|
338
|
-
return $mol_jsx("span", null,
|
|
338
|
+
return $mol_jsx("span", null,
|
|
339
|
+
icon,
|
|
340
|
+
$mol_jsx("i", { id: "label" }));
|
|
339
341
|
};
|
|
340
342
|
const dom = $mol_jsx(Foo, { id: "foo" });
|
|
341
|
-
$mol_assert_equal(dom.outerHTML, '<div id="foo"><span id="foo/bar"><img id="foo/icon"></span></div>');
|
|
343
|
+
$mol_assert_equal(dom.outerHTML, '<div id="foo" class="Foo"><span id="foo/bar" class="Foo_bar Bar"><img id="foo/icon" class="Foo_icon"><i id="foo/bar/label" class="Foo_bar_label Bar_label"></i></span></div>');
|
|
342
344
|
},
|
|
343
345
|
'Fail on non unique ids'() {
|
|
344
346
|
const App = () => {
|
|
@@ -351,13 +353,13 @@ var $;
|
|
|
351
353
|
'Owner based guid generationn'() {
|
|
352
354
|
const Foo = () => {
|
|
353
355
|
return $mol_jsx("div", null,
|
|
354
|
-
$mol_jsx(Bar, { id: "
|
|
356
|
+
$mol_jsx(Bar, { id: "middle", icon: () => $mol_jsx("img", { id: "icon" }) }));
|
|
355
357
|
};
|
|
356
358
|
const Bar = (props) => {
|
|
357
359
|
return $mol_jsx("span", null, props.icon());
|
|
358
360
|
};
|
|
359
|
-
const dom = $mol_jsx(Foo, { id: "
|
|
360
|
-
$mol_assert_equal(dom.outerHTML, '<div id="
|
|
361
|
+
const dom = $mol_jsx(Foo, { id: "app" });
|
|
362
|
+
$mol_assert_equal(dom.outerHTML, '<div id="app" class="Foo"><span id="app/middle" class="Foo_middle Bar"><img id="app/icon" class="Foo_icon"></span></div>');
|
|
361
363
|
},
|
|
362
364
|
'Fail on same ids from different caller'() {
|
|
363
365
|
const Foo = () => {
|
|
@@ -1451,7 +1453,7 @@ var $;
|
|
|
1451
1453
|
const dom = $mol_jsx(Foo, { id: "foo", title: "bar" },
|
|
1452
1454
|
"xxx",
|
|
1453
1455
|
123);
|
|
1454
|
-
$mol_assert_equal(dom.outerHTML, '<div id="foo">bar xxx-123</div>');
|
|
1456
|
+
$mol_assert_equal(dom.outerHTML, '<div id="foo" class="Foo">bar xxx-123</div>');
|
|
1455
1457
|
},
|
|
1456
1458
|
'View by element'() {
|
|
1457
1459
|
let br;
|
|
@@ -1485,10 +1487,10 @@ var $;
|
|
|
1485
1487
|
const dom = $mol_jsx_attach(doc, () => $mol_jsx(Title, { id: "foo" }));
|
|
1486
1488
|
const title = Title.of(dom);
|
|
1487
1489
|
$mol_assert_equal(title.ownerDocument, doc);
|
|
1488
|
-
$mol_assert_equal(doc.documentElement.outerHTML, '<html><body id="foo">foo</body></html>');
|
|
1490
|
+
$mol_assert_equal(doc.documentElement.outerHTML, '<html><body id="foo" class="Title">foo</body></html>');
|
|
1489
1491
|
title.value('bar');
|
|
1490
1492
|
await $mol_wire_fiber.sync();
|
|
1491
|
-
$mol_assert_equal(doc.documentElement.outerHTML, '<html><body id="foo">bar</body></html>');
|
|
1493
|
+
$mol_assert_equal(doc.documentElement.outerHTML, '<html><body id="foo" class="Title">bar</body></html>');
|
|
1492
1494
|
},
|
|
1493
1495
|
async 'Nested bound views'($) {
|
|
1494
1496
|
class Task extends $mol_jsx_view {
|
|
@@ -1516,15 +1518,15 @@ var $;
|
|
|
1516
1518
|
], App.prototype, "title", null);
|
|
1517
1519
|
const doc = $mol_dom_parse('<html xmlns="http://www.w3.org/1999/xhtml"><body id="root"></body></html>');
|
|
1518
1520
|
const root = $.$mol_jsx_attach(doc, () => $mol_jsx(App, { "$": $, id: "root" }));
|
|
1519
|
-
$mol_assert_equal($mol_dom_serialize(doc.documentElement), '<html xmlns="http://www.w3.org/1999/xhtml"><body id="root" class="list"></body></html>');
|
|
1521
|
+
$mol_assert_equal($mol_dom_serialize(doc.documentElement), '<html xmlns="http://www.w3.org/1999/xhtml"><body id="root" class="list App List"></body></html>');
|
|
1520
1522
|
App.of(root).title('barbar');
|
|
1521
1523
|
await $mol_wire_fiber.sync();
|
|
1522
1524
|
$mol_assert_equal(Task.of(root.firstElementChild).title(), 'barbar');
|
|
1523
|
-
$mol_assert_equal(doc.documentElement.outerHTML, '<html xmlns="http://www.w3.org/1999/xhtml"><body id="root" class="list"><h1 id="root/task">barbar</h1></body></html>');
|
|
1525
|
+
$mol_assert_equal(doc.documentElement.outerHTML, '<html xmlns="http://www.w3.org/1999/xhtml"><body id="root" class="list App List"><h1 id="root/task" class="App_task Task">barbar</h1></body></html>');
|
|
1524
1526
|
Task.of(root.firstElementChild).title('foofoo');
|
|
1525
1527
|
await $mol_wire_fiber.sync();
|
|
1526
1528
|
$mol_assert_equal(App.of(root).title(), 'foofoo');
|
|
1527
|
-
$mol_assert_equal(doc.documentElement.outerHTML, '<html xmlns="http://www.w3.org/1999/xhtml"><body id="root" class="list"><h1 id="root/task">foofoo</h1></body></html>');
|
|
1529
|
+
$mol_assert_equal(doc.documentElement.outerHTML, '<html xmlns="http://www.w3.org/1999/xhtml"><body id="root" class="list App List"><h1 id="root/task" class="App_task Task">foofoo</h1></body></html>');
|
|
1528
1530
|
},
|
|
1529
1531
|
});
|
|
1530
1532
|
})($ || ($ = {}));
|