@wavemaker-ai/react-codegen 1.0.0-rc.330 → 1.0.0-rc.334

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.
Files changed (55) hide show
  1. package/build-react-web.js +14 -0
  2. package/build-react-web.js.map +1 -1
  3. package/dist/transpiler/index.d.mts +5 -0
  4. package/dist/transpiler/index.mjs +478 -249
  5. package/dist/transpiler/index.mjs.map +1 -1
  6. package/dist/transpiler/wm-styles.css +3 -24
  7. package/package-lock.json +108 -91
  8. package/package.json +1 -1
  9. package/src/app.generator.js +44 -15
  10. package/src/app.generator.js.map +1 -1
  11. package/src/externalize-next-scripts.js +166 -0
  12. package/src/externalize-next-scripts.js.map +1 -0
  13. package/src/gen-app-override-css.js +4 -13
  14. package/src/gen-app-override-css.js.map +1 -1
  15. package/src/transpile/bind.ex.transformer.js +4 -1
  16. package/src/transpile/bind.ex.transformer.js.map +1 -1
  17. package/src/transpile/components/container/accordion.transformer.js +4 -4
  18. package/src/transpile/components/container/accordion.transformer.js.map +1 -1
  19. package/src/transpile/components/container/tabs.transformer.js +2 -2
  20. package/src/transpile/components/container/tabs.transformer.js.map +1 -1
  21. package/src/transpile/components/data/form/form-action.transformer.js +4 -3
  22. package/src/transpile/components/data/form/form-action.transformer.js.map +1 -1
  23. package/src/transpile/components/data/list/list-transformer.js +16 -20
  24. package/src/transpile/components/data/list/list-transformer.js.map +1 -1
  25. package/src/transpile/components/data/table/table.transformer.js +14 -20
  26. package/src/transpile/components/data/table/table.transformer.js.map +1 -1
  27. package/src/transpile/components/data/table/utils.js +90 -0
  28. package/src/transpile/components/data/table/utils.js.map +1 -1
  29. package/src/transpile/components/dialogs/dialog-actions.transformer.js +4 -6
  30. package/src/transpile/components/dialogs/dialog-actions.transformer.js.map +1 -1
  31. package/src/transpile/components/form/button.transformer.js +1 -1
  32. package/src/transpile/components/form/button.transformer.js.map +1 -1
  33. package/src/transpile/components/layout/layout-region-factory.js +16 -0
  34. package/src/transpile/components/layout/layout-region-factory.js.map +1 -1
  35. package/src/transpile/components/nav/nav.transformer.js +3 -5
  36. package/src/transpile/components/nav/nav.transformer.js.map +1 -1
  37. package/src/transpile/components/page/with-partial-container.js +2 -2
  38. package/src/transpile/components/page/with-partial-container.js.map +1 -1
  39. package/src/transpile/components/transform-register.js +3 -0
  40. package/src/transpile/components/transform-register.js.map +1 -1
  41. package/src/transpile/components/utils.js +11 -5
  42. package/src/transpile/components/utils.js.map +1 -1
  43. package/src/transpile/components/web-component/web-component.transformer.js +26 -0
  44. package/src/transpile/components/web-component/web-component.transformer.js.map +1 -0
  45. package/src/transpile/transpile.js +119 -35
  46. package/src/transpile/transpile.js.map +1 -1
  47. package/src/utils.browser.js +80 -17
  48. package/src/utils.browser.js.map +1 -1
  49. package/src/utils.js +3 -123
  50. package/src/utils.js.map +1 -1
  51. package/templates/component/web-component.tsx +61 -0
  52. package/templates/project/app/components.css +3 -0
  53. package/templates/project/app/widgetInlineStylesOverride.css +0 -20
  54. package/templates/project/app/wm-globals.css +0 -4
  55. package/templates/project/package.json +4 -4
@@ -8133,14 +8133,14 @@ var require_lib = __commonJS({
8133
8133
  super.checkParams(node, false, true);
8134
8134
  this.scope.exit();
8135
8135
  }
8136
- forwardNoArrowParamsConversionAt(node, parse7) {
8136
+ forwardNoArrowParamsConversionAt(node, parse8) {
8137
8137
  let result;
8138
8138
  if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
8139
8139
  this.state.noArrowParamsConversionAt.push(this.state.start);
8140
- result = parse7();
8140
+ result = parse8();
8141
8141
  this.state.noArrowParamsConversionAt.pop();
8142
8142
  } else {
8143
- result = parse7();
8143
+ result = parse8();
8144
8144
  }
8145
8145
  return result;
8146
8146
  }
@@ -16622,7 +16622,7 @@ var require_lib = __commonJS({
16622
16622
  node.specifiers.push(this.finishNode(specifier, type));
16623
16623
  }
16624
16624
  parseAssertEntries() {
16625
- const attrs = [];
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
- attrs.push(node);
16651
+ attrs2.push(node);
16652
16652
  } while (this.eat(types.comma));
16653
- return attrs;
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 attrs = [];
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
- attrs.push(node);
16681
+ attrs2.push(node);
16682
16682
  } while (this.eat(types.comma));
16683
- return attrs;
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 attrs = this.parseAssertEntries();
16694
+ const attrs2 = this.parseAssertEntries();
16695
16695
  this.eat(types.braceR);
16696
- return attrs;
16696
+ return attrs2;
16697
16697
  }
