@rs-x/expression-parser 0.4.10 → 0.4.12
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/dist/index.d.ts +166 -125
- package/dist/index.js +1107 -908
- package/package.json +3 -3
- package/readme.md +2241 -1711
package/dist/index.js
CHANGED
|
@@ -8213,9 +8213,9 @@ var require_estraverse = __commonJS({
|
|
|
8213
8213
|
});
|
|
8214
8214
|
|
|
8215
8215
|
// lib/expresion-change-transaction-manager.ts
|
|
8216
|
+
import { Subject } from "rxjs";
|
|
8216
8217
|
import { Inject, Injectable, PreDestroy } from "@rs-x/core";
|
|
8217
8218
|
import { RsXStateManagerInjectionTokens } from "@rs-x/state-manager";
|
|
8218
|
-
import { Subject } from "rxjs";
|
|
8219
8219
|
function _ts_decorate(decorators, target, key, desc) {
|
|
8220
8220
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8221
8221
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8319,8 +8319,8 @@ ExpressionChangeTransactionManager = _ts_decorate([
|
|
|
8319
8319
|
])
|
|
8320
8320
|
], ExpressionChangeTransactionManager);
|
|
8321
8321
|
|
|
8322
|
-
// lib/expression-
|
|
8323
|
-
import { Inject as Inject2, Injectable as Injectable2 } from "@rs-x/core";
|
|
8322
|
+
// lib/expression-cache/expression-cache.ts
|
|
8323
|
+
import { Inject as Inject2, Injectable as Injectable2, SingletonFactory } from "@rs-x/core";
|
|
8324
8324
|
|
|
8325
8325
|
// lib/rs-x-expression-parser-injection-tokes.ts
|
|
8326
8326
|
var RsXExpressionParserInjectionTokens = {
|
|
@@ -8335,10 +8335,13 @@ var RsXExpressionParserInjectionTokens = {
|
|
|
8335
8335
|
IExpressionFactory: Symbol("IExpressionFactory"),
|
|
8336
8336
|
IExpressionObserverProxyPairFactory: Symbol("IExpressionObserverProxyPairFactory"),
|
|
8337
8337
|
IExpressionIndexAccessor: Symbol("IExpressionIndexAccessor"),
|
|
8338
|
-
IExpressionObserverFactory: Symbol("IExpressionObserverFactory")
|
|
8338
|
+
IExpressionObserverFactory: Symbol("IExpressionObserverFactory"),
|
|
8339
|
+
IExpressionCache: Symbol("IExpressionCache"),
|
|
8340
|
+
IExpressionServices: Symbol("IExpressionServices"),
|
|
8341
|
+
ExpressiomMetadata: Symbol("ExpressiomMetadata")
|
|
8339
8342
|
};
|
|
8340
8343
|
|
|
8341
|
-
// lib/expression-
|
|
8344
|
+
// lib/expression-cache/expression-cache.ts
|
|
8342
8345
|
function _ts_decorate2(decorators, target, key, desc) {
|
|
8343
8346
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8344
8347
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8356,29 +8359,40 @@ function _ts_param2(paramIndex, decorator) {
|
|
|
8356
8359
|
};
|
|
8357
8360
|
}
|
|
8358
8361
|
__name(_ts_param2, "_ts_param");
|
|
8359
|
-
var
|
|
8362
|
+
var ExpressionCache = class extends SingletonFactory {
|
|
8360
8363
|
static {
|
|
8361
|
-
__name(this, "
|
|
8364
|
+
__name(this, "ExpressionCache");
|
|
8362
8365
|
}
|
|
8363
|
-
|
|
8364
|
-
constructor(
|
|
8365
|
-
this.
|
|
8366
|
+
_expressionParser;
|
|
8367
|
+
constructor(_expressionParser) {
|
|
8368
|
+
super(), this._expressionParser = _expressionParser;
|
|
8369
|
+
}
|
|
8370
|
+
getId(expressionString) {
|
|
8371
|
+
return expressionString;
|
|
8372
|
+
}
|
|
8373
|
+
createId(expressionString) {
|
|
8374
|
+
return expressionString;
|
|
8375
|
+
}
|
|
8376
|
+
create(data2) {
|
|
8377
|
+
const result = super.create(data2);
|
|
8378
|
+
result.instance = result.instance.clone();
|
|
8379
|
+
return result;
|
|
8366
8380
|
}
|
|
8367
|
-
|
|
8368
|
-
return this.
|
|
8381
|
+
createInstance(expressionString) {
|
|
8382
|
+
return this._expressionParser.parse(expressionString);
|
|
8369
8383
|
}
|
|
8370
8384
|
};
|
|
8371
|
-
|
|
8385
|
+
ExpressionCache = _ts_decorate2([
|
|
8372
8386
|
Injectable2(),
|
|
8373
|
-
_ts_param2(0, Inject2(RsXExpressionParserInjectionTokens.
|
|
8387
|
+
_ts_param2(0, Inject2(RsXExpressionParserInjectionTokens.IExpressionParser)),
|
|
8374
8388
|
_ts_metadata2("design:type", Function),
|
|
8375
8389
|
_ts_metadata2("design:paramtypes", [
|
|
8376
|
-
typeof
|
|
8390
|
+
typeof IExpressionParser === "undefined" ? Object : IExpressionParser
|
|
8377
8391
|
])
|
|
8378
|
-
],
|
|
8392
|
+
], ExpressionCache);
|
|
8379
8393
|
|
|
8380
|
-
// lib/expression-factory/expression-
|
|
8381
|
-
import { Inject as Inject3, Injectable as Injectable3
|
|
8394
|
+
// lib/expression-factory/expression-factory.ts
|
|
8395
|
+
import { Inject as Inject3, Injectable as Injectable3 } from "@rs-x/core";
|
|
8382
8396
|
function _ts_decorate3(decorators, target, key, desc) {
|
|
8383
8397
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8384
8398
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8396,67 +8410,126 @@ function _ts_param3(paramIndex, decorator) {
|
|
|
8396
8410
|
};
|
|
8397
8411
|
}
|
|
8398
8412
|
__name(_ts_param3, "_ts_param");
|
|
8399
|
-
var
|
|
8413
|
+
var ExpressionFactory = class {
|
|
8400
8414
|
static {
|
|
8401
|
-
__name(this, "
|
|
8415
|
+
__name(this, "ExpressionFactory");
|
|
8402
8416
|
}
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
constructor(_expressionParser, _context, releaseContext) {
|
|
8407
|
-
super(), this._expressionParser = _expressionParser, this._context = _context, this.releaseContext = releaseContext;
|
|
8417
|
+
_expressionManager;
|
|
8418
|
+
constructor(_expressionManager) {
|
|
8419
|
+
this._expressionManager = _expressionManager;
|
|
8408
8420
|
}
|
|
8409
|
-
|
|
8410
|
-
return
|
|
8421
|
+
create(context, expressionString, leafIndexWatchRule) {
|
|
8422
|
+
return this._expressionManager.create(context).instance.create({
|
|
8423
|
+
expressionString,
|
|
8424
|
+
leafIndexWatchRule
|
|
8425
|
+
}).instance;
|
|
8411
8426
|
}
|
|
8412
|
-
|
|
8413
|
-
|
|
8427
|
+
};
|
|
8428
|
+
ExpressionFactory = _ts_decorate3([
|
|
8429
|
+
Injectable3(),
|
|
8430
|
+
_ts_param3(0, Inject3(RsXExpressionParserInjectionTokens.IExpressionManager)),
|
|
8431
|
+
_ts_metadata3("design:type", Function),
|
|
8432
|
+
_ts_metadata3("design:paramtypes", [
|
|
8433
|
+
typeof IExpressionManager === "undefined" ? Object : IExpressionManager
|
|
8434
|
+
])
|
|
8435
|
+
], ExpressionFactory);
|
|
8436
|
+
|
|
8437
|
+
// lib/expression-factory/expression-manager.ts
|
|
8438
|
+
import { Inject as Inject4, Injectable as Injectable4, SingletonFactory as SingletonFactory2 } from "@rs-x/core";
|
|
8439
|
+
function _ts_decorate4(decorators, target, key, desc) {
|
|
8440
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8441
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
8442
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
8443
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8444
|
+
}
|
|
8445
|
+
__name(_ts_decorate4, "_ts_decorate");
|
|
8446
|
+
function _ts_metadata4(k, v) {
|
|
8447
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
8448
|
+
}
|
|
8449
|
+
__name(_ts_metadata4, "_ts_metadata");
|
|
8450
|
+
function _ts_param4(paramIndex, decorator) {
|
|
8451
|
+
return function(target, key) {
|
|
8452
|
+
decorator(target, key, paramIndex);
|
|
8453
|
+
};
|
|
8454
|
+
}
|
|
8455
|
+
__name(_ts_param4, "_ts_param");
|
|
8456
|
+
var ExpressionForContextManager = class ExpressionForContextManager2 extends SingletonFactory2 {
|
|
8457
|
+
static {
|
|
8458
|
+
__name(this, "ExpressionForContextManager");
|
|
8414
8459
|
}
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8460
|
+
_expressionCache;
|
|
8461
|
+
_services;
|
|
8462
|
+
_context;
|
|
8463
|
+
releaseContext;
|
|
8464
|
+
constructor(_expressionCache, _services, _context, releaseContext) {
|
|
8465
|
+
super(), this._expressionCache = _expressionCache, this._services = _services, this._context = _context, this.releaseContext = releaseContext;
|
|
8466
|
+
}
|
|
8467
|
+
getId(expressionIdData) {
|
|
8468
|
+
return expressionIdData.expressionString;
|
|
8469
|
+
}
|
|
8470
|
+
createId(expressionIdData) {
|
|
8471
|
+
return expressionIdData.expressionString;
|
|
8472
|
+
}
|
|
8473
|
+
create(expressionData) {
|
|
8474
|
+
const result = super.create(expressionData);
|
|
8475
|
+
result.instance.bind({
|
|
8476
|
+
rootContext: this._context,
|
|
8477
|
+
services: this._services,
|
|
8478
|
+
owner: {
|
|
8479
|
+
release: /* @__PURE__ */ __name(() => {
|
|
8480
|
+
this.release(result.id);
|
|
8481
|
+
this._expressionCache.release(result.id);
|
|
8482
|
+
}, "release"),
|
|
8483
|
+
canDispose: /* @__PURE__ */ __name(() => this.getReferenceCount(result.id) === 1, "canDispose")
|
|
8484
|
+
},
|
|
8485
|
+
leafIndexWatchRule: expressionData.leafIndexWatchRule
|
|
8419
8486
|
});
|
|
8487
|
+
this._services.transactionManager.commit();
|
|
8488
|
+
return result;
|
|
8420
8489
|
}
|
|
8421
8490
|
onReleased() {
|
|
8422
|
-
|
|
8423
|
-
|
|
8424
|
-
|
|
8491
|
+
this.releaseContext();
|
|
8492
|
+
}
|
|
8493
|
+
createInstance(expressionData) {
|
|
8494
|
+
return this._expressionCache.create(expressionData.expressionString).instance;
|
|
8425
8495
|
}
|
|
8426
8496
|
};
|
|
8427
|
-
var ExpressionManager = class extends
|
|
8497
|
+
var ExpressionManager = class extends SingletonFactory2 {
|
|
8428
8498
|
static {
|
|
8429
8499
|
__name(this, "ExpressionManager");
|
|
8430
8500
|
}
|
|
8431
|
-
|
|
8501
|
+
_expressionCache;
|
|
8502
|
+
_services;
|
|
8432
8503
|
getId(context) {
|
|
8433
8504
|
return this.createId(context);
|
|
8434
8505
|
}
|
|
8435
8506
|
createId(context) {
|
|
8436
8507
|
return context;
|
|
8437
8508
|
}
|
|
8438
|
-
constructor(
|
|
8439
|
-
super(), this.
|
|
8509
|
+
constructor(_expressionCache, _services) {
|
|
8510
|
+
super(), this._expressionCache = _expressionCache, this._services = _services;
|
|
8440
8511
|
}
|
|
8441
8512
|
createInstance(context, id) {
|
|
8442
|
-
return new ExpressionForContextManager(this.
|
|
8513
|
+
return new ExpressionForContextManager(this._expressionCache, this._services, context, () => this.release(id));
|
|
8443
8514
|
}
|
|
8444
8515
|
};
|
|
8445
|
-
ExpressionManager =
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8449
|
-
|
|
8450
|
-
|
|
8516
|
+
ExpressionManager = _ts_decorate4([
|
|
8517
|
+
Injectable4(),
|
|
8518
|
+
_ts_param4(0, Inject4(RsXExpressionParserInjectionTokens.IExpressionCache)),
|
|
8519
|
+
_ts_param4(1, Inject4(RsXExpressionParserInjectionTokens.IExpressionServices)),
|
|
8520
|
+
_ts_metadata4("design:type", Function),
|
|
8521
|
+
_ts_metadata4("design:paramtypes", [
|
|
8522
|
+
typeof IExpressionCache === "undefined" ? Object : IExpressionCache,
|
|
8523
|
+
typeof IExpressionServices === "undefined" ? Object : IExpressionServices
|
|
8451
8524
|
])
|
|
8452
8525
|
], ExpressionManager);
|
|
8453
8526
|
|
|
8454
8527
|
// lib/expression-observer/deep-clone-except-with-expression-support.ts
|
|
8455
|
-
import { Inject as
|
|
8528
|
+
import { Inject as Inject5, Injectable as Injectable5, PENDING as PENDING2, RsXCoreInjectionTokens } from "@rs-x/core";
|
|
8456
8529
|
|
|
8457
8530
|
// lib/expressions/abstract-expression.ts
|
|
8458
|
-
import { PENDING } from "@rs-x/core";
|
|
8459
8531
|
import { ReplaySubject } from "rxjs";
|
|
8532
|
+
import { PENDING } from "@rs-x/core";
|
|
8460
8533
|
var AbstractExpression = class {
|
|
8461
8534
|
static {
|
|
8462
8535
|
__name(this, "AbstractExpression");
|
|
@@ -8471,6 +8544,8 @@ var AbstractExpression = class {
|
|
|
8471
8544
|
_oldValue;
|
|
8472
8545
|
_commitedSubscription;
|
|
8473
8546
|
_owner;
|
|
8547
|
+
_services;
|
|
8548
|
+
_leafIndexWatchRule;
|
|
8474
8549
|
constructor(type, expressionString, ...childExpressions) {
|
|
8475
8550
|
this.type = type;
|
|
8476
8551
|
this.expressionString = expressionString;
|
|
@@ -8479,10 +8554,12 @@ var AbstractExpression = class {
|
|
|
8479
8554
|
}
|
|
8480
8555
|
this.addChildExpressions(childExpressions.filter((childExpression) => childExpression));
|
|
8481
8556
|
}
|
|
8482
|
-
|
|
8483
|
-
|
|
8557
|
+
bind(settings) {
|
|
8558
|
+
this._services = settings.services;
|
|
8559
|
+
this._leafIndexWatchRule = settings.leafIndexWatchRule;
|
|
8560
|
+
if (!this._parent && this.transactionManager) {
|
|
8484
8561
|
this._owner = settings.owner;
|
|
8485
|
-
this._commitedSubscription =
|
|
8562
|
+
this._commitedSubscription = this.transactionManager.commited.subscribe(this.onCommited);
|
|
8486
8563
|
}
|
|
8487
8564
|
return this;
|
|
8488
8565
|
}
|
|
@@ -8513,6 +8590,27 @@ var AbstractExpression = class {
|
|
|
8513
8590
|
toString() {
|
|
8514
8591
|
return this.expressionString;
|
|
8515
8592
|
}
|
|
8593
|
+
get services() {
|
|
8594
|
+
return this._services;
|
|
8595
|
+
}
|
|
8596
|
+
get guidFactory() {
|
|
8597
|
+
return this._services?.guidFactory;
|
|
8598
|
+
}
|
|
8599
|
+
get leafIndexWatchRule() {
|
|
8600
|
+
return this._leafIndexWatchRule;
|
|
8601
|
+
}
|
|
8602
|
+
get stateManager() {
|
|
8603
|
+
return this._services?.stateManager;
|
|
8604
|
+
}
|
|
8605
|
+
get indexValueAccessor() {
|
|
8606
|
+
return this._services?.indexValueAccessor;
|
|
8607
|
+
}
|
|
8608
|
+
get transactionManager() {
|
|
8609
|
+
return this._services?.transactionManager;
|
|
8610
|
+
}
|
|
8611
|
+
get valueMetadata() {
|
|
8612
|
+
return this._services?.valueMetadata;
|
|
8613
|
+
}
|
|
8516
8614
|
get root() {
|
|
8517
8615
|
return this.parent ? this.parent.root : this;
|
|
8518
8616
|
}
|
|
@@ -8566,148 +8664,410 @@ var AbstractExpression = class {
|
|
|
8566
8664
|
}
|
|
8567
8665
|
};
|
|
8568
8666
|
|
|
8569
|
-
// lib/
|
|
8570
|
-
|
|
8667
|
+
// lib/expression-observer/deep-clone-except-with-expression-support.ts
|
|
8668
|
+
function _ts_decorate5(decorators, target, key, desc) {
|
|
8669
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8670
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
8671
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
8672
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8673
|
+
}
|
|
8674
|
+
__name(_ts_decorate5, "_ts_decorate");
|
|
8675
|
+
function _ts_metadata5(k, v) {
|
|
8676
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
8677
|
+
}
|
|
8678
|
+
__name(_ts_metadata5, "_ts_metadata");
|
|
8679
|
+
function _ts_param5(paramIndex, decorator) {
|
|
8680
|
+
return function(target, key) {
|
|
8681
|
+
decorator(target, key, paramIndex);
|
|
8682
|
+
};
|
|
8683
|
+
}
|
|
8684
|
+
__name(_ts_param5, "_ts_param");
|
|
8685
|
+
var DeepCloneExceptWithExpressionSupport = class {
|
|
8571
8686
|
static {
|
|
8572
|
-
__name(this, "
|
|
8573
|
-
}
|
|
8574
|
-
constructor(type, expressionString, ...childExpressions) {
|
|
8575
|
-
super(type, expressionString, ...childExpressions);
|
|
8687
|
+
__name(this, "DeepCloneExceptWithExpressionSupport");
|
|
8576
8688
|
}
|
|
8577
|
-
|
|
8578
|
-
|
|
8579
|
-
this.
|
|
8580
|
-
childExpression.initialize(settings);
|
|
8581
|
-
});
|
|
8582
|
-
return this;
|
|
8689
|
+
_defaultDeepCloneValueGetter;
|
|
8690
|
+
constructor(_defaultDeepCloneValueGetter) {
|
|
8691
|
+
this._defaultDeepCloneValueGetter = _defaultDeepCloneValueGetter;
|
|
8583
8692
|
}
|
|
8584
|
-
|
|
8585
|
-
|
|
8586
|
-
|
|
8587
|
-
return false;
|
|
8693
|
+
except(source) {
|
|
8694
|
+
if (source instanceof AbstractExpression) {
|
|
8695
|
+
return source.value === void 0 ? PENDING2 : source.value;
|
|
8588
8696
|
}
|
|
8589
|
-
return
|
|
8590
|
-
}
|
|
8591
|
-
evaluate() {
|
|
8592
|
-
const args = this._childExpressions.map((childExpression) => childExpression.value);
|
|
8593
|
-
return this.evaluateExpression(...args);
|
|
8697
|
+
return this._defaultDeepCloneValueGetter.except(source);
|
|
8594
8698
|
}
|
|
8595
8699
|
};
|
|
8700
|
+
DeepCloneExceptWithExpressionSupport = _ts_decorate5([
|
|
8701
|
+
Injectable5(),
|
|
8702
|
+
_ts_param5(0, Inject5(RsXCoreInjectionTokens.IDeepCloneExcept)),
|
|
8703
|
+
_ts_metadata5("design:type", Function),
|
|
8704
|
+
_ts_metadata5("design:paramtypes", [
|
|
8705
|
+
typeof IDeepCloneExcept === "undefined" ? Object : IDeepCloneExcept
|
|
8706
|
+
])
|
|
8707
|
+
], DeepCloneExceptWithExpressionSupport);
|
|
8596
8708
|
|
|
8597
|
-
// lib/
|
|
8598
|
-
|
|
8709
|
+
// lib/expression-observer/expression-index-accessor.ts
|
|
8710
|
+
import { Injectable as Injectable6, Type, UnsupportedException } from "@rs-x/core";
|
|
8711
|
+
function _ts_decorate6(decorators, target, key, desc) {
|
|
8712
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8713
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
8714
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
8715
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8716
|
+
}
|
|
8717
|
+
__name(_ts_decorate6, "_ts_decorate");
|
|
8718
|
+
var ExpressionIndexAccessor = class {
|
|
8599
8719
|
static {
|
|
8600
|
-
__name(this, "
|
|
8601
|
-
}
|
|
8602
|
-
constructor(expressionType, expressionString, leftExpression, rightExpression) {
|
|
8603
|
-
super(expressionType, expressionString, leftExpression, rightExpression);
|
|
8720
|
+
__name(this, "ExpressionIndexAccessor");
|
|
8604
8721
|
}
|
|
8605
|
-
|
|
8606
|
-
|
|
8607
|
-
|
|
8608
|
-
var ExpressionType = /* @__PURE__ */ (function(ExpressionType2) {
|
|
8609
|
-
ExpressionType2["And"] = "and";
|
|
8610
|
-
ExpressionType2["Or"] = "or";
|
|
8611
|
-
ExpressionType2["Not"] = "not";
|
|
8612
|
-
ExpressionType2["Conditional"] = "conditional";
|
|
8613
|
-
ExpressionType2["Equality"] = "equality";
|
|
8614
|
-
ExpressionType2["Inequality"] = "inequality";
|
|
8615
|
-
ExpressionType2["StrictEquality"] = "strict equality";
|
|
8616
|
-
ExpressionType2["StrictInequality"] = "strict inequality";
|
|
8617
|
-
ExpressionType2["GreaterThan"] = "greater than";
|
|
8618
|
-
ExpressionType2["GreaterThanOrEqual"] = "Greater than or equal";
|
|
8619
|
-
ExpressionType2["LessThan"] = "less than";
|
|
8620
|
-
ExpressionType2["LessThanOrEqual"] = "less than or equal";
|
|
8621
|
-
ExpressionType2["In"] = "in";
|
|
8622
|
-
ExpressionType2["Instanceof"] = "instanceof";
|
|
8623
|
-
ExpressionType2["Typeof"] = "typeof";
|
|
8624
|
-
ExpressionType2["Remainder"] = "remain";
|
|
8625
|
-
ExpressionType2["Subtraction"] = "subtraction";
|
|
8626
|
-
ExpressionType2["UnaryNegation"] = "unary negation";
|
|
8627
|
-
ExpressionType2["Addition"] = "addition";
|
|
8628
|
-
ExpressionType2["Division"] = "division";
|
|
8629
|
-
ExpressionType2["Multiplication"] = "multiplication";
|
|
8630
|
-
ExpressionType2["Exponentiation"] = "exponentiation";
|
|
8631
|
-
ExpressionType2["NullishCoalescing"] = "nullish coalescing";
|
|
8632
|
-
ExpressionType2["String"] = "string";
|
|
8633
|
-
ExpressionType2["Number"] = "number";
|
|
8634
|
-
ExpressionType2["Boolean"] = "boolean";
|
|
8635
|
-
ExpressionType2["Array"] = "array";
|
|
8636
|
-
ExpressionType2["Identifier"] = "identifier";
|
|
8637
|
-
ExpressionType2["Function"] = "function";
|
|
8638
|
-
ExpressionType2["TemlateString"] = "template string";
|
|
8639
|
-
ExpressionType2["Null"] = "null";
|
|
8640
|
-
ExpressionType2["BigInt"] = "big int";
|
|
8641
|
-
ExpressionType2["RegExp"] = "regular expression";
|
|
8642
|
-
ExpressionType2["Member"] = "member";
|
|
8643
|
-
ExpressionType2["Spread"] = "spread";
|
|
8644
|
-
ExpressionType2["BitwiseLeftShift"] = "bitwise left shift";
|
|
8645
|
-
ExpressionType2["BitwiseRightShift"] = "bitwise right shift";
|
|
8646
|
-
ExpressionType2["BitwiseUnsignedRightShift"] = "bitwise unsigned right shift";
|
|
8647
|
-
ExpressionType2["BitwiseNot"] = "bitwise not";
|
|
8648
|
-
ExpressionType2["BitwiseAnd"] = "bitwise and";
|
|
8649
|
-
ExpressionType2["BitwiseOr"] = "bitwise or";
|
|
8650
|
-
ExpressionType2["BitwiseXor"] = "bitwise xor";
|
|
8651
|
-
ExpressionType2["New"] = "new";
|
|
8652
|
-
ExpressionType2["Sequence"] = "sequence";
|
|
8653
|
-
ExpressionType2["Object"] = "object";
|
|
8654
|
-
ExpressionType2["Property"] = "property";
|
|
8655
|
-
ExpressionType2["PropertyContext"] = "property context";
|
|
8656
|
-
ExpressionType2["Super"] = "super";
|
|
8657
|
-
ExpressionType2["This"] = "this";
|
|
8658
|
-
ExpressionType2["Index"] = "Index";
|
|
8659
|
-
ExpressionType2["UnaryPlus"] = "unary plus";
|
|
8660
|
-
return ExpressionType2;
|
|
8661
|
-
})({});
|
|
8662
|
-
|
|
8663
|
-
// lib/expressions/addition-expression.ts
|
|
8664
|
-
var AdditionExpression = class extends BinaryExpression {
|
|
8665
|
-
static {
|
|
8666
|
-
__name(this, "AdditionExpression");
|
|
8722
|
+
priority;
|
|
8723
|
+
isAsync() {
|
|
8724
|
+
return true;
|
|
8667
8725
|
}
|
|
8668
|
-
|
|
8669
|
-
|
|
8726
|
+
needsProxy() {
|
|
8727
|
+
return true;
|
|
8670
8728
|
}
|
|
8671
|
-
|
|
8672
|
-
return
|
|
8729
|
+
getResolvedValue(context, index) {
|
|
8730
|
+
return Type.cast((Type.toObject(context) ?? {})[index])?.value;
|
|
8673
8731
|
}
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
// lib/expressions/collection-expression.ts
|
|
8677
|
-
var CollectionExpression = class extends ParameterizedExpression {
|
|
8678
|
-
static {
|
|
8679
|
-
__name(this, "CollectionExpression");
|
|
8732
|
+
hasValue(context, index) {
|
|
8733
|
+
return Type.cast((Type.toObject(context) ?? {})[index])?.value !== void 0;
|
|
8680
8734
|
}
|
|
8681
|
-
|
|
8682
|
-
|
|
8735
|
+
getValue(context, index) {
|
|
8736
|
+
return (Type.toObject(context) ?? {})[index];
|
|
8683
8737
|
}
|
|
8684
|
-
|
|
8685
|
-
|
|
8686
|
-
// lib/expressions/array-expression.ts
|
|
8687
|
-
var ArrayExpression = class extends CollectionExpression {
|
|
8688
|
-
static {
|
|
8689
|
-
__name(this, "ArrayExpression");
|
|
8738
|
+
setValue() {
|
|
8739
|
+
throw new UnsupportedException("Cannot set the value of an expression directly. To update it, modify the relevant properties in the expression context.");
|
|
8690
8740
|
}
|
|
8691
|
-
|
|
8692
|
-
|
|
8741
|
+
getIndexes() {
|
|
8742
|
+
return [].values();
|
|
8693
8743
|
}
|
|
8694
|
-
|
|
8695
|
-
|
|
8696
|
-
args.forEach((item, i) => {
|
|
8697
|
-
if (this.childExpressions[i].type === ExpressionType.Spread) {
|
|
8698
|
-
array.push(...item);
|
|
8699
|
-
} else {
|
|
8700
|
-
array.push(item);
|
|
8701
|
-
}
|
|
8702
|
-
});
|
|
8703
|
-
return array;
|
|
8744
|
+
applies(context, index) {
|
|
8745
|
+
return (Type.toObject(context) ?? {})[index] instanceof AbstractExpression;
|
|
8704
8746
|
}
|
|
8705
8747
|
};
|
|
8748
|
+
ExpressionIndexAccessor = _ts_decorate6([
|
|
8749
|
+
Injectable6()
|
|
8750
|
+
], ExpressionIndexAccessor);
|
|
8706
8751
|
|
|
8707
|
-
// lib/
|
|
8708
|
-
|
|
8709
|
-
|
|
8710
|
-
|
|
8752
|
+
// lib/expression-observer/expression-observer.factory.ts
|
|
8753
|
+
import { ReplaySubject as ReplaySubject2 } from "rxjs";
|
|
8754
|
+
import { Injectable as Injectable7, SingletonFactory as SingletonFactory3 } from "@rs-x/core";
|
|
8755
|
+
import { AbstractObserver } from "@rs-x/state-manager";
|
|
8756
|
+
function _ts_decorate7(decorators, target, key, desc) {
|
|
8757
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8758
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
8759
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
8760
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8761
|
+
}
|
|
8762
|
+
__name(_ts_decorate7, "_ts_decorate");
|
|
8763
|
+
function _ts_metadata6(k, v) {
|
|
8764
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
8765
|
+
}
|
|
8766
|
+
__name(_ts_metadata6, "_ts_metadata");
|
|
8767
|
+
var ExpressionObserver = class ExpressionObserver2 extends AbstractObserver {
|
|
8768
|
+
static {
|
|
8769
|
+
__name(this, "ExpressionObserver");
|
|
8770
|
+
}
|
|
8771
|
+
_changedSubsctiption;
|
|
8772
|
+
constructor(owner, target) {
|
|
8773
|
+
super(owner, target, void 0, new ReplaySubject2(1));
|
|
8774
|
+
this._changedSubsctiption = target.changed.subscribe(this.onExpressionChanged);
|
|
8775
|
+
}
|
|
8776
|
+
disposeInternal() {
|
|
8777
|
+
this._changedSubsctiption.unsubscribe();
|
|
8778
|
+
}
|
|
8779
|
+
onExpressionChanged = /* @__PURE__ */ __name((expression) => {
|
|
8780
|
+
this.emitChange({
|
|
8781
|
+
arguments: [],
|
|
8782
|
+
chain: [],
|
|
8783
|
+
target: this.target,
|
|
8784
|
+
newValue: expression.value
|
|
8785
|
+
});
|
|
8786
|
+
}, "onExpressionChanged");
|
|
8787
|
+
};
|
|
8788
|
+
var ExpressionObserverFactory = class extends SingletonFactory3 {
|
|
8789
|
+
static {
|
|
8790
|
+
__name(this, "ExpressionObserverFactory");
|
|
8791
|
+
}
|
|
8792
|
+
constructor() {
|
|
8793
|
+
super();
|
|
8794
|
+
}
|
|
8795
|
+
getId(data2) {
|
|
8796
|
+
return data2.expression;
|
|
8797
|
+
}
|
|
8798
|
+
createId(data2) {
|
|
8799
|
+
return data2.expression;
|
|
8800
|
+
}
|
|
8801
|
+
createInstance(data2, id) {
|
|
8802
|
+
return new ExpressionObserver({
|
|
8803
|
+
canDispose: /* @__PURE__ */ __name(() => this.getReferenceCount(id) === 1, "canDispose"),
|
|
8804
|
+
release: /* @__PURE__ */ __name(() => {
|
|
8805
|
+
this.release(id);
|
|
8806
|
+
data2.owner?.release();
|
|
8807
|
+
}, "release")
|
|
8808
|
+
}, data2.expression);
|
|
8809
|
+
}
|
|
8810
|
+
releaseInstance(observer) {
|
|
8811
|
+
observer.dispose();
|
|
8812
|
+
}
|
|
8813
|
+
};
|
|
8814
|
+
ExpressionObserverFactory = _ts_decorate7([
|
|
8815
|
+
Injectable7(),
|
|
8816
|
+
_ts_metadata6("design:type", Function),
|
|
8817
|
+
_ts_metadata6("design:paramtypes", [])
|
|
8818
|
+
], ExpressionObserverFactory);
|
|
8819
|
+
|
|
8820
|
+
// lib/expression-observer/expression-observer-proxy-pair.factory.ts
|
|
8821
|
+
import { Inject as Inject6, Injectable as Injectable8 } from "@rs-x/core";
|
|
8822
|
+
function _ts_decorate8(decorators, target, key, desc) {
|
|
8823
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8824
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
8825
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
8826
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8827
|
+
}
|
|
8828
|
+
__name(_ts_decorate8, "_ts_decorate");
|
|
8829
|
+
function _ts_metadata7(k, v) {
|
|
8830
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
8831
|
+
}
|
|
8832
|
+
__name(_ts_metadata7, "_ts_metadata");
|
|
8833
|
+
function _ts_param6(paramIndex, decorator) {
|
|
8834
|
+
return function(target, key) {
|
|
8835
|
+
decorator(target, key, paramIndex);
|
|
8836
|
+
};
|
|
8837
|
+
}
|
|
8838
|
+
__name(_ts_param6, "_ts_param");
|
|
8839
|
+
var ExpressionObserverProxyPairFactory = class {
|
|
8840
|
+
static {
|
|
8841
|
+
__name(this, "ExpressionObserverProxyPairFactory");
|
|
8842
|
+
}
|
|
8843
|
+
_expressionObserverFactory;
|
|
8844
|
+
priority = 100;
|
|
8845
|
+
constructor(_expressionObserverFactory) {
|
|
8846
|
+
this._expressionObserverFactory = _expressionObserverFactory;
|
|
8847
|
+
}
|
|
8848
|
+
create(owner, proxyTarget) {
|
|
8849
|
+
return {
|
|
8850
|
+
observer: this._expressionObserverFactory.create({
|
|
8851
|
+
owner,
|
|
8852
|
+
expression: proxyTarget.target
|
|
8853
|
+
}).instance
|
|
8854
|
+
};
|
|
8855
|
+
}
|
|
8856
|
+
applies(object) {
|
|
8857
|
+
return object instanceof AbstractExpression;
|
|
8858
|
+
}
|
|
8859
|
+
};
|
|
8860
|
+
ExpressionObserverProxyPairFactory = _ts_decorate8([
|
|
8861
|
+
Injectable8(),
|
|
8862
|
+
_ts_param6(0, Inject6(RsXExpressionParserInjectionTokens.IExpressionObserverFactory)),
|
|
8863
|
+
_ts_metadata7("design:type", Function),
|
|
8864
|
+
_ts_metadata7("design:paramtypes", [
|
|
8865
|
+
typeof IExpressionObserverFactory === "undefined" ? Object : IExpressionObserverFactory
|
|
8866
|
+
])
|
|
8867
|
+
], ExpressionObserverProxyPairFactory);
|
|
8868
|
+
|
|
8869
|
+
// lib/expression-services/expression-services.ts
|
|
8870
|
+
import { Inject as Inject7, Injectable as Injectable9, RsXCoreInjectionTokens as RsXCoreInjectionTokens2 } from "@rs-x/core";
|
|
8871
|
+
import { RsXStateManagerInjectionTokens as RsXStateManagerInjectionTokens2 } from "@rs-x/state-manager";
|
|
8872
|
+
function _ts_decorate9(decorators, target, key, desc) {
|
|
8873
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8874
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
8875
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
8876
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8877
|
+
}
|
|
8878
|
+
__name(_ts_decorate9, "_ts_decorate");
|
|
8879
|
+
function _ts_metadata8(k, v) {
|
|
8880
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
8881
|
+
}
|
|
8882
|
+
__name(_ts_metadata8, "_ts_metadata");
|
|
8883
|
+
function _ts_param7(paramIndex, decorator) {
|
|
8884
|
+
return function(target, key) {
|
|
8885
|
+
decorator(target, key, paramIndex);
|
|
8886
|
+
};
|
|
8887
|
+
}
|
|
8888
|
+
__name(_ts_param7, "_ts_param");
|
|
8889
|
+
var ExpressionServices = class {
|
|
8890
|
+
static {
|
|
8891
|
+
__name(this, "ExpressionServices");
|
|
8892
|
+
}
|
|
8893
|
+
transactionManager;
|
|
8894
|
+
stateManager;
|
|
8895
|
+
indexValueAccessor;
|
|
8896
|
+
guidFactory;
|
|
8897
|
+
valueMetadata;
|
|
8898
|
+
constructor(transactionManager, stateManager, indexValueAccessor, guidFactory, valueMetadata) {
|
|
8899
|
+
this.transactionManager = transactionManager;
|
|
8900
|
+
this.stateManager = stateManager;
|
|
8901
|
+
this.indexValueAccessor = indexValueAccessor;
|
|
8902
|
+
this.guidFactory = guidFactory;
|
|
8903
|
+
this.valueMetadata = valueMetadata;
|
|
8904
|
+
}
|
|
8905
|
+
};
|
|
8906
|
+
ExpressionServices = _ts_decorate9([
|
|
8907
|
+
Injectable9(),
|
|
8908
|
+
_ts_param7(0, Inject7(RsXExpressionParserInjectionTokens.IExpressionChangeTransactionManager)),
|
|
8909
|
+
_ts_param7(1, Inject7(RsXStateManagerInjectionTokens2.IStateManager)),
|
|
8910
|
+
_ts_param7(2, Inject7(RsXCoreInjectionTokens2.IIndexValueAccessor)),
|
|
8911
|
+
_ts_param7(3, Inject7(RsXCoreInjectionTokens2.IGuidFactory)),
|
|
8912
|
+
_ts_param7(4, Inject7(RsXCoreInjectionTokens2.IValueMetadata)),
|
|
8913
|
+
_ts_metadata8("design:type", Function),
|
|
8914
|
+
_ts_metadata8("design:paramtypes", [
|
|
8915
|
+
typeof IExpressionChangeTransactionManager === "undefined" ? Object : IExpressionChangeTransactionManager,
|
|
8916
|
+
typeof IStateManager === "undefined" ? Object : IStateManager,
|
|
8917
|
+
typeof IIndexValueAccessor === "undefined" ? Object : IIndexValueAccessor,
|
|
8918
|
+
typeof IGuidFactory === "undefined" ? Object : IGuidFactory,
|
|
8919
|
+
typeof IValueMetadata === "undefined" ? Object : IValueMetadata
|
|
8920
|
+
])
|
|
8921
|
+
], ExpressionServices);
|
|
8922
|
+
|
|
8923
|
+
// lib/expressions/parameterized-abstract-expression.ts
|
|
8924
|
+
var ParameterizedExpression = class extends AbstractExpression {
|
|
8925
|
+
static {
|
|
8926
|
+
__name(this, "ParameterizedExpression");
|
|
8927
|
+
}
|
|
8928
|
+
constructor(type, expressionString, ...childExpressions) {
|
|
8929
|
+
super(type, expressionString, ...childExpressions);
|
|
8930
|
+
}
|
|
8931
|
+
bind(settings) {
|
|
8932
|
+
super.bind(settings);
|
|
8933
|
+
this._childExpressions.forEach((childExpression) => {
|
|
8934
|
+
childExpression.bind(settings);
|
|
8935
|
+
});
|
|
8936
|
+
return this;
|
|
8937
|
+
}
|
|
8938
|
+
prepareReevaluation() {
|
|
8939
|
+
const args = this._childExpressions.map((childExpression) => childExpression.value);
|
|
8940
|
+
if (args.some((arg) => arg === void 0)) {
|
|
8941
|
+
return false;
|
|
8942
|
+
}
|
|
8943
|
+
return true;
|
|
8944
|
+
}
|
|
8945
|
+
evaluate() {
|
|
8946
|
+
const args = this._childExpressions.map((childExpression) => childExpression.value);
|
|
8947
|
+
return this.evaluateExpression(...args);
|
|
8948
|
+
}
|
|
8949
|
+
};
|
|
8950
|
+
|
|
8951
|
+
// lib/expressions/binary-expression.ts
|
|
8952
|
+
var BinaryExpression = class extends ParameterizedExpression {
|
|
8953
|
+
static {
|
|
8954
|
+
__name(this, "BinaryExpression");
|
|
8955
|
+
}
|
|
8956
|
+
constructor(expressionType, expressionString, leftExpression, rightExpression) {
|
|
8957
|
+
super(expressionType, expressionString, leftExpression, rightExpression);
|
|
8958
|
+
}
|
|
8959
|
+
clone() {
|
|
8960
|
+
return new this.constructor(this.expressionString, this._childExpressions[0].clone(), this._childExpressions[1].clone());
|
|
8961
|
+
}
|
|
8962
|
+
};
|
|
8963
|
+
|
|
8964
|
+
// lib/expressions/expression-parser.interface.ts
|
|
8965
|
+
var ExpressionType = /* @__PURE__ */ (function(ExpressionType2) {
|
|
8966
|
+
ExpressionType2["And"] = "and";
|
|
8967
|
+
ExpressionType2["Or"] = "or";
|
|
8968
|
+
ExpressionType2["Not"] = "not";
|
|
8969
|
+
ExpressionType2["Conditional"] = "conditional";
|
|
8970
|
+
ExpressionType2["Equality"] = "equality";
|
|
8971
|
+
ExpressionType2["Inequality"] = "inequality";
|
|
8972
|
+
ExpressionType2["StrictEquality"] = "strict equality";
|
|
8973
|
+
ExpressionType2["StrictInequality"] = "strict inequality";
|
|
8974
|
+
ExpressionType2["GreaterThan"] = "greater than";
|
|
8975
|
+
ExpressionType2["GreaterThanOrEqual"] = "Greater than or equal";
|
|
8976
|
+
ExpressionType2["LessThan"] = "less than";
|
|
8977
|
+
ExpressionType2["LessThanOrEqual"] = "less than or equal";
|
|
8978
|
+
ExpressionType2["In"] = "in";
|
|
8979
|
+
ExpressionType2["Instanceof"] = "instanceof";
|
|
8980
|
+
ExpressionType2["Typeof"] = "typeof";
|
|
8981
|
+
ExpressionType2["Remainder"] = "remain";
|
|
8982
|
+
ExpressionType2["Subtraction"] = "subtraction";
|
|
8983
|
+
ExpressionType2["UnaryNegation"] = "unary negation";
|
|
8984
|
+
ExpressionType2["Addition"] = "addition";
|
|
8985
|
+
ExpressionType2["Division"] = "division";
|
|
8986
|
+
ExpressionType2["Multiplication"] = "multiplication";
|
|
8987
|
+
ExpressionType2["Exponentiation"] = "exponentiation";
|
|
8988
|
+
ExpressionType2["NullishCoalescing"] = "nullish coalescing";
|
|
8989
|
+
ExpressionType2["String"] = "string";
|
|
8990
|
+
ExpressionType2["Number"] = "number";
|
|
8991
|
+
ExpressionType2["Boolean"] = "boolean";
|
|
8992
|
+
ExpressionType2["Array"] = "array";
|
|
8993
|
+
ExpressionType2["Identifier"] = "identifier";
|
|
8994
|
+
ExpressionType2["Function"] = "function";
|
|
8995
|
+
ExpressionType2["TemlateString"] = "template string";
|
|
8996
|
+
ExpressionType2["Null"] = "null";
|
|
8997
|
+
ExpressionType2["BigInt"] = "big int";
|
|
8998
|
+
ExpressionType2["RegExp"] = "regular expression";
|
|
8999
|
+
ExpressionType2["Member"] = "member";
|
|
9000
|
+
ExpressionType2["Spread"] = "spread";
|
|
9001
|
+
ExpressionType2["BitwiseLeftShift"] = "bitwise left shift";
|
|
9002
|
+
ExpressionType2["BitwiseRightShift"] = "bitwise right shift";
|
|
9003
|
+
ExpressionType2["BitwiseUnsignedRightShift"] = "bitwise unsigned right shift";
|
|
9004
|
+
ExpressionType2["BitwiseNot"] = "bitwise not";
|
|
9005
|
+
ExpressionType2["BitwiseAnd"] = "bitwise and";
|
|
9006
|
+
ExpressionType2["BitwiseOr"] = "bitwise or";
|
|
9007
|
+
ExpressionType2["BitwiseXor"] = "bitwise xor";
|
|
9008
|
+
ExpressionType2["New"] = "new";
|
|
9009
|
+
ExpressionType2["Sequence"] = "sequence";
|
|
9010
|
+
ExpressionType2["Object"] = "object";
|
|
9011
|
+
ExpressionType2["Property"] = "property";
|
|
9012
|
+
ExpressionType2["PropertyContext"] = "property context";
|
|
9013
|
+
ExpressionType2["Super"] = "super";
|
|
9014
|
+
ExpressionType2["This"] = "this";
|
|
9015
|
+
ExpressionType2["Index"] = "Index";
|
|
9016
|
+
ExpressionType2["UnaryPlus"] = "unary plus";
|
|
9017
|
+
return ExpressionType2;
|
|
9018
|
+
})({});
|
|
9019
|
+
|
|
9020
|
+
// lib/expressions/addition-expression.ts
|
|
9021
|
+
var AdditionExpression = class extends BinaryExpression {
|
|
9022
|
+
static {
|
|
9023
|
+
__name(this, "AdditionExpression");
|
|
9024
|
+
}
|
|
9025
|
+
constructor(expressionString, leftExpression, rightExpression) {
|
|
9026
|
+
super(ExpressionType.Addition, expressionString, leftExpression, rightExpression);
|
|
9027
|
+
}
|
|
9028
|
+
evaluateExpression(a, b) {
|
|
9029
|
+
return a + b;
|
|
9030
|
+
}
|
|
9031
|
+
};
|
|
9032
|
+
|
|
9033
|
+
// lib/expressions/collection-expression.ts
|
|
9034
|
+
var CollectionExpression = class extends ParameterizedExpression {
|
|
9035
|
+
static {
|
|
9036
|
+
__name(this, "CollectionExpression");
|
|
9037
|
+
}
|
|
9038
|
+
constructor(type, expressionString, expressions) {
|
|
9039
|
+
super(type, expressionString, ...expressions);
|
|
9040
|
+
}
|
|
9041
|
+
};
|
|
9042
|
+
|
|
9043
|
+
// lib/expressions/array-expression.ts
|
|
9044
|
+
var ArrayExpression = class _ArrayExpression extends CollectionExpression {
|
|
9045
|
+
static {
|
|
9046
|
+
__name(this, "ArrayExpression");
|
|
9047
|
+
}
|
|
9048
|
+
constructor(expressions) {
|
|
9049
|
+
super(ExpressionType.Array, `[${expressions.map((expression) => expression.expressionString).join(", ")}]`, expressions);
|
|
9050
|
+
}
|
|
9051
|
+
clone() {
|
|
9052
|
+
return new _ArrayExpression(this._childExpressions.map((childExpression) => childExpression.clone()));
|
|
9053
|
+
}
|
|
9054
|
+
evaluateExpression(...args) {
|
|
9055
|
+
const array = [];
|
|
9056
|
+
args.forEach((item, i) => {
|
|
9057
|
+
if (this.childExpressions[i].type === ExpressionType.Spread) {
|
|
9058
|
+
array.push(...item);
|
|
9059
|
+
} else {
|
|
9060
|
+
array.push(item);
|
|
9061
|
+
}
|
|
9062
|
+
});
|
|
9063
|
+
return array;
|
|
9064
|
+
}
|
|
9065
|
+
};
|
|
9066
|
+
|
|
9067
|
+
// lib/expressions/bitwise-and-expression.ts
|
|
9068
|
+
var BitwiseAndExpression = class extends BinaryExpression {
|
|
9069
|
+
static {
|
|
9070
|
+
__name(this, "BitwiseAndExpression");
|
|
8711
9071
|
}
|
|
8712
9072
|
constructor(expressionString, leftExpression, rightExpression) {
|
|
8713
9073
|
super(ExpressionType.BitwiseAnd, expressionString, leftExpression, rightExpression);
|
|
@@ -8738,6 +9098,9 @@ var BitwiseNotExpression = class extends ParameterizedExpression {
|
|
|
8738
9098
|
constructor(expressionString, expression) {
|
|
8739
9099
|
super(ExpressionType.BitwiseNot, expressionString, expression);
|
|
8740
9100
|
}
|
|
9101
|
+
clone() {
|
|
9102
|
+
return new this.constructor(this.expressionString, this._childExpressions[0].clone());
|
|
9103
|
+
}
|
|
8741
9104
|
evaluateExpression(a) {
|
|
8742
9105
|
return ~a;
|
|
8743
9106
|
}
|
|
@@ -8803,6 +9166,9 @@ var ConditionalExpression = class extends ParameterizedExpression {
|
|
|
8803
9166
|
constructor(expressionString, condition, ifValueExpression, elseValueExpression) {
|
|
8804
9167
|
super(ExpressionType.Conditional, expressionString, condition, ifValueExpression, elseValueExpression);
|
|
8805
9168
|
}
|
|
9169
|
+
clone() {
|
|
9170
|
+
return new this.constructor(this.expressionString, this._childExpressions[0].clone(), this._childExpressions[1].clone(), this._childExpressions[2].clone());
|
|
9171
|
+
}
|
|
8806
9172
|
evaluateExpression(condition, consequent, alternate) {
|
|
8807
9173
|
return condition ? consequent : alternate;
|
|
8808
9174
|
}
|
|
@@ -8813,19 +9179,21 @@ var ConstantExpression = class extends AbstractExpression {
|
|
|
8813
9179
|
static {
|
|
8814
9180
|
__name(this, "ConstantExpression");
|
|
8815
9181
|
}
|
|
8816
|
-
_expressionChangeTransactionManager;
|
|
8817
9182
|
_commitHandler;
|
|
8818
|
-
constructor(type, expressionString, constValue
|
|
8819
|
-
super(type, expressionString)
|
|
9183
|
+
constructor(type, expressionString, constValue) {
|
|
9184
|
+
super(type, expressionString);
|
|
8820
9185
|
this._commitHandler = {
|
|
8821
9186
|
owner: this,
|
|
8822
9187
|
commit: this.commit
|
|
8823
9188
|
};
|
|
8824
9189
|
this._value = constValue;
|
|
8825
9190
|
}
|
|
8826
|
-
|
|
8827
|
-
|
|
8828
|
-
|
|
9191
|
+
clone() {
|
|
9192
|
+
return new this.constructor(this._value);
|
|
9193
|
+
}
|
|
9194
|
+
bind(settings) {
|
|
9195
|
+
super.bind(settings);
|
|
9196
|
+
this.transactionManager.registerChange(this.root, this._commitHandler);
|
|
8829
9197
|
return this;
|
|
8830
9198
|
}
|
|
8831
9199
|
evaluate() {
|
|
@@ -8839,8 +9207,8 @@ var ConstantBigIntExpression = class extends ConstantExpression {
|
|
|
8839
9207
|
static {
|
|
8840
9208
|
__name(this, "ConstantBigIntExpression");
|
|
8841
9209
|
}
|
|
8842
|
-
constructor(value
|
|
8843
|
-
super(ExpressionType.BigInt, value.toString(), value
|
|
9210
|
+
constructor(value) {
|
|
9211
|
+
super(ExpressionType.BigInt, value.toString(), value);
|
|
8844
9212
|
}
|
|
8845
9213
|
};
|
|
8846
9214
|
|
|
@@ -8849,8 +9217,8 @@ var ConstantBooleanExpression = class extends ConstantExpression {
|
|
|
8849
9217
|
static {
|
|
8850
9218
|
__name(this, "ConstantBooleanExpression");
|
|
8851
9219
|
}
|
|
8852
|
-
constructor(value
|
|
8853
|
-
super(ExpressionType.Boolean, value.toString(), value
|
|
9220
|
+
constructor(value) {
|
|
9221
|
+
super(ExpressionType.Boolean, value.toString(), value);
|
|
8854
9222
|
}
|
|
8855
9223
|
};
|
|
8856
9224
|
|
|
@@ -8859,8 +9227,11 @@ var ConstantNullExpression = class extends ConstantExpression {
|
|
|
8859
9227
|
static {
|
|
8860
9228
|
__name(this, "ConstantNullExpression");
|
|
8861
9229
|
}
|
|
8862
|
-
constructor(
|
|
8863
|
-
super(ExpressionType.Null, "null", null
|
|
9230
|
+
constructor() {
|
|
9231
|
+
super(ExpressionType.Null, "null", null);
|
|
9232
|
+
}
|
|
9233
|
+
clone() {
|
|
9234
|
+
return new this.constructor();
|
|
8864
9235
|
}
|
|
8865
9236
|
};
|
|
8866
9237
|
|
|
@@ -8869,8 +9240,8 @@ var ConstantNumberExpression = class extends ConstantExpression {
|
|
|
8869
9240
|
static {
|
|
8870
9241
|
__name(this, "ConstantNumberExpression");
|
|
8871
9242
|
}
|
|
8872
|
-
constructor(value
|
|
8873
|
-
super(ExpressionType.Number, value.toString(), value
|
|
9243
|
+
constructor(value) {
|
|
9244
|
+
super(ExpressionType.Number, value.toString(), value);
|
|
8874
9245
|
}
|
|
8875
9246
|
};
|
|
8876
9247
|
|
|
@@ -8879,8 +9250,11 @@ var ConstantRegExpExpression = class extends ConstantExpression {
|
|
|
8879
9250
|
static {
|
|
8880
9251
|
__name(this, "ConstantRegExpExpression");
|
|
8881
9252
|
}
|
|
8882
|
-
constructor(expressionString, value
|
|
8883
|
-
super(ExpressionType.RegExp, expressionString, value
|
|
9253
|
+
constructor(expressionString, value) {
|
|
9254
|
+
super(ExpressionType.RegExp, expressionString, value);
|
|
9255
|
+
}
|
|
9256
|
+
clone() {
|
|
9257
|
+
return new this.constructor(this.expressionString, this._value);
|
|
8884
9258
|
}
|
|
8885
9259
|
};
|
|
8886
9260
|
|
|
@@ -8889,21 +9263,8 @@ var ConstantStringExpression = class extends ConstantExpression {
|
|
|
8889
9263
|
static {
|
|
8890
9264
|
__name(this, "ConstantStringExpression");
|
|
8891
9265
|
}
|
|
8892
|
-
constructor(value
|
|
8893
|
-
super(ExpressionType.String, value, value
|
|
8894
|
-
}
|
|
8895
|
-
};
|
|
8896
|
-
|
|
8897
|
-
// lib/expressions/unary-plus-expression.ts
|
|
8898
|
-
var UnaryPlusExpression = class extends ParameterizedExpression {
|
|
8899
|
-
static {
|
|
8900
|
-
__name(this, "UnaryPlusExpression");
|
|
8901
|
-
}
|
|
8902
|
-
constructor(expressionString, expression) {
|
|
8903
|
-
super(ExpressionType.UnaryPlus, expressionString, expression);
|
|
8904
|
-
}
|
|
8905
|
-
evaluateExpression(a) {
|
|
8906
|
-
return +a;
|
|
9266
|
+
constructor(value) {
|
|
9267
|
+
super(ExpressionType.String, value, value);
|
|
8907
9268
|
}
|
|
8908
9269
|
};
|
|
8909
9270
|
|
|
@@ -8947,7 +9308,7 @@ var ExponentiationExpression = class extends BinaryExpression {
|
|
|
8947
9308
|
};
|
|
8948
9309
|
|
|
8949
9310
|
// lib/expressions/function-expression.ts
|
|
8950
|
-
import { Assertion, PENDING as
|
|
9311
|
+
import { Assertion, PENDING as PENDING3, Type as Type2 } from "@rs-x/core";
|
|
8951
9312
|
var FunctionExpression = class extends AbstractExpression {
|
|
8952
9313
|
static {
|
|
8953
9314
|
__name(this, "FunctionExpression");
|
|
@@ -8957,26 +9318,28 @@ var FunctionExpression = class extends AbstractExpression {
|
|
|
8957
9318
|
argumentsExpression;
|
|
8958
9319
|
computed;
|
|
8959
9320
|
optional;
|
|
8960
|
-
_stateManager;
|
|
8961
9321
|
_context;
|
|
8962
9322
|
_functionContext;
|
|
8963
9323
|
_functionId;
|
|
8964
|
-
constructor(expressionString, functionExpression, objectExpression, argumentsExpression, computed, optional
|
|
8965
|
-
super(ExpressionType.Function, expressionString, objectExpression ?? new ConstantNullExpression(
|
|
8966
|
-
|
|
9324
|
+
constructor(expressionString, functionExpression, objectExpression, argumentsExpression, computed, optional) {
|
|
9325
|
+
super(ExpressionType.Function, expressionString, objectExpression ?? new ConstantNullExpression(), functionExpression, argumentsExpression), this.functionExpression = functionExpression, this.objectExpression = objectExpression, this.argumentsExpression = argumentsExpression, this.computed = computed, this.optional = optional;
|
|
9326
|
+
}
|
|
9327
|
+
clone() {
|
|
9328
|
+
return new this.constructor(this.expressionString, this.functionExpression.clone(), this.objectExpression?.clone(), this.argumentsExpression.clone(), this.computed, this.optional);
|
|
8967
9329
|
}
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
|
|
9330
|
+
bind(settings) {
|
|
9331
|
+
super.bind(settings);
|
|
9332
|
+
this._functionId = this.guidFactory.create();
|
|
9333
|
+
this._context = settings.context ?? settings.rootContext;
|
|
8971
9334
|
if (this.objectExpression) {
|
|
8972
|
-
this.objectExpression.
|
|
9335
|
+
this.objectExpression.bind(settings);
|
|
8973
9336
|
if (this.computed) {
|
|
8974
|
-
this.functionExpression.
|
|
9337
|
+
this.functionExpression.bind(settings);
|
|
8975
9338
|
}
|
|
8976
9339
|
} else if (this.functionExpression.type !== ExpressionType.Identifier) {
|
|
8977
|
-
this.functionExpression.
|
|
9340
|
+
this.functionExpression.bind(settings);
|
|
8978
9341
|
}
|
|
8979
|
-
this.argumentsExpression.
|
|
9342
|
+
this.argumentsExpression.bind(settings);
|
|
8980
9343
|
return this;
|
|
8981
9344
|
}
|
|
8982
9345
|
internalDispose() {
|
|
@@ -8990,301 +9353,89 @@ var FunctionExpression = class extends AbstractExpression {
|
|
|
8990
9353
|
return super.prepareReevaluation(sender, root, pendingCommits);
|
|
8991
9354
|
}
|
|
8992
9355
|
evaluate() {
|
|
8993
|
-
const functionContext =
|
|
8994
|
-
if (!functionContext) {
|
|
8995
|
-
return PENDING2;
|
|
8996
|
-
}
|
|
8997
|
-
if (this._functionContext !== functionContext) {
|
|
8998
|
-
this._functionContext = functionContext;
|
|
8999
|
-
}
|
|
9000
|
-
const { functionName, argumentsExpression } = this;
|
|
9001
|
-
const args = argumentsExpression.value;
|
|
9002
|
-
if (!functionName || !args || !functionContext) {
|
|
9003
|
-
return PENDING2;
|
|
9004
|
-
}
|
|
9005
|
-
const func = Type.cast(functionContext[functionName]);
|
|
9006
|
-
Assertion.assertIsFunction(func, func.name);
|
|
9007
|
-
return this.registerResult(func.call(functionContext, ...args));
|
|
9008
|
-
}
|
|
9009
|
-
get functionName() {
|
|
9010
|
-
return this.computed ? this.functionExpression.value : this.functionExpression.expressionString;
|
|
9011
|
-
}
|
|
9012
|
-
releaseResult() {
|
|
9013
|
-
this._stateManager.releaseState(this._functionContext, this._functionId);
|
|
9014
|
-
this._functionContext = void 0;
|
|
9015
|
-
}
|
|
9016
|
-
registerResult(result) {
|
|
9017
|
-
this._stateManager.setState(this._functionContext, this._functionId, result);
|
|
9018
|
-
return result;
|
|
9019
|
-
}
|
|
9020
|
-
};
|
|
9021
|
-
|
|
9022
|
-
// lib/expressions/greater-than-expression.ts
|
|
9023
|
-
var GreaterThanExpression = class extends BinaryExpression {
|
|
9024
|
-
static {
|
|
9025
|
-
__name(this, "GreaterThanExpression");
|
|
9026
|
-
}
|
|
9027
|
-
constructor(expressionString, leftExpression, rightExpression) {
|
|
9028
|
-
super(ExpressionType.GreaterThan, expressionString, leftExpression, rightExpression);
|
|
9029
|
-
}
|
|
9030
|
-
evaluateExpression(a, b) {
|
|
9031
|
-
return a > b;
|
|
9032
|
-
}
|
|
9033
|
-
};
|
|
9034
|
-
|
|
9035
|
-
// lib/expressions/greater-than-or-equal-expression.ts
|
|
9036
|
-
var GreaterThanOrEqualExpression = class extends BinaryExpression {
|
|
9037
|
-
static {
|
|
9038
|
-
__name(this, "GreaterThanOrEqualExpression");
|
|
9039
|
-
}
|
|
9040
|
-
constructor(expressionString, leftExpression, rightExpression) {
|
|
9041
|
-
super(ExpressionType.GreaterThanOrEqual, expressionString, leftExpression, rightExpression);
|
|
9042
|
-
}
|
|
9043
|
-
evaluateExpression(a, b) {
|
|
9044
|
-
return a >= b;
|
|
9045
|
-
}
|
|
9046
|
-
};
|
|
9047
|
-
|
|
9048
|
-
// lib/expressions/identifier-expression.ts
|
|
9049
|
-
import { emptyFunction as emptyFunction2, truePredicate as truePredicate2 } from "@rs-x/core";
|
|
9050
|
-
import { ReplaySubject as ReplaySubject2, Subject as Subject2 } from "rxjs";
|
|
9051
|
-
|
|
9052
|
-
// lib/expressions/member-expression.ts
|
|
9053
|
-
import { emptyFunction, PENDING as PENDING3, truePredicate, Type as Type2 } from "@rs-x/core";
|
|
9054
|
-
var MemberExpression = class extends AbstractExpression {
|
|
9055
|
-
static {
|
|
9056
|
-
__name(this, "MemberExpression");
|
|
9057
|
-
}
|
|
9058
|
-
_indexValueAccessor;
|
|
9059
|
-
_stateManager;
|
|
9060
|
-
_mustProxifyItemHandlerFactory;
|
|
9061
|
-
_expressionChangeTransactionManager;
|
|
9062
|
-
_slotObservers = /* @__PURE__ */ new Map();
|
|
9063
|
-
_rebindingSlot = false;
|
|
9064
|
-
_initializeQueue = /* @__PURE__ */ new Map();
|
|
9065
|
-
constructor(expressionString, pathSeqments, _indexValueAccessor, _stateManager, _mustProxifyItemHandlerFactory, _expressionChangeTransactionManager) {
|
|
9066
|
-
super(ExpressionType.Member, expressionString, ...pathSeqments), this._indexValueAccessor = _indexValueAccessor, this._stateManager = _stateManager, this._mustProxifyItemHandlerFactory = _mustProxifyItemHandlerFactory, this._expressionChangeTransactionManager = _expressionChangeTransactionManager;
|
|
9067
|
-
}
|
|
9068
|
-
initialize(settings) {
|
|
9069
|
-
super.initialize(settings);
|
|
9070
|
-
for (let i = 0; i < this._childExpressions.length; i++) {
|
|
9071
|
-
const currentSegment = this._childExpressions[i];
|
|
9072
|
-
if (i === 0 || this.isCalculated(currentSegment)) {
|
|
9073
|
-
currentSegment.initialize({
|
|
9074
|
-
...settings,
|
|
9075
|
-
mustProxifyHandler: this.getMustProxifyHandler(i)
|
|
9076
|
-
});
|
|
9077
|
-
}
|
|
9078
|
-
}
|
|
9079
|
-
return this;
|
|
9080
|
-
}
|
|
9081
|
-
internalDispose() {
|
|
9082
|
-
super.internalDispose();
|
|
9083
|
-
for (const slotObserver of this._slotObservers.values()) {
|
|
9084
|
-
this.disposeSlotObserver(slotObserver);
|
|
9085
|
-
}
|
|
9086
|
-
this._slotObservers.clear();
|
|
9087
|
-
this._initializeQueue.clear();
|
|
9088
|
-
}
|
|
9089
|
-
prepareReevaluation(sender, root, pendingCommits) {
|
|
9090
|
-
const senderIndex = this._childExpressions.indexOf(this.isCalculated(root) ? root : sender);
|
|
9091
|
-
if (senderIndex < 0) {
|
|
9092
|
-
return false;
|
|
9093
|
-
}
|
|
9094
|
-
if (this.shouldCancelEvaluate(senderIndex, pendingCommits)) {
|
|
9095
|
-
return false;
|
|
9096
|
-
}
|
|
9097
|
-
const pathSeqments = this._childExpressions;
|
|
9098
|
-
for (let i = senderIndex + 1; i < pathSeqments.length; i++) {
|
|
9099
|
-
if (!this.isCalculated(pathSeqments[i]) && !this.isPending(pathSeqments[i], pendingCommits)) {
|
|
9100
|
-
AbstractExpression.clearValue(pathSeqments[i]);
|
|
9101
|
-
}
|
|
9102
|
-
}
|
|
9103
|
-
return true;
|
|
9104
|
-
}
|
|
9105
|
-
evaluate(sender, root) {
|
|
9106
|
-
const senderIndex = this._childExpressions.indexOf(root.type === ExpressionType.Index ? root : sender);
|
|
9107
|
-
const senderExpr = this._childExpressions[senderIndex];
|
|
9108
|
-
if (senderExpr?.value === void 0) {
|
|
9109
|
-
return void 0;
|
|
9110
|
-
}
|
|
9111
|
-
const startIndex = this.isCalculated(this._childExpressions[senderIndex]) ? senderIndex - 1 : senderIndex + 1;
|
|
9112
|
-
let previousPathSegmentValue = this._childExpressions[startIndex - 1]?.value;
|
|
9113
|
-
if (startIndex > 0 && Type2.isNullOrUndefined(previousPathSegmentValue)) {
|
|
9114
|
-
return PENDING3;
|
|
9115
|
-
}
|
|
9116
|
-
for (let i = startIndex; i < this._childExpressions.length; i++) {
|
|
9117
|
-
const currentPathSegment = this._childExpressions[i];
|
|
9118
|
-
const currentPathSegmentValue = this.resolvePathSegment(currentPathSegment, previousPathSegmentValue, i);
|
|
9119
|
-
if (currentPathSegmentValue === PENDING3) {
|
|
9120
|
-
return currentPathSegmentValue;
|
|
9121
|
-
}
|
|
9122
|
-
previousPathSegmentValue = currentPathSegmentValue;
|
|
9123
|
-
}
|
|
9124
|
-
return previousPathSegmentValue;
|
|
9125
|
-
}
|
|
9126
|
-
isCommitTarget(sender) {
|
|
9127
|
-
return super.isCommitTarget(sender) || this.isCalculated(sender) && this._childExpressions[this._childExpressions.length - 1] === sender;
|
|
9128
|
-
}
|
|
9129
|
-
isPending(pathSegement, pendingCommits) {
|
|
9130
|
-
for (const commit of pendingCommits) {
|
|
9131
|
-
if (commit.owner === pathSegement) {
|
|
9132
|
-
return true;
|
|
9133
|
-
}
|
|
9134
|
-
}
|
|
9135
|
-
return false;
|
|
9136
|
-
}
|
|
9137
|
-
shouldCancelEvaluate(senderIndex, pendingCommits) {
|
|
9138
|
-
for (const commit of pendingCommits) {
|
|
9139
|
-
const index = this._childExpressions.indexOf(commit.owner);
|
|
9140
|
-
if (index >= 0 && index < senderIndex) {
|
|
9141
|
-
return true;
|
|
9142
|
-
}
|
|
9143
|
-
}
|
|
9144
|
-
return false;
|
|
9145
|
-
}
|
|
9146
|
-
initializePathSegement(pathSegment, settings, initialize) {
|
|
9147
|
-
this._initializeQueue.set(pathSegment, initialize ?? (() => pathSegment.initialize(settings)));
|
|
9148
|
-
queueMicrotask(() => {
|
|
9149
|
-
this._initializeQueue.get(pathSegment)?.();
|
|
9150
|
-
this._initializeQueue.delete(pathSegment);
|
|
9151
|
-
});
|
|
9152
|
-
}
|
|
9153
|
-
resolvePathSegment(pathSegment, previousPathSegmentValue, pathSegmentIndex) {
|
|
9154
|
-
const mustProxifyInfo = this.getMustProxifyHandler(pathSegmentIndex);
|
|
9155
|
-
if (!mustProxifyInfo.valid) {
|
|
9156
|
-
return PENDING3;
|
|
9157
|
-
}
|
|
9158
|
-
if (pathSegment.value === void 0) {
|
|
9159
|
-
this.initializePathSegement(pathSegment, {
|
|
9160
|
-
context: previousPathSegmentValue,
|
|
9161
|
-
mustProxifyHandler: mustProxifyInfo
|
|
9162
|
-
});
|
|
9356
|
+
const functionContext = Type2.toObject(this.objectExpression ? this.objectExpression?.value : this._context);
|
|
9357
|
+
if (!functionContext) {
|
|
9163
9358
|
return PENDING3;
|
|
9164
9359
|
}
|
|
9165
|
-
if (this.
|
|
9166
|
-
|
|
9360
|
+
if (this._functionContext !== functionContext) {
|
|
9361
|
+
this._functionContext = functionContext;
|
|
9167
9362
|
}
|
|
9168
|
-
|
|
9169
|
-
|
|
9363
|
+
const { functionName, argumentsExpression } = this;
|
|
9364
|
+
const args = argumentsExpression.value;
|
|
9365
|
+
if (!functionName || !args || !functionContext) {
|
|
9366
|
+
return PENDING3;
|
|
9170
9367
|
}
|
|
9171
|
-
|
|
9172
|
-
|
|
9173
|
-
|
|
9174
|
-
});
|
|
9175
|
-
return PENDING3;
|
|
9368
|
+
const func = Type2.cast(functionContext[functionName]);
|
|
9369
|
+
Assertion.assertIsFunction(func, func.name);
|
|
9370
|
+
return this.registerResult(func.call(functionContext, ...args));
|
|
9176
9371
|
}
|
|
9177
|
-
|
|
9178
|
-
|
|
9179
|
-
if (value === void 0) {
|
|
9180
|
-
return void 0;
|
|
9181
|
-
}
|
|
9182
|
-
const resolved = this._indexValueAccessor.getResolvedValue(previousContext, value);
|
|
9183
|
-
this.observeSlot(previousContext, index, current2, resolved, mustProxifyInfo);
|
|
9184
|
-
return resolved;
|
|
9372
|
+
get functionName() {
|
|
9373
|
+
return this.computed ? this.functionExpression.value : this.functionExpression.expressionString;
|
|
9185
9374
|
}
|
|
9186
|
-
|
|
9187
|
-
|
|
9188
|
-
|
|
9375
|
+
releaseResult() {
|
|
9376
|
+
this.stateManager.releaseState(this._functionContext, this._functionId);
|
|
9377
|
+
this._functionContext = void 0;
|
|
9189
9378
|
}
|
|
9190
|
-
|
|
9191
|
-
|
|
9192
|
-
|
|
9193
|
-
return this.createMustProxifyHandler(truePredicate);
|
|
9194
|
-
}
|
|
9195
|
-
if (nextExpression.type === ExpressionType.Identifier) {
|
|
9196
|
-
return {
|
|
9197
|
-
releaseMustProxifyHandler: /* @__PURE__ */ __name(() => this._mustProxifyItemHandlerFactory.release(nextExpression.expressionString), "releaseMustProxifyHandler"),
|
|
9198
|
-
createMustProxifyHandler: /* @__PURE__ */ __name(() => this._mustProxifyItemHandlerFactory.create(nextExpression.expressionString).instance, "createMustProxifyHandler"),
|
|
9199
|
-
valid: true
|
|
9200
|
-
};
|
|
9201
|
-
}
|
|
9202
|
-
if (nextExpression.value !== void 0 && this.isCalculated(nextExpression)) {
|
|
9203
|
-
return {
|
|
9204
|
-
releaseMustProxifyHandler: /* @__PURE__ */ __name(() => this._mustProxifyItemHandlerFactory.release(nextExpression.value), "releaseMustProxifyHandler"),
|
|
9205
|
-
createMustProxifyHandler: /* @__PURE__ */ __name(() => this._mustProxifyItemHandlerFactory.create(nextExpression.value).instance, "createMustProxifyHandler"),
|
|
9206
|
-
valid: true
|
|
9207
|
-
};
|
|
9208
|
-
}
|
|
9209
|
-
return {
|
|
9210
|
-
releaseMustProxifyHandler: void 0,
|
|
9211
|
-
createMustProxifyHandler: void 0,
|
|
9212
|
-
valid: false
|
|
9213
|
-
};
|
|
9379
|
+
registerResult(result) {
|
|
9380
|
+
this.stateManager.setState(this._functionContext, this._functionId, result);
|
|
9381
|
+
return result;
|
|
9214
9382
|
}
|
|
9215
|
-
|
|
9216
|
-
|
|
9217
|
-
|
|
9218
|
-
|
|
9219
|
-
|
|
9220
|
-
|
|
9383
|
+
};
|
|
9384
|
+
|
|
9385
|
+
// lib/expressions/greater-than-expression.ts
|
|
9386
|
+
var GreaterThanExpression = class extends BinaryExpression {
|
|
9387
|
+
static {
|
|
9388
|
+
__name(this, "GreaterThanExpression");
|
|
9221
9389
|
}
|
|
9222
|
-
|
|
9223
|
-
|
|
9224
|
-
if (slotObserver) {
|
|
9225
|
-
if (dynamicIndexExpression.value === slotObserver.index) {
|
|
9226
|
-
return;
|
|
9227
|
-
}
|
|
9228
|
-
this.disposeSlotObserver(slotObserver);
|
|
9229
|
-
this._slotObservers.delete(dynamicIndexExpression);
|
|
9230
|
-
this._rebindingSlot = true;
|
|
9231
|
-
}
|
|
9232
|
-
const staticIndexExpression = new IdentifierExpression(context, this._stateManager, "", this._expressionChangeTransactionManager, dynamicIndexExpression.value);
|
|
9233
|
-
this.initializePathSegement(staticIndexExpression, {
|
|
9234
|
-
currentValue: value,
|
|
9235
|
-
mustProxifyHandler
|
|
9236
|
-
}, () => {
|
|
9237
|
-
let initialized = false;
|
|
9238
|
-
const changeSubscription = staticIndexExpression.changed.subscribe(() => {
|
|
9239
|
-
if (initialized) {
|
|
9240
|
-
this.onSlotChanged(staticIndexExpression);
|
|
9241
|
-
}
|
|
9242
|
-
initialized = true;
|
|
9243
|
-
});
|
|
9244
|
-
this._slotObservers.set(dynamicIndexExpression, {
|
|
9245
|
-
staticIndexExpression,
|
|
9246
|
-
changeSubscription,
|
|
9247
|
-
index: dynamicIndexExpression.value,
|
|
9248
|
-
pathSegmentIndex
|
|
9249
|
-
});
|
|
9250
|
-
this._rebindingSlot = false;
|
|
9251
|
-
});
|
|
9390
|
+
constructor(expressionString, leftExpression, rightExpression) {
|
|
9391
|
+
super(ExpressionType.GreaterThan, expressionString, leftExpression, rightExpression);
|
|
9252
9392
|
}
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
this.evaluateBottomToTop(sender, this.root, /* @__PURE__ */ new Set());
|
|
9256
|
-
}
|
|
9393
|
+
evaluateExpression(a, b) {
|
|
9394
|
+
return a > b;
|
|
9257
9395
|
}
|
|
9258
|
-
|
|
9259
|
-
|
|
9396
|
+
};
|
|
9397
|
+
|
|
9398
|
+
// lib/expressions/greater-than-or-equal-expression.ts
|
|
9399
|
+
var GreaterThanOrEqualExpression = class extends BinaryExpression {
|
|
9400
|
+
static {
|
|
9401
|
+
__name(this, "GreaterThanOrEqualExpression");
|
|
9402
|
+
}
|
|
9403
|
+
constructor(expressionString, leftExpression, rightExpression) {
|
|
9404
|
+
super(ExpressionType.GreaterThanOrEqual, expressionString, leftExpression, rightExpression);
|
|
9405
|
+
}
|
|
9406
|
+
evaluateExpression(a, b) {
|
|
9407
|
+
return a >= b;
|
|
9260
9408
|
}
|
|
9261
9409
|
};
|
|
9262
9410
|
|
|
9263
9411
|
// lib/expressions/identifier-expression.ts
|
|
9412
|
+
import { ReplaySubject as ReplaySubject3 } from "rxjs";
|
|
9413
|
+
import { IndexWatchRule } from "@rs-x/state-manager";
|
|
9264
9414
|
var IndexValueObserver = class {
|
|
9265
9415
|
static {
|
|
9266
9416
|
__name(this, "IndexValueObserver");
|
|
9267
9417
|
}
|
|
9268
9418
|
_context;
|
|
9269
|
-
|
|
9270
|
-
|
|
9419
|
+
_index;
|
|
9420
|
+
_indexWatchRule;
|
|
9271
9421
|
_stateManager;
|
|
9422
|
+
setContext;
|
|
9272
9423
|
_changeSubscription;
|
|
9273
9424
|
_contextChangeSubscription;
|
|
9274
|
-
_changed = new
|
|
9275
|
-
_contextChanged = new Subject2();
|
|
9425
|
+
_changed = new ReplaySubject3(1);
|
|
9276
9426
|
_isDisposed = false;
|
|
9277
|
-
constructor(_context,
|
|
9427
|
+
constructor(_context, _index, _indexWatchRule, _stateManager, setContext) {
|
|
9278
9428
|
this._context = _context;
|
|
9279
|
-
this.
|
|
9280
|
-
this.
|
|
9429
|
+
this._index = _index;
|
|
9430
|
+
this._indexWatchRule = _indexWatchRule;
|
|
9281
9431
|
this._stateManager = _stateManager;
|
|
9432
|
+
this.setContext = setContext;
|
|
9282
9433
|
this._changeSubscription = this._stateManager.changed.subscribe(this.emitChange);
|
|
9283
9434
|
this._contextChangeSubscription = this._stateManager.contextChanged.subscribe(this.onContextCHanged);
|
|
9284
|
-
const value = this._stateManager.watchState(this._context, this.
|
|
9435
|
+
const value = this._stateManager.watchState(this._context, this._index, this._indexWatchRule);
|
|
9285
9436
|
if (value !== void 0) {
|
|
9286
9437
|
this.emitChange({
|
|
9287
|
-
|
|
9438
|
+
index: this._index,
|
|
9288
9439
|
context: this._context,
|
|
9289
9440
|
oldContext: this._context,
|
|
9290
9441
|
oldValue: void 0,
|
|
@@ -9295,29 +9446,26 @@ var IndexValueObserver = class {
|
|
|
9295
9446
|
get changed() {
|
|
9296
9447
|
return this._changed;
|
|
9297
9448
|
}
|
|
9298
|
-
get contextChanged() {
|
|
9299
|
-
return this._contextChanged;
|
|
9300
|
-
}
|
|
9301
9449
|
dispose() {
|
|
9302
9450
|
if (this._isDisposed) {
|
|
9303
9451
|
return;
|
|
9304
9452
|
}
|
|
9305
9453
|
this._changeSubscription.unsubscribe();
|
|
9306
9454
|
this._contextChangeSubscription.unsubscribe();
|
|
9307
|
-
this._stateManager.releaseState(this._context, this.
|
|
9455
|
+
this._stateManager.releaseState(this._context, this._index, this._indexWatchRule);
|
|
9308
9456
|
this._isDisposed = true;
|
|
9309
9457
|
}
|
|
9310
9458
|
getValue(context, key) {
|
|
9311
9459
|
return this._stateManager.getState(context, key);
|
|
9312
9460
|
}
|
|
9313
9461
|
onContextCHanged = /* @__PURE__ */ __name((change) => {
|
|
9314
|
-
if (this._context === change.oldContext && change.
|
|
9462
|
+
if (this._context === change.oldContext && change.index === this._index) {
|
|
9315
9463
|
this._context = change.context;
|
|
9316
|
-
this.
|
|
9464
|
+
this.setContext(this._context);
|
|
9317
9465
|
}
|
|
9318
9466
|
}, "onContextCHanged");
|
|
9319
9467
|
emitChange = /* @__PURE__ */ __name((change) => {
|
|
9320
|
-
if (this._context === change.context && change.
|
|
9468
|
+
if (this._context === change.context && change.index === this._index) {
|
|
9321
9469
|
this._changed.next(change);
|
|
9322
9470
|
}
|
|
9323
9471
|
}, "emitChange");
|
|
@@ -9326,68 +9474,79 @@ var IdentifierExpression = class extends AbstractExpression {
|
|
|
9326
9474
|
static {
|
|
9327
9475
|
__name(this, "IdentifierExpression");
|
|
9328
9476
|
}
|
|
9329
|
-
_rootContext;
|
|
9330
|
-
_stateManager;
|
|
9331
|
-
_expressionChangeTransactionManager;
|
|
9332
9477
|
_indexValue;
|
|
9333
9478
|
_changeSubscription;
|
|
9334
|
-
|
|
9479
|
+
_isBound = false;
|
|
9335
9480
|
_indexValueObserver;
|
|
9336
9481
|
releaseMustProxifyHandler;
|
|
9337
9482
|
_commitAfterInitialized;
|
|
9338
9483
|
_commitHandler;
|
|
9339
|
-
|
|
9340
|
-
|
|
9484
|
+
_context;
|
|
9485
|
+
_indexWatchRule;
|
|
9486
|
+
constructor(expressionString, _indexValue) {
|
|
9487
|
+
super(ExpressionType.Identifier, expressionString), this._indexValue = _indexValue;
|
|
9341
9488
|
this._commitHandler = {
|
|
9342
9489
|
owner: this,
|
|
9343
9490
|
commit: this.commit
|
|
9344
9491
|
};
|
|
9345
9492
|
}
|
|
9346
|
-
|
|
9347
|
-
this.
|
|
9348
|
-
|
|
9349
|
-
|
|
9493
|
+
clone() {
|
|
9494
|
+
return new this.constructor(this.expressionString, this._indexValue);
|
|
9495
|
+
}
|
|
9496
|
+
bind(settings) {
|
|
9497
|
+
this._isBound = false;
|
|
9498
|
+
super.bind(settings);
|
|
9499
|
+
this._context = settings.context ?? settings.rootContext;
|
|
9500
|
+
this._commitAfterInitialized = settings.context !== settings.rootContext;
|
|
9501
|
+
this._indexWatchRule = new IndexWatchRule(this._context, this.shouldWatchIndex);
|
|
9350
9502
|
if (!this._indexValueObserver) {
|
|
9351
|
-
this.observeChange(
|
|
9503
|
+
this.observeChange();
|
|
9352
9504
|
} else {
|
|
9353
|
-
const newValue = this._indexValueObserver.getValue(
|
|
9505
|
+
const newValue = this._indexValueObserver.getValue(this._context, this._indexValue ?? this.expressionString);
|
|
9354
9506
|
this.onValueChanged({
|
|
9355
|
-
|
|
9356
|
-
context:
|
|
9507
|
+
index: this._indexValue ?? this.expressionString,
|
|
9508
|
+
context: this._context,
|
|
9357
9509
|
oldValue: this._value,
|
|
9358
9510
|
newValue,
|
|
9359
|
-
oldContext:
|
|
9511
|
+
oldContext: this._context
|
|
9360
9512
|
});
|
|
9361
9513
|
}
|
|
9362
|
-
this.
|
|
9514
|
+
this._isBound = true;
|
|
9363
9515
|
return this;
|
|
9364
9516
|
}
|
|
9365
9517
|
internalDispose() {
|
|
9366
9518
|
super.internalDispose();
|
|
9367
9519
|
this.releaseMustProxifyHandler?.();
|
|
9368
9520
|
this.disposeObserver();
|
|
9521
|
+
this._indexWatchRule = void 0;
|
|
9369
9522
|
}
|
|
9370
9523
|
evaluate() {
|
|
9371
9524
|
return this._value;
|
|
9372
9525
|
}
|
|
9373
|
-
|
|
9374
|
-
|
|
9375
|
-
this.releaseMustProxifyHandler = mustProxifyHandler?.releaseMustProxifyHandler;
|
|
9376
|
-
const index = this._indexValue ?? this.expressionString;
|
|
9377
|
-
this._indexValueObserver = new IndexValueObserver(settings.context ?? this._rootContext, index, mustProxifyHandler?.createMustProxifyHandler?.(), this._stateManager);
|
|
9378
|
-
this._changeSubscription = this._indexValueObserver.changed.subscribe(this.onValueChanged);
|
|
9526
|
+
get isLeaf() {
|
|
9527
|
+
return !this.parent || this.parent.childExpressions[this.parent.childExpressions.length - 1] === this;
|
|
9379
9528
|
}
|
|
9380
|
-
|
|
9381
|
-
|
|
9382
|
-
|
|
9383
|
-
|
|
9384
|
-
|
|
9385
|
-
|
|
9529
|
+
get isMemberExpressionSegment() {
|
|
9530
|
+
return this.parent?.type === ExpressionType.Member && this.parent.childExpressions.includes(this);
|
|
9531
|
+
}
|
|
9532
|
+
shouldWatchIndex = /* @__PURE__ */ __name((targetIndex, target) => {
|
|
9533
|
+
const index = this._indexValue ?? this.expressionString;
|
|
9534
|
+
if (index !== targetIndex || this._context !== target) {
|
|
9535
|
+
return !!this.leafIndexWatchRule?.test(targetIndex, target);
|
|
9386
9536
|
}
|
|
9387
|
-
|
|
9388
|
-
|
|
9389
|
-
|
|
9390
|
-
}
|
|
9537
|
+
const value = this.indexValueAccessor.getValue(target, index);
|
|
9538
|
+
if (!this.isLeaf && this.isMemberExpressionSegment) {
|
|
9539
|
+
return this.valueMetadata.needsProxy(value);
|
|
9540
|
+
}
|
|
9541
|
+
if (this.isLeaf) {
|
|
9542
|
+
return this.valueMetadata.needsProxy(value) || !!this.leafIndexWatchRule?.test(targetIndex, target);
|
|
9543
|
+
}
|
|
9544
|
+
return false;
|
|
9545
|
+
}, "shouldWatchIndex");
|
|
9546
|
+
observeChange() {
|
|
9547
|
+
const index = this._indexValue ?? this.expressionString;
|
|
9548
|
+
this._indexValueObserver = new IndexValueObserver(this._context, index, this._indexWatchRule, this.stateManager, (context) => this._context = context);
|
|
9549
|
+
this._changeSubscription = this._indexValueObserver.changed.subscribe(this.onValueChanged);
|
|
9391
9550
|
}
|
|
9392
9551
|
disposeObserver() {
|
|
9393
9552
|
if (!this._changeSubscription) {
|
|
@@ -9404,9 +9563,9 @@ var IdentifierExpression = class extends AbstractExpression {
|
|
|
9404
9563
|
return;
|
|
9405
9564
|
}
|
|
9406
9565
|
this._value = stateChange.newValue;
|
|
9407
|
-
this.
|
|
9408
|
-
if (!this.
|
|
9409
|
-
this.
|
|
9566
|
+
this.transactionManager.registerChange(this.root, this._commitHandler);
|
|
9567
|
+
if (!this._isBound && this._commitAfterInitialized) {
|
|
9568
|
+
this.transactionManager.commit();
|
|
9410
9569
|
}
|
|
9411
9570
|
}, "onValueChanged");
|
|
9412
9571
|
};
|
|
@@ -9432,6 +9591,9 @@ var IndexExpression = class extends ParameterizedExpression {
|
|
|
9432
9591
|
constructor(expression) {
|
|
9433
9592
|
super(ExpressionType.Index, `[${expression}]`, expression);
|
|
9434
9593
|
}
|
|
9594
|
+
clone() {
|
|
9595
|
+
return new this.constructor(this._childExpressions[0].clone());
|
|
9596
|
+
}
|
|
9435
9597
|
get root() {
|
|
9436
9598
|
return this;
|
|
9437
9599
|
}
|
|
@@ -9513,6 +9675,9 @@ var LogicalNotExpression = class extends ParameterizedExpression {
|
|
|
9513
9675
|
constructor(expressionString, expression) {
|
|
9514
9676
|
super(ExpressionType.Not, expressionString, expression);
|
|
9515
9677
|
}
|
|
9678
|
+
clone() {
|
|
9679
|
+
return new this.constructor(this.expressionString, this._childExpressions[0].clone());
|
|
9680
|
+
}
|
|
9516
9681
|
evaluateExpression(value) {
|
|
9517
9682
|
return !value;
|
|
9518
9683
|
}
|
|
@@ -9531,6 +9696,195 @@ var LogicalOrExpression = class extends BinaryExpression {
|
|
|
9531
9696
|
}
|
|
9532
9697
|
};
|
|
9533
9698
|
|
|
9699
|
+
// lib/expressions/member-expression.ts
|
|
9700
|
+
import { PENDING as PENDING4, Type as Type3 } from "@rs-x/core";
|
|
9701
|
+
var MemberExpression = class extends AbstractExpression {
|
|
9702
|
+
static {
|
|
9703
|
+
__name(this, "MemberExpression");
|
|
9704
|
+
}
|
|
9705
|
+
_slotObservers = /* @__PURE__ */ new Map();
|
|
9706
|
+
_rebindingSlot = false;
|
|
9707
|
+
_initializeQueue = /* @__PURE__ */ new Map();
|
|
9708
|
+
constructor(expressionString, pathSeqments) {
|
|
9709
|
+
super(ExpressionType.Member, expressionString, ...pathSeqments);
|
|
9710
|
+
}
|
|
9711
|
+
clone() {
|
|
9712
|
+
return new this.constructor(this.expressionString, this._childExpressions.map((child) => child.clone()));
|
|
9713
|
+
}
|
|
9714
|
+
bind(settings) {
|
|
9715
|
+
super.bind(settings);
|
|
9716
|
+
for (let i = 0; i < this._childExpressions.length; i++) {
|
|
9717
|
+
const currentSegment = this._childExpressions[i];
|
|
9718
|
+
if (i === 0 || this.isCalculated(currentSegment)) {
|
|
9719
|
+
currentSegment.bind(settings);
|
|
9720
|
+
}
|
|
9721
|
+
}
|
|
9722
|
+
return this;
|
|
9723
|
+
}
|
|
9724
|
+
internalDispose() {
|
|
9725
|
+
super.internalDispose();
|
|
9726
|
+
for (const slotObserver of this._slotObservers.values()) {
|
|
9727
|
+
this.disposeSlotObserver(slotObserver);
|
|
9728
|
+
}
|
|
9729
|
+
this._slotObservers.clear();
|
|
9730
|
+
this._initializeQueue.clear();
|
|
9731
|
+
}
|
|
9732
|
+
prepareReevaluation(sender, root, pendingCommits) {
|
|
9733
|
+
const senderIndex = this._childExpressions.indexOf(this.isCalculated(root) ? root : sender);
|
|
9734
|
+
if (senderIndex < 0) {
|
|
9735
|
+
return false;
|
|
9736
|
+
}
|
|
9737
|
+
if (this.shouldCancelEvaluate(senderIndex, pendingCommits)) {
|
|
9738
|
+
return false;
|
|
9739
|
+
}
|
|
9740
|
+
const pathSeqments = this._childExpressions;
|
|
9741
|
+
for (let i = senderIndex + 1; i < pathSeqments.length; i++) {
|
|
9742
|
+
if (!this.isCalculated(pathSeqments[i]) && !this.isPending(pathSeqments[i], pendingCommits)) {
|
|
9743
|
+
AbstractExpression.clearValue(pathSeqments[i]);
|
|
9744
|
+
}
|
|
9745
|
+
}
|
|
9746
|
+
return true;
|
|
9747
|
+
}
|
|
9748
|
+
evaluate(sender, root) {
|
|
9749
|
+
const senderIndex = this._childExpressions.indexOf(root.type === ExpressionType.Index ? root : sender);
|
|
9750
|
+
const senderExpr = this._childExpressions[senderIndex];
|
|
9751
|
+
if (senderExpr?.value === void 0) {
|
|
9752
|
+
return void 0;
|
|
9753
|
+
}
|
|
9754
|
+
const startIndex = this.isCalculated(this._childExpressions[senderIndex]) ? senderIndex - 1 : senderIndex + 1;
|
|
9755
|
+
let previousPathSegmentValue = this._childExpressions[startIndex - 1]?.value;
|
|
9756
|
+
if (startIndex > 0 && Type3.isNullOrUndefined(previousPathSegmentValue)) {
|
|
9757
|
+
return PENDING4;
|
|
9758
|
+
}
|
|
9759
|
+
for (let i = startIndex; i < this._childExpressions.length; i++) {
|
|
9760
|
+
const currentPathSegment = this._childExpressions[i];
|
|
9761
|
+
const currentPathSegmentValue = this.resolvePathSegment(currentPathSegment, previousPathSegmentValue, i);
|
|
9762
|
+
if (currentPathSegmentValue === PENDING4) {
|
|
9763
|
+
return currentPathSegmentValue;
|
|
9764
|
+
}
|
|
9765
|
+
previousPathSegmentValue = currentPathSegmentValue;
|
|
9766
|
+
}
|
|
9767
|
+
return previousPathSegmentValue;
|
|
9768
|
+
}
|
|
9769
|
+
isCommitTarget(sender) {
|
|
9770
|
+
return super.isCommitTarget(sender) || this.isCalculated(sender) && this._childExpressions[this._childExpressions.length - 1] === sender;
|
|
9771
|
+
}
|
|
9772
|
+
shouldCancelEvaluate(senderIndex, pendingCommits) {
|
|
9773
|
+
for (const commit of pendingCommits) {
|
|
9774
|
+
const index = this._childExpressions.indexOf(commit.owner);
|
|
9775
|
+
if (index >= 0 && index < senderIndex) {
|
|
9776
|
+
return true;
|
|
9777
|
+
}
|
|
9778
|
+
}
|
|
9779
|
+
return false;
|
|
9780
|
+
}
|
|
9781
|
+
bindPathSegement(pathSegment, settings, bind) {
|
|
9782
|
+
this._initializeQueue.set(pathSegment, bind ?? (() => pathSegment.bind(settings)));
|
|
9783
|
+
queueMicrotask(() => {
|
|
9784
|
+
this._initializeQueue.get(pathSegment)?.();
|
|
9785
|
+
this._initializeQueue.delete(pathSegment);
|
|
9786
|
+
});
|
|
9787
|
+
}
|
|
9788
|
+
resolvePathSegment(pathSegment, previousPathSegmentValue, pathSegmentIndex) {
|
|
9789
|
+
const isPending = this.isPathSegmentPending(pathSegmentIndex);
|
|
9790
|
+
if (isPending) {
|
|
9791
|
+
return PENDING4;
|
|
9792
|
+
}
|
|
9793
|
+
if (pathSegment.value === void 0) {
|
|
9794
|
+
this.bindPathSegement(pathSegment, {
|
|
9795
|
+
context: previousPathSegmentValue,
|
|
9796
|
+
services: this.services,
|
|
9797
|
+
leafIndexWatchRule: this.leafIndexWatchRule
|
|
9798
|
+
});
|
|
9799
|
+
return PENDING4;
|
|
9800
|
+
}
|
|
9801
|
+
if (this.isCalculated(pathSegment)) {
|
|
9802
|
+
return this.resolveCalculated(pathSegment, previousPathSegmentValue, pathSegmentIndex);
|
|
9803
|
+
}
|
|
9804
|
+
if (pathSegment.value !== void 0) {
|
|
9805
|
+
return pathSegment.value;
|
|
9806
|
+
}
|
|
9807
|
+
this.bindPathSegement(pathSegment, {
|
|
9808
|
+
context: previousPathSegmentValue,
|
|
9809
|
+
services: this.services,
|
|
9810
|
+
leafIndexWatchRule: this.leafIndexWatchRule
|
|
9811
|
+
});
|
|
9812
|
+
return PENDING4;
|
|
9813
|
+
}
|
|
9814
|
+
resolveCalculated(current2, previousContext, index) {
|
|
9815
|
+
const { value } = current2;
|
|
9816
|
+
if (value === void 0) {
|
|
9817
|
+
return void 0;
|
|
9818
|
+
}
|
|
9819
|
+
const resolved = this.indexValueAccessor.getResolvedValue(previousContext, value);
|
|
9820
|
+
this.observeSlot(previousContext, index, current2, resolved);
|
|
9821
|
+
return resolved;
|
|
9822
|
+
}
|
|
9823
|
+
disposeSlotObserver(slotChangeSubscription) {
|
|
9824
|
+
slotChangeSubscription.changeSubscription.unsubscribe();
|
|
9825
|
+
slotChangeSubscription.staticIndexExpression.dispose();
|
|
9826
|
+
}
|
|
9827
|
+
isPathSegmentPending(currentIndex) {
|
|
9828
|
+
const nextExpression = this._childExpressions[currentIndex + 1];
|
|
9829
|
+
if (nextExpression === void 0 || nextExpression.type === ExpressionType.Identifier) {
|
|
9830
|
+
return false;
|
|
9831
|
+
}
|
|
9832
|
+
return nextExpression.value === void 0 || !this.isCalculated(nextExpression);
|
|
9833
|
+
}
|
|
9834
|
+
observeSlot(context, pathSegmentIndex, dynamicIndexExpression, value) {
|
|
9835
|
+
const slotObserver = this._slotObservers.get(dynamicIndexExpression);
|
|
9836
|
+
if (slotObserver) {
|
|
9837
|
+
if (dynamicIndexExpression.value === slotObserver.index) {
|
|
9838
|
+
return;
|
|
9839
|
+
}
|
|
9840
|
+
this.disposeSlotObserver(slotObserver);
|
|
9841
|
+
this._slotObservers.delete(dynamicIndexExpression);
|
|
9842
|
+
this._rebindingSlot = true;
|
|
9843
|
+
}
|
|
9844
|
+
const staticIndexExpression = new IdentifierExpression("", dynamicIndexExpression.value);
|
|
9845
|
+
this.bindPathSegement(staticIndexExpression, {
|
|
9846
|
+
context,
|
|
9847
|
+
currentValue: value,
|
|
9848
|
+
services: {
|
|
9849
|
+
...this.services,
|
|
9850
|
+
transactionManager: Type3.cast(void 0)
|
|
9851
|
+
},
|
|
9852
|
+
leafIndexWatchRule: this.leafIndexWatchRule
|
|
9853
|
+
}, () => {
|
|
9854
|
+
let bound = false;
|
|
9855
|
+
const changeSubscription = staticIndexExpression.changed.subscribe(() => {
|
|
9856
|
+
if (bound) {
|
|
9857
|
+
this.onSlotChanged(staticIndexExpression);
|
|
9858
|
+
}
|
|
9859
|
+
bound = true;
|
|
9860
|
+
});
|
|
9861
|
+
this._slotObservers.set(dynamicIndexExpression, {
|
|
9862
|
+
staticIndexExpression,
|
|
9863
|
+
changeSubscription,
|
|
9864
|
+
index: dynamicIndexExpression.value,
|
|
9865
|
+
pathSegmentIndex
|
|
9866
|
+
});
|
|
9867
|
+
this._rebindingSlot = false;
|
|
9868
|
+
});
|
|
9869
|
+
}
|
|
9870
|
+
onSlotChanged(sender) {
|
|
9871
|
+
if (!this._rebindingSlot) {
|
|
9872
|
+
this.evaluateBottomToTop(sender, this.root, /* @__PURE__ */ new Set());
|
|
9873
|
+
}
|
|
9874
|
+
}
|
|
9875
|
+
isPending(pathSegement, pendingCommits) {
|
|
9876
|
+
for (const commit of pendingCommits) {
|
|
9877
|
+
if (commit.owner === pathSegement) {
|
|
9878
|
+
return true;
|
|
9879
|
+
}
|
|
9880
|
+
}
|
|
9881
|
+
return false;
|
|
9882
|
+
}
|
|
9883
|
+
isCalculated(expression) {
|
|
9884
|
+
return expression.type === ExpressionType.Index;
|
|
9885
|
+
}
|
|
9886
|
+
};
|
|
9887
|
+
|
|
9534
9888
|
// lib/expressions/multiplication-expression.ts
|
|
9535
9889
|
var MultiplicationExpression = class extends BinaryExpression {
|
|
9536
9890
|
static {
|
|
@@ -9552,6 +9906,9 @@ var NewExpression = class extends ParameterizedExpression {
|
|
|
9552
9906
|
constructor(expressionString, constructorExpression, argumentExpressions) {
|
|
9553
9907
|
super(ExpressionType.New, expressionString, constructorExpression, ...argumentExpressions ?? []);
|
|
9554
9908
|
}
|
|
9909
|
+
clone() {
|
|
9910
|
+
return new this.constructor(this.expressionString, this._childExpressions[0].clone(), this._childExpressions.slice(1).map((arg) => arg.clone()));
|
|
9911
|
+
}
|
|
9555
9912
|
evaluateExpression(constructorFunction, ...args) {
|
|
9556
9913
|
if (!constructorFunction) {
|
|
9557
9914
|
return null;
|
|
@@ -9581,6 +9938,9 @@ var ObjectExpression = class extends ParameterizedExpression {
|
|
|
9581
9938
|
constructor(expressionString, propertyExpressions) {
|
|
9582
9939
|
super(ExpressionType.Object, expressionString, ...propertyExpressions);
|
|
9583
9940
|
}
|
|
9941
|
+
clone() {
|
|
9942
|
+
return new this.constructor(this.expressionString, this._childExpressions.map((child) => child.clone()));
|
|
9943
|
+
}
|
|
9584
9944
|
evaluateExpression(...args) {
|
|
9585
9945
|
return Object.assign({}, ...args);
|
|
9586
9946
|
}
|
|
@@ -9622,9 +9982,12 @@ var SequenceExpression = class extends AbstractExpression {
|
|
|
9622
9982
|
constructor(expressionString, expressions) {
|
|
9623
9983
|
super(ExpressionType.Sequence, expressionString, ...expressions);
|
|
9624
9984
|
}
|
|
9625
|
-
|
|
9626
|
-
|
|
9627
|
-
|
|
9985
|
+
clone() {
|
|
9986
|
+
return new this.constructor(this.expressionString, this._childExpressions.map((child) => child.clone()));
|
|
9987
|
+
}
|
|
9988
|
+
bind(settings) {
|
|
9989
|
+
super.bind(settings);
|
|
9990
|
+
this._childExpressions.forEach((childExpression) => childExpression.bind(settings));
|
|
9628
9991
|
return this;
|
|
9629
9992
|
}
|
|
9630
9993
|
evaluate() {
|
|
@@ -9641,6 +10004,9 @@ var SpreadExpression = class extends ParameterizedExpression {
|
|
|
9641
10004
|
constructor(expression) {
|
|
9642
10005
|
super(ExpressionType.Spread, `...${expression.expressionString}`, expression);
|
|
9643
10006
|
}
|
|
10007
|
+
clone() {
|
|
10008
|
+
return new this.constructor(this._childExpressions[0].clone());
|
|
10009
|
+
}
|
|
9644
10010
|
evaluateExpression(...args) {
|
|
9645
10011
|
return args[0];
|
|
9646
10012
|
}
|
|
@@ -9693,6 +10059,9 @@ var TemplateStringExpression = class extends CollectionExpression {
|
|
|
9693
10059
|
constructor(expressionString, expressions) {
|
|
9694
10060
|
super(ExpressionType.TemlateString, expressionString, expressions);
|
|
9695
10061
|
}
|
|
10062
|
+
clone() {
|
|
10063
|
+
return new this.constructor(this.expressionString, this._childExpressions.map((child) => child.clone()));
|
|
10064
|
+
}
|
|
9696
10065
|
evaluateExpression(...segments) {
|
|
9697
10066
|
return segments.join("");
|
|
9698
10067
|
}
|
|
@@ -9706,6 +10075,9 @@ var TypeofExpression = class extends ParameterizedExpression {
|
|
|
9706
10075
|
constructor(expressionString, expression) {
|
|
9707
10076
|
super(ExpressionType.Typeof, expressionString, expression);
|
|
9708
10077
|
}
|
|
10078
|
+
clone() {
|
|
10079
|
+
return new this.constructor(this.expressionString, this._childExpressions[0].clone());
|
|
10080
|
+
}
|
|
9709
10081
|
evaluateExpression(value) {
|
|
9710
10082
|
return typeof value;
|
|
9711
10083
|
}
|
|
@@ -9719,219 +10091,39 @@ var UnaryNegationExpression = class extends ParameterizedExpression {
|
|
|
9719
10091
|
constructor(expressionString, expression) {
|
|
9720
10092
|
super(ExpressionType.UnaryNegation, expressionString, expression);
|
|
9721
10093
|
}
|
|
10094
|
+
clone() {
|
|
10095
|
+
return new this.constructor(this.expressionString, this._childExpressions[0].clone());
|
|
10096
|
+
}
|
|
9722
10097
|
evaluateExpression(value) {
|
|
9723
10098
|
return -value;
|
|
9724
10099
|
}
|
|
9725
10100
|
};
|
|
9726
10101
|
|
|
9727
|
-
// lib/
|
|
9728
|
-
|
|
9729
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9730
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
9731
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9732
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9733
|
-
}
|
|
9734
|
-
__name(_ts_decorate4, "_ts_decorate");
|
|
9735
|
-
function _ts_metadata4(k, v) {
|
|
9736
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9737
|
-
}
|
|
9738
|
-
__name(_ts_metadata4, "_ts_metadata");
|
|
9739
|
-
function _ts_param4(paramIndex, decorator) {
|
|
9740
|
-
return function(target, key) {
|
|
9741
|
-
decorator(target, key, paramIndex);
|
|
9742
|
-
};
|
|
9743
|
-
}
|
|
9744
|
-
__name(_ts_param4, "_ts_param");
|
|
9745
|
-
var DeepCloneExceptWithExpressionSupport = class {
|
|
9746
|
-
static {
|
|
9747
|
-
__name(this, "DeepCloneExceptWithExpressionSupport");
|
|
9748
|
-
}
|
|
9749
|
-
_defaultDeepCloneValueGetter;
|
|
9750
|
-
constructor(_defaultDeepCloneValueGetter) {
|
|
9751
|
-
this._defaultDeepCloneValueGetter = _defaultDeepCloneValueGetter;
|
|
9752
|
-
}
|
|
9753
|
-
except(source) {
|
|
9754
|
-
if (source instanceof AbstractExpression) {
|
|
9755
|
-
return source.value;
|
|
9756
|
-
}
|
|
9757
|
-
return this._defaultDeepCloneValueGetter.except(source);
|
|
9758
|
-
}
|
|
9759
|
-
};
|
|
9760
|
-
DeepCloneExceptWithExpressionSupport = _ts_decorate4([
|
|
9761
|
-
Injectable4(),
|
|
9762
|
-
_ts_param4(0, Inject4(RsXCoreInjectionTokens.IDeepCloneExcept)),
|
|
9763
|
-
_ts_metadata4("design:type", Function),
|
|
9764
|
-
_ts_metadata4("design:paramtypes", [
|
|
9765
|
-
typeof IDeepCloneExcept === "undefined" ? Object : IDeepCloneExcept
|
|
9766
|
-
])
|
|
9767
|
-
], DeepCloneExceptWithExpressionSupport);
|
|
9768
|
-
|
|
9769
|
-
// lib/expression-observer/expression-index-accessor.ts
|
|
9770
|
-
import { Injectable as Injectable5, Type as Type3, UnsupportedException } from "@rs-x/core";
|
|
9771
|
-
function _ts_decorate5(decorators, target, key, desc) {
|
|
9772
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9773
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
9774
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9775
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9776
|
-
}
|
|
9777
|
-
__name(_ts_decorate5, "_ts_decorate");
|
|
9778
|
-
var ExpressionIndexAccessor = class {
|
|
9779
|
-
static {
|
|
9780
|
-
__name(this, "ExpressionIndexAccessor");
|
|
9781
|
-
}
|
|
9782
|
-
priority;
|
|
9783
|
-
isAsync() {
|
|
9784
|
-
return true;
|
|
9785
|
-
}
|
|
9786
|
-
getResolvedValue(context, index) {
|
|
9787
|
-
return Type3.cast((Type3.toObject(context) ?? {})[index])?.value;
|
|
9788
|
-
}
|
|
9789
|
-
hasValue(context, index) {
|
|
9790
|
-
return Type3.cast((Type3.toObject(context) ?? {})[index])?.value !== void 0;
|
|
9791
|
-
}
|
|
9792
|
-
getValue(context, index) {
|
|
9793
|
-
return (Type3.toObject(context) ?? {})[index];
|
|
9794
|
-
}
|
|
9795
|
-
setValue() {
|
|
9796
|
-
throw new UnsupportedException("Cannot set the value of an expression directly. To update it, modify the relevant properties in the expression context.");
|
|
9797
|
-
}
|
|
9798
|
-
getIndexes() {
|
|
9799
|
-
return [].values();
|
|
9800
|
-
}
|
|
9801
|
-
applies(context, index) {
|
|
9802
|
-
return (Type3.toObject(context) ?? {})[index] instanceof AbstractExpression;
|
|
9803
|
-
}
|
|
9804
|
-
};
|
|
9805
|
-
ExpressionIndexAccessor = _ts_decorate5([
|
|
9806
|
-
Injectable5()
|
|
9807
|
-
], ExpressionIndexAccessor);
|
|
9808
|
-
|
|
9809
|
-
// lib/expression-observer/expression-observer-proxy-pair.factory.ts
|
|
9810
|
-
import { Inject as Inject5, Injectable as Injectable6 } from "@rs-x/core";
|
|
9811
|
-
function _ts_decorate6(decorators, target, key, desc) {
|
|
9812
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9813
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
9814
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9815
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9816
|
-
}
|
|
9817
|
-
__name(_ts_decorate6, "_ts_decorate");
|
|
9818
|
-
function _ts_metadata5(k, v) {
|
|
9819
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9820
|
-
}
|
|
9821
|
-
__name(_ts_metadata5, "_ts_metadata");
|
|
9822
|
-
function _ts_param5(paramIndex, decorator) {
|
|
9823
|
-
return function(target, key) {
|
|
9824
|
-
decorator(target, key, paramIndex);
|
|
9825
|
-
};
|
|
9826
|
-
}
|
|
9827
|
-
__name(_ts_param5, "_ts_param");
|
|
9828
|
-
var ExpressionObserverProxyPairFactory = class {
|
|
9829
|
-
static {
|
|
9830
|
-
__name(this, "ExpressionObserverProxyPairFactory");
|
|
9831
|
-
}
|
|
9832
|
-
_expressionObserverFactory;
|
|
9833
|
-
priority = 100;
|
|
9834
|
-
constructor(_expressionObserverFactory) {
|
|
9835
|
-
this._expressionObserverFactory = _expressionObserverFactory;
|
|
9836
|
-
}
|
|
9837
|
-
create(owner, proxyTarget) {
|
|
9838
|
-
return {
|
|
9839
|
-
observer: this._expressionObserverFactory.create({
|
|
9840
|
-
owner,
|
|
9841
|
-
expression: proxyTarget.target
|
|
9842
|
-
}).instance
|
|
9843
|
-
};
|
|
9844
|
-
}
|
|
9845
|
-
applies(object) {
|
|
9846
|
-
return object instanceof AbstractExpression;
|
|
9847
|
-
}
|
|
9848
|
-
};
|
|
9849
|
-
ExpressionObserverProxyPairFactory = _ts_decorate6([
|
|
9850
|
-
Injectable6(),
|
|
9851
|
-
_ts_param5(0, Inject5(RsXExpressionParserInjectionTokens.IExpressionObserverFactory)),
|
|
9852
|
-
_ts_metadata5("design:type", Function),
|
|
9853
|
-
_ts_metadata5("design:paramtypes", [
|
|
9854
|
-
typeof IExpressionObserverFactory === "undefined" ? Object : IExpressionObserverFactory
|
|
9855
|
-
])
|
|
9856
|
-
], ExpressionObserverProxyPairFactory);
|
|
9857
|
-
|
|
9858
|
-
// lib/expression-observer/expression-observer.factory.ts
|
|
9859
|
-
import { Injectable as Injectable7, SingletonFactory as SingletonFactory2 } from "@rs-x/core";
|
|
9860
|
-
import { AbstractObserver } from "@rs-x/state-manager";
|
|
9861
|
-
import { ReplaySubject as ReplaySubject3 } from "rxjs";
|
|
9862
|
-
function _ts_decorate7(decorators, target, key, desc) {
|
|
9863
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9864
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
9865
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9866
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9867
|
-
}
|
|
9868
|
-
__name(_ts_decorate7, "_ts_decorate");
|
|
9869
|
-
function _ts_metadata6(k, v) {
|
|
9870
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9871
|
-
}
|
|
9872
|
-
__name(_ts_metadata6, "_ts_metadata");
|
|
9873
|
-
var ExpressionObserver = class ExpressionObserver2 extends AbstractObserver {
|
|
9874
|
-
static {
|
|
9875
|
-
__name(this, "ExpressionObserver");
|
|
9876
|
-
}
|
|
9877
|
-
_changedSubsctiption;
|
|
9878
|
-
constructor(owner, target) {
|
|
9879
|
-
super(owner, target, void 0, new ReplaySubject3(1));
|
|
9880
|
-
this._changedSubsctiption = target.changed.subscribe(this.onExpressionChanged);
|
|
9881
|
-
}
|
|
9882
|
-
disposeInternal() {
|
|
9883
|
-
this._changedSubsctiption.unsubscribe();
|
|
9884
|
-
}
|
|
9885
|
-
onExpressionChanged = /* @__PURE__ */ __name((expression) => {
|
|
9886
|
-
this.emitChange({
|
|
9887
|
-
arguments: [],
|
|
9888
|
-
chain: [],
|
|
9889
|
-
target: this.target,
|
|
9890
|
-
newValue: expression.value
|
|
9891
|
-
});
|
|
9892
|
-
}, "onExpressionChanged");
|
|
9893
|
-
};
|
|
9894
|
-
var ExpressionObserverFactory = class extends SingletonFactory2 {
|
|
10102
|
+
// lib/expressions/unary-plus-expression.ts
|
|
10103
|
+
var UnaryPlusExpression = class extends ParameterizedExpression {
|
|
9895
10104
|
static {
|
|
9896
|
-
__name(this, "
|
|
9897
|
-
}
|
|
9898
|
-
constructor() {
|
|
9899
|
-
super();
|
|
9900
|
-
}
|
|
9901
|
-
getId(data2) {
|
|
9902
|
-
return data2.expression;
|
|
10105
|
+
__name(this, "UnaryPlusExpression");
|
|
9903
10106
|
}
|
|
9904
|
-
|
|
9905
|
-
|
|
10107
|
+
constructor(expressionString, expression) {
|
|
10108
|
+
super(ExpressionType.UnaryPlus, expressionString, expression);
|
|
9906
10109
|
}
|
|
9907
|
-
|
|
9908
|
-
return new
|
|
9909
|
-
canDispose: /* @__PURE__ */ __name(() => this.getReferenceCount(id) === 1, "canDispose"),
|
|
9910
|
-
release: /* @__PURE__ */ __name(() => {
|
|
9911
|
-
this.release(id);
|
|
9912
|
-
data2.owner?.release();
|
|
9913
|
-
}, "release")
|
|
9914
|
-
}, data2.expression);
|
|
10110
|
+
clone() {
|
|
10111
|
+
return new this.constructor(this.expressionString, this._childExpressions[0].clone());
|
|
9915
10112
|
}
|
|
9916
|
-
|
|
9917
|
-
|
|
10113
|
+
evaluateExpression(a) {
|
|
10114
|
+
return +a;
|
|
9918
10115
|
}
|
|
9919
10116
|
};
|
|
9920
|
-
ExpressionObserverFactory = _ts_decorate7([
|
|
9921
|
-
Injectable7(),
|
|
9922
|
-
_ts_metadata6("design:type", Function),
|
|
9923
|
-
_ts_metadata6("design:paramtypes", [])
|
|
9924
|
-
], ExpressionObserverFactory);
|
|
9925
10117
|
|
|
9926
10118
|
// lib/identifier-owner-resolver/array-index-owner-resolver.ts
|
|
9927
|
-
import { Injectable as
|
|
9928
|
-
function
|
|
10119
|
+
import { Injectable as Injectable10 } from "@rs-x/core";
|
|
10120
|
+
function _ts_decorate10(decorators, target, key, desc) {
|
|
9929
10121
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9930
10122
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
9931
10123
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9932
10124
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9933
10125
|
}
|
|
9934
|
-
__name(
|
|
10126
|
+
__name(_ts_decorate10, "_ts_decorate");
|
|
9935
10127
|
var ArrayIndexOwnerResolver = class {
|
|
9936
10128
|
static {
|
|
9937
10129
|
__name(this, "ArrayIndexOwnerResolver");
|
|
@@ -9944,29 +10136,29 @@ var ArrayIndexOwnerResolver = class {
|
|
|
9944
10136
|
return normalizedIndex >= 0 && normalizedIndex < array.length ? array : null;
|
|
9945
10137
|
}
|
|
9946
10138
|
};
|
|
9947
|
-
ArrayIndexOwnerResolver =
|
|
9948
|
-
|
|
10139
|
+
ArrayIndexOwnerResolver = _ts_decorate10([
|
|
10140
|
+
Injectable10()
|
|
9949
10141
|
], ArrayIndexOwnerResolver);
|
|
9950
10142
|
|
|
9951
10143
|
// lib/identifier-owner-resolver/default-identifier-owner-resolver.ts
|
|
9952
|
-
import { Injectable as
|
|
9953
|
-
function
|
|
10144
|
+
import { Injectable as Injectable11, MultiInject } from "@rs-x/core";
|
|
10145
|
+
function _ts_decorate11(decorators, target, key, desc) {
|
|
9954
10146
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9955
10147
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
9956
10148
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9957
10149
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9958
10150
|
}
|
|
9959
|
-
__name(
|
|
9960
|
-
function
|
|
10151
|
+
__name(_ts_decorate11, "_ts_decorate");
|
|
10152
|
+
function _ts_metadata9(k, v) {
|
|
9961
10153
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9962
10154
|
}
|
|
9963
|
-
__name(
|
|
9964
|
-
function
|
|
10155
|
+
__name(_ts_metadata9, "_ts_metadata");
|
|
10156
|
+
function _ts_param8(paramIndex, decorator) {
|
|
9965
10157
|
return function(target, key) {
|
|
9966
10158
|
decorator(target, key, paramIndex);
|
|
9967
10159
|
};
|
|
9968
10160
|
}
|
|
9969
|
-
__name(
|
|
10161
|
+
__name(_ts_param8, "_ts_param");
|
|
9970
10162
|
var DefaultIdentifierOwnerResolver = class {
|
|
9971
10163
|
static {
|
|
9972
10164
|
__name(this, "DefaultIdentifierOwnerResolver");
|
|
@@ -9986,24 +10178,24 @@ var DefaultIdentifierOwnerResolver = class {
|
|
|
9986
10178
|
return null;
|
|
9987
10179
|
}
|
|
9988
10180
|
};
|
|
9989
|
-
DefaultIdentifierOwnerResolver =
|
|
9990
|
-
|
|
9991
|
-
|
|
9992
|
-
|
|
9993
|
-
|
|
10181
|
+
DefaultIdentifierOwnerResolver = _ts_decorate11([
|
|
10182
|
+
Injectable11(),
|
|
10183
|
+
_ts_param8(0, MultiInject(RsXExpressionParserInjectionTokens.IIdentifierOwnerResolverList)),
|
|
10184
|
+
_ts_metadata9("design:type", Function),
|
|
10185
|
+
_ts_metadata9("design:paramtypes", [
|
|
9994
10186
|
Object
|
|
9995
10187
|
])
|
|
9996
10188
|
], DefaultIdentifierOwnerResolver);
|
|
9997
10189
|
|
|
9998
10190
|
// lib/identifier-owner-resolver/map-key-owner-resolver.ts
|
|
9999
|
-
import { Injectable as
|
|
10000
|
-
function
|
|
10191
|
+
import { Injectable as Injectable12 } from "@rs-x/core";
|
|
10192
|
+
function _ts_decorate12(decorators, target, key, desc) {
|
|
10001
10193
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
10002
10194
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
10003
10195
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
10004
10196
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10005
10197
|
}
|
|
10006
|
-
__name(
|
|
10198
|
+
__name(_ts_decorate12, "_ts_decorate");
|
|
10007
10199
|
var MapKeyOwnerResolver = class {
|
|
10008
10200
|
static {
|
|
10009
10201
|
__name(this, "MapKeyOwnerResolver");
|
|
@@ -10012,19 +10204,19 @@ var MapKeyOwnerResolver = class {
|
|
|
10012
10204
|
return map.has?.(index) ? map : null;
|
|
10013
10205
|
}
|
|
10014
10206
|
};
|
|
10015
|
-
MapKeyOwnerResolver =
|
|
10016
|
-
|
|
10207
|
+
MapKeyOwnerResolver = _ts_decorate12([
|
|
10208
|
+
Injectable12()
|
|
10017
10209
|
], MapKeyOwnerResolver);
|
|
10018
10210
|
|
|
10019
10211
|
// lib/identifier-owner-resolver/property-owner-resolver.ts
|
|
10020
|
-
import { Injectable as
|
|
10021
|
-
function
|
|
10212
|
+
import { Injectable as Injectable13, Type as Type4 } from "@rs-x/core";
|
|
10213
|
+
function _ts_decorate13(decorators, target, key, desc) {
|
|
10022
10214
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
10023
10215
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
10024
10216
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
10025
10217
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10026
10218
|
}
|
|
10027
|
-
__name(
|
|
10219
|
+
__name(_ts_decorate13, "_ts_decorate");
|
|
10028
10220
|
var PropertyOwnerResolver = class {
|
|
10029
10221
|
static {
|
|
10030
10222
|
__name(this, "PropertyOwnerResolver");
|
|
@@ -10033,13 +10225,11 @@ var PropertyOwnerResolver = class {
|
|
|
10033
10225
|
return Type4.hasProperty(context, index) ? context : null;
|
|
10034
10226
|
}
|
|
10035
10227
|
};
|
|
10036
|
-
PropertyOwnerResolver =
|
|
10037
|
-
|
|
10228
|
+
PropertyOwnerResolver = _ts_decorate13([
|
|
10229
|
+
Injectable13()
|
|
10038
10230
|
], PropertyOwnerResolver);
|
|
10039
10231
|
|
|
10040
10232
|
// lib/js-espree-expression-parser.ts
|
|
10041
|
-
import { Inject as Inject6, Injectable as Injectable12, ParserException, RsXCoreInjectionTokens as RsXCoreInjectionTokens2, Type as Type5, UnsupportedException as UnsupportedException2 } from "@rs-x/core";
|
|
10042
|
-
import { RsXStateManagerInjectionTokens as RsXStateManagerInjectionTokens2 } from "@rs-x/state-manager";
|
|
10043
10233
|
import { generate as astToString } from "astring";
|
|
10044
10234
|
|
|
10045
10235
|
// ../node_modules/acorn/dist/acorn.mjs
|
|
@@ -16538,49 +16728,34 @@ var supportedEcmaVersions = getSupportedEcmaVersions();
|
|
|
16538
16728
|
|
|
16539
16729
|
// lib/js-espree-expression-parser.ts
|
|
16540
16730
|
var estraverse = __toESM(require_estraverse(), 1);
|
|
16541
|
-
|
|
16731
|
+
import { Injectable as Injectable14, ParserException, Type as Type5, UnsupportedException as UnsupportedException2 } from "@rs-x/core";
|
|
16732
|
+
function _ts_decorate14(decorators, target, key, desc) {
|
|
16542
16733
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16543
16734
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
16544
16735
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
16545
16736
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16546
16737
|
}
|
|
16547
|
-
__name(
|
|
16548
|
-
function
|
|
16738
|
+
__name(_ts_decorate14, "_ts_decorate");
|
|
16739
|
+
function _ts_metadata10(k, v) {
|
|
16549
16740
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
16550
16741
|
}
|
|
16551
|
-
__name(
|
|
16552
|
-
function _ts_param7(paramIndex, decorator) {
|
|
16553
|
-
return function(target, key) {
|
|
16554
|
-
decorator(target, key, paramIndex);
|
|
16555
|
-
};
|
|
16556
|
-
}
|
|
16557
|
-
__name(_ts_param7, "_ts_param");
|
|
16742
|
+
__name(_ts_metadata10, "_ts_metadata");
|
|
16558
16743
|
var JsEspreeExpressionParser = class {
|
|
16559
16744
|
static {
|
|
16560
16745
|
__name(this, "JsEspreeExpressionParser");
|
|
16561
16746
|
}
|
|
16562
|
-
_indexValueAccessor;
|
|
16563
|
-
_mustProxifyItemHandlerFactory;
|
|
16564
|
-
_expressionChangeTransactionManager;
|
|
16565
|
-
_stateManager;
|
|
16566
|
-
_guidFactory;
|
|
16567
16747
|
static instance;
|
|
16568
16748
|
createConstantExpression = {
|
|
16569
|
-
string: /* @__PURE__ */ __name((literal2) => new ConstantStringExpression(literal2.value
|
|
16570
|
-
number: /* @__PURE__ */ __name((literal2) => new ConstantNumberExpression(Number(literal2.value)
|
|
16571
|
-
boolean: /* @__PURE__ */ __name((literal2) => new ConstantBooleanExpression(Boolean(literal2.value)
|
|
16572
|
-
bigint: /* @__PURE__ */ __name((literal2) => new ConstantBigIntExpression(BigInt(literal2.value)
|
|
16749
|
+
string: /* @__PURE__ */ __name((literal2) => new ConstantStringExpression(literal2.value), "string"),
|
|
16750
|
+
number: /* @__PURE__ */ __name((literal2) => new ConstantNumberExpression(Number(literal2.value)), "number"),
|
|
16751
|
+
boolean: /* @__PURE__ */ __name((literal2) => new ConstantBooleanExpression(Boolean(literal2.value)), "boolean"),
|
|
16752
|
+
bigint: /* @__PURE__ */ __name((literal2) => new ConstantBigIntExpression(BigInt(literal2.value)), "bigint")
|
|
16573
16753
|
};
|
|
16574
16754
|
expressionFactories;
|
|
16575
16755
|
unaryExpressionFactories;
|
|
16576
16756
|
binaryExpressionFactories;
|
|
16577
16757
|
logicalExpressionFactories;
|
|
16578
|
-
constructor(
|
|
16579
|
-
this._indexValueAccessor = _indexValueAccessor;
|
|
16580
|
-
this._mustProxifyItemHandlerFactory = _mustProxifyItemHandlerFactory;
|
|
16581
|
-
this._expressionChangeTransactionManager = _expressionChangeTransactionManager;
|
|
16582
|
-
this._stateManager = _stateManager;
|
|
16583
|
-
this._guidFactory = _guidFactory;
|
|
16758
|
+
constructor() {
|
|
16584
16759
|
this.expressionFactories = {
|
|
16585
16760
|
["UnaryExpression"]: this.createUnaryExpression,
|
|
16586
16761
|
["BinaryExpression"]: this.createBinaryExpression,
|
|
@@ -16642,42 +16817,36 @@ var JsEspreeExpressionParser = class {
|
|
|
16642
16817
|
"??": this.createNullishCoalescingExpression
|
|
16643
16818
|
};
|
|
16644
16819
|
}
|
|
16645
|
-
parse(
|
|
16820
|
+
parse(expressionString) {
|
|
16646
16821
|
const espreeExpression = this.tryParse(expressionString);
|
|
16647
16822
|
let expression;
|
|
16648
16823
|
try {
|
|
16649
|
-
expression = this.createExpression(espreeExpression
|
|
16824
|
+
expression = this.createExpression(espreeExpression);
|
|
16650
16825
|
} catch (e) {
|
|
16651
16826
|
if (e instanceof Error) {
|
|
16652
16827
|
throw new ParserException(expressionString, e.message);
|
|
16653
16828
|
}
|
|
16654
16829
|
throw new ParserException(expressionString, String(e));
|
|
16655
16830
|
}
|
|
16656
|
-
expression.initialize({
|
|
16657
|
-
context,
|
|
16658
|
-
transactionManager: this._expressionChangeTransactionManager,
|
|
16659
|
-
owner
|
|
16660
|
-
});
|
|
16661
|
-
this._expressionChangeTransactionManager.commit();
|
|
16662
16831
|
return expression;
|
|
16663
16832
|
}
|
|
16664
16833
|
tryParse(expressionString) {
|
|
16665
16834
|
return this.parseExpression(expressionString).expression;
|
|
16666
16835
|
}
|
|
16667
|
-
createExpression(expression
|
|
16836
|
+
createExpression(expression) {
|
|
16668
16837
|
if (!(expression.type in this.expressionFactories)) {
|
|
16669
16838
|
throw new UnsupportedException2(`Unsupported expression type ${expression.type}`);
|
|
16670
16839
|
}
|
|
16671
16840
|
const factory = this.expressionFactories[expression.type];
|
|
16672
|
-
return factory(Type5.cast(expression)
|
|
16841
|
+
return factory(Type5.cast(expression));
|
|
16673
16842
|
}
|
|
16674
16843
|
createLiteralExpression = /* @__PURE__ */ __name((expression) => {
|
|
16675
16844
|
if (expression.regex) {
|
|
16676
16845
|
const regExpLiteral = expression;
|
|
16677
|
-
return new ConstantRegExpExpression(astToString(expression), new RegExp(regExpLiteral.regex.pattern, regExpLiteral.regex.flags)
|
|
16846
|
+
return new ConstantRegExpExpression(astToString(expression), new RegExp(regExpLiteral.regex.pattern, regExpLiteral.regex.flags));
|
|
16678
16847
|
}
|
|
16679
16848
|
if (expression.value === null) {
|
|
16680
|
-
return new ConstantNullExpression(
|
|
16849
|
+
return new ConstantNullExpression();
|
|
16681
16850
|
}
|
|
16682
16851
|
const valueType = typeof expression.value;
|
|
16683
16852
|
if (valueType === "string" || valueType === "number" || valueType === "boolean" || valueType === "bigint") {
|
|
@@ -16685,62 +16854,62 @@ var JsEspreeExpressionParser = class {
|
|
|
16685
16854
|
}
|
|
16686
16855
|
throw new UnsupportedException2(`Unsupported literal type: ${valueType}`);
|
|
16687
16856
|
}, "createLiteralExpression");
|
|
16688
|
-
createBinaryExpression = /* @__PURE__ */ __name((expression
|
|
16689
|
-
return this.binaryExpressionFactories[expression.operator](expression
|
|
16857
|
+
createBinaryExpression = /* @__PURE__ */ __name((expression) => {
|
|
16858
|
+
return this.binaryExpressionFactories[expression.operator](expression);
|
|
16690
16859
|
}, "createBinaryExpression");
|
|
16691
16860
|
createAssignmentExpression = /* @__PURE__ */ __name(() => {
|
|
16692
16861
|
throw new UnsupportedException2("Assignment expressions are not supported");
|
|
16693
16862
|
}, "createAssignmentExpression");
|
|
16694
|
-
createUnaryExpression = /* @__PURE__ */ __name((expression
|
|
16695
|
-
return this.unaryExpressionFactories[expression.operator](expression
|
|
16863
|
+
createUnaryExpression = /* @__PURE__ */ __name((expression) => {
|
|
16864
|
+
return this.unaryExpressionFactories[expression.operator](expression);
|
|
16696
16865
|
}, "createUnaryExpression");
|
|
16697
|
-
createConditionalExpression = /* @__PURE__ */ __name((expression
|
|
16698
|
-
return new ConditionalExpression(astToString(expression), this.createExpression(expression.test
|
|
16866
|
+
createConditionalExpression = /* @__PURE__ */ __name((expression) => {
|
|
16867
|
+
return new ConditionalExpression(astToString(expression), this.createExpression(expression.test), this.createExpression(expression.consequent), this.createExpression(expression.alternate));
|
|
16699
16868
|
}, "createConditionalExpression");
|
|
16700
|
-
createLogicalExpression = /* @__PURE__ */ __name((expression
|
|
16701
|
-
return this.logicalExpressionFactories[expression.operator](expression
|
|
16869
|
+
createLogicalExpression = /* @__PURE__ */ __name((expression) => {
|
|
16870
|
+
return this.logicalExpressionFactories[expression.operator](expression);
|
|
16702
16871
|
}, "createLogicalExpression");
|
|
16703
|
-
createChainExpression = /* @__PURE__ */ __name((expression
|
|
16704
|
-
return this.createExpression(expression.expression
|
|
16872
|
+
createChainExpression = /* @__PURE__ */ __name((expression) => {
|
|
16873
|
+
return this.createExpression(expression.expression);
|
|
16705
16874
|
}, "createChainExpression");
|
|
16706
|
-
createMemberExpression = /* @__PURE__ */ __name((expression
|
|
16875
|
+
createMemberExpression = /* @__PURE__ */ __name((expression) => {
|
|
16707
16876
|
const pathSegments = this.flattenMemberExpression(expression).map((e) => {
|
|
16708
|
-
const expression2 = this.createExpression(e.expression
|
|
16877
|
+
const expression2 = this.createExpression(e.expression);
|
|
16709
16878
|
return e.computed ? new IndexExpression(expression2) : expression2;
|
|
16710
16879
|
});
|
|
16711
|
-
return new MemberExpression(astToString(expression), pathSegments
|
|
16880
|
+
return new MemberExpression(astToString(expression), pathSegments);
|
|
16712
16881
|
}, "createMemberExpression");
|
|
16713
|
-
createSequenceExpression = /* @__PURE__ */ __name((expression
|
|
16714
|
-
return new SequenceExpression(astToString(expression), expression.expressions.map((expression2) => this.createExpression(expression2
|
|
16882
|
+
createSequenceExpression = /* @__PURE__ */ __name((expression) => {
|
|
16883
|
+
return new SequenceExpression(astToString(expression), expression.expressions.map((expression2) => this.createExpression(expression2)));
|
|
16715
16884
|
}, "createSequenceExpression");
|
|
16716
|
-
createIdentifier = /* @__PURE__ */ __name((expression
|
|
16717
|
-
return new IdentifierExpression(
|
|
16885
|
+
createIdentifier = /* @__PURE__ */ __name((expression) => {
|
|
16886
|
+
return new IdentifierExpression(expression.name);
|
|
16718
16887
|
}, "createIdentifier");
|
|
16719
|
-
createArrayExpression = /* @__PURE__ */ __name((expression
|
|
16720
|
-
return new ArrayExpression(expression.elements.map((element) => this.createExpression(Type5.cast(element)
|
|
16888
|
+
createArrayExpression = /* @__PURE__ */ __name((expression) => {
|
|
16889
|
+
return new ArrayExpression(expression.elements.map((element) => this.createExpression(Type5.cast(element))));
|
|
16721
16890
|
}, "createArrayExpression");
|
|
16722
|
-
createSpreadExpression = /* @__PURE__ */ __name((expression
|
|
16723
|
-
return new SpreadExpression(this.createExpression(expression.argument
|
|
16891
|
+
createSpreadExpression = /* @__PURE__ */ __name((expression) => {
|
|
16892
|
+
return new SpreadExpression(this.createExpression(expression.argument));
|
|
16724
16893
|
}, "createSpreadExpression");
|
|
16725
|
-
createNewExpression = /* @__PURE__ */ __name((expression
|
|
16726
|
-
const constructorExpression = this.createExpression(expression.callee
|
|
16727
|
-
const argumentExpressions = expression.arguments.map((argumentExpressions2) => this.createExpression(argumentExpressions2
|
|
16894
|
+
createNewExpression = /* @__PURE__ */ __name((expression) => {
|
|
16895
|
+
const constructorExpression = this.createExpression(expression.callee);
|
|
16896
|
+
const argumentExpressions = expression.arguments.map((argumentExpressions2) => this.createExpression(argumentExpressions2));
|
|
16728
16897
|
return new NewExpression(astToString(expression), Type5.cast(constructorExpression), argumentExpressions);
|
|
16729
16898
|
}, "createNewExpression");
|
|
16730
|
-
createCallExpression = /* @__PURE__ */ __name((expression
|
|
16899
|
+
createCallExpression = /* @__PURE__ */ __name((expression) => {
|
|
16731
16900
|
let objectExpression = null;
|
|
16732
16901
|
let functionExpression;
|
|
16733
16902
|
if (expression.callee.type === "MemberExpression") {
|
|
16734
|
-
objectExpression = this.createExpression(expression.callee.object
|
|
16735
|
-
functionExpression = this.createExpression(expression.callee.property
|
|
16903
|
+
objectExpression = this.createExpression(expression.callee.object);
|
|
16904
|
+
functionExpression = this.createExpression(expression.callee.property);
|
|
16736
16905
|
} else {
|
|
16737
|
-
functionExpression = this.createExpression(expression.callee
|
|
16906
|
+
functionExpression = this.createExpression(expression.callee);
|
|
16738
16907
|
}
|
|
16739
|
-
const argumentExpressions = expression.arguments.map((argumentExpression) => this.createExpression(argumentExpression
|
|
16740
|
-
return new FunctionExpression(astToString(expression), Type5.cast(functionExpression), Type5.cast(objectExpression), new ArrayExpression(argumentExpressions), Type5.cast(expression.callee).computed, Type5.cast(expression.callee).optional
|
|
16908
|
+
const argumentExpressions = expression.arguments.map((argumentExpression) => this.createExpression(argumentExpression));
|
|
16909
|
+
return new FunctionExpression(astToString(expression), Type5.cast(functionExpression), Type5.cast(objectExpression), new ArrayExpression(argumentExpressions), Type5.cast(expression.callee).computed, Type5.cast(expression.callee).optional);
|
|
16741
16910
|
}, "createCallExpression");
|
|
16742
|
-
createTemplateLiteralExpression = /* @__PURE__ */ __name((templateLiteral
|
|
16743
|
-
const { quasis, parameters } = this.createTemplateElementExpression(templateLiteral
|
|
16911
|
+
createTemplateLiteralExpression = /* @__PURE__ */ __name((templateLiteral) => {
|
|
16912
|
+
const { quasis, parameters } = this.createTemplateElementExpression(templateLiteral);
|
|
16744
16913
|
const expressions = quasis.flatMap((quasi, index) => {
|
|
16745
16914
|
return [
|
|
16746
16915
|
quasi,
|
|
@@ -16752,127 +16921,127 @@ var JsEspreeExpressionParser = class {
|
|
|
16752
16921
|
}
|
|
16753
16922
|
return new TemplateStringExpression(astToString(templateLiteral), expressions);
|
|
16754
16923
|
}, "createTemplateLiteralExpression");
|
|
16755
|
-
createTaggedTemplateExpression = /* @__PURE__ */ __name((expression
|
|
16756
|
-
const { quasis, parameters } = this.createTemplateElementExpression(expression.quasi
|
|
16924
|
+
createTaggedTemplateExpression = /* @__PURE__ */ __name((expression) => {
|
|
16925
|
+
const { quasis, parameters } = this.createTemplateElementExpression(expression.quasi);
|
|
16757
16926
|
let objectExpression = null;
|
|
16758
16927
|
let functionExpression;
|
|
16759
16928
|
if (expression.tag.type === "MemberExpression") {
|
|
16760
|
-
objectExpression = this.createExpression(expression.tag.object
|
|
16761
|
-
functionExpression = this.createExpression(expression.tag.property
|
|
16929
|
+
objectExpression = this.createExpression(expression.tag.object);
|
|
16930
|
+
functionExpression = this.createExpression(expression.tag.property);
|
|
16762
16931
|
} else {
|
|
16763
|
-
functionExpression = this.createExpression(expression.tag
|
|
16932
|
+
functionExpression = this.createExpression(expression.tag);
|
|
16764
16933
|
}
|
|
16765
16934
|
return new FunctionExpression(astToString(expression), Type5.cast(functionExpression), Type5.cast(objectExpression), new ArrayExpression([
|
|
16766
16935
|
new ArrayExpression(quasis),
|
|
16767
16936
|
new SpreadExpression(new ArrayExpression(parameters))
|
|
16768
|
-
]), false, false
|
|
16937
|
+
]), false, false);
|
|
16769
16938
|
}, "createTaggedTemplateExpression");
|
|
16770
|
-
createTemplateElementExpression(templateLiteral
|
|
16939
|
+
createTemplateElementExpression(templateLiteral) {
|
|
16771
16940
|
return {
|
|
16772
|
-
quasis: templateLiteral.quasis.map((quasi) => new ConstantStringExpression(quasi.value.raw
|
|
16773
|
-
parameters: templateLiteral.expressions.map((expression) => this.createExpression(expression
|
|
16941
|
+
quasis: templateLiteral.quasis.map((quasi) => new ConstantStringExpression(quasi.value.raw)),
|
|
16942
|
+
parameters: templateLiteral.expressions.map((expression) => this.createExpression(expression))
|
|
16774
16943
|
};
|
|
16775
16944
|
}
|
|
16776
|
-
createUnaryPlusExpression = /* @__PURE__ */ __name((expression
|
|
16777
|
-
return new UnaryPlusExpression(astToString(expression), this.createExpression(expression.argument
|
|
16945
|
+
createUnaryPlusExpression = /* @__PURE__ */ __name((expression) => {
|
|
16946
|
+
return new UnaryPlusExpression(astToString(expression), this.createExpression(expression.argument));
|
|
16778
16947
|
}, "createUnaryPlusExpression");
|
|
16779
|
-
createUnaryMinusExpression = /* @__PURE__ */ __name((expression
|
|
16780
|
-
return new UnaryNegationExpression(astToString(expression), Type5.cast(this.createExpression(expression.argument
|
|
16948
|
+
createUnaryMinusExpression = /* @__PURE__ */ __name((expression) => {
|
|
16949
|
+
return new UnaryNegationExpression(astToString(expression), Type5.cast(this.createExpression(expression.argument)));
|
|
16781
16950
|
}, "createUnaryMinusExpression");
|
|
16782
|
-
createLogicalNotExpression = /* @__PURE__ */ __name((expression
|
|
16783
|
-
return new LogicalNotExpression(astToString(expression), this.createExpression(expression.argument
|
|
16951
|
+
createLogicalNotExpression = /* @__PURE__ */ __name((expression) => {
|
|
16952
|
+
return new LogicalNotExpression(astToString(expression), this.createExpression(expression.argument));
|
|
16784
16953
|
}, "createLogicalNotExpression");
|
|
16785
|
-
createTypeofExpression = /* @__PURE__ */ __name((expression
|
|
16786
|
-
return new TypeofExpression(astToString(expression), this.createExpression(expression.argument
|
|
16954
|
+
createTypeofExpression = /* @__PURE__ */ __name((expression) => {
|
|
16955
|
+
return new TypeofExpression(astToString(expression), this.createExpression(expression.argument));
|
|
16787
16956
|
}, "createTypeofExpression");
|
|
16788
16957
|
createDeleteExpression = /* @__PURE__ */ __name(() => {
|
|
16789
16958
|
throw new UnsupportedException2("Delete operator is not supported");
|
|
16790
16959
|
}, "createDeleteExpression");
|
|
16791
|
-
createEqualToExpression = /* @__PURE__ */ __name((expression
|
|
16792
|
-
return new EqualityExpression(astToString(expression), this.createExpression(expression.left
|
|
16960
|
+
createEqualToExpression = /* @__PURE__ */ __name((expression) => {
|
|
16961
|
+
return new EqualityExpression(astToString(expression), this.createExpression(expression.left), this.createExpression(expression.right));
|
|
16793
16962
|
}, "createEqualToExpression");
|
|
16794
|
-
createNotEqualToExpression = /* @__PURE__ */ __name((expression
|
|
16795
|
-
return new InequalityExpression(astToString(expression), this.createExpression(expression.left
|
|
16963
|
+
createNotEqualToExpression = /* @__PURE__ */ __name((expression) => {
|
|
16964
|
+
return new InequalityExpression(astToString(expression), this.createExpression(expression.left), this.createExpression(expression.right));
|
|
16796
16965
|
}, "createNotEqualToExpression");
|
|
16797
|
-
createStrictEqualToExpression = /* @__PURE__ */ __name((expression
|
|
16798
|
-
return new StrictEqualityExpression(astToString(expression), this.createExpression(expression.left
|
|
16966
|
+
createStrictEqualToExpression = /* @__PURE__ */ __name((expression) => {
|
|
16967
|
+
return new StrictEqualityExpression(astToString(expression), this.createExpression(expression.left), this.createExpression(expression.right));
|
|
16799
16968
|
}, "createStrictEqualToExpression");
|
|
16800
|
-
createStrictNotEqualToExpression = /* @__PURE__ */ __name((expression
|
|
16801
|
-
return new StrictInequalityExpression(astToString(expression), this.createExpression(expression.left
|
|
16969
|
+
createStrictNotEqualToExpression = /* @__PURE__ */ __name((expression) => {
|
|
16970
|
+
return new StrictInequalityExpression(astToString(expression), this.createExpression(expression.left), this.createExpression(expression.right));
|
|
16802
16971
|
}, "createStrictNotEqualToExpression");
|
|
16803
|
-
createLessThanExpression = /* @__PURE__ */ __name((expression
|
|
16804
|
-
return new LessThanExpression(astToString(expression), Type5.cast(this.createExpression(expression.left
|
|
16972
|
+
createLessThanExpression = /* @__PURE__ */ __name((expression) => {
|
|
16973
|
+
return new LessThanExpression(astToString(expression), Type5.cast(this.createExpression(expression.left)), Type5.cast(this.createExpression(expression.right)));
|
|
16805
16974
|
}, "createLessThanExpression");
|
|
16806
|
-
createLessThanOrEqualToExpression = /* @__PURE__ */ __name((expression
|
|
16807
|
-
return new LessThanOrEqualExpression(astToString(expression), Type5.cast(this.createExpression(expression.left
|
|
16975
|
+
createLessThanOrEqualToExpression = /* @__PURE__ */ __name((expression) => {
|
|
16976
|
+
return new LessThanOrEqualExpression(astToString(expression), Type5.cast(this.createExpression(expression.left)), Type5.cast(this.createExpression(expression.right)));
|
|
16808
16977
|
}, "createLessThanOrEqualToExpression");
|
|
16809
|
-
createGreaterThanExpression = /* @__PURE__ */ __name((expression
|
|
16810
|
-
return new GreaterThanExpression(astToString(expression), this.createExpression(expression.left
|
|
16978
|
+
createGreaterThanExpression = /* @__PURE__ */ __name((expression) => {
|
|
16979
|
+
return new GreaterThanExpression(astToString(expression), this.createExpression(expression.left), this.createExpression(expression.right));
|
|
16811
16980
|
}, "createGreaterThanExpression");
|
|
16812
|
-
createGreaterThanOrEqualToExpression = /* @__PURE__ */ __name((expression
|
|
16813
|
-
return new GreaterThanOrEqualExpression(astToString(expression), this.createExpression(expression.left
|
|
16981
|
+
createGreaterThanOrEqualToExpression = /* @__PURE__ */ __name((expression) => {
|
|
16982
|
+
return new GreaterThanOrEqualExpression(astToString(expression), this.createExpression(expression.left), this.createExpression(expression.right));
|
|
16814
16983
|
}, "createGreaterThanOrEqualToExpression");
|
|
16815
|
-
createBitwiseNotExpression = /* @__PURE__ */ __name((expression
|
|
16816
|
-
return new BitwiseNotExpression(astToString(expression), Type5.cast(this.createExpression(expression.argument
|
|
16984
|
+
createBitwiseNotExpression = /* @__PURE__ */ __name((expression) => {
|
|
16985
|
+
return new BitwiseNotExpression(astToString(expression), Type5.cast(this.createExpression(expression.argument)));
|
|
16817
16986
|
}, "createBitwiseNotExpression");
|
|
16818
|
-
createLeftShiftExpression = /* @__PURE__ */ __name((expression
|
|
16819
|
-
return new BitwiseLeftShiftExpression(astToString(expression), Type5.cast(this.createExpression(expression.left
|
|
16987
|
+
createLeftShiftExpression = /* @__PURE__ */ __name((expression) => {
|
|
16988
|
+
return new BitwiseLeftShiftExpression(astToString(expression), Type5.cast(this.createExpression(expression.left)), Type5.cast(this.createExpression(expression.right)));
|
|
16820
16989
|
}, "createLeftShiftExpression");
|
|
16821
|
-
createRightShiftExpression = /* @__PURE__ */ __name((expression
|
|
16822
|
-
return new BitwiseRightShiftExpression(astToString(expression), Type5.cast(this.createExpression(expression.left
|
|
16990
|
+
createRightShiftExpression = /* @__PURE__ */ __name((expression) => {
|
|
16991
|
+
return new BitwiseRightShiftExpression(astToString(expression), Type5.cast(this.createExpression(expression.left)), Type5.cast(this.createExpression(expression.right)));
|
|
16823
16992
|
}, "createRightShiftExpression");
|
|
16824
|
-
createUnsignedRightShiftExpression = /* @__PURE__ */ __name((expression
|
|
16825
|
-
return new BitwiseUnsignedRightShiftExpression(astToString(expression), Type5.cast(this.createExpression(expression.left
|
|
16993
|
+
createUnsignedRightShiftExpression = /* @__PURE__ */ __name((expression) => {
|
|
16994
|
+
return new BitwiseUnsignedRightShiftExpression(astToString(expression), Type5.cast(this.createExpression(expression.left)), Type5.cast(this.createExpression(expression.right)));
|
|
16826
16995
|
}, "createUnsignedRightShiftExpression");
|
|
16827
|
-
createBitwiseOrExpression = /* @__PURE__ */ __name((expression
|
|
16828
|
-
return new BitwiseOrExpression(astToString(expression), Type5.cast(this.createExpression(expression.left
|
|
16996
|
+
createBitwiseOrExpression = /* @__PURE__ */ __name((expression) => {
|
|
16997
|
+
return new BitwiseOrExpression(astToString(expression), Type5.cast(this.createExpression(expression.left)), Type5.cast(this.createExpression(expression.right)));
|
|
16829
16998
|
}, "createBitwiseOrExpression");
|
|
16830
|
-
createBitwiseXOrExpression = /* @__PURE__ */ __name((expression
|
|
16831
|
-
return new BitwiseXorExpression(astToString(expression), Type5.cast(this.createExpression(expression.left
|
|
16999
|
+
createBitwiseXOrExpression = /* @__PURE__ */ __name((expression) => {
|
|
17000
|
+
return new BitwiseXorExpression(astToString(expression), Type5.cast(this.createExpression(expression.left)), Type5.cast(this.createExpression(expression.right)));
|
|
16832
17001
|
}, "createBitwiseXOrExpression");
|
|
16833
|
-
createBitwiseAndExpression = /* @__PURE__ */ __name((expression
|
|
16834
|
-
return new BitwiseAndExpression(astToString(expression), Type5.cast(this.createExpression(expression.left
|
|
17002
|
+
createBitwiseAndExpression = /* @__PURE__ */ __name((expression) => {
|
|
17003
|
+
return new BitwiseAndExpression(astToString(expression), Type5.cast(this.createExpression(expression.left)), Type5.cast(this.createExpression(expression.right)));
|
|
16835
17004
|
}, "createBitwiseAndExpression");
|
|
16836
|
-
createAdditionExpression = /* @__PURE__ */ __name((expression
|
|
16837
|
-
return new AdditionExpression(astToString(expression), Type5.cast(this.createExpression(expression.left
|
|
17005
|
+
createAdditionExpression = /* @__PURE__ */ __name((expression) => {
|
|
17006
|
+
return new AdditionExpression(astToString(expression), Type5.cast(this.createExpression(expression.left)), Type5.cast(this.createExpression(expression.right)));
|
|
16838
17007
|
}, "createAdditionExpression");
|
|
16839
|
-
createSubstractionExpression = /* @__PURE__ */ __name((expression
|
|
16840
|
-
return new SubtractionExpression(astToString(expression), Type5.cast(this.createExpression(expression.left
|
|
17008
|
+
createSubstractionExpression = /* @__PURE__ */ __name((expression) => {
|
|
17009
|
+
return new SubtractionExpression(astToString(expression), Type5.cast(this.createExpression(expression.left)), Type5.cast(this.createExpression(expression.right)));
|
|
16841
17010
|
}, "createSubstractionExpression");
|
|
16842
|
-
createMultiplicationExpression = /* @__PURE__ */ __name((expression
|
|
16843
|
-
return new MultiplicationExpression(astToString(expression), Type5.cast(this.createExpression(expression.left
|
|
17011
|
+
createMultiplicationExpression = /* @__PURE__ */ __name((expression) => {
|
|
17012
|
+
return new MultiplicationExpression(astToString(expression), Type5.cast(this.createExpression(expression.left)), Type5.cast(this.createExpression(expression.right)));
|
|
16844
17013
|
}, "createMultiplicationExpression");
|
|
16845
|
-
createDivisionExpression = /* @__PURE__ */ __name((expression
|
|
16846
|
-
return new DivisionExpression(astToString(expression), Type5.cast(this.createExpression(expression.left
|
|
17014
|
+
createDivisionExpression = /* @__PURE__ */ __name((expression) => {
|
|
17015
|
+
return new DivisionExpression(astToString(expression), Type5.cast(this.createExpression(expression.left)), Type5.cast(this.createExpression(expression.right)));
|
|
16847
17016
|
}, "createDivisionExpression");
|
|
16848
|
-
createModulusExpression = /* @__PURE__ */ __name((expression
|
|
16849
|
-
return new RemainderExpression(astToString(expression), Type5.cast(this.createExpression(expression.left
|
|
17017
|
+
createModulusExpression = /* @__PURE__ */ __name((expression) => {
|
|
17018
|
+
return new RemainderExpression(astToString(expression), Type5.cast(this.createExpression(expression.left)), Type5.cast(this.createExpression(expression.right)));
|
|
16850
17019
|
}, "createModulusExpression");
|
|
16851
|
-
createExponentiationExpression = /* @__PURE__ */ __name((expression
|
|
16852
|
-
return new ExponentiationExpression(astToString(expression), Type5.cast(this.createExpression(expression.left
|
|
17020
|
+
createExponentiationExpression = /* @__PURE__ */ __name((expression) => {
|
|
17021
|
+
return new ExponentiationExpression(astToString(expression), Type5.cast(this.createExpression(expression.left)), Type5.cast(this.createExpression(expression.right)));
|
|
16853
17022
|
}, "createExponentiationExpression");
|
|
16854
|
-
createInstanceOfExpression = /* @__PURE__ */ __name((expression
|
|
16855
|
-
return new InstanceofExpression(astToString(expression), this.createExpression(expression.left
|
|
17023
|
+
createInstanceOfExpression = /* @__PURE__ */ __name((expression) => {
|
|
17024
|
+
return new InstanceofExpression(astToString(expression), this.createExpression(expression.left), Type5.cast(this.createExpression(expression.right)));
|
|
16856
17025
|
}, "createInstanceOfExpression");
|
|
16857
|
-
createInExpression = /* @__PURE__ */ __name((expression
|
|
16858
|
-
return new InExpression(astToString(expression), this.createExpression(expression.left
|
|
17026
|
+
createInExpression = /* @__PURE__ */ __name((expression) => {
|
|
17027
|
+
return new InExpression(astToString(expression), this.createExpression(expression.left), this.createExpression(expression.right));
|
|
16859
17028
|
}, "createInExpression");
|
|
16860
|
-
createLogicalOrExpression = /* @__PURE__ */ __name((expression
|
|
16861
|
-
return new LogicalOrExpression(astToString(expression), this.createExpression(expression.left
|
|
17029
|
+
createLogicalOrExpression = /* @__PURE__ */ __name((expression) => {
|
|
17030
|
+
return new LogicalOrExpression(astToString(expression), this.createExpression(expression.left), this.createExpression(expression.right));
|
|
16862
17031
|
}, "createLogicalOrExpression");
|
|
16863
|
-
createLogicalAndExpression = /* @__PURE__ */ __name((expression
|
|
16864
|
-
return new LogicalAndExpression(astToString(expression), this.createExpression(expression.left
|
|
17032
|
+
createLogicalAndExpression = /* @__PURE__ */ __name((expression) => {
|
|
17033
|
+
return new LogicalAndExpression(astToString(expression), this.createExpression(expression.left), this.createExpression(expression.right));
|
|
16865
17034
|
}, "createLogicalAndExpression");
|
|
16866
|
-
createNullishCoalescingExpression = /* @__PURE__ */ __name((expression
|
|
16867
|
-
return new NullishCoalescingExpression(astToString(expression), this.createExpression(expression.left
|
|
17035
|
+
createNullishCoalescingExpression = /* @__PURE__ */ __name((expression) => {
|
|
17036
|
+
return new NullishCoalescingExpression(astToString(expression), this.createExpression(expression.left), this.createExpression(expression.right));
|
|
16868
17037
|
}, "createNullishCoalescingExpression");
|
|
16869
|
-
createObjectExpression = /* @__PURE__ */ __name((objectExpression
|
|
16870
|
-
const propertyExpressions = objectExpression.properties.map((property) => this.createExpression(property
|
|
17038
|
+
createObjectExpression = /* @__PURE__ */ __name((objectExpression) => {
|
|
17039
|
+
const propertyExpressions = objectExpression.properties.map((property) => this.createExpression(property));
|
|
16871
17040
|
return new ObjectExpression(astToString(objectExpression), propertyExpressions);
|
|
16872
17041
|
}, "createObjectExpression");
|
|
16873
|
-
createPropertyExpression = /* @__PURE__ */ __name((propertyExpression
|
|
16874
|
-
const keyExpression = propertyExpression.key.type === "Identifier" ? new ConstantStringExpression(Type5.cast(propertyExpression.key).name
|
|
16875
|
-
return new PropertyExpression(astToString(propertyExpression), keyExpression, this.createExpression(propertyExpression.value
|
|
17042
|
+
createPropertyExpression = /* @__PURE__ */ __name((propertyExpression) => {
|
|
17043
|
+
const keyExpression = propertyExpression.key.type === "Identifier" ? new ConstantStringExpression(Type5.cast(propertyExpression.key).name) : this.createExpression(propertyExpression.key);
|
|
17044
|
+
return new PropertyExpression(astToString(propertyExpression), keyExpression, this.createExpression(propertyExpression.value));
|
|
16876
17045
|
}, "createPropertyExpression");
|
|
16877
17046
|
parseExpression(expression) {
|
|
16878
17047
|
const program = parse3(expression, {
|
|
@@ -16937,26 +17106,45 @@ var JsEspreeExpressionParser = class {
|
|
|
16937
17106
|
return result;
|
|
16938
17107
|
}
|
|
16939
17108
|
};
|
|
16940
|
-
JsEspreeExpressionParser =
|
|
16941
|
-
|
|
16942
|
-
|
|
16943
|
-
|
|
16944
|
-
_ts_param7(2, Inject6(RsXExpressionParserInjectionTokens.IExpressionChangeTransactionManager)),
|
|
16945
|
-
_ts_param7(3, Inject6(RsXStateManagerInjectionTokens2.IStateManager)),
|
|
16946
|
-
_ts_param7(4, Inject6(RsXCoreInjectionTokens2.IGuidFactory)),
|
|
16947
|
-
_ts_metadata8("design:type", Function),
|
|
16948
|
-
_ts_metadata8("design:paramtypes", [
|
|
16949
|
-
typeof IIndexValueAccessor === "undefined" ? Object : IIndexValueAccessor,
|
|
16950
|
-
typeof IMustProxifyItemHandlerFactory === "undefined" ? Object : IMustProxifyItemHandlerFactory,
|
|
16951
|
-
typeof IExpressionChangeTransactionManager === "undefined" ? Object : IExpressionChangeTransactionManager,
|
|
16952
|
-
typeof IStateManager === "undefined" ? Object : IStateManager,
|
|
16953
|
-
typeof IGuidFactory === "undefined" ? Object : IGuidFactory
|
|
16954
|
-
])
|
|
17109
|
+
JsEspreeExpressionParser = _ts_decorate14([
|
|
17110
|
+
Injectable14(),
|
|
17111
|
+
_ts_metadata10("design:type", Function),
|
|
17112
|
+
_ts_metadata10("design:paramtypes", [])
|
|
16955
17113
|
], JsEspreeExpressionParser);
|
|
16956
17114
|
|
|
16957
17115
|
// lib/rs-x-expression-parser.module.ts
|
|
16958
|
-
import { ContainerModule, defaultIndexValueAccessorList, InjectionContainer, overrideMultiInjectServices, registerMultiInjectServices, RsXCoreInjectionTokens as RsXCoreInjectionTokens3 } from "@rs-x/core";
|
|
17116
|
+
import { ContainerModule, defaultIndexValueAccessorList, defaultValueMetadataList, InjectionContainer, overrideMultiInjectServices, registerMultiInjectServices, RsXCoreInjectionTokens as RsXCoreInjectionTokens3 } from "@rs-x/core";
|
|
16959
17117
|
import { defaultObjectObserverProxyPairFactoryList, RsXStateManagerInjectionTokens as RsXStateManagerInjectionTokens3, RsXStateManagerModule } from "@rs-x/state-manager";
|
|
17118
|
+
|
|
17119
|
+
// lib/expression-observer/expression-metadata.ts
|
|
17120
|
+
import { Injectable as Injectable15 } from "@rs-x/core";
|
|
17121
|
+
function _ts_decorate15(decorators, target, key, desc) {
|
|
17122
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17123
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17124
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
17125
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17126
|
+
}
|
|
17127
|
+
__name(_ts_decorate15, "_ts_decorate");
|
|
17128
|
+
var ExpressionMetadata = class {
|
|
17129
|
+
static {
|
|
17130
|
+
__name(this, "ExpressionMetadata");
|
|
17131
|
+
}
|
|
17132
|
+
priority = 300;
|
|
17133
|
+
isAsync() {
|
|
17134
|
+
return true;
|
|
17135
|
+
}
|
|
17136
|
+
needsProxy() {
|
|
17137
|
+
return true;
|
|
17138
|
+
}
|
|
17139
|
+
applies(value) {
|
|
17140
|
+
return value instanceof AbstractExpression;
|
|
17141
|
+
}
|
|
17142
|
+
};
|
|
17143
|
+
ExpressionMetadata = _ts_decorate15([
|
|
17144
|
+
Injectable15()
|
|
17145
|
+
], ExpressionMetadata);
|
|
17146
|
+
|
|
17147
|
+
// lib/rs-x-expression-parser.module.ts
|
|
16960
17148
|
InjectionContainer.load(RsXStateManagerModule);
|
|
16961
17149
|
var RsXExpressionParserModule = new ContainerModule((options) => {
|
|
16962
17150
|
options.unbind(RsXCoreInjectionTokens3.DefaultDeepCloneExcept);
|
|
@@ -16967,6 +17155,8 @@ var RsXExpressionParserModule = new ContainerModule((options) => {
|
|
|
16967
17155
|
options.bind(RsXExpressionParserInjectionTokens.IdentifierOwnerResolver).to(DefaultIdentifierOwnerResolver).inSingletonScope();
|
|
16968
17156
|
options.bind(RsXExpressionParserInjectionTokens.IExpressionFactory).to(ExpressionFactory).inSingletonScope();
|
|
16969
17157
|
options.bind(RsXExpressionParserInjectionTokens.IExpressionObserverFactory).to(ExpressionObserverFactory).inSingletonScope();
|
|
17158
|
+
options.bind(RsXExpressionParserInjectionTokens.IExpressionCache).to(ExpressionCache).inSingletonScope();
|
|
17159
|
+
options.bind(RsXExpressionParserInjectionTokens.IExpressionServices).to(ExpressionServices).inSingletonScope();
|
|
16970
17160
|
registerMultiInjectServices(options, RsXExpressionParserInjectionTokens.IIdentifierOwnerResolverList, [
|
|
16971
17161
|
{
|
|
16972
17162
|
target: PropertyOwnerResolver,
|
|
@@ -16995,6 +17185,13 @@ var RsXExpressionParserModule = new ContainerModule((options) => {
|
|
|
16995
17185
|
},
|
|
16996
17186
|
...defaultObjectObserverProxyPairFactoryList
|
|
16997
17187
|
]);
|
|
17188
|
+
overrideMultiInjectServices(options, RsXCoreInjectionTokens3.IValueMetadataList, [
|
|
17189
|
+
{
|
|
17190
|
+
target: ExpressionMetadata,
|
|
17191
|
+
token: RsXExpressionParserInjectionTokens.ExpressiomMetadata
|
|
17192
|
+
},
|
|
17193
|
+
...defaultValueMetadataList
|
|
17194
|
+
]);
|
|
16998
17195
|
});
|
|
16999
17196
|
async function unloadRsXExpressionParserModule() {
|
|
17000
17197
|
await InjectionContainer.unload(RsXStateManagerModule);
|
|
@@ -17028,12 +17225,14 @@ export {
|
|
|
17028
17225
|
DivisionExpression,
|
|
17029
17226
|
EqualityExpression,
|
|
17030
17227
|
ExponentiationExpression,
|
|
17228
|
+
ExpressionCache,
|
|
17031
17229
|
ExpressionChangeTransactionManager,
|
|
17032
17230
|
ExpressionFactory,
|
|
17033
17231
|
ExpressionIndexAccessor,
|
|
17034
17232
|
ExpressionManager,
|
|
17035
17233
|
ExpressionObserverFactory,
|
|
17036
17234
|
ExpressionObserverProxyPairFactory,
|
|
17235
|
+
ExpressionServices,
|
|
17037
17236
|
ExpressionType,
|
|
17038
17237
|
FunctionExpression,
|
|
17039
17238
|
GreaterThanExpression,
|