@wavemaker/angular-app 11.14.1-16.6408 → 11.14.1-16.6417
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dependencies/pipe-provider.cjs.js +378 -98
- package/dependencies/transpilation-web.cjs.js +189 -49
- package/dependency-report.html +1 -1
- package/npm-shrinkwrap.json +179 -65
- package/package-lock.json +179 -65
- package/package.json +5 -5
|
@@ -99707,11 +99707,11 @@ const getRowActionAttrs = attrs => {
|
|
|
99707
99707
|
return tmpl;
|
|
99708
99708
|
};
|
|
99709
99709
|
|
|
99710
|
-
const $RAF
|
|
99710
|
+
const $RAF = window.requestAnimationFrame;
|
|
99711
99711
|
const $RAFQueue = [];
|
|
99712
99712
|
const invokeLater = fn => {
|
|
99713
99713
|
if (!$RAFQueue.length) {
|
|
99714
|
-
$RAF
|
|
99714
|
+
$RAF(() => {
|
|
99715
99715
|
$RAFQueue.forEach(f => f());
|
|
99716
99716
|
$RAFQueue.length = 0;
|
|
99717
99717
|
});
|
|
@@ -100253,83 +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
|
-
|
|
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
|
-
|
|
100262
|
-
|
|
100263
|
-
|
|
100264
|
-
|
|
100265
|
-
|
|
100266
|
-
|
|
100267
|
-
|
|
100268
|
-
formattedData = _.flatten(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
|
-
|
|
100274
|
-
|
|
100275
|
-
|
|
100276
|
-
|
|
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
|
-
|
|
100280
|
-
|
|
100305
|
+
expr: expr.replace(regex, ARRAY_INDEX_ZERO),
|
|
100306
|
+
listener
|
|
100281
100307
|
};
|
|
100282
100308
|
}
|
|
100283
|
-
|
|
100284
|
-
|
|
100285
|
-
|
|
100286
|
-
|
|
100287
|
-
|
|
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
|
-
|
|
100291
|
-
|
|
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
|
-
|
|
100296
|
-
|
|
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
|
-
|
|
100302
|
-
|
|
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
|
|
100308
|
-
|
|
100309
|
-
|
|
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;
|
|
100310
100435
|
};
|
|
100311
|
-
|
|
100312
|
-
|
|
100313
|
-
|
|
100314
|
-
|
|
100315
|
-
|
|
100316
|
-
|
|
100317
|
-
|
|
100318
|
-
|
|
100319
|
-
|
|
100320
|
-
|
|
100321
|
-
|
|
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
|
+
}
|
|
100322
100455
|
}
|
|
100323
|
-
debouncedTriggerWatchers();
|
|
100324
100456
|
}
|
|
100325
|
-
|
|
100457
|
+
// Fallback to direct lookup
|
|
100458
|
+
if (registry.has(identifier)) {
|
|
100459
|
+
registry.delete(identifier);
|
|
100460
|
+
return true;
|
|
100461
|
+
}
|
|
100462
|
+
return false;
|
|
100463
|
+
};
|
|
100326
100464
|
const $appDigest = (() => {
|
|
100327
|
-
return (force) => {
|
|
100465
|
+
return (force = false) => {
|
|
100328
100466
|
{
|
|
100329
100467
|
return;
|
|
100330
100468
|
}
|
|
100331
100469
|
};
|
|
100332
100470
|
})();
|
|
100471
|
+
// Export registry for debugging
|
|
100472
|
+
window.watchRegistry = registry;
|
|
100333
100473
|
|
|
100334
100474
|
var ComponentType;
|
|
100335
100475
|
(function (ComponentType) {
|
package/dependency-report.html
CHANGED