mol_jsx_lib 0.0.59 → 0.0.60
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.esm.js +1 -1
- package/node.esm.js.map +1 -1
- package/node.js +1 -1
- package/node.js.map +1 -1
- package/node.test.js +5 -3
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.esm.js +1 -1
- package/web.esm.js.map +1 -1
- package/web.js +1 -1
- package/web.js.map +1 -1
- package/web.test.js +4 -2
- package/web.test.js.map +1 -1
package/node.test.js
CHANGED
|
@@ -820,7 +820,7 @@ var $;
|
|
|
820
820
|
function $mol_jsx(Elem, props, ...childNodes) {
|
|
821
821
|
const id = props && props.id || '';
|
|
822
822
|
const guid = id ? $.$mol_jsx_prefix ? $.$mol_jsx_prefix + '/' + id : id : $.$mol_jsx_prefix;
|
|
823
|
-
const crumbs_self = id ? $.$mol_jsx_crumbs.replace(/(
|
|
823
|
+
const crumbs_self = id ? $.$mol_jsx_crumbs.replace(/(\S+)/g, `$1_${id}`) : $.$mol_jsx_crumbs;
|
|
824
824
|
if (Elem && $.$mol_jsx_booked) {
|
|
825
825
|
if ($.$mol_jsx_booked.has(id)) {
|
|
826
826
|
$mol_fail(new Error(`JSX already has tag with id ${JSON.stringify(guid)}`));
|
|
@@ -2834,10 +2834,12 @@ var $;
|
|
|
2834
2834
|
$mol_jsx("img", { id: "icon" })));
|
|
2835
2835
|
};
|
|
2836
2836
|
const Bar = (props, icon) => {
|
|
2837
|
-
return $mol_jsx("span", null,
|
|
2837
|
+
return $mol_jsx("span", null,
|
|
2838
|
+
icon,
|
|
2839
|
+
$mol_jsx("i", { id: "label" }));
|
|
2838
2840
|
};
|
|
2839
2841
|
const dom = $mol_jsx(Foo, { id: "foo" });
|
|
2840
|
-
$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"></span></div>');
|
|
2842
|
+
$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>');
|
|
2841
2843
|
},
|
|
2842
2844
|
'Fail on non unique ids'() {
|
|
2843
2845
|
const App = () => {
|