@cydran/cydran 0.5.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.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- 0.5.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/>
@@ -273,7 +273,7 @@ var cydran = (() => {
273
273
  return mod && mod.__esModule ? mod : { "default": mod };
274
274
  };
275
275
  Object.defineProperty(exports, "__esModule", { value: true });
276
- 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;
277
277
  var CydranError_1 = __importDefault(require_CydranError());
278
278
  exports.CydranError = CydranError_1.default;
279
279
  var AmbiguousMarkupError = class extends CydranError_1.default {
@@ -486,6 +486,18 @@ var cydran = (() => {
486
486
  }
487
487
  };
488
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;
489
501
  }
490
502
  });
491
503
 
@@ -1576,6 +1588,7 @@ var cydran = (() => {
1576
1588
  exports.forEachField = forEachField;
1577
1589
  exports.removeFromArray = removeFromArray;
1578
1590
  exports.hasMethod = hasMethod;
1591
+ exports.resolveNamedMethod = resolveNamedMethod;
1579
1592
  exports.sanitize = sanitize;
1580
1593
  exports.concat = concat;
1581
1594
  exports.partial = partial;
@@ -1932,6 +1945,14 @@ var cydran = (() => {
1932
1945
  function hasMethod(instance, methodName) {
1933
1946
  return isDefined(instance) && typeof instance[methodName] === "function";
1934
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
+ }
1935
1956
  function partial(fn, position, fixedValue) {
1936
1957
  requireNotNull(fn, "fn");
1937
1958
  requireNotNull(position, "position");
@@ -1995,20 +2016,14 @@ var cydran = (() => {
1995
2016
  }
1996
2017
  });
1997
2018
 
1998
- // dist/src/pattern/GarbageCollectablePairedSetImpl.js
1999
- var require_GarbageCollectablePairedSetImpl = __commonJS({
2000
- "dist/src/pattern/GarbageCollectablePairedSetImpl.js"(exports) {
2019
+ // dist/src/pattern/RefPair.js
2020
+ var require_RefPair = __commonJS({
2021
+ "dist/src/pattern/RefPair.js"(exports) {
2001
2022
  "use strict";
2002
- var __importDefault = exports && exports.__importDefault || function(mod) {
2003
- return mod && mod.__esModule ? mod : { "default": mod };
2004
- };
2005
2023
  Object.defineProperty(exports, "__esModule", { value: true });
2006
2024
  var Utils_1 = require_Utils();
2007
- var PairedWeakMapImpl_1 = __importDefault(require_PairedWeakMapImpl());
2008
2025
  var RefPair = class {
2009
2026
  constructor(first, second) {
2010
- this.first = first;
2011
- this.second = second;
2012
2027
  (0, Utils_1.requireNotNull)(first, "first");
2013
2028
  (0, Utils_1.requireNotNull)(second, "second");
2014
2029
  this.firstRef = new WeakRef(first);
@@ -2017,9 +2032,25 @@ var cydran = (() => {
2017
2032
  deref() {
2018
2033
  const currentFirst = this.firstRef.deref();
2019
2034
  const currentSecond = this.secondRef.deref();
2020
- return currentFirst !== void 0 && currentSecond !== void 0 ? { first: currentFirst, second: currentSecond } : void 0;
2035
+ const missing = !(0, Utils_1.isDefined)(currentFirst) || !(0, Utils_1.isDefined)(currentSecond);
2036
+ return missing ? void 0 : { first: currentFirst, second: currentSecond };
2021
2037
  }
2022
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());
2023
2054
  function createRemovalPredicate(first, second) {
2024
2055
  return (ref) => {
2025
2056
  const current = ref.deref();
@@ -2032,7 +2063,11 @@ var cydran = (() => {
2032
2063
  this.supportDatas = new PairedWeakMapImpl_1.default();
2033
2064
  this.finalizationRegistry = new FinalizationRegistry((supportData) => {
2034
2065
  if ((0, Utils_1.isDefined)(supportData.finalizer)) {
2035
- supportData.finalizer(supportData.metadata);
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
+ }
2036
2071
  }
2037
2072
  });
2038
2073
  }
@@ -2041,7 +2076,7 @@ var cydran = (() => {
2041
2076
  (0, Utils_1.requireNotNull)(secondItem, "secondItem");
2042
2077
  this.remove(firstItem, secondItem);
2043
2078
  this.prune();
2044
- this.items.push(new RefPair(firstItem, secondItem));
2079
+ this.items.push(new RefPair_1.default(firstItem, secondItem));
2045
2080
  const supportData = {
2046
2081
  metadata,
2047
2082
  finalizer
@@ -2072,13 +2107,14 @@ var cydran = (() => {
2072
2107
  this.supportDatas.clear();
2073
2108
  }
2074
2109
  size() {
2110
+ this.prune();
2075
2111
  return this.items.length;
2076
2112
  }
2077
2113
  isEmpty() {
2078
- return this.items.length === 0;
2114
+ return this.size() === 0;
2079
2115
  }
2080
2116
  isPopulated() {
2081
- return this.items.length > 0;
2117
+ return this.size() > 0;
2082
2118
  }
2083
2119
  prune() {
2084
2120
  const removableItems = this.items.filter((i) => !(0, Utils_1.isDefined)(i.deref()));
@@ -2109,17 +2145,25 @@ var cydran = (() => {
2109
2145
  receive(messageName, payload) {
2110
2146
  const callbacksForMessageType = this.callbacks[messageName];
2111
2147
  if ((0, Utils_1.isDefined)(callbacksForMessageType)) {
2112
- callbacksForMessageType.forEach((thisObject, callback) => {
2113
- callback.call(thisObject, payload);
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
+ }
2114
2158
  });
2115
2159
  }
2116
2160
  }
2117
- register(messageName, callback = null) {
2161
+ register(messageName, callback = null, before, after) {
2118
2162
  (0, Utils_1.requireNotNull)(messageName, "messageName");
2119
2163
  if (!(0, Utils_1.isDefined)(this.callbacks[messageName])) {
2120
2164
  this.callbacks[messageName] = new GarbageCollectablePairedSetImpl_1.default();
2121
2165
  }
2122
- this.callbacks[messageName].add(this.thisObjectFn(), callback);
2166
+ this.callbacks[messageName].add(this.thisObjectFn(), callback, { before, after });
2123
2167
  }
2124
2168
  $release() {
2125
2169
  this.callbacks = {};
@@ -2168,19 +2212,19 @@ var cydran = (() => {
2168
2212
  forChannel: (channelName) => {
2169
2213
  (0, Utils_1.requireNotNull)(channelName, "channelName");
2170
2214
  return {
2171
- invoke: (callback) => {
2172
- (0, Utils_1.requireNotNull)(callback, "callback");
2173
- 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);
2174
2218
  }
2175
2219
  };
2176
2220
  },
2177
- invoke: (callback) => {
2178
- (0, Utils_1.requireNotNull)(callback, "callback");
2179
- 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);
2180
2224
  }
2181
2225
  };
2182
2226
  }
2183
- listenTo(channelName, messageName, callback) {
2227
+ listenTo(channelName, messageName, callback, before, after) {
2184
2228
  (0, Utils_1.requireNotNull)(channelName, "channelName");
2185
2229
  (0, Utils_1.requireNotNull)(messageName, "messageName");
2186
2230
  (0, Utils_1.requireNotNull)(callback, "callback");
@@ -2188,7 +2232,7 @@ var cydran = (() => {
2188
2232
  this.listeners[channelName] = new ListenerImpl_1.default(() => this.thisObject);
2189
2233
  }
2190
2234
  const listener = this.listeners[channelName];
2191
- listener.register(messageName, callback);
2235
+ listener.register(messageName, callback, before, after);
2192
2236
  }
2193
2237
  };
2194
2238
  exports.default = ReceiverImpl;
@@ -3197,19 +3241,13 @@ var cydran = (() => {
3197
3241
  forChannel: (channelName) => {
3198
3242
  (0, Utils_1.requireNotNull)(channelName, CHANNEL_NAME);
3199
3243
  return {
3200
- invoke: (callback) => {
3201
- (0, Utils_1.requireNotNull)(callback, "callback");
3202
- this.receiver.on(messageName).forChannel(channelName).invoke((payload) => {
3203
- callback.apply(this, [payload]);
3204
- });
3244
+ invoke: (name2) => {
3245
+ this.receiver.on(messageName).forChannel(channelName).invoke(name2);
3205
3246
  }
3206
3247
  };
3207
3248
  },
3208
- invoke: (callback) => {
3209
- (0, Utils_1.requireNotNull)(callback, "callback");
3210
- this.receiver.on(messageName).forChannel(CydranConstants_1.INTERNAL_CHANNEL_NAME).invoke((payload) => {
3211
- callback.apply(this, [payload]);
3212
- });
3249
+ invoke: (name2) => {
3250
+ this.receiver.on(messageName).forChannel(CydranConstants_1.INTERNAL_CHANNEL_NAME).invoke(name2);
3213
3251
  }
3214
3252
  };
3215
3253
  }
@@ -3367,7 +3405,7 @@ var cydran = (() => {
3367
3405
  this.domListeners = {};
3368
3406
  this.params = null;
3369
3407
  this.id = IdGenerator_1.IdGenerator.generate();
3370
- this.receiver = new ReceiverImpl_1.default(this);
3408
+ this.receiver = new ReceiverImpl_1.default(this.parent);
3371
3409
  if (this.dependencies.el.nodeType === Node.ELEMENT_NODE && this.dependencies.validated) {
3372
3410
  this.tagText = (0, Utils_1.elementAsString)(this.dependencies.el);
3373
3411
  }
@@ -3663,7 +3701,7 @@ var cydran = (() => {
3663
3701
  super.onMount();
3664
3702
  this.onChange(null, this.getMediator().get());
3665
3703
  if (this.isMutable()) {
3666
- this.getMediator().watch(this, this.onChange);
3704
+ this.getMediator().watch(this, "onChange");
3667
3705
  }
3668
3706
  }
3669
3707
  };
@@ -4107,9 +4145,8 @@ Message: ${e.message}`, e);
4107
4145
  this.watchDispatchPending = false;
4108
4146
  }
4109
4147
  }
4110
- watch(thisObject, callback) {
4111
- (0, Utils_1.requireNotNull)(thisObject, "thisObject");
4112
- (0, Utils_1.requireNotNull)(callback, "callback");
4148
+ watch(thisObject, name2) {
4149
+ const callback = (0, Utils_1.resolveNamedMethod)(thisObject, name2);
4113
4150
  this.callbacks.add(thisObject, callback);
4114
4151
  }
4115
4152
  unwatch(thisObject, callback) {
@@ -4517,7 +4554,7 @@ Message: ${e.message}`, e);
4517
4554
  this.logger = logr;
4518
4555
  this.callbacks = new GarbageCollectablePairedSetImpl_1.default();
4519
4556
  this.value = watchable.evaluate(expression);
4520
- watchable.onExpressionValueChange(expression, this.onChange, AsFunctions_1.asIdentity, this);
4557
+ watchable.onExpressionValueChange(expression, this, "onChange", AsFunctions_1.asIdentity);
4521
4558
  }
4522
4559
  onChange(previous, current) {
4523
4560
  this.logger.ifTrace(() => ({
@@ -4778,9 +4815,10 @@ Message: ${e.message}`, e);
4778
4815
  this.filteredItems = [];
4779
4816
  this.phase = phase;
4780
4817
  this.watchable = (0, Utils_1.requireNotNull)(watchable, "watchable");
4781
- this.watcher = (0, Utils_1.requireNotNull)(watcher, "watcher").addCallback(this, () => this.refresh());
4818
+ this.refreshCallback = () => this.refresh();
4819
+ this.watcher = (0, Utils_1.requireNotNull)(watcher, "watcher").addCallback(this, this.refreshCallback);
4782
4820
  this.callbacks = [];
4783
- this.phase.setCallback(() => this.refresh());
4821
+ this.phase.setCallback(this.refreshCallback);
4784
4822
  this.refresh();
4785
4823
  }
4786
4824
  items() {
@@ -5053,9 +5091,8 @@ Message: ${e.message}`, e);
5053
5091
  this.messageName = (0, Utils_1.requireNotNull)(messageName, "messageName");
5054
5092
  this.channelName = (0, Utils_1.requireNotNull)(channelName, "channelName");
5055
5093
  }
5056
- invoke(callback) {
5057
- (0, Utils_1.requireNotNull)(callback, "callback");
5058
- this.internals.on(callback, this.messageName, this.channelName);
5094
+ invoke(name2) {
5095
+ this.internals.on(name2, this.messageName, this.channelName);
5059
5096
  }
5060
5097
  };
5061
5098
  exports.default = ForChannelContinuationImpl;
@@ -5078,9 +5115,8 @@ Message: ${e.message}`, e);
5078
5115
  this.internals = (0, Utils_1.requireNotNull)(internals, "internals");
5079
5116
  this.messageName = (0, Utils_1.requireNotNull)(messageName, "messageName");
5080
5117
  }
5081
- invoke(callback) {
5082
- (0, Utils_1.requireNotNull)(callback, "callback");
5083
- 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);
5084
5120
  }
5085
5121
  forChannel(channelName) {
5086
5122
  return new ForChannelContinuationImpl_1.default(this.internals, this.messageName, channelName);
@@ -5136,15 +5172,38 @@ Message: ${e.message}`, e);
5136
5172
  this.internals = (0, Utils_1.requireNotNull)(internals, "internals");
5137
5173
  this.delay = (0, Utils_1.requireNotNull)(delay, "delay");
5138
5174
  }
5139
- invoke(callback) {
5140
- (0, Utils_1.requireNotNull)(callback, "callback");
5141
- this.internals.addInterval(callback, this.delay);
5175
+ invoke(name2) {
5176
+ this.internals.addInterval(name2, this.delay);
5142
5177
  }
5143
5178
  };
5144
5179
  exports.default = IntervalContinuationImpl;
5145
5180
  }
5146
5181
  });
5147
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
+
5148
5207
  // dist/src/continuation/ActionContinuationImpl.js
5149
5208
  var require_ActionContinuationImpl = __commonJS({
5150
5209
  "dist/src/continuation/ActionContinuationImpl.js"(exports) {
@@ -5158,16 +5217,19 @@ Message: ${e.message}`, e);
5158
5217
  var OnContinuationImpl_1 = __importDefault(require_OnContinuationImpl());
5159
5218
  var SendContinuationImpl_1 = __importDefault(require_SendContinuationImpl());
5160
5219
  var IntervalContinuationImpl_1 = __importDefault(require_IntervalContinuationImpl());
5220
+ var WatchContinuationImpl_1 = __importDefault(require_WatchContinuationImpl());
5221
+ var Errors_1 = require_Errors();
5161
5222
  var ActionContinuationImpl = class {
5162
- constructor(component, internals) {
5223
+ constructor(component, internals, readySupplier) {
5163
5224
  this.component = (0, Utils_1.requireNotNull)(component, "component");
5164
5225
  this.internals = (0, Utils_1.requireNotNull)(internals, "internals");
5226
+ this.readySupplier = (0, Utils_1.requireNotNull)(readySupplier, "readySupplier");
5165
5227
  }
5166
5228
  getContext() {
5167
5229
  return this.internals.getContext();
5168
5230
  }
5169
- onExpressionValueChange(expression, callback, reducerFn, thisObject) {
5170
- this.internals.watch(expression, callback, reducerFn, thisObject);
5231
+ onExpressionValueChange(expression) {
5232
+ return new WatchContinuationImpl_1.default(this.internals, this.component, (0, Utils_1.requireNotNull)(expression, "expression"));
5171
5233
  }
5172
5234
  onMessage(messageName) {
5173
5235
  return new OnContinuationImpl_1.default(this.internals, messageName);
@@ -5179,21 +5241,26 @@ Message: ${e.message}`, e);
5179
5241
  return new SendContinuationImpl_1.default(this.internals, messageName, payload, startFrom);
5180
5242
  }
5181
5243
  createFilter(expression) {
5182
- return this.internals.withFilter(this.component.$c(), (0, Utils_1.requireNotNull)(expression, "expression"));
5244
+ return this.internals.withFilter((0, Utils_1.requireNotNull)(expression, "expression"));
5183
5245
  }
5184
5246
  regions() {
5247
+ this.guardReady();
5185
5248
  return new RegionContinuationImpl_1.default(this.internals);
5186
5249
  }
5187
5250
  forSeries(name2) {
5251
+ this.guardReady();
5188
5252
  return this.internals.forSeries(name2);
5189
5253
  }
5190
5254
  forElement(name2) {
5255
+ this.guardReady();
5191
5256
  return this.internals.forElement(name2);
5192
5257
  }
5193
5258
  forForm(name2) {
5259
+ this.guardReady();
5194
5260
  return this.internals.forForm(name2);
5195
5261
  }
5196
5262
  forForms() {
5263
+ this.guardReady();
5197
5264
  return this.internals.forForms();
5198
5265
  }
5199
5266
  /**
@@ -5233,10 +5300,8 @@ Message: ${e.message}`, e);
5233
5300
  getLogger() {
5234
5301
  return this.internals.getLogger();
5235
5302
  }
5236
- getWatchScope() {
5237
- return this.internals.getWatchScope();
5238
- }
5239
5303
  properties() {
5304
+ this.guardReady();
5240
5305
  return this.internals.getContext().getProperties();
5241
5306
  }
5242
5307
  getId() {
@@ -5254,6 +5319,11 @@ Message: ${e.message}`, e);
5254
5319
  getValue() {
5255
5320
  return this.internals.getData();
5256
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
+ }
5257
5327
  };
5258
5328
  exports.default = ActionContinuationImpl;
5259
5329
  }
@@ -5462,6 +5532,7 @@ Message: ${e.message}`, e);
5462
5532
  var VALID_PREFIX_REGEX = /^([a-z]+-)*[a-z]+$/;
5463
5533
  var ComponentInternalsImpl = class {
5464
5534
  constructor(component, template, options) {
5535
+ this.ready = false;
5465
5536
  this.template = (0, Utils_1.requireNotNull)(template, CydranConstants_1.TagNames.TEMPLATE);
5466
5537
  this.component = (0, Utils_1.requireNotNull)(component, "component");
5467
5538
  this.context = null;
@@ -5560,6 +5631,7 @@ Message: ${e.message}`, e);
5560
5631
  this.behaviors.setContext(this.getContext());
5561
5632
  this.tellBehaviors(ComponentTransitions_1.default.MOUNT);
5562
5633
  this.tellMediators(MediatorTransitions_1.default.MOUNT);
5634
+ this.ready = true;
5563
5635
  this.component.onMount();
5564
5636
  this.intervals.enable();
5565
5637
  }
@@ -5669,17 +5741,15 @@ Message: ${e.message}`, e);
5669
5741
  getScope() {
5670
5742
  return this.scope;
5671
5743
  }
5672
- watch(expression, callback, reducerFn, thisObject) {
5744
+ watch(expression, thisObject, name2, reducerFn) {
5673
5745
  (0, Utils_1.requireNotNull)(expression, "expression");
5674
- (0, Utils_1.requireNotNull)(callback, "callback");
5675
- const actualThisObject = (0, Utils_1.isDefined)(thisObject) ? thisObject : this.component;
5676
- this.mediate(expression, reducerFn).watch(actualThisObject, callback);
5746
+ this.mediate(expression, reducerFn).watch(thisObject, name2);
5677
5747
  }
5678
- on(callback, messageName, channel) {
5679
- this.receiver.on(messageName).forChannel(channel || CydranConstants_1.INTERNAL_CHANNEL_NAME).invoke((payload) => {
5680
- callback.apply(this.component, [payload]);
5681
- this.sync();
5682
- });
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());
5683
5753
  }
5684
5754
  getName() {
5685
5755
  return this.options.name;
@@ -5819,16 +5889,16 @@ Message: ${e.message}`, e);
5819
5889
  addForm(form) {
5820
5890
  this.forms.push(form);
5821
5891
  }
5822
- withFilter(watchable, expression) {
5823
- (0, Utils_1.requireNotNull)(watchable, "watchable");
5892
+ withFilter(expression) {
5824
5893
  (0, Utils_1.requireNotNull)(expression, "expression");
5825
- const watcher = new WatcherImpl_1.default(watchable, expression, (0, getLogger_1.default)(`watcher-${this.id}`, `Watcher: ${expression}`));
5826
- return new FilterBuilderImpl_1.default(watchable, watcher);
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);
5827
5896
  }
5828
5897
  $c() {
5829
- return new ActionContinuationImpl_1.default(this.component, this);
5898
+ return new ActionContinuationImpl_1.default(this.component, this, () => this.ready);
5830
5899
  }
5831
- addInterval(callback, delay) {
5900
+ addInterval(name2, delay) {
5901
+ const callback = (0, Utils_1.resolveNamedMethod)(this.component, name2);
5832
5902
  this.intervals.add(callback, delay);
5833
5903
  }
5834
5904
  postConstruct() {
@@ -5976,6 +6046,7 @@ Message: ${e.message}`, e);
5976
6046
  * @param options - optional {@link ComponentOptions} argument
5977
6047
  */
5978
6048
  constructor(template, options) {
6049
+ this.____internal$$cydran____ = null;
5979
6050
  this.____internal$$cydran$$init____(template, options);
5980
6051
  }
5981
6052
  setContext(context) {
@@ -6470,8 +6541,8 @@ Message: ${e.message}`, e);
6470
6541
  this.name = (0, Utils_1.requireValid)(name2, "name", CydranConstants_1.PROPERTY_KEY);
6471
6542
  }
6472
6543
  resolve(context) {
6473
- const subscriber = (thisObject, callback) => {
6474
- context.getProperties().addPropertyObserver(this.name, thisObject, callback);
6544
+ const subscriber = (thisObject, name2) => {
6545
+ context.getProperties().addPropertyObserver(this.name, thisObject, name2);
6475
6546
  };
6476
6547
  return subscriber;
6477
6548
  }
@@ -6533,8 +6604,8 @@ Message: ${e.message}`, e);
6533
6604
  this.prefix = prefix;
6534
6605
  }
6535
6606
  resolve(context) {
6536
- const subscriber = (thisObject, callback) => {
6537
- context.getProperties().addFallbackObserver(thisObject, callback, this.preferredKey, this.prefix);
6607
+ const subscriber = (thisObject, name2) => {
6608
+ context.getProperties().addFallbackObserver(thisObject, name2, this.preferredKey, this.prefix);
6538
6609
  };
6539
6610
  return subscriber;
6540
6611
  }
@@ -7339,9 +7410,9 @@ Message: ${e.message}`, e);
7339
7410
  this.allowSuppression = false;
7340
7411
  const contextNameSegment = context.isRoot() ? "" : "." + context.getFullName();
7341
7412
  const propertyPrefix = LOGGER_NAME_PREFIX + contextNameSegment + "." + this.key + ".";
7342
- this.initObservation(propertyPrefix, "allowSupressDefaultAppender", this.updateAllowSupressDefaultAppender, this.onAllowSupressDefaultAppenderChange);
7343
- this.initObservation(propertyPrefix, "appenders", this.updateAppenders, this.onAppendersChange);
7344
- this.initObservation(propertyPrefix, "level", this.updateStrategy, this.onLevelChange);
7413
+ this.initObservation(propertyPrefix, "allowSupressDefaultAppender", this.updateAllowSupressDefaultAppender, "onAllowSupressDefaultAppenderChange");
7414
+ this.initObservation(propertyPrefix, "appenders", this.updateAppenders, "onAppendersChange");
7415
+ this.initObservation(propertyPrefix, "level", this.updateStrategy, "onLevelChange");
7345
7416
  }
7346
7417
  getKey() {
7347
7418
  return this.key;
@@ -7406,9 +7477,9 @@ Message: ${e.message}`, e);
7406
7477
  getLevel() {
7407
7478
  return this.strategy.getLevel();
7408
7479
  }
7409
- initObservation(prefix, key, updateMethod, callback) {
7480
+ initObservation(prefix, key, updateMethod, callbackName) {
7410
7481
  const preferred = prefix + key;
7411
- this.properties.addFallbackObserver(this, callback, preferred, "cydran.logging");
7482
+ this.properties.addFallbackObserver(this, callbackName, preferred, "cydran.logging");
7412
7483
  const value = this.properties.getWithFallback(preferred);
7413
7484
  updateMethod.call(this, value);
7414
7485
  }
@@ -8160,7 +8231,7 @@ Message: ${e.message}`, e);
8160
8231
  }
8161
8232
  mirror(source) {
8162
8233
  (0, Utils_1.requireNotNull)(source, "source");
8163
- source.addObserver(this, (key, value) => this.set(key, value));
8234
+ source.addObserver(this, "set");
8164
8235
  return this;
8165
8236
  }
8166
8237
  lock(...keys) {
@@ -8204,8 +8275,8 @@ Message: ${e.message}`, e);
8204
8275
  (0, Utils_1.requireValid)(key, "key", CydranConstants_1.PROPERTY_KEY);
8205
8276
  return this.pins.contains(key);
8206
8277
  }
8207
- addGlobalObserver(thisObject, callback, preferredKey, prefix) {
8208
- (0, Utils_1.requireNotNull)(callback, "callback");
8278
+ addGlobalObserver(thisObject, name2, preferredKey, prefix) {
8279
+ const callback = (0, Utils_1.resolveNamedMethod)(thisObject, name2);
8209
8280
  let predicate = null;
8210
8281
  let mapper = null;
8211
8282
  const fallbackMapper = (key) => this.getWithFallback(key, prefix);
@@ -8214,32 +8285,32 @@ Message: ${e.message}`, e);
8214
8285
  predicate = new PropertyGeneralizationPredicate_1.default(preferredKey, prefix, existsPredicate).getPredicate();
8215
8286
  mapper = new PropertyGeneralizationMapper_1.default(preferredKey, prefix, fallbackMapper).getMapper();
8216
8287
  }
8217
- this.observers.register((0, Utils_1.defaulted)(thisObject, {}), callback, predicate, mapper);
8288
+ this.observers.register(thisObject, callback, predicate, mapper);
8218
8289
  }
8219
- removeGlobalObserver(thisObject, callback) {
8220
- (0, Utils_1.requireNotNull)(callback, "callback");
8290
+ removeGlobalObserver(thisObject, name2) {
8291
+ const callback = (0, Utils_1.resolveNamedMethod)(thisObject, name2);
8221
8292
  this.observers.unregister(thisObject, callback);
8222
8293
  }
8223
- addObserver(thisObject, callback) {
8224
- this.addGlobalObserver(thisObject, callback, null, null);
8294
+ addObserver(thisObject, name2) {
8295
+ this.addGlobalObserver(thisObject, name2, null, null);
8225
8296
  }
8226
- removeObserver(thisObject, callback) {
8227
- this.removeGlobalObserver(thisObject, callback);
8297
+ removeObserver(thisObject, name2) {
8298
+ this.removeGlobalObserver(thisObject, name2);
8228
8299
  }
8229
- addFallbackObserver(thisObject, callback, preferredKey, prefix) {
8230
- this.addGlobalObserver(thisObject, callback, preferredKey, prefix);
8300
+ addFallbackObserver(thisObject, name2, preferredKey, prefix) {
8301
+ this.addGlobalObserver(thisObject, name2, preferredKey, prefix);
8231
8302
  }
8232
- removeFallbackObserver(thisObject, callback) {
8233
- this.removeGlobalObserver(thisObject, callback);
8303
+ removeFallbackObserver(thisObject, name2) {
8304
+ this.removeGlobalObserver(thisObject, name2);
8234
8305
  }
8235
- addPropertyObserver(key, thisObject, callback) {
8306
+ addPropertyObserver(key, thisObject, name2) {
8236
8307
  (0, Utils_1.requireValid)(key, "key", CydranConstants_1.PROPERTY_KEY);
8237
- (0, Utils_1.requireNotNull)(callback, "callback");
8238
- this.propertyObservers.computeIfAbsent(key, () => new ObservableImpl_1.default()).register((0, Utils_1.defaulted)(thisObject, {}), callback);
8308
+ const callback = (0, Utils_1.resolveNamedMethod)(thisObject, name2);
8309
+ this.propertyObservers.computeIfAbsent(key, () => new ObservableImpl_1.default()).register(thisObject, callback);
8239
8310
  }
8240
- removePropertyObserver(key, thisObject, callback) {
8311
+ removePropertyObserver(key, thisObject, name2) {
8241
8312
  (0, Utils_1.requireValid)(key, "key", CydranConstants_1.PROPERTY_KEY);
8242
- (0, Utils_1.requireNotNull)(callback, "callback");
8313
+ const callback = (0, Utils_1.resolveNamedMethod)(thisObject, name2);
8243
8314
  this.propertyObservers.computeIfAbsent(key, () => new ObservableImpl_1.default()).unregister(thisObject, callback);
8244
8315
  }
8245
8316
  load(values) {
@@ -8322,7 +8393,7 @@ Message: ${e.message}`, e);
8322
8393
  this.parent = (0, Utils_1.requireNotNull)(parent, "parent");
8323
8394
  this.localValues = new AdvancedMapImpl_1.default();
8324
8395
  this.effectiveValues = new AdvancedMapImpl_1.default();
8325
- this.parent.addObserver({}, (key) => this.reevaluateProperty(key));
8396
+ this.parent.addObserver(this, "reevaluateProperty");
8326
8397
  this.sync();
8327
8398
  }
8328
8399
  clear() {
@@ -8405,7 +8476,7 @@ Message: ${e.message}`, e);
8405
8476
  var ArgumentResolversBuilderImpl_1 = __importDefault(require_ArgumentResolversBuilderImpl());
8406
8477
  var ContextAwarePostProcessor_1 = __importDefault(require_ContextAwarePostProcessor());
8407
8478
  var EMPTY_ARGUMENT_RESOLVERS = new ArgumentResolversBuilderImpl_1.default().build();
8408
- var FactoryAlternativeImpl = class {
8479
+ var FactoryImpl = class {
8409
8480
  constructor(config, creator, cache, resolvers, localResolution) {
8410
8481
  this.creator = (0, Utils_1.requireNotNull)(creator, "creator");
8411
8482
  this.cache = (0, Utils_1.requireNotNull)(cache, "cache");
@@ -8436,7 +8507,7 @@ Message: ${e.message}`, e);
8436
8507
  return this.config;
8437
8508
  }
8438
8509
  };
8439
- exports.default = FactoryAlternativeImpl;
8510
+ exports.default = FactoryImpl;
8440
8511
  }
8441
8512
  });
8442
8513
 
@@ -8701,25 +8772,21 @@ Message: ${e.message}`, e);
8701
8772
  var require_InitializersImpl = __commonJS({
8702
8773
  "dist/src/context/InitializersImpl.js"(exports) {
8703
8774
  "use strict";
8704
- var __importDefault = exports && exports.__importDefault || function(mod) {
8705
- return mod && mod.__esModule ? mod : { "default": mod };
8706
- };
8707
8775
  Object.defineProperty(exports, "__esModule", { value: true });
8708
- var GarbageCollectablePairedSetImpl_1 = __importDefault(require_GarbageCollectablePairedSetImpl());
8709
8776
  var Utils_1 = require_Utils();
8710
8777
  var InitializersImpl = class {
8711
8778
  constructor() {
8712
- this.callbacks = new GarbageCollectablePairedSetImpl_1.default();
8779
+ this.callbacks = [];
8713
8780
  }
8714
8781
  add(thisObject, callback) {
8715
8782
  (0, Utils_1.requireNotNull)(callback, "callback");
8716
- this.callbacks.add((0, Utils_1.defaulted)(thisObject, {}), callback);
8783
+ this.callbacks.push({ thisObject: (0, Utils_1.defaulted)(thisObject, {}), callback });
8717
8784
  }
8718
8785
  execute(context) {
8719
- this.callbacks.forEach((thisObject, callback) => {
8720
- callback.call(thisObject, context);
8721
- });
8722
- this.callbacks.clear();
8786
+ for (const registration of this.callbacks) {
8787
+ registration.callback.call(registration.thisObject, context);
8788
+ }
8789
+ this.callbacks = [];
8723
8790
  }
8724
8791
  };
8725
8792
  exports.default = InitializersImpl;
@@ -8924,15 +8991,12 @@ Message: ${e.message}`, e);
8924
8991
  getContext() {
8925
8992
  throw new Error("Method not implemented.");
8926
8993
  }
8927
- onExpressionValueChange(expression, callback, reducerFn, thisObject) {
8994
+ onExpressionValueChange(expression) {
8928
8995
  throw new Error("Method not implemented.");
8929
8996
  }
8930
8997
  evaluate(expression) {
8931
8998
  throw new Error("Method not implemented.");
8932
8999
  }
8933
- getWatchScope() {
8934
- throw new Error("Method not implemented.");
8935
- }
8936
9000
  };
8937
9001
  var AnonymousParentNestable = class {
8938
9002
  constructor() {
@@ -9585,11 +9649,14 @@ Message: ${e.message}`, e);
9585
9649
  var RegionBehavior = class extends AbstractContainerBehavior_1.default {
9586
9650
  constructor(parent) {
9587
9651
  super();
9652
+ this.element = null;
9653
+ this.name = null;
9588
9654
  this.itemFn = null;
9589
9655
  this.component = null;
9590
9656
  this.parent = parent;
9591
9657
  this.expression = null;
9592
9658
  this.locked = false;
9659
+ this.dependencies = null;
9593
9660
  this.setDefaults(DEFAULT_ATTRIBUTES);
9594
9661
  this.setValidations({
9595
9662
  lock: [Validations_1.validateDefined],
@@ -10000,7 +10067,7 @@ Message: ${e.message}`, e);
10000
10067
  onMount() {
10001
10068
  this.getEl().textContent = this.getMediator().get();
10002
10069
  if (this.isMutable()) {
10003
- this.getMediator().watch(this, this.onChange);
10070
+ this.getMediator().watch(this, "onChange");
10004
10071
  }
10005
10072
  }
10006
10073
  onChange(previous, current) {
@@ -10143,7 +10210,7 @@ Message: ${e.message}`, e);
10143
10210
  onMount() {
10144
10211
  this.getEl().setAttribute(this.attributeName, this.getMediator().get());
10145
10212
  if (this.isMutable()) {
10146
- this.getMediator().watch(this, this.onChange);
10213
+ this.getMediator().watch(this, "onChange");
10147
10214
  }
10148
10215
  }
10149
10216
  onChange(previous, current) {
@@ -10172,7 +10239,7 @@ Message: ${e.message}`, e);
10172
10239
  }
10173
10240
  onInit() {
10174
10241
  this.bridge(this.eventKey);
10175
- this.on(this.eventKey).forChannel(CydranConstants_1.DOM_KEY).invoke(this.handleEvent);
10242
+ this.on(this.eventKey).forChannel(CydranConstants_1.DOM_KEY).invoke("handleEvent");
10176
10243
  }
10177
10244
  handleEvent(event) {
10178
10245
  this.invoke({ $event: event });
@@ -10200,7 +10267,7 @@ Message: ${e.message}`, e);
10200
10267
  }
10201
10268
  onInit() {
10202
10269
  this.bridge(CydranConstants_1.RESET_KEY);
10203
- this.on(CydranConstants_1.RESET_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke(this.onReset);
10270
+ this.on(CydranConstants_1.RESET_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke("onReset");
10204
10271
  }
10205
10272
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
10206
10273
  onReset(event) {
@@ -10567,16 +10634,18 @@ Message: ${e.message}`, e);
10567
10634
  super();
10568
10635
  this.setReducerFn(AsFunctions_1.asBoolean);
10569
10636
  this.setDefaultExpression("true");
10637
+ this.shouldFocus = false;
10638
+ this.operations = null;
10570
10639
  }
10571
10640
  onInit() {
10572
10641
  this.bridge("focusout");
10573
- this.on("focusout").forChannel(CydranConstants_1.DOM_KEY).invoke(() => this.handleFocus());
10642
+ this.on("focusout").forChannel(CydranConstants_1.DOM_KEY).invoke("handleFocus");
10574
10643
  this.operations = new ElementOperationsImpl_1.default(this.getEl());
10575
10644
  }
10576
10645
  onMount() {
10577
10646
  this.shouldFocus = this.getMediator().get();
10578
10647
  if (this.isMutable()) {
10579
- this.getMediator().watch(this, this.onChange);
10648
+ this.getMediator().watch(this, "onChange");
10580
10649
  }
10581
10650
  this.handleFocus();
10582
10651
  }
@@ -10612,12 +10681,12 @@ Message: ${e.message}`, e);
10612
10681
  }
10613
10682
  onInit() {
10614
10683
  this.bridge(CydranConstants_1.INPUT_KEY);
10615
- this.on(CydranConstants_1.INPUT_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke(this.onInput);
10684
+ this.on(CydranConstants_1.INPUT_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke("onInput");
10616
10685
  this.bridge(CydranConstants_1.BEHAVIOR_FORM_RESET);
10617
- this.on(CydranConstants_1.BEHAVIOR_FORM_RESET).forChannel(CydranConstants_1.DOM_KEY).invoke((event) => this.onReset(event));
10686
+ this.on(CydranConstants_1.BEHAVIOR_FORM_RESET).forChannel(CydranConstants_1.DOM_KEY).invoke("onReset");
10618
10687
  }
10619
10688
  onMount() {
10620
- this.getMediator().watch(this, this.onChange);
10689
+ this.getMediator().watch(this, "onChange");
10621
10690
  this.onChange(null, this.getMediator().get());
10622
10691
  }
10623
10692
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -10809,6 +10878,20 @@ Message: ${e.message}`, e);
10809
10878
  }
10810
10879
  return result;
10811
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
+ }
10812
10895
  idsSame(ids) {
10813
10896
  return (0, Utils_1.equals)(10, this.state.getIds(), ids);
10814
10897
  }
@@ -10861,6 +10944,7 @@ Message: ${e.message}`, e);
10861
10944
  refresh(items) {
10862
10945
  this.enrich(items);
10863
10946
  const newIds = this.extract(items);
10947
+ this.updateReusedItems(items);
10864
10948
  if (this.idsSame(newIds)) {
10865
10949
  this.getState().setIds(newIds);
10866
10950
  return;
@@ -11422,6 +11506,7 @@ Message: ${e.message}`);
11422
11506
  refresh(items) {
11423
11507
  this.enrich(items);
11424
11508
  const newIds = this.extract(items);
11509
+ this.updateReusedItems(items);
11425
11510
  if (this.idsSame(newIds)) {
11426
11511
  this.getState().setIds(newIds);
11427
11512
  return;
@@ -11523,7 +11608,7 @@ Message: ${e.message}`);
11523
11608
  this.parseChildElements();
11524
11609
  this.initChildElements(this.getMediator().get());
11525
11610
  if (this.isMutable()) {
11526
- this.getMediator().watch(this, this.onChange);
11611
+ this.getMediator().watch(this, "onChange");
11527
11612
  }
11528
11613
  this.state.mount();
11529
11614
  }
@@ -11628,23 +11713,24 @@ Message: ${e.message}`);
11628
11713
  var MultiSelectValueModel = class extends AbstractBehavior_1.default {
11629
11714
  onInit() {
11630
11715
  this.bridge(CydranConstants_1.INPUT_KEY);
11631
- this.on(CydranConstants_1.INPUT_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke(this.onInput);
11716
+ this.on(CydranConstants_1.INPUT_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke("onInput");
11632
11717
  this.bridge(CydranConstants_1.CHANGE_KEY);
11633
- this.on(CydranConstants_1.CHANGE_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke(this.onInput);
11718
+ this.on(CydranConstants_1.CHANGE_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke("onInput");
11634
11719
  this.bridge(CydranConstants_1.BEHAVIOR_FORM_RESET);
11635
- this.on(CydranConstants_1.BEHAVIOR_FORM_RESET).forChannel(CydranConstants_1.DOM_KEY).invoke((event) => this.onReset(event));
11720
+ this.on(CydranConstants_1.BEHAVIOR_FORM_RESET).forChannel(CydranConstants_1.DOM_KEY).invoke("onReset");
11636
11721
  }
11637
11722
  onMount() {
11638
11723
  this.onChange(null, this.getMediator().get());
11639
- this.getMediator().watch(this, this.onChange);
11724
+ this.getMediator().watch(this, "onChange");
11640
11725
  this.onChange(null, this.getMediator().get());
11641
11726
  }
11642
11727
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
11643
11728
  onInput(event) {
11729
+ var _a, _b, _c;
11644
11730
  if (this.getEl().multiple) {
11645
11731
  const selectedValues = [];
11646
11732
  for (let i = 0; i < this.getEl().selectedOptions.length; i++) {
11647
- 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);
11648
11734
  selectedValues.push(optValue);
11649
11735
  }
11650
11736
  this.getMediator().set(selectedValues);
@@ -11763,15 +11849,15 @@ Message: ${e.message}`);
11763
11849
  }
11764
11850
  onInit() {
11765
11851
  this.bridge(CydranConstants_1.INPUT_KEY);
11766
- this.on(CydranConstants_1.INPUT_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke((event) => this.onInput(event));
11852
+ this.on(CydranConstants_1.INPUT_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke("onInput");
11767
11853
  this.bridge(CydranConstants_1.CHANGE_KEY);
11768
- this.on(CydranConstants_1.CHANGE_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke((event) => this.onInput(event));
11854
+ this.on(CydranConstants_1.CHANGE_KEY).forChannel(CydranConstants_1.DOM_KEY).invoke("onInput");
11769
11855
  this.bridge(CydranConstants_1.BEHAVIOR_FORM_RESET);
11770
- this.on(CydranConstants_1.BEHAVIOR_FORM_RESET).forChannel(CydranConstants_1.DOM_KEY).invoke((event) => this.onReset(event));
11856
+ this.on(CydranConstants_1.BEHAVIOR_FORM_RESET).forChannel(CydranConstants_1.DOM_KEY).invoke("onReset");
11771
11857
  this.onInitElement(this.getEl());
11772
11858
  }
11773
11859
  onMount() {
11774
- this.getMediator().watch(this, this.onChange);
11860
+ this.getMediator().watch(this, "onChange");
11775
11861
  this.onChange(null, this.getMediator().get());
11776
11862
  }
11777
11863
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -12137,7 +12223,10 @@ Message: ${e.message}`);
12137
12223
  return new ScopeImpl_1.default().extend();
12138
12224
  }
12139
12225
  init() {
12140
- const fn = (el) => (0, Utils_1.isDefined)(el.type) && el.type.toLowerCase() === "radio" ? new RadioModelBehavior_1.default() : new ValuedModelBehavior_1.default();
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
+ };
12141
12230
  this.registerPrototypeWithFactory("cydran:behavior:model:input", fn, (0, argumentsBuilder_1.default)().withArgument(0).build());
12142
12231
  this.registerSingleton("cydranSegmentDigester", SegmentDigesterImpl_1.default, (0, argumentsBuilder_1.default)().withLogger("cydranSegmentDigester").build());
12143
12232
  this.registerPrototype("cydranDigestionState", DigestionStateImpl_1.default, (0, argumentsBuilder_1.default)().with("cydranSegmentDigester").build());