16698
16698
  maybeParseDefaultImportSpecifier(node) {
16699
16699
  if (this.shouldParseDefaultImport(node)) {
@@ -16778,7 +16778,7 @@ var require_lib = __commonJS({
16778
16778
  }
16779
16779
  return pluginMap;
16780
16780
  }
16781
- function parse6(input, options) {
16781
+ function parse7(input, options) {
16782
16782
  var _options;
16783
16783
  if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") {
16784
16784
  options = Object.assign({}, options);
@@ -16840,7 +16840,7 @@ var require_lib = __commonJS({
16840
16840
  }
16841
16841
  return cls;
16842
16842
  }
16843
- exports$1.parse = parse6;
16843
+ exports$1.parse = parse7;
16844
16844
  exports$1.parseExpression = parseExpression2;
16845
16845
  exports$1.tokTypes = types;
16846
16846
  }
@@ -19892,7 +19892,7 @@ var require_parse = __commonJS({
19892
19892
  var whitespace = /* @__PURE__ */ new Set([9, 10, 12, 13, 32]);
19893
19893
  var ZERO = "0".charCodeAt(0);
19894
19894
  var NINE = "9".charCodeAt(0);
19895
- function parse6(formula) {
19895
+ function parse7(formula) {
19896
19896
  formula = formula.trim().toLowerCase();
19897
19897
  if (formula === "even") {
19898
19898
  return [2, 0];
@@ -19944,7 +19944,7 @@ var require_parse = __commonJS({
19944
19944
  }
19945
19945
  }
19946
19946
  }
19947
- exports$1.parse = parse6;
19947
+ exports$1.parse = parse7;
19948
19948
  }
19949
19949
  });
19950
19950
 
@@ -21232,11 +21232,11 @@ var require_html = __commonJS({
21232
21232
  return DOMTokenList2;
21233
21233
  })()
21234
21234
  );
21235
- var HTMLElement3 = (
21235
+ var HTMLElement4 = (
21236
21236
  /** @class */
21237
21237
  (function(_super) {
21238
- __extends(HTMLElement4, _super);
21239
- function HTMLElement4(tagName, keyAttrs, rawAttrs, parentNode, range) {
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
- HTMLElement4.prototype.quoteAttribute = function(attr) {
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
- HTMLElement4.prototype.remove = function() {
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
- HTMLElement4.prototype.removeChild = function(node) {
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
- HTMLElement4.prototype.exchangeChild = function(oldNode, newNode) {
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(HTMLElement4.prototype, "tagName", {
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(HTMLElement4.prototype, "localName", {
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(HTMLElement4.prototype, "isVoidElement", {
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(HTMLElement4.prototype, "rawText", {
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(HTMLElement4.prototype, "textContent", {
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(HTMLElement4.prototype, "text", {
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(HTMLElement4.prototype, "structuredText", {
21359
+ Object.defineProperty(HTMLElement5.prototype, "structuredText", {
21360
21360
  /**
21361
21361
  * Get structured Text (with '\n' etc.)
21362
21362
  * @return {string} structured text
@@ -21398,40 +21398,40 @@ var require_html = __commonJS({
21398
21398
  enumerable: false,
21399
21399
  configurable: true
21400
21400
  });
21401
- HTMLElement4.prototype.toString = function() {
21401
+ HTMLElement5.prototype.toString = function() {
21402
21402
  var tag = this.rawTagName;
21403
21403
  if (tag) {
21404
- var attrs = this.rawAttrs ? " " + this.rawAttrs : "";
21405
- return this.isVoidElement ? "<" + tag + attrs + ">" : "<" + tag + attrs + ">" + this.innerHTML + "</" + 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(HTMLElement4.prototype, "innerHTML", {
21409
+ Object.defineProperty(HTMLElement5.prototype, "innerHTML", {
21410
21410
  get: function() {
21411
21411
  return this.childNodes.map(function(child) {
21412
21412
  return child.toString();
21413
21413
  }).join("");
21414
21414
  },
21415
21415
  set: function(content) {
21416
- var r = parse6(content);
21416
+ var r = parse7(content);
21417
21417
  this.childNodes = r.childNodes.length ? r.childNodes : [new text_1.default(content, this)];
21418
21418
  },
21419
21419
  enumerable: false,
21420
21420
  configurable: true
21421
21421
  });
21422
- HTMLElement4.prototype.set_content = function(content, options) {
21422
+ HTMLElement5.prototype.set_content = function(content, options) {
21423
21423
  if (options === void 0) {
21424
21424
  options = {};
21425
21425
  }
21426
21426
  if (content instanceof node_1.default) {
21427
21427
  content = [content];
21428
21428
  } else if (typeof content == "string") {
21429
- var r = parse6(content, options);
21429
+ var r = parse7(content, options);
21430
21430
  content = r.childNodes.length ? r.childNodes : [new text_1.default(content, this)];
21431
21431
  }
21432
21432
  this.childNodes = content;
21433
21433
  };
21434
- HTMLElement4.prototype.replaceWith = function() {
21434
+ HTMLElement5.prototype.replaceWith = function() {
21435
21435
  var _this = this;
21436
21436
  var nodes = [];
21437
21437
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -21441,7 +21441,7 @@ var require_html = __commonJS({
21441
21441
  if (node instanceof node_1.default) {
21442
21442
  return [node];
21443
21443
  } else if (typeof node == "string") {
21444
- var r = parse6(node);
21444
+ var r = parse7(node);
21445
21445
  return r.childNodes.length ? r.childNodes : [new text_1.default(node, _this)];
21446
21446
  }
21447
21447
  return [];
@@ -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(HTMLElement4.prototype, "outerHTML", {
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
- HTMLElement4.prototype.trimRight = function(pattern) {
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(HTMLElement4.prototype, "structure", {
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
- HTMLElement4.prototype.removeWhitespace = function() {
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
- HTMLElement4.prototype.querySelectorAll = function(selector) {
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
- HTMLElement4.prototype.querySelector = function(selector) {
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
- HTMLElement4.prototype.getElementsByTagName = function(tagName) {
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
- HTMLElement4.prototype.closest = function(selector) {
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
- HTMLElement4.prototype.appendChild = function(node) {
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(HTMLElement4.prototype, "firstChild", {
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(HTMLElement4.prototype, "lastChild", {
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(HTMLElement4.prototype, "attrs", {
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 attrs = this.rawAttributes;
21649
- for (var key in attrs) {
21650
- var val = attrs[key] || "";
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(HTMLElement4.prototype, "attributes", {
21658
+ Object.defineProperty(HTMLElement5.prototype, "attributes", {
21659
21659
  get: function() {
21660
21660
  var ret_attrs = {};
21661
- var attrs = this.rawAttributes;
21662
- for (var key in attrs) {
21663
- var val = attrs[key] || "";
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(HTMLElement4.prototype, "rawAttributes", {
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 attrs = {};
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
- attrs[key] = val;
21689
+ attrs2[key] = val;
21690
21690
  }
21691
21691
  }
21692
- this._rawAttrs = attrs;
21693
- return attrs;
21692
+ this._rawAttrs = attrs2;
21693
+ return attrs2;
21694
21694
  },
21695
21695
  enumerable: false,
21696
21696
  configurable: true
21697
21697
  });
21698
- HTMLElement4.prototype.removeAttribute = function(key) {
21699
- var attrs = this.rawAttributes;
21700
- delete attrs[key];
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(attrs).map(function(name) {
21705
- var val = JSON.stringify(attrs[name]);
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
- HTMLElement4.prototype.hasAttribute = function(key) {
21715
+ HTMLElement5.prototype.hasAttribute = function(key) {
21716
21716
  return key.toLowerCase() in this.attrs;
21717
21717
  };
21718
- HTMLElement4.prototype.getAttribute = function(key) {
21718
+ HTMLElement5.prototype.getAttribute = function(key) {
21719
21719
  return this.attrs[key.toLowerCase()];
21720
21720
  };
21721
- HTMLElement4.prototype.setAttribute = function(key, value) {
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 attrs = this.rawAttributes;
21728
- for (var k in attrs) {
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
- attrs[key] = String(value);
21734
+ attrs2[key] = String(value);
21735
21735
  if (this._attrs) {
21736
- this._attrs[k2] = decode(attrs[key]);
21736
+ this._attrs[k2] = decode(attrs2[key]);
21737
21737
  }
21738
- this.rawAttrs = Object.keys(attrs).map(function(name) {
21739
- var val = _this.quoteAttribute(attrs[name]);
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
- HTMLElement4.prototype.setAttributes = function(attributes) {
21748
+ HTMLElement5.prototype.setAttributes = function(attributes) {
21749
21749
  var _this = this;
21750
21750
  if (this._attrs) {
21751
21751
  delete this._attrs;
@@ -21760,20 +21760,20 @@ var require_html = __commonJS({
21760
21760
  return name + "=" + _this.quoteAttribute(String(val));
21761
21761
  }).join(" ");
21762
21762
  };
21763
- HTMLElement4.prototype.insertAdjacentHTML = function(where, html) {
21763
+ HTMLElement5.prototype.insertAdjacentHTML = function(where, html) {
21764
21764
  var _a, _b, _c;
21765
21765
  var _this = this;
21766
21766
  if (arguments.length < 2) {
21767
21767
  throw new Error("2 arguments required");
21768
21768
  }
21769
- var p = parse6(html);
21769
+ var p = parse7(html);
21770
21770
  if (where === "afterend") {
21771
21771
  var idx = this.parentNode.childNodes.findIndex(function(child) {
21772
21772
  return child === _this;
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 HTMLElement4) {
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 HTMLElement4) {
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(HTMLElement4.prototype, "nextSibling", {
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(HTMLElement4.prototype, "nextElementSibling", {
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 HTMLElement4) {
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(HTMLElement4.prototype, "classNames", {
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 HTMLElement4;
21845
+ return HTMLElement5;
21846
21846
  })(node_1.default)
21847
21847
  );
21848
- exports$1.default = HTMLElement3;
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 HTMLElement3(null, {}, "", null, [0, data.length]);
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 attrs = {};
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
- attrs[key.toLowerCase()] = isQuoted ? val.slice(1, val.length - 1) : val;
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 HTMLElement3(tagName, attrs, attributes.slice(1), null, createRange(tagStartPos_1, tagEndPos_1))
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)) {
@@ -22056,7 +22056,7 @@ var require_html = __commonJS({
22056
22056
  return stack;
22057
22057
  }
22058
22058
  exports$1.base_parse = base_parse;
22059
- function parse6(data, options) {
22059
+ function parse7(data, options) {
22060
22060
  if (options === void 0) {
22061
22061
  options = { lowerCaseTagName: false, comment: false };
22062
22062
  }
@@ -22085,7 +22085,7 @@ var require_html = __commonJS({
22085
22085
  }
22086
22086
  return root;
22087
22087
  }
22088
- exports$1.parse = parse6;
22088
+ exports$1.parse = parse7;
22089
22089
  }
22090
22090
  });
22091
22091
 
@@ -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 attrs = "";
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
- attrs += ` ${attrName}${attrValue}`;
22775
+ attrs2 += ` ${attrName}${attrValue}`;
22776
22776
  }
22777
- return getHtmlTagDefinition(tagName).isVoid ? `<${tagName}${classAttr}${attrs}/>` : `<${tagName}${classAttr}${attrs}></${tagName}>`;
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 attrs = cssSelector.attrs;
22842
+ const attrs2 = cssSelector.attrs;
22843
22843
  const selectable = new SelectorContext(cssSelector, callbackCtxt, listContext);
22844
22844
  if (element) {
22845
- const isTerminal = attrs.length === 0 && classNames.length === 0;
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 = attrs.length === 0 && i === classNames.length - 1;
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 (attrs) {
22864
- for (let i = 0; i < attrs.length; i += 2) {
22865
- const isTerminal = i === attrs.length - 2;
22866
- const name = attrs[i];
22867
- const value = attrs[i + 1];
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 attrs = cssSelector.attrs;
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 (attrs) {
22929
- for (let i = 0; i < attrs.length; i += 2) {
22930
- const name = attrs[i];
22931
- const value = attrs[i + 1];
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, attrs, startName, closeName, children, isVoid, sourceSpan, startSourceSpan, endSourceSpan) {
24746
+ constructor(tag, attrs2, startName, closeName, children, isVoid, sourceSpan, startSourceSpan, endSourceSpan) {
24747
24747
  this.tag = tag;
24748
- this.attrs = 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, attrs, children, sourceSpan, startSourceSpan, endSourceSpan = null, i18n) {
29188
+ constructor(name, attrs2, children, sourceSpan, startSourceSpan, endSourceSpan = null, i18n) {
29189
29189
  super(sourceSpan, i18n);
29190
29190
  this.name = name;
29191
- this.attrs = 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 attrs = [];
32358
+ const attrs2 = [];
32359
32359
  while (this._peek.type === TokenType.ATTR_NAME) {
32360
- attrs.push(this._consumeAttr(this._advance()));
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, attrs, [], span, startSpan, void 0);
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(attrs) {
32489
- return attrs.some((attr) => attr.name === PRESERVE_WS_ATTR_NAME);
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(attrs) {
33241
+ populateInitialStylingAttrs(attrs2) {
33242
33242
  if (this._initialClassValues.length) {
33243
- attrs.push(literal(
33243
+ attrs2.push(literal(
33244
33244
  1
33245
33245
  /* Classes */
33246
33246
  ));
33247
33247
  for (let i = 0; i < this._initialClassValues.length; i++) {
33248
- attrs.push(literal(this._initialClassValues[i]));
33248
+ attrs2.push(literal(this._initialClassValues[i]));
33249
33249
  }
33250
33250
  }
33251
33251
  if (this._initialStyleValues.length) {
33252
- attrs.push(literal(
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
- attrs.push(literal(this._initialStyleValues[i]), literal(this._initialStyleValues[i + 1]));
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(attrs, definitionMap) {
33269
- if (this._directiveExpr && (attrs.length || this._hasInitialValues)) {
33270
- this.populateInitialStylingAttrs(attrs);
33271
- definitionMap.set("hostAttrs", literalArr(attrs));
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 attrs = element.attrs.map((attr) => this.visitAttribute(attr));
35561
- parsedElement = new Content(selector, attrs, element.sourceSpan, element.i18n);
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 attrs = this.extractAttributes(element.name, parsedProperties, i18nAttrsMeta);
35565
- parsedElement = new Template(element.name, attributes, attrs.bound, boundEvents, [
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 attrs = this.extractAttributes(element.name, parsedProperties, i18nAttrsMeta);
35570
- parsedElement = new Element(element.name, attributes, attrs.bound, boundEvents, children, references, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.i18n);
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 attrs = this.extractAttributes("ng-template", templateParsedProperties, i18nAttrsMeta);
35573
+ const attrs2 = this.extractAttributes("ng-template", templateParsedProperties, i18nAttrsMeta);
35574
35574
  const templateAttrs = [];
35575
- attrs.literal.forEach((attr) => templateAttrs.push(attr));
35576
- attrs.bound.forEach((attr) => templateAttrs.push(attr));
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, attrs, isVoid) {
36038
- const signature = this._hashTag(tag, attrs, isVoid);
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, attrs, isVoid) {
36073
+ _hashTag(tag, attrs2, isVoid) {
36074
36074
  const start = `<${tag}`;
36075
- const strAttrs = Object.keys(attrs).sort().map((name) => ` ${name}=${attrs[name]}`).join("");
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 attrs = {};
36121
+ const attrs2 = {};
36122
36122
  el.attrs.forEach((attr) => {
36123
- attrs[attr.name] = attr.value;
36123
+ attrs2[attr.name] = attr.value;
36124
36124
  });
36125
36125
  const isVoid = getHtmlTagDefinition(el.name).isVoid;
36126
- const startPhName = context.placeholderRegistry.getStartTagPlaceholderName(el.name, attrs, isVoid);
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, attrs, startPhName, closePhName, children, isVoid, el.sourceSpan, el.startSourceSpan, el.endSourceSpan);
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 attrs = [];
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
- attrs.push(attr);
36318
+ attrs2.push(attr);
36319
36319
  }
36320
36320
  }
36321
36321
  if (Object.keys(attrsMeta).length) {
36322
- for (const attr of attrs) {
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 = 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, attrs, sourceSpan) {
36848
+ i18nAttributesInstruction(nodeIndex, attrs2, sourceSpan) {
36849
36849
  let hasBindings = false;
36850
36850
  const i18nAttrArgs = [];
36851
36851
  const bindings = [];
36852
- attrs.forEach((attr) => {
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, attrs) {
37231
+ templatePropertyBindings(templateIndex, attrs2) {
37232
37232
  const propertyBindings = [];
37233
- attrs.forEach((input) => {
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(attrs) {
37483
- return attrs.length > 0 ? this.addToConsts(literalArr(attrs)) : TYPED_NULL_EXPR;
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) {
@@ -39285,6 +39285,35 @@ var transformAppLocale = (exp) => {
39285
39285
  const expression = exp.replace(appLocaleRegex, replacer);
39286
39286
  return expression;
39287
39287
  };
39288
+ var splitTopLevel = (expr, separator, limit = Infinity) => {
39289
+ const parts = [];
39290
+ let depth = 0;
39291
+ let inString = false;
39292
+ let stringChar = "";
39293
+ let start = 0;
39294
+ for (let i = 0; i < expr.length && parts.length < limit - 1; i++) {
39295
+ const ch = expr[i];
39296
+ if (inString) {
39297
+ if (ch === stringChar && expr[i - 1] !== "\\") {
39298
+ inString = false;
39299
+ }
39300
+ continue;
39301
+ }
39302
+ if (ch === '"' || ch === "'") {
39303
+ inString = true;
39304
+ stringChar = ch;
39305
+ } else if (ch === "(" || ch === "[" || ch === "{") {
39306
+ depth++;
39307
+ } else if (ch === ")" || ch === "]" || ch === "}") {
39308
+ depth--;
39309
+ } else if (ch === separator && depth === 0) {
39310
+ parts.push(expr.slice(start, i));
39311
+ start = i + 1;
39312
+ }
39313
+ }
39314
+ parts.push(expr.slice(start));
39315
+ return parts;
39316
+ };
39288
39317
  var convertHyphenatedPropsToBracketNotation = (expr) => {
39289
39318
  if (!expr || typeof expr !== "string") return expr;
39290
39319
  return expr.replace(/\.([a-zA-Z_$][a-zA-Z0-9_$]*-[a-zA-Z_$][a-zA-Z0-9_$\-]*)/g, (_, propName) => {
@@ -39714,7 +39743,7 @@ var transform = (expr, scopeName = "this", mode = "attr") => {
39714
39743
  expr = convertHyphenatedPropsToBracketNotation(expr);
39715
39744
  try {
39716
39745
  const parser = new Parser$1(new Lexer());
39717
- let expressions = expr.split(";"), transformedExpressions = [];
39746
+ let expressions = splitTopLevel(expr, ";"), transformedExpressions = [];
39718
39747
  const $iExp = new RegExp("\\[" + scopeName + "\\.\\$i\\]", "g");
39719
39748
  expressions.forEach((currentExp) => {
39720
39749
  const ast = parser.parseBinding(currentExp, "", 0);
@@ -40583,9 +40612,12 @@ var transformRepeatChildData = (element, dataSetEx, prefix = "repeat_item", list
40583
40612
  if (isList) {
40584
40613
  return;
40585
40614
  }
40586
- let value = element.attributes[name];
40587
- value = removeOptionChaining(value);
40588
- element.setAttribute(name, replaceAll(value, dataSetEx, "$item"));
40615
+ const value = element.attributes[name];
40616
+ const stripped = removeOptionChaining(value);
40617
+ const replaced = replaceAll(stripped, dataSetEx, "$item");
40618
+ if (replaced !== stripped) {
40619
+ element.setAttribute(name, replaced);
40620
+ }
40589
40621
  if (list) {
40590
40622
  let genrateRandomString2 = function() {
40591
40623
  return Math.random().toString(36).substring(2, 5);
@@ -40602,12 +40634,15 @@ var transformRepeatChildData = (element, dataSetEx, prefix = "repeat_item", list
40602
40634
  }
40603
40635
  });
40604
40636
  };
40605
- var transformRepeatChildAttr = (element, replace2, replaceWith) => {
40637
+ var transformRepeatChildAttr = (element, replace2, replaceWith, skipAttrNames) => {
40606
40638
  Object.keys(element.attributes).forEach((name) => {
40607
40639
  const isList = isListAndField(element);
40608
40640
  if (isList) {
40609
40641
  return;
40610
40642
  }
40643
+ if (skipAttrNames == null ? void 0 : skipAttrNames.includes(name)) {
40644
+ return;
40645
+ }
40611
40646
  const value = element.attributes[name];
40612
40647
  const regex = new RegExp(
40613
40648
  replace2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + "(?![a-zA-Z_$0-9])",
@@ -40621,7 +40656,7 @@ var transformRepeatChildAttr = (element, replace2, replaceWith) => {
40621
40656
  });
40622
40657
  element.childNodes.forEach((c) => {
40623
40658
  if (isHTMLElement(c)) {
40624
- transformRepeatChildAttr(c, replace2, replaceWith);
40659
+ transformRepeatChildAttr(c, replace2, replaceWith, skipAttrNames);
40625
40660
  }
40626
40661
  });
40627
40662
  };
@@ -41782,7 +41817,7 @@ function parseAttrValue(name, raw, props) {
41782
41817
  }
41783
41818
  }
41784
41819
  function getStaticLayoutPropsFromElement(element, dynamicGroups) {
41785
- const attrs = element.attributes || {};
41820
+ const attrs2 = element.attributes || {};
41786
41821
  const props = {};
41787
41822
  let hasAny = false;
41788
41823
  for (const name of LAYOUT_ATTR_NAMES) {
@@ -41791,7 +41826,7 @@ function getStaticLayoutPropsFromElement(element, dynamicGroups) {
41791
41826
  if (dynamicGroups.overflow && OVERFLOW_ATTR_GROUP.has(name)) continue;
41792
41827
  if (dynamicGroups.position && POSITION_ATTR_GROUP.has(name)) continue;
41793
41828
  }
41794
- const raw = attrs[name];
41829
+ const raw = attrs2[name];
41795
41830
  if (raw == null) continue;
41796
41831
  if (isBind(raw)) continue;
41797
41832
  hasAny = true;
@@ -41809,10 +41844,10 @@ function expandShorthand(value) {
41809
41844
  return [parts[0], parts[1], parts[2], parts[3]];
41810
41845
  }
41811
41846
  function detectDynamicGroups(element) {
41812
- const attrs = element.attributes || {};
41847
+ const attrs2 = element.attributes || {};
41813
41848
  const flags = { flex: false, overflow: false, position: false };
41814
41849
  for (const name of LAYOUT_ATTR_NAMES) {
41815
- const raw = attrs[name];
41850
+ const raw = attrs2[name];
41816
41851
  if (raw == null || !isBind(raw)) continue;
41817
41852
  if (FLEX_ATTR_GROUP.has(name)) flags.flex = true;
41818
41853
  else if (OVERFLOW_ATTR_GROUP.has(name)) flags.overflow = true;
@@ -41980,10 +42015,10 @@ var AutolayoutCodegen = class {
41980
42015
  }
41981
42016
  // Converts dynamic ternary layout attrs to conditional class expressions
41982
42017
  processDynamicTernaryProps(element, removeAttrs = true) {
41983
- const attrs = element.attributes || {};
42018
+ const attrs2 = element.attributes || {};
41984
42019
  const parsed = [];
41985
42020
  for (const name of LAYOUT_ATTR_NAMES) {
41986
- const raw = attrs[name];
42021
+ const raw = attrs2[name];
41987
42022
  if (raw == null || !isBind(raw)) continue;
41988
42023
  if (FLEX_ATTR_GROUP.has(name)) continue;
41989
42024
  const ternary = parseTernaryExpression(raw);
@@ -42245,6 +42280,73 @@ function getFormatCellExpression(element, context) {
42245
42280
  transformed = transformed.replace(/(\w+)\?\.\s*\(/g, "$1(");
42246
42281
  return transformed;
42247
42282
  }
42283
+ var VARIABLES_SCOPE_PREFIX = /^bind:fragment(?:\?\.|\.)((?:App(?:\?\.|\.)(?:activePage(?:\?\.|\.))?)?Variables)/;
42284
+ function findClosingBracket(value, start) {
42285
+ let depth = 0;
42286
+ let quote = null;
42287
+ for (let i = start; i < value.length; i++) {
42288
+ const ch = value[i];
42289
+ if (quote) {
42290
+ if (ch === "\\") i++;
42291
+ else if (ch === quote) quote = null;
42292
+ continue;
42293
+ }
42294
+ if (ch === "'" || ch === '"' || ch === "`") {
42295
+ quote = ch;
42296
+ } else if (ch === "[") {
42297
+ depth++;
42298
+ } else if (ch === "]") {
42299
+ depth--;
42300
+ if (depth === 0) return i;
42301
+ }
42302
+ }
42303
+ return -1;
42304
+ }
42305
+ function parseVariableDataSetBinding(value) {
42306
+ const prefix = VARIABLES_SCOPE_PREFIX.exec(value);
42307
+ if (!prefix) {
42308
+ return void 0;
42309
+ }
42310
+ const scopePath = prefix[1].replace(/\?\./g, ".");
42311
+ let index = prefix[0].length;
42312
+ let sawSeparator = false;
42313
+ if (value.startsWith("?.", index)) {
42314
+ index += 2;
42315
+ sawSeparator = true;
42316
+ } else if (value[index] === ".") {
42317
+ index += 1;
42318
+ sawSeparator = true;
42319
+ }
42320
+ let accessor;
42321
+ let variableName;
42322
+ if (value[index] === "[") {
42323
+ const close = findClosingBracket(value, index);
42324
+ if (close < 0) {
42325
+ return void 0;
42326
+ }
42327
+ const key = value.slice(index + 1, close).trim();
42328
+ accessor = `[${key}]`;
42329
+ const quote = key[0];
42330
+ const isQuotedLiteral = (quote === "'" || quote === '"') && key.length > 1 && key[key.length - 1] === quote;
42331
+ variableName = isQuotedLiteral ? key.slice(1, -1) : void 0;
42332
+ index = close + 1;
42333
+ } else {
42334
+ const identifier = /^[A-Za-z_$][A-Za-z0-9_$]*/.exec(value.slice(index));
42335
+ if (!identifier || !sawSeparator) {
42336
+ return void 0;
42337
+ }
42338
+ accessor = `.${identifier[0]}`;
42339
+ variableName = identifier[0];
42340
+ index += identifier[0].length;
42341
+ }
42342
+ if (!/^(?:\?\.|\.)dataSet(?![A-Za-z0-9_$])/.test(value.slice(index))) {
42343
+ return void 0;
42344
+ }
42345
+ const datasourceExpr = addOptionalChainingToPropertyPath(
42346
+ `fragment.${scopePath}${accessor}`.replace(/\?\./g, ".")
42347
+ );
42348
+ return { scopePath, datasourceExpr, variableName };
42349
+ }
42248
42350
 
42249
42351
  // src/transpile/class-expression.util.ts
42250
42352
  function transformClassWithMustacheExpressions(classes, options = {}) {
@@ -42327,7 +42429,14 @@ var EVENT_NAME_MAP = {
42327
42429
  "on-dragenter": "on-dragEnter",
42328
42430
  "on-dragleave": "on-dragLeave"
42329
42431
  };
42330
- var processTextContentForJSX = (textContent) => {
42432
+ var convertMustacheTextToJsx = (textContent, isInsideTableColumn) => {
42433
+ return textContent.replace(/\{\{([\s\S]*?)\}\}/g, (_match, rawExpr) => {
42434
+ const expr = rawExpr.trim();
42435
+ const transformed = isInsideTableColumn ? transformTableColumnClassExpression(expr) : modifyExpression(expr);
42436
+ return `{${transformed}}`;
42437
+ });
42438
+ };
42439
+ var processTextContentForJSX = (textContent, isInsideTableColumn = false) => {
42331
42440
  const trimmedContent = textContent.trim();
42332
42441
  if (!trimmedContent) {
42333
42442
  return "";
@@ -42335,6 +42444,9 @@ var processTextContentForJSX = (textContent) => {
42335
42444
  if (/^[<>&]+$/.test(trimmedContent)) {
42336
42445
  return trimmedContent.split("").map((char) => `{'${char}'}`).join("");
42337
42446
  }
42447
+ if (trimmedContent.includes("{{") && trimmedContent.includes("}}")) {
42448
+ return convertMustacheTextToJsx(textContent, isInsideTableColumn);
42449
+ }
42338
42450
  return textContent;
42339
42451
  };
42340
42452
  var parse5 = typeof esm_default === "function" ? esm_default : esm_default.parse;
@@ -42400,8 +42512,10 @@ var _Transpiler = class _Transpiler {
42400
42512
  this.transformers = /* @__PURE__ */ new Map();
42401
42513
  this.componentNamesList = [];
42402
42514
  this.transpile = (e, isPartOfPrefab, splitCode = true, oldContext) => {
42403
- var _a;
42404
- const isHtmlElement = htmlElements.includes(e.tagName.toLowerCase());
42515
+ var _a, _b, _c;
42516
+ const tagName = e.tagName.toLowerCase();
42517
+ const isHtmlElement = htmlElements.includes(tagName);
42518
+ const isWebComponent = tagName.includes("-") && !tagName.startsWith("wm-");
42405
42519
  const ignoreElements = ["wm-filter-action", "wm-form-action"];
42406
42520
  const transformer = this.transformers.get(e && e.tagName.toLowerCase());
42407
42521
  let result = {
@@ -42411,9 +42525,13 @@ var _Transpiler = class _Transpiler {
42411
42525
  imports: [],
42412
42526
  partials: [],
42413
42527
  prefabs: [],
42414
- wmxcomponents: []
42528
+ wmxcomponents: [],
42529
+ webComponents: []
42415
42530
  };
42416
- if (!e.getAttribute("name") && !ignoreElements.includes(e.tagName.toLowerCase()) && !((_a = oldContext == null ? void 0 : oldContext.data) == null ? void 0 : _a.isInsideTableColumn)) {
42531
+ if (isWebComponent) {
42532
+ (_a = result.webComponents) == null ? void 0 : _a.push(this.getWebComponentDefinition(e));
42533
+ }
42534
+ if (!e.getAttribute("name") && !isWebComponent && !ignoreElements.includes(e.tagName.toLowerCase()) && !((_b = oldContext == null ? void 0 : oldContext.data) == null ? void 0 : _b.isInsideTableColumn)) {
42417
42535
  e.setAttribute(
42418
42536
  "name",
42419
42537
  `${e.tagName.toLowerCase().replace(/-/g, "_")}_${generateRandomString()}`
@@ -42423,37 +42541,44 @@ var _Transpiler = class _Transpiler {
42423
42541
  this.componentNamesList = [];
42424
42542
  }
42425
42543
  if (isHtmlElement) {
42426
- result.markup = preTranspileHtmlElement(e);
42544
+ result.markup = preTranspileHtmlElement(e, !!((_c = oldContext == null ? void 0 : oldContext.data) == null ? void 0 : _c.isInsideTableColumn));
42427
42545
  e.childNodes.forEach((c) => {
42546
+ var _a2, _b2;
42428
42547
  if (c && c.nodeType == NodeType2.ELEMENT_NODE) {
42429
42548
  const cResult = this.transpile(c, isPartOfPrefab, splitCode);
42430
42549
  (0, import_lodash5.assignIn)(result.components, cResult.components);
42431
42550
  result.markup += cResult.markup;
42432
42551
  result.imports.push(...cResult.imports);
42433
42552
  result.prefabs.push(...cResult.prefabs);
42553
+ (_a2 = result.webComponents) == null ? void 0 : _a2.push(...cResult.webComponents || []);
42434
42554
  result.partials.push(...cResult.partials);
42435
42555
  result.components = { ...result.components, ...cResult.components };
42436
42556
  if (cResult.pageEvents) result.pageEvents = cResult.pageEvents;
42437
42557
  } else if (c && c.nodeType == NodeType2.TEXT_NODE) {
42438
- const processedContent = processTextContentForJSX(c.text);
42558
+ const processedContent = processTextContentForJSX(
42559
+ c.text,
42560
+ !!((_b2 = oldContext == null ? void 0 : oldContext.data) == null ? void 0 : _b2.isInsideTableColumn)
42561
+ );
42439
42562
  if (processedContent) {
42440
42563
  result.markup += processedContent;
42441
42564
  }
42442
42565
  }
42443
42566
  });
42444
42567
  result.markup += postTranspileHtmlElement(e);
42445
- } else if (transformer != null) {
42568
+ } else if (transformer != null || isWebComponent) {
42569
+ const resolvedTransformer = transformer != null ? transformer : this.transformers.get("__web-component__");
42446
42570
  const context = new TranspilationContext2({
42447
42571
  result,
42448
42572
  isPartOfPrefab,
42449
- transformer,
42573
+ transformer: resolvedTransformer,
42450
42574
  listener: oldContext == null ? void 0 : oldContext.listener,
42451
42575
  props: (oldContext == null ? void 0 : oldContext.props) || [],
42452
42576
  data: oldContext == null ? void 0 : oldContext.data
42453
42577
  });
42454
- result.imports.push(...transformer.imports(e, context));
42455
- result.markup += transformer.pre(e, context).replace(new RegExp(FORMAT_CONTEXT, "g"), "") + (e.childNodes.length > 0 ? "\n" : "");
42578
+ result.imports.push(...resolvedTransformer.imports(e, context));
42579
+ result.markup += resolvedTransformer.pre(e, context).replace(new RegExp(FORMAT_CONTEXT, "g"), "") + (e.childNodes.length > 0 ? "\n" : "");
42456
42580
  e.childNodes.forEach((c) => {
42581
+ var _a2, _b2;
42457
42582
  if (c && c.nodeType == NodeType2.ELEMENT_NODE) {
42458
42583
  const cResult = this.transpile(c, isPartOfPrefab, splitCode, context);
42459
42584
  (0, import_lodash5.assignIn)(result.components, cResult.components);
@@ -42461,20 +42586,24 @@ var _Transpiler = class _Transpiler {
42461
42586
  result.imports.push(...cResult.imports);
42462
42587
  result.prefabs.push(...cResult.prefabs);
42463
42588
  result.wmxcomponents.push(...cResult.wmxcomponents);
42589
+ (_a2 = result.webComponents) == null ? void 0 : _a2.push(...cResult.webComponents || []);
42464
42590
  result.partials.push(...cResult.partials);
42465
42591
  result.components = { ...result.components, ...cResult.components };
42466
42592
  if (cResult.pageEvents) result.pageEvents = cResult.pageEvents;
42467
42593
  } else if (c && c.nodeType == NodeType2.TEXT_NODE) {
42468
- const processedContent = processTextContentForJSX(c.text);
42594
+ const processedContent = processTextContentForJSX(
42595
+ c.text,
42596
+ !!((_b2 = context.data) == null ? void 0 : _b2.isInsideTableColumn)
42597
+ );
42469
42598
  if (processedContent) {
42470
42599
  result.markup += processedContent;
42471
42600
  }
42472
42601
  }
42473
42602
  });
42474
- transformer.partials && result.partials.push(...transformer.partials(e, context));
42475
- transformer.prefabs && result.prefabs.push(...transformer.prefabs(e, context));
42476
- transformer.wmxcomponents && result.wmxcomponents.push(...transformer.wmxcomponents(e, context));
42477
- result.markup += transformer.post(e, context).replace(new RegExp(FORMAT_CONTEXT, "g"), "");
42603
+ resolvedTransformer.partials && result.partials.push(...resolvedTransformer.partials(e, context));
42604
+ resolvedTransformer.prefabs && result.prefabs.push(...resolvedTransformer.prefabs(e, context));
42605
+ resolvedTransformer.wmxcomponents && result.wmxcomponents.push(...resolvedTransformer.wmxcomponents(e, context));
42606
+ result.markup += resolvedTransformer.post(e, context).replace(new RegExp(FORMAT_CONTEXT, "g"), "");
42478
42607
  const accessRole = e.attrs["accessroles"];
42479
42608
  if (accessRole) {
42480
42609
  result.markup = `{fragment.appConfig.SecurityService.hasAccessToWidget('${accessRole}') ? (${result.markup}): null}`;
@@ -42484,6 +42613,19 @@ var _Transpiler = class _Transpiler {
42484
42613
  return result;
42485
42614
  };
42486
42615
  }
42616
+ getWebComponentDefinition(element) {
42617
+ const attributes = {};
42618
+ Object.entries(element.attributes).forEach(([name, value]) => {
42619
+ if (name.startsWith("on-")) {
42620
+ attributes[`on${name.substring(3).replace(/-/g, "")}`] = "(event: CustomEvent) => void";
42621
+ } else if (value.startsWith("bind:")) {
42622
+ attributes[name.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase())] = "unknown";
42623
+ } else {
42624
+ attributes[name] = "string";
42625
+ }
42626
+ });
42627
+ return { tag: element.tagName.toLowerCase(), attributes };
42628
+ }
42487
42629
  /**
42488
42630
  * Transforms $[...] syntax to fragment.property for use with Angular parser
42489
42631
  * Examples:
@@ -42592,6 +42734,7 @@ var _Transpiler = class _Transpiler {
42592
42734
  let value = e.attributes[name];
42593
42735
  if (value.startsWith("bind:")) {
42594
42736
  value = value.substring(5).trim();
42737
+ value = decodeHTMLEntities(value);
42595
42738
  value = value.replace(/;+$/, "");
42596
42739
  const simpleSinglePattern = /^\$\[([^\]]+)\]$/;
42597
42740
  const match = value.match(simpleSinglePattern);
@@ -42649,7 +42792,7 @@ var _Transpiler = class _Transpiler {
42649
42792
  });
42650
42793
  }
42651
42794
  transformStyles(e, context) {
42652
- var _a, _b;
42795
+ var _a, _b, _c;
42653
42796
  let rawStylesObj = {};
42654
42797
  const style_attr = e.getAttribute("style");
42655
42798
  const rawStyles = e.getAttribute("styles") || style_attr;
@@ -42730,21 +42873,26 @@ var _Transpiler = class _Transpiler {
42730
42873
  }
42731
42874
  }
42732
42875
  if (conditionalClasses) {
42876
+ const isInsideTableColumn = !!((_b = context == null ? void 0 : context.get) == null ? void 0 : _b.call(context, "isInsideTableColumn"));
42733
42877
  conditionalClasses = conditionalClasses.startsWith("bind:") ? `${conditionalClasses.substring(5)}` : conditionalClasses;
42878
+ if (isInsideTableColumn) {
42879
+ conditionalClasses = conditionalClasses.replace("fragment.Page", "fragment");
42880
+ }
42881
+ const transformCondition = (exp) => isInsideTableColumn ? transformTableColumnClassExpression(exp) : addOptionalChaining(exp);
42734
42882
  if (conditionalClasses.startsWith("{") && conditionalClasses.endsWith("}")) {
42735
42883
  conditionalClasses = conditionalClasses.slice(1, -1);
42736
- let expressions = conditionalClasses.split(",").map((expression) => {
42737
- const [className, condition] = expression.split(":");
42738
- if (!condition) {
42884
+ let expressions = splitTopLevel(conditionalClasses, ",").map((expression) => {
42885
+ const [className, condition] = splitTopLevel(expression, ":", 2);
42886
+ if (condition === void 0) {
42739
42887
  return `'${className.trim()}'`;
42740
42888
  }
42741
- return `(${addOptionalChaining(condition.trim())} ? ${className.replace(/'$/, " '")} : '')`;
42889
+ return `(${transformCondition(condition.trim())} ? ${className.replace(/'$/, " '")} : '')`;
42742
42890
  });
42743
42891
  conditionalClasses = expressions.join("+");
42744
42892
  } else if (!conditionalClasses.includes(":") && !conditionalClasses.includes("&&") && !conditionalClasses.includes("||") && !conditionalClasses.includes("$formField")) {
42745
- conditionalClasses = `${conditionalClasses}`;
42893
+ conditionalClasses = isInsideTableColumn ? transformCondition(conditionalClasses) : `${conditionalClasses}`;
42746
42894
  } else {
42747
- conditionalClasses = addOptionalChaining(conditionalClasses);
42895
+ conditionalClasses = transformCondition(conditionalClasses);
42748
42896
  }
42749
42897
  if (classes == null ? void 0 : classes.startsWith("{")) {
42750
42898
  classes = classes.substring(0, classes.length - 1);
@@ -42756,7 +42904,7 @@ var _Transpiler = class _Transpiler {
42756
42904
  }
42757
42905
  } else if (classes.includes("{{") && classes.includes("}}")) {
42758
42906
  const mustacheClass = transformClassWithMustacheExpressions(classes, {
42759
- isInsideTableColumn: !!((_b = context == null ? void 0 : context.get) == null ? void 0 : _b.call(context, "isInsideTableColumn"))
42907
+ isInsideTableColumn: !!((_c = context == null ? void 0 : context.get) == null ? void 0 : _c.call(context, "isInsideTableColumn"))
42760
42908
  });
42761
42909
  classes = mustacheClass != null ? mustacheClass : `'${classes}'`;
42762
42910
  } else if (!!classes && !classes.startsWith("{")) {
@@ -42995,21 +43143,25 @@ var _Transpiler = class _Transpiler {
42995
43143
  return attrName.endsWith("url") || attrName.endsWith("src");
42996
43144
  }
42997
43145
  transformAttr(tagName, name, value, context, tx) {
42998
- var _a, _b, _c;
43146
+ var _a, _b, _c, _d;
42999
43147
  if (name === "styles" || name === "style" || name === "className") ; else if (name === "groupby" && value.includes("(")) {
43000
43148
  value = `${this.findArgs(value, context)} => ${value}`;
43001
43149
  value = `{${value}}`;
43002
43150
  } else if (name.startsWith("on-")) {
43003
43151
  name = "on" + name.charAt(3).toUpperCase() + name.substr(4);
43004
- value = value.replace(/item,/g, "$item,");
43005
- value = value.replace(/item\./g, "$item.");
43006
- value = value.replace(/item\)/g, "$item)");
43007
- if ((_a = context == null ? void 0 : context.get) == null ? void 0 : _a.call(context, "isInsideList")) {
43152
+ const standaloneDollarItem = /(?<=[(,]\s*)\$item(?=\s*[,)])/;
43153
+ const standaloneBareItem = /(?<=[(,]\s*)item(?=\s*[,)])/;
43154
+ if (((_a = context == null ? void 0 : context.get) == null ? void 0 : _a.call(context, "isInsideList")) && standaloneDollarItem.test(value) && standaloneBareItem.test(value)) {
43155
+ value = value.replace(new RegExp(standaloneDollarItem, "g"), "$eventItem");
43156
+ }
43157
+ value = value.replace(/(?<!\$)\bitem\b(?=[,)])/g, "$item");
43158
+ value = value.replace(/(?<!\$)\bitem\b\./g, "$item.");
43159
+ if ((_b = context == null ? void 0 : context.get) == null ? void 0 : _b.call(context, "isInsideList")) {
43008
43160
  value = value.replace(/;+\s*$/, "").trim();
43009
43161
  value = addFragmentOptionalChaining(value, false);
43010
43162
  }
43011
43163
  const args = this.findArgs(value, context);
43012
- if ((_b = context == null ? void 0 : context.get) == null ? void 0 : _b.call(context, "isInsideTableColumn")) {
43164
+ if ((_c = context == null ? void 0 : context.get) == null ? void 0 : _c.call(context, "isInsideTableColumn")) {
43013
43165
  value = value.replace(/\brow\b/g, "rowData");
43014
43166
  }
43015
43167
  const arrowParams = this.parseArrowParamNames(args);
@@ -43032,7 +43184,7 @@ var _Transpiler = class _Transpiler {
43032
43184
  let exp = `${value.substring(5)}`;
43033
43185
  exp = exp.replace("fragment.Page", "fragment");
43034
43186
  const isProgressCircleDatavalue = tagName === "wm-progress-circle" && name === "datavalue";
43035
- exp = ((_c = context == null ? void 0 : context.get) == null ? void 0 : _c.call(context, "isInsideTableColumn")) ? transformTableColumnClassExpression(exp) : modifyExpression(exp);
43187
+ exp = ((_d = context == null ? void 0 : context.get) == null ? void 0 : _d.call(context, "isInsideTableColumn")) ? transformTableColumnClassExpression(exp) : modifyExpression(exp);
43036
43188
  exp = resolveFormatContext(exp, context);
43037
43189
  exp = this.convertStringBooleanTernary(exp);
43038
43190
  if (!exp) {
@@ -43182,6 +43334,7 @@ var transpileMarkup = (markup, isPartOfPrefab, splitCode, variables, preview, in
43182
43334
  components: {},
43183
43335
  partials: [],
43184
43336
  wmxcomponents: [],
43337
+ webComponents: [],
43185
43338
  prefabs: [],
43186
43339
  imports: []
43187
43340
  };
@@ -43212,6 +43365,7 @@ var transpileMarkup = (markup, isPartOfPrefab, splitCode, variables, preview, in
43212
43365
  }
43213
43366
  });
43214
43367
  parsed.childNodes.forEach((node) => {
43368
+ var _a;
43215
43369
  if (node.nodeType === NodeType2.TEXT_NODE) {
43216
43370
  const textContent = node.text;
43217
43371
  if (textContent.trim()) {
@@ -43226,6 +43380,7 @@ var transpileMarkup = (markup, isPartOfPrefab, splitCode, variables, preview, in
43226
43380
  finalResult.partials.push(...result.partials);
43227
43381
  finalResult.prefabs.push(...result.prefabs);
43228
43382
  finalResult.wmxcomponents.push(...result.wmxcomponents);
43383
+ (_a = finalResult.webComponents) == null ? void 0 : _a.push(...result.webComponents || []);
43229
43384
  finalResult.imports.push(...result.imports);
43230
43385
  if (result.pageEvents) finalResult.pageEvents = result.pageEvents;
43231
43386
  }
@@ -43263,8 +43418,8 @@ var createExpression = (element, attrName) => {
43263
43418
  let displayexpression = element.attrs[attrName];
43264
43419
  if (displayexpression == null ? void 0 : displayexpression.startsWith("bind:")) {
43265
43420
  displayexpression = displayexpression.substring(5).trim();
43266
- displayexpression = displayexpression.replace(/;+$/, "");
43267
43421
  displayexpression = decodeHTMLEntities(displayexpression);
43422
+ displayexpression = displayexpression.replace(/;+$/, "");
43268
43423
  displayexpression = transformDollarBracketSyntax(displayexpression);
43269
43424
  displayexpression = displayexpression.replace(/fragment\.\$item/g, "$item");
43270
43425
  displayexpression = displayexpression.replace(/fragment\.\$index/g, "$index");
@@ -43293,14 +43448,22 @@ var createExpression = (element, attrName) => {
43293
43448
  return `{($item) => (${transformedExp})}`;
43294
43449
  }
43295
43450
  };
43296
- var preTranspileHtmlElement = (e) => {
43451
+ var preTranspileHtmlElement = (e, isInsideTableColumn = false) => {
43297
43452
  const styleObj = style_transformer_default(e, (propName) => {
43298
43453
  return true;
43299
43454
  }) || {};
43300
- const attrs = Object.keys(e.attributes).filter((attr) => attr !== "name").map((attr) => {
43455
+ const attrs2 = Object.keys(e.attributes).filter((attr) => attr !== "name").map((attr) => {
43301
43456
  const value = e.getAttribute(attr);
43302
43457
  if (!value) return `${attr}=""`;
43303
43458
  if (attr === "class") {
43459
+ if (value.includes("{{") && value.includes("}}")) {
43460
+ const mustacheClassName = transformClassWithMustacheExpressions(value, {
43461
+ isInsideTableColumn
43462
+ });
43463
+ if (mustacheClassName) {
43464
+ return `className=${mustacheClassName}`;
43465
+ }
43466
+ }
43304
43467
  return `className="${value}"`;
43305
43468
  } else if (attr === "style") {
43306
43469
  const styleObject = convertStyleStringToObject(value);
@@ -43312,7 +43475,7 @@ var preTranspileHtmlElement = (e) => {
43312
43475
  if (styleObj && Object.keys(styleObj).length > 0) {
43313
43476
  styleAttr = ` style={${JSON.stringify(styleObj)}}`;
43314
43477
  }
43315
- const attrsStr = attrs ? ` ${attrs}` : "";
43478
+ const attrsStr = attrs2 ? ` ${attrs2}` : "";
43316
43479
  return `<${e.tagName.toLowerCase()}${attrsStr}${styleAttr}>`;
43317
43480
  };
43318
43481
  var convertStyleStringToObject = (styleString) => {
@@ -43370,6 +43533,12 @@ var label_transformer_default = {
43370
43533
  };
43371
43534
 
43372
43535
  // src/transpile/components/layout/layout-region-factory.ts
43536
+ var isOnlyWmParamChildren = (element) => {
43537
+ const elementChildren = element.childNodes.filter(
43538
+ (node) => node.nodeType === NodeType.ELEMENT_NODE
43539
+ );
43540
+ return elementChildren.length > 0 && elementChildren.every((node) => node.tagName === "WM-PARAM");
43541
+ };
43373
43542
  var partialContainerImport = [
43374
43543
  {
43375
43544
  name: "WmPartialContainer",
@@ -43385,6 +43554,11 @@ function createLayoutRegionTransformer(config) {
43385
43554
  const content = element.getAttribute("content") || defaultContent;
43386
43555
  const name = element.getAttribute("name") || defaultName;
43387
43556
  const isPreview = context.get("preview") === true;
43557
+ const hasCustomContent = element.childNodes.some((node) => node.nodeType === NodeType.ELEMENT_NODE) && !isOnlyWmParamChildren(element);
43558
+ if (hasCustomContent) {
43559
+ return `<${tag} ${transformAttrs(element, context)}>
43560
+ `;
43561
+ }
43388
43562
  if (isPreview) {
43389
43563
  return `<${tag} ${transformAttrs(element, context)}>
43390
43564
  <WmPartialContainer content="${content}" isLayout={true} partialName="${name}" listener={fragment} />
@@ -43396,6 +43570,10 @@ function createLayoutRegionTransformer(config) {
43396
43570
  },
43397
43571
  post: () => `</${tag}>`,
43398
43572
  imports: (element, context) => {
43573
+ const hasCustomContent = element.childNodes.some((node) => node.nodeType === NodeType.ELEMENT_NODE) && !isOnlyWmParamChildren(element);
43574
+ if (hasCustomContent) {
43575
+ return [...componentImports];
43576
+ }
43399
43577
  const isPreview = context.get("preview") === true;
43400
43578
  if (isPreview) {
43401
43579
  return [...componentImports, ...partialContainerImport];
@@ -43790,7 +43968,7 @@ function withPartialContainer(element, context, options) {
43790
43968
  if (options.removeName) {
43791
43969
  element.removeAttribute("name");
43792
43970
  }
43793
- const params = options.extraParams ? `props:Record<string, any>, onLoad:()=>void, ${options.extraParams}` : "props:Record<string, any>, onLoad:()=>void";
43971
+ const params = options.extraParams ? `props:Record<string, any>, onLoad:(widget?: any)=>void, ${options.extraParams}` : "props:Record<string, any>, onLoad:(widget?: any)=>void";
43794
43972
  partial = `${options.prop}={(${params}) => (${partial})}`;
43795
43973
  }
43796
43974
  return { partialAttr: partial, extraImports };
@@ -43950,7 +44128,7 @@ var button_transformer_default = {
43950
44128
  const enclosingFormName = getParentNode(element, "wm-form");
43951
44129
  enclosingFormName && element.setAttribute("formName", enclosingFormName);
43952
44130
  }
43953
- const isInsideTableColumn = getParentNode(element, "wm-table-column");
44131
+ const isInsideTableColumn = getParentNode(element, "wm-table-column") || (context == null ? void 0 : context.get("isInsideTableColumn"));
43954
44132
  const stopPropagation = (context == null ? void 0 : context.get("isInsideList")) || isInsideTableColumn ? " stopPropagation={true}" : "";
43955
44133
  return `<WmButton listener={fragment} ${stopPropagation} ${transformAttrs(element, context)} ${context.isPartOfPrefab ? " prefabName={fragment.prefabName}" : ""} >`;
43956
44134
  },
@@ -43986,10 +44164,10 @@ var createNavItemLabelExpression = (element) => {
43986
44164
  let expression;
43987
44165
  if (itemlabel.startsWith("bind:")) {
43988
44166
  expression = itemlabel.substring(5);
43989
- expression = expression.replace(/\[([^\]]+)\]/g, (match, content) => {
43990
- const transformedContent = content.replace(/fragment\./g, "item.");
43991
- return `[${transformedContent}]`;
43992
- });
44167
+ expression = expression.replace(
44168
+ /fragment\.([a-zA-Z_$][a-zA-Z0-9_$]*)/g,
44169
+ (match, name) => FRAGMENT_SCOPED_NAMES.includes(name) ? match : `item.${name}`
44170
+ );
43993
44171
  } else {
43994
44172
  expression = `item.${itemlabel}`;
43995
44173
  }
@@ -44201,7 +44379,7 @@ var buildItemAttrsFromListTemplate = (template, context) => {
44201
44379
  };
44202
44380
  var list_transformer_default = {
44203
44381
  pre: (element, context) => {
44204
- var _a, _b, _c, _d, _e, _f;
44382
+ var _a, _b, _c, _d, _e;
44205
44383
  context.set("isInsideList", true);
44206
44384
  const widgetName = element.attrs["name"];
44207
44385
  const listContent = parse5(`<wm-list-content name="${widgetName + "Item"}"></wm-list-content>`).firstChild;
@@ -44237,9 +44415,9 @@ var list_transformer_default = {
44237
44415
  transformRepeatChildAttr(template, "fragment.item", "$item");
44238
44416
  transformRepeatChildAttr(template, "fragment.index", "$index");
44239
44417
  transformRepeatChildAttr(template, "fragment.$index", "$index");
44240
- transformRepeatChildAttr(template, "itemRef.$index", "index");
44241
- transformRepeatChildAttr(template, "itemRef.$first", "first");
44242
- transformRepeatChildAttr(template, "itemRef.$last", "last");
44418
+ transformRepeatChildAttr(template, "fragment.itemRef.$index", "$index");
44419
+ transformRepeatChildAttr(template, "fragment.itemRef.$first", "$first");
44420
+ transformRepeatChildAttr(template, "fragment.itemRef.$last", "$last");
44243
44421
  if (template && dataSet && dataSet.startsWith("bind:")) {
44244
44422
  transformRepeatChildData(
44245
44423
  template,
@@ -44290,22 +44468,18 @@ var list_transformer_default = {
44290
44468
  true,
44291
44469
  widgetName
44292
44470
  );
44293
- transformRepeatChildAttr(template, dataSet.substring(5), "$item");
44294
- const isLoading = (_a = dataSet.match(/(fragment)+\.Variables\.[^\.]+/g)) == null ? void 0 : _a.map((v) => v + ".isExecuting").join(" || ");
44295
- if (isLoading) {
44296
- element.setAttribute("loadingdata", `bind:${isLoading}`);
44297
- }
44298
- if ((_b = element.getAttribute("disableitem")) == null ? void 0 : _b.startsWith("bind:")) {
44471
+ transformRepeatChildAttr(template, dataSet.substring(5), "$item", ["dataset", "datasource"]);
44472
+ if ((_a = element.getAttribute("disableitem")) == null ? void 0 : _a.startsWith("bind:")) {
44299
44473
  const disabelItemExp = replaceAll(
44300
- ((_c = element.getAttribute("disableitem")) == null ? void 0 : _c.substring(5)) || "",
44474
+ ((_b = element.getAttribute("disableitem")) == null ? void 0 : _b.substring(5)) || "",
44301
44475
  dataSet.substring(5) + "[fragment.$i]",
44302
44476
  "$item"
44303
44477
  );
44304
44478
  disableitem = `disableitem={($item, $index) => fragment.eval(() => ${disabelItemExp})}`;
44305
44479
  element.removeAttribute("disableitem");
44306
44480
  }
44307
- if ((_d = element.getAttribute("itemkey")) == null ? void 0 : _d.startsWith("bind:")) {
44308
- let itemKeyExp = ((_e = element.getAttribute("itemkey")) == null ? void 0 : _e.substring(5)) || "";
44481
+ if ((_c = element.getAttribute("itemkey")) == null ? void 0 : _c.startsWith("bind:")) {
44482
+ let itemKeyExp = ((_d = element.getAttribute("itemkey")) == null ? void 0 : _d.substring(5)) || "";
44309
44483
  itemKeyExp = replaceAll(itemKeyExp, dataSet.substring(5) + "[fragment.$i]", "$item");
44310
44484
  itemKeyExp = replaceAll(itemKeyExp, dataSet.substring(5) + "[0]", "$item");
44311
44485
  itemKey = `itemkey={($item, $index) => fragment.eval(() => ${itemKeyExp})}`;
@@ -44329,7 +44503,7 @@ var list_transformer_default = {
44329
44503
  `Variables.${variableName}.dataSet`
44330
44504
  ];
44331
44505
  dataPatterns.forEach((pattern) => {
44332
- transformRepeatChildAttr(template, pattern, "$item");
44506
+ transformRepeatChildAttr(template, pattern, "$item", ["dataset", "datasource"]);
44333
44507
  });
44334
44508
  }
44335
44509
  }
@@ -44339,7 +44513,7 @@ var list_transformer_default = {
44339
44513
  }
44340
44514
  }
44341
44515
  const templateNode = element.childNodes.find((c) => c instanceof HTMLElement);
44342
- const itemAttrsStr = ((_f = templateNode == null ? void 0 : templateNode.tagName) == null ? void 0 : _f.toLowerCase()) === "wm-listtemplate" ? buildItemAttrsFromListTemplate(templateNode, context) : "";
44516
+ const itemAttrsStr = ((_e = templateNode == null ? void 0 : templateNode.tagName) == null ? void 0 : _e.toLowerCase()) === "wm-listtemplate" ? buildItemAttrsFromListTemplate(templateNode, context) : "";
44343
44517
  addTemplateClass(element);
44344
44518
  listContent.childNodes = element.childNodes;
44345
44519
  element.childNodes = [listContent];
@@ -44350,6 +44524,7 @@ var list_transformer_default = {
44350
44524
  renderItem={($item:Record<string, any>, $index:number, list:Record<string, any>[] ,getCurrentItemWidgets :any) => {
44351
44525
  const currentItemWidgetsRef = React.useRef({})
44352
44526
  const currentItemWidgets = getCurrentItemWidgets($index);
44527
+ const item = $item;
44353
44528
  currentItemWidgetsRef.current = currentItemWidgets;
44354
44529
  const $first = $index === 0;
44355
44530
  const $last = list && $index === list.length - 1;
@@ -44863,8 +45038,8 @@ var form_field_transformer_default = {
44863
45038
  element.setAttribute("formName", formName);
44864
45039
  }
44865
45040
  (() => {
44866
- const attrs = ["primary-key", "is-related"];
44867
- attrs.forEach((attr) => {
45041
+ const attrs2 = ["primary-key", "is-related"];
45042
+ attrs2.forEach((attr) => {
44868
45043
  if (element.hasAttribute(attr)) {
44869
45044
  element.removeAttribute(attr);
44870
45045
  }
@@ -45057,7 +45232,8 @@ var getFormActionExpr = (action, isAsync = false) => {
45057
45232
  const asyncKeyword = isAsync ? "async " : "";
45058
45233
  const awaitKeyword = isAsync ? "await " : "";
45059
45234
  const processedAction = isAsync && action.includes("?.submit();") ? action.replace(/(\S+\?\.submit\(\);)/g, `${awaitKeyword}$1`) : action;
45060
- return `${asyncKeyword}($event) => {
45235
+ const params = /\bwidget\b/.test(action) ? "($event, widget)" : "($event)";
45236
+ return `${asyncKeyword}${params} => {
45061
45237
  ${processedAction}
45062
45238
  }`;
45063
45239
  };
@@ -45097,11 +45273,11 @@ var form_action_transformer_default = {
45097
45273
  const fragmentPrefix = "fragment?.Widgets";
45098
45274
  const widgetsPrefix = "Widgets";
45099
45275
  let btnClass = "btn-default";
45100
- if (actionType === "submit") {
45276
+ if (actionType === "submit" || action === "submit()") {
45101
45277
  btnClass = "btn-primary";
45102
45278
  action = listName ? getWidgetAccessor(listPrefix, formName, "?.submit();", isDynamicFormName) + (action || "") : getWidgetAccessor(widgetsPrefix, formName, "?.submit();", isDynamicFormName) + (action || "");
45103
45279
  }
45104
- if (actionType === "reset") {
45280
+ if (actionType === "reset" || action === "reset()") {
45105
45281
  action = listName ? getWidgetAccessor(listPrefix, formName, "?.formreset()", isDynamicFormName) + (action || "") : getWidgetAccessor(widgetsPrefix, formName, "?.formreset();", isDynamicFormName) + (action || "");
45106
45282
  }
45107
45283
  if (action) {
@@ -45223,10 +45399,10 @@ var applyAttr = (e, replace2, replaceWith) => {
45223
45399
  });
45224
45400
  e.childNodes.forEach((c) => isHTMLElement(c) && applyAttr(c, replace2, replaceWith));
45225
45401
  };
45402
+ var isInsideDialog = (element) => !!getParentNode(element, "wm-dialog");
45226
45403
  var dialog_actions_transformer_default = {
45227
45404
  pre: (element, context) => {
45228
- const parent = element.parentNode;
45229
- if (!(parent == null ? void 0 : parent.rawTagName.includes("dialog"))) {
45405
+ if (!isInsideDialog(element)) {
45230
45406
  Array.from(element.childNodes).forEach((child) => {
45231
45407
  element.removeChild(child);
45232
45408
  });
@@ -45243,15 +45419,13 @@ var dialog_actions_transformer_default = {
45243
45419
  return `<WmDialogActions ${transformAttrs(element, context)}>`;
45244
45420
  },
45245
45421
  post: (element, context) => {
45246
- const parent = element.parentNode;
45247
- if (!(parent == null ? void 0 : parent.rawTagName.includes("dialog"))) {
45422
+ if (!isInsideDialog(element)) {
45248
45423
  return ``;
45249
45424
  }
45250
45425
  return "</WmDialogActions>";
45251
45426
  },
45252
45427
  imports: (element, context) => {
45253
- const parent = element.parentNode;
45254
- if (!(parent == null ? void 0 : parent.rawTagName.includes("dialog"))) {
45428
+ if (!isInsideDialog(element)) {
45255
45429
  return [];
45256
45430
  }
45257
45431
  return imports37;
@@ -45315,12 +45489,16 @@ var tabs_transformer_default = {
45315
45489
  transformRepeatChildData(
45316
45490
  repeatTemplate,
45317
45491
  dataSet.substring(5) + "[0]",
45318
- "list_item"
45492
+ "list_item",
45493
+ true,
45494
+ widgetName
45319
45495
  );
45320
45496
  transformRepeatChildData(
45321
45497
  repeatTemplate,
45322
45498
  dataSet.substring(5) + "[$i]",
45323
- "list_item"
45499
+ "list_item",
45500
+ true,
45501
+ widgetName
45324
45502
  );
45325
45503
  repeatTemplate.childNodes = element.childNodes;
45326
45504
  element.childNodes = [repeatTemplate];
@@ -45734,7 +45912,7 @@ var imports52 = [
45734
45912
  ];
45735
45913
  var accordion_transformer_default = {
45736
45914
  pre: (element, context) => {
45737
- element.attrs["name"];
45915
+ const widgetName = element.attrs["name"];
45738
45916
  let dataSet = element.getAttribute("dataset");
45739
45917
  if (dataSet && dataSet.startsWith("bind:") && element.getAttribute("type") === "dynamic") {
45740
45918
  dataSet = dataSet.substring(5);
@@ -45744,10 +45922,34 @@ var accordion_transformer_default = {
45744
45922
  accordionPane.setAttribute("active", "bind:$item.active");
45745
45923
  accordionPane.setAttribute("toggle", "bind:$item.toggle");
45746
45924
  }
45747
- transformRepeatChildData(template, dataSet + "[0]", "repeat_item");
45748
- transformRepeatChildData(template, dataSet + "[$i]", "repeat_item");
45749
- transformRepeatChildData(template, dataSet + "[fragment.$i]", "repeat_item");
45750
- transformRepeatChildData(template, dataSet + "[fragment.$i]", "repeat_item");
45925
+ transformRepeatChildData(
45926
+ template,
45927
+ dataSet + "[0]",
45928
+ "repeat_item",
45929
+ true,
45930
+ widgetName
45931
+ );
45932
+ transformRepeatChildData(
45933
+ template,
45934
+ dataSet + "[$i]",
45935
+ "repeat_item",
45936
+ true,
45937
+ widgetName
45938
+ );
45939
+ transformRepeatChildData(
45940
+ template,
45941
+ dataSet + "[fragment.$i]",
45942
+ "repeat_item",
45943
+ true,
45944
+ widgetName
45945
+ );
45946
+ transformRepeatChildData(
45947
+ template,
45948
+ dataSet + "[fragment.$i]",
45949
+ "repeat_item",
45950
+ true,
45951
+ widgetName
45952
+ );
45751
45953
  context.set("old_props", context.props);
45752
45954
  context.props = ["$item", "$index"];
45753
45955
  return `<WmAccordion listener={fragment} ${transformAttrs(element, context)} render={(($item:Record<string,any>,$index:number,data:Record<string,any>[])=>(`;
@@ -46946,18 +47148,16 @@ var table_transformer_default = {
46946
47148
  const datasourceAttr = element.getAttribute("datasource");
46947
47149
  const binddatasetAttr = element.getAttribute("binddataset");
46948
47150
  if (datasetAttr && datasetAttr.includes(".dataSet")) {
46949
- const match = datasetAttr.match(
46950
- /^bind:fragment\.((?:App\.activePage\.|App\.)?Variables)\.([^.]+)\.dataSet(?=[^A-Za-z0-9_]|$)/
46951
- );
46952
- if (match) {
46953
- const scopePath = match[1];
46954
- const variableName = match[2];
46955
- context.set("tableDatasetVariableName", variableName);
47151
+ const binding = parseVariableDataSetBinding(datasetAttr);
47152
+ if (binding) {
47153
+ const { scopePath, datasourceExpr, variableName } = binding;
47154
+ if (variableName) {
47155
+ context.set("tableDatasetVariableName", variableName);
47156
+ }
46956
47157
  if (!datasourceAttr) {
46957
- const datasourceExpr = `fragment.${scopePath}.${variableName}`.split(".").join("?.");
46958
47158
  element.setAttribute("datasource", `{${datasourceExpr}}`);
46959
47159
  }
46960
- if (!binddatasetAttr) {
47160
+ if (!binddatasetAttr && variableName) {
46961
47161
  element.setAttribute("binddataset", `${scopePath}.${variableName}.dataSet`);
46962
47162
  }
46963
47163
  }
@@ -47486,8 +47686,37 @@ var wmx_component_transformer_default = {
47486
47686
  ]
47487
47687
  };
47488
47688
 
47689
+ // src/transpile/components/web-component/web-component.transformer.ts
47690
+ var toCamelCase = (name) => name.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
47691
+ var attrs = (element) => Object.entries(element.attributes).map(([name, value]) => {
47692
+ if (name.startsWith("on-")) {
47693
+ return `on${name.substring(3).replace(/-/g, "")}={($event) => { ${value.replace(/;+$/, "")} }}`;
47694
+ }
47695
+ if (value.startsWith("bind:")) return `${toCamelCase(name)}={${value.substring(5)}}`;
47696
+ return `${name}=${JSON.stringify(value)}`;
47697
+ }).join(" ");
47698
+ var web_component_transformer_default = {
47699
+ pre: (element, context) => {
47700
+ var _a;
47701
+ const tagName = element.tagName.toLowerCase();
47702
+ if ((_a = context.data) == null ? void 0 : _a.preview) {
47703
+ return `<${tagName} ${attrs(element)}>`;
47704
+ }
47705
+ return `<WebComponent tagname=${JSON.stringify(tagName)} ${attrs(element)} />`;
47706
+ },
47707
+ post: (element, context) => {
47708
+ var _a;
47709
+ return ((_a = context.data) == null ? void 0 : _a.preview) ? `</${element.tagName.toLowerCase()}>` : "";
47710
+ },
47711
+ imports: (element, context) => {
47712
+ var _a;
47713
+ return ((_a = context.data) == null ? void 0 : _a.preview) ? [] : [{ name: "WebComponent", from: "@/app/helper/web-component" }];
47714
+ }
47715
+ };
47716
+
47489
47717
  // src/transpile/components/transform-register.ts
47490
47718
  var transform_register_default = () => {
47719
+ registerTransformer("__web-component__", web_component_transformer_default);
47491
47720
  registerTransformer("wm-page", page_transformer_default);
47492
47721
  registerTransformer("wm-page-content", page_content_transformer_default);
47493
47722
  registerTransformer("wm-content", content_transformer_default);