@cydran/cydran 0.4.0 → 0.5.1
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/cydran.d.ts +125 -120
- package/dist/cydran.js +648 -354
- package/dist/cydran.js.map +4 -4
- package/dist/cydran.min.js +23 -21
- package/dist/cydran.min.js.map +4 -4
- package/package.json +5 -20
package/dist/cydran.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
0.
|
|
2
|
+
0.5.1
|
|
3
3
|
---
|
|
4
4
|
Cydran <http://cydran.io/>
|
|
5
5
|
Copyright (c) 2018 The Cydran Team and other contributors <http://cydran.io/>
|
|
@@ -47,6 +47,7 @@ var cydran = (() => {
|
|
|
47
47
|
To2["CONTEXT"] = "CONTEXT";
|
|
48
48
|
To2["DESCENDANTS"] = "DESCENDANTS";
|
|
49
49
|
To2["IMMEDIATE_CHILDREN"] = "IMMEDIATE_CHILDREN";
|
|
50
|
+
To2["IMMEDIATE_CHILD_COMPONENTS"] = "IMMEDIATE_CHILD_COMPONENTS";
|
|
50
51
|
To2["PARENT"] = "PARENT";
|
|
51
52
|
To2["PARENTS"] = "PARENTS";
|
|
52
53
|
To2["ROOT"] = "ROOT";
|
|
@@ -155,7 +156,7 @@ var cydran = (() => {
|
|
|
155
156
|
var OBJECT_ID_PARTIAL = /[a-zA-Z0-9\*\:\_\-\.]+/;
|
|
156
157
|
var CONTEXT_NAME_PARTIAL = ALPHA_NUMERIC_PARTIAL;
|
|
157
158
|
var PERIOD = /\./;
|
|
158
|
-
var DASH =
|
|
159
|
+
var DASH = /-/;
|
|
159
160
|
var CURRENT_PATH = PERIOD;
|
|
160
161
|
var PARENT_PATH = /\.\./;
|
|
161
162
|
var SLASH = /\//;
|
|
@@ -272,7 +273,7 @@ var cydran = (() => {
|
|
|
272
273
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
273
274
|
};
|
|
274
275
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
275
|
-
exports.BoundsError = exports.DuplicateComponentError = exports.PrefixMismatchError = exports.PathError = exports.UnsupportedOperationError = exports.ContextUnavailableError = exports.UnknownPropertyError = exports.UnknownContextError = exports.NamingConflictError = exports.UndefinedContextError = exports.EvaluationError = exports.AppenderError = exports.IllegalArgumentError = exports.UnknownInputError = exports.InvalidStateError = exports.UnknownStateError = exports.ValidationError = exports.UnknownRegionError = exports.UnknownElementError = exports.UnknownComponentError = exports.TemplateError = exports.SetComponentError = exports.SelectorError = exports.ScopeError = exports.RegistrationError = exports.RecursionError = exports.NullValueError = exports.ContextAffinityError = exports.MalformedOnEventError = exports.LockedRegionError = exports.InvalidTypeError = exports.DigestLoopError = exports.AmbiguousMarkupError = exports.ComponentStateError = exports.CydranError = exports.BehaviorError = void 0;
|
|
276
|
+
exports.UnknownMethodError = exports.BoundsError = exports.DuplicateComponentError = exports.PrefixMismatchError = exports.PathError = exports.UnsupportedOperationError = exports.ContextUnavailableError = exports.UnknownPropertyError = exports.UnknownContextError = exports.NamingConflictError = exports.UndefinedContextError = exports.EvaluationError = exports.AppenderError = exports.IllegalArgumentError = exports.UnknownInputError = exports.InvalidStateError = exports.UnknownStateError = exports.ValidationError = exports.UnknownRegionError = exports.UnknownElementError = exports.UnknownComponentError = exports.TemplateError = exports.SetComponentError = exports.SelectorError = exports.ScopeError = exports.RegistrationError = exports.RecursionError = exports.NullValueError = exports.ContextAffinityError = exports.MalformedOnEventError = exports.LockedRegionError = exports.InvalidTypeError = exports.DigestLoopError = exports.AmbiguousMarkupError = exports.ComponentReadinessError = exports.ComponentStateError = exports.CydranError = exports.BehaviorError = void 0;
|
|
276
277
|
var CydranError_1 = __importDefault(require_CydranError());
|
|
277
278
|
exports.CydranError = CydranError_1.default;
|
|
278
279
|
var AmbiguousMarkupError = class extends CydranError_1.default {
|
|
@@ -485,6 +486,18 @@ var cydran = (() => {
|
|
|
485
486
|
}
|
|
486
487
|
};
|
|
487
488
|
exports.BoundsError = BoundsError;
|
|
489
|
+
var ComponentReadinessError = class extends CydranError_1.default {
|
|
490
|
+
constructor(msg) {
|
|
491
|
+
super(msg);
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
exports.ComponentReadinessError = ComponentReadinessError;
|
|
495
|
+
var UnknownMethodError = class extends CydranError_1.default {
|
|
496
|
+
constructor(msg) {
|
|
497
|
+
super(msg);
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
exports.UnknownMethodError = UnknownMethodError;
|
|
488
501
|
}
|
|
489
502
|
});
|
|
490
503
|
|
|
@@ -1575,12 +1588,17 @@ var cydran = (() => {
|
|
|
1575
1588
|
exports.forEachField = forEachField;
|
|
1576
1589
|
exports.removeFromArray = removeFromArray;
|
|
1577
1590
|
exports.hasMethod = hasMethod;
|
|
1591
|
+
exports.resolveNamedMethod = resolveNamedMethod;
|
|
1578
1592
|
exports.sanitize = sanitize;
|
|
1579
1593
|
exports.concat = concat;
|
|
1580
1594
|
exports.partial = partial;
|
|
1595
|
+
exports.exactlyOneDefined = exactlyOneDefined;
|
|
1581
1596
|
var CloneEquals_1 = require_CloneEquals();
|
|
1582
1597
|
var Errors_1 = require_Errors();
|
|
1583
1598
|
var CydranConstants_1 = require_CydranConstants();
|
|
1599
|
+
function exactlyOneDefined(first, second) {
|
|
1600
|
+
return isDefined(first) ? !isDefined(second) : isDefined(second);
|
|
1601
|
+
}
|
|
1584
1602
|
function concat(array0, array1) {
|
|
1585
1603
|
const first = isDefined(array0) ? array0 : [];
|
|
1586
1604
|
const second = isDefined(array1) ? array1 : [];
|
|
@@ -1673,7 +1691,6 @@ var cydran = (() => {
|
|
|
1673
1691
|
throw new Errors_1.NullValueError(`${name2} ${SHALL_NOTBE_NULL}`);
|
|
1674
1692
|
}
|
|
1675
1693
|
if (!regex.test(value)) {
|
|
1676
|
-
console.log(`Value: ${value}`);
|
|
1677
1694
|
throw new Errors_1.ValidationError(`${name2} must be valid`);
|
|
1678
1695
|
}
|
|
1679
1696
|
return value;
|
|
@@ -1734,10 +1751,8 @@ var cydran = (() => {
|
|
|
1734
1751
|
return null;
|
|
1735
1752
|
}
|
|
1736
1753
|
const result = {};
|
|
1737
|
-
for (const key
|
|
1738
|
-
|
|
1739
|
-
result[key] = source[key];
|
|
1740
|
-
}
|
|
1754
|
+
for (const key of Object.keys(source)) {
|
|
1755
|
+
result[key] = source[key];
|
|
1741
1756
|
}
|
|
1742
1757
|
return result;
|
|
1743
1758
|
}
|
|
@@ -1756,10 +1771,7 @@ var cydran = (() => {
|
|
|
1756
1771
|
if (!isDefined(source)) {
|
|
1757
1772
|
continue;
|
|
1758
1773
|
}
|
|
1759
|
-
for (const name2
|
|
1760
|
-
if (!source.hasOwnProperty(name2)) {
|
|
1761
|
-
continue;
|
|
1762
|
-
}
|
|
1774
|
+
for (const name2 of Object.keys(source)) {
|
|
1763
1775
|
if (!isDefined(source[name2])) {
|
|
1764
1776
|
continue;
|
|
1765
1777
|
}
|
|
@@ -1772,10 +1784,7 @@ var cydran = (() => {
|
|
|
1772
1784
|
if (!isDefined(source)) {
|
|
1773
1785
|
continue;
|
|
1774
1786
|
}
|
|
1775
|
-
for (const name2
|
|
1776
|
-
if (!source.hasOwnProperty(name2)) {
|
|
1777
|
-
continue;
|
|
1778
|
-
}
|
|
1787
|
+
for (const name2 of Object.keys(source)) {
|
|
1779
1788
|
if (!isDefined(source[name2])) {
|
|
1780
1789
|
continue;
|
|
1781
1790
|
}
|
|
@@ -1790,10 +1799,8 @@ var cydran = (() => {
|
|
|
1790
1799
|
}
|
|
1791
1800
|
function extractKeys(source) {
|
|
1792
1801
|
const result = [];
|
|
1793
|
-
for (const name2
|
|
1794
|
-
|
|
1795
|
-
result.push(name2);
|
|
1796
|
-
}
|
|
1802
|
+
for (const name2 of Object.keys(source)) {
|
|
1803
|
+
result.push(name2);
|
|
1797
1804
|
}
|
|
1798
1805
|
return result;
|
|
1799
1806
|
}
|
|
@@ -1892,7 +1899,7 @@ var cydran = (() => {
|
|
|
1892
1899
|
return doPadWork(DIR.RIGHT, text, desiredLength, padCharacter);
|
|
1893
1900
|
}
|
|
1894
1901
|
function doPadWork(direction, text, desiredLength, padCharacter) {
|
|
1895
|
-
|
|
1902
|
+
const wkStr = text !== null && text !== void 0 ? text : "";
|
|
1896
1903
|
const wkPadChars = padCharacter !== null && padCharacter !== void 0 ? padCharacter : " ";
|
|
1897
1904
|
const wkLength = desiredLength !== null && desiredLength !== void 0 ? desiredLength : 0;
|
|
1898
1905
|
return DIR.LEFT == direction ? wkStr.padStart(wkLength, wkPadChars) : wkStr.padEnd(wkLength, wkPadChars);
|
|
@@ -1910,11 +1917,9 @@ var cydran = (() => {
|
|
|
1910
1917
|
destinationNode.parentElement.insertBefore(addedNode, destinationNode.nextSibling);
|
|
1911
1918
|
}
|
|
1912
1919
|
function forEachField(source, callback) {
|
|
1913
|
-
for (const key
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
callback(key, value);
|
|
1917
|
-
}
|
|
1920
|
+
for (const key of Object.keys(source)) {
|
|
1921
|
+
const value = source[key];
|
|
1922
|
+
callback(key, value);
|
|
1918
1923
|
}
|
|
1919
1924
|
}
|
|
1920
1925
|
function removeFromArray(source, instance) {
|
|
@@ -1940,6 +1945,14 @@ var cydran = (() => {
|
|
|
1940
1945
|
function hasMethod(instance, methodName) {
|
|
1941
1946
|
return isDefined(instance) && typeof instance[methodName] === "function";
|
|
1942
1947
|
}
|
|
1948
|
+
function resolveNamedMethod(thisObject, name2, argName = "name") {
|
|
1949
|
+
requireNotNull(thisObject, "thisObject");
|
|
1950
|
+
requireType("string", name2, argName);
|
|
1951
|
+
if (!hasMethod(thisObject, name2)) {
|
|
1952
|
+
throw new Errors_1.UnknownMethodError(`${extractClassName(thisObject)} has no method named '${name2}'`);
|
|
1953
|
+
}
|
|
1954
|
+
return thisObject[name2];
|
|
1955
|
+
}
|
|
1943
1956
|
function partial(fn, position, fixedValue) {
|
|
1944
1957
|
requireNotNull(fn, "fn");
|
|
1945
1958
|
requireNotNull(position, "position");
|
|
@@ -2003,20 +2016,14 @@ var cydran = (() => {
|
|
|
2003
2016
|
}
|
|
2004
2017
|
});
|
|
2005
2018
|
|
|
2006
|
-
// dist/src/pattern/
|
|
2007
|
-
var
|
|
2008
|
-
"dist/src/pattern/
|
|
2019
|
+
// dist/src/pattern/RefPair.js
|
|
2020
|
+
var require_RefPair = __commonJS({
|
|
2021
|
+
"dist/src/pattern/RefPair.js"(exports) {
|
|
2009
2022
|
"use strict";
|
|
2010
|
-
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
2011
|
-
return mod && mod.__esModule ? mod : { "default": mod };
|
|
2012
|
-
};
|
|
2013
2023
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2014
2024
|
var Utils_1 = require_Utils();
|
|
2015
|
-
var PairedWeakMapImpl_1 = __importDefault(require_PairedWeakMapImpl());
|
|
2016
2025
|
var RefPair = class {
|
|
2017
2026
|
constructor(first, second) {
|
|
2018
|
-
this.first = first;
|
|
2019
|
-
this.second = second;
|
|
2020
2027
|
(0, Utils_1.requireNotNull)(first, "first");
|
|
2021
2028
|
(0, Utils_1.requireNotNull)(second, "second");
|
|
2022
2029
|
this.firstRef = new WeakRef(first);
|
|
@@ -2025,9 +2032,25 @@ var cydran = (() => {
|
|
|
2025
2032
|
deref() {
|
|
2026
2033
|
const currentFirst = this.firstRef.deref();
|
|
2027
2034
|
const currentSecond = this.secondRef.deref();
|
|
2028
|
-
|
|
2035
|
+
const missing = !(0, Utils_1.isDefined)(currentFirst) || !(0, Utils_1.isDefined)(currentSecond);
|
|
2036
|
+
return missing ? void 0 : { first: currentFirst, second: currentSecond };
|
|
2029
2037
|
}
|
|
2030
2038
|
};
|
|
2039
|
+
exports.default = RefPair;
|
|
2040
|
+
}
|
|
2041
|
+
});
|
|
2042
|
+
|
|
2043
|
+
// dist/src/pattern/GarbageCollectablePairedSetImpl.js
|
|
2044
|
+
var require_GarbageCollectablePairedSetImpl = __commonJS({
|
|
2045
|
+
"dist/src/pattern/GarbageCollectablePairedSetImpl.js"(exports) {
|
|
2046
|
+
"use strict";
|
|
2047
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
2048
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
2049
|
+
};
|
|
2050
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2051
|
+
var Utils_1 = require_Utils();
|
|
2052
|
+
var PairedWeakMapImpl_1 = __importDefault(require_PairedWeakMapImpl());
|
|
2053
|
+
var RefPair_1 = __importDefault(require_RefPair());
|
|
2031
2054
|
function createRemovalPredicate(first, second) {
|
|
2032
2055
|
return (ref) => {
|
|
2033
2056
|
const current = ref.deref();
|
|
@@ -2040,7 +2063,11 @@ var cydran = (() => {
|
|
|
2040
2063
|
this.supportDatas = new PairedWeakMapImpl_1.default();
|
|
2041
2064
|
this.finalizationRegistry = new FinalizationRegistry((supportData) => {
|
|
2042
2065
|
if ((0, Utils_1.isDefined)(supportData.finalizer)) {
|
|
2043
|
-
supportData.finalizer
|
|
2066
|
+
const finalizer = (0, Utils_1.isDefined)(supportData.finalizer) ? supportData.finalizer : null;
|
|
2067
|
+
if ((0, Utils_1.isDefined)(finalizer)) {
|
|
2068
|
+
const metadata = supportData.metadata;
|
|
2069
|
+
finalizer(metadata);
|
|
2070
|
+
}
|
|
2044
2071
|
}
|
|
2045
2072
|
});
|
|
2046
2073
|
}
|
|
@@ -2049,7 +2076,7 @@ var cydran = (() => {
|
|
|
2049
2076
|
(0, Utils_1.requireNotNull)(secondItem, "secondItem");
|
|
2050
2077
|
this.remove(firstItem, secondItem);
|
|
2051
2078
|
this.prune();
|
|
2052
|
-
this.items.push(new
|
|
2079
|
+
this.items.push(new RefPair_1.default(firstItem, secondItem));
|
|
2053
2080
|
const supportData = {
|
|
2054
2081
|
metadata,
|
|
2055
2082
|
finalizer
|
|
@@ -2080,13 +2107,14 @@ var cydran = (() => {
|
|
|
2080
2107
|
this.supportDatas.clear();
|
|
2081
2108
|
}
|
|
2082
2109
|
size() {
|
|
2110
|
+
this.prune();
|
|
2083
2111
|
return this.items.length;
|
|
2084
2112
|
}
|
|
2085
2113
|
isEmpty() {
|
|
2086
|
-
return this.
|
|
2114
|
+
return this.size() === 0;
|
|
2087
2115
|
}
|
|
2088
2116
|
isPopulated() {
|
|
2089
|
-
return this.
|
|
2117
|
+
return this.size() > 0;
|
|
2090
2118
|
}
|
|
2091
2119
|
prune() {
|
|
2092
2120
|
const removableItems = this.items.filter((i) => !(0, Utils_1.isDefined)(i.deref()));
|
|
@@ -2117,17 +2145,25 @@ var cydran = (() => {
|
|
|
2117
2145
|
receive(messageName, payload) {
|
|
2118
2146
|
const callbacksForMessageType = this.callbacks[messageName];
|
|
2119
2147
|
if ((0, Utils_1.isDefined)(callbacksForMessageType)) {
|
|
2120
|
-
callbacksForMessageType.forEach((thisObject, callback) => {
|
|
2121
|
-
|
|
2148
|
+
callbacksForMessageType.forEach((thisObject, callback, metadata) => {
|
|
2149
|
+
if ((0, Utils_1.isDefined)(thisObject) && (0, Utils_1.isDefined)(callback)) {
|
|
2150
|
+
if ((0, Utils_1.isDefined)(metadata) && (0, Utils_1.isDefined)(metadata.before)) {
|
|
2151
|
+
metadata.before.apply({});
|
|
2152
|
+
}
|
|
2153
|
+
callback.call(thisObject, payload);
|
|
2154
|
+
if ((0, Utils_1.isDefined)(metadata) && (0, Utils_1.isDefined)(metadata.after)) {
|
|
2155
|
+
metadata.after.apply({});
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2122
2158
|
});
|
|
2123
2159
|
}
|
|
2124
2160
|
}
|
|
2125
|
-
register(messageName, callback = null) {
|
|
2161
|
+
register(messageName, callback = null, before, after) {
|
|
2126
2162
|
(0, Utils_1.requireNotNull)(messageName, "messageName");
|
|
2127
2163
|
if (!(0, Utils_1.isDefined)(this.callbacks[messageName])) {
|
|
2128
2164
|
this.callbacks[messageName] = new GarbageCollectablePairedSetImpl_1.default();
|
|
2129
2165
|
}
|
|
2130
|
-
this.callbacks[messageName].add(this.thisObjectFn(), callback);
|
|
2166
|
+
this.callbacks[messageName].add(this.thisObjectFn(), callback, { before, after });
|
|
2131
2167
|
}
|
|
2132
2168
|
$release() {
|
|
2133
2169
|
this.callbacks = {};
|
|
@@ -2176,19 +2212,19 @@ var cydran = (() => {
|
|
|
2176
2212
|
forChannel: (channelName) => {
|
|
2177
2213
|
(0, Utils_1.requireNotNull)(channelName, "channelName");
|
|
2178
2214
|
return {
|
|
2179
|
-
invoke: (
|
|
2180
|
-
(0, Utils_1.
|
|
2181
|
-
mine.listenTo(channelName, messageName, callback);
|
|
2215
|
+
invoke: (name2, before, after) => {
|
|
2216
|
+
const callback = (0, Utils_1.resolveNamedMethod)(mine.thisObject, name2);
|
|
2217
|
+
mine.listenTo(channelName, messageName, callback, before, after);
|
|
2182
2218
|
}
|
|
2183
2219
|
};
|
|
2184
2220
|
},
|
|
2185
|
-
invoke: (
|
|
2186
|
-
(0, Utils_1.
|
|
2187
|
-
mine.listenTo(CydranConstants_1.INTERNAL_CHANNEL_NAME, messageName, callback);
|
|
2221
|
+
invoke: (name2, before, after) => {
|
|
2222
|
+
const callback = (0, Utils_1.resolveNamedMethod)(mine.thisObject, name2);
|
|
2223
|
+
mine.listenTo(CydranConstants_1.INTERNAL_CHANNEL_NAME, messageName, callback, before, after);
|
|
2188
2224
|
}
|
|
2189
2225
|
};
|
|
2190
2226
|
}
|
|
2191
|
-
listenTo(channelName, messageName, callback) {
|
|
2227
|
+
listenTo(channelName, messageName, callback, before, after) {
|
|
2192
2228
|
(0, Utils_1.requireNotNull)(channelName, "channelName");
|
|
2193
2229
|
(0, Utils_1.requireNotNull)(messageName, "messageName");
|
|
2194
2230
|
(0, Utils_1.requireNotNull)(callback, "callback");
|
|
@@ -2196,7 +2232,7 @@ var cydran = (() => {
|
|
|
2196
2232
|
this.listeners[channelName] = new ListenerImpl_1.default(() => this.thisObject);
|
|
2197
2233
|
}
|
|
2198
2234
|
const listener = this.listeners[channelName];
|
|
2199
|
-
listener.register(messageName, callback);
|
|
2235
|
+
listener.register(messageName, callback, before, after);
|
|
2200
2236
|
}
|
|
2201
2237
|
};
|
|
2202
2238
|
exports.default = ReceiverImpl;
|
|
@@ -2315,16 +2351,17 @@ var cydran = (() => {
|
|
|
2315
2351
|
}
|
|
2316
2352
|
execute(state, parameter) {
|
|
2317
2353
|
const result = this.predicate.apply(state.getModel(), [parameter, state.getModel()]);
|
|
2318
|
-
if (result) {
|
|
2319
|
-
for (const callback of this.callbacks) {
|
|
2320
|
-
callback.apply(state.getModel(), [parameter, state.getModel()]);
|
|
2321
|
-
}
|
|
2322
|
-
}
|
|
2323
2354
|
return result;
|
|
2324
2355
|
}
|
|
2356
|
+
executeCallbacks(model, parameter) {
|
|
2357
|
+
for (const callback of this.callbacks) {
|
|
2358
|
+
callback.apply(model, [parameter, model]);
|
|
2359
|
+
}
|
|
2360
|
+
}
|
|
2325
2361
|
getTargetState() {
|
|
2326
2362
|
return this.targetState;
|
|
2327
2363
|
}
|
|
2364
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2328
2365
|
validate(stateNames, errors) {
|
|
2329
2366
|
let idFound = false;
|
|
2330
2367
|
for (const id of stateNames) {
|
|
@@ -2372,6 +2409,7 @@ var cydran = (() => {
|
|
|
2372
2409
|
const targetState = transition.getTargetState();
|
|
2373
2410
|
machineState.setState(targetState);
|
|
2374
2411
|
changed = true;
|
|
2412
|
+
transition.executeCallbacks(machineState.getModel(), parameter);
|
|
2375
2413
|
break;
|
|
2376
2414
|
}
|
|
2377
2415
|
}
|
|
@@ -2400,22 +2438,18 @@ var cydran = (() => {
|
|
|
2400
2438
|
if (!idFound) {
|
|
2401
2439
|
throw new Errors_1.ValidationError(`State ${this.id} is not a valid state id`);
|
|
2402
2440
|
}
|
|
2403
|
-
for (const key
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
currentTransition.validate(stateNames, errors);
|
|
2408
|
-
}
|
|
2441
|
+
for (const key of Object.keys(this.transitions)) {
|
|
2442
|
+
const currentTransitions = this.transitions[key];
|
|
2443
|
+
for (const currentTransition of currentTransitions) {
|
|
2444
|
+
currentTransition.validate(stateNames, errors);
|
|
2409
2445
|
}
|
|
2410
2446
|
}
|
|
2411
2447
|
}
|
|
2412
2448
|
$release() {
|
|
2413
|
-
for (const key
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
(0, Utils_1.safeCydranDisposal)(transition);
|
|
2418
|
-
}
|
|
2449
|
+
for (const key of Object.keys(this.transitions)) {
|
|
2450
|
+
const transitions = this.transitions[key];
|
|
2451
|
+
for (const transition of transitions) {
|
|
2452
|
+
(0, Utils_1.safeCydranDisposal)(transition);
|
|
2419
2453
|
}
|
|
2420
2454
|
}
|
|
2421
2455
|
this.transitions = {};
|
|
@@ -2499,18 +2533,14 @@ var cydran = (() => {
|
|
|
2499
2533
|
}
|
|
2500
2534
|
validate() {
|
|
2501
2535
|
const errors = new Messages_1.default("Machine definition is invalid");
|
|
2502
|
-
errors.addIf(!this.states.
|
|
2536
|
+
errors.addIf(!Object.keys(this.states).includes(this.startState), () => `Start state is not a validate state: ${this.startState}`);
|
|
2503
2537
|
const stateNames = [];
|
|
2504
|
-
for (const key
|
|
2505
|
-
|
|
2506
|
-
stateNames.push(key);
|
|
2507
|
-
}
|
|
2538
|
+
for (const key of Object.keys(this.states)) {
|
|
2539
|
+
stateNames.push(key);
|
|
2508
2540
|
}
|
|
2509
|
-
for (const key
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
currentState.validate(stateNames, errors);
|
|
2513
|
-
}
|
|
2541
|
+
for (const key of Object.keys(this.states)) {
|
|
2542
|
+
const currentState = this.states[key];
|
|
2543
|
+
currentState.validate(stateNames, errors);
|
|
2514
2544
|
}
|
|
2515
2545
|
errors.ifMessages((message) => {
|
|
2516
2546
|
throw new Errors_1.ValidationError(message);
|
|
@@ -2526,10 +2556,8 @@ var cydran = (() => {
|
|
|
2526
2556
|
this.states[id].withTransition(input, targetState, callbacks, predicate);
|
|
2527
2557
|
}
|
|
2528
2558
|
$release() {
|
|
2529
|
-
for (const key
|
|
2530
|
-
|
|
2531
|
-
(0, Utils_1.safeCydranDisposal)(this.states[key]);
|
|
2532
|
-
}
|
|
2559
|
+
for (const key of Object.keys(this.states)) {
|
|
2560
|
+
(0, Utils_1.safeCydranDisposal)(this.states[key]);
|
|
2533
2561
|
}
|
|
2534
2562
|
this.states = {};
|
|
2535
2563
|
}
|
|
@@ -2647,13 +2675,7 @@ var cydran = (() => {
|
|
|
2647
2675
|
this.values = {};
|
|
2648
2676
|
}
|
|
2649
2677
|
size() {
|
|
2650
|
-
|
|
2651
|
-
for (const key in this.values) {
|
|
2652
|
-
if (!this.values.hasOwnProperty(key)) {
|
|
2653
|
-
continue;
|
|
2654
|
-
}
|
|
2655
|
-
++count;
|
|
2656
|
-
}
|
|
2678
|
+
const count = Object.keys(this.values).length;
|
|
2657
2679
|
return count;
|
|
2658
2680
|
}
|
|
2659
2681
|
isEmpty() {
|
|
@@ -2712,10 +2734,7 @@ var cydran = (() => {
|
|
|
2712
2734
|
(0, Utils_1.requireNotNull)(config, "config");
|
|
2713
2735
|
const extracted = config.isPrefixed() ? (0, Utils_1.extractAttributesWithPrefix)(prefix + CydranConstants_1.ATTRIBUTE_DELIMITER, element, config.getValidator().getNames()) : (0, Utils_1.extractAttributes)(element, config.getValidator().getNames());
|
|
2714
2736
|
const valuelessDefaults = config.getValuelessDefaults();
|
|
2715
|
-
for (const key
|
|
2716
|
-
if (!extracted.hasOwnProperty(key)) {
|
|
2717
|
-
continue;
|
|
2718
|
-
}
|
|
2737
|
+
for (const key of Object.keys(extracted)) {
|
|
2719
2738
|
if ((0, Utils_1.isDefined)(extracted[key]) && extracted[key].length === 0 && (0, Utils_1.isDefined)(valuelessDefaults[key])) {
|
|
2720
2739
|
extracted[key] = valuelessDefaults[key];
|
|
2721
2740
|
}
|
|
@@ -2730,10 +2749,7 @@ var cydran = (() => {
|
|
|
2730
2749
|
convertValues(config, values) {
|
|
2731
2750
|
const result = {};
|
|
2732
2751
|
const converters = config.getConverters();
|
|
2733
|
-
for (const key
|
|
2734
|
-
if (!values.hasOwnProperty(key)) {
|
|
2735
|
-
continue;
|
|
2736
|
-
}
|
|
2752
|
+
for (const key of Object.keys(values)) {
|
|
2737
2753
|
const sourceValue = values[key];
|
|
2738
2754
|
const converter = converters[key];
|
|
2739
2755
|
const resultValue = (0, Utils_1.isDefined)(converter) ? converter(sourceValue) : sourceValue;
|
|
@@ -2994,10 +3010,7 @@ var cydran = (() => {
|
|
|
2994
3010
|
}
|
|
2995
3011
|
validate(values, state, prefix = "") {
|
|
2996
3012
|
const errors = [];
|
|
2997
|
-
for (const key
|
|
2998
|
-
if (!this.validations.hasOwnProperty(key)) {
|
|
2999
|
-
continue;
|
|
3000
|
-
}
|
|
3013
|
+
for (const key of Object.keys(this.validations)) {
|
|
3001
3014
|
const value = values[key];
|
|
3002
3015
|
this.validateValue(prefix, key, value, values, state, errors);
|
|
3003
3016
|
}
|
|
@@ -3228,19 +3241,13 @@ var cydran = (() => {
|
|
|
3228
3241
|
forChannel: (channelName) => {
|
|
3229
3242
|
(0, Utils_1.requireNotNull)(channelName, CHANNEL_NAME);
|
|
3230
3243
|
return {
|
|
3231
|
-
invoke: (
|
|
3232
|
-
(
|
|
3233
|
-
this.receiver.on(messageName).forChannel(channelName).invoke((payload) => {
|
|
3234
|
-
callback.apply(this, [payload]);
|
|
3235
|
-
});
|
|
3244
|
+
invoke: (name2) => {
|
|
3245
|
+
this.receiver.on(messageName).forChannel(channelName).invoke(name2);
|
|
3236
3246
|
}
|
|
3237
3247
|
};
|
|
3238
3248
|
},
|
|
3239
|
-
invoke: (
|
|
3240
|
-
(
|
|
3241
|
-
this.receiver.on(messageName).forChannel(CydranConstants_1.INTERNAL_CHANNEL_NAME).invoke((payload) => {
|
|
3242
|
-
callback.apply(this, [payload]);
|
|
3243
|
-
});
|
|
3249
|
+
invoke: (name2) => {
|
|
3250
|
+
this.receiver.on(messageName).forChannel(CydranConstants_1.INTERNAL_CHANNEL_NAME).invoke(name2);
|
|
3244
3251
|
}
|
|
3245
3252
|
};
|
|
3246
3253
|
}
|
|
@@ -3398,24 +3405,18 @@ var cydran = (() => {
|
|
|
3398
3405
|
this.domListeners = {};
|
|
3399
3406
|
this.params = null;
|
|
3400
3407
|
this.id = IdGenerator_1.IdGenerator.generate();
|
|
3401
|
-
this.receiver = new ReceiverImpl_1.default(this);
|
|
3408
|
+
this.receiver = new ReceiverImpl_1.default(this.parent);
|
|
3402
3409
|
if (this.dependencies.el.nodeType === Node.ELEMENT_NODE && this.dependencies.validated) {
|
|
3403
3410
|
this.tagText = (0, Utils_1.elementAsString)(this.dependencies.el);
|
|
3404
3411
|
}
|
|
3405
3412
|
}
|
|
3406
3413
|
bindDomListeners() {
|
|
3407
|
-
for (const name2
|
|
3408
|
-
if (!this.domListeners.hasOwnProperty(name2)) {
|
|
3409
|
-
continue;
|
|
3410
|
-
}
|
|
3414
|
+
for (const name2 of Object.keys(this.domListeners)) {
|
|
3411
3415
|
this.getEl().addEventListener(name2, this.domListeners[name2], false);
|
|
3412
3416
|
}
|
|
3413
3417
|
}
|
|
3414
3418
|
unbindDomListeners() {
|
|
3415
|
-
for (const name2
|
|
3416
|
-
if (!this.domListeners.hasOwnProperty(name2)) {
|
|
3417
|
-
continue;
|
|
3418
|
-
}
|
|
3419
|
+
for (const name2 of Object.keys(this.domListeners)) {
|
|
3419
3420
|
this.getEl().removeEventListener(name2, this.domListeners[name2]);
|
|
3420
3421
|
}
|
|
3421
3422
|
}
|
|
@@ -3502,8 +3503,10 @@ var cydran = (() => {
|
|
|
3502
3503
|
constructor() {
|
|
3503
3504
|
this.____internal$$cydran____ = new BehaviorInternalsImpl_1.default(this);
|
|
3504
3505
|
}
|
|
3506
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3505
3507
|
requestDigestionSources(sources) {
|
|
3506
3508
|
}
|
|
3509
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3507
3510
|
onInit(dependencies) {
|
|
3508
3511
|
}
|
|
3509
3512
|
onMount() {
|
|
@@ -3610,7 +3613,7 @@ var cydran = (() => {
|
|
|
3610
3613
|
}
|
|
3611
3614
|
/**
|
|
3612
3615
|
* [getModel description]
|
|
3613
|
-
* @return {
|
|
3616
|
+
* @return {unknown} [description]
|
|
3614
3617
|
*/
|
|
3615
3618
|
getModel() {
|
|
3616
3619
|
return this.____internal$$cydran____.getModel();
|
|
@@ -3698,7 +3701,7 @@ var cydran = (() => {
|
|
|
3698
3701
|
super.onMount();
|
|
3699
3702
|
this.onChange(null, this.getMediator().get());
|
|
3700
3703
|
if (this.isMutable()) {
|
|
3701
|
-
this.getMediator().watch(this,
|
|
3704
|
+
this.getMediator().watch(this, "onChange");
|
|
3702
3705
|
}
|
|
3703
3706
|
}
|
|
3704
3707
|
};
|
|
@@ -3733,10 +3736,8 @@ var cydran = (() => {
|
|
|
3733
3736
|
}
|
|
3734
3737
|
keys() {
|
|
3735
3738
|
const result = [];
|
|
3736
|
-
for (const key
|
|
3737
|
-
|
|
3738
|
-
result.push(key);
|
|
3739
|
-
}
|
|
3739
|
+
for (const key of Object.keys(this.values)) {
|
|
3740
|
+
result.push(key);
|
|
3740
3741
|
}
|
|
3741
3742
|
return result;
|
|
3742
3743
|
}
|
|
@@ -3748,7 +3749,7 @@ var cydran = (() => {
|
|
|
3748
3749
|
}
|
|
3749
3750
|
has(key) {
|
|
3750
3751
|
(0, Utils_1.requireNotNull)(key, KEY);
|
|
3751
|
-
return this.values.
|
|
3752
|
+
return Object.keys(this.values).includes(key);
|
|
3752
3753
|
}
|
|
3753
3754
|
lacks(key) {
|
|
3754
3755
|
(0, Utils_1.requireNotNull)(key, KEY);
|
|
@@ -3772,10 +3773,7 @@ var cydran = (() => {
|
|
|
3772
3773
|
return this.get(key);
|
|
3773
3774
|
}
|
|
3774
3775
|
each(consumer) {
|
|
3775
|
-
for (const key
|
|
3776
|
-
if (!this.values.hasOwnProperty(key)) {
|
|
3777
|
-
continue;
|
|
3778
|
-
}
|
|
3776
|
+
for (const key of Object.keys(this.values)) {
|
|
3779
3777
|
const value = this.values[key];
|
|
3780
3778
|
consumer(value);
|
|
3781
3779
|
}
|
|
@@ -4147,9 +4145,8 @@ Message: ${e.message}`, e);
|
|
|
4147
4145
|
this.watchDispatchPending = false;
|
|
4148
4146
|
}
|
|
4149
4147
|
}
|
|
4150
|
-
watch(thisObject,
|
|
4151
|
-
(0, Utils_1.
|
|
4152
|
-
(0, Utils_1.requireNotNull)(callback, "callback");
|
|
4148
|
+
watch(thisObject, name2) {
|
|
4149
|
+
const callback = (0, Utils_1.resolveNamedMethod)(thisObject, name2);
|
|
4153
4150
|
this.callbacks.add(thisObject, callback);
|
|
4154
4151
|
}
|
|
4155
4152
|
unwatch(thisObject, callback) {
|
|
@@ -4299,17 +4296,11 @@ Message: ${e.message}`, e);
|
|
|
4299
4296
|
this.items = {};
|
|
4300
4297
|
if (this.parent) {
|
|
4301
4298
|
const parentItems = this.parent.getItems();
|
|
4302
|
-
for (const key
|
|
4303
|
-
if (!parentItems.hasOwnProperty(key)) {
|
|
4304
|
-
continue;
|
|
4305
|
-
}
|
|
4299
|
+
for (const key of Object.keys(parentItems)) {
|
|
4306
4300
|
this.items[key] = parentItems[key];
|
|
4307
4301
|
}
|
|
4308
4302
|
}
|
|
4309
|
-
for (const key
|
|
4310
|
-
if (!this.localItems.hasOwnProperty(key)) {
|
|
4311
|
-
continue;
|
|
4312
|
-
}
|
|
4303
|
+
for (const key of Object.keys(this.localItems)) {
|
|
4313
4304
|
this.items[key] = this.localItems[key];
|
|
4314
4305
|
}
|
|
4315
4306
|
}
|
|
@@ -4420,6 +4411,7 @@ ${this.template}
|
|
|
4420
4411
|
process(items) {
|
|
4421
4412
|
return items;
|
|
4422
4413
|
}
|
|
4414
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4423
4415
|
setCallback(callback) {
|
|
4424
4416
|
}
|
|
4425
4417
|
invalidate() {
|
|
@@ -4452,7 +4444,7 @@ ${this.template}
|
|
|
4452
4444
|
var Utils_1 = require_Utils();
|
|
4453
4445
|
var CydranConstants_1 = require_CydranConstants();
|
|
4454
4446
|
var getLogger_1 = __importDefault(require_getLogger());
|
|
4455
|
-
var regex = /(^[^ - ]+)
|
|
4447
|
+
var regex = /(^[^ - ]+) - (.+)$/;
|
|
4456
4448
|
var AbstractPhaseImpl = class {
|
|
4457
4449
|
constructor(name2, previous) {
|
|
4458
4450
|
let wkLogName = name2;
|
|
@@ -4510,9 +4502,9 @@ ${this.template}
|
|
|
4510
4502
|
var AsFunctions_1 = require_AsFunctions();
|
|
4511
4503
|
var Utils_1 = require_Utils();
|
|
4512
4504
|
var IndexedEvaluator = class {
|
|
4513
|
-
constructor(expression, scope, reducerFn,
|
|
4505
|
+
constructor(expression, scope, reducerFn, logger) {
|
|
4514
4506
|
this.reducerFn = (0, Utils_1.isDefined)(reducerFn) ? reducerFn : AsFunctions_1.asIdentity;
|
|
4515
|
-
this.logger =
|
|
4507
|
+
this.logger = logger;
|
|
4516
4508
|
this.expression = (0, Utils_1.requireNotNull)(expression, "expression");
|
|
4517
4509
|
this.scope = (0, Utils_1.requireNotNull)(scope, "scope");
|
|
4518
4510
|
this.code = `
|
|
@@ -4562,7 +4554,7 @@ Message: ${e.message}`, e);
|
|
|
4562
4554
|
this.logger = logr;
|
|
4563
4555
|
this.callbacks = new GarbageCollectablePairedSetImpl_1.default();
|
|
4564
4556
|
this.value = watchable.evaluate(expression);
|
|
4565
|
-
watchable.onExpressionValueChange(expression, this
|
|
4557
|
+
watchable.onExpressionValueChange(expression, this, "onChange", AsFunctions_1.asIdentity);
|
|
4566
4558
|
}
|
|
4567
4559
|
onChange(previous, current) {
|
|
4568
4560
|
this.logger.ifTrace(() => ({
|
|
@@ -4823,9 +4815,10 @@ Message: ${e.message}`, e);
|
|
|
4823
4815
|
this.filteredItems = [];
|
|
4824
4816
|
this.phase = phase;
|
|
4825
4817
|
this.watchable = (0, Utils_1.requireNotNull)(watchable, "watchable");
|
|
4826
|
-
this.
|
|
4818
|
+
this.refreshCallback = () => this.refresh();
|
|
4819
|
+
this.watcher = (0, Utils_1.requireNotNull)(watcher, "watcher").addCallback(this, this.refreshCallback);
|
|
4827
4820
|
this.callbacks = [];
|
|
4828
|
-
this.phase.setCallback(
|
|
4821
|
+
this.phase.setCallback(this.refreshCallback);
|
|
4829
4822
|
this.refresh();
|
|
4830
4823
|
}
|
|
4831
4824
|
items() {
|
|
@@ -5098,9 +5091,8 @@ Message: ${e.message}`, e);
|
|
|
5098
5091
|
this.messageName = (0, Utils_1.requireNotNull)(messageName, "messageName");
|
|
5099
5092
|
this.channelName = (0, Utils_1.requireNotNull)(channelName, "channelName");
|
|
5100
5093
|
}
|
|
5101
|
-
invoke(
|
|
5102
|
-
(
|
|
5103
|
-
this.internals.on(callback, this.messageName, this.channelName);
|
|
5094
|
+
invoke(name2) {
|
|
5095
|
+
this.internals.on(name2, this.messageName, this.channelName);
|
|
5104
5096
|
}
|
|
5105
5097
|
};
|
|
5106
5098
|
exports.default = ForChannelContinuationImpl;
|
|
@@ -5123,9 +5115,8 @@ Message: ${e.message}`, e);
|
|
|
5123
5115
|
this.internals = (0, Utils_1.requireNotNull)(internals, "internals");
|
|
5124
5116
|
this.messageName = (0, Utils_1.requireNotNull)(messageName, "messageName");
|
|
5125
5117
|
}
|
|
5126
|
-
invoke(
|
|
5127
|
-
(
|
|
5128
|
-
this.internals.on(callback, this.messageName, CydranConstants_1.INTERNAL_CHANNEL_NAME);
|
|
5118
|
+
invoke(name2) {
|
|
5119
|
+
this.internals.on(name2, this.messageName, CydranConstants_1.INTERNAL_CHANNEL_NAME);
|
|
5129
5120
|
}
|
|
5130
5121
|
forChannel(channelName) {
|
|
5131
5122
|
return new ForChannelContinuationImpl_1.default(this.internals, this.messageName, channelName);
|
|
@@ -5181,15 +5172,38 @@ Message: ${e.message}`, e);
|
|
|
5181
5172
|
this.internals = (0, Utils_1.requireNotNull)(internals, "internals");
|
|
5182
5173
|
this.delay = (0, Utils_1.requireNotNull)(delay, "delay");
|
|
5183
5174
|
}
|
|
5184
|
-
invoke(
|
|
5185
|
-
(
|
|
5186
|
-
this.internals.addInterval(callback, this.delay);
|
|
5175
|
+
invoke(name2) {
|
|
5176
|
+
this.internals.addInterval(name2, this.delay);
|
|
5187
5177
|
}
|
|
5188
5178
|
};
|
|
5189
5179
|
exports.default = IntervalContinuationImpl;
|
|
5190
5180
|
}
|
|
5191
5181
|
});
|
|
5192
5182
|
|
|
5183
|
+
// dist/src/continuation/WatchContinuationImpl.js
|
|
5184
|
+
var require_WatchContinuationImpl = __commonJS({
|
|
5185
|
+
"dist/src/continuation/WatchContinuationImpl.js"(exports) {
|
|
5186
|
+
"use strict";
|
|
5187
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5188
|
+
var Utils_1 = require_Utils();
|
|
5189
|
+
var WatchContinuationImpl = class {
|
|
5190
|
+
constructor(internals, component, expression) {
|
|
5191
|
+
this.internals = (0, Utils_1.requireNotNull)(internals, "internals");
|
|
5192
|
+
this.component = (0, Utils_1.requireNotNull)(component, "component");
|
|
5193
|
+
this.expression = (0, Utils_1.requireNotNull)(expression, "expression");
|
|
5194
|
+
}
|
|
5195
|
+
reducedBy(reducerFn) {
|
|
5196
|
+
this.reducerFn = (0, Utils_1.requireNotNull)(reducerFn, "reducerFn");
|
|
5197
|
+
return this;
|
|
5198
|
+
}
|
|
5199
|
+
invoke(name2) {
|
|
5200
|
+
this.internals.watch(this.expression, this.component, name2, this.reducerFn);
|
|
5201
|
+
}
|
|
5202
|
+
};
|
|
5203
|
+
exports.default = WatchContinuationImpl;
|
|
5204
|
+
}
|
|
5205
|
+
});
|
|
5206
|
+
|
|
5193
5207
|
// dist/src/continuation/ActionContinuationImpl.js
|
|
5194
5208
|
var require_ActionContinuationImpl = __commonJS({
|
|
5195
5209
|
"dist/src/continuation/ActionContinuationImpl.js"(exports) {
|
|
@@ -5203,16 +5217,19 @@ Message: ${e.message}`, e);
|
|
|
5203
5217
|
var OnContinuationImpl_1 = __importDefault(require_OnContinuationImpl());
|
|
5204
5218
|
var SendContinuationImpl_1 = __importDefault(require_SendContinuationImpl());
|
|
5205
5219
|
var IntervalContinuationImpl_1 = __importDefault(require_IntervalContinuationImpl());
|
|
5220
|
+
var WatchContinuationImpl_1 = __importDefault(require_WatchContinuationImpl());
|
|
5221
|
+
var Errors_1 = require_Errors();
|
|
5206
5222
|
var ActionContinuationImpl = class {
|
|
5207
|
-
constructor(component, internals) {
|
|
5223
|
+
constructor(component, internals, readySupplier) {
|
|
5208
5224
|
this.component = (0, Utils_1.requireNotNull)(component, "component");
|
|
5209
5225
|
this.internals = (0, Utils_1.requireNotNull)(internals, "internals");
|
|
5226
|
+
this.readySupplier = (0, Utils_1.requireNotNull)(readySupplier, "readySupplier");
|
|
5210
5227
|
}
|
|
5211
5228
|
getContext() {
|
|
5212
5229
|
return this.internals.getContext();
|
|
5213
5230
|
}
|
|
5214
|
-
onExpressionValueChange(expression
|
|
5215
|
-
this.internals.
|
|
5231
|
+
onExpressionValueChange(expression) {
|
|
5232
|
+
return new WatchContinuationImpl_1.default(this.internals, this.component, (0, Utils_1.requireNotNull)(expression, "expression"));
|
|
5216
5233
|
}
|
|
5217
5234
|
onMessage(messageName) {
|
|
5218
5235
|
return new OnContinuationImpl_1.default(this.internals, messageName);
|
|
@@ -5224,21 +5241,26 @@ Message: ${e.message}`, e);
|
|
|
5224
5241
|
return new SendContinuationImpl_1.default(this.internals, messageName, payload, startFrom);
|
|
5225
5242
|
}
|
|
5226
5243
|
createFilter(expression) {
|
|
5227
|
-
return this.internals.withFilter(
|
|
5244
|
+
return this.internals.withFilter((0, Utils_1.requireNotNull)(expression, "expression"));
|
|
5228
5245
|
}
|
|
5229
5246
|
regions() {
|
|
5247
|
+
this.guardReady();
|
|
5230
5248
|
return new RegionContinuationImpl_1.default(this.internals);
|
|
5231
5249
|
}
|
|
5232
5250
|
forSeries(name2) {
|
|
5251
|
+
this.guardReady();
|
|
5233
5252
|
return this.internals.forSeries(name2);
|
|
5234
5253
|
}
|
|
5235
5254
|
forElement(name2) {
|
|
5255
|
+
this.guardReady();
|
|
5236
5256
|
return this.internals.forElement(name2);
|
|
5237
5257
|
}
|
|
5238
5258
|
forForm(name2) {
|
|
5259
|
+
this.guardReady();
|
|
5239
5260
|
return this.internals.forForm(name2);
|
|
5240
5261
|
}
|
|
5241
5262
|
forForms() {
|
|
5263
|
+
this.guardReady();
|
|
5242
5264
|
return this.internals.forForms();
|
|
5243
5265
|
}
|
|
5244
5266
|
/**
|
|
@@ -5278,10 +5300,8 @@ Message: ${e.message}`, e);
|
|
|
5278
5300
|
getLogger() {
|
|
5279
5301
|
return this.internals.getLogger();
|
|
5280
5302
|
}
|
|
5281
|
-
getWatchScope() {
|
|
5282
|
-
return this.internals.getWatchScope();
|
|
5283
|
-
}
|
|
5284
5303
|
properties() {
|
|
5304
|
+
this.guardReady();
|
|
5285
5305
|
return this.internals.getContext().getProperties();
|
|
5286
5306
|
}
|
|
5287
5307
|
getId() {
|
|
@@ -5299,6 +5319,11 @@ Message: ${e.message}`, e);
|
|
|
5299
5319
|
getValue() {
|
|
5300
5320
|
return this.internals.getData();
|
|
5301
5321
|
}
|
|
5322
|
+
guardReady() {
|
|
5323
|
+
if (!this.readySupplier()) {
|
|
5324
|
+
throw new Errors_1.ComponentReadinessError("Component is not ready for action continuations. Ensure that the component is ready before invoking actions.");
|
|
5325
|
+
}
|
|
5326
|
+
}
|
|
5302
5327
|
};
|
|
5303
5328
|
exports.default = ActionContinuationImpl;
|
|
5304
5329
|
}
|
|
@@ -5451,6 +5476,19 @@ Message: ${e.message}`, e);
|
|
|
5451
5476
|
}
|
|
5452
5477
|
});
|
|
5453
5478
|
|
|
5479
|
+
// dist/src/util/NestableUtils.js
|
|
5480
|
+
var require_NestableUtils = __commonJS({
|
|
5481
|
+
"dist/src/util/NestableUtils.js"(exports) {
|
|
5482
|
+
"use strict";
|
|
5483
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5484
|
+
exports.bothPresentButDifferent = bothPresentButDifferent;
|
|
5485
|
+
var Utils_1 = require_Utils();
|
|
5486
|
+
function bothPresentButDifferent(first, second) {
|
|
5487
|
+
return (0, Utils_1.isDefined)(first) && (0, Utils_1.isDefined)(second) && first.$c().getId() !== second.$c().getId();
|
|
5488
|
+
}
|
|
5489
|
+
}
|
|
5490
|
+
});
|
|
5491
|
+
|
|
5454
5492
|
// dist/src/component/ComponentInternalsImpl.js
|
|
5455
5493
|
var require_ComponentInternalsImpl = __commonJS({
|
|
5456
5494
|
"dist/src/component/ComponentInternalsImpl.js"(exports) {
|
|
@@ -5490,13 +5528,16 @@ Message: ${e.message}`, e);
|
|
|
5490
5528
|
var GlobalContextHolder_1 = __importDefault(require_GlobalContextHolder());
|
|
5491
5529
|
var getLogger_1 = __importDefault(require_getLogger());
|
|
5492
5530
|
var SeriesOperationsImpl_1 = __importDefault(require_SeriesOperationsImpl());
|
|
5493
|
-
var
|
|
5531
|
+
var NestableUtils_1 = require_NestableUtils();
|
|
5532
|
+
var VALID_PREFIX_REGEX = /^([a-z]+-)*[a-z]+$/;
|
|
5494
5533
|
var ComponentInternalsImpl = class {
|
|
5495
5534
|
constructor(component, template, options) {
|
|
5535
|
+
this.ready = false;
|
|
5496
5536
|
this.template = (0, Utils_1.requireNotNull)(template, CydranConstants_1.TagNames.TEMPLATE);
|
|
5497
|
-
this.context = null;
|
|
5498
5537
|
this.component = (0, Utils_1.requireNotNull)(component, "component");
|
|
5538
|
+
this.context = null;
|
|
5499
5539
|
this.options = options;
|
|
5540
|
+
this.itemFn = () => this.getData();
|
|
5500
5541
|
this.machineState = COMPONENT_MACHINE.create(this);
|
|
5501
5542
|
}
|
|
5502
5543
|
getStyles() {
|
|
@@ -5506,7 +5547,11 @@ Message: ${e.message}`, e);
|
|
|
5506
5547
|
this.getMessagingContext().message(channelName, messageName, payload);
|
|
5507
5548
|
}
|
|
5508
5549
|
send(propagation, channelName, messageName, payload, startFrom) {
|
|
5509
|
-
|
|
5550
|
+
if (propagation === CydranConstants_1.To.IMMEDIATE_CHILD_COMPONENTS) {
|
|
5551
|
+
this.messageChildren(channelName, messageName, payload);
|
|
5552
|
+
} else {
|
|
5553
|
+
this.getMessagingContext().send(propagation, channelName, messageName, payload, startFrom);
|
|
5554
|
+
}
|
|
5510
5555
|
}
|
|
5511
5556
|
isMounted() {
|
|
5512
5557
|
return this.machineState.isState(ComponentStates_1.default.MOUNTED);
|
|
@@ -5515,7 +5560,7 @@ Message: ${e.message}`, e);
|
|
|
5515
5560
|
return this.parent;
|
|
5516
5561
|
}
|
|
5517
5562
|
bootstrap() {
|
|
5518
|
-
this.options = (0, Utils_1.merge)([DefaultComponentOptions_1.default, this.options], { metadata: (existingValue, newValue) => (0, Utils_1.merge)([existingValue, newValue]) });
|
|
5563
|
+
this.options = (0, Utils_1.merge)([DefaultComponentOptions_1.default, { name: this.component.constructor.name }, this.options], { metadata: (existingValue, newValue) => (0, Utils_1.merge)([existingValue, newValue]) });
|
|
5519
5564
|
this.options.prefix = this.options.prefix.toLowerCase();
|
|
5520
5565
|
if (!VALID_PREFIX_REGEX.test(this.options.prefix)) {
|
|
5521
5566
|
throw new Errors_1.ValidationError("Invalid prefix defined in options. Prefix values must only contain letters and single dashes.");
|
|
@@ -5542,7 +5587,6 @@ Message: ${e.message}`, e);
|
|
|
5542
5587
|
this.equalsDepth = (0, Utils_1.isDefined)(configuredEqualsDepth) ? configuredEqualsDepth : CydranConstants_1.DEFAULT_EQUALS_DEPTH;
|
|
5543
5588
|
const localModelFn = () => this.component;
|
|
5544
5589
|
this.modelFn = (0, Utils_1.isDefined)(this.options.parentModelFn) ? this.options.parentModelFn : localModelFn;
|
|
5545
|
-
this.itemFn = () => this.getData();
|
|
5546
5590
|
const parentScope = new ScopeImpl_1.default();
|
|
5547
5591
|
parentScope.setParent(this.getContext().getScope());
|
|
5548
5592
|
this.scope.setParent(parentScope);
|
|
@@ -5585,26 +5629,24 @@ Message: ${e.message}`, e);
|
|
|
5585
5629
|
const walker = this.getObject("cydran:domWalker");
|
|
5586
5630
|
walker.walk(this.el, this);
|
|
5587
5631
|
this.behaviors.setContext(this.getContext());
|
|
5588
|
-
this.component.onMount();
|
|
5589
|
-
this.tellChildren(ComponentTransitions_1.default.MOUNT);
|
|
5590
5632
|
this.tellBehaviors(ComponentTransitions_1.default.MOUNT);
|
|
5591
5633
|
this.tellMediators(MediatorTransitions_1.default.MOUNT);
|
|
5634
|
+
this.ready = true;
|
|
5635
|
+
this.component.onMount();
|
|
5592
5636
|
this.intervals.enable();
|
|
5593
5637
|
}
|
|
5594
5638
|
onUnmount() {
|
|
5595
5639
|
this.behaviors.setContext(null);
|
|
5596
5640
|
this.component.onUnmount();
|
|
5597
|
-
this.tellChildren(ComponentTransitions_1.default.UNMOUNT);
|
|
5598
5641
|
this.tellBehaviors(ComponentTransitions_1.default.UNMOUNT);
|
|
5599
5642
|
this.tellMediators(MediatorTransitions_1.default.UNMOUNT);
|
|
5600
5643
|
this.intervals.disable();
|
|
5601
5644
|
}
|
|
5602
5645
|
onRemount() {
|
|
5603
5646
|
this.behaviors.setContext(this.getContext());
|
|
5604
|
-
this.component.onRemount();
|
|
5605
|
-
this.tellChildren(ComponentTransitions_1.default.MOUNT);
|
|
5606
5647
|
this.tellBehaviors(ComponentTransitions_1.default.MOUNT);
|
|
5607
5648
|
this.tellMediators(MediatorTransitions_1.default.MOUNT);
|
|
5649
|
+
this.component.onRemount();
|
|
5608
5650
|
this.digest();
|
|
5609
5651
|
this.intervals.enable();
|
|
5610
5652
|
}
|
|
@@ -5652,9 +5694,7 @@ Message: ${e.message}`, e);
|
|
|
5652
5694
|
tell(name2, payload) {
|
|
5653
5695
|
switch (name2) {
|
|
5654
5696
|
case "addNamedElement":
|
|
5655
|
-
|
|
5656
|
-
const el = payload["element"];
|
|
5657
|
-
this.addNamedElement(id, el);
|
|
5697
|
+
this.addNamedElement(payload["name"], payload["element"]);
|
|
5658
5698
|
break;
|
|
5659
5699
|
case "digest":
|
|
5660
5700
|
this.digest();
|
|
@@ -5701,17 +5741,15 @@ Message: ${e.message}`, e);
|
|
|
5701
5741
|
getScope() {
|
|
5702
5742
|
return this.scope;
|
|
5703
5743
|
}
|
|
5704
|
-
watch(expression,
|
|
5744
|
+
watch(expression, thisObject, name2, reducerFn) {
|
|
5705
5745
|
(0, Utils_1.requireNotNull)(expression, "expression");
|
|
5706
|
-
(
|
|
5707
|
-
const actualThisObject = (0, Utils_1.isDefined)(thisObject) ? thisObject : this.component;
|
|
5708
|
-
this.mediate(expression, reducerFn).watch(actualThisObject, callback);
|
|
5746
|
+
this.mediate(expression, reducerFn).watch(thisObject, name2);
|
|
5709
5747
|
}
|
|
5710
|
-
|
|
5711
|
-
this.
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5748
|
+
onExpressionValueChange(expression, thisObject, name2, reducerFn) {
|
|
5749
|
+
this.watch(expression, thisObject, name2, reducerFn);
|
|
5750
|
+
}
|
|
5751
|
+
on(name2, messageName, channel) {
|
|
5752
|
+
this.receiver.on(messageName).forChannel(channel || CydranConstants_1.INTERNAL_CHANNEL_NAME).invoke(name2, null, () => this.sync());
|
|
5715
5753
|
}
|
|
5716
5754
|
getName() {
|
|
5717
5755
|
return this.options.name;
|
|
@@ -5736,7 +5774,7 @@ Message: ${e.message}`, e);
|
|
|
5736
5774
|
(0, Utils_1.requireNotNull)(name2, "name");
|
|
5737
5775
|
const form = this.getNamedForm(name2);
|
|
5738
5776
|
if (!(0, Utils_1.isDefined)(form)) {
|
|
5739
|
-
throw new Errors_1.UnknownElementError(`Unknown form: ${name2}
|
|
5777
|
+
throw new Errors_1.UnknownElementError(`Unknown form: ${name2}. The c-id atttibute may not be present on the form element.`);
|
|
5740
5778
|
}
|
|
5741
5779
|
return new FormOperationsImpl_1.default(form);
|
|
5742
5780
|
}
|
|
@@ -5807,9 +5845,6 @@ Message: ${e.message}`, e);
|
|
|
5807
5845
|
getItemFn() {
|
|
5808
5846
|
return this.itemFn;
|
|
5809
5847
|
}
|
|
5810
|
-
getMessagables() {
|
|
5811
|
-
return this.components;
|
|
5812
|
-
}
|
|
5813
5848
|
getModel() {
|
|
5814
5849
|
return this.component;
|
|
5815
5850
|
}
|
|
@@ -5854,16 +5889,16 @@ Message: ${e.message}`, e);
|
|
|
5854
5889
|
addForm(form) {
|
|
5855
5890
|
this.forms.push(form);
|
|
5856
5891
|
}
|
|
5857
|
-
withFilter(
|
|
5858
|
-
(0, Utils_1.requireNotNull)(watchable, "watchable");
|
|
5892
|
+
withFilter(expression) {
|
|
5859
5893
|
(0, Utils_1.requireNotNull)(expression, "expression");
|
|
5860
|
-
const watcher = new WatcherImpl_1.default(
|
|
5861
|
-
return new FilterBuilderImpl_1.default(
|
|
5894
|
+
const watcher = new WatcherImpl_1.default(this, expression, (0, getLogger_1.default)(`watcher-${this.id}`, `Watcher: ${expression}`));
|
|
5895
|
+
return new FilterBuilderImpl_1.default(this, watcher);
|
|
5862
5896
|
}
|
|
5863
5897
|
$c() {
|
|
5864
|
-
return new ActionContinuationImpl_1.default(this.component, this);
|
|
5898
|
+
return new ActionContinuationImpl_1.default(this.component, this, () => this.ready);
|
|
5865
5899
|
}
|
|
5866
|
-
addInterval(
|
|
5900
|
+
addInterval(name2, delay) {
|
|
5901
|
+
const callback = (0, Utils_1.resolveNamedMethod)(this.component, name2);
|
|
5867
5902
|
this.intervals.add(callback, delay);
|
|
5868
5903
|
}
|
|
5869
5904
|
postConstruct() {
|
|
@@ -5913,7 +5948,6 @@ Message: ${e.message}`, e);
|
|
|
5913
5948
|
this.parent = null;
|
|
5914
5949
|
this.itemLookupFn = emptyObject_1.default;
|
|
5915
5950
|
this.externalItemLookup = false;
|
|
5916
|
-
this.components = [];
|
|
5917
5951
|
this.renderer = null;
|
|
5918
5952
|
this.extractor = new AttributesImpl_1.default(this.options.prefix);
|
|
5919
5953
|
this.scope = new ScopeImpl_1.default();
|
|
@@ -5938,10 +5972,6 @@ Message: ${e.message}`, e);
|
|
|
5938
5972
|
this.message(CydranConstants_1.INTERNAL_CHANNEL_NAME, messageName, payload);
|
|
5939
5973
|
}
|
|
5940
5974
|
}
|
|
5941
|
-
tellChildren(name2, payload) {
|
|
5942
|
-
this.regionMap.each((region) => region.tellComponent(name2, payload));
|
|
5943
|
-
this.seriesMap.each((series) => series.tellComponents(name2, payload));
|
|
5944
|
-
}
|
|
5945
5975
|
tellBehaviors(name2, payload) {
|
|
5946
5976
|
this.behaviors.tell(name2, payload);
|
|
5947
5977
|
}
|
|
@@ -5968,7 +5998,12 @@ Message: ${e.message}`, e);
|
|
|
5968
5998
|
this.parentContext = parentContext;
|
|
5969
5999
|
}
|
|
5970
6000
|
setParent(parent) {
|
|
5971
|
-
|
|
6001
|
+
if (this.machineState.isState(ComponentStates_1.default.BOOTSTRAPPED)) {
|
|
6002
|
+
this.tell(ComponentTransitions_1.default.INIT, null);
|
|
6003
|
+
}
|
|
6004
|
+
const bothPresentButDifferentResult = (0, NestableUtils_1.bothPresentButDifferent)(parent, this.parent);
|
|
6005
|
+
const exactlyOneDefinedResult = (0, Utils_1.exactlyOneDefined)(parent, this.parent);
|
|
6006
|
+
const changed = bothPresentButDifferentResult || exactlyOneDefinedResult;
|
|
5972
6007
|
const parentAdded = !!(parent !== null && this.parent === null);
|
|
5973
6008
|
const parentRemoved = !!(parent === null && this.parent !== null);
|
|
5974
6009
|
this.messageInternalIf(parentAdded, CydranConstants_1.Events.BEFORE_PARENT_ADDED, {});
|
|
@@ -5989,12 +6024,6 @@ Message: ${e.message}`, e);
|
|
|
5989
6024
|
this.messageInternalIf(parentAdded, CydranConstants_1.Events.AFTER_PARENT_ADDED, {});
|
|
5990
6025
|
this.messageInternalIf(parentRemoved, CydranConstants_1.Events.AFTER_PARENT_REMOVED, {});
|
|
5991
6026
|
}
|
|
5992
|
-
bothPresentButDifferent(first, second) {
|
|
5993
|
-
return (0, Utils_1.isDefined)(first) && (0, Utils_1.isDefined)(second) && first.$c().getId() !== second.$c().getId();
|
|
5994
|
-
}
|
|
5995
|
-
exactlyOneDefined(first, second) {
|
|
5996
|
-
return (0, Utils_1.isDefined)(first) ? !(0, Utils_1.isDefined)(second) : (0, Utils_1.isDefined)(second);
|
|
5997
|
-
}
|
|
5998
6027
|
};
|
|
5999
6028
|
var COMPONENT_MACHINE = (0, StateMachineBuilder_1.default)(ComponentStates_1.default.UNINITIALIZED).withState(ComponentStates_1.default.UNINITIALIZED, []).withState(ComponentStates_1.default.BOOTSTRAPPED, []).withState(ComponentStates_1.default.READY, []).withState(ComponentStates_1.default.MOUNTED, []).withState(ComponentStates_1.default.UNMOUNTED, []).withTransition(ComponentStates_1.default.UNINITIALIZED, ComponentTransitions_1.default.BOOTSTRAP, ComponentStates_1.default.BOOTSTRAPPED, [ComponentInternalsImpl.prototype.bootstrap]).withTransition(ComponentStates_1.default.BOOTSTRAPPED, ComponentTransitions_1.default.INIT, ComponentStates_1.default.READY, [ComponentInternalsImpl.prototype.initialize]).withTransition(ComponentStates_1.default.READY, ComponentTransitions_1.default.MOUNT, ComponentStates_1.default.MOUNTED, [ComponentInternalsImpl.prototype.onMount]).withTransition(ComponentStates_1.default.MOUNTED, ComponentTransitions_1.default.UNMOUNT, ComponentStates_1.default.UNMOUNTED, [ComponentInternalsImpl.prototype.onUnmount]).withTransition(ComponentStates_1.default.UNMOUNTED, ComponentTransitions_1.default.MOUNT, ComponentStates_1.default.MOUNTED, [ComponentInternalsImpl.prototype.onRemount]).build();
|
|
6000
6029
|
exports.default = ComponentInternalsImpl;
|
|
@@ -6017,6 +6046,7 @@ Message: ${e.message}`, e);
|
|
|
6017
6046
|
* @param options - optional {@link ComponentOptions} argument
|
|
6018
6047
|
*/
|
|
6019
6048
|
constructor(template, options) {
|
|
6049
|
+
this.____internal$$cydran____ = null;
|
|
6020
6050
|
this.____internal$$cydran$$init____(template, options);
|
|
6021
6051
|
}
|
|
6022
6052
|
setContext(context) {
|
|
@@ -6156,9 +6186,11 @@ Message: ${e.message}`, e);
|
|
|
6156
6186
|
constructor(value) {
|
|
6157
6187
|
this.value = value;
|
|
6158
6188
|
}
|
|
6189
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6159
6190
|
resolve(context) {
|
|
6160
6191
|
return this.value;
|
|
6161
6192
|
}
|
|
6193
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6162
6194
|
postProcess(context, targetObject, param) {
|
|
6163
6195
|
}
|
|
6164
6196
|
};
|
|
@@ -6181,10 +6213,12 @@ Message: ${e.message}`, e);
|
|
|
6181
6213
|
throw new Errors_1.IllegalArgumentError("supplied argument not a function");
|
|
6182
6214
|
}
|
|
6183
6215
|
}
|
|
6216
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6184
6217
|
resolve(context) {
|
|
6185
6218
|
const instance = this.fn();
|
|
6186
6219
|
return instance;
|
|
6187
6220
|
}
|
|
6221
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6188
6222
|
postProcess(context, targetObject, param) {
|
|
6189
6223
|
}
|
|
6190
6224
|
};
|
|
@@ -6207,6 +6241,7 @@ Message: ${e.message}`, e);
|
|
|
6207
6241
|
const value = context.getProperties().get(this.name);
|
|
6208
6242
|
return value;
|
|
6209
6243
|
}
|
|
6244
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6210
6245
|
postProcess(context, targetObject, param) {
|
|
6211
6246
|
}
|
|
6212
6247
|
};
|
|
@@ -6230,6 +6265,7 @@ Message: ${e.message}`, e);
|
|
|
6230
6265
|
const argsToPass = (0, Utils_1.concat)([this.id], this.instanceArguments);
|
|
6231
6266
|
return context.getObject.apply(context, argsToPass);
|
|
6232
6267
|
}
|
|
6268
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6233
6269
|
postProcess(context, targetObject, param) {
|
|
6234
6270
|
}
|
|
6235
6271
|
};
|
|
@@ -6278,6 +6314,7 @@ Message: ${e.message}`, e);
|
|
|
6278
6314
|
resolve(context) {
|
|
6279
6315
|
return new TransmitterImpl_1.default(context);
|
|
6280
6316
|
}
|
|
6317
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6281
6318
|
postProcess(context, targetObject, param) {
|
|
6282
6319
|
}
|
|
6283
6320
|
};
|
|
@@ -6337,6 +6374,7 @@ Message: ${e.message}`, e);
|
|
|
6337
6374
|
const value = context.getScope().get(this.name);
|
|
6338
6375
|
return value;
|
|
6339
6376
|
}
|
|
6377
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6340
6378
|
postProcess(context, targetObject, param) {
|
|
6341
6379
|
}
|
|
6342
6380
|
};
|
|
@@ -6351,9 +6389,11 @@ Message: ${e.message}`, e);
|
|
|
6351
6389
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6352
6390
|
var IdGenerator_1 = require_IdGenerator();
|
|
6353
6391
|
var InstanceIdArgumentResolver = class {
|
|
6392
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6354
6393
|
resolve(context) {
|
|
6355
6394
|
return IdGenerator_1.IdGenerator.generate();
|
|
6356
6395
|
}
|
|
6396
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6357
6397
|
postProcess(context, targetObject, param) {
|
|
6358
6398
|
}
|
|
6359
6399
|
};
|
|
@@ -6368,11 +6408,13 @@ Message: ${e.message}`, e);
|
|
|
6368
6408
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6369
6409
|
var IdGenerator_1 = require_IdGenerator();
|
|
6370
6410
|
var InstanceIdFnArgumentResolver = class {
|
|
6411
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6371
6412
|
resolve(context) {
|
|
6372
6413
|
return () => {
|
|
6373
6414
|
return IdGenerator_1.IdGenerator.generate();
|
|
6374
6415
|
};
|
|
6375
6416
|
}
|
|
6417
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6376
6418
|
postProcess(context, targetObject, param) {
|
|
6377
6419
|
}
|
|
6378
6420
|
};
|
|
@@ -6394,6 +6436,7 @@ Message: ${e.message}`, e);
|
|
|
6394
6436
|
resolve(context) {
|
|
6395
6437
|
return context.getObject("logger", this.key, this.label);
|
|
6396
6438
|
}
|
|
6439
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6397
6440
|
postProcess(context, targetObject, param) {
|
|
6398
6441
|
}
|
|
6399
6442
|
};
|
|
@@ -6410,6 +6453,7 @@ Message: ${e.message}`, e);
|
|
|
6410
6453
|
resolve(context) {
|
|
6411
6454
|
return context;
|
|
6412
6455
|
}
|
|
6456
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6413
6457
|
postProcess(context, targetObject, param) {
|
|
6414
6458
|
}
|
|
6415
6459
|
};
|
|
@@ -6434,6 +6478,7 @@ Message: ${e.message}`, e);
|
|
|
6434
6478
|
return context.getObject.apply(context, argsToPass);
|
|
6435
6479
|
};
|
|
6436
6480
|
}
|
|
6481
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6437
6482
|
postProcess(context, targetObject, param) {
|
|
6438
6483
|
}
|
|
6439
6484
|
};
|
|
@@ -6455,6 +6500,7 @@ Message: ${e.message}`, e);
|
|
|
6455
6500
|
resolve(context) {
|
|
6456
6501
|
return () => context.getProperties().get(this.name);
|
|
6457
6502
|
}
|
|
6503
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6458
6504
|
postProcess(context, targetObject, param) {
|
|
6459
6505
|
}
|
|
6460
6506
|
};
|
|
@@ -6475,6 +6521,7 @@ Message: ${e.message}`, e);
|
|
|
6475
6521
|
resolve(context, instanceArguments = []) {
|
|
6476
6522
|
return (0, Utils_1.isDefined)(instanceArguments) && (0, Utils_1.isDefined)(instanceArguments[this.index]) ? instanceArguments[this.index] : null;
|
|
6477
6523
|
}
|
|
6524
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6478
6525
|
postProcess(context, targetObject, param) {
|
|
6479
6526
|
}
|
|
6480
6527
|
};
|
|
@@ -6494,11 +6541,12 @@ Message: ${e.message}`, e);
|
|
|
6494
6541
|
this.name = (0, Utils_1.requireValid)(name2, "name", CydranConstants_1.PROPERTY_KEY);
|
|
6495
6542
|
}
|
|
6496
6543
|
resolve(context) {
|
|
6497
|
-
const subscriber = (thisObject,
|
|
6498
|
-
context.getProperties().addPropertyObserver(this.name, thisObject,
|
|
6544
|
+
const subscriber = (thisObject, name2) => {
|
|
6545
|
+
context.getProperties().addPropertyObserver(this.name, thisObject, name2);
|
|
6499
6546
|
};
|
|
6500
6547
|
return subscriber;
|
|
6501
6548
|
}
|
|
6549
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6502
6550
|
postProcess(context, targetObject, param) {
|
|
6503
6551
|
}
|
|
6504
6552
|
};
|
|
@@ -6514,11 +6562,12 @@ Message: ${e.message}`, e);
|
|
|
6514
6562
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
6515
6563
|
};
|
|
6516
6564
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6517
|
-
var
|
|
6565
|
+
var ReceiverImpl_1 = __importDefault(require_ReceiverImpl());
|
|
6518
6566
|
var ReceiverArgumentResolver = class {
|
|
6519
6567
|
resolve(context) {
|
|
6520
|
-
return new
|
|
6568
|
+
return new ReceiverImpl_1.default(context);
|
|
6521
6569
|
}
|
|
6570
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6522
6571
|
postProcess(context, targetObject, param) {
|
|
6523
6572
|
}
|
|
6524
6573
|
};
|
|
@@ -6535,6 +6584,7 @@ Message: ${e.message}`, e);
|
|
|
6535
6584
|
resolve(context) {
|
|
6536
6585
|
return (thisObject, callback) => context.addListener(thisObject, callback);
|
|
6537
6586
|
}
|
|
6587
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6538
6588
|
postProcess(context, targetObject, param) {
|
|
6539
6589
|
}
|
|
6540
6590
|
};
|
|
@@ -6554,11 +6604,12 @@ Message: ${e.message}`, e);
|
|
|
6554
6604
|
this.prefix = prefix;
|
|
6555
6605
|
}
|
|
6556
6606
|
resolve(context) {
|
|
6557
|
-
const subscriber = (thisObject,
|
|
6558
|
-
context.getProperties().addFallbackObserver(thisObject,
|
|
6607
|
+
const subscriber = (thisObject, name2) => {
|
|
6608
|
+
context.getProperties().addFallbackObserver(thisObject, name2, this.preferredKey, this.prefix);
|
|
6559
6609
|
};
|
|
6560
6610
|
return subscriber;
|
|
6561
6611
|
}
|
|
6612
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6562
6613
|
postProcess(context, targetObject, param) {
|
|
6563
6614
|
}
|
|
6564
6615
|
};
|
|
@@ -6665,6 +6716,7 @@ Message: ${e.message}`, e);
|
|
|
6665
6716
|
this.getInstance().add(new ScopeItemArgumentResolver_1.default(name2));
|
|
6666
6717
|
return this;
|
|
6667
6718
|
}
|
|
6719
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6668
6720
|
validate(reportError) {
|
|
6669
6721
|
}
|
|
6670
6722
|
};
|
|
@@ -6697,9 +6749,11 @@ Message: ${e.message}`, e);
|
|
|
6697
6749
|
constructor(options) {
|
|
6698
6750
|
this.options = options;
|
|
6699
6751
|
}
|
|
6752
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6700
6753
|
resolve(context) {
|
|
6701
6754
|
return this.options;
|
|
6702
6755
|
}
|
|
6756
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6703
6757
|
postProcess(context, targetObject, param) {
|
|
6704
6758
|
}
|
|
6705
6759
|
};
|
|
@@ -6982,8 +7036,10 @@ Message: ${e.message}`, e);
|
|
|
6982
7036
|
var Level_1 = __importDefault(require_Level());
|
|
6983
7037
|
var AbstractLevelStrategy_1 = require_AbstractLevelStrategy();
|
|
6984
7038
|
var DebugLevelStrategyImpl = class extends AbstractLevelStrategy_1.AbstractLevelStrategy {
|
|
7039
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6985
7040
|
trace(logLabel, appenders, msgBase, moreArgs) {
|
|
6986
7041
|
}
|
|
7042
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6987
7043
|
ifTrace(logLabel, appenders, primaryMsgFn, moreArgs) {
|
|
6988
7044
|
}
|
|
6989
7045
|
isTrace() {
|
|
@@ -7023,12 +7079,16 @@ Message: ${e.message}`, e);
|
|
|
7023
7079
|
var Level_1 = __importDefault(require_Level());
|
|
7024
7080
|
var AbstractLevelStrategy_1 = require_AbstractLevelStrategy();
|
|
7025
7081
|
var InfoLevelStrategyImpl = class extends AbstractLevelStrategy_1.AbstractLevelStrategy {
|
|
7082
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7026
7083
|
trace(logLabel, appenders, msgBase, moreArgs) {
|
|
7027
7084
|
}
|
|
7085
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7028
7086
|
ifTrace(logLabel, appenders, primaryMsgFn, moreArgs) {
|
|
7029
7087
|
}
|
|
7088
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7030
7089
|
debug(logLabel, appenders, msgBase, moreArgs) {
|
|
7031
7090
|
}
|
|
7091
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7032
7092
|
ifDebug(logLabel, appenders, primaryMsgFn, moreArgs) {
|
|
7033
7093
|
}
|
|
7034
7094
|
isTrace() {
|
|
@@ -7068,16 +7128,22 @@ Message: ${e.message}`, e);
|
|
|
7068
7128
|
var Level_1 = __importDefault(require_Level());
|
|
7069
7129
|
var AbstractLevelStrategy_1 = require_AbstractLevelStrategy();
|
|
7070
7130
|
var WarnLevelStrategyImpl = class extends AbstractLevelStrategy_1.AbstractLevelStrategy {
|
|
7131
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7071
7132
|
trace(logLabel, appenders, msgBase, moreArgs) {
|
|
7072
7133
|
}
|
|
7134
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7073
7135
|
ifTrace(logLabel, appenders, primaryMsgFn, moreArgs) {
|
|
7074
7136
|
}
|
|
7137
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7075
7138
|
debug(logLabel, appenders, msgBase, moreArgs) {
|
|
7076
7139
|
}
|
|
7140
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7077
7141
|
ifDebug(logLabel, appenders, primaryMsgFn, moreArgs) {
|
|
7078
7142
|
}
|
|
7143
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7079
7144
|
info(logLabel, appenders, msgBase, moreArgs) {
|
|
7080
7145
|
}
|
|
7146
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7081
7147
|
ifInfo(logLabel, appenders, primaryMsgFn, moreArgs) {
|
|
7082
7148
|
}
|
|
7083
7149
|
isTrace() {
|
|
@@ -7117,20 +7183,28 @@ Message: ${e.message}`, e);
|
|
|
7117
7183
|
var Level_1 = __importDefault(require_Level());
|
|
7118
7184
|
var AbstractLevelStrategy_1 = require_AbstractLevelStrategy();
|
|
7119
7185
|
var ErrorLevelStrategyImpl = class extends AbstractLevelStrategy_1.AbstractLevelStrategy {
|
|
7186
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7120
7187
|
trace(logLabel, appenders, msgBase, moreArgs) {
|
|
7121
7188
|
}
|
|
7189
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7122
7190
|
ifTrace(logLabel, appenders, primaryMsgFn, moreArgs) {
|
|
7123
7191
|
}
|
|
7192
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7124
7193
|
debug(logLabel, appenders, msgBase, moreArgs) {
|
|
7125
7194
|
}
|
|
7195
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7126
7196
|
ifDebug(logLabel, appenders, primaryMsgFn, moreArgs) {
|
|
7127
7197
|
}
|
|
7198
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7128
7199
|
info(logLabel, appenders, msgBase, moreArgs) {
|
|
7129
7200
|
}
|
|
7201
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7130
7202
|
ifInfo(logLabel, appenders, primaryMsgFn, moreArgs) {
|
|
7131
7203
|
}
|
|
7204
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7132
7205
|
warn(logLabel, appenders, msgBase, moreArgs) {
|
|
7133
7206
|
}
|
|
7207
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7134
7208
|
ifWarn(logLabel, appenders, primaryMsgFn, moreArgs) {
|
|
7135
7209
|
}
|
|
7136
7210
|
isTrace() {
|
|
@@ -7170,24 +7244,34 @@ Message: ${e.message}`, e);
|
|
|
7170
7244
|
var Level_1 = __importDefault(require_Level());
|
|
7171
7245
|
var AbstractLevelStrategy_1 = require_AbstractLevelStrategy();
|
|
7172
7246
|
var FatalLevelStrategyImpl = class extends AbstractLevelStrategy_1.AbstractLevelStrategy {
|
|
7247
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7173
7248
|
trace(logLabel, appenders, msgBase, moreArgs) {
|
|
7174
7249
|
}
|
|
7250
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7175
7251
|
ifTrace(logLabel, appenders, primaryMsgFn, moreArgs) {
|
|
7176
7252
|
}
|
|
7253
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7177
7254
|
debug(logLabel, appenders, msgBase, moreArgs) {
|
|
7178
7255
|
}
|
|
7256
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7179
7257
|
ifDebug(logLabel, appenders, primaryMsgFn, moreArgs) {
|
|
7180
7258
|
}
|
|
7259
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7181
7260
|
info(logLabel, appenders, msgBase, moreArgs) {
|
|
7182
7261
|
}
|
|
7262
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7183
7263
|
ifInfo(logLabel, appenders, primaryMsgFn, moreArgs) {
|
|
7184
7264
|
}
|
|
7265
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7185
7266
|
warn(logLabel, appenders, msgBase, moreArgs) {
|
|
7186
7267
|
}
|
|
7268
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7187
7269
|
ifWarn(logLabel, appenders, primaryMsgFn, moreArgs) {
|
|
7188
7270
|
}
|
|
7271
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7189
7272
|
error(logLabel, appenders, msgBase, moreArgs) {
|
|
7190
7273
|
}
|
|
7274
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7191
7275
|
ifError(logLabel, appenders, primaryMsgFn, moreArgs) {
|
|
7192
7276
|
}
|
|
7193
7277
|
isTrace() {
|
|
@@ -7227,28 +7311,40 @@ Message: ${e.message}`, e);
|
|
|
7227
7311
|
var Level_1 = __importDefault(require_Level());
|
|
7228
7312
|
var AbstractLevelStrategy_1 = require_AbstractLevelStrategy();
|
|
7229
7313
|
var DisabledLevelStrategyImpl = class extends AbstractLevelStrategy_1.AbstractLevelStrategy {
|
|
7314
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7230
7315
|
trace(logLabel, appenders, msgBase, moreArgs) {
|
|
7231
7316
|
}
|
|
7317
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7232
7318
|
ifTrace(logLabel, appenders, primaryMsgFn, moreArgs) {
|
|
7233
7319
|
}
|
|
7320
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7234
7321
|
debug(logLabel, appenders, msgBase, moreArgs) {
|
|
7235
7322
|
}
|
|
7323
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7236
7324
|
ifDebug(logLabel, appenders, primaryMsgFn, moreArgs) {
|
|
7237
7325
|
}
|
|
7326
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7238
7327
|
info(logLabel, appenders, msgBase, moreArgs) {
|
|
7239
7328
|
}
|
|
7329
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7240
7330
|
ifInfo(logLabel, appenders, primaryMsgFn, moreArgs) {
|
|
7241
7331
|
}
|
|
7332
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7242
7333
|
warn(logLabel, appenders, msgBase, moreArgs) {
|
|
7243
7334
|
}
|
|
7335
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7244
7336
|
ifWarn(logLabel, appenders, primaryMsgFn, moreArgs) {
|
|
7245
7337
|
}
|
|
7338
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7246
7339
|
error(logLabel, appenders, msgBase, moreArgs) {
|
|
7247
7340
|
}
|
|
7341
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7248
7342
|
ifError(logLabel, appenders, primaryMsgFn, moreArgs) {
|
|
7249
7343
|
}
|
|
7344
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7250
7345
|
fatal(logLabel, appenders, msgBase, moreArgs) {
|
|
7251
7346
|
}
|
|
7347
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7252
7348
|
ifFatal(logLabel, appenders, primaryMsgFn, moreArgs) {
|
|
7253
7349
|
}
|
|
7254
7350
|
isTrace() {
|
|
@@ -7314,9 +7410,9 @@ Message: ${e.message}`, e);
|
|
|
7314
7410
|
this.allowSuppression = false;
|
|
7315
7411
|
const contextNameSegment = context.isRoot() ? "" : "." + context.getFullName();
|
|
7316
7412
|
const propertyPrefix = LOGGER_NAME_PREFIX + contextNameSegment + "." + this.key + ".";
|
|
7317
|
-
this.initObservation(propertyPrefix, "allowSupressDefaultAppender", this.updateAllowSupressDefaultAppender,
|
|
7318
|
-
this.initObservation(propertyPrefix, "appenders", this.updateAppenders,
|
|
7319
|
-
this.initObservation(propertyPrefix, "level", this.updateStrategy,
|
|
7413
|
+
this.initObservation(propertyPrefix, "allowSupressDefaultAppender", this.updateAllowSupressDefaultAppender, "onAllowSupressDefaultAppenderChange");
|
|
7414
|
+
this.initObservation(propertyPrefix, "appenders", this.updateAppenders, "onAppendersChange");
|
|
7415
|
+
this.initObservation(propertyPrefix, "level", this.updateStrategy, "onLevelChange");
|
|
7320
7416
|
}
|
|
7321
7417
|
getKey() {
|
|
7322
7418
|
return this.key;
|
|
@@ -7381,9 +7477,9 @@ Message: ${e.message}`, e);
|
|
|
7381
7477
|
getLevel() {
|
|
7382
7478
|
return this.strategy.getLevel();
|
|
7383
7479
|
}
|
|
7384
|
-
initObservation(prefix, key, updateMethod,
|
|
7480
|
+
initObservation(prefix, key, updateMethod, callbackName) {
|
|
7385
7481
|
const preferred = prefix + key;
|
|
7386
|
-
this.properties.addFallbackObserver(this,
|
|
7482
|
+
this.properties.addFallbackObserver(this, callbackName, preferred, "cydran.logging");
|
|
7387
7483
|
const value = this.properties.getWithFallback(preferred);
|
|
7388
7484
|
updateMethod.call(this, value);
|
|
7389
7485
|
}
|
|
@@ -7552,8 +7648,6 @@ Message: ${e.message}`, e);
|
|
|
7552
7648
|
;
|
|
7553
7649
|
return result.trim();
|
|
7554
7650
|
};
|
|
7555
|
-
var colorPfx = CydranConstants_1.PropertyKeys.CYDRAN_LOG_COLOR_PREFIX;
|
|
7556
|
-
var preamOrdrKey = CydranConstants_1.PropertyKeys.CYDRAN_LOG_PREAMBLE_ORDER;
|
|
7557
7651
|
var PREAMBLFMT = "%c%s ";
|
|
7558
7652
|
var ConsoleAppender = class extends AbstractAppender_1.AbstractAppender {
|
|
7559
7653
|
constructor(id, pOrder = "level:time:name", wkConsole = console) {
|
|
@@ -7643,9 +7737,10 @@ Message: ${e.message}`, e);
|
|
|
7643
7737
|
this.objectPathResolver = new ObjectPathResolverImpl_1.default();
|
|
7644
7738
|
this.contextPathResolver = new ContextPathResolverImpl_1.default();
|
|
7645
7739
|
this.name = (0, Utils_1.requireValid)(name2, "name", CydranConstants_1.CONTEXT_NAME);
|
|
7646
|
-
this.
|
|
7647
|
-
this.
|
|
7648
|
-
this.
|
|
7740
|
+
this.obscuredParent = parent;
|
|
7741
|
+
this.properties = this.createProperties(this.obscuredParent);
|
|
7742
|
+
this.registry = this.createRegistry(this.obscuredParent);
|
|
7743
|
+
this.scope = this.createScope(this.obscuredParent);
|
|
7649
7744
|
this.broker = new BrokerImpl_1.default();
|
|
7650
7745
|
this.commonInit();
|
|
7651
7746
|
}
|
|
@@ -7759,6 +7854,7 @@ Message: ${e.message}`, e);
|
|
|
7759
7854
|
this.getRegistry().registerSingletonWithFactory(id, factoryFn, resolvers, localResolution);
|
|
7760
7855
|
return this;
|
|
7761
7856
|
}
|
|
7857
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7762
7858
|
tell(name2, payload) {
|
|
7763
7859
|
}
|
|
7764
7860
|
getBroker() {
|
|
@@ -7983,9 +8079,9 @@ Message: ${e.message}`, e);
|
|
|
7983
8079
|
this.supportedProperties = (0, propertyMapGenerator_1.default)(preferredKey, prefix);
|
|
7984
8080
|
}
|
|
7985
8081
|
getPredicate() {
|
|
7986
|
-
return (key, value) => this.isMatched(key
|
|
8082
|
+
return (key, value) => this.isMatched(key);
|
|
7987
8083
|
}
|
|
7988
|
-
isMatched(key
|
|
8084
|
+
isMatched(key) {
|
|
7989
8085
|
if (!(0, Utils_1.isDefined)(key) || !(0, Utils_1.isDefined)(this.supportedProperties.has(key))) {
|
|
7990
8086
|
return false;
|
|
7991
8087
|
}
|
|
@@ -8135,7 +8231,7 @@ Message: ${e.message}`, e);
|
|
|
8135
8231
|
}
|
|
8136
8232
|
mirror(source) {
|
|
8137
8233
|
(0, Utils_1.requireNotNull)(source, "source");
|
|
8138
|
-
source.addObserver(this,
|
|
8234
|
+
source.addObserver(this, "set");
|
|
8139
8235
|
return this;
|
|
8140
8236
|
}
|
|
8141
8237
|
lock(...keys) {
|
|
@@ -8179,8 +8275,8 @@ Message: ${e.message}`, e);
|
|
|
8179
8275
|
(0, Utils_1.requireValid)(key, "key", CydranConstants_1.PROPERTY_KEY);
|
|
8180
8276
|
return this.pins.contains(key);
|
|
8181
8277
|
}
|
|
8182
|
-
addGlobalObserver(thisObject,
|
|
8183
|
-
(0, Utils_1.
|
|
8278
|
+
addGlobalObserver(thisObject, name2, preferredKey, prefix) {
|
|
8279
|
+
const callback = (0, Utils_1.resolveNamedMethod)(thisObject, name2);
|
|
8184
8280
|
let predicate = null;
|
|
8185
8281
|
let mapper = null;
|
|
8186
8282
|
const fallbackMapper = (key) => this.getWithFallback(key, prefix);
|
|
@@ -8189,40 +8285,37 @@ Message: ${e.message}`, e);
|
|
|
8189
8285
|
predicate = new PropertyGeneralizationPredicate_1.default(preferredKey, prefix, existsPredicate).getPredicate();
|
|
8190
8286
|
mapper = new PropertyGeneralizationMapper_1.default(preferredKey, prefix, fallbackMapper).getMapper();
|
|
8191
8287
|
}
|
|
8192
|
-
this.observers.register(
|
|
8288
|
+
this.observers.register(thisObject, callback, predicate, mapper);
|
|
8193
8289
|
}
|
|
8194
|
-
removeGlobalObserver(thisObject,
|
|
8195
|
-
(0, Utils_1.
|
|
8290
|
+
removeGlobalObserver(thisObject, name2) {
|
|
8291
|
+
const callback = (0, Utils_1.resolveNamedMethod)(thisObject, name2);
|
|
8196
8292
|
this.observers.unregister(thisObject, callback);
|
|
8197
8293
|
}
|
|
8198
|
-
addObserver(thisObject,
|
|
8199
|
-
this.addGlobalObserver(thisObject,
|
|
8294
|
+
addObserver(thisObject, name2) {
|
|
8295
|
+
this.addGlobalObserver(thisObject, name2, null, null);
|
|
8200
8296
|
}
|
|
8201
|
-
removeObserver(thisObject,
|
|
8202
|
-
this.removeGlobalObserver(thisObject,
|
|
8297
|
+
removeObserver(thisObject, name2) {
|
|
8298
|
+
this.removeGlobalObserver(thisObject, name2);
|
|
8203
8299
|
}
|
|
8204
|
-
addFallbackObserver(thisObject,
|
|
8205
|
-
this.addGlobalObserver(thisObject,
|
|
8300
|
+
addFallbackObserver(thisObject, name2, preferredKey, prefix) {
|
|
8301
|
+
this.addGlobalObserver(thisObject, name2, preferredKey, prefix);
|
|
8206
8302
|
}
|
|
8207
|
-
removeFallbackObserver(thisObject,
|
|
8208
|
-
this.removeGlobalObserver(thisObject,
|
|
8303
|
+
removeFallbackObserver(thisObject, name2) {
|
|
8304
|
+
this.removeGlobalObserver(thisObject, name2);
|
|
8209
8305
|
}
|
|
8210
|
-
addPropertyObserver(key, thisObject,
|
|
8306
|
+
addPropertyObserver(key, thisObject, name2) {
|
|
8211
8307
|
(0, Utils_1.requireValid)(key, "key", CydranConstants_1.PROPERTY_KEY);
|
|
8212
|
-
(0, Utils_1.
|
|
8213
|
-
this.propertyObservers.computeIfAbsent(key, () => new ObservableImpl_1.default()).register(
|
|
8308
|
+
const callback = (0, Utils_1.resolveNamedMethod)(thisObject, name2);
|
|
8309
|
+
this.propertyObservers.computeIfAbsent(key, () => new ObservableImpl_1.default()).register(thisObject, callback);
|
|
8214
8310
|
}
|
|
8215
|
-
removePropertyObserver(key, thisObject,
|
|
8311
|
+
removePropertyObserver(key, thisObject, name2) {
|
|
8216
8312
|
(0, Utils_1.requireValid)(key, "key", CydranConstants_1.PROPERTY_KEY);
|
|
8217
|
-
(0, Utils_1.
|
|
8313
|
+
const callback = (0, Utils_1.resolveNamedMethod)(thisObject, name2);
|
|
8218
8314
|
this.propertyObservers.computeIfAbsent(key, () => new ObservableImpl_1.default()).unregister(thisObject, callback);
|
|
8219
8315
|
}
|
|
8220
8316
|
load(values) {
|
|
8221
8317
|
(0, Utils_1.requireNotNull)(values, "values");
|
|
8222
|
-
for (const key
|
|
8223
|
-
if (!values.hasOwnProperty(key)) {
|
|
8224
|
-
continue;
|
|
8225
|
-
}
|
|
8318
|
+
for (const key of Object.keys(values)) {
|
|
8226
8319
|
if (key === "$locked" || key === "$pinned") {
|
|
8227
8320
|
continue;
|
|
8228
8321
|
}
|
|
@@ -8300,7 +8393,7 @@ Message: ${e.message}`, e);
|
|
|
8300
8393
|
this.parent = (0, Utils_1.requireNotNull)(parent, "parent");
|
|
8301
8394
|
this.localValues = new AdvancedMapImpl_1.default();
|
|
8302
8395
|
this.effectiveValues = new AdvancedMapImpl_1.default();
|
|
8303
|
-
this.parent.addObserver(
|
|
8396
|
+
this.parent.addObserver(this, "reevaluateProperty");
|
|
8304
8397
|
this.sync();
|
|
8305
8398
|
}
|
|
8306
8399
|
clear() {
|
|
@@ -8319,7 +8412,6 @@ Message: ${e.message}`, e);
|
|
|
8319
8412
|
this.localValues.put(key, value);
|
|
8320
8413
|
this.reevaluateProperty(key);
|
|
8321
8414
|
this.sync();
|
|
8322
|
-
this.notify(key, value);
|
|
8323
8415
|
return this;
|
|
8324
8416
|
}
|
|
8325
8417
|
includes(key) {
|
|
@@ -8384,7 +8476,7 @@ Message: ${e.message}`, e);
|
|
|
8384
8476
|
var ArgumentResolversBuilderImpl_1 = __importDefault(require_ArgumentResolversBuilderImpl());
|
|
8385
8477
|
var ContextAwarePostProcessor_1 = __importDefault(require_ContextAwarePostProcessor());
|
|
8386
8478
|
var EMPTY_ARGUMENT_RESOLVERS = new ArgumentResolversBuilderImpl_1.default().build();
|
|
8387
|
-
var
|
|
8479
|
+
var FactoryImpl = class {
|
|
8388
8480
|
constructor(config, creator, cache, resolvers, localResolution) {
|
|
8389
8481
|
this.creator = (0, Utils_1.requireNotNull)(creator, "creator");
|
|
8390
8482
|
this.cache = (0, Utils_1.requireNotNull)(cache, "cache");
|
|
@@ -8415,7 +8507,7 @@ Message: ${e.message}`, e);
|
|
|
8415
8507
|
return this.config;
|
|
8416
8508
|
}
|
|
8417
8509
|
};
|
|
8418
|
-
exports.default =
|
|
8510
|
+
exports.default = FactoryImpl;
|
|
8419
8511
|
}
|
|
8420
8512
|
});
|
|
8421
8513
|
|
|
@@ -8574,14 +8666,12 @@ Message: ${e.message}`, e);
|
|
|
8574
8666
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8575
8667
|
var CydranConstants_1 = require_CydranConstants();
|
|
8576
8668
|
var Utils_1 = require_Utils();
|
|
8577
|
-
var Errors_1 = require_Errors();
|
|
8578
8669
|
var FactoryImpl_1 = __importDefault(require_FactoryImpl());
|
|
8579
8670
|
var FunctionalCreatorStrategyImpl_1 = __importDefault(require_FunctionalCreatorStrategyImpl());
|
|
8580
8671
|
var MemoizationCacheStrategyImpl_1 = __importDefault(require_MemoizationCacheStrategyImpl());
|
|
8581
8672
|
var ClassCreatorStrategyImpl_1 = __importDefault(require_ClassCreatorStrategyImpl());
|
|
8582
8673
|
var NoopCacheStrategyImpl_1 = __importDefault(require_NoopCacheStrategyImpl());
|
|
8583
8674
|
var ConstantCreatorStrategyImpl_1 = __importDefault(require_ConstantCreatorStrategyImpl());
|
|
8584
|
-
var UNIQUE_EXTANT = "key is considered unique and already exists";
|
|
8585
8675
|
var AbstractRegistryImpl = class {
|
|
8586
8676
|
constructor(context) {
|
|
8587
8677
|
this.context = (0, Utils_1.requireNotNull)(context, "context");
|
|
@@ -8629,8 +8719,8 @@ Message: ${e.message}`, e);
|
|
|
8629
8719
|
return this;
|
|
8630
8720
|
}
|
|
8631
8721
|
$release() {
|
|
8632
|
-
for (const key
|
|
8633
|
-
if (this.factories
|
|
8722
|
+
for (const key of Object.keys(this.factories)) {
|
|
8723
|
+
if (this.factories[key]) {
|
|
8634
8724
|
(0, Utils_1.safeCydranDisposal)(this.factories[key]);
|
|
8635
8725
|
}
|
|
8636
8726
|
}
|
|
@@ -8641,9 +8731,6 @@ Message: ${e.message}`, e);
|
|
|
8641
8731
|
registerFactory(id, factory) {
|
|
8642
8732
|
(0, Utils_1.requireValid)(id, "id", CydranConstants_1.OBJECT_ID);
|
|
8643
8733
|
if (id && factory) {
|
|
8644
|
-
if (this.factories[id]) {
|
|
8645
|
-
throw new Errors_1.RegistrationError(`'${id}' ${UNIQUE_EXTANT}`);
|
|
8646
|
-
}
|
|
8647
8734
|
this.factories[id] = factory;
|
|
8648
8735
|
}
|
|
8649
8736
|
}
|
|
@@ -8655,6 +8742,7 @@ Message: ${e.message}`, e);
|
|
|
8655
8742
|
getObject(id, instanceArguments, localContext) {
|
|
8656
8743
|
return this.getLocalObject(id, instanceArguments, localContext);
|
|
8657
8744
|
}
|
|
8745
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8658
8746
|
expose(id) {
|
|
8659
8747
|
throw new Error("Method not supported until issue #651 is implemented.");
|
|
8660
8748
|
}
|
|
@@ -8671,6 +8759,7 @@ Message: ${e.message}`, e);
|
|
|
8671
8759
|
}
|
|
8672
8760
|
return instance;
|
|
8673
8761
|
}
|
|
8762
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8674
8763
|
expose(id) {
|
|
8675
8764
|
throw new Error("Method not supported until issue #651 is implemented.");
|
|
8676
8765
|
}
|
|
@@ -8683,25 +8772,21 @@ Message: ${e.message}`, e);
|
|
|
8683
8772
|
var require_InitializersImpl = __commonJS({
|
|
8684
8773
|
"dist/src/context/InitializersImpl.js"(exports) {
|
|
8685
8774
|
"use strict";
|
|
8686
|
-
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
8687
|
-
return mod && mod.__esModule ? mod : { "default": mod };
|
|
8688
|
-
};
|
|
8689
8775
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8690
|
-
var GarbageCollectablePairedSetImpl_1 = __importDefault(require_GarbageCollectablePairedSetImpl());
|
|
8691
8776
|
var Utils_1 = require_Utils();
|
|
8692
8777
|
var InitializersImpl = class {
|
|
8693
8778
|
constructor() {
|
|
8694
|
-
this.callbacks =
|
|
8779
|
+
this.callbacks = [];
|
|
8695
8780
|
}
|
|
8696
8781
|
add(thisObject, callback) {
|
|
8697
8782
|
(0, Utils_1.requireNotNull)(callback, "callback");
|
|
8698
|
-
this.callbacks.
|
|
8783
|
+
this.callbacks.push({ thisObject: (0, Utils_1.defaulted)(thisObject, {}), callback });
|
|
8699
8784
|
}
|
|
8700
8785
|
execute(context) {
|
|
8701
|
-
this.callbacks
|
|
8702
|
-
callback.call(thisObject, context);
|
|
8703
|
-
}
|
|
8704
|
-
this.callbacks
|
|
8786
|
+
for (const registration of this.callbacks) {
|
|
8787
|
+
registration.callback.call(registration.thisObject, context);
|
|
8788
|
+
}
|
|
8789
|
+
this.callbacks = [];
|
|
8705
8790
|
}
|
|
8706
8791
|
};
|
|
8707
8792
|
exports.default = InitializersImpl;
|
|
@@ -8755,7 +8840,6 @@ Message: ${e.message}`, e);
|
|
|
8755
8840
|
var CydranConstants_1 = require_CydranConstants();
|
|
8756
8841
|
var DomUtils_1 = __importDefault(require_DomUtils());
|
|
8757
8842
|
var Utils_1 = require_Utils();
|
|
8758
|
-
var CYDRAN_PREFIX = CydranConstants_1.DEFAULT_PREFIX + CydranConstants_1.ATTRIBUTE_DELIMITER;
|
|
8759
8843
|
var StageRendererImpl = class {
|
|
8760
8844
|
constructor(selector) {
|
|
8761
8845
|
this.selector = (0, Utils_1.requireNotNull)(selector, "selector");
|
|
@@ -8826,6 +8910,112 @@ Message: ${e.message}`, e);
|
|
|
8826
8910
|
}
|
|
8827
8911
|
});
|
|
8828
8912
|
|
|
8913
|
+
// dist/src/stage/AnonymousParentNestable.js
|
|
8914
|
+
var require_AnonymousParentNestable = __commonJS({
|
|
8915
|
+
"dist/src/stage/AnonymousParentNestable.js"(exports) {
|
|
8916
|
+
"use strict";
|
|
8917
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8918
|
+
var ActionContinuationImpl = class {
|
|
8919
|
+
getParent() {
|
|
8920
|
+
throw new Error("Method not implemented.");
|
|
8921
|
+
}
|
|
8922
|
+
getEl() {
|
|
8923
|
+
throw new Error("Method not implemented.");
|
|
8924
|
+
}
|
|
8925
|
+
getObject(id, ...instanceArguments) {
|
|
8926
|
+
throw new Error("Method not implemented.");
|
|
8927
|
+
}
|
|
8928
|
+
getLogger() {
|
|
8929
|
+
throw new Error("Method not implemented.");
|
|
8930
|
+
}
|
|
8931
|
+
properties() {
|
|
8932
|
+
throw new Error("Method not implemented.");
|
|
8933
|
+
}
|
|
8934
|
+
getId() {
|
|
8935
|
+
throw new Error("Method not implemented.");
|
|
8936
|
+
}
|
|
8937
|
+
getPrefix() {
|
|
8938
|
+
throw new Error("Method not implemented.");
|
|
8939
|
+
}
|
|
8940
|
+
getName() {
|
|
8941
|
+
throw new Error("Method not implemented.");
|
|
8942
|
+
}
|
|
8943
|
+
scope() {
|
|
8944
|
+
throw new Error("Method not implemented.");
|
|
8945
|
+
}
|
|
8946
|
+
getValue() {
|
|
8947
|
+
throw new Error("Method not implemented.");
|
|
8948
|
+
}
|
|
8949
|
+
isMounted() {
|
|
8950
|
+
return true;
|
|
8951
|
+
}
|
|
8952
|
+
isConnected() {
|
|
8953
|
+
throw new Error("Method not implemented.");
|
|
8954
|
+
}
|
|
8955
|
+
send(messageName, payload) {
|
|
8956
|
+
throw new Error("Method not implemented.");
|
|
8957
|
+
}
|
|
8958
|
+
onInterval(millis) {
|
|
8959
|
+
throw new Error("Method not implemented.");
|
|
8960
|
+
}
|
|
8961
|
+
onMessage(messageName) {
|
|
8962
|
+
throw new Error("Method not implemented.");
|
|
8963
|
+
}
|
|
8964
|
+
createFilter(expression) {
|
|
8965
|
+
throw new Error("Method not implemented.");
|
|
8966
|
+
}
|
|
8967
|
+
regions() {
|
|
8968
|
+
throw new Error("Method not implemented.");
|
|
8969
|
+
}
|
|
8970
|
+
tell(name2, payload) {
|
|
8971
|
+
throw new Error("Method not implemented.");
|
|
8972
|
+
}
|
|
8973
|
+
forElement(name2) {
|
|
8974
|
+
throw new Error("Method not implemented.");
|
|
8975
|
+
}
|
|
8976
|
+
forSeries(name2) {
|
|
8977
|
+
throw new Error("Method not implemented.");
|
|
8978
|
+
}
|
|
8979
|
+
forForm(name2) {
|
|
8980
|
+
throw new Error("Method not implemented.");
|
|
8981
|
+
}
|
|
8982
|
+
forForms() {
|
|
8983
|
+
throw new Error("Method not implemented.");
|
|
8984
|
+
}
|
|
8985
|
+
metadata() {
|
|
8986
|
+
throw new Error("Method not implemented.");
|
|
8987
|
+
}
|
|
8988
|
+
sync() {
|
|
8989
|
+
throw new Error("Method not implemented.");
|
|
8990
|
+
}
|
|
8991
|
+
getContext() {
|
|
8992
|
+
throw new Error("Method not implemented.");
|
|
8993
|
+
}
|
|
8994
|
+
onExpressionValueChange(expression) {
|
|
8995
|
+
throw new Error("Method not implemented.");
|
|
8996
|
+
}
|
|
8997
|
+
evaluate(expression) {
|
|
8998
|
+
throw new Error("Method not implemented.");
|
|
8999
|
+
}
|
|
9000
|
+
};
|
|
9001
|
+
var AnonymousParentNestable = class {
|
|
9002
|
+
constructor() {
|
|
9003
|
+
this.continuation = new ActionContinuationImpl();
|
|
9004
|
+
}
|
|
9005
|
+
onMount() {
|
|
9006
|
+
}
|
|
9007
|
+
onUnmount() {
|
|
9008
|
+
}
|
|
9009
|
+
onRemount() {
|
|
9010
|
+
}
|
|
9011
|
+
$c() {
|
|
9012
|
+
return this.continuation;
|
|
9013
|
+
}
|
|
9014
|
+
};
|
|
9015
|
+
exports.default = AnonymousParentNestable;
|
|
9016
|
+
}
|
|
9017
|
+
});
|
|
9018
|
+
|
|
8829
9019
|
// dist/src/stage/StageInternalsImpl.js
|
|
8830
9020
|
var require_StageInternalsImpl = __commonJS({
|
|
8831
9021
|
"dist/src/stage/StageInternalsImpl.js"(exports) {
|
|
@@ -8844,6 +9034,7 @@ Message: ${e.message}`, e);
|
|
|
8844
9034
|
var StageRendererImpl_1 = __importDefault(require_StageRendererImpl());
|
|
8845
9035
|
var Styles_1 = __importDefault(require_Styles());
|
|
8846
9036
|
var InitializersImpl_1 = __importDefault(require_InitializersImpl());
|
|
9037
|
+
var AnonymousParentNestable_1 = __importDefault(require_AnonymousParentNestable());
|
|
8847
9038
|
var StageInternalsImpl = class {
|
|
8848
9039
|
constructor(context, stage, rootSelector, properties, callback, thisObject) {
|
|
8849
9040
|
this.context = (0, Utils_1.requireNotNull)(context, "context");
|
|
@@ -8924,9 +9115,8 @@ Message: ${e.message}`, e);
|
|
|
8924
9115
|
this.logger.ifDebug(() => "DOM Ready");
|
|
8925
9116
|
const renderer = new StageRendererImpl_1.default(this.rootSelector);
|
|
8926
9117
|
this.root = this.getContext().getObject(CydranConstants_1.Ids.STAGE_COMPONENT, renderer);
|
|
8927
|
-
this.
|
|
8928
|
-
this.root.$c().tell(
|
|
8929
|
-
this.root.$c().tell(ComponentTransitions_1.default.MOUNT);
|
|
9118
|
+
this.topNestable = new AnonymousParentNestable_1.default();
|
|
9119
|
+
this.root.$c().tell("setParent", this.topNestable);
|
|
8930
9120
|
if (this.getContext().getProperties().isTruthy(CydranConstants_1.PropertyKeys.CYDRAN_STYLES_ENABLED)) {
|
|
8931
9121
|
new Styles_1.default(DomUtils_1.default.getDocument().head).add();
|
|
8932
9122
|
}
|
|
@@ -8959,11 +9149,13 @@ Message: ${e.message}`, e);
|
|
|
8959
9149
|
const modeLabel = isStrict ? CydranConstants_1.CydranMode.STRICT : CydranConstants_1.CydranMode.LAZY;
|
|
8960
9150
|
let extra = "";
|
|
8961
9151
|
if (isStrict) {
|
|
8962
|
-
extra = `${props.getAsString(CydranConstants_1.PropertyKeys.CYDRAN_STRICT_STARTPHRASE)}
|
|
9152
|
+
extra = `${props.getAsString(CydranConstants_1.PropertyKeys.CYDRAN_STRICT_STARTPHRASE)}
|
|
9153
|
+
- ${props.getAsString(CydranConstants_1.PropertyKeys.CYDRAN_STRICT_MESSAGE)}`;
|
|
8963
9154
|
} else {
|
|
8964
9155
|
extra = props.getAsString(CydranConstants_1.PropertyKeys.CYDRAN_LAZY_STARTPHRASE);
|
|
8965
9156
|
}
|
|
8966
|
-
this.logger.ifInfo(() => `MODE: ${modeLabel.toUpperCase()}
|
|
9157
|
+
this.logger.ifInfo(() => `MODE: ${modeLabel.toUpperCase()}
|
|
9158
|
+
- ${extra}`);
|
|
8967
9159
|
}
|
|
8968
9160
|
completeStartup() {
|
|
8969
9161
|
this.transitionTo(ContextTransitions_1.default.DOMREADY);
|
|
@@ -9083,6 +9275,7 @@ Message: ${e.message}`, e);
|
|
|
9083
9275
|
this.children = {};
|
|
9084
9276
|
this.logger = null;
|
|
9085
9277
|
}
|
|
9278
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9086
9279
|
tell(name2, payload) {
|
|
9087
9280
|
(0, Utils_1.requireNotNull)(name2, "name");
|
|
9088
9281
|
}
|
|
@@ -9132,7 +9325,7 @@ Message: ${e.message}`, e);
|
|
|
9132
9325
|
return true;
|
|
9133
9326
|
}
|
|
9134
9327
|
constructor() {
|
|
9135
|
-
super("Root");
|
|
9328
|
+
super("Root", GlobalContextHolder_1.default.getContext());
|
|
9136
9329
|
}
|
|
9137
9330
|
getParent() {
|
|
9138
9331
|
return this;
|
|
@@ -9268,6 +9461,7 @@ Message: ${e.message}`, e);
|
|
|
9268
9461
|
"use strict";
|
|
9269
9462
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9270
9463
|
var NonOpVisitor = class {
|
|
9464
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9271
9465
|
visit(element, internals, consumer, topLevel) {
|
|
9272
9466
|
}
|
|
9273
9467
|
};
|
|
@@ -9286,6 +9480,7 @@ Message: ${e.message}`, e);
|
|
|
9286
9480
|
var DomUtils_1 = __importDefault(require_DomUtils());
|
|
9287
9481
|
var Utils_1 = require_Utils();
|
|
9288
9482
|
var ComponentStylesVisitor = class {
|
|
9483
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9289
9484
|
visit(element, internals, consumer, topLevel) {
|
|
9290
9485
|
const style = DomUtils_1.default.createElement("style");
|
|
9291
9486
|
const css = (0, Utils_1.defaulted)(internals.getStyles(), "");
|
|
@@ -9335,7 +9530,7 @@ Message: ${e.message}`, e);
|
|
|
9335
9530
|
"dist/src/validator/Validations.js"(exports) {
|
|
9336
9531
|
"use strict";
|
|
9337
9532
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9338
|
-
exports.validateNotEmptyString = exports.validateRequestableObjectPath = exports.validateValidContextName = exports.validateValidObjectId = exports.validateValidSeriesName = exports.validateValidRegionName = exports.validateDefined = void 0;
|
|
9533
|
+
exports.validateNotEmptyString = exports.validateRequestableObjectPath = exports.validateValidContextName = exports.validateValidObjectId = exports.validateValidSeriesName = exports.validateValidRegionName = exports.validateDefined = exports.validateAllValuesAllowed = void 0;
|
|
9339
9534
|
exports.validateOneOf = validateOneOf;
|
|
9340
9535
|
exports.validateNotNullIfFieldEquals = validateNotNullIfFieldEquals;
|
|
9341
9536
|
exports.validateDefinedIf = validateDefinedIf;
|
|
@@ -9343,19 +9538,45 @@ Message: ${e.message}`, e);
|
|
|
9343
9538
|
var CydranConstants_1 = require_CydranConstants();
|
|
9344
9539
|
var Utils_1 = require_Utils();
|
|
9345
9540
|
var AsFunctions_1 = require_AsFunctions();
|
|
9346
|
-
var
|
|
9541
|
+
var validateAllValuesAllowed = (
|
|
9542
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9543
|
+
(value, instance, state) => null
|
|
9544
|
+
);
|
|
9545
|
+
exports.validateAllValuesAllowed = validateAllValuesAllowed;
|
|
9546
|
+
var validateDefined = (
|
|
9547
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9548
|
+
(value, instance, state) => (0, Utils_1.isDefined)(value) ? null : "must be defined"
|
|
9549
|
+
);
|
|
9347
9550
|
exports.validateDefined = validateDefined;
|
|
9348
|
-
var validateValidRegionName = (
|
|
9551
|
+
var validateValidRegionName = (
|
|
9552
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9553
|
+
(value, instance, state) => !(0, Utils_1.isDefined)(value) || CydranConstants_1.REGION_NAME.test(value) ? null : "must be valid region name"
|
|
9554
|
+
);
|
|
9349
9555
|
exports.validateValidRegionName = validateValidRegionName;
|
|
9350
|
-
var validateValidSeriesName = (
|
|
9556
|
+
var validateValidSeriesName = (
|
|
9557
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9558
|
+
(value, instance, state) => !(0, Utils_1.isDefined)(value) || CydranConstants_1.SERIES_NAME.test(value) ? null : "must be valid series name"
|
|
9559
|
+
);
|
|
9351
9560
|
exports.validateValidSeriesName = validateValidSeriesName;
|
|
9352
|
-
var validateValidObjectId = (
|
|
9561
|
+
var validateValidObjectId = (
|
|
9562
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9563
|
+
(value, instance, state) => !(0, Utils_1.isDefined)(value) || CydranConstants_1.OBJECT_ID.test(value) ? null : "must be valid object id"
|
|
9564
|
+
);
|
|
9353
9565
|
exports.validateValidObjectId = validateValidObjectId;
|
|
9354
|
-
var validateValidContextName = (
|
|
9566
|
+
var validateValidContextName = (
|
|
9567
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9568
|
+
(value, instance, state) => !(0, Utils_1.isDefined)(value) || CydranConstants_1.CONTEXT_NAME.test(value) ? null : "must be valid context name"
|
|
9569
|
+
);
|
|
9355
9570
|
exports.validateValidContextName = validateValidContextName;
|
|
9356
|
-
var validateRequestableObjectPath = (
|
|
9571
|
+
var validateRequestableObjectPath = (
|
|
9572
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9573
|
+
(value, instance, state) => !(0, Utils_1.isDefined)(value) || CydranConstants_1.REQUESTABLE_OBJECT_PATH.test(value) ? null : "must be valid object path"
|
|
9574
|
+
);
|
|
9357
9575
|
exports.validateRequestableObjectPath = validateRequestableObjectPath;
|
|
9358
|
-
var validateNotEmptyString = (
|
|
9576
|
+
var validateNotEmptyString = (
|
|
9577
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9578
|
+
(value, instance, state) => (0, Utils_1.isDefined)(value) && (0, AsFunctions_1.asString)(value).trim() === "" ? "must not be empty" : null
|
|
9579
|
+
);
|
|
9359
9580
|
exports.validateNotEmptyString = validateNotEmptyString;
|
|
9360
9581
|
function validateNotNullIfFieldEquals(fieldName, expectedValue) {
|
|
9361
9582
|
const fn = (value, instance, state) => {
|
|
@@ -9419,7 +9640,6 @@ Message: ${e.message}`, e);
|
|
|
9419
9640
|
var AsFunctions_1 = require_AsFunctions();
|
|
9420
9641
|
var Validations_1 = require_Validations();
|
|
9421
9642
|
var AbstractContainerBehavior_1 = __importDefault(require_AbstractContainerBehavior());
|
|
9422
|
-
var ComponentTransitions_1 = __importDefault(require_ComponentTransitions());
|
|
9423
9643
|
var DEFAULT_ATTRIBUTES = {
|
|
9424
9644
|
lock: false,
|
|
9425
9645
|
path: null,
|
|
@@ -9429,16 +9649,20 @@ Message: ${e.message}`, e);
|
|
|
9429
9649
|
var RegionBehavior = class extends AbstractContainerBehavior_1.default {
|
|
9430
9650
|
constructor(parent) {
|
|
9431
9651
|
super();
|
|
9652
|
+
this.element = null;
|
|
9653
|
+
this.name = null;
|
|
9432
9654
|
this.itemFn = null;
|
|
9433
9655
|
this.component = null;
|
|
9434
9656
|
this.parent = parent;
|
|
9435
9657
|
this.expression = null;
|
|
9436
9658
|
this.locked = false;
|
|
9659
|
+
this.dependencies = null;
|
|
9437
9660
|
this.setDefaults(DEFAULT_ATTRIBUTES);
|
|
9438
9661
|
this.setValidations({
|
|
9439
9662
|
lock: [Validations_1.validateDefined],
|
|
9440
9663
|
name: [Validations_1.validateValidRegionName],
|
|
9441
|
-
path: [Validations_1.validateRequestableObjectPath]
|
|
9664
|
+
path: [Validations_1.validateRequestableObjectPath],
|
|
9665
|
+
value: [Validations_1.validateAllValuesAllowed]
|
|
9442
9666
|
});
|
|
9443
9667
|
this.setConverters({
|
|
9444
9668
|
lock: AsFunctions_1.asBoolean
|
|
@@ -9494,7 +9718,6 @@ Message: ${e.message}`, e);
|
|
|
9494
9718
|
if ((0, Utils_1.isDefined)(component)) {
|
|
9495
9719
|
this.getLogger().ifTrace(() => `Setting component ${component.$c().getId()}`);
|
|
9496
9720
|
component.$c().tell("setParentContext", this.getContext());
|
|
9497
|
-
component.$c().tell(ComponentTransitions_1.default.INIT, null);
|
|
9498
9721
|
}
|
|
9499
9722
|
if ((0, Utils_1.isDefined)(this.component)) {
|
|
9500
9723
|
this.component.$c().tell("setItemFn", null);
|
|
@@ -9549,6 +9772,7 @@ Message: ${e.message}`, e);
|
|
|
9549
9772
|
var RegionBehavior_1 = __importDefault(require_RegionBehavior());
|
|
9550
9773
|
var BehaviorTransitions_1 = __importDefault(require_BehaviorTransitions());
|
|
9551
9774
|
var RegionVisitor = class {
|
|
9775
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9552
9776
|
visit(element, internals, consumer, topLevel) {
|
|
9553
9777
|
const region = new RegionBehavior_1.default(internals);
|
|
9554
9778
|
const dependencies = {
|
|
@@ -9582,7 +9806,6 @@ Message: ${e.message}`, e);
|
|
|
9582
9806
|
var DomUtils_1 = __importDefault(require_DomUtils());
|
|
9583
9807
|
var Validations_1 = require_Validations();
|
|
9584
9808
|
var Errors_1 = require_Errors();
|
|
9585
|
-
var ComponentTransitions_1 = __importDefault(require_ComponentTransitions());
|
|
9586
9809
|
var TOP_COMMENT_TEXT = "SS";
|
|
9587
9810
|
var BOTTOM_COMMENT_TEXT = "SE";
|
|
9588
9811
|
var DEFAULT_ATTRIBUTES = {
|
|
@@ -9734,6 +9957,7 @@ Message: ${e.message}`, e);
|
|
|
9734
9957
|
}
|
|
9735
9958
|
onMount() {
|
|
9736
9959
|
}
|
|
9960
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9737
9961
|
requestDigestionSources(sources) {
|
|
9738
9962
|
}
|
|
9739
9963
|
$release() {
|
|
@@ -9756,7 +9980,6 @@ Message: ${e.message}`, e);
|
|
|
9756
9980
|
if ((0, Utils_1.isDefined)(component)) {
|
|
9757
9981
|
this.getLogger().ifTrace(() => `Setting component ${component.$c().getId()}`);
|
|
9758
9982
|
component.$c().tell("setParentContext", this.getContext());
|
|
9759
|
-
component.$c().tell(ComponentTransitions_1.default.INIT, null);
|
|
9760
9983
|
}
|
|
9761
9984
|
component.$c().tell("setParent", this.parent.getComponent());
|
|
9762
9985
|
}
|
|
@@ -9779,6 +10002,7 @@ Message: ${e.message}`, e);
|
|
|
9779
10002
|
var BehaviorTransitions_1 = __importDefault(require_BehaviorTransitions());
|
|
9780
10003
|
var SeriesBehavior_1 = __importDefault(require_SeriesBehavior());
|
|
9781
10004
|
var SeriesVisitor = class {
|
|
10005
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9782
10006
|
visit(element, internals, consumer, topLevel) {
|
|
9783
10007
|
const series = new SeriesBehavior_1.default(internals);
|
|
9784
10008
|
const dependencies = {
|
|
@@ -9843,7 +10067,7 @@ Message: ${e.message}`, e);
|
|
|
9843
10067
|
onMount() {
|
|
9844
10068
|
this.getEl().textContent = this.getMediator().get();
|
|
9845
10069
|
if (this.isMutable()) {
|
|
9846
|
-
this.getMediator().watch(this,
|
|
10070
|
+
this.getMediator().watch(this, "onChange");
|
|
9847
10071
|
}
|
|
9848
10072
|
}
|
|
9849
10073
|
onChange(previous, current) {
|
|
@@ -9902,6 +10126,7 @@ Message: ${e.message}`, e);
|
|
|
9902
10126
|
var DomUtils_1 = __importDefault(require_DomUtils());
|
|
9903
10127
|
var Tokens_1 = require_Tokens();
|
|
9904
10128
|
var TextVisitor = class {
|
|
10129
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9905
10130
|
visit(element, internals, consumer, topLevel) {
|
|
9906
10131
|
const result = this.splitChild(element, internals);
|
|
9907
10132
|
if (result.length > 1) {
|
|
@@ -9985,7 +10210,7 @@ Message: ${e.message}`, e);
|
|
|
9985
10210
|
onMount() {
|
|
9986
10211
|
this.getEl().setAttribute(this.attributeName, this.getMediator().get());
|
|
9987
10212
|
if (this.isMutable()) {
|
|
9988
|
-
this.getMediator().watch(this,
|
|
10213
|
+
this.getMediator().watch(this, "onChange");
|
|
9989
10214
|
}
|
|
9990
10215
|
}
|
|
9991
10216
|
onChange(previous, current) {
|
|
@@ -10014,7 +10239,7 @@ Message: ${e.message}`, e);
|
|
|
10014
10239
|
}
|
|
10015
10240
|
onInit() {
|
|
10016
10241
|
this.bridge(this.eventKey);
|
|
10017
|
-
this.on(this.eventKey).forChannel(CydranConstants_1.DOM_KEY).invoke(
|
|
10242
|
+
this.on(this.eventKey).forChannel(CydranConstants_1.DOM_KEY).invoke("handleEvent");
|
|
10018
10243
|
}
|
|
10019
10244
|
handleEvent(event) {
|
|
10020
10245
|
this.invoke({ $event: event });
|
|
@@ -10042,8 +10267,9 @@ Message: ${e.message}`, e);
|
|
|
10042
10267
|
}
|
|
10043
10268
|
onInit() {
|
|
10044
10269
|
this.bridge(CydranConstants_1.RESET_KEY);
|
|
10045
|
-
this.on(CydranConstants_1.RESET_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke(
|
|
10270
|
+
this.on(CydranConstants_1.RESET_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke("onReset");
|
|
10046
10271
|
}
|
|
10272
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10047
10273
|
onReset(event) {
|
|
10048
10274
|
for (let i = 0; i < this.getEl().elements.length; i++) {
|
|
10049
10275
|
this.notifyElement(CydranConstants_1.BEHAVIOR_FORM_RESET, {}, this.getEl().elements[i]);
|
|
@@ -10227,12 +10453,12 @@ Message: ${e.message}`, e);
|
|
|
10227
10453
|
const newClasses = [];
|
|
10228
10454
|
const map = current || {};
|
|
10229
10455
|
for (const value of oldClasses) {
|
|
10230
|
-
if (!map.
|
|
10456
|
+
if (!Object.keys(map).includes(value)) {
|
|
10231
10457
|
newClasses.push(value);
|
|
10232
10458
|
}
|
|
10233
10459
|
}
|
|
10234
|
-
for (const key
|
|
10235
|
-
if (map
|
|
10460
|
+
for (const key of Object.keys(map)) {
|
|
10461
|
+
if (map[key]) {
|
|
10236
10462
|
newClasses.push(key);
|
|
10237
10463
|
}
|
|
10238
10464
|
}
|
|
@@ -10408,16 +10634,18 @@ Message: ${e.message}`, e);
|
|
|
10408
10634
|
super();
|
|
10409
10635
|
this.setReducerFn(AsFunctions_1.asBoolean);
|
|
10410
10636
|
this.setDefaultExpression("true");
|
|
10637
|
+
this.shouldFocus = false;
|
|
10638
|
+
this.operations = null;
|
|
10411
10639
|
}
|
|
10412
10640
|
onInit() {
|
|
10413
10641
|
this.bridge("focusout");
|
|
10414
|
-
this.on("focusout").forChannel(CydranConstants_1.DOM_KEY).invoke(
|
|
10642
|
+
this.on("focusout").forChannel(CydranConstants_1.DOM_KEY).invoke("handleFocus");
|
|
10415
10643
|
this.operations = new ElementOperationsImpl_1.default(this.getEl());
|
|
10416
10644
|
}
|
|
10417
10645
|
onMount() {
|
|
10418
10646
|
this.shouldFocus = this.getMediator().get();
|
|
10419
10647
|
if (this.isMutable()) {
|
|
10420
|
-
this.getMediator().watch(this,
|
|
10648
|
+
this.getMediator().watch(this, "onChange");
|
|
10421
10649
|
}
|
|
10422
10650
|
this.handleFocus();
|
|
10423
10651
|
}
|
|
@@ -10453,14 +10681,15 @@ Message: ${e.message}`, e);
|
|
|
10453
10681
|
}
|
|
10454
10682
|
onInit() {
|
|
10455
10683
|
this.bridge(CydranConstants_1.INPUT_KEY);
|
|
10456
|
-
this.on(CydranConstants_1.INPUT_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke(
|
|
10684
|
+
this.on(CydranConstants_1.INPUT_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke("onInput");
|
|
10457
10685
|
this.bridge(CydranConstants_1.BEHAVIOR_FORM_RESET);
|
|
10458
|
-
this.on(CydranConstants_1.BEHAVIOR_FORM_RESET).forChannel(CydranConstants_1.DOM_KEY).invoke(
|
|
10686
|
+
this.on(CydranConstants_1.BEHAVIOR_FORM_RESET).forChannel(CydranConstants_1.DOM_KEY).invoke("onReset");
|
|
10459
10687
|
}
|
|
10460
10688
|
onMount() {
|
|
10461
|
-
this.getMediator().watch(this,
|
|
10689
|
+
this.getMediator().watch(this, "onChange");
|
|
10462
10690
|
this.onChange(null, this.getMediator().get());
|
|
10463
10691
|
}
|
|
10692
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10464
10693
|
onInput(event) {
|
|
10465
10694
|
this.getMediator().set(this.getEl().checked);
|
|
10466
10695
|
this.sync();
|
|
@@ -10468,6 +10697,7 @@ Message: ${e.message}`, e);
|
|
|
10468
10697
|
onChange(previous, current) {
|
|
10469
10698
|
this.getEl().checked = current;
|
|
10470
10699
|
}
|
|
10700
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10471
10701
|
onReset(event) {
|
|
10472
10702
|
this.getEl().checked = this.getEl().defaultChecked;
|
|
10473
10703
|
this.onInput();
|
|
@@ -10491,6 +10721,7 @@ Message: ${e.message}`, e);
|
|
|
10491
10721
|
check(item) {
|
|
10492
10722
|
return (0, Utils_1.isDefined)(item[this.idKey]);
|
|
10493
10723
|
}
|
|
10724
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10494
10725
|
enrich(item, index) {
|
|
10495
10726
|
item[this.idKey] = (0, Utils_1.uuidV4)();
|
|
10496
10727
|
}
|
|
@@ -10516,9 +10747,11 @@ Message: ${e.message}`, e);
|
|
|
10516
10747
|
this.code = `'use strict'; return function(i,item,v,value) { return ${expression} }(arguments[0], arguments[0], arguments[0], arguments[0]);`;
|
|
10517
10748
|
this.fn = Function(this.code);
|
|
10518
10749
|
}
|
|
10750
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10519
10751
|
check(item) {
|
|
10520
10752
|
return false;
|
|
10521
10753
|
}
|
|
10754
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10522
10755
|
enrich(item, index) {
|
|
10523
10756
|
}
|
|
10524
10757
|
extract(item) {
|
|
@@ -10576,11 +10809,14 @@ Message: ${e.message}`, e);
|
|
|
10576
10809
|
"use strict";
|
|
10577
10810
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10578
10811
|
var InvalidIdStrategyImpl = class {
|
|
10812
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10579
10813
|
check(item) {
|
|
10580
10814
|
return true;
|
|
10581
10815
|
}
|
|
10816
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10582
10817
|
enrich(item, index) {
|
|
10583
10818
|
}
|
|
10819
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10584
10820
|
extract(item) {
|
|
10585
10821
|
return null;
|
|
10586
10822
|
}
|
|
@@ -10642,6 +10878,20 @@ Message: ${e.message}`, e);
|
|
|
10642
10878
|
}
|
|
10643
10879
|
return result;
|
|
10644
10880
|
}
|
|
10881
|
+
/**
|
|
10882
|
+
* Points each reused item component at the current item object for its key. Components are reused
|
|
10883
|
+
* by key, so without this a component keeps reading the object it was created with when the array
|
|
10884
|
+
* receives a new object with the same key (e.g. an immutable-style copy), and v() goes stale.
|
|
10885
|
+
*/
|
|
10886
|
+
updateReusedItems(items) {
|
|
10887
|
+
const map = this.state.getMap();
|
|
10888
|
+
for (const item of items) {
|
|
10889
|
+
const component = map[this.idStrategy.extract(item)];
|
|
10890
|
+
if ((0, Utils_1.isDefined)(component) && component.$c().getValue() !== item) {
|
|
10891
|
+
component.$c().tell("setItemFn", () => item);
|
|
10892
|
+
}
|
|
10893
|
+
}
|
|
10894
|
+
}
|
|
10645
10895
|
idsSame(ids) {
|
|
10646
10896
|
return (0, Utils_1.equals)(10, this.state.getIds(), ids);
|
|
10647
10897
|
}
|
|
@@ -10655,13 +10905,11 @@ Message: ${e.message}`, e);
|
|
|
10655
10905
|
components.push(component);
|
|
10656
10906
|
delete map[id];
|
|
10657
10907
|
}
|
|
10658
|
-
for (const key
|
|
10659
|
-
|
|
10660
|
-
|
|
10661
|
-
|
|
10662
|
-
|
|
10663
|
-
this.getElement().removeChild(component.$c().getEl());
|
|
10664
|
-
}
|
|
10908
|
+
for (const key of Object.keys(map)) {
|
|
10909
|
+
const component = map[key];
|
|
10910
|
+
component.$c().tell(ComponentTransitions_1.default.UNMOUNT);
|
|
10911
|
+
delete map[key];
|
|
10912
|
+
this.getElement().removeChild(component.$c().getEl());
|
|
10665
10913
|
}
|
|
10666
10914
|
this.state.setMap(newMap);
|
|
10667
10915
|
}
|
|
@@ -10696,6 +10944,7 @@ Message: ${e.message}`, e);
|
|
|
10696
10944
|
refresh(items) {
|
|
10697
10945
|
this.enrich(items);
|
|
10698
10946
|
const newIds = this.extract(items);
|
|
10947
|
+
this.updateReusedItems(items);
|
|
10699
10948
|
if (this.idsSame(newIds)) {
|
|
10700
10949
|
this.getState().setIds(newIds);
|
|
10701
10950
|
return;
|
|
@@ -10788,10 +11037,7 @@ Message: ${e.message}`, e);
|
|
|
10788
11037
|
this.localScope = null;
|
|
10789
11038
|
}
|
|
10790
11039
|
requestDigestionSources(sources) {
|
|
10791
|
-
for (const key
|
|
10792
|
-
if (!this.map.hasOwnProperty(key)) {
|
|
10793
|
-
continue;
|
|
10794
|
-
}
|
|
11040
|
+
for (const key of Object.keys(this.map)) {
|
|
10795
11041
|
const component = this.map[key];
|
|
10796
11042
|
sources.push(component.$c());
|
|
10797
11043
|
}
|
|
@@ -10821,10 +11067,7 @@ Message: ${e.message}`, e);
|
|
|
10821
11067
|
if (this.last) {
|
|
10822
11068
|
this.last.$c().tell(name2, payload);
|
|
10823
11069
|
}
|
|
10824
|
-
for (const key
|
|
10825
|
-
if (!this.map.hasOwnProperty(key)) {
|
|
10826
|
-
continue;
|
|
10827
|
-
}
|
|
11070
|
+
for (const key of Object.keys(this.map)) {
|
|
10828
11071
|
const component = this.map[key];
|
|
10829
11072
|
component.$c().tell(name2, payload);
|
|
10830
11073
|
}
|
|
@@ -10956,9 +11199,8 @@ Message: ${e.message}`);
|
|
|
10956
11199
|
};
|
|
10957
11200
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10958
11201
|
var Component_1 = __importDefault(require_Component());
|
|
10959
|
-
var ComponentTransitions_1 = __importDefault(require_ComponentTransitions());
|
|
10960
11202
|
var ItemComponentFactoryImpl = class {
|
|
10961
|
-
constructor(context, template, prefix, parent, parentId, parentModelFn
|
|
11203
|
+
constructor(context, template, prefix, parent, parentId, parentModelFn) {
|
|
10962
11204
|
this.context = context;
|
|
10963
11205
|
this.template = template;
|
|
10964
11206
|
this.prefix = prefix;
|
|
@@ -10975,7 +11217,6 @@ Message: ${e.message}`);
|
|
|
10975
11217
|
});
|
|
10976
11218
|
component.$c().tell("setItemFn", () => item);
|
|
10977
11219
|
component.$c().tell("setParentContext", this.context);
|
|
10978
|
-
component.$c().tell(ComponentTransitions_1.default.INIT);
|
|
10979
11220
|
component.$c().tell("setParent", this.parent);
|
|
10980
11221
|
return component;
|
|
10981
11222
|
}
|
|
@@ -11192,11 +11433,7 @@ Message: ${e.message}`);
|
|
|
11192
11433
|
var require_EmbeddedComponentFactoryImpl = __commonJS({
|
|
11193
11434
|
"dist/src/behavior/core/each/EmbeddedComponentFactoryImpl.js"(exports) {
|
|
11194
11435
|
"use strict";
|
|
11195
|
-
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
11196
|
-
return mod && mod.__esModule ? mod : { "default": mod };
|
|
11197
|
-
};
|
|
11198
11436
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11199
|
-
var ComponentTransitions_1 = __importDefault(require_ComponentTransitions());
|
|
11200
11437
|
var Utils_1 = require_Utils();
|
|
11201
11438
|
var EmbeddedComponentFactoryImpl = class {
|
|
11202
11439
|
constructor(context, componentId, contextId, parent) {
|
|
@@ -11210,7 +11447,6 @@ Message: ${e.message}`);
|
|
|
11210
11447
|
const component = context.getObject(this.componentId);
|
|
11211
11448
|
component.$c().tell("setItemFn", () => item);
|
|
11212
11449
|
component.$c().tell("setParentContext", this.context);
|
|
11213
|
-
component.$c().tell(ComponentTransitions_1.default.INIT);
|
|
11214
11450
|
component.$c().tell("setParent", this.parent);
|
|
11215
11451
|
return component;
|
|
11216
11452
|
}
|
|
@@ -11234,12 +11470,11 @@ Message: ${e.message}`);
|
|
|
11234
11470
|
this.element = element;
|
|
11235
11471
|
this.state = state;
|
|
11236
11472
|
}
|
|
11473
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11237
11474
|
refresh(current) {
|
|
11238
|
-
for (const key
|
|
11239
|
-
|
|
11240
|
-
|
|
11241
|
-
component.$c().tell(ComponentTransitions_1.default.UNMOUNT);
|
|
11242
|
-
}
|
|
11475
|
+
for (const key of Object.keys(this.state.getMap())) {
|
|
11476
|
+
const component = this.state.getMap()[key];
|
|
11477
|
+
component.$c().tell(ComponentTransitions_1.default.UNMOUNT);
|
|
11243
11478
|
}
|
|
11244
11479
|
this.state.setIds([]);
|
|
11245
11480
|
this.state.setMap({});
|
|
@@ -11271,6 +11506,7 @@ Message: ${e.message}`);
|
|
|
11271
11506
|
refresh(items) {
|
|
11272
11507
|
this.enrich(items);
|
|
11273
11508
|
const newIds = this.extract(items);
|
|
11509
|
+
this.updateReusedItems(items);
|
|
11274
11510
|
if (this.idsSame(newIds)) {
|
|
11275
11511
|
this.getState().setIds(newIds);
|
|
11276
11512
|
return;
|
|
@@ -11372,7 +11608,7 @@ Message: ${e.message}`);
|
|
|
11372
11608
|
this.parseChildElements();
|
|
11373
11609
|
this.initChildElements(this.getMediator().get());
|
|
11374
11610
|
if (this.isMutable()) {
|
|
11375
|
-
this.getMediator().watch(this,
|
|
11611
|
+
this.getMediator().watch(this, "onChange");
|
|
11376
11612
|
}
|
|
11377
11613
|
this.state.mount();
|
|
11378
11614
|
}
|
|
@@ -11477,22 +11713,24 @@ Message: ${e.message}`);
|
|
|
11477
11713
|
var MultiSelectValueModel = class extends AbstractBehavior_1.default {
|
|
11478
11714
|
onInit() {
|
|
11479
11715
|
this.bridge(CydranConstants_1.INPUT_KEY);
|
|
11480
|
-
this.on(CydranConstants_1.INPUT_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke(
|
|
11716
|
+
this.on(CydranConstants_1.INPUT_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke("onInput");
|
|
11481
11717
|
this.bridge(CydranConstants_1.CHANGE_KEY);
|
|
11482
|
-
this.on(CydranConstants_1.CHANGE_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke(
|
|
11718
|
+
this.on(CydranConstants_1.CHANGE_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke("onInput");
|
|
11483
11719
|
this.bridge(CydranConstants_1.BEHAVIOR_FORM_RESET);
|
|
11484
|
-
this.on(CydranConstants_1.BEHAVIOR_FORM_RESET).forChannel(CydranConstants_1.DOM_KEY).invoke(
|
|
11720
|
+
this.on(CydranConstants_1.BEHAVIOR_FORM_RESET).forChannel(CydranConstants_1.DOM_KEY).invoke("onReset");
|
|
11485
11721
|
}
|
|
11486
11722
|
onMount() {
|
|
11487
11723
|
this.onChange(null, this.getMediator().get());
|
|
11488
|
-
this.getMediator().watch(this,
|
|
11724
|
+
this.getMediator().watch(this, "onChange");
|
|
11489
11725
|
this.onChange(null, this.getMediator().get());
|
|
11490
11726
|
}
|
|
11727
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11491
11728
|
onInput(event) {
|
|
11729
|
+
var _a, _b, _c;
|
|
11492
11730
|
if (this.getEl().multiple) {
|
|
11493
11731
|
const selectedValues = [];
|
|
11494
11732
|
for (let i = 0; i < this.getEl().selectedOptions.length; i++) {
|
|
11495
|
-
const optValue = this.getEl().selectedOptions.item(i).getAttribute(CydranConstants_1.Attrs.VALUE);
|
|
11733
|
+
const optValue = (_c = (_b = (_a = this.getEl()) === null || _a === void 0 ? void 0 : _a.selectedOptions) === null || _b === void 0 ? void 0 : _b.item(i)) === null || _c === void 0 ? void 0 : _c.getAttribute(CydranConstants_1.Attrs.VALUE);
|
|
11496
11734
|
selectedValues.push(optValue);
|
|
11497
11735
|
}
|
|
11498
11736
|
this.getMediator().set(selectedValues);
|
|
@@ -11513,6 +11751,7 @@ Message: ${e.message}`);
|
|
|
11513
11751
|
this.getEl().value = current;
|
|
11514
11752
|
}
|
|
11515
11753
|
}
|
|
11754
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11516
11755
|
onReset(event) {
|
|
11517
11756
|
for (let i = 0; i < this.getEl().options.length; i++) {
|
|
11518
11757
|
const element = this.getEl().options.item(i);
|
|
@@ -11540,10 +11779,7 @@ Message: ${e.message}`);
|
|
|
11540
11779
|
if (!(0, Utils_1.isDefined)(current)) {
|
|
11541
11780
|
return;
|
|
11542
11781
|
}
|
|
11543
|
-
for (const key
|
|
11544
|
-
if (!current.hasOwnProperty(key)) {
|
|
11545
|
-
continue;
|
|
11546
|
-
}
|
|
11782
|
+
for (const key of Object.keys(current)) {
|
|
11547
11783
|
this.getEl().style[key] = current[key] + "";
|
|
11548
11784
|
}
|
|
11549
11785
|
}
|
|
@@ -11607,24 +11843,26 @@ Message: ${e.message}`);
|
|
|
11607
11843
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11608
11844
|
var AbstractBehavior_1 = __importDefault(require_AbstractBehavior());
|
|
11609
11845
|
var CydranConstants_1 = require_CydranConstants();
|
|
11610
|
-
var AsFunctions_1 = require_AsFunctions();
|
|
11611
11846
|
var AbstractInputModelBehavior = class extends AbstractBehavior_1.default {
|
|
11612
11847
|
constructor() {
|
|
11613
11848
|
super();
|
|
11614
|
-
this.setReducerFn(AsFunctions_1.asString);
|
|
11615
11849
|
}
|
|
11616
11850
|
onInit() {
|
|
11617
11851
|
this.bridge(CydranConstants_1.INPUT_KEY);
|
|
11618
|
-
this.on(CydranConstants_1.INPUT_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke(
|
|
11852
|
+
this.on(CydranConstants_1.INPUT_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke("onInput");
|
|
11619
11853
|
this.bridge(CydranConstants_1.CHANGE_KEY);
|
|
11620
|
-
this.on(CydranConstants_1.CHANGE_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke(
|
|
11854
|
+
this.on(CydranConstants_1.CHANGE_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke("onInput");
|
|
11621
11855
|
this.bridge(CydranConstants_1.BEHAVIOR_FORM_RESET);
|
|
11622
|
-
this.on(CydranConstants_1.BEHAVIOR_FORM_RESET).forChannel(CydranConstants_1.DOM_KEY).invoke(
|
|
11856
|
+
this.on(CydranConstants_1.BEHAVIOR_FORM_RESET).forChannel(CydranConstants_1.DOM_KEY).invoke("onReset");
|
|
11857
|
+
this.onInitElement(this.getEl());
|
|
11623
11858
|
}
|
|
11624
11859
|
onMount() {
|
|
11625
|
-
this.getMediator().watch(this,
|
|
11860
|
+
this.getMediator().watch(this, "onChange");
|
|
11626
11861
|
this.onChange(null, this.getMediator().get());
|
|
11627
11862
|
}
|
|
11863
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11864
|
+
onInitElement(el) {
|
|
11865
|
+
}
|
|
11628
11866
|
};
|
|
11629
11867
|
exports.default = AbstractInputModelBehavior;
|
|
11630
11868
|
}
|
|
@@ -11639,18 +11877,59 @@ Message: ${e.message}`);
|
|
|
11639
11877
|
};
|
|
11640
11878
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11641
11879
|
var AbstractInputModelBehavior_1 = __importDefault(require_AbstractInputModelBehavior());
|
|
11880
|
+
var AsFunctions_1 = require_AsFunctions();
|
|
11881
|
+
var Utils_1 = require_Utils();
|
|
11882
|
+
var DATE_TYPES = ["date", "datetime-local", "month", "time", "week"];
|
|
11883
|
+
var NUMBER_TYPES = ["number", "range"];
|
|
11884
|
+
function isTypeWithin(el, types) {
|
|
11885
|
+
if (el.tagName.toLowerCase() !== "input") {
|
|
11886
|
+
return false;
|
|
11887
|
+
}
|
|
11888
|
+
const inputType = (0, Utils_1.defaulted)(el.getAttribute("type"), "text").toLowerCase();
|
|
11889
|
+
return types.includes(inputType);
|
|
11890
|
+
}
|
|
11891
|
+
var STRING_ACCESSOR = (el) => el.value;
|
|
11892
|
+
var STRING_MUTATOR = (el, value) => {
|
|
11893
|
+
el.value = value;
|
|
11894
|
+
};
|
|
11895
|
+
var DATE_ACCESSOR = (el) => el.valueAsDate;
|
|
11896
|
+
var DATE_MUTATOR = (el, value) => {
|
|
11897
|
+
el.valueAsDate = value;
|
|
11898
|
+
};
|
|
11899
|
+
var NUMBER_ACCESSOR = (el) => el.valueAsNumber;
|
|
11900
|
+
var NUMBER_MUTATOR = (el, value) => {
|
|
11901
|
+
el.valueAsNumber = value;
|
|
11902
|
+
};
|
|
11642
11903
|
var ValuedModelBehavior = class extends AbstractInputModelBehavior_1.default {
|
|
11904
|
+
constructor() {
|
|
11905
|
+
super();
|
|
11906
|
+
this.setReducerFn(AsFunctions_1.asIdentity);
|
|
11907
|
+
}
|
|
11908
|
+
onInitElement(el) {
|
|
11909
|
+
if (isTypeWithin(el, DATE_TYPES)) {
|
|
11910
|
+
this.valueAccessor = DATE_ACCESSOR;
|
|
11911
|
+
this.valueMutator = DATE_MUTATOR;
|
|
11912
|
+
} else if (isTypeWithin(el, NUMBER_TYPES)) {
|
|
11913
|
+
this.valueAccessor = NUMBER_ACCESSOR;
|
|
11914
|
+
this.valueMutator = NUMBER_MUTATOR;
|
|
11915
|
+
} else {
|
|
11916
|
+
this.valueAccessor = STRING_ACCESSOR;
|
|
11917
|
+
this.valueMutator = STRING_MUTATOR;
|
|
11918
|
+
}
|
|
11919
|
+
}
|
|
11920
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11643
11921
|
onInput(event) {
|
|
11644
|
-
const value = this.getEl()
|
|
11922
|
+
const value = this.valueAccessor(this.getEl());
|
|
11645
11923
|
this.getMediator().set(value);
|
|
11646
11924
|
this.sync();
|
|
11647
11925
|
}
|
|
11926
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11648
11927
|
onReset(event) {
|
|
11649
11928
|
this.getEl().value = this.getEl().defaultValue;
|
|
11650
11929
|
this.onInput();
|
|
11651
11930
|
}
|
|
11652
11931
|
onChange(previous, current) {
|
|
11653
|
-
this.getEl()
|
|
11932
|
+
this.valueMutator(this.getEl(), current);
|
|
11654
11933
|
this.notify("modelChanged", current);
|
|
11655
11934
|
}
|
|
11656
11935
|
};
|
|
@@ -11667,7 +11946,12 @@ Message: ${e.message}`);
|
|
|
11667
11946
|
};
|
|
11668
11947
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11669
11948
|
var AbstractInputModelBehavior_1 = __importDefault(require_AbstractInputModelBehavior());
|
|
11949
|
+
var AsFunctions_1 = require_AsFunctions();
|
|
11670
11950
|
var RadioModelBehavior = class extends AbstractInputModelBehavior_1.default {
|
|
11951
|
+
constructor() {
|
|
11952
|
+
super();
|
|
11953
|
+
this.setReducerFn(AsFunctions_1.asString);
|
|
11954
|
+
}
|
|
11671
11955
|
onInput() {
|
|
11672
11956
|
const value = this.getEl().value;
|
|
11673
11957
|
if (this.getEl().checked) {
|
|
@@ -11681,6 +11965,7 @@ Message: ${e.message}`);
|
|
|
11681
11965
|
}
|
|
11682
11966
|
this.notify("modelChanged", current);
|
|
11683
11967
|
}
|
|
11968
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11684
11969
|
onReset(event) {
|
|
11685
11970
|
this.getEl().checked = this.getEl().defaultChecked;
|
|
11686
11971
|
this.onInput();
|
|
@@ -11740,10 +12025,7 @@ Message: ${e.message}`);
|
|
|
11740
12025
|
}
|
|
11741
12026
|
digest() {
|
|
11742
12027
|
const changedCandidates = [];
|
|
11743
|
-
for (const key
|
|
11744
|
-
if (!this.candidates.hasOwnProperty(key)) {
|
|
11745
|
-
continue;
|
|
11746
|
-
}
|
|
12028
|
+
for (const key of Object.keys(this.candidates)) {
|
|
11747
12029
|
const current = this.candidates[key];
|
|
11748
12030
|
this.segmentDigester.digestSegment(key, changedCandidates, current);
|
|
11749
12031
|
}
|
|
@@ -11861,10 +12143,13 @@ Message: ${e.message}`);
|
|
|
11861
12143
|
getRoot() {
|
|
11862
12144
|
return this;
|
|
11863
12145
|
}
|
|
12146
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11864
12147
|
addPreInitializer(thisObject, callback) {
|
|
11865
12148
|
}
|
|
12149
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11866
12150
|
addInitializer(thisObject, callback) {
|
|
11867
12151
|
}
|
|
12152
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11868
12153
|
addDisposer(thisObject, callback) {
|
|
11869
12154
|
}
|
|
11870
12155
|
$release() {
|
|
@@ -11892,6 +12177,7 @@ Message: ${e.message}`);
|
|
|
11892
12177
|
removeRootChild(child) {
|
|
11893
12178
|
this.children.remove(child);
|
|
11894
12179
|
}
|
|
12180
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11895
12181
|
tell(name2, payload) {
|
|
11896
12182
|
}
|
|
11897
12183
|
getParent() {
|
|
@@ -11914,10 +12200,12 @@ Message: ${e.message}`);
|
|
|
11914
12200
|
(0, Utils_1.requireValid)(name2, "name", CydranConstants_2.CONTEXT_NAME);
|
|
11915
12201
|
return false;
|
|
11916
12202
|
}
|
|
12203
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11917
12204
|
addChild(name2, initializer) {
|
|
11918
12205
|
(0, Utils_1.requireValid)(name2, "name", CydranConstants_2.CONTEXT_NAME);
|
|
11919
12206
|
throw new Errors_1.UnsupportedOperationError("Operation not supported.");
|
|
11920
12207
|
}
|
|
12208
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11921
12209
|
forParent(fn) {
|
|
11922
12210
|
}
|
|
11923
12211
|
forChildren(callback) {
|
|
@@ -11935,7 +12223,10 @@ Message: ${e.message}`);
|
|
|
11935
12223
|
return new ScopeImpl_1.default().extend();
|
|
11936
12224
|
}
|
|
11937
12225
|
init() {
|
|
11938
|
-
const fn = (
|
|
12226
|
+
const fn = (args) => {
|
|
12227
|
+
const el = args === null || args === void 0 ? void 0 : args[0];
|
|
12228
|
+
return (0, Utils_1.isDefined)(el) && (0, Utils_1.isDefined)(el.type) && el.type.toLowerCase() === "radio" ? new RadioModelBehavior_1.default() : new ValuedModelBehavior_1.default();
|
|
12229
|
+
};
|
|
11939
12230
|
this.registerPrototypeWithFactory("cydran:behavior:model:input", fn, (0, argumentsBuilder_1.default)().withArgument(0).build());
|
|
11940
12231
|
this.registerSingleton("cydranSegmentDigester", SegmentDigesterImpl_1.default, (0, argumentsBuilder_1.default)().withLogger("cydranSegmentDigester").build());
|
|
11941
12232
|
this.registerPrototype("cydranDigestionState", DigestionStateImpl_1.default, (0, argumentsBuilder_1.default)().with("cydranSegmentDigester").build());
|
|
@@ -12037,6 +12328,7 @@ Message: ${e.message}`);
|
|
|
12037
12328
|
}
|
|
12038
12329
|
disconnectedCallback() {
|
|
12039
12330
|
}
|
|
12331
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12040
12332
|
attributeChangedCallback(name2, oldValue, newValue) {
|
|
12041
12333
|
}
|
|
12042
12334
|
static get observedAttributes() {
|
|
@@ -12060,6 +12352,7 @@ Message: ${e.message}`);
|
|
|
12060
12352
|
}
|
|
12061
12353
|
disconnectedCallback() {
|
|
12062
12354
|
}
|
|
12355
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12063
12356
|
attributeChangedCallback(name2, oldValue, newValue) {
|
|
12064
12357
|
}
|
|
12065
12358
|
static get observedAttributes() {
|
|
@@ -12083,6 +12376,7 @@ Message: ${e.message}`);
|
|
|
12083
12376
|
}
|
|
12084
12377
|
disconnectedCallback() {
|
|
12085
12378
|
}
|
|
12379
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12086
12380
|
attributeChangedCallback(name2, oldValue, newValue) {
|
|
12087
12381
|
}
|
|
12088
12382
|
static get observedAttributes() {
|