cx 24.3.8 → 24.3.10

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/ui.js CHANGED
@@ -12,6 +12,8 @@ import {
12
12
  getSelector,
13
13
  Binding,
14
14
  ZoomIntoPropertyView,
15
+ setGetExpressionCacheCallback,
16
+ setGetStringTemplateCacheCallback,
15
17
  isAccessorChain,
16
18
  SubscribableView,
17
19
  Store,
@@ -41,6 +43,7 @@ import {
41
43
  closestParent,
42
44
  Format as Format$1,
43
45
  resolveMinMaxFractionDigits,
46
+ setGetFormatCacheCallback,
44
47
  isNonEmptyArray,
45
48
  debug,
46
49
  processDataFlag,
@@ -80,7 +83,7 @@ function _toPrimitive(t, r) {
80
83
  }
81
84
  function _toPropertyKey(t) {
82
85
  var i = _toPrimitive(t, "string");
83
- return "symbol" == typeof i ? i : String(i);
86
+ return "symbol" == typeof i ? i : i + "";
84
87
  }
85
88
  function _defineProperties(target, props) {
86
89
  for (var i = 0; i < props.length; i++) {
@@ -129,20 +132,14 @@ function _setPrototypeOf(o, p) {
129
132
  };
130
133
  return _setPrototypeOf(o, p);
131
134
  }
132
- function _assertThisInitialized(self) {
133
- if (self === void 0) {
134
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
135
- }
136
- return self;
137
- }
138
135
 
139
136
  var computablePrefix = "computable-";
140
137
  var triggerPrefix = "trigger-";
141
138
  var Controller = /*#__PURE__*/ (function (_Component) {
142
- _inheritsLoose(Controller, _Component);
143
139
  function Controller() {
144
140
  return _Component.apply(this, arguments) || this;
145
141
  }
142
+ _inheritsLoose(Controller, _Component);
146
143
  var _proto = Controller.prototype;
147
144
  _proto.init = function init(context) {
148
145
  if (!this.initialized) {
@@ -345,7 +342,6 @@ var VDOM$1 = VDOM$2;
345
342
  var VDOM = VDOM$1;
346
343
  var widgetId = 100;
347
344
  var Widget = /*#__PURE__*/ (function (_Component) {
348
- _inheritsLoose(Widget, _Component);
349
345
  function Widget(config) {
350
346
  var _this;
351
347
  _this = _Component.call(this, config) || this;
@@ -361,6 +357,7 @@ var Widget = /*#__PURE__*/ (function (_Component) {
361
357
  }
362
358
  return _this;
363
359
  }
360
+ _inheritsLoose(Widget, _Component);
364
361
  var _proto = Widget.prototype;
365
362
  _proto.init = function init() {
366
363
  if (this.styles) this.style = this.styles;
@@ -497,10 +494,10 @@ function getContent(x) {
497
494
  }
498
495
 
499
496
  var StaticText = /*#__PURE__*/ (function (_Widget) {
500
- _inheritsLoose(StaticText, _Widget);
501
497
  function StaticText() {
502
498
  return _Widget.apply(this, arguments) || this;
503
499
  }
500
+ _inheritsLoose(StaticText, _Widget);
504
501
  var _proto = StaticText.prototype;
505
502
  _proto.render = function render() {
506
503
  return this.text;
@@ -510,10 +507,10 @@ var StaticText = /*#__PURE__*/ (function (_Widget) {
510
507
  Widget.alias("static-text", StaticText);
511
508
 
512
509
  var Text = /*#__PURE__*/ (function (_Widget) {
513
- _inheritsLoose(Text, _Widget);
514
510
  function Text() {
515
511
  return _Widget.apply(this, arguments) || this;
516
512
  }
513
+ _inheritsLoose(Text, _Widget);
517
514
  var _proto = Text.prototype;
518
515
  _proto.init = function init() {
519
516
  if (!this.value && (this.tpl || this.expr || this.bind))
@@ -576,10 +573,10 @@ function exploreChildren(context, instance, children, previousResult, key, store
576
573
  }
577
574
 
578
575
  var Container = /*#__PURE__*/ (function (_Widget) {
579
- _inheritsLoose(Container, _Widget);
580
576
  function Container() {
581
577
  return _Widget.apply(this, arguments) || this;
582
578
  }
579
+ _inheritsLoose(Container, _Widget);
583
580
  var _proto = Container.prototype;
584
581
  _proto.init = function init(context) {
585
582
  if (typeof this.ws !== "undefined") this.preserveWhitespace = this.ws;
@@ -733,20 +730,20 @@ Container.prototype.plainText = true;
733
730
  Container.prototype.styled = false;
734
731
 
735
732
  var PureContainer = /*#__PURE__*/ (function (_Container) {
736
- _inheritsLoose(PureContainer, _Container);
737
733
  function PureContainer() {
738
734
  return _Container.apply(this, arguments) || this;
739
735
  }
736
+ _inheritsLoose(PureContainer, _Container);
740
737
  return PureContainer;
741
738
  })(Container);
742
739
  PureContainer.prototype.isPureContainer = true;
743
740
  PureContainer.alias("pure-container", PureContainer);
744
741
 
745
742
  var DataAdapter = /*#__PURE__*/ (function (_Component) {
746
- _inheritsLoose(DataAdapter, _Component);
747
743
  function DataAdapter() {
748
744
  return _Component.apply(this, arguments) || this;
749
745
  }
746
+ _inheritsLoose(DataAdapter, _Component);
750
747
  var _proto = DataAdapter.prototype;
751
748
  _proto.getRecords = function getRecords() {
752
749
  throw new Error("Abstract method");
@@ -817,34 +814,84 @@ var Localization = /*#__PURE__*/ (function () {
817
814
  return Localization;
818
815
  })();
819
816
 
820
- var culture = "en";
821
- var numberCulture = null;
822
- var dateTimeCulture = null;
823
- var cultureCache = {};
824
- var defaultCurrency = "USD";
825
- var dateEncoding = function dateEncoding(date) {
826
- return date.toISOString();
827
- };
817
+ // let culture = "en";
818
+ // let numberCulture = null;
819
+ // let dateTimeCulture = null;
820
+ // let cache = {};
821
+ // let defaultCurrency = "USD";
822
+ // let dateEncoding = (date) => date.toISOString();
823
+
824
+ var stack = [
825
+ {
826
+ culture: "en",
827
+ numberCulture: null,
828
+ dateTimeCulture: null,
829
+ cache: {},
830
+ defaultCurrency: "USD",
831
+ dateEncoding: function dateEncoding(date) {
832
+ return date.toISOString();
833
+ },
834
+ },
835
+ ];
836
+ function getRootCultureSpecs() {
837
+ return stack[0];
838
+ }
839
+ function getCurrentCultureSpecs() {
840
+ return stack[stack.length - 1];
841
+ }
842
+ function getCurrentCultureCache() {
843
+ return getCurrentCultureSpecs().cache;
844
+ }
845
+ function pushCulture(cultureInfo) {
846
+ stack.push(cultureInfo);
847
+ }
848
+ function createCulture(cultureSpecs) {
849
+ var current = getCurrentCultureSpecs();
850
+ var info = {
851
+ culture: current.culture,
852
+ dateEncoding: current.dateEncoding,
853
+ defaultCurrency: current.defaultCurrency,
854
+ cache: {},
855
+ };
856
+ for (var key in cultureSpecs) {
857
+ if (!cultureSpecs[key]) continue;
858
+ info[key] = cultureSpecs[key];
859
+ }
860
+ return info;
861
+ }
862
+ function popCulture() {
863
+ if (stack.length == 1) throw new Error("Cannot pop the last culture object.");
864
+ return stack.pop();
865
+ }
828
866
  var Culture = /*#__PURE__*/ (function () {
829
867
  function Culture() {}
830
868
  Culture.setCulture = function setCulture(cultureCode) {
831
- culture = cultureCode;
832
- cultureCache = {};
869
+ var cultureSpecs = getRootCultureSpecs();
870
+ cultureSpecs.culture = cultureCode;
871
+ cultureSpecs.cache = {};
833
872
  Localization.setCulture(cultureCode);
834
873
  this.invalidateCache();
835
874
  };
836
875
  Culture.setNumberCulture = function setNumberCulture(cultureCode) {
837
- numberCulture = cultureCode;
838
- delete cultureCache.numberCulture;
876
+ var cultureSpecs = getRootCultureSpecs();
877
+ cultureSpecs.numberCulture = cultureCode;
878
+ delete cultureSpecs.cache.numberCulture;
839
879
  this.invalidateCache();
840
880
  };
841
881
  Culture.setDateTimeCulture = function setDateTimeCulture(cultureCode) {
842
- dateTimeCulture = cultureCode;
843
- delete cultureCache.dateTimeCulture;
882
+ var cultureSpecs = getRootCultureSpecs();
883
+ cultureSpecs.dateTimeCulture = cultureCode;
884
+ delete cultureSpecs.cache.dateTimeCulture;
844
885
  this.invalidateCache();
845
886
  };
846
887
  Culture.setDefaultCurrency = function setDefaultCurrency(currencyCode) {
847
- defaultCurrency = currencyCode;
888
+ var cultureSpecs = getRootCultureSpecs();
889
+ cultureSpecs.defaultCurrency = currencyCode;
890
+ this.invalidateCache();
891
+ };
892
+ Culture.setDefaultDateEncoding = function setDefaultDateEncoding(encoding) {
893
+ var cultureSpecs = getRootCultureSpecs();
894
+ cultureSpecs.dateEncoding = encoding;
848
895
  this.invalidateCache();
849
896
  };
850
897
  Culture.invalidateCache = function invalidateCache() {
@@ -853,53 +900,52 @@ var Culture = /*#__PURE__*/ (function () {
853
900
  invalidateStringTemplateCache();
854
901
  };
855
902
  Culture.getNumberCulture = function getNumberCulture() {
856
- var _numberCulture;
857
- if (!cultureCache.numberCulture)
858
- cultureCache.numberCulture = new NumberCulture(
859
- (_numberCulture = numberCulture) != null ? _numberCulture : culture,
860
- );
861
- return cultureCache.numberCulture;
903
+ var _getCurrentCultureSpe = getCurrentCultureSpecs(),
904
+ cache = _getCurrentCultureSpe.cache,
905
+ numberCulture = _getCurrentCultureSpe.numberCulture,
906
+ culture = _getCurrentCultureSpe.culture;
907
+ if (!cache.numberCulture) cache.numberCulture = new NumberCulture(numberCulture != null ? numberCulture : culture);
908
+ return cache.numberCulture;
862
909
  };
863
910
  Culture.getDateTimeCulture = function getDateTimeCulture() {
864
- var _dateTimeCulture;
865
- if (!cultureCache.dateTimeCulture)
866
- cultureCache.dateTimeCulture = new DateTimeCulture(
867
- (_dateTimeCulture = dateTimeCulture) != null ? _dateTimeCulture : culture,
868
- );
869
- return cultureCache.dateTimeCulture;
911
+ var _getCurrentCultureSpe2 = getCurrentCultureSpecs(),
912
+ cache = _getCurrentCultureSpe2.cache,
913
+ dateTimeCulture = _getCurrentCultureSpe2.dateTimeCulture,
914
+ culture = _getCurrentCultureSpe2.culture;
915
+ if (!cache.dateTimeCulture)
916
+ cache.dateTimeCulture = new DateTimeCulture(dateTimeCulture != null ? dateTimeCulture : culture);
917
+ return cache.dateTimeCulture;
870
918
  };
871
919
  Culture.getDefaultDateEncoding = function getDefaultDateEncoding() {
872
- return dateEncoding;
873
- };
874
- Culture.setDefaultDateEncoding = function setDefaultDateEncoding(encoding) {
875
- dateEncoding = encoding;
920
+ return getCurrentCultureSpecs().dateEncoding;
876
921
  };
877
922
  Culture.getComparer = function getComparer(options) {
923
+ var _getCurrentCultureSpe3 = getCurrentCultureSpecs(),
924
+ culture = _getCurrentCultureSpe3.culture;
878
925
  if (typeof Intl.Collator != "undefined") return new Intl.Collator(culture, options).compare;
879
926
  return defaultCompare;
880
927
  };
881
- _createClass(Culture, null, [
928
+ return _createClass(Culture, null, [
882
929
  {
883
930
  key: "defaultCurrency",
884
931
  get: function get() {
885
- return defaultCurrency;
932
+ return getCurrentCultureSpecs().defaultCurrency;
886
933
  },
887
934
  },
888
935
  {
889
936
  key: "culture",
890
937
  get: function get() {
891
- return culture;
938
+ return getCurrentCultureSpecs().culture;
892
939
  },
893
940
  },
894
941
  ]);
895
- return Culture;
896
942
  })();
897
943
 
898
944
  var ArrayAdapter = /*#__PURE__*/ (function (_DataAdapter) {
899
- _inheritsLoose(ArrayAdapter, _DataAdapter);
900
945
  function ArrayAdapter() {
901
946
  return _DataAdapter.apply(this, arguments) || this;
902
947
  }
948
+ _inheritsLoose(ArrayAdapter, _DataAdapter);
903
949
  var _proto = ArrayAdapter.prototype;
904
950
  _proto.init = function init() {
905
951
  this.recordsAccessor = getAccessor(this.recordsBinding ? this.recordsBinding : this.recordsAccessor);
@@ -1032,20 +1078,20 @@ ArrayAdapter.prototype.sealed = false;
1032
1078
  ArrayAdapter.autoInit = true;
1033
1079
 
1034
1080
  var UseParentLayout = /*#__PURE__*/ (function (_PureContainer) {
1035
- _inheritsLoose(UseParentLayout, _PureContainer);
1036
1081
  function UseParentLayout() {
1037
1082
  return _PureContainer.apply(this, arguments) || this;
1038
1083
  }
1084
+ _inheritsLoose(UseParentLayout, _PureContainer);
1039
1085
  return UseParentLayout;
1040
1086
  })(PureContainer);
1041
1087
  UseParentLayout.prototype.noLayout = true;
1042
1088
  UseParentLayout.prototype.useParentLayout = true;
1043
1089
 
1044
1090
  var Repeater = /*#__PURE__*/ (function (_Container) {
1045
- _inheritsLoose(Repeater, _Container);
1046
1091
  function Repeater() {
1047
1092
  return _Container.apply(this, arguments) || this;
1048
1093
  }
1094
+ _inheritsLoose(Repeater, _Container);
1049
1095
  var _proto = Repeater.prototype;
1050
1096
  _proto.declareData = function declareData() {
1051
1097
  var _Container$prototype$;
@@ -1167,10 +1213,10 @@ var StructuredInstanceDataAccessor = /*#__PURE__*/ (function () {
1167
1213
  })();
1168
1214
 
1169
1215
  var Rescope = /*#__PURE__*/ (function (_PureContainer) {
1170
- _inheritsLoose(Rescope, _PureContainer);
1171
1216
  function Rescope() {
1172
1217
  return _PureContainer.apply(this, arguments) || this;
1173
1218
  }
1219
+ _inheritsLoose(Rescope, _PureContainer);
1174
1220
  var _proto = Rescope.prototype;
1175
1221
  _proto.init = function init() {
1176
1222
  this.binding = Binding.get(this.bind);
@@ -1562,6 +1608,21 @@ function enableCultureSensitiveFormatting() {
1562
1608
  return formatter.format(new Date(value));
1563
1609
  };
1564
1610
  });
1611
+ setGetFormatCacheCallback(function () {
1612
+ var cache = getCurrentCultureCache();
1613
+ if (!cache.formatCache) cache.formatCache = {};
1614
+ return cache.formatCache;
1615
+ });
1616
+ setGetExpressionCacheCallback(function () {
1617
+ var cache = getCurrentCultureCache();
1618
+ if (!cache.exprCache) cache.exprCache = {};
1619
+ return cache.exprCache;
1620
+ });
1621
+ setGetStringTemplateCacheCallback(function () {
1622
+ var cache = getCurrentCultureCache();
1623
+ if (!cache.strTplCache) cache.strTplCache = {};
1624
+ return cache.strTplCache;
1625
+ });
1565
1626
  GlobalCacheIdentifier.change();
1566
1627
  }
1567
1628
 
@@ -2171,7 +2232,6 @@ var LinkedListsNode = /*#__PURE__*/ (function () {
2171
2232
  })();
2172
2233
 
2173
2234
  var Cx = /*#__PURE__*/ (function (_VDOM$Component) {
2174
- _inheritsLoose(Cx, _VDOM$Component);
2175
2235
  function Cx(props) {
2176
2236
  var _this;
2177
2237
  _this = _VDOM$Component.call(this, props) || this;
@@ -2195,17 +2255,18 @@ var Cx = /*#__PURE__*/ (function (_VDOM$Component) {
2195
2255
  deferToken: 0,
2196
2256
  };
2197
2257
  if (props.subscribe) {
2198
- _this.unsubscribe = _this.store.subscribe(_this.update.bind(_assertThisInitialized(_this)));
2258
+ _this.unsubscribe = _this.store.subscribe(_this.update.bind(_this));
2199
2259
  _this.state.data = _this.store.getData();
2200
2260
  }
2201
2261
  _this.flags = {};
2202
2262
  _this.renderCount = 0;
2203
- if (props.onError) _this.componentDidCatch = _this.componentDidCatchHandler.bind(_assertThisInitialized(_this));
2204
- _this.forceUpdateCallback = _this.forceUpdate.bind(_assertThisInitialized(_this));
2263
+ if (props.onError) _this.componentDidCatch = _this.componentDidCatchHandler.bind(_this);
2264
+ _this.forceUpdateCallback = _this.forceUpdate.bind(_this);
2205
2265
  _this.deferCounter = 0;
2206
2266
  _this.waitForIdle();
2207
2267
  return _this;
2208
2268
  }
2269
+ _inheritsLoose(Cx, _VDOM$Component);
2209
2270
  var _proto = Cx.prototype;
2210
2271
  _proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(props) {
2211
2272
  var newStore = props.instance ? props.instance.store : props.store ? props.store : props.parentInstance.store;
@@ -2243,6 +2304,7 @@ var Cx = /*#__PURE__*/ (function (_VDOM$Component) {
2243
2304
  buster: ++this.renderCount,
2244
2305
  contentFactory: this.props.contentFactory,
2245
2306
  forceUpdate: this.forceUpdateCallback,
2307
+ cultureInfo: this.props.cultureInfo,
2246
2308
  });
2247
2309
  };
2248
2310
  _proto.componentDidMount = function componentDidMount() {
@@ -2314,7 +2376,8 @@ var Cx = /*#__PURE__*/ (function (_VDOM$Component) {
2314
2376
  props.instance !== this.props.instance ||
2315
2377
  props.widget !== this.props.widget ||
2316
2378
  props.store !== this.props.store ||
2317
- props.parentInstance !== this.props.parentInstance
2379
+ props.parentInstance !== this.props.parentInstance ||
2380
+ props.cultureInfo !== this.props.cultureInfo
2318
2381
  );
2319
2382
  };
2320
2383
  _proto.componentDidCatchHandler = function componentDidCatchHandler(error, info) {
@@ -2324,7 +2387,6 @@ var Cx = /*#__PURE__*/ (function (_VDOM$Component) {
2324
2387
  return Cx;
2325
2388
  })(VDOM.Component);
2326
2389
  var CxContext = /*#__PURE__*/ (function (_VDOM$Component2) {
2327
- _inheritsLoose(CxContext, _VDOM$Component2);
2328
2390
  function CxContext(props) {
2329
2391
  var _this4;
2330
2392
  _this4 = _VDOM$Component2.call(this, props) || this;
@@ -2332,6 +2394,7 @@ var CxContext = /*#__PURE__*/ (function (_VDOM$Component2) {
2332
2394
  _this4.UNSAFE_componentWillReceiveProps(props);
2333
2395
  return _this4;
2334
2396
  }
2397
+ _inheritsLoose(CxContext, _VDOM$Component2);
2335
2398
  var _proto2 = CxContext.prototype;
2336
2399
  _proto2.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(props) {
2337
2400
  this.timings = {
@@ -2349,23 +2412,28 @@ var CxContext = /*#__PURE__*/ (function (_VDOM$Component2) {
2349
2412
  throw new Error("The instance passed to a Cx component should be detached from its parent.");
2350
2413
  if (this.props.instance !== instance && this.props.instance.destroyTracked) this.props.instance.destroy();
2351
2414
  this.props.flags.preparing = true;
2352
- do {
2353
- context = new RenderingContext(options);
2354
- context.forceUpdate = this.props.forceUpdate;
2355
- this.props.flags.dirty = false;
2356
- instance.assignedRenderList = context.getRootRenderList();
2357
- visible = instance.scheduleExploreIfVisible(context);
2358
- if (visible) {
2359
- while (!context.exploreStack.empty()) {
2360
- var inst = context.exploreStack.pop();
2361
- //console.log("EXPLORE", inst.widget.constructor.name, inst.widget.tag, inst.widget.widgetId);
2362
- inst.explore(context);
2415
+ if (this.props.cultureInfo) pushCulture(this.props.cultureInfo);
2416
+ try {
2417
+ do {
2418
+ context = new RenderingContext(options);
2419
+ context.forceUpdate = this.props.forceUpdate;
2420
+ this.props.flags.dirty = false;
2421
+ instance.assignedRenderList = context.getRootRenderList();
2422
+ visible = instance.scheduleExploreIfVisible(context);
2423
+ if (visible) {
2424
+ while (!context.exploreStack.empty()) {
2425
+ var inst = context.exploreStack.pop();
2426
+ //console.log("EXPLORE", inst.widget.constructor.name, inst.widget.tag, inst.widget.widgetId);
2427
+ inst.explore(context);
2428
+ }
2429
+ } else if (instance.destroyTracked) {
2430
+ instance.destroy();
2431
+ break;
2363
2432
  }
2364
- } else if (instance.destroyTracked) {
2365
- instance.destroy();
2366
- break;
2367
- }
2368
- } while (this.props.flags.dirty && ++count <= 3 && Widget.optimizePrepare && now() - this.timings.start < 8);
2433
+ } while (this.props.flags.dirty && ++count <= 3 && Widget.optimizePrepare && now() - this.timings.start < 8);
2434
+ } finally {
2435
+ if (this.props.cultureInfo) popCulture();
2436
+ }
2369
2437
  if (visible) {
2370
2438
  this.timings.afterExplore = now();
2371
2439
  for (var i = 0; i < context.prepareList.length; i++) context.prepareList[i].prepare(context);
@@ -2454,10 +2522,10 @@ var CxContext = /*#__PURE__*/ (function (_VDOM$Component2) {
2454
2522
  })(VDOM.Component);
2455
2523
 
2456
2524
  var ContentResolver = /*#__PURE__*/ (function (_PureContainer) {
2457
- _inheritsLoose(ContentResolver, _PureContainer);
2458
2525
  function ContentResolver() {
2459
2526
  return _PureContainer.apply(this, arguments) || this;
2460
2527
  }
2528
+ _inheritsLoose(ContentResolver, _PureContainer);
2461
2529
  var _proto = ContentResolver.prototype;
2462
2530
  _proto.declareData = function declareData() {
2463
2531
  var _PureContainer$protot;
@@ -2532,10 +2600,10 @@ var ContentResolver = /*#__PURE__*/ (function (_PureContainer) {
2532
2600
  ContentResolver.prototype.mode = "replace";
2533
2601
 
2534
2602
  var IsolatedScope = /*#__PURE__*/ (function (_PureContainer) {
2535
- _inheritsLoose(IsolatedScope, _PureContainer);
2536
2603
  function IsolatedScope() {
2537
2604
  return _PureContainer.apply(this, arguments) || this;
2538
2605
  }
2606
+ _inheritsLoose(IsolatedScope, _PureContainer);
2539
2607
  var _proto = IsolatedScope.prototype;
2540
2608
  _proto.declareData = function declareData() {
2541
2609
  var _PureContainer$protot;
@@ -2575,10 +2643,10 @@ var IsolatedScope = /*#__PURE__*/ (function (_PureContainer) {
2575
2643
  })(PureContainer);
2576
2644
 
2577
2645
  var DetachedScope = /*#__PURE__*/ (function (_IsolatedScope) {
2578
- _inheritsLoose(DetachedScope, _IsolatedScope);
2579
2646
  function DetachedScope() {
2580
2647
  return _IsolatedScope.apply(this, arguments) || this;
2581
2648
  }
2649
+ _inheritsLoose(DetachedScope, _IsolatedScope);
2582
2650
  var _proto = DetachedScope.prototype;
2583
2651
  _proto.declareData = function declareData() {
2584
2652
  var _IsolatedScope$protot;
@@ -2642,10 +2710,10 @@ var DetachedScope = /*#__PURE__*/ (function (_IsolatedScope) {
2642
2710
  return DetachedScope;
2643
2711
  })(IsolatedScope);
2644
2712
  var ContainmentStore = /*#__PURE__*/ (function (_SubscribableView) {
2645
- _inheritsLoose(ContainmentStore, _SubscribableView);
2646
2713
  function ContainmentStore() {
2647
2714
  return _SubscribableView.apply(this, arguments) || this;
2648
2715
  }
2716
+ _inheritsLoose(ContainmentStore, _SubscribableView);
2649
2717
  var _proto2 = ContainmentStore.prototype;
2650
2718
  _proto2.getData = function getData() {
2651
2719
  return this.store.getData();
@@ -2689,10 +2757,10 @@ var ContainmentStore = /*#__PURE__*/ (function (_SubscribableView) {
2689
2757
 
2690
2758
  var persistenceCache = {};
2691
2759
  var Restate = /*#__PURE__*/ (function (_PureContainer) {
2692
- _inheritsLoose(Restate, _PureContainer);
2693
2760
  function Restate() {
2694
2761
  return _PureContainer.apply(this, arguments) || this;
2695
2762
  }
2763
+ _inheritsLoose(Restate, _PureContainer);
2696
2764
  var _proto = Restate.prototype;
2697
2765
  _proto.declareData = function declareData() {
2698
2766
  var _PureContainer$protot;
@@ -2756,6 +2824,8 @@ var Restate = /*#__PURE__*/ (function (_PureContainer) {
2756
2824
  _proto.explore = function explore(context, instance) {
2757
2825
  if (!instance.subStore) this.initSubStore(context, instance);
2758
2826
  if (instance.subStore.parentDataCheck()) instance.markShouldUpdate();
2827
+ instance.cultureInfo = context.cultureInfo;
2828
+ if (instance.cache("cultureInfo", instance.culture)) instance.markShouldUpdate();
2759
2829
  _PureContainer.prototype.explore.call(this, context, instance);
2760
2830
  };
2761
2831
  _proto.exploreItems = function exploreItems(context, instance, items) {
@@ -2779,6 +2849,7 @@ var Restate = /*#__PURE__*/ (function (_PureContainer) {
2779
2849
  deferredUntilIdle: instance.data.deferredUntilIdle,
2780
2850
  idleTimeout: instance.data.idleTimeout,
2781
2851
  immediate: this.immediate,
2852
+ cultureInfo: instance.cultureInfo,
2782
2853
  },
2783
2854
  key,
2784
2855
  );
@@ -2790,13 +2861,13 @@ Restate.prototype.waitForIdle = false;
2790
2861
  Restate.prototype.immediate = false;
2791
2862
  var PrivateStore = Restate;
2792
2863
  var RestateStore = /*#__PURE__*/ (function (_Store) {
2793
- _inheritsLoose(RestateStore, _Store);
2794
2864
  function RestateStore(config) {
2795
2865
  var _this2;
2796
2866
  _this2 = _Store.call(this, config) || this;
2797
2867
  _this2.parentDataVersion = -1;
2798
2868
  return _this2;
2799
2869
  }
2870
+ _inheritsLoose(RestateStore, _Store);
2800
2871
  var _proto2 = RestateStore.prototype;
2801
2872
  _proto2.getData = function getData() {
2802
2873
  var _this3 = this;
@@ -2846,10 +2917,10 @@ var RestateStore = /*#__PURE__*/ (function (_Store) {
2846
2917
  })(Store);
2847
2918
 
2848
2919
  var DataProxy = /*#__PURE__*/ (function (_PureContainer) {
2849
- _inheritsLoose(DataProxy, _PureContainer);
2850
2920
  function DataProxy() {
2851
2921
  return _PureContainer.apply(this, arguments) || this;
2852
2922
  }
2923
+ _inheritsLoose(DataProxy, _PureContainer);
2853
2924
  var _proto = DataProxy.prototype;
2854
2925
  _proto.init = function init() {
2855
2926
  if (!this.data) this.data = {};
@@ -2917,10 +2988,10 @@ function registerKeyboardShortcut(key, callback) {
2917
2988
  }
2918
2989
 
2919
2990
  var HoverSync = /*#__PURE__*/ (function (_PureContainer) {
2920
- _inheritsLoose(HoverSync, _PureContainer);
2921
2991
  function HoverSync() {
2922
2992
  return _PureContainer.apply(this, arguments) || this;
2923
2993
  }
2994
+ _inheritsLoose(HoverSync, _PureContainer);
2924
2995
  var _proto = HoverSync.prototype;
2925
2996
  _proto.initInstance = function initInstance(context, instance) {
2926
2997
  var channels = {};
@@ -2955,17 +3026,17 @@ var HoverSync = /*#__PURE__*/ (function (_PureContainer) {
2955
3026
  return HoverSync;
2956
3027
  })(PureContainer);
2957
3028
  var HoverSyncChild = /*#__PURE__*/ (function (_VDOM$Component) {
2958
- _inheritsLoose(HoverSyncChild, _VDOM$Component);
2959
3029
  function HoverSyncChild(props) {
2960
3030
  var _this;
2961
3031
  _this = _VDOM$Component.call(this, props) || this;
2962
3032
  _this.state = {
2963
3033
  hover: false,
2964
3034
  };
2965
- _this.onMouseMove = _this.onMouseMove.bind(_assertThisInitialized(_this));
2966
- _this.onMouseLeave = _this.onMouseLeave.bind(_assertThisInitialized(_this));
3035
+ _this.onMouseMove = _this.onMouseMove.bind(_this);
3036
+ _this.onMouseLeave = _this.onMouseLeave.bind(_this);
2967
3037
  return _this;
2968
3038
  }
3039
+ _inheritsLoose(HoverSyncChild, _VDOM$Component);
2969
3040
  var _proto2 = HoverSyncChild.prototype;
2970
3041
  _proto2.onMouseMove = function onMouseMove() {
2971
3042
  this.props.hoverSync.report(this.props.hoverChannel, this.props.hoverId, true);
@@ -3016,10 +3087,10 @@ function withHoverSync(key, hoverSync, hoverChannel, hoverId, render) {
3016
3087
  );
3017
3088
  }
3018
3089
  var HoverSyncElement = /*#__PURE__*/ (function (_Container) {
3019
- _inheritsLoose(HoverSyncElement, _Container);
3020
3090
  function HoverSyncElement() {
3021
3091
  return _Container.apply(this, arguments) || this;
3022
3092
  }
3093
+ _inheritsLoose(HoverSyncElement, _Container);
3023
3094
  var _proto3 = HoverSyncElement.prototype;
3024
3095
  _proto3.declareData = function declareData() {
3025
3096
  var _Container$prototype$;
@@ -3090,6 +3161,69 @@ HoverSyncElement.prototype.baseClass = "hoversyncelement";
3090
3161
  HoverSyncElement.prototype.styled = true;
3091
3162
  HoverSyncElement.prototype.hoverChannel = "default";
3092
3163
 
3164
+ var CultureScope = /*#__PURE__*/ (function (_PureContainer) {
3165
+ function CultureScope() {
3166
+ return _PureContainer.apply(this, arguments) || this;
3167
+ }
3168
+ _inheritsLoose(CultureScope, _PureContainer);
3169
+ var _proto = CultureScope.prototype;
3170
+ _proto.init = function init() {
3171
+ var _this$items;
3172
+ this.initialItems = (_this$items = this.items) != null ? _this$items : this.children;
3173
+ delete this.items;
3174
+ delete this.children;
3175
+ _PureContainer.prototype.init.call(this);
3176
+ };
3177
+ _proto.declareData = function declareData() {
3178
+ var _PureContainer$protot;
3179
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3180
+ args[_key] = arguments[_key];
3181
+ }
3182
+ (_PureContainer$protot = _PureContainer.prototype.declareData).call.apply(
3183
+ _PureContainer$protot,
3184
+ [this].concat(args, [
3185
+ {
3186
+ culture: undefined,
3187
+ numberCulture: undefined,
3188
+ dateTimeCulture: undefined,
3189
+ defaultCurrency: undefined,
3190
+ },
3191
+ ]),
3192
+ );
3193
+ };
3194
+ _proto.prepareData = function prepareData(context, instance) {
3195
+ _PureContainer.prototype.prepareData.call(this, context, instance);
3196
+ this.clear();
3197
+ var data = instance.data;
3198
+ if (this.onCreateCulture) instance.culture = instance.invoke("onCreateCulture", data, instance);
3199
+ else
3200
+ instance.culture = createCulture({
3201
+ culture: data.culture,
3202
+ numberCulture: data.numberCulture,
3203
+ dateTimeCulture: data.dateTimeCulture,
3204
+ defaultCurrency: data.defaultCurrency,
3205
+ dateEncoding: this.dateEncoding,
3206
+ });
3207
+ };
3208
+ _proto.explore = function explore(context, instance) {
3209
+ var culture = instance.culture;
3210
+ pushCulture(culture);
3211
+ if (this.items.length == 0 && this.initialItems) this.add(this.initialItems);
3212
+ context.push("cultureInfo", culture);
3213
+ _PureContainer.prototype.explore.call(this, context, instance);
3214
+ };
3215
+ _proto.exploreCleanup = function exploreCleanup(context, instance) {
3216
+ context.pop("cultureInfo");
3217
+ popCulture();
3218
+ };
3219
+ return CultureScope;
3220
+ })(PureContainer);
3221
+ CultureScope.prototype.culture = null;
3222
+ CultureScope.prototype.numberCulture = null;
3223
+ CultureScope.prototype.dateTimeCulture = null;
3224
+ CultureScope.prototype.defaultCurrency = null;
3225
+ CultureScope.prototype.dateEncoding = null;
3226
+
3093
3227
  var flattenProps = function flattenProps(props) {
3094
3228
  if (!props) return {};
3095
3229
  if (props.jsxSpread) {
@@ -3112,10 +3246,10 @@ var flattenProps = function flattenProps(props) {
3112
3246
 
3113
3247
  var currentInstance = null;
3114
3248
  var FunctionalComponent = /*#__PURE__*/ (function (_PureContainer) {
3115
- _inheritsLoose(FunctionalComponent, _PureContainer);
3116
3249
  function FunctionalComponent() {
3117
3250
  return _PureContainer.apply(this, arguments) || this;
3118
3251
  }
3252
+ _inheritsLoose(FunctionalComponent, _PureContainer);
3119
3253
  var _proto = FunctionalComponent.prototype;
3120
3254
  _proto.initInstance = function initInstance(context, instance) {
3121
3255
  this.clear();
@@ -3172,10 +3306,10 @@ function getCurrentInstance() {
3172
3306
  }
3173
3307
 
3174
3308
  var Selection = /*#__PURE__*/ (function (_Component) {
3175
- _inheritsLoose(Selection, _Component);
3176
3309
  function Selection() {
3177
3310
  return _Component.apply(this, arguments) || this;
3178
3311
  }
3312
+ _inheritsLoose(Selection, _Component);
3179
3313
  var _proto = Selection.prototype;
3180
3314
  _proto.isSelected = function isSelected(store, record, index) {
3181
3315
  return this.bind && store.get(this.bind) === record;
@@ -3228,10 +3362,10 @@ var Selection = /*#__PURE__*/ (function (_Component) {
3228
3362
  Selection.prototype.toggle = false;
3229
3363
  Selection.namespace = "ui.selection.";
3230
3364
  var SimpleSelection = /*#__PURE__*/ (function (_Selection) {
3231
- _inheritsLoose(SimpleSelection, _Selection);
3232
3365
  function SimpleSelection() {
3233
3366
  return _Selection.apply(this, arguments) || this;
3234
3367
  }
3368
+ _inheritsLoose(SimpleSelection, _Selection);
3235
3369
  var _proto2 = SimpleSelection.prototype;
3236
3370
  _proto2.isSelected = function isSelected(store, record, index) {
3237
3371
  return this.getIsSelectedDelegate(store)(record, index);
@@ -3248,10 +3382,10 @@ var SimpleSelection = /*#__PURE__*/ (function (_Selection) {
3248
3382
  return SimpleSelection;
3249
3383
  })(Selection);
3250
3384
  var DummySelection = /*#__PURE__*/ (function (_Selection2) {
3251
- _inheritsLoose(DummySelection, _Selection2);
3252
3385
  function DummySelection() {
3253
3386
  return _Selection2.apply(this, arguments) || this;
3254
3387
  }
3388
+ _inheritsLoose(DummySelection, _Selection2);
3255
3389
  var _proto3 = DummySelection.prototype;
3256
3390
  _proto3.isSelected = function isSelected(store, record, index) {
3257
3391
  return false;
@@ -3271,10 +3405,10 @@ Selection.factory = function (name) {
3271
3405
  };
3272
3406
 
3273
3407
  var PropertySelection = /*#__PURE__*/ (function (_Selection) {
3274
- _inheritsLoose(PropertySelection, _Selection);
3275
3408
  function PropertySelection() {
3276
3409
  return _Selection.apply(this, arguments) || this;
3277
3410
  }
3411
+ _inheritsLoose(PropertySelection, _Selection);
3278
3412
  var _proto = PropertySelection.prototype;
3279
3413
  _proto.selectMultiple = function selectMultiple(store, records, indexes, _temp) {
3280
3414
  var _this = this;
@@ -3320,10 +3454,10 @@ PropertySelection.prototype.multiple = false;
3320
3454
  Selection.alias("property", PropertySelection);
3321
3455
 
3322
3456
  var KeySelection = /*#__PURE__*/ (function (_Selection) {
3323
- _inheritsLoose(KeySelection, _Selection);
3324
3457
  function KeySelection() {
3325
3458
  return _Selection.apply(this, arguments) || this;
3326
3459
  }
3460
+ _inheritsLoose(KeySelection, _Selection);
3327
3461
  var _proto = KeySelection.prototype;
3328
3462
  _proto.init = function init() {
3329
3463
  if (this.bind && !this.selection)
@@ -3467,10 +3601,10 @@ function isVisibleDeep(instance) {
3467
3601
  return false;
3468
3602
  }
3469
3603
  var FirstVisibleChildItem = /*#__PURE__*/ (function (_PureContainer) {
3470
- _inheritsLoose(FirstVisibleChildItem, _PureContainer);
3471
3604
  function FirstVisibleChildItem() {
3472
3605
  return _PureContainer.apply(this, arguments) || this;
3473
3606
  }
3607
+ _inheritsLoose(FirstVisibleChildItem, _PureContainer);
3474
3608
  var _proto = FirstVisibleChildItem.prototype;
3475
3609
  _proto.checkVisible = function checkVisible(context, instance, data) {
3476
3610
  if (instance.parent.firstVisibleChild) return false;
@@ -3492,10 +3626,10 @@ var FirstVisibleChildItem = /*#__PURE__*/ (function (_PureContainer) {
3492
3626
  })(PureContainer);
3493
3627
  FirstVisibleChildItem.prototype.useParentLayout = true;
3494
3628
  var FirstVisibleChildLayout = /*#__PURE__*/ (function (_PureContainer2) {
3495
- _inheritsLoose(FirstVisibleChildLayout, _PureContainer2);
3496
3629
  function FirstVisibleChildLayout() {
3497
3630
  return _PureContainer2.apply(this, arguments) || this;
3498
3631
  }
3632
+ _inheritsLoose(FirstVisibleChildLayout, _PureContainer2);
3499
3633
  var _proto2 = FirstVisibleChildLayout.prototype;
3500
3634
  _proto2.explore = function explore(context, instance) {
3501
3635
  instance.firstVisibleChild = null;
@@ -3527,10 +3661,10 @@ function validContent$1(r) {
3527
3661
  return content;
3528
3662
  }
3529
3663
  var LabelsLeftLayout = /*#__PURE__*/ (function (_PureContainer) {
3530
- _inheritsLoose(LabelsLeftLayout, _PureContainer);
3531
3664
  function LabelsLeftLayout() {
3532
3665
  return _PureContainer.apply(this, arguments) || this;
3533
3666
  }
3667
+ _inheritsLoose(LabelsLeftLayout, _PureContainer);
3534
3668
  var _proto = LabelsLeftLayout.prototype;
3535
3669
  _proto.init = function init() {
3536
3670
  this.labelStyle = parseStyle(this.labelStyle);
@@ -3616,10 +3750,10 @@ function validContent(r) {
3616
3750
  return content;
3617
3751
  }
3618
3752
  var LabelsTopLayout = /*#__PURE__*/ (function (_Container) {
3619
- _inheritsLoose(LabelsTopLayout, _Container);
3620
3753
  function LabelsTopLayout() {
3621
3754
  return _Container.apply(this, arguments) || this;
3622
3755
  }
3756
+ _inheritsLoose(LabelsTopLayout, _Container);
3623
3757
  var _proto = LabelsTopLayout.prototype;
3624
3758
  _proto.init = function init() {
3625
3759
  if (this.vertical && isUndefined(this.columns)) this.columns = 1;
@@ -3729,10 +3863,10 @@ LabelsTopLayout.prototype.vertical = false;
3729
3863
  LabelsTopLayout.prototype.columns = undefined;
3730
3864
  LabelsTopLayout.prototype.styled = true;
3731
3865
  var LabelsTopLayoutCell = /*#__PURE__*/ (function (_PureContainer) {
3732
- _inheritsLoose(LabelsTopLayoutCell, _PureContainer);
3733
3866
  function LabelsTopLayoutCell() {
3734
3867
  return _PureContainer.apply(this, arguments) || this;
3735
3868
  }
3869
+ _inheritsLoose(LabelsTopLayoutCell, _PureContainer);
3736
3870
  var _proto2 = LabelsTopLayoutCell.prototype;
3737
3871
  _proto2.declareData = function declareData() {
3738
3872
  var _PureContainer$protot;
@@ -3765,10 +3899,10 @@ LabelsTopLayoutCell.prototype.styled = true;
3765
3899
  LabelsTopLayoutCell.prototype.useParentLayout = true;
3766
3900
 
3767
3901
  var Content = /*#__PURE__*/ (function (_PureContainer) {
3768
- _inheritsLoose(Content, _PureContainer);
3769
3902
  function Content() {
3770
3903
  return _PureContainer.apply(this, arguments) || this;
3771
3904
  }
3905
+ _inheritsLoose(Content, _PureContainer);
3772
3906
  var _proto = Content.prototype;
3773
3907
  _proto.init = function init() {
3774
3908
  _PureContainer.prototype.init.call(this);
@@ -3781,10 +3915,10 @@ Content.prototype.isContent = true;
3781
3915
  Widget.alias("content", Content);
3782
3916
 
3783
3917
  var ContentPlaceholder = /*#__PURE__*/ (function (_PureContainer) {
3784
- _inheritsLoose(ContentPlaceholder, _PureContainer);
3785
3918
  function ContentPlaceholder() {
3786
3919
  return _PureContainer.apply(this, arguments) || this;
3787
3920
  }
3921
+ _inheritsLoose(ContentPlaceholder, _PureContainer);
3788
3922
  var _proto = ContentPlaceholder.prototype;
3789
3923
  _proto.declareData = function declareData() {
3790
3924
  var _PureContainer$protot;
@@ -3832,10 +3966,10 @@ ContentPlaceholder.prototype.name = "body";
3832
3966
  ContentPlaceholder.prototype.scoped = false;
3833
3967
  Widget.alias("content-placeholder", ContentPlaceholder);
3834
3968
  var ContentPlaceholderScope = /*#__PURE__*/ (function (_PureContainer2) {
3835
- _inheritsLoose(ContentPlaceholderScope, _PureContainer2);
3836
3969
  function ContentPlaceholderScope() {
3837
3970
  return _PureContainer2.apply(this, arguments) || this;
3838
3971
  }
3972
+ _inheritsLoose(ContentPlaceholderScope, _PureContainer2);
3839
3973
  var _proto2 = ContentPlaceholderScope.prototype;
3840
3974
  _proto2.init = function init() {
3841
3975
  _PureContainer2.prototype.init.call(this);
@@ -4110,10 +4244,10 @@ function startHotAppLoop(appModule, element, store, widgets, options) {
4110
4244
  }
4111
4245
 
4112
4246
  var GroupAdapter = /*#__PURE__*/ (function (_ArrayAdapter) {
4113
- _inheritsLoose(GroupAdapter, _ArrayAdapter);
4114
4247
  function GroupAdapter() {
4115
4248
  return _ArrayAdapter.apply(this, arguments) || this;
4116
4249
  }
4250
+ _inheritsLoose(GroupAdapter, _ArrayAdapter);
4117
4251
  var _proto = GroupAdapter.prototype;
4118
4252
  _proto.init = function init() {
4119
4253
  _ArrayAdapter.prototype.init.call(this);
@@ -4247,10 +4381,10 @@ function serializeKey(data) {
4247
4381
  }
4248
4382
 
4249
4383
  var TreeAdapter = /*#__PURE__*/ (function (_ArrayAdapter) {
4250
- _inheritsLoose(TreeAdapter, _ArrayAdapter);
4251
4384
  function TreeAdapter() {
4252
4385
  return _ArrayAdapter.apply(this, arguments) || this;
4253
4386
  }
4387
+ _inheritsLoose(TreeAdapter, _ArrayAdapter);
4254
4388
  var _proto = TreeAdapter.prototype;
4255
4389
  _proto.init = function init() {
4256
4390
  _ArrayAdapter.prototype.init.call(this);
@@ -4390,6 +4524,7 @@ export {
4390
4524
  ContentResolver,
4391
4525
  Controller,
4392
4526
  Culture,
4527
+ CultureScope,
4393
4528
  Cx,
4394
4529
  DataAdapter,
4395
4530
  DataProxy,
@@ -4432,6 +4567,7 @@ export {
4432
4567
  batchUpdatesAndNotify,
4433
4568
  bind,
4434
4569
  contentAppend,
4570
+ createCulture,
4435
4571
  createFunctionalComponent,
4436
4572
  enableCultureSensitiveFormatting,
4437
4573
  executeKeyboardShortcuts,
@@ -4440,14 +4576,17 @@ export {
4440
4576
  flattenProps,
4441
4577
  getContent,
4442
4578
  getContentArray,
4579
+ getCurrentCultureCache,
4443
4580
  getCurrentInstance,
4444
4581
  isBatchingUpdates,
4445
4582
  notifyBatchedUpdateCompleted,
4446
4583
  notifyBatchedUpdateStarting,
4447
4584
  offFocusOut,
4448
4585
  oneFocusOut,
4586
+ popCulture,
4449
4587
  preventFocus,
4450
4588
  preventFocusOnTouch,
4589
+ pushCulture,
4451
4590
  registerKeyboardShortcut,
4452
4591
  resolveNumberFormattingFlags,
4453
4592
  startAppLoop,