@builder.io/mitosis 0.11.2 → 0.11.3
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.
|
@@ -393,7 +393,7 @@ const blockToAngular = ({ root, json, options = {}, blockOptions = {
|
|
|
393
393
|
// Add ref for passing attributes
|
|
394
394
|
str += `#${rootRef}`;
|
|
395
395
|
}
|
|
396
|
-
if (html_tags_1.SELF_CLOSING_HTML_TAGS.has(
|
|
396
|
+
if (html_tags_1.SELF_CLOSING_HTML_TAGS.has(element)) {
|
|
397
397
|
return str + ' />';
|
|
398
398
|
}
|
|
399
399
|
str += '>';
|
|
@@ -10,6 +10,7 @@ const parse_selector_1 = require("../../../generators/angular/helpers/parse-sele
|
|
|
10
10
|
const babel_transform_1 = require("../../../helpers/babel-transform");
|
|
11
11
|
const bindings_1 = require("../../../helpers/bindings");
|
|
12
12
|
const event_handlers_1 = require("../../../helpers/event-handlers");
|
|
13
|
+
const get_tag_name_1 = require("../../../helpers/get-tag-name");
|
|
13
14
|
const is_children_1 = __importDefault(require("../../../helpers/is-children"));
|
|
14
15
|
const is_mitosis_node_1 = require("../../../helpers/is-mitosis-node");
|
|
15
16
|
const slots_1 = require("../../../helpers/slots");
|
|
@@ -268,22 +269,23 @@ const getElementTag = (json, blockOptions) => {
|
|
|
268
269
|
const childComponents = (blockOptions === null || blockOptions === void 0 ? void 0 : blockOptions.childComponents) || [];
|
|
269
270
|
let element, classNames = [], attributes;
|
|
270
271
|
const isComponent = childComponents.find((impName) => impName === json.name);
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}
|
|
277
|
-
catch (_a) {
|
|
278
|
-
element = (0, lodash_1.kebabCase)(json.name);
|
|
279
|
-
}
|
|
272
|
+
const tagName = (0, get_tag_name_1.getBuilderTagName)(json);
|
|
273
|
+
const selector = json.meta.selector || (blockOptions === null || blockOptions === void 0 ? void 0 : blockOptions.selector);
|
|
274
|
+
if (selector) {
|
|
275
|
+
try {
|
|
276
|
+
({ element, classNames, attributes } = (0, parse_selector_1.parseSelector)(`${selector}`));
|
|
280
277
|
}
|
|
281
|
-
|
|
282
|
-
element = (0, lodash_1.kebabCase)(json.name);
|
|
278
|
+
catch (_a) {
|
|
279
|
+
element = tagName !== null && tagName !== void 0 ? tagName : (0, lodash_1.kebabCase)(json.name);
|
|
283
280
|
}
|
|
284
281
|
}
|
|
285
|
-
|
|
286
|
-
|
|
282
|
+
if (!element) {
|
|
283
|
+
if (isComponent) {
|
|
284
|
+
element = tagName !== null && tagName !== void 0 ? tagName : (0, lodash_1.kebabCase)(json.name);
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
element = tagName !== null && tagName !== void 0 ? tagName : json.name;
|
|
288
|
+
}
|
|
287
289
|
}
|
|
288
290
|
let additionalString = '';
|
|
289
291
|
// TODO: merge with existing classes/bindings
|
|
@@ -362,7 +364,7 @@ const blockToAngularSignals = ({ root, json, options = {}, blockOptions = {
|
|
|
362
364
|
// Add ref for passing attributes
|
|
363
365
|
str += `#${rootRef}`;
|
|
364
366
|
}
|
|
365
|
-
if (html_tags_1.SELF_CLOSING_HTML_TAGS.has(
|
|
367
|
+
if (html_tags_1.SELF_CLOSING_HTML_TAGS.has(element)) {
|
|
366
368
|
return str + ' />';
|
|
367
369
|
}
|
|
368
370
|
str += '>';
|