@wavemaker/angular-codegen 11.14.0-rc.6276 → 11.14.1-10.6348

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.
@@ -5867,14 +5867,14 @@ function createNgModuleType(meta) {
5867
5867
  if (meta.kind === R3NgModuleMetadataKind.Local) {
5868
5868
  return new ExpressionType$1(meta.type.value);
5869
5869
  }
5870
- const { type: moduleType, declarations, exports, imports, includeImportTypes, publicDeclarationTypes, } = meta;
5870
+ const { type: moduleType, declarations, exports: exports$1, imports, includeImportTypes, publicDeclarationTypes, } = meta;
5871
5871
  return new ExpressionType$1(importExpr(Identifiers.NgModuleDeclaration, [
5872
5872
  new ExpressionType$1(moduleType.type),
5873
5873
  publicDeclarationTypes === null
5874
5874
  ? tupleTypeOf(declarations)
5875
5875
  : tupleOfTypes(publicDeclarationTypes),
5876
5876
  includeImportTypes ? tupleTypeOf(imports) : NONE_TYPE,
5877
- tupleTypeOf(exports),
5877
+ tupleTypeOf(exports$1),
5878
5878
  ]));
5879
5879
  }
5880
5880
  /**
@@ -35417,7 +35417,7 @@ const TABLE_ACTION_DIRECTIVE = [{ from: '@wm/components/data/table', name: 'Tabl
35417
35417
  const TABLE_COLUMN_DIRECTIVE = [{ from: '@wm/components/data/table', name: 'TableColumnDirective' }];
35418
35418
  const TABLE_COLUMN_GROUP_DIRECTIVE = [{ from: '@wm/components/data/table', name: 'TableColumnGroupDirective' }];
35419
35419
  const TABLE_ROW_DIRECTIVE = [{ from: '@wm/components/data/table', name: 'TableRowDirective' }, ...CONTAINER_DIRECTIVE, ...PARTIAL_CONTAINER];
35420
- const TABLE_ROW_ACTION_DIRECTIVE = [{ from: '@wm/components/data/table', name: 'TableRowActionDirective' }, ...BUTTON_COMPONENT];
35420
+ const TABLE_ROW_ACTION_DIRECTIVE = [{ from: '@wm/components/data/table', name: 'TableRowActionDirective' }, ...BUTTON_COMPONENT, ...ANCHOR_COMPONENT];
35421
35421
  const TABLE_COMPONENT = [
35422
35422
  ...NG_FORM_MODULE,
35423
35423
  ...NG_REACTIVE_FORM_MODULE,
@@ -39572,7 +39572,7 @@ var hasRequiredEntities;
39572
39572
  function requireEntities () {
39573
39573
  if (hasRequiredEntities) return entities;
39574
39574
  hasRequiredEntities = 1;
39575
- (function (exports) {
39575
+ (function (exports$1) {
39576
39576
 
39577
39577
  var freeze = requireConventions().freeze;
39578
39578
 
@@ -39583,7 +39583,7 @@ function requireEntities () {
39583
39583
  * @see https://www.w3.org/TR/2008/REC-xml-20081126/#sec-predefined-ent W3C XML 1.0
39584
39584
  * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML Wikipedia
39585
39585
  */
