@wavemaker/angular-codegen 11.14.1-3.6306 → 11.14.1-6.6324

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.
@@ -147299,11 +147299,11 @@ const CURRENCY_INFO = {
147299
147299
  }
147300
147300
  };
147301
147301
 
147302
- const $RAF$1 = window.requestAnimationFrame;
147302
+ const $RAF$1$1 = window.requestAnimationFrame;
147303
147303
  const $RAFQueue$1 = [];
147304
147304
  const invokeLater$1 = fn => {
147305
147305
  if (!$RAFQueue$1.length) {
147306
- $RAF$1(() => {
147306
+ $RAF$1$1(() => {
147307
147307
  $RAFQueue$1.forEach(f => f());
147308
147308
  $RAFQueue$1.length = 0;
147309
147309
  });
@@ -147845,220 +147845,70 @@ const getFnForEventExpr$1 = (expr) => {
147845
147845
  return fnExecutor$1(expr, ExpressionType$2.Action);
147846
147846
  };
147847
147847
 
147848
- // Constants
147849
- const WIDGET_ID_REGEX$1 = /^(widget-[^_]+)/;
147850
- const WIDGET_PROPERTY_REGEX$1 = /^widget-[^_]+_(.+)$/;
147851
- const ARRAY_INDEX_PLACEHOLDER$1 = '[$i]';
147852
- const ARRAY_INDEX_ZERO$1 = '[0]';
147853
147848
  const registry$1 = new Map();
147854
147849
  const watchIdGenerator$1 = new IDGenerator$1('watch-id-');
147855
- const FIRST_TIME_WATCH$1 = Object.freeze({});
147856
- /**
147857
- * Extracts widget ID from identifier (e.g., "widget-id23_eventsource" -> "widget-id23")
147858
- */
147859
- const getWidgetId$1 = (identifier) => {
147860
- if (!identifier || typeof identifier !== 'string') {
147861
- return null;
147862
- }
147863
- const match = identifier.match(WIDGET_ID_REGEX$1);
147864
- return match ? match[1] : null;
147865
- };
147866
- /**
147867
- * Extracts property name from identifier (e.g., "widget-id23_eventsource" -> "eventsource")
147868
- */
147869
- const getPropertyName$1 = (identifier) => {
147870
- if (!identifier || typeof identifier !== 'string') {
147871
- return identifier;
147872
- }
147873
- const match = identifier.match(WIDGET_PROPERTY_REGEX$1);
147874
- return match ? match[1] : identifier;
147875
- };
147876
- /**
147877
- * Array consumer wrapper for array-based expressions
147878
- */
147850
+ const FIRST_TIME_WATCH$1 = {};
147851
+ Object.freeze(FIRST_TIME_WATCH$1);
147879
147852
  const arrayConsumer$1 = (listenerFn, restExpr, newVal, oldVal) => {
147880
- if (!isArray$1(newVal)) {
147881
- return;
147882
- }
147883
- let formattedData = newVal.map(datum => findValueOf$1(datum, restExpr));
147884
- // Flatten if result is array of arrays
147885
- if (isArray$1(formattedData[0])) {
147886
- formattedData = flatten$2(formattedData);
147853
+ let data = newVal, formattedData;
147854
+ if (isArray$1(data)) {
147855
+ formattedData = data.map(function (datum) {
147856
+ return findValueOf$1(datum, restExpr);
147857
+ });
147858
+ // If resulting structure is an array of array, flatten it
147859
+ if (isArray$1(formattedData[0])) {
147860
+ formattedData = flatten$2(formattedData);
147861
+ }
147862
+ listenerFn(formattedData, oldVal);
147887
147863
  }
147888
- listenerFn(formattedData, oldVal);
147889
147864
  };
147890
- /**
147891
- * Updates watch info for array expressions
147892
- */
147893
- const getUpdatedWatchInfo$1 = (expr, acceptsArray, listener) => {
147894
- const regex = /\[\$i\]/g;
147865
+ const getUpdatedWatcInfo$1 = (expr, acceptsArray, listener) => {
147866
+ // listener doesn't accept array
147867
+ // replace all `[$i]` with `[0]` and return the expression
147868
+ let regex = /\[\$i\]/g, $I = '[$i]', $0 = '[0]';
147895
147869
  if (!acceptsArray) {
147896
147870
  return {
147897
- expr: expr.replace(regex, ARRAY_INDEX_ZERO$1),
147898
- listener
147871
+ 'expr': expr.replace(regex, $0),
147872
+ 'listener': listener
147899
147873
  };
147900
147874
  }
147901
- const lastIndex = expr.lastIndexOf(ARRAY_INDEX_PLACEHOLDER$1);
147902
- const baseExpr = expr.substring(0, lastIndex).replace(ARRAY_INDEX_PLACEHOLDER$1, ARRAY_INDEX_ZERO$1);
147903
- const restExpr = expr.substring(lastIndex + ARRAY_INDEX_PLACEHOLDER$1.length);
147904
- const arrayConsumerFn = restExpr
147905
- ? arrayConsumer$1.bind(undefined, listener, restExpr)
147906
- : listener;
147875
+ // listener accepts array
147876
+ // replace all except the last `[$i]` with `[0]` and return the expression.
147877
+ var index = expr.lastIndexOf($I), _expr = expr.substr(0, index).replace($I, $0), restExpr = expr.substr(index + 5), arrayConsumerFn = listener;
147878
+ if (restExpr) {
147879
+ arrayConsumerFn = arrayConsumer$1.bind(undefined, listener, restExpr);
147880
+ }
147907
147881
  return {
147908
- expr: baseExpr,
147909
- listener: arrayConsumerFn
147882
+ 'expr': _expr,
147883
+ 'listener': arrayConsumerFn
147910
147884
  };
147911
147885
  };
147912
- /**
147913
- * Determines if an expression is static (doesn't need to be watched)
147914
- */
147915
- const STATIC_EXPRESSION_NAMES$1 = [
147916
- "row.getProperty('investment')",
147917
- "row.getProperty('factsheetLink')",
147918
- "row.getProperty('isRebalanceEligible')"
147919
- ];
147920
- const isStaticExpression$1 = (expr) => {
147921
- if (typeof expr !== 'string') {
147922
- return false;
147923
- }
147924
- const trimmedExpr = expr.trim();
147925
- // Expressions that always evaluate to localization strings
147926
- if (trimmedExpr.includes('appLocale')) {
147927
- return true;
147928
- }
147929
- // Hard-coded static expression names
147930
- if (STATIC_EXPRESSION_NAMES$1.includes(trimmedExpr)) {
147931
- return true;
147932
- }
147933
- return false;
147934
- };
147935
- /**
147936
- * Gets the scope type from the scope object
147937
- */
147938
- const getScopeType$1 = ($scope) => {
147939
- if (!$scope) {
147940
- return null;
147941
- }
147942
- if ($scope.pageName)
147943
- return 'Page';
147944
- if ($scope.prefabName)
147945
- return 'Prefab';
147946
- if ($scope.partialName)
147947
- return 'Partial';
147948
- // Check for App scope
147949
- if ($scope.Variables !== undefined &&
147950
- $scope.Actions !== undefined &&
147951
- !$scope.pageName &&
147952
- !$scope.prefabName &&
147953
- !$scope.partialName) {
147954
- return 'App';
147955
- }
147956
- if ($scope.constructor?.name === 'AppRef') {
147957
- return 'App';
147958
- }
147959
- return null;
147960
- };
147961
- /**
147962
- * Gets scope name based on scope type
147963
- */
147964
- const getScopeName$1 = ($scope, scopeType) => {
147965
- if (!scopeType || !$scope) {
147966
- return null;
147967
- }
147968
- switch (scopeType) {
147969
- case 'Prefab': return $scope.prefabName || null;
147970
- case 'Partial': return $scope.partialName || null;
147971
- case 'Page': return $scope.pageName || null;
147972
- default: return null;
147973
- }
147974
- };
147975
- /**
147976
- * Main watch function
147977
- */
147978
147886
  const $watch$1 = (expr, $scope, $locals, listener, identifier = watchIdGenerator$1.nextUid(), doNotClone = false, config = {}, isMuted) => {
147979
- // Handle array expressions
147980
- if (expr.includes(ARRAY_INDEX_PLACEHOLDER$1)) {
147981
- const watchInfo = getUpdatedWatchInfo$1(expr, config.arrayType || config.isList || false, listener);
147887
+ if (expr.indexOf('[$i]') !== -1) {
147888
+ let watchInfo = getUpdatedWatcInfo$1(expr, config && (config.arrayType || config.isList), listener);
147982
147889
  expr = watchInfo.expr;
147983
147890
  listener = watchInfo.listener;
147984
147891
  }
147985
- // Handle static expressions
147986
- if (isStaticExpression$1(expr)) {
147987
- try {
147988
- const fn = $parseExpr$1(expr);
147989
- const staticValue = fn($scope, $locals);
147990
- listener(staticValue, FIRST_TIME_WATCH$1);
147991
- }
147992
- catch (e) {
147993
- console.warn(`Error evaluating static expression '${expr}':`, e);
147994
- listener(undefined, FIRST_TIME_WATCH$1);
147995
- }
147996
- return () => { }; // No-op unsubscribe
147997
- }
147998
147892
  const fn = $parseExpr$1();
147999
- const scopeType = getScopeType$1($scope);
148000
- const scopeName = getScopeName$1($scope, scopeType);
148001
- const watchInfo = {
148002
- fn: fn.bind(null, $scope, $locals),
147893
+ registry$1.set(identifier, {
147894
+ fn: fn.bind(expr, $scope, $locals),
148003
147895
  listener,
148004
147896
  expr,
148005
147897
  last: FIRST_TIME_WATCH$1,
148006
147898
  doNotClone,
148007
- isMuted,
148008
- scopeType,
148009
- scopeName
148010
- };
148011
- // Store in registry
148012
- const widgetId = getWidgetId$1(identifier);
148013
- if (widgetId) {
148014
- const propertyName = getPropertyName$1(identifier);
148015
- if (!registry$1.has(widgetId)) {
148016
- registry$1.set(widgetId, {});
148017
- }
148018
- const widgetGroup = registry$1.get(widgetId);
148019
- widgetGroup[propertyName] = watchInfo;
148020
- }
148021
- else {
148022
- registry$1.set(identifier, watchInfo);
148023
- }
147899
+ isMuted: isMuted
147900
+ });
148024
147901
  return () => $unwatch$1(identifier);
148025
147902
  };
148026
- /**
148027
- * Unwatches a single identifier
148028
- */
148029
- const $unwatch$1 = (identifier) => {
148030
- const widgetId = getWidgetId$1(identifier);
148031
- if (widgetId) {
148032
- const propertyName = getPropertyName$1(identifier);
148033
- const widgetGroup = registry$1.get(widgetId);
148034
- if (widgetGroup && typeof widgetGroup === 'object' && !widgetGroup.fn) {
148035
- const watchInfo = widgetGroup[propertyName];
148036
- if (watchInfo) {
148037
- delete widgetGroup[propertyName];
148038
- // Clean up empty widget groups
148039
- if (Object.keys(widgetGroup).length === 0) {
148040
- registry$1.delete(widgetId);
148041
- }
148042
- return true;
148043
- }
148044
- }
148045
- }
148046
- // Fallback to direct lookup
148047
- if (registry$1.has(identifier)) {
148048
- registry$1.delete(identifier);
148049
- return true;
148050
- }
148051
- return false;
148052
- };
147903
+ const $unwatch$1 = identifier => registry$1.delete(identifier);
147904
+ window.watchRegistry = registry$1;
148053
147905
  const $appDigest$1 = (() => {
148054
- return (force = false) => {
147906
+ return (force) => {
148055
147907
  {
148056
147908
  return;
148057
147909
  }
148058
147910
  };
148059
147911
  })();
148060
- // Export registry for debugging
148061
- // (window as any).watchRegistry = registry;
148062
147912
 
148063
147913
  var ComponentType$1;
148064
147914
  (function (ComponentType) {
@@ -203064,11 +202914,11 @@ var DEFAULT_FORMATS;
203064
202914
  DEFAULT_FORMATS["DATE_TIME"] = "yyyy-MM-dd HH:mm:ss";
203065
202915
  })(DEFAULT_FORMATS || (DEFAULT_FORMATS = {}));
203066
202916
 
203067
- const $RAF = window.requestAnimationFrame;
202917
+ const $RAF$1 = window.requestAnimationFrame;
203068
202918
  const $RAFQueue = [];
203069
202919
  const invokeLater = fn => {
203070
202920
  if (!$RAFQueue.length) {
203071
- $RAF(() => {
202921
+ $RAF$1(() => {
203072
202922
  $RAFQueue.forEach(f => f());
203073
202923
  $RAFQueue.length = 0;
203074
202924
  });
@@ -203610,220 +203460,70 @@ const getFnForEventExpr = (expr) => {
203610
203460
  return fnExecutor(expr, ExpressionType.Action);
203611
203461
  };
203612
203462
 
203613
- // Constants
203614
- const WIDGET_ID_REGEX = /^(widget-[^_]+)/;
203615
- const WIDGET_PROPERTY_REGEX = /^widget-[^_]+_(.+)$/;
203616
- const ARRAY_INDEX_PLACEHOLDER = '[$i]';
203617
- const ARRAY_INDEX_ZERO = '[0]';
203618
203463
  const registry = new Map();
203619
203464
  const watchIdGenerator = new IDGenerator('watch-id-');
203620
- const FIRST_TIME_WATCH = Object.freeze({});
203621
- /**
203622
- * Extracts widget ID from identifier (e.g., "widget-id23_eventsource" -> "widget-id23")
203623
- */
203624
- const getWidgetId = (identifier) => {
203625
- if (!identifier || typeof identifier !== 'string') {
203626
- return null;
203627
- }
203628
- const match = identifier.match(WIDGET_ID_REGEX);
203629
- return match ? match[1] : null;
203630
- };
203631
- /**
203632
- * Extracts property name from identifier (e.g., "widget-id23_eventsource" -> "eventsource")
203633
- */
203634
- const getPropertyName = (identifier) => {
203635
- if (!identifier || typeof identifier !== 'string') {
203636
- return identifier;
203637
- }
203638
- const match = identifier.match(WIDGET_PROPERTY_REGEX);
203639
- return match ? match[1] : identifier;
203640
- };
203641
- /**
203642
- * Array consumer wrapper for array-based expressions
203643
- */
203465
+ const FIRST_TIME_WATCH = {};
203466
+ Object.freeze(FIRST_TIME_WATCH);
203644
203467
  const arrayConsumer = (listenerFn, restExpr, newVal, oldVal) => {
203645
- if (!isArray(newVal)) {
203646
- return;
203647
- }
203648
- let formattedData = newVal.map(datum => findValueOf(datum, restExpr));
203649
- // Flatten if result is array of arrays
203650
- if (isArray(formattedData[0])) {
203651
- formattedData = flatten(formattedData);
203468
+ let data = newVal, formattedData;
203469
+ if (isArray(data)) {
203470
+ formattedData = data.map(function (datum) {
203471
+ return findValueOf(datum, restExpr);
203472
+ });
203473
+ // If resulting structure is an array of array, flatten it
203474
+ if (isArray(formattedData[0])) {
203475
+ formattedData = flatten(formattedData);
203476
+ }
203477
+ listenerFn(formattedData, oldVal);
203652
203478
  }
203653
- listenerFn(formattedData, oldVal);
203654
203479
  };
203655
- /**
203656
- * Updates watch info for array expressions
203657
- */
203658
- const getUpdatedWatchInfo = (expr, acceptsArray, listener) => {
203659
- const regex = /\[\$i\]/g;
203480
+ const getUpdatedWatcInfo = (expr, acceptsArray, listener) => {
203481
+ // listener doesn't accept array
203482
+ // replace all `[$i]` with `[0]` and return the expression
203483
+ let regex = /\[\$i\]/g, $I = '[$i]', $0 = '[0]';
203660
203484
  if (!acceptsArray) {
203661
203485
  return {
203662
- expr: expr.replace(regex, ARRAY_INDEX_ZERO),
203663
- listener
203486
+ 'expr': expr.replace(regex, $0),
203487
+ 'listener': listener
203664
203488
  };
203665
203489
  }
203666
- const lastIndex = expr.lastIndexOf(ARRAY_INDEX_PLACEHOLDER);
203667
- const baseExpr = expr.substring(0, lastIndex).replace(ARRAY_INDEX_PLACEHOLDER, ARRAY_INDEX_ZERO);
203668
- const restExpr = expr.substring(lastIndex + ARRAY_INDEX_PLACEHOLDER.length);
203669
- const arrayConsumerFn = restExpr
203670
- ? arrayConsumer.bind(undefined, listener, restExpr)
203671
- : listener;
203490
+ // listener accepts array
203491
+ // replace all except the last `[$i]` with `[0]` and return the expression.
203492
+ var index = expr.lastIndexOf($I), _expr = expr.substr(0, index).replace($I, $0), restExpr = expr.substr(index + 5), arrayConsumerFn = listener;
203493
+ if (restExpr) {
203494
+ arrayConsumerFn = arrayConsumer.bind(undefined, listener, restExpr);
203495
+ }
203672
203496
  return {
203673
- expr: baseExpr,
203674
- listener: arrayConsumerFn
203497
+ 'expr': _expr,
203498
+ 'listener': arrayConsumerFn
203675
203499
  };
203676
203500
  };
203677
- /**
203678
- * Determines if an expression is static (doesn't need to be watched)
203679
- */
203680
- const STATIC_EXPRESSION_NAMES = [
203681
- "row.getProperty('investment')",
203682
- "row.getProperty('factsheetLink')",
203683
- "row.getProperty('isRebalanceEligible')"
203684
- ];
203685
- const isStaticExpression = (expr) => {
203686
- if (typeof expr !== 'string') {
203687
- return false;
203688
- }
203689
- const trimmedExpr = expr.trim();
203690
- // Expressions that always evaluate to localization strings
203691
- if (trimmedExpr.includes('appLocale')) {
203692
- return true;
203693
- }
203694
- // Hard-coded static expression names
203695
- if (STATIC_EXPRESSION_NAMES.includes(trimmedExpr)) {
203696
- return true;
203697
- }
203698
- return false;
203699
- };
203700
- /**
203701
- * Gets the scope type from the scope object
203702
- */
203703
- const getScopeType = ($scope) => {
203704
- if (!$scope) {
203705
- return null;
203706
- }
203707
- if ($scope.pageName)
203708
- return 'Page';
203709
- if ($scope.prefabName)
203710
- return 'Prefab';
203711
- if ($scope.partialName)
203712
- return 'Partial';
203713
- // Check for App scope
203714
- if ($scope.Variables !== undefined &&
203715
- $scope.Actions !== undefined &&
203716
- !$scope.pageName &&
203717
- !$scope.prefabName &&
203718
- !$scope.partialName) {
203719
- return 'App';
203720
- }
203721
- if ($scope.constructor?.name === 'AppRef') {
203722
- return 'App';
203723
- }
203724
- return null;
203725
- };
203726
- /**
203727
- * Gets scope name based on scope type
203728
- */
203729
- const getScopeName = ($scope, scopeType) => {
203730
- if (!scopeType || !$scope) {
203731
- return null;
203732
- }
203733
- switch (scopeType) {
203734
- case 'Prefab': return $scope.prefabName || null;
203735
- case 'Partial': return $scope.partialName || null;
203736
- case 'Page': return $scope.pageName || null;
203737
- default: return null;
203738
- }
203739
- };
203740
- /**
203741
- * Main watch function
203742
- */
203743
203501
  const $watch = (expr, $scope, $locals, listener, identifier = watchIdGenerator.nextUid(), doNotClone = false, config = {}, isMuted) => {
203744
- // Handle array expressions
203745
- if (expr.includes(ARRAY_INDEX_PLACEHOLDER)) {
203746
- const watchInfo = getUpdatedWatchInfo(expr, config.arrayType || config.isList || false, listener);
203502
+ if (expr.indexOf('[$i]') !== -1) {
203503
+ let watchInfo = getUpdatedWatcInfo(expr, config && (config.arrayType || config.isList), listener);
203747
203504
  expr = watchInfo.expr;
203748
203505
  listener = watchInfo.listener;
203749
203506
  }
203750
- // Handle static expressions
203751
- if (isStaticExpression(expr)) {
203752
- try {
203753
- const fn = $parseExpr(expr);
203754
- const staticValue = fn($scope, $locals);
203755
- listener(staticValue, FIRST_TIME_WATCH);
203756
- }
203757
- catch (e) {
203758
- console.warn(`Error evaluating static expression '${expr}':`, e);
203759
- listener(undefined, FIRST_TIME_WATCH);
203760
- }
203761
- return () => { }; // No-op unsubscribe
203762
- }
203763
203507
  const fn = $parseExpr();
203764
- const scopeType = getScopeType($scope);
203765
- const scopeName = getScopeName($scope, scopeType);
203766
- const watchInfo = {
203767
- fn: fn.bind(null, $scope, $locals),
203508
+ registry.set(identifier, {
203509
+ fn: fn.bind(expr, $scope, $locals),
203768
203510
  listener,
203769
203511
  expr,
203770
203512
  last: FIRST_TIME_WATCH,
203771
203513
  doNotClone,
203772
- isMuted,
203773
- scopeType,
203774
- scopeName
203775
- };
203776
- // Store in registry
203777
- const widgetId = getWidgetId(identifier);
203778
- if (widgetId) {
203779
- const propertyName = getPropertyName(identifier);
203780
- if (!registry.has(widgetId)) {
203781
- registry.set(widgetId, {});
203782
- }
203783
- const widgetGroup = registry.get(widgetId);
203784
- widgetGroup[propertyName] = watchInfo;
203785
- }
203786
- else {
203787
- registry.set(identifier, watchInfo);
203788
- }
203514
+ isMuted: isMuted
203515
+ });
203789
203516
  return () => $unwatch(identifier);
203790
203517
  };
203791
- /**
203792
- * Unwatches a single identifier
203793
- */
203794
- const $unwatch = (identifier) => {
203795
- const widgetId = getWidgetId(identifier);
203796
- if (widgetId) {
203797
- const propertyName = getPropertyName(identifier);
203798
- const widgetGroup = registry.get(widgetId);
203799
- if (widgetGroup && typeof widgetGroup === 'object' && !widgetGroup.fn) {
203800
- const watchInfo = widgetGroup[propertyName];
203801
- if (watchInfo) {
203802
- delete widgetGroup[propertyName];
203803
- // Clean up empty widget groups
203804
- if (Object.keys(widgetGroup).length === 0) {
203805
- registry.delete(widgetId);
203806
- }
203807
- return true;
203808
- }
203809
- }
203810
- }
203811
- // Fallback to direct lookup
203812
- if (registry.has(identifier)) {
203813
- registry.delete(identifier);
203814
- return true;
203815
- }
203816
- return false;
203817
- };
203518
+ const $unwatch = identifier => registry.delete(identifier);
203519
+ window.watchRegistry = registry;
203818
203520
  const $appDigest = (() => {
203819
- return (force = false) => {
203521
+ return (force) => {
203820
203522
  {
203821
203523
  return;
203822
203524
  }
203823
203525
  };
203824
203526
  })();
203825
- // Export registry for debugging
203826
- // (window as any).watchRegistry = registry;
203827
203527
 
203828
203528
  var ComponentType;
203829
203529
  (function (ComponentType) {