@wavemaker/angular-app 11.14.1-13.6377 → 11.14.1-16.6404
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/custom-widgets-bundle.cjs.js +1 -1
- package/dependencies/pipe-provider.cjs.js +98 -378
- package/dependencies/transpilation-web.cjs.js +49 -189
- package/dependency-report.html +1 -1
- package/npm-shrinkwrap.json +302 -288
- package/package-lock.json +302 -288
- package/package.json +5 -5
|
@@ -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,223 +147845,83 @@ 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 =
|
|
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
|
-
|
|
147881
|
-
|
|
147882
|
-
|
|
147883
|
-
|
|
147884
|
-
|
|
147885
|
-
|
|
147886
|
-
|
|
147853
|
+
let data = newVal, formattedData;
|
|
147854
|
+
if (_.isArray(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(formattedData[0])) {
|
|
147860
|
+
formattedData = _.flatten(formattedData);
|
|
147861
|
+
}
|
|
147862
|
+
listenerFn(formattedData, oldVal);
|
|
147887
147863
|
}
|
|
147888
|
-
listenerFn(formattedData, oldVal);
|
|
147889
147864
|
};
|
|
147890
|
-
|
|
147891
|
-
|
|
147892
|
-
|
|
147893
|
-
|
|
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,
|
|
147898
|
-
listener
|
|
147871
|
+
'expr': expr.replace(regex, $0),
|
|
147872
|
+
'listener': listener
|
|
147899
147873
|
};
|
|
147900
147874
|
}
|
|
147901
|
-
|
|
147902
|
-
|
|
147903
|
-
|
|
147904
|
-
|
|
147905
|
-
|
|
147906
|
-
|
|
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:
|
|
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
|
-
|
|
147980
|
-
|
|
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
|
-
|
|
148000
|
-
|
|
148001
|
-
const destroyFn = () => $unwatch$1(identifier);
|
|
148002
|
-
const watchInfo = {
|
|
148003
|
-
fn: fn.bind(null, $scope, $locals),
|
|
147893
|
+
registry$1.set(identifier, {
|
|
147894
|
+
fn: fn.bind(expr, $scope, $locals),
|
|
148004
147895
|
listener,
|
|
148005
147896
|
expr,
|
|
148006
147897
|
last: FIRST_TIME_WATCH$1,
|
|
148007
147898
|
doNotClone,
|
|
148008
|
-
isMuted
|
|
148009
|
-
|
|
148010
|
-
|
|
148011
|
-
destroyFn
|
|
148012
|
-
};
|
|
148013
|
-
// Store in registry
|
|
148014
|
-
const widgetId = getWidgetId$1(identifier);
|
|
148015
|
-
if (widgetId) {
|
|
148016
|
-
const propertyName = getPropertyName$1(identifier);
|
|
148017
|
-
if (!registry$1.has(widgetId)) {
|
|
148018
|
-
registry$1.set(widgetId, {});
|
|
148019
|
-
}
|
|
148020
|
-
const widgetGroup = registry$1.get(widgetId);
|
|
148021
|
-
widgetGroup[propertyName] = watchInfo;
|
|
148022
|
-
}
|
|
148023
|
-
else {
|
|
148024
|
-
registry$1.set(identifier, watchInfo);
|
|
148025
|
-
}
|
|
148026
|
-
return destroyFn;
|
|
147899
|
+
isMuted: isMuted
|
|
147900
|
+
});
|
|
147901
|
+
return () => $unwatch$1(identifier);
|
|
148027
147902
|
};
|
|
148028
|
-
|
|
148029
|
-
|
|
148030
|
-
|
|
148031
|
-
const $
|
|
148032
|
-
|
|
148033
|
-
|
|
148034
|
-
|
|
148035
|
-
|
|
148036
|
-
|
|
148037
|
-
|
|
148038
|
-
|
|
148039
|
-
if (watchInfo) {
|
|
148040
|
-
delete widgetGroup[propertyName];
|
|
148041
|
-
// Clean up empty widget groups
|
|
148042
|
-
if (Object.keys(widgetGroup).length === 0) {
|
|
148043
|
-
registry$1.delete(widgetId);
|
|
148044
|
-
}
|
|
148045
|
-
return true;
|
|
148046
|
-
}
|
|
147903
|
+
const $unwatch$1 = identifier => registry$1.delete(identifier);
|
|
147904
|
+
window.watchRegistry = registry$1;
|
|
147905
|
+
window.__WM_DEBUG_WATCHERS__ = false;
|
|
147906
|
+
/*export const $invokeWatchers = (force?: boolean, ignoreMuted?: boolean) => {
|
|
147907
|
+
if (force) {
|
|
147908
|
+
triggerWatchers(ignoreMuted);
|
|
147909
|
+
} else {
|
|
147910
|
+
|
|
147911
|
+
if (skipWatchers) {
|
|
147912
|
+
skipWatchers = false;
|
|
147913
|
+
return;
|
|
148047
147914
|
}
|
|
147915
|
+
debouncedTriggerWatchers();
|
|
148048
147916
|
}
|
|
148049
|
-
|
|
148050
|
-
if (registry$1.has(identifier)) {
|
|
148051
|
-
registry$1.delete(identifier);
|
|
148052
|
-
return true;
|
|
148053
|
-
}
|
|
148054
|
-
return false;
|
|
148055
|
-
};
|
|
147917
|
+
};*/
|
|
148056
147918
|
const $appDigest$1 = (() => {
|
|
148057
|
-
return (force
|
|
147919
|
+
return (force) => {
|
|
148058
147920
|
{
|
|
148059
147921
|
return;
|
|
148060
147922
|
}
|
|
148061
147923
|
};
|
|
148062
147924
|
})();
|
|
148063
|
-
// Export registry for debugging
|
|
148064
|
-
window.watchRegistry = registry$1;
|
|
148065
147925
|
|
|
148066
147926
|
var ComponentType$1;
|
|
148067
147927
|
(function (ComponentType) {
|
|
@@ -203067,11 +202927,11 @@ var DEFAULT_FORMATS;
|
|
|
203067
202927
|
DEFAULT_FORMATS["DATE_TIME"] = "yyyy-MM-dd HH:mm:ss";
|
|
203068
202928
|
})(DEFAULT_FORMATS || (DEFAULT_FORMATS = {}));
|
|
203069
202929
|
|
|
203070
|
-
const $RAF = window.requestAnimationFrame;
|
|
202930
|
+
const $RAF$1 = window.requestAnimationFrame;
|
|
203071
202931
|
const $RAFQueue = [];
|
|
203072
202932
|
const invokeLater = fn => {
|
|
203073
202933
|
if (!$RAFQueue.length) {
|
|
203074
|
-
$RAF(() => {
|
|
202934
|
+
$RAF$1(() => {
|
|
203075
202935
|
$RAFQueue.forEach(f => f());
|
|
203076
202936
|
$RAFQueue.length = 0;
|
|
203077
202937
|
});
|
|
@@ -203613,223 +203473,83 @@ const getFnForEventExpr = (expr) => {
|
|
|
203613
203473
|
return fnExecutor(expr, ExpressionType.Action);
|
|
203614
203474
|
};
|
|
203615
203475
|
|
|
203616
|
-
// Constants
|
|
203617
|
-
const WIDGET_ID_REGEX = /^(widget-[^_]+)/;
|
|
203618
|
-
const WIDGET_PROPERTY_REGEX = /^widget-[^_]+_(.+)$/;
|
|
203619
|
-
const ARRAY_INDEX_PLACEHOLDER = '[$i]';
|
|
203620
|
-
const ARRAY_INDEX_ZERO = '[0]';
|
|
203621
203476
|
const registry = new Map();
|
|
203622
203477
|
const watchIdGenerator = new IDGenerator('watch-id-');
|
|
203623
|
-
const FIRST_TIME_WATCH =
|
|
203624
|
-
|
|
203625
|
-
* Extracts widget ID from identifier (e.g., "widget-id23_eventsource" -> "widget-id23")
|
|
203626
|
-
*/
|
|
203627
|
-
const getWidgetId = (identifier) => {
|
|
203628
|
-
if (!identifier || typeof identifier !== 'string') {
|
|
203629
|
-
return null;
|
|
203630
|
-
}
|
|
203631
|
-
const match = identifier.match(WIDGET_ID_REGEX);
|
|
203632
|
-
return match ? match[1] : null;
|
|
203633
|
-
};
|
|
203634
|
-
/**
|
|
203635
|
-
* Extracts property name from identifier (e.g., "widget-id23_eventsource" -> "eventsource")
|
|
203636
|
-
*/
|
|
203637
|
-
const getPropertyName = (identifier) => {
|
|
203638
|
-
if (!identifier || typeof identifier !== 'string') {
|
|
203639
|
-
return identifier;
|
|
203640
|
-
}
|
|
203641
|
-
const match = identifier.match(WIDGET_PROPERTY_REGEX);
|
|
203642
|
-
return match ? match[1] : identifier;
|
|
203643
|
-
};
|
|
203644
|
-
/**
|
|
203645
|
-
* Array consumer wrapper for array-based expressions
|
|
203646
|
-
*/
|
|
203478
|
+
const FIRST_TIME_WATCH = {};
|
|
203479
|
+
Object.freeze(FIRST_TIME_WATCH);
|
|
203647
203480
|
const arrayConsumer = (listenerFn, restExpr, newVal, oldVal) => {
|
|
203648
|
-
|
|
203649
|
-
|
|
203650
|
-
|
|
203651
|
-
|
|
203652
|
-
|
|
203653
|
-
|
|
203654
|
-
|
|
203481
|
+
let data = newVal, formattedData;
|
|
203482
|
+
if (_.isArray(data)) {
|
|
203483
|
+
formattedData = data.map(function (datum) {
|
|
203484
|
+
return findValueOf(datum, restExpr);
|
|
203485
|
+
});
|
|
203486
|
+
// If resulting structure is an array of array, flatten it
|
|
203487
|
+
if (_.isArray(formattedData[0])) {
|
|
203488
|
+
formattedData = _.flatten(formattedData);
|
|
203489
|
+
}
|
|
203490
|
+
listenerFn(formattedData, oldVal);
|
|
203655
203491
|
}
|
|
203656
|
-
listenerFn(formattedData, oldVal);
|
|
203657
203492
|
};
|
|
203658
|
-
|
|
203659
|
-
|
|
203660
|
-
|
|
203661
|
-
|
|
203662
|
-
const regex = /\[\$i\]/g;
|
|
203493
|
+
const getUpdatedWatcInfo = (expr, acceptsArray, listener) => {
|
|
203494
|
+
// listener doesn't accept array
|
|
203495
|
+
// replace all `[$i]` with `[0]` and return the expression
|
|
203496
|
+
let regex = /\[\$i\]/g, $I = '[$i]', $0 = '[0]';
|
|
203663
203497
|
if (!acceptsArray) {
|
|
203664
203498
|
return {
|
|
203665
|
-
expr: expr.replace(regex,
|
|
203666
|
-
listener
|
|
203499
|
+
'expr': expr.replace(regex, $0),
|
|
203500
|
+
'listener': listener
|
|
203667
203501
|
};
|
|
203668
203502
|
}
|
|
203669
|
-
|
|
203670
|
-
|
|
203671
|
-
|
|
203672
|
-
|
|
203673
|
-
|
|
203674
|
-
|
|
203503
|
+
// listener accepts array
|
|
203504
|
+
// replace all except the last `[$i]` with `[0]` and return the expression.
|
|
203505
|
+
var index = expr.lastIndexOf($I), _expr = expr.substr(0, index).replace($I, $0), restExpr = expr.substr(index + 5), arrayConsumerFn = listener;
|
|
203506
|
+
if (restExpr) {
|
|
203507
|
+
arrayConsumerFn = arrayConsumer.bind(undefined, listener, restExpr);
|
|
203508
|
+
}
|
|
203675
203509
|
return {
|
|
203676
|
-
expr:
|
|
203677
|
-
listener: arrayConsumerFn
|
|
203510
|
+
'expr': _expr,
|
|
203511
|
+
'listener': arrayConsumerFn
|
|
203678
203512
|
};
|
|
203679
203513
|
};
|
|
203680
|
-
/**
|
|
203681
|
-
* Determines if an expression is static (doesn't need to be watched)
|
|
203682
|
-
*/
|
|
203683
|
-
const STATIC_EXPRESSION_NAMES = [
|
|
203684
|
-
"row.getProperty('investment')",
|
|
203685
|
-
"row.getProperty('factsheetLink')",
|
|
203686
|
-
"row.getProperty('isRebalanceEligible')"
|
|
203687
|
-
];
|
|
203688
|
-
const isStaticExpression = (expr) => {
|
|
203689
|
-
if (typeof expr !== 'string') {
|
|
203690
|
-
return false;
|
|
203691
|
-
}
|
|
203692
|
-
const trimmedExpr = expr.trim();
|
|
203693
|
-
// Expressions that always evaluate to localization strings
|
|
203694
|
-
// if (trimmedExpr.includes('appLocale')) {
|
|
203695
|
-
// return true;
|
|
203696
|
-
// }
|
|
203697
|
-
// Hard-coded static expression names
|
|
203698
|
-
if (STATIC_EXPRESSION_NAMES.includes(trimmedExpr)) {
|
|
203699
|
-
return true;
|
|
203700
|
-
}
|
|
203701
|
-
return false;
|
|
203702
|
-
};
|
|
203703
|
-
/**
|
|
203704
|
-
* Gets the scope type from the scope object
|
|
203705
|
-
*/
|
|
203706
|
-
const getScopeType = ($scope) => {
|
|
203707
|
-
if (!$scope) {
|
|
203708
|
-
return null;
|
|
203709
|
-
}
|
|
203710
|
-
if ($scope.pageName)
|
|
203711
|
-
return 'Page';
|
|
203712
|
-
if ($scope.prefabName)
|
|
203713
|
-
return 'Prefab';
|
|
203714
|
-
if ($scope.partialName)
|
|
203715
|
-
return 'Partial';
|
|
203716
|
-
// Check for App scope
|
|
203717
|
-
if ($scope.Variables !== undefined &&
|
|
203718
|
-
$scope.Actions !== undefined &&
|
|
203719
|
-
!$scope.pageName &&
|
|
203720
|
-
!$scope.prefabName &&
|
|
203721
|
-
!$scope.partialName) {
|
|
203722
|
-
return 'App';
|
|
203723
|
-
}
|
|
203724
|
-
if ($scope.constructor?.name === 'AppRef') {
|
|
203725
|
-
return 'App';
|
|
203726
|
-
}
|
|
203727
|
-
return null;
|
|
203728
|
-
};
|
|
203729
|
-
/**
|
|
203730
|
-
* Gets scope name based on scope type
|
|
203731
|
-
*/
|
|
203732
|
-
const getScopeName = ($scope, scopeType) => {
|
|
203733
|
-
if (!scopeType || !$scope) {
|
|
203734
|
-
return null;
|
|
203735
|
-
}
|
|
203736
|
-
switch (scopeType) {
|
|
203737
|
-
case 'Prefab': return $scope.prefabName || null;
|
|
203738
|
-
case 'Partial': return $scope.partialName || null;
|
|
203739
|
-
case 'Page': return $scope.pageName || null;
|
|
203740
|
-
default: return null;
|
|
203741
|
-
}
|
|
203742
|
-
};
|
|
203743
|
-
/**
|
|
203744
|
-
* Main watch function
|
|
203745
|
-
*/
|
|
203746
203514
|
const $watch = (expr, $scope, $locals, listener, identifier = watchIdGenerator.nextUid(), doNotClone = false, config = {}, isMuted) => {
|
|
203747
|
-
|
|
203748
|
-
|
|
203749
|
-
const watchInfo = getUpdatedWatchInfo(expr, config.arrayType || config.isList || false, listener);
|
|
203515
|
+
if (expr.indexOf('[$i]') !== -1) {
|
|
203516
|
+
let watchInfo = getUpdatedWatcInfo(expr, config && (config.arrayType || config.isList), listener);
|
|
203750
203517
|
expr = watchInfo.expr;
|
|
203751
203518
|
listener = watchInfo.listener;
|
|
203752
203519
|
}
|
|
203753
|
-
// Handle static expressions
|
|
203754
|
-
if (isStaticExpression(expr)) {
|
|
203755
|
-
try {
|
|
203756
|
-
const fn = $parseExpr(expr);
|
|
203757
|
-
const staticValue = fn($scope, $locals);
|
|
203758
|
-
listener(staticValue, FIRST_TIME_WATCH);
|
|
203759
|
-
}
|
|
203760
|
-
catch (e) {
|
|
203761
|
-
console.warn(`Error evaluating static expression '${expr}':`, e);
|
|
203762
|
-
listener(undefined, FIRST_TIME_WATCH);
|
|
203763
|
-
}
|
|
203764
|
-
return () => { }; // No-op unsubscribe
|
|
203765
|
-
}
|
|
203766
203520
|
const fn = $parseExpr();
|
|
203767
|
-
|
|
203768
|
-
|
|
203769
|
-
const destroyFn = () => $unwatch(identifier);
|
|
203770
|
-
const watchInfo = {
|
|
203771
|
-
fn: fn.bind(null, $scope, $locals),
|
|
203521
|
+
registry.set(identifier, {
|
|
203522
|
+
fn: fn.bind(expr, $scope, $locals),
|
|
203772
203523
|
listener,
|
|
203773
203524
|
expr,
|
|
203774
203525
|
last: FIRST_TIME_WATCH,
|
|
203775
203526
|
doNotClone,
|
|
203776
|
-
isMuted
|
|
203777
|
-
|
|
203778
|
-
|
|
203779
|
-
destroyFn
|
|
203780
|
-
};
|
|
203781
|
-
// Store in registry
|
|
203782
|
-
const widgetId = getWidgetId(identifier);
|
|
203783
|
-
if (widgetId) {
|
|
203784
|
-
const propertyName = getPropertyName(identifier);
|
|
203785
|
-
if (!registry.has(widgetId)) {
|
|
203786
|
-
registry.set(widgetId, {});
|
|
203787
|
-
}
|
|
203788
|
-
const widgetGroup = registry.get(widgetId);
|
|
203789
|
-
widgetGroup[propertyName] = watchInfo;
|
|
203790
|
-
}
|
|
203791
|
-
else {
|
|
203792
|
-
registry.set(identifier, watchInfo);
|
|
203793
|
-
}
|
|
203794
|
-
return destroyFn;
|
|
203527
|
+
isMuted: isMuted
|
|
203528
|
+
});
|
|
203529
|
+
return () => $unwatch(identifier);
|
|
203795
203530
|
};
|
|
203796
|
-
|
|
203797
|
-
|
|
203798
|
-
|
|
203799
|
-
const $
|
|
203800
|
-
|
|
203801
|
-
|
|
203802
|
-
|
|
203803
|
-
|
|
203804
|
-
|
|
203805
|
-
|
|
203806
|
-
|
|
203807
|
-
if (watchInfo) {
|
|
203808
|
-
delete widgetGroup[propertyName];
|
|
203809
|
-
// Clean up empty widget groups
|
|
203810
|
-
if (Object.keys(widgetGroup).length === 0) {
|
|
203811
|
-
registry.delete(widgetId);
|
|
203812
|
-
}
|
|
203813
|
-
return true;
|
|
203814
|
-
}
|
|
203531
|
+
const $unwatch = identifier => registry.delete(identifier);
|
|
203532
|
+
window.watchRegistry = registry;
|
|
203533
|
+
window.__WM_DEBUG_WATCHERS__ = false;
|
|
203534
|
+
/*export const $invokeWatchers = (force?: boolean, ignoreMuted?: boolean) => {
|
|
203535
|
+
if (force) {
|
|
203536
|
+
triggerWatchers(ignoreMuted);
|
|
203537
|
+
} else {
|
|
203538
|
+
|
|
203539
|
+
if (skipWatchers) {
|
|
203540
|
+
skipWatchers = false;
|
|
203541
|
+
return;
|
|
203815
203542
|
}
|
|
203543
|
+
debouncedTriggerWatchers();
|
|
203816
203544
|
}
|
|
203817
|
-
|
|
203818
|
-
if (registry.has(identifier)) {
|
|
203819
|
-
registry.delete(identifier);
|
|
203820
|
-
return true;
|
|
203821
|
-
}
|
|
203822
|
-
return false;
|
|
203823
|
-
};
|
|
203545
|
+
};*/
|
|
203824
203546
|
const $appDigest = (() => {
|
|
203825
|
-
return (force
|
|
203547
|
+
return (force) => {
|
|
203826
203548
|
{
|
|
203827
203549
|
return;
|
|
203828
203550
|
}
|
|
203829
203551
|
};
|
|
203830
203552
|
})();
|
|
203831
|
-
// Export registry for debugging
|
|
203832
|
-
window.watchRegistry = registry;
|
|
203833
203553
|
|
|
203834
203554
|
var ComponentType;
|
|
203835
203555
|
(function (ComponentType) {
|