@wavemaker/angular-app 11.14.2-1.6424 → 11.14.2-2.6435
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 +96 -370
- package/dependencies/transpilation-web.cjs.js +48 -185
- package/dependency-report.html +1 -1
- package/npm-shrinkwrap.json +361 -330
- package/package-lock.json +361 -330
- 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
|
});
|
|
@@ -147861,220 +147861,83 @@ const getFnForEventExpr$1 = (expr) => {
|
|
|
147861
147861
|
return fnExecutor$1(expr, ExpressionType$2.Action);
|
|
147862
147862
|
};
|
|
147863
147863
|
|
|
147864
|
-
// Constants
|
|
147865
|
-
const WIDGET_ID_REGEX$1 = /^(widget-[^_]+)/;
|
|
147866
|
-
const WIDGET_PROPERTY_REGEX$1 = /^widget-[^_]+_(.+)$/;
|
|
147867
|
-
const ARRAY_INDEX_PLACEHOLDER$1 = '[$i]';
|
|
147868
|
-
const ARRAY_INDEX_ZERO$1 = '[0]';
|
|
147869
147864
|
const registry$1 = new Map();
|
|
147870
147865
|
const watchIdGenerator$1 = new IDGenerator$1('watch-id-');
|
|
147871
|
-
const FIRST_TIME_WATCH$1 =
|
|
147872
|
-
|
|
147873
|
-
* Extracts widget ID from identifier (e.g., "widget-id23_eventsource" -> "widget-id23")
|
|
147874
|
-
*/
|
|
147875
|
-
const getWidgetId$1 = (identifier) => {
|
|
147876
|
-
if (!identifier || typeof identifier !== 'string') {
|
|
147877
|
-
return null;
|
|
147878
|
-
}
|
|
147879
|
-
const match = identifier.match(WIDGET_ID_REGEX$1);
|
|
147880
|
-
return match ? match[1] : null;
|
|
147881
|
-
};
|
|
147882
|
-
/**
|
|
147883
|
-
* Extracts property name from identifier (e.g., "widget-id23_eventsource" -> "eventsource")
|
|
147884
|
-
*/
|
|
147885
|
-
const getPropertyName$1 = (identifier) => {
|
|
147886
|
-
if (!identifier || typeof identifier !== 'string') {
|
|
147887
|
-
return identifier;
|
|
147888
|
-
}
|
|
147889
|
-
const match = identifier.match(WIDGET_PROPERTY_REGEX$1);
|
|
147890
|
-
return match ? match[1] : identifier;
|
|
147891
|
-
};
|
|
147892
|
-
/**
|
|
147893
|
-
* Array consumer wrapper for array-based expressions
|
|
147894
|
-
*/
|
|
147866
|
+
const FIRST_TIME_WATCH$1 = {};
|
|
147867
|
+
Object.freeze(FIRST_TIME_WATCH$1);
|
|
147895
147868
|
const arrayConsumer$1 = (listenerFn, restExpr, newVal, oldVal) => {
|
|
147896
|
-
|
|
147897
|
-
|
|
147898
|
-
|
|
147899
|
-
|
|
147900
|
-
|
|
147901
|
-
|
|
147902
|
-
|
|
147869
|
+
let data = newVal, formattedData;
|
|
147870
|
+
if (isArray$1(data)) {
|
|
147871
|
+
formattedData = data.map(function (datum) {
|
|
147872
|
+
return findValueOf$1(datum, restExpr);
|
|
147873
|
+
});
|
|
147874
|
+
// If resulting structure is an array of array, flatten it
|
|
147875
|
+
if (isArray$1(formattedData[0])) {
|
|
147876
|
+
formattedData = flatten$2(formattedData);
|
|
147877
|
+
}
|
|
147878
|
+
listenerFn(formattedData, oldVal);
|
|
147903
147879
|
}
|
|
147904
|
-
listenerFn(formattedData, oldVal);
|
|
147905
147880
|
};
|
|
147906
|
-
|
|
147907
|
-
|
|
147908
|
-
|
|
147909
|
-
|
|
147910
|
-
const regex = /\[\$i\]/g;
|
|
147881
|
+
const getUpdatedWatcInfo$1 = (expr, acceptsArray, listener) => {
|
|
147882
|
+
// listener doesn't accept array
|
|
147883
|
+
// replace all `[$i]` with `[0]` and return the expression
|
|
147884
|
+
let regex = /\[\$i\]/g, $I = '[$i]', $0 = '[0]';
|
|
147911
147885
|
if (!acceptsArray) {
|
|
147912
147886
|
return {
|
|
147913
|
-
expr: expr.replace(regex,
|
|
147914
|
-
listener
|
|
147887
|
+
'expr': expr.replace(regex, $0),
|
|
147888
|
+
'listener': listener
|
|
147915
147889
|
};
|
|
147916
147890
|
}
|
|
147917
|
-
|
|
147918
|
-
|
|
147919
|
-
|
|
147920
|
-
|
|
147921
|
-
|
|
147922
|
-
|
|
147891
|
+
// listener accepts array
|
|
147892
|
+
// replace all except the last `[$i]` with `[0]` and return the expression.
|
|
147893
|
+
var index = expr.lastIndexOf($I), _expr = expr.substr(0, index).replace($I, $0), restExpr = expr.substr(index + 5), arrayConsumerFn = listener;
|
|
147894
|
+
if (restExpr) {
|
|
147895
|
+
arrayConsumerFn = arrayConsumer$1.bind(undefined, listener, restExpr);
|
|
147896
|
+
}
|
|
147923
147897
|
return {
|
|
147924
|
-
expr:
|
|
147925
|
-
listener: arrayConsumerFn
|
|
147898
|
+
'expr': _expr,
|
|
147899
|
+
'listener': arrayConsumerFn
|
|
147926
147900
|
};
|
|
147927
147901
|
};
|
|
147928
|
-
/**
|
|
147929
|
-
* Determines if an expression is static (doesn't need to be watched)
|
|
147930
|
-
*/
|
|
147931
|
-
const STATIC_EXPRESSION_NAMES$1 = [
|
|
147932
|
-
"row.getProperty('investment')",
|
|
147933
|
-
"row.getProperty('factsheetLink')",
|
|
147934
|
-
"row.getProperty('isRebalanceEligible')"
|
|
147935
|
-
];
|
|
147936
|
-
const isStaticExpression$1 = (expr) => {
|
|
147937
|
-
if (typeof expr !== 'string') {
|
|
147938
|
-
return false;
|
|
147939
|
-
}
|
|
147940
|
-
const trimmedExpr = expr.trim();
|
|
147941
|
-
// Expressions that always evaluate to localization strings
|
|
147942
|
-
// if (trimmedExpr.includes('appLocale')) {
|
|
147943
|
-
// return true;
|
|
147944
|
-
// }
|
|
147945
|
-
// Hard-coded static expression names
|
|
147946
|
-
if (STATIC_EXPRESSION_NAMES$1.includes(trimmedExpr)) {
|
|
147947
|
-
return true;
|
|
147948
|
-
}
|
|
147949
|
-
return false;
|
|
147950
|
-
};
|
|
147951
|
-
/**
|
|
147952
|
-
* Gets the scope type from the scope object
|
|
147953
|
-
*/
|
|
147954
|
-
const getScopeType$1 = ($scope) => {
|
|
147955
|
-
if (!$scope) {
|
|
147956
|
-
return null;
|
|
147957
|
-
}
|
|
147958
|
-
if ($scope.pageName)
|
|
147959
|
-
return 'Page';
|
|
147960
|
-
if ($scope.prefabName)
|
|
147961
|
-
return 'Prefab';
|
|
147962
|
-
if ($scope.partialName)
|
|
147963
|
-
return 'Partial';
|
|
147964
|
-
// Check for App scope
|
|
147965
|
-
if ($scope.Variables !== undefined &&
|
|
147966
|
-
$scope.Actions !== undefined &&
|
|
147967
|
-
!$scope.pageName &&
|
|
147968
|
-
!$scope.prefabName &&
|
|
147969
|
-
!$scope.partialName) {
|
|
147970
|
-
return 'App';
|
|
147971
|
-
}
|
|
147972
|
-
if ($scope.constructor?.name === 'AppRef') {
|
|
147973
|
-
return 'App';
|
|
147974
|
-
}
|
|
147975
|
-
return null;
|
|
147976
|
-
};
|
|
147977
|
-
/**
|
|
147978
|
-
* Gets scope name based on scope type
|
|
147979
|
-
*/
|
|
147980
|
-
const getScopeName$1 = ($scope, scopeType) => {
|
|
147981
|
-
if (!scopeType || !$scope) {
|
|
147982
|
-
return null;
|
|
147983
|
-
}
|
|
147984
|
-
switch (scopeType) {
|
|
147985
|
-
case 'Prefab': return $scope.prefabName || null;
|
|
147986
|
-
case 'Partial': return $scope.partialName || null;
|
|
147987
|
-
case 'Page': return $scope.pageName || null;
|
|
147988
|
-
default: return null;
|
|
147989
|
-
}
|
|
147990
|
-
};
|
|
147991
|
-
/**
|
|
147992
|
-
* Main watch function
|
|
147993
|
-
*/
|
|
147994
147902
|
const $watch$1 = (expr, $scope, $locals, listener, identifier = watchIdGenerator$1.nextUid(), doNotClone = false, config = {}, isMuted) => {
|
|
147995
|
-
|
|
147996
|
-
|
|
147997
|
-
const watchInfo = getUpdatedWatchInfo$1(expr, config.arrayType || config.isList || false, listener);
|
|
147903
|
+
if (expr.indexOf('[$i]') !== -1) {
|
|
147904
|
+
let watchInfo = getUpdatedWatcInfo$1(expr, config && (config.arrayType || config.isList), listener);
|
|
147998
147905
|
expr = watchInfo.expr;
|
|
147999
147906
|
listener = watchInfo.listener;
|
|
148000
147907
|
}
|
|
148001
|
-
// Handle static expressions
|
|
148002
|
-
if (isStaticExpression$1(expr)) {
|
|
148003
|
-
try {
|
|
148004
|
-
const fn = $parseExpr$1(expr);
|
|
148005
|
-
const staticValue = fn($scope, $locals);
|
|
148006
|
-
listener(staticValue, FIRST_TIME_WATCH$1);
|
|
148007
|
-
}
|
|
148008
|
-
catch (e) {
|
|
148009
|
-
console.warn(`Error evaluating static expression '${expr}':`, e);
|
|
148010
|
-
listener(undefined, FIRST_TIME_WATCH$1);
|
|
148011
|
-
}
|
|
148012
|
-
return () => { }; // No-op unsubscribe
|
|
148013
|
-
}
|
|
148014
147908
|
const fn = $parseExpr$1();
|
|
148015
|
-
|
|
148016
|
-
|
|
148017
|
-
const watchInfo = {
|
|
148018
|
-
fn: fn.bind(null, $scope, $locals),
|
|
147909
|
+
registry$1.set(identifier, {
|
|
147910
|
+
fn: fn.bind(expr, $scope, $locals),
|
|
148019
147911
|
listener,
|
|
148020
147912
|
expr,
|
|
148021
147913
|
last: FIRST_TIME_WATCH$1,
|
|
148022
147914
|
doNotClone,
|
|
148023
|
-
isMuted
|
|
148024
|
-
|
|
148025
|
-
scopeName
|
|
148026
|
-
};
|
|
148027
|
-
// Store in registry
|
|
148028
|
-
const widgetId = getWidgetId$1(identifier);
|
|
148029
|
-
if (widgetId) {
|
|
148030
|
-
const propertyName = getPropertyName$1(identifier);
|
|
148031
|
-
if (!registry$1.has(widgetId)) {
|
|
148032
|
-
registry$1.set(widgetId, {});
|
|
148033
|
-
}
|
|
148034
|
-
const widgetGroup = registry$1.get(widgetId);
|
|
148035
|
-
widgetGroup[propertyName] = watchInfo;
|
|
148036
|
-
}
|
|
148037
|
-
else {
|
|
148038
|
-
registry$1.set(identifier, watchInfo);
|
|
148039
|
-
}
|
|
147915
|
+
isMuted: isMuted
|
|
147916
|
+
});
|
|
148040
147917
|
return () => $unwatch$1(identifier);
|
|
148041
147918
|
};
|
|
148042
|
-
|
|
148043
|
-
|
|
148044
|
-
|
|
148045
|
-
const $
|
|
148046
|
-
|
|
148047
|
-
|
|
148048
|
-
|
|
148049
|
-
|
|
148050
|
-
if (
|
|
148051
|
-
|
|
148052
|
-
|
|
148053
|
-
delete widgetGroup[propertyName];
|
|
148054
|
-
// Clean up empty widget groups
|
|
148055
|
-
if (Object.keys(widgetGroup).length === 0) {
|
|
148056
|
-
registry$1.delete(widgetId);
|
|
148057
|
-
}
|
|
148058
|
-
return true;
|
|
148059
|
-
}
|
|
147919
|
+
const $unwatch$1 = identifier => registry$1.delete(identifier);
|
|
147920
|
+
window.watchRegistry = registry$1;
|
|
147921
|
+
window.__WM_DEBUG_WATCHERS__ = false;
|
|
147922
|
+
/*export const $invokeWatchers = (force?: boolean, ignoreMuted?: boolean) => {
|
|
147923
|
+
if (force) {
|
|
147924
|
+
triggerWatchers(ignoreMuted);
|
|
147925
|
+
} else {
|
|
147926
|
+
|
|
147927
|
+
if (skipWatchers) {
|
|
147928
|
+
skipWatchers = false;
|
|
147929
|
+
return;
|
|
148060
147930
|
}
|
|
147931
|
+
debouncedTriggerWatchers();
|
|
148061
147932
|
}
|
|
148062
|
-
|
|
148063
|
-
if (registry$1.has(identifier)) {
|
|
148064
|
-
registry$1.delete(identifier);
|
|
148065
|
-
return true;
|
|
148066
|
-
}
|
|
148067
|
-
return false;
|
|
148068
|
-
};
|
|
147933
|
+
};*/
|
|
148069
147934
|
const $appDigest$1 = (() => {
|
|
148070
|
-
return (force
|
|
147935
|
+
return (force) => {
|
|
148071
147936
|
{
|
|
148072
147937
|
return;
|
|
148073
147938
|
}
|
|
148074
147939
|
};
|
|
148075
147940
|
})();
|
|
148076
|
-
// Export registry for debugging
|
|
148077
|
-
window.watchRegistry = registry$1;
|
|
148078
147941
|
|
|
148079
147942
|
var ComponentType$1;
|
|
148080
147943
|
(function (ComponentType) {
|
|
@@ -203097,11 +202960,11 @@ var DEFAULT_FORMATS;
|
|
|
203097
202960
|
DEFAULT_FORMATS["DATE_TIME"] = "yyyy-MM-dd HH:mm:ss";
|
|
203098
202961
|
})(DEFAULT_FORMATS || (DEFAULT_FORMATS = {}));
|
|
203099
202962
|
|
|
203100
|
-
const $RAF = window.requestAnimationFrame;
|
|
202963
|
+
const $RAF$1 = window.requestAnimationFrame;
|
|
203101
202964
|
const $RAFQueue = [];
|
|
203102
202965
|
const invokeLater = fn => {
|
|
203103
202966
|
if (!$RAFQueue.length) {
|
|
203104
|
-
$RAF(() => {
|
|
202967
|
+
$RAF$1(() => {
|
|
203105
202968
|
$RAFQueue.forEach(f => f());
|
|
203106
202969
|
$RAFQueue.length = 0;
|
|
203107
202970
|
});
|
|
@@ -203659,220 +203522,83 @@ const getFnForEventExpr = (expr) => {
|
|
|
203659
203522
|
return fnExecutor(expr, ExpressionType.Action);
|
|
203660
203523
|
};
|
|
203661
203524
|
|
|
203662
|
-
// Constants
|
|
203663
|
-
const WIDGET_ID_REGEX = /^(widget-[^_]+)/;
|
|
203664
|
-
const WIDGET_PROPERTY_REGEX = /^widget-[^_]+_(.+)$/;
|
|
203665
|
-
const ARRAY_INDEX_PLACEHOLDER = '[$i]';
|
|
203666
|
-
const ARRAY_INDEX_ZERO = '[0]';
|
|
203667
203525
|
const registry = new Map();
|
|
203668
203526
|
const watchIdGenerator = new IDGenerator('watch-id-');
|
|
203669
|
-
const FIRST_TIME_WATCH =
|
|
203670
|
-
|
|
203671
|
-
* Extracts widget ID from identifier (e.g., "widget-id23_eventsource" -> "widget-id23")
|
|
203672
|
-
*/
|
|
203673
|
-
const getWidgetId = (identifier) => {
|
|
203674
|
-
if (!identifier || typeof identifier !== 'string') {
|
|
203675
|
-
return null;
|
|
203676
|
-
}
|
|
203677
|
-
const match = identifier.match(WIDGET_ID_REGEX);
|
|
203678
|
-
return match ? match[1] : null;
|
|
203679
|
-
};
|
|
203680
|
-
/**
|
|
203681
|
-
* Extracts property name from identifier (e.g., "widget-id23_eventsource" -> "eventsource")
|
|
203682
|
-
*/
|
|
203683
|
-
const getPropertyName = (identifier) => {
|
|
203684
|
-
if (!identifier || typeof identifier !== 'string') {
|
|
203685
|
-
return identifier;
|
|
203686
|
-
}
|
|
203687
|
-
const match = identifier.match(WIDGET_PROPERTY_REGEX);
|
|
203688
|
-
return match ? match[1] : identifier;
|
|
203689
|
-
};
|
|
203690
|
-
/**
|
|
203691
|
-
* Array consumer wrapper for array-based expressions
|
|
203692
|
-
*/
|
|
203527
|
+
const FIRST_TIME_WATCH = {};
|
|
203528
|
+
Object.freeze(FIRST_TIME_WATCH);
|
|
203693
203529
|
const arrayConsumer = (listenerFn, restExpr, newVal, oldVal) => {
|
|
203694
|
-
|
|
203695
|
-
|
|
203696
|
-
|
|
203697
|
-
|
|
203698
|
-
|
|
203699
|
-
|
|
203700
|
-
|
|
203530
|
+
let data = newVal, formattedData;
|
|
203531
|
+
if (isArray(data)) {
|
|
203532
|
+
formattedData = data.map(function (datum) {
|
|
203533
|
+
return findValueOf(datum, restExpr);
|
|
203534
|
+
});
|
|
203535
|
+
// If resulting structure is an array of array, flatten it
|
|
203536
|
+
if (isArray(formattedData[0])) {
|
|
203537
|
+
formattedData = flatten(formattedData);
|
|
203538
|
+
}
|
|
203539
|
+
listenerFn(formattedData, oldVal);
|
|
203701
203540
|
}
|
|
203702
|
-
listenerFn(formattedData, oldVal);
|
|
203703
203541
|
};
|
|
203704
|
-
|
|
203705
|
-
|
|
203706
|
-
|
|
203707
|
-
|
|
203708
|
-
const regex = /\[\$i\]/g;
|
|
203542
|
+
const getUpdatedWatcInfo = (expr, acceptsArray, listener) => {
|
|
203543
|
+
// listener doesn't accept array
|
|
203544
|
+
// replace all `[$i]` with `[0]` and return the expression
|
|
203545
|
+
let regex = /\[\$i\]/g, $I = '[$i]', $0 = '[0]';
|
|
203709
203546
|
if (!acceptsArray) {
|
|
203710
203547
|
return {
|
|
203711
|
-
expr: expr.replace(regex,
|
|
203712
|
-
listener
|
|
203548
|
+
'expr': expr.replace(regex, $0),
|
|
203549
|
+
'listener': listener
|
|
203713
203550
|
};
|
|
203714
203551
|
}
|
|
203715
|
-
|
|
203716
|
-
|
|
203717
|
-
|
|
203718
|
-
|
|
203719
|
-
|
|
203720
|
-
|
|
203552
|
+
// listener accepts array
|
|
203553
|
+
// replace all except the last `[$i]` with `[0]` and return the expression.
|
|
203554
|
+
var index = expr.lastIndexOf($I), _expr = expr.substr(0, index).replace($I, $0), restExpr = expr.substr(index + 5), arrayConsumerFn = listener;
|
|
203555
|
+
if (restExpr) {
|
|
203556
|
+
arrayConsumerFn = arrayConsumer.bind(undefined, listener, restExpr);
|
|
203557
|
+
}
|
|
203721
203558
|
return {
|
|
203722
|
-
expr:
|
|
203723
|
-
listener: arrayConsumerFn
|
|
203559
|
+
'expr': _expr,
|
|
203560
|
+
'listener': arrayConsumerFn
|
|
203724
203561
|
};
|
|
203725
203562
|
};
|
|
203726
|
-
/**
|
|
203727
|
-
* Determines if an expression is static (doesn't need to be watched)
|
|
203728
|
-
*/
|
|
203729
|
-
const STATIC_EXPRESSION_NAMES = [
|
|
203730
|
-
"row.getProperty('investment')",
|
|
203731
|
-
"row.getProperty('factsheetLink')",
|
|
203732
|
-
"row.getProperty('isRebalanceEligible')"
|
|
203733
|
-
];
|
|
203734
|
-
const isStaticExpression = (expr) => {
|
|
203735
|
-
if (typeof expr !== 'string') {
|
|
203736
|
-
return false;
|
|
203737
|
-
}
|
|
203738
|
-
const trimmedExpr = expr.trim();
|
|
203739
|
-
// Expressions that always evaluate to localization strings
|
|
203740
|
-
// if (trimmedExpr.includes('appLocale')) {
|
|
203741
|
-
// return true;
|
|
203742
|
-
// }
|
|
203743
|
-
// Hard-coded static expression names
|
|
203744
|
-
if (STATIC_EXPRESSION_NAMES.includes(trimmedExpr)) {
|
|
203745
|
-
return true;
|
|
203746
|
-
}
|
|
203747
|
-
return false;
|
|
203748
|
-
};
|
|
203749
|
-
/**
|
|
203750
|
-
* Gets the scope type from the scope object
|
|
203751
|
-
*/
|
|
203752
|
-
const getScopeType = ($scope) => {
|
|
203753
|
-
if (!$scope) {
|
|
203754
|
-
return null;
|
|
203755
|
-
}
|
|
203756
|
-
if ($scope.pageName)
|
|
203757
|
-
return 'Page';
|
|
203758
|
-
if ($scope.prefabName)
|
|
203759
|
-
return 'Prefab';
|
|
203760
|
-
if ($scope.partialName)
|
|
203761
|
-
return 'Partial';
|
|
203762
|
-
// Check for App scope
|
|
203763
|
-
if ($scope.Variables !== undefined &&
|
|
203764
|
-
$scope.Actions !== undefined &&
|
|
203765
|
-
!$scope.pageName &&
|
|
203766
|
-
!$scope.prefabName &&
|
|
203767
|
-
!$scope.partialName) {
|
|
203768
|
-
return 'App';
|
|
203769
|
-
}
|
|
203770
|
-
if ($scope.constructor?.name === 'AppRef') {
|
|
203771
|
-
return 'App';
|
|
203772
|
-
}
|
|
203773
|
-
return null;
|
|
203774
|
-
};
|
|
203775
|
-
/**
|
|
203776
|
-
* Gets scope name based on scope type
|
|
203777
|
-
*/
|
|
203778
|
-
const getScopeName = ($scope, scopeType) => {
|
|
203779
|
-
if (!scopeType || !$scope) {
|
|
203780
|
-
return null;
|
|
203781
|
-
}
|
|
203782
|
-
switch (scopeType) {
|
|
203783
|
-
case 'Prefab': return $scope.prefabName || null;
|
|
203784
|
-
case 'Partial': return $scope.partialName || null;
|
|
203785
|
-
case 'Page': return $scope.pageName || null;
|
|
203786
|
-
default: return null;
|
|
203787
|
-
}
|
|
203788
|
-
};
|
|
203789
|
-
/**
|
|
203790
|
-
* Main watch function
|
|
203791
|
-
*/
|
|
203792
203563
|
const $watch = (expr, $scope, $locals, listener, identifier = watchIdGenerator.nextUid(), doNotClone = false, config = {}, isMuted) => {
|
|
203793
|
-
|
|
203794
|
-
|
|
203795
|
-
const watchInfo = getUpdatedWatchInfo(expr, config.arrayType || config.isList || false, listener);
|
|
203564
|
+
if (expr.indexOf('[$i]') !== -1) {
|
|
203565
|
+
let watchInfo = getUpdatedWatcInfo(expr, config && (config.arrayType || config.isList), listener);
|
|
203796
203566
|
expr = watchInfo.expr;
|
|
203797
203567
|
listener = watchInfo.listener;
|
|
203798
203568
|
}
|
|
203799
|
-
// Handle static expressions
|
|
203800
|
-
if (isStaticExpression(expr)) {
|
|
203801
|
-
try {
|
|
203802
|
-
const fn = $parseExpr(expr);
|
|
203803
|
-
const staticValue = fn($scope, $locals);
|
|
203804
|
-
listener(staticValue, FIRST_TIME_WATCH);
|
|
203805
|
-
}
|
|
203806
|
-
catch (e) {
|
|
203807
|
-
console.warn(`Error evaluating static expression '${expr}':`, e);
|
|
203808
|
-
listener(undefined, FIRST_TIME_WATCH);
|
|
203809
|
-
}
|
|
203810
|
-
return () => { }; // No-op unsubscribe
|
|
203811
|
-
}
|
|
203812
203569
|
const fn = $parseExpr();
|
|
203813
|
-
|
|
203814
|
-
|
|
203815
|
-
const watchInfo = {
|
|
203816
|
-
fn: fn.bind(null, $scope, $locals),
|
|
203570
|
+
registry.set(identifier, {
|
|
203571
|
+
fn: fn.bind(expr, $scope, $locals),
|
|
203817
203572
|
listener,
|
|
203818
203573
|
expr,
|
|
203819
203574
|
last: FIRST_TIME_WATCH,
|
|
203820
203575
|
doNotClone,
|
|
203821
|
-
isMuted
|
|
203822
|
-
|
|
203823
|
-
scopeName
|
|
203824
|
-
};
|
|
203825
|
-
// Store in registry
|
|
203826
|
-
const widgetId = getWidgetId(identifier);
|
|
203827
|
-
if (widgetId) {
|
|
203828
|
-
const propertyName = getPropertyName(identifier);
|
|
203829
|
-
if (!registry.has(widgetId)) {
|
|
203830
|
-
registry.set(widgetId, {});
|
|
203831
|
-
}
|
|
203832
|
-
const widgetGroup = registry.get(widgetId);
|
|
203833
|
-
widgetGroup[propertyName] = watchInfo;
|
|
203834
|
-
}
|
|
203835
|
-
else {
|
|
203836
|
-
registry.set(identifier, watchInfo);
|
|
203837
|
-
}
|
|
203576
|
+
isMuted: isMuted
|
|
203577
|
+
});
|
|
203838
203578
|
return () => $unwatch(identifier);
|
|
203839
203579
|
};
|
|
203840
|
-
|
|
203841
|
-
|
|
203842
|
-
|
|
203843
|
-
const $
|
|
203844
|
-
|
|
203845
|
-
|
|
203846
|
-
|
|
203847
|
-
|
|
203848
|
-
if (
|
|
203849
|
-
|
|
203850
|
-
|
|
203851
|
-
delete widgetGroup[propertyName];
|
|
203852
|
-
// Clean up empty widget groups
|
|
203853
|
-
if (Object.keys(widgetGroup).length === 0) {
|
|
203854
|
-
registry.delete(widgetId);
|
|
203855
|
-
}
|
|
203856
|
-
return true;
|
|
203857
|
-
}
|
|
203580
|
+
const $unwatch = identifier => registry.delete(identifier);
|
|
203581
|
+
window.watchRegistry = registry;
|
|
203582
|
+
window.__WM_DEBUG_WATCHERS__ = false;
|
|
203583
|
+
/*export const $invokeWatchers = (force?: boolean, ignoreMuted?: boolean) => {
|
|
203584
|
+
if (force) {
|
|
203585
|
+
triggerWatchers(ignoreMuted);
|
|
203586
|
+
} else {
|
|
203587
|
+
|
|
203588
|
+
if (skipWatchers) {
|
|
203589
|
+
skipWatchers = false;
|
|
203590
|
+
return;
|
|
203858
203591
|
}
|
|
203592
|
+
debouncedTriggerWatchers();
|
|
203859
203593
|
}
|
|
203860
|
-
|
|
203861
|
-
if (registry.has(identifier)) {
|
|
203862
|
-
registry.delete(identifier);
|
|
203863
|
-
return true;
|
|
203864
|
-
}
|
|
203865
|
-
return false;
|
|
203866
|
-
};
|
|
203594
|
+
};*/
|
|
203867
203595
|
const $appDigest = (() => {
|
|
203868
|
-
return (force
|
|
203596
|
+
return (force) => {
|
|
203869
203597
|
{
|
|
203870
203598
|
return;
|
|
203871
203599
|
}
|
|
203872
203600
|
};
|
|
203873
203601
|
})();
|
|
203874
|
-
// Export registry for debugging
|
|
203875
|
-
window.watchRegistry = registry;
|
|
203876
203602
|
|
|
203877
203603
|
var ComponentType;
|
|
203878
203604
|
(function (ComponentType) {
|