mol_jsx_lib 0.0.60 → 0.0.63
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.deps.json +1 -1
- package/node.esm.js +5 -3
- package/node.esm.js.map +1 -1
- package/node.js +5 -3
- 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.deps.json +1 -1
- package/web.esm.js +5 -3
- package/web.esm.js.map +1 -1
- package/web.js +5 -3
- package/web.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(/(\S+)/g, `$1_${id}`) : $.$mol_jsx_crumbs;
|
|
823
|
+
const crumbs_self = id ? $.$mol_jsx_crumbs.replace(/(\S+)/g, `$1_${id.replace(/\/.*/i, '')}`) : $.$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)}`));
|
|
@@ -896,7 +896,11 @@ var $;
|
|
|
896
896
|
$mol_dom_render_children(node, [].concat(...childNodes));
|
|
897
897
|
if (!Elem)
|
|
898
898
|
return node;
|
|
899
|
+
if (guid)
|
|
900
|
+
node.id = guid;
|
|
899
901
|
for (const key in props) {
|
|
902
|
+
if (key === 'id')
|
|
903
|
+
continue;
|
|
900
904
|
if (typeof props[key] === 'string') {
|
|
901
905
|
;
|
|
902
906
|
node.setAttribute(key, props[key]);
|
|
@@ -913,8 +917,6 @@ var $;
|
|
|
913
917
|
node[key] = props[key];
|
|
914
918
|
}
|
|
915
919
|
}
|
|
916
|
-
if (guid)
|
|
917
|
-
node.id = guid;
|
|
918
920
|
if ($.$mol_jsx_crumbs)
|
|
919
921
|
node.className = (props?.['class'] ? props['class'] + ' ' : '') + crumbs_self;
|
|
920
922
|
return node;
|