@wavemaker-ai/react-codegen 1.0.0-rc.647655 → 1.0.0-rc.647684
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 +361 -244
- package/dist/transpiler/index.mjs.map +1 -1
- package/dist/transpiler/wm-styles.css +3 -4
- package/package-lock.json +142 -609
- package/package.json +7 -23
- package/src/app.generator.js +45 -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/bind.ex.transformer.js +42 -14
- package/src/transpile/bind.ex.transformer.js.map +1 -1
- package/src/transpile/components/container/wizardaction.transformer.js +1 -1
- package/src/transpile/components/container/wizardaction.transformer.js.map +1 -1
- package/src/transpile/components/container/wizardstep.transformer.js +1 -1
- package/src/transpile/components/container/wizardstep.transformer.js.map +1 -1
- 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/form/form-field.transformer.js +16 -1
- package/src/transpile/components/data/form/form-field.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/data/live-filter-field.transformer.js +13 -1
- package/src/transpile/components/data/live-filter-field.transformer.js.map +1 -1
- package/src/transpile/components/dialogs/dialog.transformer.js +15 -8
- package/src/transpile/components/dialogs/dialog.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 +4 -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/components/wmx-component/wmx-component.transformer.js +12 -15
- package/src/transpile/components/wmx-component/wmx-component.transformer.js.map +1 -1
- package/src/transpile/style.transformer.js +6 -1
- package/src/transpile/style.transformer.js.map +1 -1
- package/src/transpile/transpile.js +61 -18
- package/src/transpile/transpile.js.map +1 -1
- package/src/transpile/widget-inline-style-processor.js +5 -1
- package/src/transpile/widget-inline-style-processor.js.map +1 -1
- package/src/utils.browser.js +43 -20
- package/src/utils.browser.js.map +1 -1
- package/src/utils.js +6 -116
- package/src/utils.js.map +1 -1
- package/src/wmx.generator.js +4 -26
- package/src/wmx.generator.js.map +1 -1
- package/templates/component/app.template.hbs +8 -0
- package/templates/component/web-component.tsx +61 -0
- package/templates/project/app/components.css +3 -0
- package/templates/project/app/wm-globals.css +0 -4
- package/templates/project/package.json +4 -4
|
@@ -4567,9 +4567,9 @@ var require_lodash = __commonJS({
|
|
|
4567
4567
|
}
|
|
4568
4568
|
var camelCase = createCompounder(function(result2, word, index) {
|
|
4569
4569
|
word = word.toLowerCase();
|
|
4570
|
-
return result2 + (index ?
|
|
4570
|
+
return result2 + (index ? capitalize4(word) : word);
|
|
4571
4571
|
});
|
|
4572
|
-
function
|
|
4572
|
+
function capitalize4(string) {
|
|
4573
4573
|
return upperFirst2(toString(string).toLowerCase());
|
|
4574
4574
|
}
|
|
4575
4575
|
function deburr(string) {
|
|
@@ -5178,7 +5178,7 @@ var require_lodash = __commonJS({
|
|
|
5178
5178
|
lodash.add = add;
|
|
5179
5179
|
lodash.attempt = attempt;
|
|
5180
5180
|
lodash.camelCase = camelCase;
|
|
5181
|
-
lodash.capitalize =
|
|
5181
|
+
lodash.capitalize = capitalize4;
|
|
5182
5182
|
lodash.ceil = ceil;
|
|
5183
5183
|
lodash.clamp = clamp;
|
|
5184
5184
|
lodash.clone = clone2;
|
|
@@ -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) {
|
|
@@ -38981,6 +38981,7 @@ var NodeType = import_dist.default.NodeType;
|
|
|
38981
38981
|
var esm_default = import_dist.default;
|
|
38982
38982
|
|
|
38983
38983
|
// src/utils.browser.ts
|
|
38984
|
+
var appLocaleRegex = /(fragment\.)?(?:App\.)?appLocale(?:\.messages)?(?:\[(['"])([^'"]+)\2\]|\.([a-zA-Z0-9_]+))/g;
|
|
38984
38985
|
function isValid(expr) {
|
|
38985
38986
|
try {
|
|
38986
38987
|
(0, import_parser.parse)(expr, { sourceType: "module", plugins: ["optionalChaining"] });
|
|
@@ -39270,7 +39271,6 @@ var transformAppLocale = (exp) => {
|
|
|
39270
39271
|
exp = exp.replace("fragment?.Prefab", "fragment");
|
|
39271
39272
|
exp = exp.replace("fragment.Prefab", "fragment");
|
|
39272
39273
|
}
|
|
39273
|
-
const appLocaleRegex = /(fragment\.)?appLocale(?:\.messages)?(?:\[(['"])([^'"]+)\2\]|\.([a-zA-Z0-9_]+))/g;
|
|
39274
39274
|
const replacer = (fullMatch, fragmentPrefix, quoteType, keyFromBrackets, keyFromDot) => {
|
|
39275
39275
|
const key = keyFromBrackets || keyFromDot;
|
|
39276
39276
|
if (key) {
|
|
@@ -39505,8 +39505,30 @@ var htmlElements = [
|
|
|
39505
39505
|
// src/transpile/bind.ex.transformer.ts
|
|
39506
39506
|
var FORMAT_CONTEXT = "{formatContext:''}";
|
|
39507
39507
|
var FORMAT_CONTEXT_REGEX = /\{formatContext:''\}/g;
|
|
39508
|
-
var FRAGMENT_SCOPED_NAMES = ["appLocale", "Variables"];
|
|
39508
|
+
var FRAGMENT_SCOPED_NAMES = ["appLocale", "Variables", "App"];
|
|
39509
39509
|
var LIST_SCOPE_VARS = /* @__PURE__ */ new Set(["currentItemWidgets"]);
|
|
39510
|
+
var JS_GLOBALS = /* @__PURE__ */ new Set([
|
|
39511
|
+
"Number",
|
|
39512
|
+
"String",
|
|
39513
|
+
"Boolean",
|
|
39514
|
+
"Array",
|
|
39515
|
+
"Object",
|
|
39516
|
+
"Date",
|
|
39517
|
+
"Math",
|
|
39518
|
+
"JSON",
|
|
39519
|
+
"RegExp",
|
|
39520
|
+
"Promise",
|
|
39521
|
+
"Symbol",
|
|
39522
|
+
"BigInt",
|
|
39523
|
+
"parseInt",
|
|
39524
|
+
"parseFloat",
|
|
39525
|
+
"isNaN",
|
|
39526
|
+
"isFinite",
|
|
39527
|
+
"encodeURIComponent",
|
|
39528
|
+
"decodeURIComponent",
|
|
39529
|
+
"encodeURI",
|
|
39530
|
+
"decodeURI"
|
|
39531
|
+
]);
|
|
39510
39532
|
var ExpressionTransformer = class {
|
|
39511
39533
|
constructor(ctx = "this", mode = "attr") {
|
|
39512
39534
|
this.ctx = ctx;
|
|
@@ -39536,14 +39558,14 @@ var ExpressionTransformer = class {
|
|
|
39536
39558
|
if (this.mode === "event" && ast.receiver instanceof ImplicitReceiver && ast.name === "$event") {
|
|
39537
39559
|
return "$event";
|
|
39538
39560
|
}
|
|
39539
|
-
if (ast.receiver instanceof ImplicitReceiver && LIST_SCOPE_VARS.has(ast.name)) {
|
|
39561
|
+
if (ast.receiver instanceof ImplicitReceiver && (LIST_SCOPE_VARS.has(ast.name) || JS_GLOBALS.has(ast.name))) {
|
|
39540
39562
|
return ast.name;
|
|
39541
39563
|
}
|
|
39542
39564
|
const r = this.build(ast.receiver);
|
|
39543
39565
|
return `${r}.${ast.name}`;
|
|
39544
39566
|
}
|
|
39545
39567
|
processSafePropertyRead(ast) {
|
|
39546
|
-
if (ast.receiver instanceof ImplicitReceiver && LIST_SCOPE_VARS.has(ast.name)) {
|
|
39568
|
+
if (ast.receiver instanceof ImplicitReceiver && (LIST_SCOPE_VARS.has(ast.name) || JS_GLOBALS.has(ast.name))) {
|
|
39547
39569
|
return ast.name;
|
|
39548
39570
|
}
|
|
39549
39571
|
const r = this.build(ast.receiver);
|
|
@@ -39591,16 +39613,23 @@ var ExpressionTransformer = class {
|
|
|
39591
39613
|
const rhs = this.build(ast.value);
|
|
39592
39614
|
return `${lhs} = ${rhs}`;
|
|
39593
39615
|
}
|
|
39594
|
-
|
|
39616
|
+
buildCallArgs(args) {
|
|
39595
39617
|
const _args = [];
|
|
39596
|
-
for (const arg of
|
|
39618
|
+
for (const arg of args) {
|
|
39597
39619
|
let argExp = this.build(arg);
|
|
39598
|
-
const fragmentScoped = typeof argExp === "string" && FRAGMENT_SCOPED_NAMES.some((name) => argExp.includes(name));
|
|
39620
|
+
const fragmentScoped = typeof argExp === "string" && FRAGMENT_SCOPED_NAMES.some((name) => name !== this.ctx && argExp.includes(name));
|
|
39599
39621
|
if (this.mode === "event" && !fragmentScoped && argExp.replace) {
|
|
39600
39622
|
argExp = argExp.replace(`${this.ctx}.`, "");
|
|
39601
39623
|
}
|
|
39602
39624
|
_args.push(argExp);
|
|
39603
39625
|
}
|
|
39626
|
+
return _args;
|
|
39627
|
+
}
|
|
39628
|
+
processMethodCall(ast) {
|
|
39629
|
+
const _args = this.buildCallArgs(ast.args);
|
|
39630
|
+
if (ast.receiver instanceof ImplicitReceiver && JS_GLOBALS.has(ast.name)) {
|
|
39631
|
+
return `${ast.name}(${_args.join(",")})`;
|
|
39632
|
+
}
|
|
39604
39633
|
const fn2 = this.build(ast.receiver);
|
|
39605
39634
|
if (_args.includes("currentItemWidgets")) {
|
|
39606
39635
|
_args.forEach((arg, index) => {
|
|
@@ -39612,14 +39641,9 @@ var ExpressionTransformer = class {
|
|
|
39612
39641
|
return `${fn2}?.${ast.name}?.(${_args.join(",")})`;
|
|
39613
39642
|
}
|
|
39614
39643
|
processSafeMethodCall(ast) {
|
|
39615
|
-
const _args =
|
|
39616
|
-
|
|
39617
|
-
|
|
39618
|
-
const fragmentScoped = typeof argExp === "string" && FRAGMENT_SCOPED_NAMES.some((name) => argExp.includes(name));
|
|
39619
|
-
if (this.mode === "event" && !fragmentScoped && argExp.replace) {
|
|
39620
|
-
argExp = argExp.replace(`${this.ctx}.`, "");
|
|
39621
|
-
}
|
|
39622
|
-
_args.push(argExp);
|
|
39644
|
+
const _args = this.buildCallArgs(ast.args);
|
|
39645
|
+
if (ast.receiver instanceof ImplicitReceiver && JS_GLOBALS.has(ast.name)) {
|
|
39646
|
+
return `${ast.name}(${_args.join(",")})`;
|
|
39623
39647
|
}
|
|
39624
39648
|
const fn2 = this.build(ast.receiver);
|
|
39625
39649
|
return `${fn2}?.${ast.name}?.(${_args.join(",")})`;
|
|
@@ -40840,7 +40864,10 @@ var style_transformer_default = (element, isStyleProperty) => {
|
|
|
40840
40864
|
StyleProps.forEach((parser, k) => {
|
|
40841
40865
|
if (!!element.hasAttribute(k) && isStyleProperty && isStyleProperty(k)) {
|
|
40842
40866
|
const value = element.getAttribute(k);
|
|
40843
|
-
|
|
40867
|
+
const isFillDimension = (k === "width" || k === "height") && value === "fill";
|
|
40868
|
+
if (!isFillDimension) {
|
|
40869
|
+
element.removeAttribute(k);
|
|
40870
|
+
}
|
|
40844
40871
|
if (value) {
|
|
40845
40872
|
if (value.startsWith("bind:")) {
|
|
40846
40873
|
if (k === "backgroundimage" && value.startsWith('bind:"') && value.endsWith('"')) {
|
|
@@ -41755,7 +41782,7 @@ function parseAttrValue(name, raw, props) {
|
|
|
41755
41782
|
}
|
|
41756
41783
|
}
|
|
41757
41784
|
function getStaticLayoutPropsFromElement(element, dynamicGroups) {
|
|
41758
|
-
const
|
|
41785
|
+
const attrs2 = element.attributes || {};
|
|
41759
41786
|
const props = {};
|
|
41760
41787
|
let hasAny = false;
|
|
41761
41788
|
for (const name of LAYOUT_ATTR_NAMES) {
|
|
@@ -41764,7 +41791,7 @@ function getStaticLayoutPropsFromElement(element, dynamicGroups) {
|
|
|
41764
41791
|
if (dynamicGroups.overflow && OVERFLOW_ATTR_GROUP.has(name)) continue;
|
|
41765
41792
|
if (dynamicGroups.position && POSITION_ATTR_GROUP.has(name)) continue;
|
|
41766
41793
|
}
|
|
41767
|
-
const raw =
|
|
41794
|
+
const raw = attrs2[name];
|
|
41768
41795
|
if (raw == null) continue;
|
|
41769
41796
|
if (isBind(raw)) continue;
|
|
41770
41797
|
hasAny = true;
|
|
@@ -41782,10 +41809,10 @@ function expandShorthand(value) {
|
|
|
41782
41809
|
return [parts[0], parts[1], parts[2], parts[3]];
|
|
41783
41810
|
}
|
|
41784
41811
|
function detectDynamicGroups(element) {
|
|
41785
|
-
const
|
|
41812
|
+
const attrs2 = element.attributes || {};
|
|
41786
41813
|
const flags = { flex: false, overflow: false, position: false };
|
|
41787
41814
|
for (const name of LAYOUT_ATTR_NAMES) {
|
|
41788
|
-
const raw =
|
|
41815
|
+
const raw = attrs2[name];
|
|
41789
41816
|
if (raw == null || !isBind(raw)) continue;
|
|
41790
41817
|
if (FLEX_ATTR_GROUP.has(name)) flags.flex = true;
|
|
41791
41818
|
else if (OVERFLOW_ATTR_GROUP.has(name)) flags.overflow = true;
|
|
@@ -41905,7 +41932,9 @@ var AutolayoutCodegen = class {
|
|
|
41905
41932
|
}
|
|
41906
41933
|
this.collectSizeFlexProps(element, dimKey, raw, flexProps);
|
|
41907
41934
|
classNames.push(...this.registerSizeClass(element, dimKey, raw));
|
|
41908
|
-
|
|
41935
|
+
if (raw !== "fill") {
|
|
41936
|
+
element.removeAttribute(dimKey);
|
|
41937
|
+
}
|
|
41909
41938
|
}
|
|
41910
41939
|
for (const [prop, value] of Object.entries(flexProps)) {
|
|
41911
41940
|
classNames.push(this.registerClass(prop, value));
|
|
@@ -41951,10 +41980,10 @@ var AutolayoutCodegen = class {
|
|
|
41951
41980
|
}
|
|
41952
41981
|
// Converts dynamic ternary layout attrs to conditional class expressions
|
|
41953
41982
|
processDynamicTernaryProps(element, removeAttrs = true) {
|
|
41954
|
-
const
|
|
41983
|
+
const attrs2 = element.attributes || {};
|
|
41955
41984
|
const parsed = [];
|
|
41956
41985
|
for (const name of LAYOUT_ATTR_NAMES) {
|
|
41957
|
-
const raw =
|
|
41986
|
+
const raw = attrs2[name];
|
|
41958
41987
|
if (raw == null || !isBind(raw)) continue;
|
|
41959
41988
|
if (FLEX_ATTR_GROUP.has(name)) continue;
|
|
41960
41989
|
const ternary = parseTernaryExpression(raw);
|
|
@@ -42371,8 +42400,10 @@ var _Transpiler = class _Transpiler {
|
|
|
42371
42400
|
this.transformers = /* @__PURE__ */ new Map();
|
|
42372
42401
|
this.componentNamesList = [];
|
|
42373
42402
|
this.transpile = (e, isPartOfPrefab, splitCode = true, oldContext) => {
|
|
42374
|
-
var _a;
|
|
42375
|
-
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-");
|
|
42376
42407
|
const ignoreElements = ["wm-filter-action", "wm-form-action"];
|
|
42377
42408
|
const transformer = this.transformers.get(e && e.tagName.toLowerCase());
|
|
42378
42409
|
let result = {
|
|
@@ -42382,9 +42413,13 @@ var _Transpiler = class _Transpiler {
|
|
|
42382
42413
|
imports: [],
|
|
42383
42414
|
partials: [],
|
|
42384
42415
|
prefabs: [],
|
|
42385
|
-
wmxcomponents: []
|
|
42416
|
+
wmxcomponents: [],
|
|
42417
|
+
webComponents: []
|
|
42386
42418
|
};
|
|
42387
|
-
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)) {
|
|
42388
42423
|
e.setAttribute(
|
|
42389
42424
|
"name",
|
|
42390
42425
|
`${e.tagName.toLowerCase().replace(/-/g, "_")}_${generateRandomString()}`
|
|
@@ -42396,12 +42431,14 @@ var _Transpiler = class _Transpiler {
|
|
|
42396
42431
|
if (isHtmlElement) {
|
|
42397
42432
|
result.markup = preTranspileHtmlElement(e);
|
|
42398
42433
|
e.childNodes.forEach((c) => {
|
|
42434
|
+
var _a2;
|
|
42399
42435
|
if (c && c.nodeType == NodeType2.ELEMENT_NODE) {
|
|
42400
42436
|
const cResult = this.transpile(c, isPartOfPrefab, splitCode);
|
|
42401
42437
|
(0, import_lodash5.assignIn)(result.components, cResult.components);
|
|
42402
42438
|
result.markup += cResult.markup;
|
|
42403
42439
|
result.imports.push(...cResult.imports);
|
|
42404
42440
|
result.prefabs.push(...cResult.prefabs);
|
|
42441
|
+
(_a2 = result.webComponents) == null ? void 0 : _a2.push(...cResult.webComponents || []);
|
|
42405
42442
|
result.partials.push(...cResult.partials);
|
|
42406
42443
|
result.components = { ...result.components, ...cResult.components };
|
|
42407
42444
|
if (cResult.pageEvents) result.pageEvents = cResult.pageEvents;
|
|
@@ -42413,18 +42450,20 @@ var _Transpiler = class _Transpiler {
|
|
|
42413
42450
|
}
|
|
42414
42451
|
});
|
|
42415
42452
|
result.markup += postTranspileHtmlElement(e);
|
|
42416
|
-
} else if (transformer != null) {
|
|
42453
|
+
} else if (transformer != null || isWebComponent) {
|
|
42454
|
+
const resolvedTransformer = transformer != null ? transformer : this.transformers.get("__web-component__");
|
|
42417
42455
|
const context = new TranspilationContext2({
|
|
42418
42456
|
result,
|
|
42419
42457
|
isPartOfPrefab,
|
|
42420
|
-
transformer,
|
|
42458
|
+
transformer: resolvedTransformer,
|
|
42421
42459
|
listener: oldContext == null ? void 0 : oldContext.listener,
|
|
42422
42460
|
props: (oldContext == null ? void 0 : oldContext.props) || [],
|
|
42423
42461
|
data: oldContext == null ? void 0 : oldContext.data
|
|
42424
42462
|
});
|
|
42425
|
-
result.imports.push(...
|
|
42426
|
-
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" : "");
|
|
42427
42465
|
e.childNodes.forEach((c) => {
|
|
42466
|
+
var _a2;
|
|
42428
42467
|
if (c && c.nodeType == NodeType2.ELEMENT_NODE) {
|
|
42429
42468
|
const cResult = this.transpile(c, isPartOfPrefab, splitCode, context);
|
|
42430
42469
|
(0, import_lodash5.assignIn)(result.components, cResult.components);
|
|
@@ -42432,6 +42471,7 @@ var _Transpiler = class _Transpiler {
|
|
|
42432
42471
|
result.imports.push(...cResult.imports);
|
|
42433
42472
|
result.prefabs.push(...cResult.prefabs);
|
|
42434
42473
|
result.wmxcomponents.push(...cResult.wmxcomponents);
|
|
42474
|
+
(_a2 = result.webComponents) == null ? void 0 : _a2.push(...cResult.webComponents || []);
|
|
42435
42475
|
result.partials.push(...cResult.partials);
|
|
42436
42476
|
result.components = { ...result.components, ...cResult.components };
|
|
42437
42477
|
if (cResult.pageEvents) result.pageEvents = cResult.pageEvents;
|
|
@@ -42442,10 +42482,10 @@ var _Transpiler = class _Transpiler {
|
|
|
42442
42482
|
}
|
|
42443
42483
|
}
|
|
42444
42484
|
});
|
|
42445
|
-
|
|
42446
|
-
|
|
42447
|
-
|
|
42448
|
-
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"), "");
|
|
42449
42489
|
const accessRole = e.attrs["accessroles"];
|
|
42450
42490
|
if (accessRole) {
|
|
42451
42491
|
result.markup = `{fragment.appConfig.SecurityService.hasAccessToWidget('${accessRole}') ? (${result.markup}): null}`;
|
|
@@ -42455,6 +42495,19 @@ var _Transpiler = class _Transpiler {
|
|
|
42455
42495
|
return result;
|
|
42456
42496
|
};
|
|
42457
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
|
+
}
|
|
42458
42511
|
/**
|
|
42459
42512
|
* Transforms $[...] syntax to fragment.property for use with Angular parser
|
|
42460
42513
|
* Examples:
|
|
@@ -42620,7 +42673,7 @@ var _Transpiler = class _Transpiler {
|
|
|
42620
42673
|
});
|
|
42621
42674
|
}
|
|
42622
42675
|
transformStyles(e, context) {
|
|
42623
|
-
var _a, _b;
|
|
42676
|
+
var _a, _b, _c;
|
|
42624
42677
|
let rawStylesObj = {};
|
|
42625
42678
|
const style_attr = e.getAttribute("style");
|
|
42626
42679
|
const rawStyles = e.getAttribute("styles") || style_attr;
|
|
@@ -42701,7 +42754,12 @@ var _Transpiler = class _Transpiler {
|
|
|
42701
42754
|
}
|
|
42702
42755
|
}
|
|
42703
42756
|
if (conditionalClasses) {
|
|
42757
|
+
const isInsideTableColumn = !!((_b = context == null ? void 0 : context.get) == null ? void 0 : _b.call(context, "isInsideTableColumn"));
|
|
42704
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);
|
|
42705
42763
|
if (conditionalClasses.startsWith("{") && conditionalClasses.endsWith("}")) {
|
|
42706
42764
|
conditionalClasses = conditionalClasses.slice(1, -1);
|
|
42707
42765
|
let expressions = conditionalClasses.split(",").map((expression) => {
|
|
@@ -42709,13 +42767,13 @@ var _Transpiler = class _Transpiler {
|
|
|
42709
42767
|
if (!condition) {
|
|
42710
42768
|
return `'${className.trim()}'`;
|
|
42711
42769
|
}
|
|
42712
|
-
return `(${
|
|
42770
|
+
return `(${transformCondition(condition.trim())} ? ${className.replace(/'$/, " '")} : '')`;
|
|
42713
42771
|
});
|
|
42714
42772
|
conditionalClasses = expressions.join("+");
|
|
42715
42773
|
} else if (!conditionalClasses.includes(":") && !conditionalClasses.includes("&&") && !conditionalClasses.includes("||") && !conditionalClasses.includes("$formField")) {
|
|
42716
|
-
conditionalClasses = `${conditionalClasses}`;
|
|
42774
|
+
conditionalClasses = isInsideTableColumn ? transformCondition(conditionalClasses) : `${conditionalClasses}`;
|
|
42717
42775
|
} else {
|
|
42718
|
-
conditionalClasses =
|
|
42776
|
+
conditionalClasses = transformCondition(conditionalClasses);
|
|
42719
42777
|
}
|
|
42720
42778
|
if (classes == null ? void 0 : classes.startsWith("{")) {
|
|
42721
42779
|
classes = classes.substring(0, classes.length - 1);
|
|
@@ -42727,7 +42785,7 @@ var _Transpiler = class _Transpiler {
|
|
|
42727
42785
|
}
|
|
42728
42786
|
} else if (classes.includes("{{") && classes.includes("}}")) {
|
|
42729
42787
|
const mustacheClass = transformClassWithMustacheExpressions(classes, {
|
|
42730
|
-
isInsideTableColumn: !!((
|
|
42788
|
+
isInsideTableColumn: !!((_c = context == null ? void 0 : context.get) == null ? void 0 : _c.call(context, "isInsideTableColumn"))
|
|
42731
42789
|
});
|
|
42732
42790
|
classes = mustacheClass != null ? mustacheClass : `'${classes}'`;
|
|
42733
42791
|
} else if (!!classes && !classes.startsWith("{")) {
|
|
@@ -43017,7 +43075,7 @@ var _Transpiler = class _Transpiler {
|
|
|
43017
43075
|
if (name === "conditionalclass") {
|
|
43018
43076
|
return "";
|
|
43019
43077
|
}
|
|
43020
|
-
} else if (name === "width" || name === "height") {
|
|
43078
|
+
} else if ((name === "width" || name === "height") && value != "fill") {
|
|
43021
43079
|
`${value.substring(5)}`;
|
|
43022
43080
|
value = `{${value}}`;
|
|
43023
43081
|
} else {
|
|
@@ -43153,6 +43211,7 @@ var transpileMarkup = (markup, isPartOfPrefab, splitCode, variables, preview, in
|
|
|
43153
43211
|
components: {},
|
|
43154
43212
|
partials: [],
|
|
43155
43213
|
wmxcomponents: [],
|
|
43214
|
+
webComponents: [],
|
|
43156
43215
|
prefabs: [],
|
|
43157
43216
|
imports: []
|
|
43158
43217
|
};
|
|
@@ -43183,6 +43242,7 @@ var transpileMarkup = (markup, isPartOfPrefab, splitCode, variables, preview, in
|
|
|
43183
43242
|
}
|
|
43184
43243
|
});
|
|
43185
43244
|
parsed.childNodes.forEach((node) => {
|
|
43245
|
+
var _a;
|
|
43186
43246
|
if (node.nodeType === NodeType2.TEXT_NODE) {
|
|
43187
43247
|
const textContent = node.text;
|
|
43188
43248
|
if (textContent.trim()) {
|
|
@@ -43197,6 +43257,7 @@ var transpileMarkup = (markup, isPartOfPrefab, splitCode, variables, preview, in
|
|
|
43197
43257
|
finalResult.partials.push(...result.partials);
|
|
43198
43258
|
finalResult.prefabs.push(...result.prefabs);
|
|
43199
43259
|
finalResult.wmxcomponents.push(...result.wmxcomponents);
|
|
43260
|
+
(_a = finalResult.webComponents) == null ? void 0 : _a.push(...result.webComponents || []);
|
|
43200
43261
|
finalResult.imports.push(...result.imports);
|
|
43201
43262
|
if (result.pageEvents) finalResult.pageEvents = result.pageEvents;
|
|
43202
43263
|
}
|
|
@@ -43268,7 +43329,7 @@ var preTranspileHtmlElement = (e) => {
|
|
|
43268
43329
|
const styleObj = style_transformer_default(e, (propName) => {
|
|
43269
43330
|
return true;
|
|
43270
43331
|
}) || {};
|
|
43271
|
-
const
|
|
43332
|
+
const attrs2 = Object.keys(e.attributes).filter((attr) => attr !== "name").map((attr) => {
|
|
43272
43333
|
const value = e.getAttribute(attr);
|
|
43273
43334
|
if (!value) return `${attr}=""`;
|
|
43274
43335
|
if (attr === "class") {
|
|
@@ -43283,7 +43344,7 @@ var preTranspileHtmlElement = (e) => {
|
|
|
43283
43344
|
if (styleObj && Object.keys(styleObj).length > 0) {
|
|
43284
43345
|
styleAttr = ` style={${JSON.stringify(styleObj)}}`;
|
|
43285
43346
|
}
|
|
43286
|
-
const attrsStr =
|
|
43347
|
+
const attrsStr = attrs2 ? ` ${attrs2}` : "";
|
|
43287
43348
|
return `<${e.tagName.toLowerCase()}${attrsStr}${styleAttr}>`;
|
|
43288
43349
|
};
|
|
43289
43350
|
var convertStyleStringToObject = (styleString) => {
|
|
@@ -43356,6 +43417,13 @@ function createLayoutRegionTransformer(config) {
|
|
|
43356
43417
|
const content = element.getAttribute("content") || defaultContent;
|
|
43357
43418
|
const name = element.getAttribute("name") || defaultName;
|
|
43358
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
|
+
}
|
|
43359
43427
|
if (isPreview) {
|
|
43360
43428
|
return `<${tag} ${transformAttrs(element, context)}>
|
|
43361
43429
|
<WmPartialContainer content="${content}" isLayout={true} partialName="${name}" listener={fragment} />
|
|
@@ -43367,6 +43435,12 @@ function createLayoutRegionTransformer(config) {
|
|
|
43367
43435
|
},
|
|
43368
43436
|
post: () => `</${tag}>`,
|
|
43369
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
|
+
}
|
|
43370
43444
|
const isPreview = context.get("preview") === true;
|
|
43371
43445
|
if (isPreview) {
|
|
43372
43446
|
return [...componentImports, ...partialContainerImport];
|
|
@@ -43761,7 +43835,7 @@ function withPartialContainer(element, context, options) {
|
|
|
43761
43835
|
if (options.removeName) {
|
|
43762
43836
|
element.removeAttribute("name");
|
|
43763
43837
|
}
|
|
43764
|
-
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";
|
|
43765
43839
|
partial = `${options.prop}={(${params}) => (${partial})}`;
|
|
43766
43840
|
}
|
|
43767
43841
|
return { partialAttr: partial, extraImports };
|
|
@@ -43921,7 +43995,7 @@ var button_transformer_default = {
|
|
|
43921
43995
|
const enclosingFormName = getParentNode(element, "wm-form");
|
|
43922
43996
|
enclosingFormName && element.setAttribute("formName", enclosingFormName);
|
|
43923
43997
|
}
|
|
43924
|
-
const isInsideTableColumn = getParentNode(element, "wm-table-column");
|
|
43998
|
+
const isInsideTableColumn = getParentNode(element, "wm-table-column") || (context == null ? void 0 : context.get("isInsideTableColumn"));
|
|
43925
43999
|
const stopPropagation = (context == null ? void 0 : context.get("isInsideList")) || isInsideTableColumn ? " stopPropagation={true}" : "";
|
|
43926
44000
|
return `<WmButton listener={fragment} ${stopPropagation} ${transformAttrs(element, context)} ${context.isPartOfPrefab ? " prefabName={fragment.prefabName}" : ""} >`;
|
|
43927
44001
|
},
|
|
@@ -44172,7 +44246,7 @@ var buildItemAttrsFromListTemplate = (template, context) => {
|
|
|
44172
44246
|
};
|
|
44173
44247
|
var list_transformer_default = {
|
|
44174
44248
|
pre: (element, context) => {
|
|
44175
|
-
var _a, _b, _c, _d, _e
|
|
44249
|
+
var _a, _b, _c, _d, _e;
|
|
44176
44250
|
context.set("isInsideList", true);
|
|
44177
44251
|
const widgetName = element.attrs["name"];
|
|
44178
44252
|
const listContent = parse5(`<wm-list-content name="${widgetName + "Item"}"></wm-list-content>`).firstChild;
|
|
@@ -44208,9 +44282,9 @@ var list_transformer_default = {
|
|
|
44208
44282
|
transformRepeatChildAttr(template, "fragment.item", "$item");
|
|
44209
44283
|
transformRepeatChildAttr(template, "fragment.index", "$index");
|
|
44210
44284
|
transformRepeatChildAttr(template, "fragment.$index", "$index");
|
|
44211
|
-
transformRepeatChildAttr(template, "itemRef.$index", "index");
|
|
44212
|
-
transformRepeatChildAttr(template, "itemRef.$first", "first");
|
|
44213
|
-
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");
|
|
44214
44288
|
if (template && dataSet && dataSet.startsWith("bind:")) {
|
|
44215
44289
|
transformRepeatChildData(
|
|
44216
44290
|
template,
|
|
@@ -44262,21 +44336,17 @@ var list_transformer_default = {
|
|
|
44262
44336
|
widgetName
|
|
44263
44337
|
);
|
|
44264
44338
|
transformRepeatChildAttr(template, dataSet.substring(5), "$item");
|
|
44265
|
-
|
|
44266
|
-
if (isLoading) {
|
|
44267
|
-
element.setAttribute("loadingdata", `bind:${isLoading}`);
|
|
44268
|
-
}
|
|
44269
|
-
if ((_b = element.getAttribute("disableitem")) == null ? void 0 : _b.startsWith("bind:")) {
|
|
44339
|
+
if ((_a = element.getAttribute("disableitem")) == null ? void 0 : _a.startsWith("bind:")) {
|
|
44270
44340
|
const disabelItemExp = replaceAll(
|
|
44271
|
-
((
|
|
44341
|
+
((_b = element.getAttribute("disableitem")) == null ? void 0 : _b.substring(5)) || "",
|
|
44272
44342
|
dataSet.substring(5) + "[fragment.$i]",
|
|
44273
44343
|
"$item"
|
|
44274
44344
|
);
|
|
44275
44345
|
disableitem = `disableitem={($item, $index) => fragment.eval(() => ${disabelItemExp})}`;
|
|
44276
44346
|
element.removeAttribute("disableitem");
|
|
44277
44347
|
}
|
|
44278
|
-
if ((
|
|
44279
|
-
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)) || "";
|
|
44280
44350
|
itemKeyExp = replaceAll(itemKeyExp, dataSet.substring(5) + "[fragment.$i]", "$item");
|
|
44281
44351
|
itemKeyExp = replaceAll(itemKeyExp, dataSet.substring(5) + "[0]", "$item");
|
|
44282
44352
|
itemKey = `itemkey={($item, $index) => fragment.eval(() => ${itemKeyExp})}`;
|
|
@@ -44310,7 +44380,7 @@ var list_transformer_default = {
|
|
|
44310
44380
|
}
|
|
44311
44381
|
}
|
|
44312
44382
|
const templateNode = element.childNodes.find((c) => c instanceof HTMLElement);
|
|
44313
|
-
const itemAttrsStr = ((
|
|
44383
|
+
const itemAttrsStr = ((_e = templateNode == null ? void 0 : templateNode.tagName) == null ? void 0 : _e.toLowerCase()) === "wm-listtemplate" ? buildItemAttrsFromListTemplate(templateNode, context) : "";
|
|
44314
44384
|
addTemplateClass(element);
|
|
44315
44385
|
listContent.childNodes = element.childNodes;
|
|
44316
44386
|
element.childNodes = [listContent];
|
|
@@ -44549,6 +44619,7 @@ var getWidgetMarkup = (widgetType, widgetName, commonFields, element) => {
|
|
|
44549
44619
|
const timeconfirmationtitle = isDateTimeTag && element.getAttribute("timeconfirmationtitle") ? `timeconfirmationtitle="${(_f = element.getAttribute("timeconfirmationtitle")) == null ? void 0 : _f.replace(/"/g, """)}"` : "";
|
|
44550
44620
|
const timecanceltitle = isDateTimeTag && element.getAttribute("timecanceltitle") ? `timecanceltitle="${(_g = element.getAttribute("timecanceltitle")) == null ? void 0 : _g.replace(/"/g, """)}"` : "";
|
|
44551
44621
|
const outputformat = element.getAttribute("outputformat") ? `outputformat="${(_h = element.getAttribute("outputformat")) == null ? void 0 : _h.replace(/"/g, """)}"` : ``;
|
|
44622
|
+
const hyphenatedToComponentName = (str) => str.split("-").map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1)).join("") || "";
|
|
44552
44623
|
switch (widgetType) {
|
|
44553
44624
|
case "text":
|
|
44554
44625
|
case "password":
|
|
@@ -44733,6 +44804,13 @@ var getWidgetMarkup = (widgetType, widgetName, commonFields, element) => {
|
|
|
44733
44804
|
${floatinglabel}>
|
|
44734
44805
|
</wm-colorpicker>`;
|
|
44735
44806
|
break;
|
|
44807
|
+
default:
|
|
44808
|
+
if (widgetType.toLowerCase().includes("wmx")) {
|
|
44809
|
+
const fromAttr = widgetType == null ? void 0 : widgetType.split("-").at(-1);
|
|
44810
|
+
const componentName = hyphenatedToComponentName((fromAttr || "customwidget").trim()) || "Customwidget";
|
|
44811
|
+
tmpl = `<wmx-component componentname="${componentName}" ${commonFields} ${displayExp}></wmx-component>`;
|
|
44812
|
+
}
|
|
44813
|
+
break;
|
|
44736
44814
|
}
|
|
44737
44815
|
return tmpl;
|
|
44738
44816
|
};
|
|
@@ -44768,7 +44846,8 @@ var form_field_transformer_default = {
|
|
|
44768
44846
|
element.setAttribute("key", strippedKey);
|
|
44769
44847
|
}
|
|
44770
44848
|
}
|
|
44771
|
-
|
|
44849
|
+
const usesDatasetBindings = DATASET_WIDGETS.includes(widgetType) || widgetType.toLowerCase().includes("wmx");
|
|
44850
|
+
if (usesDatasetBindings) {
|
|
44772
44851
|
if (element.attrs["primary-key"]) {
|
|
44773
44852
|
element.setAttribute("primaryKey", element.attrs["primary-key"]);
|
|
44774
44853
|
}
|
|
@@ -44825,8 +44904,8 @@ var form_field_transformer_default = {
|
|
|
44825
44904
|
element.setAttribute("formName", formName);
|
|
44826
44905
|
}
|
|
44827
44906
|
(() => {
|
|
44828
|
-
const
|
|
44829
|
-
|
|
44907
|
+
const attrs2 = ["primary-key", "is-related"];
|
|
44908
|
+
attrs2.forEach((attr) => {
|
|
44830
44909
|
if (element.hasAttribute(attr)) {
|
|
44831
44910
|
element.removeAttribute(attr);
|
|
44832
44911
|
}
|
|
@@ -45019,7 +45098,8 @@ var getFormActionExpr = (action, isAsync = false) => {
|
|
|
45019
45098
|
const asyncKeyword = isAsync ? "async " : "";
|
|
45020
45099
|
const awaitKeyword = isAsync ? "await " : "";
|
|
45021
45100
|
const processedAction = isAsync && action.includes("?.submit();") ? action.replace(/(\S+\?\.submit\(\);)/g, `${awaitKeyword}$1`) : action;
|
|
45022
|
-
|
|
45101
|
+
const params = /\bwidget\b/.test(action) ? "($event, widget)" : "($event)";
|
|
45102
|
+
return `${asyncKeyword}${params} => {
|
|
45023
45103
|
${processedAction}
|
|
45024
45104
|
}`;
|
|
45025
45105
|
};
|
|
@@ -45059,11 +45139,11 @@ var form_action_transformer_default = {
|
|
|
45059
45139
|
const fragmentPrefix = "fragment?.Widgets";
|
|
45060
45140
|
const widgetsPrefix = "Widgets";
|
|
45061
45141
|
let btnClass = "btn-default";
|
|
45062
|
-
if (actionType === "submit") {
|
|
45142
|
+
if (actionType === "submit" || action === "submit()") {
|
|
45063
45143
|
btnClass = "btn-primary";
|
|
45064
45144
|
action = listName ? getWidgetAccessor(listPrefix, formName, "?.submit();", isDynamicFormName) + (action || "") : getWidgetAccessor(widgetsPrefix, formName, "?.submit();", isDynamicFormName) + (action || "");
|
|
45065
45145
|
}
|
|
45066
|
-
if (actionType === "reset") {
|
|
45146
|
+
if (actionType === "reset" || action === "reset()") {
|
|
45067
45147
|
action = listName ? getWidgetAccessor(listPrefix, formName, "?.formreset()", isDynamicFormName) + (action || "") : getWidgetAccessor(widgetsPrefix, formName, "?.formreset();", isDynamicFormName) + (action || "");
|
|
45068
45148
|
}
|
|
45069
45149
|
if (action) {
|
|
@@ -45140,22 +45220,27 @@ var imports36 = [
|
|
|
45140
45220
|
var dialog_transformer_default = {
|
|
45141
45221
|
pre: (element, context) => {
|
|
45142
45222
|
element.getAttribute("name");
|
|
45143
|
-
const
|
|
45144
|
-
"wm-dialogbody"
|
|
45145
|
-
{},
|
|
45146
|
-
null,
|
|
45147
|
-
element,
|
|
45148
|
-
[0, 41]
|
|
45223
|
+
const hasExplicitBody = element.childNodes.some(
|
|
45224
|
+
(e) => isHTMLElement(e) && ["wm-dialogcontent", "wm-dialogbody"].includes(e.tagName.toLowerCase())
|
|
45149
45225
|
);
|
|
45150
|
-
|
|
45151
|
-
|
|
45152
|
-
|
|
45153
|
-
|
|
45154
|
-
|
|
45155
|
-
|
|
45156
|
-
|
|
45157
|
-
|
|
45158
|
-
|
|
45226
|
+
if (!hasExplicitBody) {
|
|
45227
|
+
const content = new HTMLElement(
|
|
45228
|
+
"wm-dialogbody",
|
|
45229
|
+
{},
|
|
45230
|
+
null,
|
|
45231
|
+
element,
|
|
45232
|
+
[0, 41]
|
|
45233
|
+
);
|
|
45234
|
+
content.nodeType = NodeType.ELEMENT_NODE;
|
|
45235
|
+
const actionsIndex = element.childNodes.findIndex(
|
|
45236
|
+
(e) => isHTMLElement(e) && e.tagName.toLowerCase() === "wm-dialogactions"
|
|
45237
|
+
);
|
|
45238
|
+
content.childNodes = element.childNodes;
|
|
45239
|
+
element.childNodes = [content];
|
|
45240
|
+
if (actionsIndex >= 0) {
|
|
45241
|
+
const actions = content.childNodes.splice(actionsIndex, 1);
|
|
45242
|
+
actions && element.childNodes.push(actions[0]);
|
|
45243
|
+
}
|
|
45159
45244
|
}
|
|
45160
45245
|
return `<WmDialog listener={fragment} ${transformAttrs(element, context)}>`;
|
|
45161
45246
|
},
|
|
@@ -46385,7 +46470,7 @@ function getNearestWizardType(element) {
|
|
|
46385
46470
|
while (current) {
|
|
46386
46471
|
current = current.parentNode;
|
|
46387
46472
|
if (!current) break;
|
|
46388
|
-
if (((_a = current.tagName) == null ? void 0 : _a.toLowerCase()) === "wm-wizard") {
|
|
46473
|
+
if (((_a = current == null ? void 0 : current.tagName) == null ? void 0 : _a.toLowerCase()) === "wm-wizard") {
|
|
46389
46474
|
const type = current.getAttribute("type");
|
|
46390
46475
|
if (type) {
|
|
46391
46476
|
return type;
|
|
@@ -46430,7 +46515,7 @@ var imports87 = [
|
|
|
46430
46515
|
function getNearestWizardName(element) {
|
|
46431
46516
|
var _a;
|
|
46432
46517
|
let current = element.parentNode || null;
|
|
46433
|
-
if (((_a = current.tagName) == null ? void 0 : _a.toLowerCase()) === "wm-wizard") {
|
|
46518
|
+
if (((_a = current == null ? void 0 : current.tagName) == null ? void 0 : _a.toLowerCase()) === "wm-wizard") {
|
|
46434
46519
|
const n = current.getAttribute("name");
|
|
46435
46520
|
if (n) {
|
|
46436
46521
|
return n;
|
|
@@ -47275,6 +47360,14 @@ var getWidgetMarkup2 = (widgetType, widgetName, commonFields, element) => {
|
|
|
47275
47360
|
${floatinglabel}>
|
|
47276
47361
|
</wm-colorpicker>`;
|
|
47277
47362
|
break;
|
|
47363
|
+
default:
|
|
47364
|
+
if (widgetType.toLowerCase().includes("wmx")) {
|
|
47365
|
+
const fromAttr = widgetType == null ? void 0 : widgetType.split("-").at(-1);
|
|
47366
|
+
const hyphenatedToComponentName = (str) => str.split("-").map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1)).join("") || "";
|
|
47367
|
+
const componentName = hyphenatedToComponentName((fromAttr || "customwidget").trim()) || "Customwidget";
|
|
47368
|
+
tmpl = `<wmx-component componentname="${componentName}" ${commonFields} ${displayExp}></wmx-component>`;
|
|
47369
|
+
}
|
|
47370
|
+
break;
|
|
47278
47371
|
}
|
|
47279
47372
|
return tmpl;
|
|
47280
47373
|
};
|
|
@@ -47295,7 +47388,7 @@ var live_filter_field_transformer_default = {
|
|
|
47295
47388
|
} else {
|
|
47296
47389
|
filterName = currentNode.getAttribute("name");
|
|
47297
47390
|
}
|
|
47298
|
-
if (DATASET_WIDGETS.includes(widgetType)) {
|
|
47391
|
+
if (DATASET_WIDGETS.includes(widgetType) || widgetType.toLowerCase().includes("wmx")) {
|
|
47299
47392
|
if (element.attrs["primary-key"]) {
|
|
47300
47393
|
element.setAttribute("primaryKey", element.attrs["primary-key"]);
|
|
47301
47394
|
}
|
|
@@ -47415,34 +47508,57 @@ var linear_layout_item_default = {
|
|
|
47415
47508
|
};
|
|
47416
47509
|
|
|
47417
47510
|
// src/transpile/components/wmx-component/wmx-component.transformer.ts
|
|
47418
|
-
var capitalize4 = (str) => {
|
|
47419
|
-
return str ? str.split("-").map((s) => s.charAt(0).toUpperCase() + s.substring(1)).join("") : str;
|
|
47420
|
-
};
|
|
47421
47511
|
var wmx_component_transformer_default = {
|
|
47422
47512
|
pre: (element, context) => {
|
|
47423
|
-
const
|
|
47424
|
-
|
|
47425
|
-
|
|
47426
|
-
|
|
47427
|
-
|
|
47428
|
-
return `</Wmx${componentName}>`;
|
|
47429
|
-
},
|
|
47430
|
-
imports: (element, context) => {
|
|
47431
|
-
const componentName = capitalize4(element.getAttribute("componentname"));
|
|
47432
|
-
return [
|
|
47433
|
-
{
|
|
47434
|
-
name: `{Wmx${componentName}}`,
|
|
47435
|
-
from: `@wavemaker-ai/wmx-components`
|
|
47436
|
-
}
|
|
47437
|
-
];
|
|
47513
|
+
const isFormField = element.getAttribute("formfield") === "true";
|
|
47514
|
+
if (isFormField) {
|
|
47515
|
+
element.removeAttribute("formfield");
|
|
47516
|
+
}
|
|
47517
|
+
return `<WmxRenderer listener={fragment} ${transformAttrs(element, context, inferTypeAndParseProperty)} ${isFormField ? " {...$formField}" : ""}/>`;
|
|
47438
47518
|
},
|
|
47519
|
+
post: () => "",
|
|
47520
|
+
imports: () => [
|
|
47521
|
+
{
|
|
47522
|
+
name: `WmxRenderer`,
|
|
47523
|
+
from: `@wavemaker-ai/react-runtime/components/wmx/WmxRenderer`
|
|
47524
|
+
}
|
|
47525
|
+
],
|
|
47439
47526
|
wmxcomponents: (element, context) => [
|
|
47440
47527
|
element.getAttribute("componentname")
|
|
47441
47528
|
]
|
|
47442
47529
|
};
|
|
47443
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
|
+
|
|
47444
47559
|
// src/transpile/components/transform-register.ts
|
|
47445
47560
|
var transform_register_default = () => {
|
|
47561
|
+
registerTransformer("__web-component__", web_component_transformer_default);
|
|
47446
47562
|
registerTransformer("wm-page", page_transformer_default);
|
|
47447
47563
|
registerTransformer("wm-page-content", page_content_transformer_default);
|
|
47448
47564
|
registerTransformer("wm-content", content_transformer_default);
|
|
@@ -47523,6 +47639,7 @@ var transform_register_default = () => {
|
|
|
47523
47639
|
registerTransformer("wm-dialog", dialog_transformer_default);
|
|
47524
47640
|
registerTransformer("wm-dialogactions", dialog_actions_transformer_default);
|
|
47525
47641
|
registerTransformer("wm-dialogbody", dialog_body_transformer_default);
|
|
47642
|
+
registerTransformer("wm-dialogcontent", dialog_body_transformer_default);
|
|
47526
47643
|
registerTransformer("wm-logindialog", login_dialog_transformer_default);
|
|
47527
47644
|
registerTransformer("wm-list", list_transformer_default);
|
|
47528
47645
|
registerTransformer("wm-listtemplate", list_template_transformer_default);
|