39586
- exports.XML_ENTITIES = freeze({
39586
+ exports$1.XML_ENTITIES = freeze({
39587
39587
  amp: '&',
39588
39588
  apos: "'",
39589
39589
  gt: '>',
@@ -39605,7 +39605,7 @@ function requireEntities () {
39605
39605
  * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entity_references_in_HTML Wikipedia (HTML)
39606
39606
  * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Entities_representing_special_characters_in_XHTML Wikpedia (XHTML)
39607
39607
  */
39608
- exports.HTML_ENTITIES = freeze({
39608
+ exports$1.HTML_ENTITIES = freeze({
39609
39609
  Aacute: '\u00C1',
39610
39610
  aacute: '\u00E1',
39611
39611
  Abreve: '\u0102',
@@ -41737,7 +41737,7 @@ function requireEntities () {
41737
41737
  * @deprecated use `HTML_ENTITIES` instead
41738
41738
  * @see HTML_ENTITIES
41739
41739
  */
41740
- exports.entityMap = exports.HTML_ENTITIES;
41740
+ exports$1.entityMap = exports$1.HTML_ENTITIES;
41741
41741
  } (entities));
41742
41742
  return entities;
41743
41743
  }
@@ -43545,7 +43545,7 @@ var hasRequiredMoment;
43545
43545
  function requireMoment () {
43546
43546
  if (hasRequiredMoment) return moment$1.exports;
43547
43547
  hasRequiredMoment = 1;
43548
- (function (module, exports) {
43548
+ (function (module, exports$1) {
43549
43549
  (function (global, factory) {
43550
43550
  module.exports = factory() ;
43551
43551
  }(this, (function () {
@@ -81680,7 +81680,7 @@ function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRo
81680
81680
  verifySemanticsOfNgModuleImport(modOrStandaloneCmpt, moduleType);
81681
81681
  verifySemanticsOfNgModuleDef(modOrStandaloneCmpt, false, moduleType);
81682
81682
  });
81683
- const exports = maybeUnwrapFn(ngModuleDef.exports);
81683
+ const exports$1 = maybeUnwrapFn(ngModuleDef.exports);
81684
81684
  declarations.forEach(verifyDeclarationsHaveDefinitions);
81685
81685
  declarations.forEach(verifyDirectivesHaveSelector);
81686
81686
  declarations.forEach((declarationType) => verifyNotStandalone(declarationType, moduleType));
@@ -81688,7 +81688,7 @@ function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRo
81688
81688
  ...declarations.map(resolveForwardRef),
81689
81689
  ...flatten(imports.map(computeCombinedExports)).map(resolveForwardRef),
81690
81690
  ];
81691
- exports.forEach(verifyExportsAreDeclaredOrReExported);
81691
+ exports$1.forEach(verifyExportsAreDeclaredOrReExported);
81692
81692
  declarations.forEach((decl) => verifyDeclarationIsUnique(decl, allowDuplicateDeclarationsInRoot));
81693
81693
  const ngModule = getAnnotation(moduleType, 'NgModule');
81694
81694
  if (ngModule) {
@@ -99707,11 +99707,11 @@ const getRowActionAttrs = attrs => {
99707
99707
  return tmpl;
99708
99708
  };
99709
99709
 
99710
- const $RAF$1 = window.requestAnimationFrame;
99710
+ const $RAF = window.requestAnimationFrame;
99711
99711
  const $RAFQueue = [];
99712
99712
  const invokeLater = fn => {
99713
99713
  if (!$RAFQueue.length) {
99714
- $RAF$1(() => {
99714
+ $RAF(() => {
99715
99715
  $RAFQueue.forEach(f => f());
99716
99716
  $RAFQueue.length = 0;
99717
99717
  });
@@ -100253,70 +100253,223 @@ const getFnForEventExpr = (expr) => {
100253
100253
  return fnExecutor(expr, ExpressionType.Action);
100254
100254
  };
100255
100255
 
100256
+ // Constants
100257
+ const WIDGET_ID_REGEX = /^(widget-[^_]+)/;
100258
+ const WIDGET_PROPERTY_REGEX = /^widget-[^_]+_(.+)$/;
100259
+ const ARRAY_INDEX_PLACEHOLDER = '[$i]';
100260
+ const ARRAY_INDEX_ZERO = '[0]';
100256
100261
  const registry = new Map();
100257
100262
  const watchIdGenerator = new IDGenerator('watch-id-');
100258
- const FIRST_TIME_WATCH = {};
100259
- Object.freeze(FIRST_TIME_WATCH);
100263
+ const FIRST_TIME_WATCH = Object.freeze({});
100264
+ /**
100265
+ * Extracts widget ID from identifier (e.g., "widget-id23_eventsource" -> "widget-id23")
100266
+ */
100267
+ const getWidgetId = (identifier) => {
100268
+ if (!identifier || typeof identifier !== 'string') {
100269
+ return null;
100270
+ }
100271
+ const match = identifier.match(WIDGET_ID_REGEX);
100272
+ return match ? match[1] : null;
100273
+ };
100274
+ /**
100275
+ * Extracts property name from identifier (e.g., "widget-id23_eventsource" -> "eventsource")
100276
+ */
100277
+ const getPropertyName = (identifier) => {
100278
+ if (!identifier || typeof identifier !== 'string') {
100279
+ return identifier;
100280
+ }
100281
+ const match = identifier.match(WIDGET_PROPERTY_REGEX);
100282
+ return match ? match[1] : identifier;
100283
+ };
100284
+ /**
100285
+ * Array consumer wrapper for array-based expressions
100286
+ */
100260
100287
  const arrayConsumer = (listenerFn, restExpr, newVal, oldVal) => {
100261
- let data = newVal, formattedData;
100262
- if (isArray(data)) {
100263
- formattedData = data.map(function (datum) {
100264
- return findValueOf(datum, restExpr);
100265
- });
100266
- // If resulting structure is an array of array, flatten it
100267
- if (isArray(formattedData[0])) {
100268
- formattedData = flatten$1(formattedData);
100269
- }
100270
- listenerFn(formattedData, oldVal);
100288
+ if (!isArray(newVal)) {
100289
+ return;
100290
+ }
100291
+ let formattedData = newVal.map(datum => findValueOf(datum, restExpr));
100292
+ // Flatten if result is array of arrays
100293
+ if (isArray(formattedData[0])) {
100294
+ formattedData = flatten$1(formattedData);
100271
100295
  }
100296
+ listenerFn(formattedData, oldVal);
100272
100297
  };
100273
- const getUpdatedWatcInfo = (expr, acceptsArray, listener) => {
100274
- // listener doesn't accept array
100275
- // replace all `[$i]` with `[0]` and return the expression
100276
- let regex = /\[\$i\]/g, $I = '[$i]', $0 = '[0]';
100298
+ /**
100299
+ * Updates watch info for array expressions
100300
+ */
100301
+ const getUpdatedWatchInfo = (expr, acceptsArray, listener) => {
100302
+ const regex = /\[\$i\]/g;
100277
100303
  if (!acceptsArray) {
100278
100304
  return {
100279
- 'expr': expr.replace(regex, $0),
100280
- 'listener': listener
100305
+ expr: expr.replace(regex, ARRAY_INDEX_ZERO),
100306
+ listener
100281
100307
  };
100282
100308
  }
100283
- // listener accepts array
100284
- // replace all except the last `[$i]` with `[0]` and return the expression.
100285
- var index = expr.lastIndexOf($I), _expr = expr.substr(0, index).replace($I, $0), restExpr = expr.substr(index + 5), arrayConsumerFn = listener;
100286
- if (restExpr) {
100287
- arrayConsumerFn = arrayConsumer.bind(undefined, listener, restExpr);
100288
- }
100309
+ const lastIndex = expr.lastIndexOf(ARRAY_INDEX_PLACEHOLDER);
100310
+ const baseExpr = expr.substring(0, lastIndex).replace(ARRAY_INDEX_PLACEHOLDER, ARRAY_INDEX_ZERO);
100311
+ const restExpr = expr.substring(lastIndex + 5);
100312
+ const arrayConsumerFn = restExpr
100313
+ ? arrayConsumer.bind(undefined, listener, restExpr)
100314
+ : listener;
100289
100315
  return {
100290
- 'expr': _expr,
100291
- 'listener': arrayConsumerFn
100316
+ expr: baseExpr,
100317
+ listener: arrayConsumerFn
100292
100318
  };
100293
100319
  };
100320
+ /**
100321
+ * Determines if an expression is static (doesn't need to be watched)
100322
+ */
100323
+ const STATIC_EXPRESSION_NAMES = [
100324
+ "row.getProperty('investment')",
100325
+ "row.getProperty('factsheetLink')",
100326
+ "row.getProperty('isRebalanceEligible')"
100327
+ ];
100328
+ const isStaticExpression = (expr) => {
100329
+ if (typeof expr !== 'string') {
100330
+ return false;
100331
+ }
100332
+ const trimmedExpr = expr.trim();
100333
+ // Expressions that always evaluate to localization strings
100334
+ // if (trimmedExpr.includes('appLocale')) {
100335
+ // return true;
100336
+ // }
100337
+ // Hard-coded static expression names
100338
+ if (STATIC_EXPRESSION_NAMES.includes(trimmedExpr)) {
100339
+ return true;
100340
+ }
100341
+ return false;
100342
+ };
100343
+ /**
100344
+ * Gets the scope type from the scope object
100345
+ */
100346
+ const getScopeType = ($scope) => {
100347
+ if (!$scope) {
100348
+ return null;
100349
+ }
100350
+ if ($scope.pageName)
100351
+ return 'Page';
100352
+ if ($scope.prefabName)
100353
+ return 'Prefab';
100354
+ if ($scope.partialName)
100355
+ return 'Partial';
100356
+ // Check for App scope
100357
+ if ($scope.Variables !== undefined &&
100358
+ $scope.Actions !== undefined &&
100359
+ !$scope.pageName &&
100360
+ !$scope.prefabName &&
100361
+ !$scope.partialName) {
100362
+ return 'App';
100363
+ }
100364
+ if ($scope.constructor?.name === 'AppRef') {
100365
+ return 'App';
100366
+ }
100367
+ return null;
100368
+ };
100369
+ /**
100370
+ * Gets scope name based on scope type
100371
+ */
100372
+ const getScopeName = ($scope, scopeType) => {
100373
+ if (!scopeType || !$scope) {
100374
+ return null;
100375
+ }
100376
+ switch (scopeType) {
100377
+ case 'Prefab': return $scope.prefabName || null;
100378
+ case 'Partial': return $scope.partialName || null;
100379
+ case 'Page': return $scope.pageName || null;
100380
+ default: return null;
100381
+ }
100382
+ };
100383
+ /**
100384
+ * Main watch function
100385
+ */
100294
100386
  const $watch = (expr, $scope, $locals, listener, identifier = watchIdGenerator.nextUid(), doNotClone = false, config = {}, isMuted) => {
100295
- if (expr.indexOf('[$i]') !== -1) {
100296
- let watchInfo = getUpdatedWatcInfo(expr, config && (config.arrayType || config.isList), listener);
100387
+ // Handle array expressions
100388
+ if (expr.includes(ARRAY_INDEX_PLACEHOLDER)) {
100389
+ const watchInfo = getUpdatedWatchInfo(expr, config.arrayType || config.isList || false, listener);
100297
100390
  expr = watchInfo.expr;
100298
100391
  listener = watchInfo.listener;
100299
100392
  }
100393
+ // Handle static expressions
100394
+ if (isStaticExpression(expr)) {
100395
+ try {
100396
+ const fn = $parseExpr(expr);
100397
+ const staticValue = fn($scope, $locals);
100398
+ listener(staticValue, FIRST_TIME_WATCH);
100399
+ }
100400
+ catch (e) {
100401
+ console.warn(`Error evaluating static expression '${expr}':`, e);
100402
+ listener(undefined, FIRST_TIME_WATCH);
100403
+ }
100404
+ return () => { }; // No-op unsubscribe
100405
+ }
100300
100406
  const fn = $parseExpr();
100301
- registry.set(identifier, {
100302
- fn: fn.bind(expr, $scope, $locals),
100407
+ const scopeType = getScopeType($scope);
100408
+ const scopeName = getScopeName($scope, scopeType);
100409
+ const destroyFn = () => $unwatch(identifier);
100410
+ const watchInfo = {
100411
+ fn: fn.bind(null, $scope, $locals),
100303
100412
  listener,
100304
100413
  expr,
100305
100414
  last: FIRST_TIME_WATCH,
100306
100415
  doNotClone,
100307
- isMuted: isMuted
100308
- });
100309
- return () => $unwatch(identifier);
100416
+ isMuted,
100417
+ scopeType,
100418
+ scopeName,
100419
+ destroyFn
100420
+ };
100421
+ // Store in registry
100422
+ const widgetId = getWidgetId(identifier);
100423
+ if (widgetId) {
100424
+ const propertyName = getPropertyName(identifier);
100425
+ if (!registry.has(widgetId)) {
100426
+ registry.set(widgetId, {});
100427
+ }
100428
+ const widgetGroup = registry.get(widgetId);
100429
+ widgetGroup[propertyName] = watchInfo;
100430
+ }
100431
+ else {
100432
+ registry.set(identifier, watchInfo);
100433
+ }
100434
+ return destroyFn;
100435
+ };
100436
+ /**
100437
+ * Unwatches a single identifier
100438
+ */
100439
+ const $unwatch = (identifier) => {
100440
+ const widgetId = getWidgetId(identifier);
100441
+ if (widgetId) {
100442
+ const propertyName = getPropertyName(identifier);
100443
+ const widgetGroup = registry.get(widgetId);
100444
+ //@ts-ignore
100445
+ if (widgetGroup && typeof widgetGroup === 'object' && !widgetGroup.fn) {
100446
+ const watchInfo = widgetGroup[propertyName];
100447
+ if (watchInfo) {
100448
+ delete widgetGroup[propertyName];
100449
+ // Clean up empty widget groups
100450
+ if (Object.keys(widgetGroup).length === 0) {
100451
+ registry.delete(widgetId);
100452
+ }
100453
+ return true;
100454
+ }
100455
+ }
100456
+ }
100457
+ // Fallback to direct lookup
100458
+ if (registry.has(identifier)) {
100459
+ registry.delete(identifier);
100460
+ return true;
100461
+ }
100462
+ return false;
100310
100463
  };
100311
- const $unwatch = identifier => registry.delete(identifier);
100312
- window.watchRegistry = registry;
100313
100464
  const $appDigest = (() => {
100314
- return (force) => {
100465
+ return (force = false) => {
100315
100466
  {
100316
100467
  return;
100317
100468
  }
100318
100469
  };
100319
100470
  })();
100471
+ // Export registry for debugging
100472
+ window.watchRegistry = registry;
100320
100473
 
100321
100474
  var ComponentType;
100322
100475
  (function (ComponentType) {
@@ -100387,6 +100540,7 @@ const REGEX = {
100387
100540
  SUPPORTED_AUDIO_FORMAT: /\.(mp3|ogg|webm|wma|3gp|wav|m4a)$/i,
100388
100541
  SUPPORTED_VIDEO_FORMAT: /\.(mp4|ogg|webm|wmv|mpeg|mpg|avi|mov)$/i,
100389
100542
  VALID_WEB_URL: /^(http[s]?:\/\/)(www\.){0,1}[a-zA-Z0-9=:?\/\.\-]+(\.[a-zA-Z]{2,5}[\.]{0,1})?/,
100543
+ VALID_IMAGE_URL: /^(https?|blob|data|file|ftp):/i,
100390
100544
  REPLACE_PATTERN: /\$\{([^\}]+)\}/g,
100391
100545
  DATA_URL: /^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i,
100392
100546
  ISO_DATE_FORMAT: /(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})(\.\d+)?([+-]\d{2}:?\d{2}|Z)$/
@@ -100609,6 +100763,9 @@ const isVideoFile = (fileName) => {
100609
100763
  const isValidWebURL = (url) => {
100610
100764
  return (REGEX.VALID_WEB_URL).test(url);
100611
100765
  };
100766
+ const isValidImageUrl = (url) => {
100767
+ return (REGEX.VALID_IMAGE_URL).test(url?.trim());
100768
+ };
100612
100769
  /*This function returns the url to the resource after checking the validity of url*/
100613
100770
  const getResourceURL = (urlString) => {
100614
100771
  return urlString;
@@ -101862,6 +102019,7 @@ var Utils = /*#__PURE__*/Object.freeze({
101862
102019
  isPageable: isPageable,
101863
102020
  isSafari: isSafari,
101864
102021
  isTablet: isTablet,
102022
+ isValidImageUrl: isValidImageUrl,
101865
102023
  isValidWebURL: isValidWebURL,
101866
102024
  isVideoFile: isVideoFile,
101867
102025
  loadScript: loadScript,