cx 25.4.0 → 25.5.0
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/charts.js +2 -2
- package/dist/data.js +17 -3
- package/dist/manifest.js +651 -651
- package/dist/ui.js +88 -61
- package/dist/widgets.js +13 -13
- package/package.json +1 -1
- package/src/charts/Legend.d.ts +6 -6
- package/src/charts/LegendEntry.js +128 -128
- package/src/charts/LegendEntry.scss +27 -27
- package/src/charts/PieChart.d.ts +92 -92
- package/src/charts/RangeMarker.js +6 -2
- package/src/charts/axis/Axis.d.ts +113 -113
- package/src/charts/axis/Axis.js +280 -280
- package/src/charts/axis/CategoryAxis.d.ts +30 -30
- package/src/charts/axis/CategoryAxis.js +241 -241
- package/src/charts/axis/NumericAxis.d.ts +46 -46
- package/src/charts/axis/NumericAxis.js +351 -351
- package/src/charts/axis/Stack.js +55 -55
- package/src/charts/axis/TimeAxis.d.ts +31 -28
- package/src/charts/axis/TimeAxis.js +611 -611
- package/src/charts/helpers/PointReducer.js +47 -47
- package/src/charts/helpers/SnapPointFinder.js +69 -69
- package/src/data/AugmentedViewBase.js +77 -75
- package/src/data/Binding.spec.js +69 -69
- package/src/data/ExposedRecordView.js +75 -70
- package/src/data/ExposedValueView.js +73 -72
- package/src/data/Expression.js +229 -229
- package/src/data/Expression.spec.js +229 -229
- package/src/data/Ref.d.ts +24 -24
- package/src/data/Ref.spec.js +79 -79
- package/src/data/StoreRef.spec.js +24 -24
- package/src/data/StringTemplate.js +92 -92
- package/src/data/StringTemplate.spec.js +132 -132
- package/src/data/StructuredDataAccessor.d.ts +7 -7
- package/src/data/StructuredSelector.js +132 -132
- package/src/data/SubscribableView.js +54 -54
- package/src/data/getAccessor.spec.js +11 -11
- package/src/data/getSelector.js +49 -49
- package/src/hooks/createLocalStorageRef.d.ts +3 -3
- package/src/hooks/createLocalStorageRef.js +20 -20
- package/src/index.scss +6 -6
- package/src/ui/Container.js +154 -183
- package/src/ui/Culture.d.ts +57 -57
- package/src/ui/Culture.js +139 -139
- package/src/ui/Cx.js +3 -3
- package/src/ui/DataProxy.js +45 -44
- package/src/ui/DetachedScope.js +98 -94
- package/src/ui/FocusManager.js +171 -171
- package/src/ui/Format.js +108 -108
- package/src/ui/HoverSync.js +147 -147
- package/src/ui/Instance.d.ts +1 -1
- package/src/ui/Instance.js +25 -16
- package/src/ui/IsolatedScope.js +30 -30
- package/src/ui/Repeater.d.ts +61 -61
- package/src/ui/Rescope.js +35 -31
- package/src/ui/Restate.js +167 -163
- package/src/ui/Widget.js +184 -200
- package/src/ui/adapter/ArrayAdapter.js +152 -142
- package/src/ui/adapter/TreeAdapter.js +101 -100
- package/src/ui/createFunctionalComponent.d.ts +1 -1
- package/src/ui/createFunctionalComponent.js +31 -36
- package/src/ui/layout/ContentPlaceholder.d.ts +19 -19
- package/src/ui/layout/ContentPlaceholder.js +105 -105
- package/src/ui/layout/ContentPlaceholder.spec.js +579 -579
- package/src/ui/layout/LabelsTopLayout.js +134 -134
- package/src/ui/layout/exploreChildren.d.ts +12 -15
- package/src/ui/layout/exploreChildren.js +27 -40
- package/src/util/Format.js +270 -270
- package/src/util/date/encodeDate.d.ts +1 -1
- package/src/util/date/encodeDate.js +8 -8
- package/src/util/date/encodeDateWithTimezoneOffset.d.ts +1 -1
- package/src/util/date/index.d.ts +11 -11
- package/src/util/date/index.js +11 -11
- package/src/util/date/parseDateInvariant.d.ts +3 -3
- package/src/util/date/parseDateInvariant.js +20 -20
- package/src/util/debounce.js +18 -18
- package/src/util/getSearchQueryPredicate.js +59 -59
- package/src/util/index.d.ts +51 -51
- package/src/util/index.js +54 -54
- package/src/util/isValidIdentifierName.d.ts +1 -1
- package/src/util/isValidIdentifierName.js +5 -5
- package/src/util/isValidIdentifierName.spec.js +33 -33
- package/src/util/scss/add-rules.scss +38 -38
- package/src/util/validatedDebounce.js +19 -19
- package/src/widgets/Button.js +118 -118
- package/src/widgets/CxCredit.scss +37 -37
- package/src/widgets/HighlightedSearchText.js +36 -36
- package/src/widgets/HighlightedSearchText.scss +18 -18
- package/src/widgets/List.scss +91 -91
- package/src/widgets/Sandbox.js +9 -8
- package/src/widgets/drag-drop/DropZone.js +214 -214
- package/src/widgets/form/Calendar.d.ts +86 -86
- package/src/widgets/form/Calendar.js +618 -618
- package/src/widgets/form/Calendar.scss +196 -196
- package/src/widgets/form/Checkbox.scss +127 -127
- package/src/widgets/form/ColorField.js +397 -397
- package/src/widgets/form/ColorField.scss +96 -96
- package/src/widgets/form/ColorPicker.scss +283 -283
- package/src/widgets/form/DateTimeField.js +576 -576
- package/src/widgets/form/DateTimePicker.js +392 -392
- package/src/widgets/form/LookupField.d.ts +179 -179
- package/src/widgets/form/LookupField.scss +219 -219
- package/src/widgets/form/MonthField.d.ts +99 -99
- package/src/widgets/form/MonthField.js +523 -523
- package/src/widgets/form/MonthPicker.d.ts +76 -76
- package/src/widgets/form/MonthPicker.js +641 -641
- package/src/widgets/form/MonthPicker.scss +118 -118
- package/src/widgets/form/NumberField.js +459 -459
- package/src/widgets/form/NumberField.scss +61 -61
- package/src/widgets/form/Radio.scss +121 -121
- package/src/widgets/form/Select.scss +99 -99
- package/src/widgets/form/Slider.scss +118 -118
- package/src/widgets/form/Switch.scss +140 -140
- package/src/widgets/form/TextArea.scss +43 -43
- package/src/widgets/form/TextField.js +290 -290
- package/src/widgets/form/TextField.scss +55 -55
- package/src/widgets/form/UploadButton.d.ts +34 -34
- package/src/widgets/form/variables.scss +353 -353
- package/src/widgets/grid/Grid.d.ts +442 -442
- package/src/widgets/grid/Grid.js +3414 -3414
- package/src/widgets/grid/GridRow.js +228 -228
- package/src/widgets/grid/TreeNode.d.ts +23 -23
- package/src/widgets/grid/TreeNode.scss +88 -88
- package/src/widgets/grid/variables.scss +133 -133
- package/src/widgets/nav/LinkButton.js +128 -128
- package/src/widgets/nav/Menu.scss +74 -74
- package/src/widgets/nav/Route.js +102 -106
- package/src/widgets/overlay/Dropdown.js +612 -612
- package/src/widgets/overlay/FlyweightTooltipTracker.js +39 -39
- package/src/widgets/overlay/Overlay.d.ts +73 -73
- package/src/widgets/overlay/Tooltip.js +1 -1
- package/src/widgets/overlay/Window.js +202 -202
- package/src/widgets/overlay/captureMouse.js +124 -124
- package/src/widgets/overlay/createHotPromiseWindowFactory.d.ts +18 -18
- package/src/widgets/overlay/createHotPromiseWindowFactory.js +56 -56
- package/src/widgets/overlay/index.d.ts +11 -11
- package/src/widgets/overlay/index.js +11 -11
- package/src/widgets/variables.scss +144 -144
package/dist/ui.js
CHANGED
|
@@ -430,9 +430,7 @@ var Widget = /*#__PURE__*/ (function (_Component) {
|
|
|
430
430
|
_proto.prepareData = function prepareData(context, instance) {
|
|
431
431
|
if (this.styled) this.prepareCSS(context, instance);
|
|
432
432
|
};
|
|
433
|
-
_proto.initInstance = function initInstance(context, instance) {
|
|
434
|
-
if (this.onInit) this.onInit(context, instance);
|
|
435
|
-
};
|
|
433
|
+
_proto.initInstance = function initInstance(context, instance) {};
|
|
436
434
|
_proto.initState = function initState(context, instance) {};
|
|
437
435
|
_proto.checkVisible = function checkVisible(context, instance, data) {
|
|
438
436
|
return data.visible;
|
|
@@ -453,6 +451,12 @@ var Widget = /*#__PURE__*/ (function (_Component) {
|
|
|
453
451
|
_proto.update = function update() {
|
|
454
452
|
this.version = (this.version || 0) + 1;
|
|
455
453
|
};
|
|
454
|
+
_proto.applyParentStore = function applyParentStore(instance) {
|
|
455
|
+
instance.store = instance.parentStore;
|
|
456
|
+
|
|
457
|
+
// check when this is actually needed, perhaps this is needed only for tables and repeated elements
|
|
458
|
+
// if (instance.cached) delete instance.cached.rawData; // force prepareData to execute again
|
|
459
|
+
};
|
|
456
460
|
Widget.resetCounter = function resetCounter() {
|
|
457
461
|
widgetId = 100;
|
|
458
462
|
};
|
|
@@ -540,20 +544,12 @@ var Text = /*#__PURE__*/ (function (_Widget) {
|
|
|
540
544
|
})(Widget);
|
|
541
545
|
Widget.alias("text", Text);
|
|
542
546
|
|
|
543
|
-
function exploreChildren(context, instance, children, previousResult, key, store
|
|
547
|
+
function exploreChildren(context, instance, children, previousResult, key, store) {
|
|
544
548
|
var newChildren = previousResult || [];
|
|
545
549
|
var oldChildren = previousResult || newChildren;
|
|
546
550
|
var identical = previousResult ? 0 : -1;
|
|
547
|
-
|
|
548
|
-
// if (children.length)
|
|
549
|
-
// context.exploreStack.hop();
|
|
550
|
-
|
|
551
551
|
for (var c = 0; c < children.length; c++) {
|
|
552
552
|
var cell = instance.getChild(context, children[c], key, store);
|
|
553
|
-
|
|
554
|
-
// if (beforeCallback)
|
|
555
|
-
// beforeCallback(cell);
|
|
556
|
-
|
|
557
553
|
if (cell.checkVisible(context)) {
|
|
558
554
|
if (identical >= 0) {
|
|
559
555
|
if (cell == oldChildren[identical]) identical++;
|
|
@@ -603,7 +599,7 @@ var Container = /*#__PURE__*/ (function (_Widget) {
|
|
|
603
599
|
_Widget.prototype.init.call(this, context);
|
|
604
600
|
};
|
|
605
601
|
_proto.exploreItems = function exploreItems(context, instance, items) {
|
|
606
|
-
instance.children = exploreChildren(context, instance, items, instance.cached.children);
|
|
602
|
+
instance.children = exploreChildren(context, instance, items, instance.cached.children, null, instance.store);
|
|
607
603
|
if (instance.cache("children", instance.children)) instance.markShouldUpdate(context);
|
|
608
604
|
};
|
|
609
605
|
_proto.explore = function explore(context, instance) {
|
|
@@ -959,7 +955,10 @@ var ArrayAdapter = /*#__PURE__*/ (function (_DataAdapter) {
|
|
|
959
955
|
this.indexName = this.indexName.toString();
|
|
960
956
|
};
|
|
961
957
|
_proto.initInstance = function initInstance(context, instance) {
|
|
962
|
-
if (!instance.recordStoreCache)
|
|
958
|
+
if (!instance.recordStoreCache) {
|
|
959
|
+
instance.recordStoreCache = new WeakMap();
|
|
960
|
+
instance.cacheByKey = {};
|
|
961
|
+
}
|
|
963
962
|
if (!instance.recordsAccessor && this.recordsAccessor) {
|
|
964
963
|
instance.recordsAccessor = this.recordsAccessor.bindInstance
|
|
965
964
|
? this.recordsAccessor.bindInstance(instance)
|
|
@@ -984,7 +983,8 @@ var ArrayAdapter = /*#__PURE__*/ (function (_DataAdapter) {
|
|
|
984
983
|
return result;
|
|
985
984
|
};
|
|
986
985
|
_proto.mapRecord = function mapRecord(context, instance, data, parentStore, recordsAccessor, index) {
|
|
987
|
-
var
|
|
986
|
+
var key = this.cacheByKeyField && this.keyField ? data[this.keyField] : null;
|
|
987
|
+
var recordStore = key != null ? instance.cacheByKey[key] : instance.recordStoreCache.get(data);
|
|
988
988
|
if (recordsAccessor) {
|
|
989
989
|
if (!recordStore)
|
|
990
990
|
recordStore = new ArrayElementView({
|
|
@@ -1011,9 +1011,13 @@ var ArrayAdapter = /*#__PURE__*/ (function (_DataAdapter) {
|
|
|
1011
1011
|
});
|
|
1012
1012
|
else {
|
|
1013
1013
|
recordStore.setStore(parentStore);
|
|
1014
|
+
recordStore.setData(data);
|
|
1014
1015
|
}
|
|
1015
1016
|
}
|
|
1016
|
-
|
|
1017
|
+
|
|
1018
|
+
// cache by the key or by data reference
|
|
1019
|
+
if (key != null) instance.cacheByKey[key] = recordStore;
|
|
1020
|
+
else instance.recordStoreCache.set(data, recordStore);
|
|
1017
1021
|
return {
|
|
1018
1022
|
store: recordStore,
|
|
1019
1023
|
index: index,
|
|
@@ -1079,6 +1083,8 @@ var ArrayAdapter = /*#__PURE__*/ (function (_DataAdapter) {
|
|
|
1079
1083
|
})(DataAdapter);
|
|
1080
1084
|
ArrayAdapter.prototype.immutable = false;
|
|
1081
1085
|
ArrayAdapter.prototype.sealed = false;
|
|
1086
|
+
ArrayAdapter.prototype.keyField = null;
|
|
1087
|
+
ArrayAdapter.prototype.cacheByKeyField = true;
|
|
1082
1088
|
ArrayAdapter.autoInit = true;
|
|
1083
1089
|
|
|
1084
1090
|
var UseParentLayout = /*#__PURE__*/ (function (_PureContainer) {
|
|
@@ -1229,7 +1235,7 @@ var Rescope = /*#__PURE__*/ (function (_PureContainer) {
|
|
|
1229
1235
|
};
|
|
1230
1236
|
_proto.initInstance = function initInstance(context, instance) {
|
|
1231
1237
|
instance.store = new ZoomIntoPropertyView({
|
|
1232
|
-
store: instance.
|
|
1238
|
+
store: instance.parentStore,
|
|
1233
1239
|
binding: this.binding,
|
|
1234
1240
|
rootName: this.rootName,
|
|
1235
1241
|
nestedData: isObject(this.data)
|
|
@@ -1240,9 +1246,10 @@ var Rescope = /*#__PURE__*/ (function (_PureContainer) {
|
|
|
1240
1246
|
})
|
|
1241
1247
|
: null,
|
|
1242
1248
|
});
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1249
|
+
_PureContainer.prototype.initInstance.call(this, context, instance);
|
|
1250
|
+
};
|
|
1251
|
+
_proto.applyParentStore = function applyParentStore(instance) {
|
|
1252
|
+
instance.store.setStore(instance.parentStore);
|
|
1246
1253
|
};
|
|
1247
1254
|
return Rescope;
|
|
1248
1255
|
})(PureContainer);
|
|
@@ -1635,31 +1642,39 @@ function enableCultureSensitiveFormatting() {
|
|
|
1635
1642
|
|
|
1636
1643
|
var instanceId = 1000;
|
|
1637
1644
|
var Instance = /*#__PURE__*/ (function () {
|
|
1638
|
-
function Instance(widget, key, parent,
|
|
1645
|
+
function Instance(widget, key, parent, parentStore) {
|
|
1639
1646
|
this.widget = widget;
|
|
1640
1647
|
this.key = key;
|
|
1641
1648
|
this.id = String(++instanceId);
|
|
1642
1649
|
this.cached = {};
|
|
1643
1650
|
this.parent = parent;
|
|
1644
|
-
this.
|
|
1651
|
+
this.parentStore = parentStore != null ? parentStore : parent == null ? void 0 : parent.store;
|
|
1652
|
+
if (this.parentStore == null) throw new Error("Cannot create instance without a parent store.");
|
|
1645
1653
|
}
|
|
1646
1654
|
var _proto = Instance.prototype;
|
|
1647
|
-
_proto.
|
|
1648
|
-
this.
|
|
1655
|
+
_proto.setParentStore = function setParentStore(parentStore) {
|
|
1656
|
+
this.parentStore = parentStore;
|
|
1657
|
+
this.widget.applyParentStore(this);
|
|
1649
1658
|
};
|
|
1650
1659
|
_proto.init = function init(context) {
|
|
1651
|
-
//widget is initialized when first instance is initialized
|
|
1660
|
+
// widget is initialized when the first instance is initialized
|
|
1652
1661
|
if (!this.widget.initialized) {
|
|
1653
1662
|
this.widget.init(context);
|
|
1663
|
+
|
|
1664
|
+
// init default values
|
|
1665
|
+
this.widget.selector.init(this.parentStore);
|
|
1654
1666
|
this.widget.initialized = true;
|
|
1655
1667
|
}
|
|
1656
1668
|
if (!this.dataSelector) {
|
|
1657
|
-
this.widget.selector.init(this.store);
|
|
1658
1669
|
this.dataSelector = this.widget.selector.createStoreSelector();
|
|
1659
1670
|
}
|
|
1660
1671
|
|
|
1661
|
-
//init instance might change the store, so
|
|
1672
|
+
// init instance might change the store, so this must go before the controller initialization
|
|
1662
1673
|
this.widget.initInstance(context, this);
|
|
1674
|
+
|
|
1675
|
+
// initInstance can set the store, otherwise use parent store
|
|
1676
|
+
if (!this.store) this.store = this.parentStore;
|
|
1677
|
+
if (this.widget.onInit) this.widget.onInit(context, this);
|
|
1663
1678
|
this.widget.initState(context, this);
|
|
1664
1679
|
if (this.widget.controller)
|
|
1665
1680
|
this.controller = Controller.create(this.widget.controller, {
|
|
@@ -2040,15 +2055,15 @@ var Instance = /*#__PURE__*/ (function () {
|
|
|
2040
2055
|
if (this.instanceCache) this.instanceCache.destroy();
|
|
2041
2056
|
};
|
|
2042
2057
|
_proto.getChild = function getChild(context, widget, key, store) {
|
|
2043
|
-
return this.getInstanceCache().getChild(widget, store
|
|
2058
|
+
return this.getInstanceCache().getChild(widget, store != null ? store : this.store, key);
|
|
2044
2059
|
};
|
|
2045
2060
|
_proto.getDetachedChild = function getDetachedChild(widget, key, store) {
|
|
2046
|
-
var child = new Instance(widget, key, this, store
|
|
2061
|
+
var child = new Instance(widget, key, this, store != null ? store : this.store);
|
|
2047
2062
|
child.detached = true;
|
|
2048
2063
|
return child;
|
|
2049
2064
|
};
|
|
2050
2065
|
_proto.prepareRenderCleanupChild = function prepareRenderCleanupChild(widget, store, keyPrefix, options) {
|
|
2051
|
-
return widget.prepareRenderCleanup(store
|
|
2066
|
+
return widget.prepareRenderCleanup(store != null ? store : this.store, options, keyPrefix, this);
|
|
2052
2067
|
};
|
|
2053
2068
|
_proto.getJsxEventProps = function getJsxEventProps() {
|
|
2054
2069
|
var _this5 = this;
|
|
@@ -2116,7 +2131,7 @@ var InstanceCache = /*#__PURE__*/ (function () {
|
|
|
2116
2131
|
this.keyPrefix = keyPrefix != null ? keyPrefix + "-" : "";
|
|
2117
2132
|
}
|
|
2118
2133
|
var _proto2 = InstanceCache.prototype;
|
|
2119
|
-
_proto2.getChild = function getChild(widget,
|
|
2134
|
+
_proto2.getChild = function getChild(widget, parentStore, key) {
|
|
2120
2135
|
var k = this.keyPrefix + (key != null ? key : widget.vdomKey || widget.widgetId);
|
|
2121
2136
|
var instance = this.children[k];
|
|
2122
2137
|
if (
|
|
@@ -2124,12 +2139,10 @@ var InstanceCache = /*#__PURE__*/ (function () {
|
|
|
2124
2139
|
instance.widget !== widget ||
|
|
2125
2140
|
(!instance.visible && (instance.widget.controller || instance.widget.onInit))
|
|
2126
2141
|
) {
|
|
2127
|
-
instance = new Instance(widget, k, this.parent);
|
|
2142
|
+
instance = new Instance(widget, k, this.parent, parentStore);
|
|
2128
2143
|
this.children[k] = instance;
|
|
2129
|
-
}
|
|
2130
|
-
|
|
2131
|
-
instance.setStore(store);
|
|
2132
|
-
if (instance.cached) delete instance.cached.rawData; // force prepareData to execute again
|
|
2144
|
+
} else if (instance.parentStore !== parentStore) {
|
|
2145
|
+
instance.setParentStore(parentStore);
|
|
2133
2146
|
}
|
|
2134
2147
|
return instance;
|
|
2135
2148
|
};
|
|
@@ -2257,10 +2270,10 @@ var Cx = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
2257
2270
|
_this.parentInstance = props.parentInstance;
|
|
2258
2271
|
_this.store = props.store || _this.parentInstance.store;
|
|
2259
2272
|
} else {
|
|
2260
|
-
_this.parentInstance = new Instance(_this.widget, 0);
|
|
2273
|
+
_this.parentInstance = new Instance(_this.widget, 0, null, props.store);
|
|
2261
2274
|
_this.store = props.store;
|
|
2262
2275
|
}
|
|
2263
|
-
if (!_this.store) throw new Error("Cx component requires store.");
|
|
2276
|
+
if (!_this.store) throw new Error("Cx component requires a store.");
|
|
2264
2277
|
}
|
|
2265
2278
|
_this.state = {
|
|
2266
2279
|
deferToken: 0,
|
|
@@ -2299,7 +2312,7 @@ var Cx = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
2299
2312
|
_proto.getInstance = function getInstance() {
|
|
2300
2313
|
if (this.props.instance) return this.props.instance;
|
|
2301
2314
|
if (this.instance && this.instance.widget === this.widget) {
|
|
2302
|
-
if (this.instance.
|
|
2315
|
+
if (this.instance.parentStore != this.store) this.instance.setParentStore(this.store);
|
|
2303
2316
|
return this.instance;
|
|
2304
2317
|
}
|
|
2305
2318
|
if (this.widget && this.parentInstance)
|
|
@@ -2661,6 +2674,9 @@ var IsolatedScope = /*#__PURE__*/ (function (_PureContainer) {
|
|
|
2661
2674
|
_proto.explore = function explore(context, instance) {
|
|
2662
2675
|
if (instance.shouldUpdate) {
|
|
2663
2676
|
_PureContainer.prototype.explore.call(this, context, instance);
|
|
2677
|
+
} else if (instance.children) {
|
|
2678
|
+
// mark children to prevent sweeping them away
|
|
2679
|
+
for (var i = 0; i < instance.children.length; i++) instance.instanceCache.addChild(instance.children[i]);
|
|
2664
2680
|
}
|
|
2665
2681
|
};
|
|
2666
2682
|
return IsolatedScope;
|
|
@@ -2717,6 +2733,10 @@ var DetachedScope = /*#__PURE__*/ (function (_IsolatedScope) {
|
|
|
2717
2733
|
selector: getSelector(this.exclusiveData || this.data),
|
|
2718
2734
|
});
|
|
2719
2735
|
};
|
|
2736
|
+
_proto.applyParentStore = function applyParentStore(instance) {
|
|
2737
|
+
instance.store = instance.parentStore;
|
|
2738
|
+
instance.subStore.setStore(instance.parentStore);
|
|
2739
|
+
};
|
|
2720
2740
|
_proto.render = function render(context, instance, key) {
|
|
2721
2741
|
return /*#__PURE__*/ jsx(
|
|
2722
2742
|
Cx,
|
|
@@ -2835,16 +2855,15 @@ var Restate = /*#__PURE__*/ (function (_PureContainer) {
|
|
|
2835
2855
|
return instance.nestedDataSet(path, value, _this.data);
|
|
2836
2856
|
},
|
|
2837
2857
|
});
|
|
2838
|
-
instance.setStore = function (store) {
|
|
2839
|
-
instance.store = store;
|
|
2840
|
-
instance.subStore.setStore(store);
|
|
2841
|
-
};
|
|
2842
2858
|
if (cacheKey) {
|
|
2843
2859
|
instance.subscribeOnDestroy(function () {
|
|
2844
2860
|
persistenceCache[cacheKey] = instance.subStore.getData();
|
|
2845
2861
|
});
|
|
2846
2862
|
}
|
|
2847
2863
|
};
|
|
2864
|
+
_proto.applyParentStore = function applyParentStore(instance) {
|
|
2865
|
+
if (instance.subStore) instance.subStore.setStore(instance.parentStore);
|
|
2866
|
+
};
|
|
2848
2867
|
_proto.explore = function explore(context, instance) {
|
|
2849
2868
|
var _this$culture;
|
|
2850
2869
|
if (!instance.subStore) this.initSubStore(context, instance);
|
|
@@ -2939,6 +2958,11 @@ var RestateStore = /*#__PURE__*/ (function (_Store) {
|
|
|
2939
2958
|
if (!this.detached) this.store.notify();
|
|
2940
2959
|
_Store.prototype.doNotify.call(this);
|
|
2941
2960
|
};
|
|
2961
|
+
|
|
2962
|
+
// override the default implementation to avoid meta overwrites
|
|
2963
|
+
_proto2.setStore = function setStore(store) {
|
|
2964
|
+
this.store = store;
|
|
2965
|
+
};
|
|
2942
2966
|
return RestateStore;
|
|
2943
2967
|
})(Store);
|
|
2944
2968
|
|
|
@@ -2952,25 +2976,25 @@ var DataProxy = /*#__PURE__*/ (function (_PureContainer) {
|
|
|
2952
2976
|
if (!this.data) this.data = {};
|
|
2953
2977
|
if (this.alias) this.data[this.alias] = this.value;
|
|
2954
2978
|
|
|
2955
|
-
//
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2979
|
+
// nesting is required to avoid resetting the store on every render and recalculating the data
|
|
2980
|
+
this.container = PureContainer.create({
|
|
2981
|
+
type: PureContainer,
|
|
2982
|
+
items: this.children || this.items,
|
|
2983
|
+
layout: this.layout,
|
|
2984
|
+
controller: this.controller,
|
|
2985
|
+
outerLayout: this.outerLayout,
|
|
2986
|
+
ws: this.ws,
|
|
2987
|
+
});
|
|
2988
|
+
this.children = [this.container];
|
|
2989
|
+
delete this.items;
|
|
2990
|
+
delete this.controller;
|
|
2991
|
+
delete this.outerLayout;
|
|
2992
|
+
this.layout = UseParentLayout;
|
|
2969
2993
|
_PureContainer.prototype.init.call(this);
|
|
2970
2994
|
};
|
|
2971
2995
|
_proto.initInstance = function initInstance(context, instance) {
|
|
2972
2996
|
instance.store = new NestedDataView({
|
|
2973
|
-
store: instance.
|
|
2997
|
+
store: instance.parentStore,
|
|
2974
2998
|
nestedData: new StructuredInstanceDataAccessor({
|
|
2975
2999
|
instance: instance,
|
|
2976
3000
|
data: this.data,
|
|
@@ -2979,9 +3003,10 @@ var DataProxy = /*#__PURE__*/ (function (_PureContainer) {
|
|
|
2979
3003
|
immutable: this.immutable,
|
|
2980
3004
|
sealed: this.sealed,
|
|
2981
3005
|
});
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
3006
|
+
_PureContainer.prototype.initInstance.call(this, context, instance);
|
|
3007
|
+
};
|
|
3008
|
+
_proto.applyParentStore = function applyParentStore(instance) {
|
|
3009
|
+
instance.store.setStore(instance.parentStore);
|
|
2985
3010
|
};
|
|
2986
3011
|
return DataProxy;
|
|
2987
3012
|
})(PureContainer);
|
|
@@ -3215,6 +3240,7 @@ var FunctionalComponent = /*#__PURE__*/ (function (_PureContainer) {
|
|
|
3215
3240
|
_inheritsLoose(FunctionalComponent, _PureContainer);
|
|
3216
3241
|
var _proto = FunctionalComponent.prototype;
|
|
3217
3242
|
_proto.initInstance = function initInstance(context, instance) {
|
|
3243
|
+
instance.store = instance.parentStore;
|
|
3218
3244
|
this.clear();
|
|
3219
3245
|
currentInstance = instance;
|
|
3220
3246
|
this.add(this.childrenFactory(this.props));
|
|
@@ -4483,6 +4509,7 @@ TreeAdapter.prototype.loadedField = "$loaded";
|
|
|
4483
4509
|
TreeAdapter.prototype.foldersFirst = true;
|
|
4484
4510
|
TreeAdapter.prototype.isTreeAdapter = true;
|
|
4485
4511
|
TreeAdapter.prototype.hideRootNodes = false;
|
|
4512
|
+
TreeAdapter.prototype.cacheByKeyField = false;
|
|
4486
4513
|
|
|
4487
4514
|
function bind(path, defaultValue) {
|
|
4488
4515
|
return {
|
package/dist/widgets.js
CHANGED
|
@@ -1771,15 +1771,16 @@ var Sandbox = /*#__PURE__*/ (function (_PureContainer) {
|
|
|
1771
1771
|
};
|
|
1772
1772
|
_proto.initInstance = function initInstance(context, instance) {
|
|
1773
1773
|
instance.store = new ExposedValueView({
|
|
1774
|
-
store: instance.
|
|
1774
|
+
store: instance.parentStore,
|
|
1775
1775
|
containerBinding: this.storageBinding,
|
|
1776
1776
|
key: null,
|
|
1777
1777
|
recordName: this.recordName,
|
|
1778
1778
|
immutable: this.immutable,
|
|
1779
1779
|
});
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1780
|
+
_PureContainer.prototype.initInstance.call(this, context, instance);
|
|
1781
|
+
};
|
|
1782
|
+
_proto.applyParentStore = function applyParentStore(instance) {
|
|
1783
|
+
instance.store.setStore(instance.parentStore);
|
|
1783
1784
|
};
|
|
1784
1785
|
_proto.declareData = function declareData() {
|
|
1785
1786
|
var _PureContainer$protot;
|
|
@@ -1798,6 +1799,8 @@ var Sandbox = /*#__PURE__*/ (function (_PureContainer) {
|
|
|
1798
1799
|
var store = instance.store,
|
|
1799
1800
|
data = instance.data;
|
|
1800
1801
|
if (store.getKey() !== data.key) {
|
|
1802
|
+
//when navigating to a page using the same widget tree as the previous page
|
|
1803
|
+
//everything needs to be reinstantiated, e.g. user/1 => user/2
|
|
1801
1804
|
instance.store = new ExposedValueView({
|
|
1802
1805
|
store: store,
|
|
1803
1806
|
containerBinding: this.storageBinding,
|
|
@@ -1805,9 +1808,6 @@ var Sandbox = /*#__PURE__*/ (function (_PureContainer) {
|
|
|
1805
1808
|
recordName: this.recordName,
|
|
1806
1809
|
immutable: this.immutable,
|
|
1807
1810
|
});
|
|
1808
|
-
|
|
1809
|
-
//when navigating to a page using the same widget tree as the previous page
|
|
1810
|
-
//everything needs to be reinstantiated, e.g. user/1 => user/2
|
|
1811
1811
|
instance.clearChildrenCache();
|
|
1812
1812
|
}
|
|
1813
1813
|
_PureContainer.prototype.prepareData.call(this, context, instance);
|
|
@@ -4245,8 +4245,8 @@ function getTooltipInstance(e, parentInstance, tooltip, options) {
|
|
|
4245
4245
|
tooltipInstance = parentInstance.tooltips[name] = parentInstance.getDetachedChild(tooltipWidget, name, store);
|
|
4246
4246
|
tooltipInstance.config = tooltip;
|
|
4247
4247
|
tooltipInstance.tooltipName = name;
|
|
4248
|
+
tooltipInstance.init(new RenderingContext());
|
|
4248
4249
|
if (tooltip.alwaysVisible || tooltip.trackMouse || tooltip.trackMouseX || tooltip.trackMouseY) {
|
|
4249
|
-
tooltipInstance.init(new RenderingContext());
|
|
4250
4250
|
tooltipInstance.data = tooltipInstance.dataSelector(store);
|
|
4251
4251
|
}
|
|
4252
4252
|
}
|
|
@@ -4986,13 +4986,13 @@ var Route = /*#__PURE__*/ (function (_PureContainer) {
|
|
|
4986
4986
|
this.matcher = new RouteMatcher(this.route + (this.prefix ? "(*remainder)" : ""));
|
|
4987
4987
|
};
|
|
4988
4988
|
_proto.initInstance = function initInstance(context, instance) {
|
|
4989
|
-
_PureContainer.prototype.initInstance.call(this, context, instance);
|
|
4990
4989
|
instance.store = new ReadOnlyDataView({
|
|
4991
|
-
store: instance.
|
|
4990
|
+
store: instance.parentStore,
|
|
4992
4991
|
});
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4992
|
+
_PureContainer.prototype.initInstance.call(this, context, instance);
|
|
4993
|
+
};
|
|
4994
|
+
_proto.applyParentStore = function applyParentStore(instance) {
|
|
4995
|
+
instance.store.setStore(instance.parentStore);
|
|
4996
4996
|
};
|
|
4997
4997
|
_proto.declareData = function declareData() {
|
|
4998
4998
|
var _PureContainer$protot;
|
package/package.json
CHANGED
package/src/charts/Legend.d.ts
CHANGED
|
@@ -20,22 +20,22 @@ interface LegendProps extends Cx.HtmlElementProps {
|
|
|
20
20
|
shape?: Cx.StringProp;
|
|
21
21
|
|
|
22
22
|
/** CSS style that will be applied to the legend entry. */
|
|
23
|
-
entryStyle
|
|
23
|
+
entryStyle?: Cx.StyleProp;
|
|
24
24
|
|
|
25
25
|
/** CSS class that will be applied to the legend entry. */
|
|
26
|
-
entryClass
|
|
26
|
+
entryClass?: Cx.ClassProp;
|
|
27
27
|
|
|
28
28
|
/** CSS style that will be applied to the legend entry value segment. */
|
|
29
|
-
valueStyle
|
|
29
|
+
valueStyle?: Cx.StyleProp;
|
|
30
30
|
|
|
31
31
|
/** CSS class that will be applied to the legend entry value segment. */
|
|
32
|
-
valueClass
|
|
32
|
+
valueClass?: Cx.ClassProp;
|
|
33
33
|
|
|
34
34
|
/** Set to true to show values. Mostly used for PieChart legends. */
|
|
35
|
-
showValues
|
|
35
|
+
showValues?: Cx.BooleanProp;
|
|
36
36
|
|
|
37
37
|
/** Format used for values, i.e. n;2 or currency. The default value is s.*/
|
|
38
|
-
valueFormat
|
|
38
|
+
valueFormat?: string;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export class Legend extends Cx.Widget<LegendProps> {
|