@wavemaker-ai/react-codegen 1.0.0-rc.328 → 1.0.0-rc.332
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/build-react-web.js +14 -0
- package/build-react-web.js.map +1 -1
- package/dist/transpiler/index.d.mts +5 -0
- package/dist/transpiler/index.mjs +257 -186
- package/dist/transpiler/index.mjs.map +1 -1
- package/dist/transpiler/wm-styles.css +0 -4
- package/package-lock.json +122 -105
- package/package.json +1 -1
- package/src/app.generator.js +44 -15
- package/src/app.generator.js.map +1 -1
- package/src/externalize-next-scripts.js +166 -0
- package/src/externalize-next-scripts.js.map +1 -0
- package/src/transpile/components/data/form/form-action.transformer.js +4 -3
- package/src/transpile/components/data/form/form-action.transformer.js.map +1 -1
- package/src/transpile/components/data/list/list-transformer.js +9 -18
- package/src/transpile/components/data/list/list-transformer.js.map +1 -1
- package/src/transpile/components/form/button.transformer.js +1 -1
- package/src/transpile/components/form/button.transformer.js.map +1 -1
- package/src/transpile/components/layout/layout-region-factory.js +10 -0
- package/src/transpile/components/layout/layout-region-factory.js.map +1 -1
- package/src/transpile/components/page/with-partial-container.js +2 -2
- package/src/transpile/components/page/with-partial-container.js.map +1 -1
- package/src/transpile/components/transform-register.js +3 -0
- package/src/transpile/components/transform-register.js.map +1 -1
- package/src/transpile/components/web-component/web-component.transformer.js +26 -0
- package/src/transpile/components/web-component/web-component.transformer.js.map +1 -0
- package/src/transpile/transpile.js +60 -17
- package/src/transpile/transpile.js.map +1 -1
- package/src/utils.browser.js +39 -17
- package/src/utils.browser.js.map +1 -1
- package/src/utils.js +3 -113
- package/src/utils.js.map +1 -1
- package/templates/component/web-component.tsx +61 -0
- package/templates/project/app/wm-globals.css +0 -4
- package/templates/project/package.json +4 -4
|
@@ -16622,7 +16622,7 @@ var require_lib = __commonJS({
|
|
|
16622
16622
|
node.specifiers.push(this.finishNode(specifier, type));
|
|
16623
16623
|
}
|
|
16624
16624
|
parseAssertEntries() {
|
|
16625
|
-
const
|
|
16625
|
+
const attrs2 = [];
|
|
16626
16626
|
const attrNames = /* @__PURE__ */ new Set();
|
|
16627
16627
|
do {
|
|
16628
16628
|
if (this.match(types.braceR)) {
|
|
@@ -16648,9 +16648,9 @@ var require_lib = __commonJS({
|
|
|
16648
16648
|
}
|
|
16649
16649
|
node.value = this.parseLiteral(this.state.value, "StringLiteral");
|
|
16650
16650
|
this.finishNode(node, "ImportAttribute");
|
|
16651
|
-
|
|
16651
|
+
attrs2.push(node);
|
|
16652
16652
|
} while (this.eat(types.comma));
|
|
16653
|
-
return
|
|
16653
|
+
return attrs2;
|
|
16654
16654
|
}
|
|
16655
16655
|
maybeParseModuleAttributes() {
|
|
16656
16656
|
if (this.match(types._with) && !this.hasPrecedingLineBreak()) {
|
|
@@ -16660,7 +16660,7 @@ var require_lib = __commonJS({
|
|
|
16660
16660
|
if (this.hasPlugin("moduleAttributes")) return [];
|
|
16661
16661
|
return null;
|
|
16662
16662
|
}
|
|
16663
|
-
const
|
|
16663
|
+
const attrs2 = [];
|
|
16664
16664
|
const attributes = /* @__PURE__ */ new Set();
|
|
16665
16665
|
do {
|
|
16666
16666
|
const node = this.startNode();
|
|
@@ -16678,9 +16678,9 @@ var require_lib = __commonJS({
|
|
|
16678
16678
|
}
|
|
16679
16679
|
node.value = this.parseLiteral(this.state.value, "StringLiteral");
|
|
16680
16680
|
this.finishNode(node, "ImportAttribute");
|
|
16681
|
-
|
|
16681
|
+
attrs2.push(node);
|
|
16682
16682
|
} while (this.eat(types.comma));
|
|
16683
|
-
return
|
|
16683
|
+
return attrs2;
|
|
16684
16684
|
}
|
|
16685
16685
|
maybeParseImportAssertions() {
|
|
16686
16686
|
if (this.isContextual("assert") && !this.hasPrecedingLineBreak()) {
|
|
@@ -16691,9 +16691,9 @@ var require_lib = __commonJS({
|
|
|
16691
16691
|
return null;
|
|
16692
16692
|
}
|
|
16693
16693
|
this.eat(types.braceL);
|
|
16694
|
-
const
|
|
16694
|
+
const attrs2 = this.parseAssertEntries();
|
|
16695
16695
|
this.eat(types.braceR);
|
|
16696
|
-
return
|
|
16696
|
+
return attrs2;
|
|
16697
16697
|
}
|
|
16698
16698
|
maybeParseDefaultImportSpecifier(node) {
|
|
16699
16699
|
if (this.shouldParseDefaultImport(node)) {
|
|
@@ -21232,11 +21232,11 @@ var require_html = __commonJS({
|
|
|
21232
21232
|
return DOMTokenList2;
|
|
21233
21233
|
})()
|
|
21234
21234
|
);
|
|
21235
|
-
var
|
|
21235
|
+
var HTMLElement4 = (
|
|
21236
21236
|
/** @class */
|
|
21237
21237
|
(function(_super) {
|
|
21238
|
-
__extends(
|
|
21239
|
-
function
|
|
21238
|
+
__extends(HTMLElement5, _super);
|
|
21239
|
+
function HTMLElement5(tagName, keyAttrs, rawAttrs, parentNode, range) {
|
|
21240
21240
|
if (rawAttrs === void 0) {
|
|
21241
21241
|
rawAttrs = "";
|
|
21242
21242
|
}
|
|
@@ -21271,13 +21271,13 @@ var require_html = __commonJS({
|
|
|
21271
21271
|
}
|
|
21272
21272
|
return _this;
|
|
21273
21273
|
}
|
|
21274
|
-
|
|
21274
|
+
HTMLElement5.prototype.quoteAttribute = function(attr) {
|
|
21275
21275
|
if (attr == null) {
|
|
21276
21276
|
return "null";
|
|
21277
21277
|
}
|
|
21278
21278
|
return JSON.stringify(attr.replace(/"/g, """));
|
|
21279
21279
|
};
|
|
21280
|
-
|
|
21280
|
+
HTMLElement5.prototype.remove = function() {
|
|
21281
21281
|
var _this = this;
|
|
21282
21282
|
if (this.parentNode) {
|
|
21283
21283
|
var children = this.parentNode.childNodes;
|
|
@@ -21286,12 +21286,12 @@ var require_html = __commonJS({
|
|
|
21286
21286
|
});
|
|
21287
21287
|
}
|
|
21288
21288
|
};
|
|
21289
|
-
|
|
21289
|
+
HTMLElement5.prototype.removeChild = function(node) {
|
|
21290
21290
|
this.childNodes = this.childNodes.filter(function(child) {
|
|
21291
21291
|
return child !== node;
|
|
21292
21292
|
});
|
|
21293
21293
|
};
|
|
21294
|
-
|
|
21294
|
+
HTMLElement5.prototype.exchangeChild = function(oldNode, newNode) {
|
|
21295
21295
|
var children = this.childNodes;
|
|
21296
21296
|
this.childNodes = children.map(function(child) {
|
|
21297
21297
|
if (child === oldNode) {
|
|
@@ -21300,28 +21300,28 @@ var require_html = __commonJS({
|
|
|
21300
21300
|
return child;
|
|
21301
21301
|
});
|
|
21302
21302
|
};
|
|
21303
|
-
Object.defineProperty(
|
|
21303
|
+
Object.defineProperty(HTMLElement5.prototype, "tagName", {
|
|
21304
21304
|
get: function() {
|
|
21305
21305
|
return this.rawTagName ? this.rawTagName.toUpperCase() : this.rawTagName;
|
|
21306
21306
|
},
|
|
21307
21307
|
enumerable: false,
|
|
21308
21308
|
configurable: true
|
|
21309
21309
|
});
|
|
21310
|
-
Object.defineProperty(
|
|
21310
|
+
Object.defineProperty(HTMLElement5.prototype, "localName", {
|
|
21311
21311
|
get: function() {
|
|
21312
21312
|
return this.rawTagName.toLowerCase();
|
|
21313
21313
|
},
|
|
21314
21314
|
enumerable: false,
|
|
21315
21315
|
configurable: true
|
|
21316
21316
|
});
|
|
21317
|
-
Object.defineProperty(
|
|
21317
|
+
Object.defineProperty(HTMLElement5.prototype, "isVoidElement", {
|
|
21318
21318
|
get: function() {
|
|
21319
21319
|
return voidTags.has(this.localName);
|
|
21320
21320
|
},
|
|
21321
21321
|
enumerable: false,
|
|
21322
21322
|
configurable: true
|
|
21323
21323
|
});
|
|
21324
|
-
Object.defineProperty(
|
|
21324
|
+
Object.defineProperty(HTMLElement5.prototype, "rawText", {
|
|
21325
21325
|
/**
|
|
21326
21326
|
* Get escpaed (as-it) text value of current node and its children.
|
|
21327
21327
|
* @return {string} text content
|
|
@@ -21334,7 +21334,7 @@ var require_html = __commonJS({
|
|
|
21334
21334
|
enumerable: false,
|
|
21335
21335
|
configurable: true
|
|
21336
21336
|
});
|
|
21337
|
-
Object.defineProperty(
|
|
21337
|
+
Object.defineProperty(HTMLElement5.prototype, "textContent", {
|
|
21338
21338
|
get: function() {
|
|
21339
21339
|
return decode(this.rawText);
|
|
21340
21340
|
},
|
|
@@ -21345,7 +21345,7 @@ var require_html = __commonJS({
|
|
|
21345
21345
|
enumerable: false,
|
|
21346
21346
|
configurable: true
|
|
21347
21347
|
});
|
|
21348
|
-
Object.defineProperty(
|
|
21348
|
+
Object.defineProperty(HTMLElement5.prototype, "text", {
|
|
21349
21349
|
/**
|
|
21350
21350
|
* Get unescaped text value of current node and its children.
|
|
21351
21351
|
* @return {string} text content
|
|
@@ -21356,7 +21356,7 @@ var require_html = __commonJS({
|
|
|
21356
21356
|
enumerable: false,
|
|
21357
21357
|
configurable: true
|
|
21358
21358
|
});
|
|
21359
|
-
Object.defineProperty(
|
|
21359
|
+
Object.defineProperty(HTMLElement5.prototype, "structuredText", {
|
|
21360
21360
|
/**
|
|
21361
21361
|
* Get structured Text (with '\n' etc.)
|
|
21362
21362
|
* @return {string} structured text
|
|
@@ -21398,15 +21398,15 @@ var require_html = __commonJS({
|
|
|
21398
21398
|
enumerable: false,
|
|
21399
21399
|
configurable: true
|
|
21400
21400
|
});
|
|
21401
|
-
|
|
21401
|
+
HTMLElement5.prototype.toString = function() {
|
|
21402
21402
|
var tag = this.rawTagName;
|
|
21403
21403
|
if (tag) {
|
|
21404
|
-
var
|
|
21405
|
-
return this.isVoidElement ? "<" + tag +
|
|
21404
|
+
var attrs2 = this.rawAttrs ? " " + this.rawAttrs : "";
|
|
21405
|
+
return this.isVoidElement ? "<" + tag + attrs2 + ">" : "<" + tag + attrs2 + ">" + this.innerHTML + "</" + tag + ">";
|
|
21406
21406
|
}
|
|
21407
21407
|
return this.innerHTML;
|
|
21408
21408
|
};
|
|
21409
|
-
Object.defineProperty(
|
|
21409
|
+
Object.defineProperty(HTMLElement5.prototype, "innerHTML", {
|
|
21410
21410
|
get: function() {
|
|
21411
21411
|
return this.childNodes.map(function(child) {
|
|
21412
21412
|
return child.toString();
|
|
@@ -21419,7 +21419,7 @@ var require_html = __commonJS({
|
|
|
21419
21419
|
enumerable: false,
|
|
21420
21420
|
configurable: true
|
|
21421
21421
|
});
|
|
21422
|
-
|
|
21422
|
+
HTMLElement5.prototype.set_content = function(content, options) {
|
|
21423
21423
|
if (options === void 0) {
|
|
21424
21424
|
options = {};
|
|
21425
21425
|
}
|
|
@@ -21431,7 +21431,7 @@ var require_html = __commonJS({
|
|
|
21431
21431
|
}
|
|
21432
21432
|
this.childNodes = content;
|
|
21433
21433
|
};
|
|
21434
|
-
|
|
21434
|
+
HTMLElement5.prototype.replaceWith = function() {
|
|
21435
21435
|
var _this = this;
|
|
21436
21436
|
var nodes = [];
|
|
21437
21437
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -21451,14 +21451,14 @@ var require_html = __commonJS({
|
|
|
21451
21451
|
});
|
|
21452
21452
|
this.parentNode.childNodes = __spreadArray(__spreadArray(__spreadArray([], this.parentNode.childNodes.slice(0, idx), true), content, true), this.parentNode.childNodes.slice(idx + 1), true);
|
|
21453
21453
|
};
|
|
21454
|
-
Object.defineProperty(
|
|
21454
|
+
Object.defineProperty(HTMLElement5.prototype, "outerHTML", {
|
|
21455
21455
|
get: function() {
|
|
21456
21456
|
return this.toString();
|
|
21457
21457
|
},
|
|
21458
21458
|
enumerable: false,
|
|
21459
21459
|
configurable: true
|
|
21460
21460
|
});
|
|
21461
|
-
|
|
21461
|
+
HTMLElement5.prototype.trimRight = function(pattern) {
|
|
21462
21462
|
for (var i = 0; i < this.childNodes.length; i++) {
|
|
21463
21463
|
var childNode = this.childNodes[i];
|
|
21464
21464
|
if (childNode.nodeType === type_1.default.ELEMENT_NODE) {
|
|
@@ -21473,7 +21473,7 @@ var require_html = __commonJS({
|
|
|
21473
21473
|
}
|
|
21474
21474
|
return this;
|
|
21475
21475
|
};
|
|
21476
|
-
Object.defineProperty(
|
|
21476
|
+
Object.defineProperty(HTMLElement5.prototype, "structure", {
|
|
21477
21477
|
/**
|
|
21478
21478
|
* Get DOM structure
|
|
21479
21479
|
* @return {string} strucutre
|
|
@@ -21506,7 +21506,7 @@ var require_html = __commonJS({
|
|
|
21506
21506
|
enumerable: false,
|
|
21507
21507
|
configurable: true
|
|
21508
21508
|
});
|
|
21509
|
-
|
|
21509
|
+
HTMLElement5.prototype.removeWhitespace = function() {
|
|
21510
21510
|
var _this = this;
|
|
21511
21511
|
var o = 0;
|
|
21512
21512
|
this.childNodes.forEach(function(node) {
|
|
@@ -21523,19 +21523,19 @@ var require_html = __commonJS({
|
|
|
21523
21523
|
this.childNodes.length = o;
|
|
21524
21524
|
return this;
|
|
21525
21525
|
};
|
|
21526
|
-
|
|
21526
|
+
HTMLElement5.prototype.querySelectorAll = function(selector) {
|
|
21527
21527
|
return (0, css_select_1.selectAll)(selector, this, {
|
|
21528
21528
|
xmlMode: true,
|
|
21529
21529
|
adapter: matcher_1.default
|
|
21530
21530
|
});
|
|
21531
21531
|
};
|
|
21532
|
-
|
|
21532
|
+
HTMLElement5.prototype.querySelector = function(selector) {
|
|
21533
21533
|
return (0, css_select_1.selectOne)(selector, this, {
|
|
21534
21534
|
xmlMode: true,
|
|
21535
21535
|
adapter: matcher_1.default
|
|
21536
21536
|
});
|
|
21537
21537
|
};
|
|
21538
|
-
|
|
21538
|
+
HTMLElement5.prototype.getElementsByTagName = function(tagName) {
|
|
21539
21539
|
var upperCasedTagName = tagName.toUpperCase();
|
|
21540
21540
|
var re = [];
|
|
21541
21541
|
var stack = [];
|
|
@@ -21563,7 +21563,7 @@ var require_html = __commonJS({
|
|
|
21563
21563
|
}
|
|
21564
21564
|
return re;
|
|
21565
21565
|
};
|
|
21566
|
-
|
|
21566
|
+
HTMLElement5.prototype.closest = function(selector) {
|
|
21567
21567
|
var mapChild = /* @__PURE__ */ new Map();
|
|
21568
21568
|
var el = this;
|
|
21569
21569
|
var old = null;
|
|
@@ -21607,12 +21607,12 @@ var require_html = __commonJS({
|
|
|
21607
21607
|
}
|
|
21608
21608
|
return null;
|
|
21609
21609
|
};
|
|
21610
|
-
|
|
21610
|
+
HTMLElement5.prototype.appendChild = function(node) {
|
|
21611
21611
|
this.childNodes.push(node);
|
|
21612
21612
|
node.parentNode = this;
|
|
21613
21613
|
return node;
|
|
21614
21614
|
};
|
|
21615
|
-
Object.defineProperty(
|
|
21615
|
+
Object.defineProperty(HTMLElement5.prototype, "firstChild", {
|
|
21616
21616
|
/**
|
|
21617
21617
|
* Get first child node
|
|
21618
21618
|
* @return {Node} first child node
|
|
@@ -21623,7 +21623,7 @@ var require_html = __commonJS({
|
|
|
21623
21623
|
enumerable: false,
|
|
21624
21624
|
configurable: true
|
|
21625
21625
|
});
|
|
21626
|
-
Object.defineProperty(
|
|
21626
|
+
Object.defineProperty(HTMLElement5.prototype, "lastChild", {
|
|
21627
21627
|
/**
|
|
21628
21628
|
* Get last child node
|
|
21629
21629
|
* @return {Node} last child node
|
|
@@ -21634,7 +21634,7 @@ var require_html = __commonJS({
|
|
|
21634
21634
|
enumerable: false,
|
|
21635
21635
|
configurable: true
|
|
21636
21636
|
});
|
|
21637
|
-
Object.defineProperty(
|
|
21637
|
+
Object.defineProperty(HTMLElement5.prototype, "attrs", {
|
|
21638
21638
|
/**
|
|
21639
21639
|
* Get attributes
|
|
21640
21640
|
* @access private
|
|
@@ -21645,9 +21645,9 @@ var require_html = __commonJS({
|
|
|
21645
21645
|
return this._attrs;
|
|
21646
21646
|
}
|
|
21647
21647
|
this._attrs = {};
|
|
21648
|
-
var
|
|
21649
|
-
for (var key in
|
|
21650
|
-
var val =
|
|
21648
|
+
var attrs2 = this.rawAttributes;
|
|
21649
|
+
for (var key in attrs2) {
|
|
21650
|
+
var val = attrs2[key] || "";
|
|
21651
21651
|
this._attrs[key.toLowerCase()] = decode(val);
|
|
21652
21652
|
}
|
|
21653
21653
|
return this._attrs;
|
|
@@ -21655,12 +21655,12 @@ var require_html = __commonJS({
|
|
|
21655
21655
|
enumerable: false,
|
|
21656
21656
|
configurable: true
|
|
21657
21657
|
});
|
|
21658
|
-
Object.defineProperty(
|
|
21658
|
+
Object.defineProperty(HTMLElement5.prototype, "attributes", {
|
|
21659
21659
|
get: function() {
|
|
21660
21660
|
var ret_attrs = {};
|
|
21661
|
-
var
|
|
21662
|
-
for (var key in
|
|
21663
|
-
var val =
|
|
21661
|
+
var attrs2 = this.rawAttributes;
|
|
21662
|
+
for (var key in attrs2) {
|
|
21663
|
+
var val = attrs2[key] || "";
|
|
21664
21664
|
ret_attrs[key] = decode(val);
|
|
21665
21665
|
}
|
|
21666
21666
|
return ret_attrs;
|
|
@@ -21668,7 +21668,7 @@ var require_html = __commonJS({
|
|
|
21668
21668
|
enumerable: false,
|
|
21669
21669
|
configurable: true
|
|
21670
21670
|
});
|
|
21671
|
-
Object.defineProperty(
|
|
21671
|
+
Object.defineProperty(HTMLElement5.prototype, "rawAttributes", {
|
|
21672
21672
|
/**
|
|
21673
21673
|
* Get escaped (as-is) attributes
|
|
21674
21674
|
* @return {Object} parsed attributes
|
|
@@ -21677,7 +21677,7 @@ var require_html = __commonJS({
|
|
|
21677
21677
|
if (this._rawAttrs) {
|
|
21678
21678
|
return this._rawAttrs;
|
|
21679
21679
|
}
|
|
21680
|
-
var
|
|
21680
|
+
var attrs2 = {};
|
|
21681
21681
|
if (this.rawAttrs) {
|
|
21682
21682
|
var re = /([a-zA-Z()#][a-zA-Z0-9-_:()#]*)(?:\s*=\s*((?:'[^']*')|(?:"[^"]*")|\S+))?/g;
|
|
21683
21683
|
var match = void 0;
|
|
@@ -21686,23 +21686,23 @@ var require_html = __commonJS({
|
|
|
21686
21686
|
var val = match[2] || null;
|
|
21687
21687
|
if (val && (val[0] === "'" || val[0] === '"'))
|
|
21688
21688
|
val = val.slice(1, val.length - 1);
|
|
21689
|
-
|
|
21689
|
+
attrs2[key] = val;
|
|
21690
21690
|
}
|
|
21691
21691
|
}
|
|
21692
|
-
this._rawAttrs =
|
|
21693
|
-
return
|
|
21692
|
+
this._rawAttrs = attrs2;
|
|
21693
|
+
return attrs2;
|
|
21694
21694
|
},
|
|
21695
21695
|
enumerable: false,
|
|
21696
21696
|
configurable: true
|
|
21697
21697
|
});
|
|
21698
|
-
|
|
21699
|
-
var
|
|
21700
|
-
delete
|
|
21698
|
+
HTMLElement5.prototype.removeAttribute = function(key) {
|
|
21699
|
+
var attrs2 = this.rawAttributes;
|
|
21700
|
+
delete attrs2[key];
|
|
21701
21701
|
if (this._attrs) {
|
|
21702
21702
|
delete this._attrs[key];
|
|
21703
21703
|
}
|
|
21704
|
-
this.rawAttrs = Object.keys(
|
|
21705
|
-
var val = JSON.stringify(
|
|
21704
|
+
this.rawAttrs = Object.keys(attrs2).map(function(name) {
|
|
21705
|
+
var val = JSON.stringify(attrs2[name]);
|
|
21706
21706
|
if (val === void 0 || val === "null") {
|
|
21707
21707
|
return name;
|
|
21708
21708
|
}
|
|
@@ -21712,31 +21712,31 @@ var require_html = __commonJS({
|
|
|
21712
21712
|
this.id = "";
|
|
21713
21713
|
}
|
|
21714
21714
|
};
|
|
21715
|
-
|
|
21715
|
+
HTMLElement5.prototype.hasAttribute = function(key) {
|
|
21716
21716
|
return key.toLowerCase() in this.attrs;
|
|
21717
21717
|
};
|
|
21718
|
-
|
|
21718
|
+
HTMLElement5.prototype.getAttribute = function(key) {
|
|
21719
21719
|
return this.attrs[key.toLowerCase()];
|
|
21720
21720
|
};
|
|
21721
|
-
|
|
21721
|
+
HTMLElement5.prototype.setAttribute = function(key, value) {
|
|
21722
21722
|
var _this = this;
|
|
21723
21723
|
if (arguments.length < 2) {
|
|
21724
21724
|
throw new Error("Failed to execute 'setAttribute' on 'Element'");
|
|
21725
21725
|
}
|
|
21726
21726
|
var k2 = key.toLowerCase();
|
|
21727
|
-
var
|
|
21728
|
-
for (var k in
|
|
21727
|
+
var attrs2 = this.rawAttributes;
|
|
21728
|
+
for (var k in attrs2) {
|
|
21729
21729
|
if (k.toLowerCase() === k2) {
|
|
21730
21730
|
key = k;
|
|
21731
21731
|
break;
|
|
21732
21732
|
}
|
|
21733
21733
|
}
|
|
21734
|
-
|
|
21734
|
+
attrs2[key] = String(value);
|
|
21735
21735
|
if (this._attrs) {
|
|
21736
|
-
this._attrs[k2] = decode(
|
|
21736
|
+
this._attrs[k2] = decode(attrs2[key]);
|
|
21737
21737
|
}
|
|
21738
|
-
this.rawAttrs = Object.keys(
|
|
21739
|
-
var val = _this.quoteAttribute(
|
|
21738
|
+
this.rawAttrs = Object.keys(attrs2).map(function(name) {
|
|
21739
|
+
var val = _this.quoteAttribute(attrs2[name]);
|
|
21740
21740
|
if (val === "null" || val === '""')
|
|
21741
21741
|
return name;
|
|
21742
21742
|
return name + "=" + val;
|
|
@@ -21745,7 +21745,7 @@ var require_html = __commonJS({
|
|
|
21745
21745
|
this.id = value;
|
|
21746
21746
|
}
|
|
21747
21747
|
};
|
|
21748
|
-
|
|
21748
|
+
HTMLElement5.prototype.setAttributes = function(attributes) {
|
|
21749
21749
|
var _this = this;
|
|
21750
21750
|
if (this._attrs) {
|
|
21751
21751
|
delete this._attrs;
|
|
@@ -21760,7 +21760,7 @@ var require_html = __commonJS({
|
|
|
21760
21760
|
return name + "=" + _this.quoteAttribute(String(val));
|
|
21761
21761
|
}).join(" ");
|
|
21762
21762
|
};
|
|
21763
|
-
|
|
21763
|
+
HTMLElement5.prototype.insertAdjacentHTML = function(where, html) {
|
|
21764
21764
|
var _a, _b, _c;
|
|
21765
21765
|
var _this = this;
|
|
21766
21766
|
if (arguments.length < 2) {
|
|
@@ -21773,7 +21773,7 @@ var require_html = __commonJS({
|
|
|
21773
21773
|
});
|
|
21774
21774
|
(_a = this.parentNode.childNodes).splice.apply(_a, __spreadArray([idx + 1, 0], p.childNodes, false));
|
|
21775
21775
|
p.childNodes.forEach(function(n) {
|
|
21776
|
-
if (n instanceof
|
|
21776
|
+
if (n instanceof HTMLElement5) {
|
|
21777
21777
|
n.parentNode = _this.parentNode;
|
|
21778
21778
|
}
|
|
21779
21779
|
});
|
|
@@ -21789,7 +21789,7 @@ var require_html = __commonJS({
|
|
|
21789
21789
|
});
|
|
21790
21790
|
(_c = this.parentNode.childNodes).splice.apply(_c, __spreadArray([idx, 0], p.childNodes, false));
|
|
21791
21791
|
p.childNodes.forEach(function(n) {
|
|
21792
|
-
if (n instanceof
|
|
21792
|
+
if (n instanceof HTMLElement5) {
|
|
21793
21793
|
n.parentNode = _this.parentNode;
|
|
21794
21794
|
}
|
|
21795
21795
|
});
|
|
@@ -21797,7 +21797,7 @@ var require_html = __commonJS({
|
|
|
21797
21797
|
throw new Error("The value provided ('" + where + "') is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'");
|
|
21798
21798
|
}
|
|
21799
21799
|
};
|
|
21800
|
-
Object.defineProperty(
|
|
21800
|
+
Object.defineProperty(HTMLElement5.prototype, "nextSibling", {
|
|
21801
21801
|
get: function() {
|
|
21802
21802
|
if (this.parentNode) {
|
|
21803
21803
|
var children = this.parentNode.childNodes;
|
|
@@ -21813,7 +21813,7 @@ var require_html = __commonJS({
|
|
|
21813
21813
|
enumerable: false,
|
|
21814
21814
|
configurable: true
|
|
21815
21815
|
});
|
|
21816
|
-
Object.defineProperty(
|
|
21816
|
+
Object.defineProperty(HTMLElement5.prototype, "nextElementSibling", {
|
|
21817
21817
|
get: function() {
|
|
21818
21818
|
if (this.parentNode) {
|
|
21819
21819
|
var children = this.parentNode.childNodes;
|
|
@@ -21822,7 +21822,7 @@ var require_html = __commonJS({
|
|
|
21822
21822
|
while (i < children.length) {
|
|
21823
21823
|
var child = children[i++];
|
|
21824
21824
|
if (find) {
|
|
21825
|
-
if (child instanceof
|
|
21825
|
+
if (child instanceof HTMLElement5) {
|
|
21826
21826
|
return child || null;
|
|
21827
21827
|
}
|
|
21828
21828
|
} else if (this === child) {
|
|
@@ -21835,17 +21835,17 @@ var require_html = __commonJS({
|
|
|
21835
21835
|
enumerable: false,
|
|
21836
21836
|
configurable: true
|
|
21837
21837
|
});
|
|
21838
|
-
Object.defineProperty(
|
|
21838
|
+
Object.defineProperty(HTMLElement5.prototype, "classNames", {
|
|
21839
21839
|
get: function() {
|
|
21840
21840
|
return this.classList.toString();
|
|
21841
21841
|
},
|
|
21842
21842
|
enumerable: false,
|
|
21843
21843
|
configurable: true
|
|
21844
21844
|
});
|
|
21845
|
-
return
|
|
21845
|
+
return HTMLElement5;
|
|
21846
21846
|
})(node_1.default)
|
|
21847
21847
|
);
|
|
21848
|
-
exports$1.default =
|
|
21848
|
+
exports$1.default = HTMLElement4;
|
|
21849
21849
|
var kMarkupPattern = /<!--[\s\S]*?-->|<(\/?)([a-zA-Z][-.:0-9_a-zA-Z]*)((?:\s+[^>]*?(?:(?:'[^']*')|(?:"[^"]*"))?)*)\s*(\/?)>/g;
|
|
21850
21850
|
var kAttributePattern = /(?:^|\s)(id|class)\s*=\s*((?:'[^']*')|(?:"[^"]*")|\S+)/gi;
|
|
21851
21851
|
var kSelfClosingElements = {
|
|
@@ -21951,7 +21951,7 @@ var require_html = __commonJS({
|
|
|
21951
21951
|
var createRange = function(startPos, endPos) {
|
|
21952
21952
|
return [startPos - frameFlagOffset, endPos - frameFlagOffset];
|
|
21953
21953
|
};
|
|
21954
|
-
var root = new
|
|
21954
|
+
var root = new HTMLElement4(null, {}, "", null, [0, data.length]);
|
|
21955
21955
|
var currentParent = root;
|
|
21956
21956
|
var stack = [root];
|
|
21957
21957
|
var lastTextPos = -1;
|
|
@@ -21985,11 +21985,11 @@ var require_html = __commonJS({
|
|
|
21985
21985
|
if (lowerCaseTagName)
|
|
21986
21986
|
tagName = tagName.toLowerCase();
|
|
21987
21987
|
if (!leadingSlash) {
|
|
21988
|
-
var
|
|
21988
|
+
var attrs2 = {};
|
|
21989
21989
|
for (var attMatch = void 0; attMatch = kAttributePattern.exec(attributes); ) {
|
|
21990
21990
|
var key = attMatch[1], val = attMatch[2];
|
|
21991
21991
|
var isQuoted = val[0] === "'" || val[0] === '"';
|
|
21992
|
-
|
|
21992
|
+
attrs2[key.toLowerCase()] = isQuoted ? val.slice(1, val.length - 1) : val;
|
|
21993
21993
|
}
|
|
21994
21994
|
var parentTagName = currentParent.rawTagName;
|
|
21995
21995
|
if (!closingSlash && kElementsClosedByOpening[parentTagName]) {
|
|
@@ -22009,7 +22009,7 @@ var require_html = __commonJS({
|
|
|
22009
22009
|
var tagStartPos_1 = tagEndPos_1 - matchLength;
|
|
22010
22010
|
currentParent = currentParent.appendChild(
|
|
22011
22011
|
// Initialize range (end position updated later for closed tags)
|
|
22012
|
-
new
|
|
22012
|
+
new HTMLElement4(tagName, attrs2, attributes.slice(1), null, createRange(tagStartPos_1, tagEndPos_1))
|
|
22013
22013
|
);
|
|
22014
22014
|
stack.push(currentParent);
|
|
22015
22015
|
if (is_block_text_element(tagName)) {
|
|
@@ -22768,13 +22768,13 @@ var CssSelector = class _CssSelector {
|
|
|
22768
22768
|
getMatchingElementTemplate() {
|
|
22769
22769
|
const tagName = this.element || "div";
|
|
22770
22770
|
const classAttr = this.classNames.length > 0 ? ` class="${this.classNames.join(" ")}"` : "";
|
|
22771
|
-
let
|
|
22771
|
+
let attrs2 = "";
|
|
22772
22772
|
for (let i = 0; i < this.attrs.length; i += 2) {
|
|
22773
22773
|
const attrName = this.attrs[i];
|
|
22774
22774
|
const attrValue = this.attrs[i + 1] !== "" ? `="${this.attrs[i + 1]}"` : "";
|
|
22775
|
-
|
|
22775
|
+
attrs2 += ` ${attrName}${attrValue}`;
|
|
22776
22776
|
}
|
|
22777
|
-
return getHtmlTagDefinition(tagName).isVoid ? `<${tagName}${classAttr}${
|
|
22777
|
+
return getHtmlTagDefinition(tagName).isVoid ? `<${tagName}${classAttr}${attrs2}/>` : `<${tagName}${classAttr}${attrs2}></${tagName}>`;
|
|
22778
22778
|
}
|
|
22779
22779
|
getAttrs() {
|
|
22780
22780
|
const result = [];
|
|
@@ -22839,10 +22839,10 @@ var SelectorMatcher = class _SelectorMatcher {
|
|
|
22839
22839
|
let matcher = this;
|
|
22840
22840
|
const element = cssSelector.element;
|
|
22841
22841
|
const classNames = cssSelector.classNames;
|
|
22842
|
-
const
|
|
22842
|
+
const attrs2 = cssSelector.attrs;
|
|
22843
22843
|
const selectable = new SelectorContext(cssSelector, callbackCtxt, listContext);
|
|
22844
22844
|
if (element) {
|
|
22845
|
-
const isTerminal =
|
|
22845
|
+
const isTerminal = attrs2.length === 0 && classNames.length === 0;
|
|
22846
22846
|
if (isTerminal) {
|
|
22847
22847
|
this._addTerminal(matcher._elementMap, element, selectable);
|
|
22848
22848
|
} else {
|
|
@@ -22851,7 +22851,7 @@ var SelectorMatcher = class _SelectorMatcher {
|
|
|
22851
22851
|
}
|
|
22852
22852
|
if (classNames) {
|
|
22853
22853
|
for (let i = 0; i < classNames.length; i++) {
|
|
22854
|
-
const isTerminal =
|
|
22854
|
+
const isTerminal = attrs2.length === 0 && i === classNames.length - 1;
|
|
22855
22855
|
const className = classNames[i];
|
|
22856
22856
|
if (isTerminal) {
|
|
22857
22857
|
this._addTerminal(matcher._classMap, className, selectable);
|
|
@@ -22860,11 +22860,11 @@ var SelectorMatcher = class _SelectorMatcher {
|
|
|
22860
22860
|
}
|
|
22861
22861
|
}
|
|
22862
22862
|
}
|
|
22863
|
-
if (
|
|
22864
|
-
for (let i = 0; i <
|
|
22865
|
-
const isTerminal = i ===
|
|
22866
|
-
const name =
|
|
22867
|
-
const value =
|
|
22863
|
+
if (attrs2) {
|
|
22864
|
+
for (let i = 0; i < attrs2.length; i += 2) {
|
|
22865
|
+
const isTerminal = i === attrs2.length - 2;
|
|
22866
|
+
const name = attrs2[i];
|
|
22867
|
+
const value = attrs2[i + 1];
|
|
22868
22868
|
if (isTerminal) {
|
|
22869
22869
|
const terminalMap = matcher._attrValueMap;
|
|
22870
22870
|
let terminalValuesMap = terminalMap.get(name);
|
|
@@ -22912,7 +22912,7 @@ var SelectorMatcher = class _SelectorMatcher {
|
|
|
22912
22912
|
let result = false;
|
|
22913
22913
|
const element = cssSelector.element;
|
|
22914
22914
|
const classNames = cssSelector.classNames;
|
|
22915
|
-
const
|
|
22915
|
+
const attrs2 = cssSelector.attrs;
|
|
22916
22916
|
for (let i = 0; i < this._listContexts.length; i++) {
|
|
22917
22917
|
this._listContexts[i].alreadyMatched = false;
|
|
22918
22918
|
}
|
|
@@ -22925,10 +22925,10 @@ var SelectorMatcher = class _SelectorMatcher {
|
|
|
22925
22925
|
result = this._matchPartial(this._classPartialMap, className, cssSelector, matchedCallback) || result;
|
|
22926
22926
|
}
|
|
22927
22927
|
}
|
|
22928
|
-
if (
|
|
22929
|
-
for (let i = 0; i <
|
|
22930
|
-
const name =
|
|
22931
|
-
const value =
|
|
22928
|
+
if (attrs2) {
|
|
22929
|
+
for (let i = 0; i < attrs2.length; i += 2) {
|
|
22930
|
+
const name = attrs2[i];
|
|
22931
|
+
const value = attrs2[i + 1];
|
|
22932
22932
|
const terminalValuesMap = this._attrValueMap.get(name);
|
|
22933
22933
|
if (value) {
|
|
22934
22934
|
result = this._matchTerminal(terminalValuesMap, "", cssSelector, matchedCallback) || result;
|
|
@@ -24743,9 +24743,9 @@ var Icu$1 = class {
|
|
|
24743
24743
|
}
|
|
24744
24744
|
};
|
|
24745
24745
|
var TagPlaceholder = class {
|
|
24746
|
-
constructor(tag,
|
|
24746
|
+
constructor(tag, attrs2, startName, closeName, children, isVoid, sourceSpan, startSourceSpan, endSourceSpan) {
|
|
24747
24747
|
this.tag = tag;
|
|
24748
|
-
this.attrs =
|
|
24748
|
+
this.attrs = attrs2;
|
|
24749
24749
|
this.startName = startName;
|
|
24750
24750
|
this.closeName = closeName;
|
|
24751
24751
|
this.children = children;
|
|
@@ -29185,10 +29185,10 @@ var Attribute = class extends NodeWithI18n {
|
|
|
29185
29185
|
}
|
|
29186
29186
|
};
|
|
29187
29187
|
var Element$1 = class extends NodeWithI18n {
|
|
29188
|
-
constructor(name,
|
|
29188
|
+
constructor(name, attrs2, children, sourceSpan, startSourceSpan, endSourceSpan = null, i18n) {
|
|
29189
29189
|
super(sourceSpan, i18n);
|
|
29190
29190
|
this.name = name;
|
|
29191
|
-
this.attrs =
|
|
29191
|
+
this.attrs = attrs2;
|
|
29192
29192
|
this.children = children;
|
|
29193
29193
|
this.startSourceSpan = startSourceSpan;
|
|
29194
29194
|
this.endSourceSpan = endSourceSpan;
|
|
@@ -32355,9 +32355,9 @@ var _TreeBuilder = class __TreeBuilder {
|
|
|
32355
32355
|
}
|
|
32356
32356
|
_consumeStartTag(startTagToken) {
|
|
32357
32357
|
const [prefix, name] = startTagToken.parts;
|
|
32358
|
-
const
|
|
32358
|
+
const attrs2 = [];
|
|
32359
32359
|
while (this._peek.type === TokenType.ATTR_NAME) {
|
|
32360
|
-
|
|
32360
|
+
attrs2.push(this._consumeAttr(this._advance()));
|
|
32361
32361
|
}
|
|
32362
32362
|
const fullName = this._getElementFullName(prefix, name, this._getParentElement());
|
|
32363
32363
|
let selfClosing = false;
|
|
@@ -32375,7 +32375,7 @@ var _TreeBuilder = class __TreeBuilder {
|
|
|
32375
32375
|
const end = this._peek.sourceSpan.fullStart;
|
|
32376
32376
|
const span = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);
|
|
32377
32377
|
const startSpan = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);
|
|
32378
|
-
const el = new Element$1(fullName,
|
|
32378
|
+
const el = new Element$1(fullName, attrs2, [], span, startSpan, void 0);
|
|
32379
32379
|
this._pushElement(el);
|
|
32380
32380
|
if (selfClosing) {
|
|
32381
32381
|
this._popElement(fullName, span);
|
|
@@ -32485,8 +32485,8 @@ var SKIP_WS_TRIM_TAGS = /* @__PURE__ */ new Set(["pre", "template", "textarea",
|
|
|
32485
32485
|
var WS_CHARS = " \f\n\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
|
|
32486
32486
|
var NO_WS_REGEXP = new RegExp(`[^${WS_CHARS}]`);
|
|
32487
32487
|
var WS_REPLACE_REGEXP = new RegExp(`[${WS_CHARS}]{2,}`, "g");
|
|
32488
|
-
function hasPreserveWhitespacesAttr(
|
|
32489
|
-
return
|
|
32488
|
+
function hasPreserveWhitespacesAttr(attrs2) {
|
|
32489
|
+
return attrs2.some((attr) => attr.name === PRESERVE_WS_ATTR_NAME);
|
|
32490
32490
|
}
|
|
32491
32491
|
function replaceNgsp(value) {
|
|
32492
32492
|
return value.replace(new RegExp(NGSP_UNICODE, "g"), " ");
|
|
@@ -33238,23 +33238,23 @@ var StylingBuilder = class {
|
|
|
33238
33238
|
* @param attrs an existing array where each of the styling expressions
|
|
33239
33239
|
* will be inserted into.
|
|
33240
33240
|
*/
|
|
33241
|
-
populateInitialStylingAttrs(
|
|
33241
|
+
populateInitialStylingAttrs(attrs2) {
|
|
33242
33242
|
if (this._initialClassValues.length) {
|
|
33243
|
-
|
|
33243
|
+
attrs2.push(literal(
|
|
33244
33244
|
1
|
|
33245
33245
|
/* Classes */
|
|
33246
33246
|
));
|
|
33247
33247
|
for (let i = 0; i < this._initialClassValues.length; i++) {
|
|
33248
|
-
|
|
33248
|
+
attrs2.push(literal(this._initialClassValues[i]));
|
|
33249
33249
|
}
|
|
33250
33250
|
}
|
|
33251
33251
|
if (this._initialStyleValues.length) {
|
|
33252
|
-
|
|
33252
|
+
attrs2.push(literal(
|
|
33253
33253
|
2
|
|
33254
33254
|
/* Styles */
|
|
33255
33255
|
));
|
|
33256
33256
|
for (let i = 0; i < this._initialStyleValues.length; i += 2) {
|
|
33257
|
-
|
|
33257
|
+
attrs2.push(literal(this._initialStyleValues[i]), literal(this._initialStyleValues[i + 1]));
|
|
33258
33258
|
}
|
|
33259
33259
|
}
|
|
33260
33260
|
}
|
|
@@ -33265,10 +33265,10 @@ var StylingBuilder = class {
|
|
|
33265
33265
|
* responsible for registering initial styles (within a directive hostBindings' creation block),
|
|
33266
33266
|
* as well as any of the provided attribute values, to the directive host element.
|
|
33267
33267
|
*/
|
|
33268
|
-
assignHostAttrs(
|
|
33269
|
-
if (this._directiveExpr && (
|
|
33270
|
-
this.populateInitialStylingAttrs(
|
|
33271
|
-
definitionMap.set("hostAttrs", literalArr(
|
|
33268
|
+
assignHostAttrs(attrs2, definitionMap) {
|
|
33269
|
+
if (this._directiveExpr && (attrs2.length || this._hasInitialValues)) {
|
|
33270
|
+
this.populateInitialStylingAttrs(attrs2);
|
|
33271
|
+
definitionMap.set("hostAttrs", literalArr(attrs2));
|
|
33272
33272
|
}
|
|
33273
33273
|
}
|
|
33274
33274
|
/**
|
|
@@ -35557,23 +35557,23 @@ var HtmlAstToIvyAst = class {
|
|
|
35557
35557
|
this.reportError(`<ng-content> element cannot have content.`, element.sourceSpan);
|
|
35558
35558
|
}
|
|
35559
35559
|
const selector = preparsedElement.selectAttr;
|
|
35560
|
-
const
|
|
35561
|
-
parsedElement = new Content(selector,
|
|
35560
|
+
const attrs2 = element.attrs.map((attr) => this.visitAttribute(attr));
|
|
35561
|
+
parsedElement = new Content(selector, attrs2, element.sourceSpan, element.i18n);
|
|
35562
35562
|
this.ngContentSelectors.push(selector);
|
|
35563
35563
|
} else if (isTemplateElement) {
|
|
35564
|
-
const
|
|
35565
|
-
parsedElement = new Template(element.name, attributes,
|
|
35564
|
+
const attrs2 = this.extractAttributes(element.name, parsedProperties, i18nAttrsMeta);
|
|
35565
|
+
parsedElement = new Template(element.name, attributes, attrs2.bound, boundEvents, [
|
|
35566
35566
|
/* no template attributes */
|
|
35567
35567
|
], children, references, variables, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.i18n);
|
|
35568
35568
|
} else {
|
|
35569
|
-
const
|
|
35570
|
-
parsedElement = new Element(element.name, attributes,
|
|
35569
|
+
const attrs2 = this.extractAttributes(element.name, parsedProperties, i18nAttrsMeta);
|
|
35570
|
+
parsedElement = new Element(element.name, attributes, attrs2.bound, boundEvents, children, references, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.i18n);
|
|
35571
35571
|
}
|
|
35572
35572
|
if (elementHasInlineTemplate) {
|
|
35573
|
-
const
|
|
35573
|
+
const attrs2 = this.extractAttributes("ng-template", templateParsedProperties, i18nAttrsMeta);
|
|
35574
35574
|
const templateAttrs = [];
|
|
35575
|
-
|
|
35576
|
-
|
|
35575
|
+
attrs2.literal.forEach((attr) => templateAttrs.push(attr));
|
|
35576
|
+
attrs2.bound.forEach((attr) => templateAttrs.push(attr));
|
|
35577
35577
|
const hoistedAttrs = parsedElement instanceof Element ? {
|
|
35578
35578
|
attributes: parsedElement.attributes,
|
|
35579
35579
|
inputs: parsedElement.inputs,
|
|
@@ -36034,8 +36034,8 @@ var PlaceholderRegistry = class {
|
|
|
36034
36034
|
this._placeHolderNameCounts = {};
|
|
36035
36035
|
this._signatureToName = {};
|
|
36036
36036
|
}
|
|
36037
|
-
getStartTagPlaceholderName(tag,
|
|
36038
|
-
const signature = this._hashTag(tag,
|
|
36037
|
+
getStartTagPlaceholderName(tag, attrs2, isVoid) {
|
|
36038
|
+
const signature = this._hashTag(tag, attrs2, isVoid);
|
|
36039
36039
|
if (this._signatureToName[signature]) {
|
|
36040
36040
|
return this._signatureToName[signature];
|
|
36041
36041
|
}
|
|
@@ -36070,9 +36070,9 @@ var PlaceholderRegistry = class {
|
|
|
36070
36070
|
return this._generateUniqueName(name.toUpperCase());
|
|
36071
36071
|
}
|
|
36072
36072
|
// Generate a hash for a tag - does not take attribute order into account
|
|
36073
|
-
_hashTag(tag,
|
|
36073
|
+
_hashTag(tag, attrs2, isVoid) {
|
|
36074
36074
|
const start = `<${tag}`;
|
|
36075
|
-
const strAttrs = Object.keys(
|
|
36075
|
+
const strAttrs = Object.keys(attrs2).sort().map((name) => ` ${name}=${attrs2[name]}`).join("");
|
|
36076
36076
|
const end = isVoid ? "/>" : `></${tag}>`;
|
|
36077
36077
|
return start + strAttrs + end;
|
|
36078
36078
|
}
|
|
@@ -36118,12 +36118,12 @@ var _I18nVisitor = class {
|
|
|
36118
36118
|
visitElement(el, context) {
|
|
36119
36119
|
var _a;
|
|
36120
36120
|
const children = visitAll$1(this, el.children, context);
|
|
36121
|
-
const
|
|
36121
|
+
const attrs2 = {};
|
|
36122
36122
|
el.attrs.forEach((attr) => {
|
|
36123
|
-
|
|
36123
|
+
attrs2[attr.name] = attr.value;
|
|
36124
36124
|
});
|
|
36125
36125
|
const isVoid = getHtmlTagDefinition(el.name).isVoid;
|
|
36126
|
-
const startPhName = context.placeholderRegistry.getStartTagPlaceholderName(el.name,
|
|
36126
|
+
const startPhName = context.placeholderRegistry.getStartTagPlaceholderName(el.name, attrs2, isVoid);
|
|
36127
36127
|
context.placeholderToContent[startPhName] = {
|
|
36128
36128
|
text: el.startSourceSpan.toString(),
|
|
36129
36129
|
sourceSpan: el.startSourceSpan
|
|
@@ -36136,7 +36136,7 @@ var _I18nVisitor = class {
|
|
|
36136
36136
|
sourceSpan: (_a = el.endSourceSpan) !== null && _a !== void 0 ? _a : el.sourceSpan
|
|
36137
36137
|
};
|
|
36138
36138
|
}
|
|
36139
|
-
const node = new TagPlaceholder(el.name,
|
|
36139
|
+
const node = new TagPlaceholder(el.name, attrs2, startPhName, closePhName, children, isVoid, el.sourceSpan, el.startSourceSpan, el.endSourceSpan);
|
|
36140
36140
|
return context.visitNodeFn(el, node);
|
|
36141
36141
|
}
|
|
36142
36142
|
visitAttribute(attribute, context) {
|
|
@@ -36298,7 +36298,7 @@ var I18nMetaVisitor = class {
|
|
|
36298
36298
|
visitElement(element) {
|
|
36299
36299
|
if (hasI18nAttrs(element)) {
|
|
36300
36300
|
this.hasI18nMeta = true;
|
|
36301
|
-
const
|
|
36301
|
+
const attrs2 = [];
|
|
36302
36302
|
const attrsMeta = {};
|
|
36303
36303
|
for (const attr of element.attrs) {
|
|
36304
36304
|
if (attr.name === I18N_ATTR) {
|
|
@@ -36315,11 +36315,11 @@ var I18nMetaVisitor = class {
|
|
|
36315
36315
|
attrsMeta[name] = attr.value;
|
|
36316
36316
|
}
|
|
36317
36317
|
} else {
|
|
36318
|
-
|
|
36318
|
+
attrs2.push(attr);
|
|
36319
36319
|
}
|
|
36320
36320
|
}
|
|
36321
36321
|
if (Object.keys(attrsMeta).length) {
|
|
36322
|
-
for (const attr of
|
|
36322
|
+
for (const attr of attrs2) {
|
|
36323
36323
|
const meta = attrsMeta[attr.name];
|
|
36324
36324
|
if (meta !== void 0 && attr.value) {
|
|
36325
36325
|
attr.i18n = this._generateI18nMessage([attr], attr.i18n || meta);
|
|
@@ -36327,7 +36327,7 @@ var I18nMetaVisitor = class {
|
|
|
36327
36327
|
}
|
|
36328
36328
|
}
|
|
36329
36329
|
if (!this.keepI18nAttrs) {
|
|
36330
|
-
element.attrs =
|
|
36330
|
+
element.attrs = attrs2;
|
|
36331
36331
|
}
|
|
36332
36332
|
}
|
|
36333
36333
|
visitAll$1(this, element.children, element.i18n);
|
|
@@ -36845,11 +36845,11 @@ var TemplateDefinitionBuilder = class _TemplateDefinitionBuilder {
|
|
|
36845
36845
|
}
|
|
36846
36846
|
this.i18n = null;
|
|
36847
36847
|
}
|
|
36848
|
-
i18nAttributesInstruction(nodeIndex,
|
|
36848
|
+
i18nAttributesInstruction(nodeIndex, attrs2, sourceSpan) {
|
|
36849
36849
|
let hasBindings = false;
|
|
36850
36850
|
const i18nAttrArgs = [];
|
|
36851
36851
|
const bindings = [];
|
|
36852
|
-
|
|
36852
|
+
attrs2.forEach((attr) => {
|
|
36853
36853
|
const message = attr.i18n;
|
|
36854
36854
|
const converted = attr.value.visit(this._valueConverter);
|
|
36855
36855
|
this.allocateBindingSlots(converted);
|
|
@@ -37228,9 +37228,9 @@ var TemplateDefinitionBuilder = class _TemplateDefinitionBuilder {
|
|
|
37228
37228
|
bindingContext() {
|
|
37229
37229
|
return `${this._bindingContext++}`;
|
|
37230
37230
|
}
|
|
37231
|
-
templatePropertyBindings(templateIndex,
|
|
37231
|
+
templatePropertyBindings(templateIndex, attrs2) {
|
|
37232
37232
|
const propertyBindings = [];
|
|
37233
|
-
|
|
37233
|
+
attrs2.forEach((input) => {
|
|
37234
37234
|
if (input instanceof BoundAttribute) {
|
|
37235
37235
|
const value = input.value.visit(this._valueConverter);
|
|
37236
37236
|
if (value !== void 0) {
|
|
@@ -37479,8 +37479,8 @@ var TemplateDefinitionBuilder = class _TemplateDefinitionBuilder {
|
|
|
37479
37479
|
}
|
|
37480
37480
|
return literal(consts.push(expression) - 1);
|
|
37481
37481
|
}
|
|
37482
|
-
addAttrsToConsts(
|
|
37483
|
-
return
|
|
37482
|
+
addAttrsToConsts(attrs2) {
|
|
37483
|
+
return attrs2.length > 0 ? this.addToConsts(literalArr(attrs2)) : TYPED_NULL_EXPR;
|
|
37484
37484
|
}
|
|
37485
37485
|
prepareRefsArray(references) {
|
|
37486
37486
|
if (!references || references.length === 0) {
|
|
@@ -41782,7 +41782,7 @@ function parseAttrValue(name, raw, props) {
|
|
|
41782
41782
|
}
|
|
41783
41783
|
}
|
|
41784
41784
|
function getStaticLayoutPropsFromElement(element, dynamicGroups) {
|
|
41785
|
-
const
|
|
41785
|
+
const attrs2 = element.attributes || {};
|
|
41786
41786
|
const props = {};
|
|
41787
41787
|
let hasAny = false;
|
|
41788
41788
|
for (const name of LAYOUT_ATTR_NAMES) {
|
|
@@ -41791,7 +41791,7 @@ function getStaticLayoutPropsFromElement(element, dynamicGroups) {
|
|
|
41791
41791
|
if (dynamicGroups.overflow && OVERFLOW_ATTR_GROUP.has(name)) continue;
|
|
41792
41792
|
if (dynamicGroups.position && POSITION_ATTR_GROUP.has(name)) continue;
|
|
41793
41793
|
}
|
|
41794
|
-
const raw =
|
|
41794
|
+
const raw = attrs2[name];
|
|
41795
41795
|
if (raw == null) continue;
|
|
41796
41796
|
if (isBind(raw)) continue;
|
|
41797
41797
|
hasAny = true;
|
|
@@ -41809,10 +41809,10 @@ function expandShorthand(value) {
|
|
|
41809
41809
|
return [parts[0], parts[1], parts[2], parts[3]];
|
|
41810
41810
|
}
|
|
41811
41811
|
function detectDynamicGroups(element) {
|
|
41812
|
-
const
|
|
41812
|
+
const attrs2 = element.attributes || {};
|
|
41813
41813
|
const flags = { flex: false, overflow: false, position: false };
|
|
41814
41814
|
for (const name of LAYOUT_ATTR_NAMES) {
|
|
41815
|
-
const raw =
|
|
41815
|
+
const raw = attrs2[name];
|
|
41816
41816
|
if (raw == null || !isBind(raw)) continue;
|
|
41817
41817
|
if (FLEX_ATTR_GROUP.has(name)) flags.flex = true;
|
|
41818
41818
|
else if (OVERFLOW_ATTR_GROUP.has(name)) flags.overflow = true;
|
|
@@ -41980,10 +41980,10 @@ var AutolayoutCodegen = class {
|
|
|
41980
41980
|
}
|
|
41981
41981
|
// Converts dynamic ternary layout attrs to conditional class expressions
|
|
41982
41982
|
processDynamicTernaryProps(element, removeAttrs = true) {
|
|
41983
|
-
const
|
|
41983
|
+
const attrs2 = element.attributes || {};
|
|
41984
41984
|
const parsed = [];
|
|
41985
41985
|
for (const name of LAYOUT_ATTR_NAMES) {
|
|
41986
|
-
const raw =
|
|
41986
|
+
const raw = attrs2[name];
|
|
41987
41987
|
if (raw == null || !isBind(raw)) continue;
|
|
41988
41988
|
if (FLEX_ATTR_GROUP.has(name)) continue;
|
|
41989
41989
|
const ternary = parseTernaryExpression(raw);
|
|
@@ -42400,8 +42400,10 @@ var _Transpiler = class _Transpiler {
|
|
|
42400
42400
|
this.transformers = /* @__PURE__ */ new Map();
|
|
42401
42401
|
this.componentNamesList = [];
|
|
42402
42402
|
this.transpile = (e, isPartOfPrefab, splitCode = true, oldContext) => {
|
|
42403
|
-
var _a;
|
|
42404
|
-
const
|
|
42403
|
+
var _a, _b;
|
|
42404
|
+
const tagName = e.tagName.toLowerCase();
|
|
42405
|
+
const isHtmlElement = htmlElements.includes(tagName);
|
|
42406
|
+
const isWebComponent = tagName.includes("-") && !tagName.startsWith("wm-");
|
|
42405
42407
|
const ignoreElements = ["wm-filter-action", "wm-form-action"];
|
|
42406
42408
|
const transformer = this.transformers.get(e && e.tagName.toLowerCase());
|
|
42407
42409
|
let result = {
|
|
@@ -42411,9 +42413,13 @@ var _Transpiler = class _Transpiler {
|
|
|
42411
42413
|
imports: [],
|
|
42412
42414
|
partials: [],
|
|
42413
42415
|
prefabs: [],
|
|
42414
|
-
wmxcomponents: []
|
|
42416
|
+
wmxcomponents: [],
|
|
42417
|
+
webComponents: []
|
|
42415
42418
|
};
|
|
42416
|
-
if (
|
|
42419
|
+
if (isWebComponent) {
|
|
42420
|
+
(_a = result.webComponents) == null ? void 0 : _a.push(this.getWebComponentDefinition(e));
|
|
42421
|
+
}
|
|
42422
|
+
if (!e.getAttribute("name") && !isWebComponent && !ignoreElements.includes(e.tagName.toLowerCase()) && !((_b = oldContext == null ? void 0 : oldContext.data) == null ? void 0 : _b.isInsideTableColumn)) {
|
|
42417
42423
|
e.setAttribute(
|
|
42418
42424
|
"name",
|
|
42419
42425
|
`${e.tagName.toLowerCase().replace(/-/g, "_")}_${generateRandomString()}`
|
|
@@ -42425,12 +42431,14 @@ var _Transpiler = class _Transpiler {
|
|
|
42425
42431
|
if (isHtmlElement) {
|
|
42426
42432
|
result.markup = preTranspileHtmlElement(e);
|
|
42427
42433
|
e.childNodes.forEach((c) => {
|
|
42434
|
+
var _a2;
|
|
42428
42435
|
if (c && c.nodeType == NodeType2.ELEMENT_NODE) {
|
|
42429
42436
|
const cResult = this.transpile(c, isPartOfPrefab, splitCode);
|
|
42430
42437
|
(0, import_lodash5.assignIn)(result.components, cResult.components);
|
|
42431
42438
|
result.markup += cResult.markup;
|
|
42432
42439
|
result.imports.push(...cResult.imports);
|
|
42433
42440
|
result.prefabs.push(...cResult.prefabs);
|
|
42441
|
+
(_a2 = result.webComponents) == null ? void 0 : _a2.push(...cResult.webComponents || []);
|
|
42434
42442
|
result.partials.push(...cResult.partials);
|
|
42435
42443
|
result.components = { ...result.components, ...cResult.components };
|
|
42436
42444
|
if (cResult.pageEvents) result.pageEvents = cResult.pageEvents;
|
|
@@ -42442,18 +42450,20 @@ var _Transpiler = class _Transpiler {
|
|
|
42442
42450
|
}
|
|
42443
42451
|
});
|
|
42444
42452
|
result.markup += postTranspileHtmlElement(e);
|
|
42445
|
-
} else if (transformer != null) {
|
|
42453
|
+
} else if (transformer != null || isWebComponent) {
|
|
42454
|
+
const resolvedTransformer = transformer != null ? transformer : this.transformers.get("__web-component__");
|
|
42446
42455
|
const context = new TranspilationContext2({
|
|
42447
42456
|
result,
|
|
42448
42457
|
isPartOfPrefab,
|
|
42449
|
-
transformer,
|
|
42458
|
+
transformer: resolvedTransformer,
|
|
42450
42459
|
listener: oldContext == null ? void 0 : oldContext.listener,
|
|
42451
42460
|
props: (oldContext == null ? void 0 : oldContext.props) || [],
|
|
42452
42461
|
data: oldContext == null ? void 0 : oldContext.data
|
|
42453
42462
|
});
|
|
42454
|
-
result.imports.push(...
|
|
42455
|
-
result.markup +=
|
|
42463
|
+
result.imports.push(...resolvedTransformer.imports(e, context));
|
|
42464
|
+
result.markup += resolvedTransformer.pre(e, context).replace(new RegExp(FORMAT_CONTEXT, "g"), "") + (e.childNodes.length > 0 ? "\n" : "");
|
|
42456
42465
|
e.childNodes.forEach((c) => {
|
|
42466
|
+
var _a2;
|
|
42457
42467
|
if (c && c.nodeType == NodeType2.ELEMENT_NODE) {
|
|
42458
42468
|
const cResult = this.transpile(c, isPartOfPrefab, splitCode, context);
|
|
42459
42469
|
(0, import_lodash5.assignIn)(result.components, cResult.components);
|
|
@@ -42461,6 +42471,7 @@ var _Transpiler = class _Transpiler {
|
|
|
42461
42471
|
result.imports.push(...cResult.imports);
|
|
42462
42472
|
result.prefabs.push(...cResult.prefabs);
|
|
42463
42473
|
result.wmxcomponents.push(...cResult.wmxcomponents);
|
|
42474
|
+
(_a2 = result.webComponents) == null ? void 0 : _a2.push(...cResult.webComponents || []);
|
|
42464
42475
|
result.partials.push(...cResult.partials);
|
|
42465
42476
|
result.components = { ...result.components, ...cResult.components };
|
|
42466
42477
|
if (cResult.pageEvents) result.pageEvents = cResult.pageEvents;
|
|
@@ -42471,10 +42482,10 @@ var _Transpiler = class _Transpiler {
|
|
|
42471
42482
|
}
|
|
42472
42483
|
}
|
|
42473
42484
|
});
|
|
42474
|
-
|
|
42475
|
-
|
|
42476
|
-
|
|
42477
|
-
result.markup +=
|
|
42485
|
+
resolvedTransformer.partials && result.partials.push(...resolvedTransformer.partials(e, context));
|
|
42486
|
+
resolvedTransformer.prefabs && result.prefabs.push(...resolvedTransformer.prefabs(e, context));
|
|
42487
|
+
resolvedTransformer.wmxcomponents && result.wmxcomponents.push(...resolvedTransformer.wmxcomponents(e, context));
|
|
42488
|
+
result.markup += resolvedTransformer.post(e, context).replace(new RegExp(FORMAT_CONTEXT, "g"), "");
|
|
42478
42489
|
const accessRole = e.attrs["accessroles"];
|
|
42479
42490
|
if (accessRole) {
|
|
42480
42491
|
result.markup = `{fragment.appConfig.SecurityService.hasAccessToWidget('${accessRole}') ? (${result.markup}): null}`;
|
|
@@ -42484,6 +42495,19 @@ var _Transpiler = class _Transpiler {
|
|
|
42484
42495
|
return result;
|
|
42485
42496
|
};
|
|
42486
42497
|
}
|
|
42498
|
+
getWebComponentDefinition(element) {
|
|
42499
|
+
const attributes = {};
|
|
42500
|
+
Object.entries(element.attributes).forEach(([name, value]) => {
|
|
42501
|
+
if (name.startsWith("on-")) {
|
|
42502
|
+
attributes[`on${name.substring(3).replace(/-/g, "")}`] = "(event: CustomEvent) => void";
|
|
42503
|
+
} else if (value.startsWith("bind:")) {
|
|
42504
|
+
attributes[name.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase())] = "unknown";
|
|
42505
|
+
} else {
|
|
42506
|
+
attributes[name] = "string";
|
|
42507
|
+
}
|
|
42508
|
+
});
|
|
42509
|
+
return { tag: element.tagName.toLowerCase(), attributes };
|
|
42510
|
+
}
|
|
42487
42511
|
/**
|
|
42488
42512
|
* Transforms $[...] syntax to fragment.property for use with Angular parser
|
|
42489
42513
|
* Examples:
|
|
@@ -42649,7 +42673,7 @@ var _Transpiler = class _Transpiler {
|
|
|
42649
42673
|
});
|
|
42650
42674
|
}
|
|
42651
42675
|
transformStyles(e, context) {
|
|
42652
|
-
var _a, _b;
|
|
42676
|
+
var _a, _b, _c;
|
|
42653
42677
|
let rawStylesObj = {};
|
|
42654
42678
|
const style_attr = e.getAttribute("style");
|
|
42655
42679
|
const rawStyles = e.getAttribute("styles") || style_attr;
|
|
@@ -42730,7 +42754,12 @@ var _Transpiler = class _Transpiler {
|
|
|
42730
42754
|
}
|
|
42731
42755
|
}
|
|
42732
42756
|
if (conditionalClasses) {
|
|
42757
|
+
const isInsideTableColumn = !!((_b = context == null ? void 0 : context.get) == null ? void 0 : _b.call(context, "isInsideTableColumn"));
|
|
42733
42758
|
conditionalClasses = conditionalClasses.startsWith("bind:") ? `${conditionalClasses.substring(5)}` : conditionalClasses;
|
|
42759
|
+
if (isInsideTableColumn) {
|
|
42760
|
+
conditionalClasses = conditionalClasses.replace("fragment.Page", "fragment");
|
|
42761
|
+
}
|
|
42762
|
+
const transformCondition = (exp) => isInsideTableColumn ? transformTableColumnClassExpression(exp) : addOptionalChaining(exp);
|
|
42734
42763
|
if (conditionalClasses.startsWith("{") && conditionalClasses.endsWith("}")) {
|
|
42735
42764
|
conditionalClasses = conditionalClasses.slice(1, -1);
|
|
42736
42765
|
let expressions = conditionalClasses.split(",").map((expression) => {
|
|
@@ -42738,13 +42767,13 @@ var _Transpiler = class _Transpiler {
|
|
|
42738
42767
|
if (!condition) {
|
|
42739
42768
|
return `'${className.trim()}'`;
|
|
42740
42769
|
}
|
|
42741
|
-
return `(${
|
|
42770
|
+
return `(${transformCondition(condition.trim())} ? ${className.replace(/'$/, " '")} : '')`;
|
|
42742
42771
|
});
|
|
42743
42772
|
conditionalClasses = expressions.join("+");
|
|
42744
42773
|
} else if (!conditionalClasses.includes(":") && !conditionalClasses.includes("&&") && !conditionalClasses.includes("||") && !conditionalClasses.includes("$formField")) {
|
|
42745
|
-
conditionalClasses = `${conditionalClasses}`;
|
|
42774
|
+
conditionalClasses = isInsideTableColumn ? transformCondition(conditionalClasses) : `${conditionalClasses}`;
|
|
42746
42775
|
} else {
|
|
42747
|
-
conditionalClasses =
|
|
42776
|
+
conditionalClasses = transformCondition(conditionalClasses);
|
|
42748
42777
|
}
|
|
42749
42778
|
if (classes == null ? void 0 : classes.startsWith("{")) {
|
|
42750
42779
|
classes = classes.substring(0, classes.length - 1);
|
|
@@ -42756,7 +42785,7 @@ var _Transpiler = class _Transpiler {
|
|
|
42756
42785
|
}
|
|
42757
42786
|
} else if (classes.includes("{{") && classes.includes("}}")) {
|
|
42758
42787
|
const mustacheClass = transformClassWithMustacheExpressions(classes, {
|
|
42759
|
-
isInsideTableColumn: !!((
|
|
42788
|
+
isInsideTableColumn: !!((_c = context == null ? void 0 : context.get) == null ? void 0 : _c.call(context, "isInsideTableColumn"))
|
|
42760
42789
|
});
|
|
42761
42790
|
classes = mustacheClass != null ? mustacheClass : `'${classes}'`;
|
|
42762
42791
|
} else if (!!classes && !classes.startsWith("{")) {
|
|
@@ -43182,6 +43211,7 @@ var transpileMarkup = (markup, isPartOfPrefab, splitCode, variables, preview, in
|
|
|
43182
43211
|
components: {},
|
|
43183
43212
|
partials: [],
|
|
43184
43213
|
wmxcomponents: [],
|
|
43214
|
+
webComponents: [],
|
|
43185
43215
|
prefabs: [],
|
|
43186
43216
|
imports: []
|
|
43187
43217
|
};
|
|
@@ -43212,6 +43242,7 @@ var transpileMarkup = (markup, isPartOfPrefab, splitCode, variables, preview, in
|
|
|
43212
43242
|
}
|
|
43213
43243
|
});
|
|
43214
43244
|
parsed.childNodes.forEach((node) => {
|
|
43245
|
+
var _a;
|
|
43215
43246
|
if (node.nodeType === NodeType2.TEXT_NODE) {
|
|
43216
43247
|
const textContent = node.text;
|
|
43217
43248
|
if (textContent.trim()) {
|
|
@@ -43226,6 +43257,7 @@ var transpileMarkup = (markup, isPartOfPrefab, splitCode, variables, preview, in
|
|
|
43226
43257
|
finalResult.partials.push(...result.partials);
|
|
43227
43258
|
finalResult.prefabs.push(...result.prefabs);
|
|
43228
43259
|
finalResult.wmxcomponents.push(...result.wmxcomponents);
|
|
43260
|
+
(_a = finalResult.webComponents) == null ? void 0 : _a.push(...result.webComponents || []);
|
|
43229
43261
|
finalResult.imports.push(...result.imports);
|
|
43230
43262
|
if (result.pageEvents) finalResult.pageEvents = result.pageEvents;
|
|
43231
43263
|
}
|
|
@@ -43297,7 +43329,7 @@ var preTranspileHtmlElement = (e) => {
|
|
|
43297
43329
|
const styleObj = style_transformer_default(e, (propName) => {
|
|
43298
43330
|
return true;
|
|
43299
43331
|
}) || {};
|
|
43300
|
-
const
|
|
43332
|
+
const attrs2 = Object.keys(e.attributes).filter((attr) => attr !== "name").map((attr) => {
|
|
43301
43333
|
const value = e.getAttribute(attr);
|
|
43302
43334
|
if (!value) return `${attr}=""`;
|
|
43303
43335
|
if (attr === "class") {
|
|
@@ -43312,7 +43344,7 @@ var preTranspileHtmlElement = (e) => {
|
|
|
43312
43344
|
if (styleObj && Object.keys(styleObj).length > 0) {
|
|
43313
43345
|
styleAttr = ` style={${JSON.stringify(styleObj)}}`;
|
|
43314
43346
|
}
|
|
43315
|
-
const attrsStr =
|
|
43347
|
+
const attrsStr = attrs2 ? ` ${attrs2}` : "";
|
|
43316
43348
|
return `<${e.tagName.toLowerCase()}${attrsStr}${styleAttr}>`;
|
|
43317
43349
|
};
|
|
43318
43350
|
var convertStyleStringToObject = (styleString) => {
|
|
@@ -43385,6 +43417,13 @@ function createLayoutRegionTransformer(config) {
|
|
|
43385
43417
|
const content = element.getAttribute("content") || defaultContent;
|
|
43386
43418
|
const name = element.getAttribute("name") || defaultName;
|
|
43387
43419
|
const isPreview = context.get("preview") === true;
|
|
43420
|
+
const hasCustomContent = element.childNodes.some(
|
|
43421
|
+
(node) => node.nodeType === NodeType.ELEMENT_NODE
|
|
43422
|
+
);
|
|
43423
|
+
if (hasCustomContent) {
|
|
43424
|
+
return `<${tag} ${transformAttrs(element, context)}>
|
|
43425
|
+
`;
|
|
43426
|
+
}
|
|
43388
43427
|
if (isPreview) {
|
|
43389
43428
|
return `<${tag} ${transformAttrs(element, context)}>
|
|
43390
43429
|
<WmPartialContainer content="${content}" isLayout={true} partialName="${name}" listener={fragment} />
|
|
@@ -43396,6 +43435,12 @@ function createLayoutRegionTransformer(config) {
|
|
|
43396
43435
|
},
|
|
43397
43436
|
post: () => `</${tag}>`,
|
|
43398
43437
|
imports: (element, context) => {
|
|
43438
|
+
const hasCustomContent = element.childNodes.some(
|
|
43439
|
+
(node) => node.nodeType === NodeType.ELEMENT_NODE
|
|
43440
|
+
);
|
|
43441
|
+
if (hasCustomContent) {
|
|
43442
|
+
return [...componentImports];
|
|
43443
|
+
}
|
|
43399
43444
|
const isPreview = context.get("preview") === true;
|
|
43400
43445
|
if (isPreview) {
|
|
43401
43446
|
return [...componentImports, ...partialContainerImport];
|
|
@@ -43790,7 +43835,7 @@ function withPartialContainer(element, context, options) {
|
|
|
43790
43835
|
if (options.removeName) {
|
|
43791
43836
|
element.removeAttribute("name");
|
|
43792
43837
|
}
|
|
43793
|
-
const params = options.extraParams ? `props:Record<string, any>, onLoad:()=>void, ${options.extraParams}` : "props:Record<string, any>, onLoad:()=>void";
|
|
43838
|
+
const params = options.extraParams ? `props:Record<string, any>, onLoad:(widget?: any)=>void, ${options.extraParams}` : "props:Record<string, any>, onLoad:(widget?: any)=>void";
|
|
43794
43839
|
partial = `${options.prop}={(${params}) => (${partial})}`;
|
|
43795
43840
|
}
|
|
43796
43841
|
return { partialAttr: partial, extraImports };
|
|
@@ -43950,7 +43995,7 @@ var button_transformer_default = {
|
|
|
43950
43995
|
const enclosingFormName = getParentNode(element, "wm-form");
|
|
43951
43996
|
enclosingFormName && element.setAttribute("formName", enclosingFormName);
|
|
43952
43997
|
}
|
|
43953
|
-
const isInsideTableColumn = getParentNode(element, "wm-table-column");
|
|
43998
|
+
const isInsideTableColumn = getParentNode(element, "wm-table-column") || (context == null ? void 0 : context.get("isInsideTableColumn"));
|
|
43954
43999
|
const stopPropagation = (context == null ? void 0 : context.get("isInsideList")) || isInsideTableColumn ? " stopPropagation={true}" : "";
|
|
43955
44000
|
return `<WmButton listener={fragment} ${stopPropagation} ${transformAttrs(element, context)} ${context.isPartOfPrefab ? " prefabName={fragment.prefabName}" : ""} >`;
|
|
43956
44001
|
},
|
|
@@ -44201,7 +44246,7 @@ var buildItemAttrsFromListTemplate = (template, context) => {
|
|
|
44201
44246
|
};
|
|
44202
44247
|
var list_transformer_default = {
|
|
44203
44248
|
pre: (element, context) => {
|
|
44204
|
-
var _a, _b, _c, _d, _e
|
|
44249
|
+
var _a, _b, _c, _d, _e;
|
|
44205
44250
|
context.set("isInsideList", true);
|
|
44206
44251
|
const widgetName = element.attrs["name"];
|
|
44207
44252
|
const listContent = parse5(`<wm-list-content name="${widgetName + "Item"}"></wm-list-content>`).firstChild;
|
|
@@ -44237,9 +44282,9 @@ var list_transformer_default = {
|
|
|
44237
44282
|
transformRepeatChildAttr(template, "fragment.item", "$item");
|
|
44238
44283
|
transformRepeatChildAttr(template, "fragment.index", "$index");
|
|
44239
44284
|
transformRepeatChildAttr(template, "fragment.$index", "$index");
|
|
44240
|
-
transformRepeatChildAttr(template, "itemRef.$index", "index");
|
|
44241
|
-
transformRepeatChildAttr(template, "itemRef.$first", "first");
|
|
44242
|
-
transformRepeatChildAttr(template, "itemRef.$last", "last");
|
|
44285
|
+
transformRepeatChildAttr(template, "fragment.itemRef.$index", "$index");
|
|
44286
|
+
transformRepeatChildAttr(template, "fragment.itemRef.$first", "$first");
|
|
44287
|
+
transformRepeatChildAttr(template, "fragment.itemRef.$last", "$last");
|
|
44243
44288
|
if (template && dataSet && dataSet.startsWith("bind:")) {
|
|
44244
44289
|
transformRepeatChildData(
|
|
44245
44290
|
template,
|
|
@@ -44291,21 +44336,17 @@ var list_transformer_default = {
|
|
|
44291
44336
|
widgetName
|
|
44292
44337
|
);
|
|
44293
44338
|
transformRepeatChildAttr(template, dataSet.substring(5), "$item");
|
|
44294
|
-
|
|
44295
|
-
if (isLoading) {
|
|
44296
|
-
element.setAttribute("loadingdata", `bind:${isLoading}`);
|
|
44297
|
-
}
|
|
44298
|
-
if ((_b = element.getAttribute("disableitem")) == null ? void 0 : _b.startsWith("bind:")) {
|
|
44339
|
+
if ((_a = element.getAttribute("disableitem")) == null ? void 0 : _a.startsWith("bind:")) {
|
|
44299
44340
|
const disabelItemExp = replaceAll(
|
|
44300
|
-
((
|
|
44341
|
+
((_b = element.getAttribute("disableitem")) == null ? void 0 : _b.substring(5)) || "",
|
|
44301
44342
|
dataSet.substring(5) + "[fragment.$i]",
|
|
44302
44343
|
"$item"
|
|
44303
44344
|
);
|
|
44304
44345
|
disableitem = `disableitem={($item, $index) => fragment.eval(() => ${disabelItemExp})}`;
|
|
44305
44346
|
element.removeAttribute("disableitem");
|
|
44306
44347
|
}
|
|
44307
|
-
if ((
|
|
44308
|
-
let itemKeyExp = ((
|
|
44348
|
+
if ((_c = element.getAttribute("itemkey")) == null ? void 0 : _c.startsWith("bind:")) {
|
|
44349
|
+
let itemKeyExp = ((_d = element.getAttribute("itemkey")) == null ? void 0 : _d.substring(5)) || "";
|
|
44309
44350
|
itemKeyExp = replaceAll(itemKeyExp, dataSet.substring(5) + "[fragment.$i]", "$item");
|
|
44310
44351
|
itemKeyExp = replaceAll(itemKeyExp, dataSet.substring(5) + "[0]", "$item");
|
|
44311
44352
|
itemKey = `itemkey={($item, $index) => fragment.eval(() => ${itemKeyExp})}`;
|
|
@@ -44339,7 +44380,7 @@ var list_transformer_default = {
|
|
|
44339
44380
|
}
|
|
44340
44381
|
}
|
|
44341
44382
|
const templateNode = element.childNodes.find((c) => c instanceof HTMLElement);
|
|
44342
|
-
const itemAttrsStr = ((
|
|
44383
|
+
const itemAttrsStr = ((_e = templateNode == null ? void 0 : templateNode.tagName) == null ? void 0 : _e.toLowerCase()) === "wm-listtemplate" ? buildItemAttrsFromListTemplate(templateNode, context) : "";
|
|
44343
44384
|
addTemplateClass(element);
|
|
44344
44385
|
listContent.childNodes = element.childNodes;
|
|
44345
44386
|
element.childNodes = [listContent];
|
|
@@ -44863,8 +44904,8 @@ var form_field_transformer_default = {
|
|
|
44863
44904
|
element.setAttribute("formName", formName);
|
|
44864
44905
|
}
|
|
44865
44906
|
(() => {
|
|
44866
|
-
const
|
|
44867
|
-
|
|
44907
|
+
const attrs2 = ["primary-key", "is-related"];
|
|
44908
|
+
attrs2.forEach((attr) => {
|
|
44868
44909
|
if (element.hasAttribute(attr)) {
|
|
44869
44910
|
element.removeAttribute(attr);
|
|
44870
44911
|
}
|
|
@@ -45057,7 +45098,8 @@ var getFormActionExpr = (action, isAsync = false) => {
|
|
|
45057
45098
|
const asyncKeyword = isAsync ? "async " : "";
|
|
45058
45099
|
const awaitKeyword = isAsync ? "await " : "";
|
|
45059
45100
|
const processedAction = isAsync && action.includes("?.submit();") ? action.replace(/(\S+\?\.submit\(\);)/g, `${awaitKeyword}$1`) : action;
|
|
45060
|
-
|
|
45101
|
+
const params = /\bwidget\b/.test(action) ? "($event, widget)" : "($event)";
|
|
45102
|
+
return `${asyncKeyword}${params} => {
|
|
45061
45103
|
${processedAction}
|
|
45062
45104
|
}`;
|
|
45063
45105
|
};
|
|
@@ -45097,11 +45139,11 @@ var form_action_transformer_default = {
|
|
|
45097
45139
|
const fragmentPrefix = "fragment?.Widgets";
|
|
45098
45140
|
const widgetsPrefix = "Widgets";
|
|
45099
45141
|
let btnClass = "btn-default";
|
|
45100
|
-
if (actionType === "submit") {
|
|
45142
|
+
if (actionType === "submit" || action === "submit()") {
|
|
45101
45143
|
btnClass = "btn-primary";
|
|
45102
45144
|
action = listName ? getWidgetAccessor(listPrefix, formName, "?.submit();", isDynamicFormName) + (action || "") : getWidgetAccessor(widgetsPrefix, formName, "?.submit();", isDynamicFormName) + (action || "");
|
|
45103
45145
|
}
|
|
45104
|
-
if (actionType === "reset") {
|
|
45146
|
+
if (actionType === "reset" || action === "reset()") {
|
|
45105
45147
|
action = listName ? getWidgetAccessor(listPrefix, formName, "?.formreset()", isDynamicFormName) + (action || "") : getWidgetAccessor(widgetsPrefix, formName, "?.formreset();", isDynamicFormName) + (action || "");
|
|
45106
45148
|
}
|
|
45107
45149
|
if (action) {
|
|
@@ -47486,8 +47528,37 @@ var wmx_component_transformer_default = {
|
|
|
47486
47528
|
]
|
|
47487
47529
|
};
|
|
47488
47530
|
|
|
47531
|
+
// src/transpile/components/web-component/web-component.transformer.ts
|
|
47532
|
+
var toCamelCase = (name) => name.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
47533
|
+
var attrs = (element) => Object.entries(element.attributes).map(([name, value]) => {
|
|
47534
|
+
if (name.startsWith("on-")) {
|
|
47535
|
+
return `on${name.substring(3).replace(/-/g, "")}={($event) => { ${value.replace(/;+$/, "")} }}`;
|
|
47536
|
+
}
|
|
47537
|
+
if (value.startsWith("bind:")) return `${toCamelCase(name)}={${value.substring(5)}}`;
|
|
47538
|
+
return `${name}=${JSON.stringify(value)}`;
|
|
47539
|
+
}).join(" ");
|
|
47540
|
+
var web_component_transformer_default = {
|
|
47541
|
+
pre: (element, context) => {
|
|
47542
|
+
var _a;
|
|
47543
|
+
const tagName = element.tagName.toLowerCase();
|
|
47544
|
+
if ((_a = context.data) == null ? void 0 : _a.preview) {
|
|
47545
|
+
return `<${tagName} ${attrs(element)}>`;
|
|
47546
|
+
}
|
|
47547
|
+
return `<WebComponent tagname=${JSON.stringify(tagName)} ${attrs(element)} />`;
|
|
47548
|
+
},
|
|
47549
|
+
post: (element, context) => {
|
|
47550
|
+
var _a;
|
|
47551
|
+
return ((_a = context.data) == null ? void 0 : _a.preview) ? `</${element.tagName.toLowerCase()}>` : "";
|
|
47552
|
+
},
|
|
47553
|
+
imports: (element, context) => {
|
|
47554
|
+
var _a;
|
|
47555
|
+
return ((_a = context.data) == null ? void 0 : _a.preview) ? [] : [{ name: "WebComponent", from: "@/app/helper/web-component" }];
|
|
47556
|
+
}
|
|
47557
|
+
};
|
|
47558
|
+
|
|
47489
47559
|
// src/transpile/components/transform-register.ts
|
|
47490
47560
|
var transform_register_default = () => {
|
|
47561
|
+
registerTransformer("__web-component__", web_component_transformer_default);
|
|
47491
47562
|
registerTransformer("wm-page", page_transformer_default);
|
|
47492
47563
|
registerTransformer("wm-page-content", page_content_transformer_default);
|
|
47493
47564
|
registerTransformer("wm-content", content_transformer_default);
|