mol_data_all 1.1.359 → 1.1.362
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.test.js +6 -4
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.test.js +6 -4
- package/web.test.js.map +1 -1
package/node.test.js
CHANGED
|
@@ -836,7 +836,7 @@ var $;
|
|
|
836
836
|
return $mol_jsx("button", { title: props.hint }, target());
|
|
837
837
|
};
|
|
838
838
|
const dom = $mol_jsx(Button, { id: "foo", hint: "click me" }, () => 'hey!');
|
|
839
|
-
$mol_assert_equal(dom.outerHTML, '<button title="click me"
|
|
839
|
+
$mol_assert_equal(dom.outerHTML, '<button id="foo" title="click me" class="Button">hey!</button>');
|
|
840
840
|
},
|
|
841
841
|
'Nested guid generation'() {
|
|
842
842
|
const Foo = () => {
|
|
@@ -901,7 +901,7 @@ var $;
|
|
|
901
901
|
function $mol_jsx(Elem, props, ...childNodes) {
|
|
902
902
|
const id = props && props.id || '';
|
|
903
903
|
const guid = id ? $.$mol_jsx_prefix ? $.$mol_jsx_prefix + '/' + id : id : $.$mol_jsx_prefix;
|
|
904
|
-
const crumbs_self = id ? $.$mol_jsx_crumbs.replace(/(\S+)/g, `$1_${id}`) : $.$mol_jsx_crumbs;
|
|
904
|
+
const crumbs_self = id ? $.$mol_jsx_crumbs.replace(/(\S+)/g, `$1_${id.replace(/\/.*/i, '')}`) : $.$mol_jsx_crumbs;
|
|
905
905
|
if (Elem && $.$mol_jsx_booked) {
|
|
906
906
|
if ($.$mol_jsx_booked.has(id)) {
|
|
907
907
|
$mol_fail(new Error(`JSX already has tag with id ${JSON.stringify(guid)}`));
|
|
@@ -977,7 +977,11 @@ var $;
|
|
|
977
977
|
$mol_dom_render_children(node, [].concat(...childNodes));
|
|
978
978
|
if (!Elem)
|
|
979
979
|
return node;
|
|
980
|
+
if (guid)
|
|
981
|
+
node.id = guid;
|
|
980
982
|
for (const key in props) {
|
|
983
|
+
if (key === 'id')
|
|
984
|
+
continue;
|
|
981
985
|
if (typeof props[key] === 'string') {
|
|
982
986
|
;
|
|
983
987
|
node.setAttribute(key, props[key]);
|
|
@@ -994,8 +998,6 @@ var $;
|
|
|
994
998
|
node[key] = props[key];
|
|
995
999
|
}
|
|
996
1000
|
}
|
|
997
|
-
if (guid)
|
|
998
|
-
node.id = guid;
|
|
999
1001
|
if ($.$mol_jsx_crumbs)
|
|
1000
1002
|
node.className = (props?.['class'] ? props['class'] + ' ' : '') + crumbs_self;
|
|
1001
1003
|
return node;
|