cx 25.5.1 → 25.6.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.
Files changed (45) hide show
  1. package/dist/charts.js +40 -21
  2. package/dist/manifest.js +771 -771
  3. package/dist/ui.js +0 -15
  4. package/dist/widgets.js +34 -25
  5. package/package.json +1 -1
  6. package/src/charts/LineGraph.js +1 -1
  7. package/src/charts/axis/NumericAxis.d.ts +46 -46
  8. package/src/charts/helpers/PointReducer.d.ts +9 -0
  9. package/src/charts/helpers/PointReducer.js +36 -22
  10. package/src/data/AugmentedViewBase.js +77 -77
  11. package/src/data/ExposedRecordView.js +75 -75
  12. package/src/data/ExposedValueView.js +73 -73
  13. package/src/data/Ref.d.ts +24 -24
  14. package/src/data/Ref.spec.js +79 -79
  15. package/src/data/StoreRef.spec.js +24 -24
  16. package/src/data/StructuredDataAccessor.d.ts +7 -7
  17. package/src/data/SubscribableView.js +54 -54
  18. package/src/ui/Container.js +154 -154
  19. package/src/ui/DataProxy.js +31 -45
  20. package/src/ui/DetachedScope.js +98 -98
  21. package/src/ui/Instance.d.ts +72 -72
  22. package/src/ui/Instance.js +623 -623
  23. package/src/ui/IsolatedScope.js +30 -30
  24. package/src/ui/Repeater.js +109 -109
  25. package/src/ui/Rescope.js +35 -35
  26. package/src/ui/Restate.js +167 -167
  27. package/src/ui/Widget.js +184 -184
  28. package/src/ui/adapter/ArrayAdapter.js +152 -152
  29. package/src/ui/adapter/TreeAdapter.js +101 -101
  30. package/src/ui/createFunctionalComponent.d.ts +1 -1
  31. package/src/ui/index.d.ts +42 -42
  32. package/src/ui/layout/exploreChildren.d.ts +12 -12
  33. package/src/ui/layout/exploreChildren.js +27 -27
  34. package/src/util/debounce.js +18 -18
  35. package/src/util/validatedDebounce.js +19 -19
  36. package/src/widgets/Button.js +118 -118
  37. package/src/widgets/List.js +594 -594
  38. package/src/widgets/form/Calendar.d.ts +86 -86
  39. package/src/widgets/form/Checkbox.js +5 -2
  40. package/src/widgets/form/MonthField.d.ts +5 -0
  41. package/src/widgets/form/MonthField.js +1 -0
  42. package/src/widgets/form/MonthPicker.d.ts +13 -0
  43. package/src/widgets/form/MonthPicker.js +25 -21
  44. package/src/widgets/grid/Grid.js +3421 -3421
  45. package/src/widgets/nav/Route.js +102 -102
@@ -1,102 +1,102 @@
1
- import { Widget } from "../../ui/Widget";
2
- import { PureContainer } from "../../ui/PureContainer";
3
- import RouteMatcher from "route-parser";
4
- import { ReadOnlyDataView } from "../../data/ReadOnlyDataView";
5
- import { routeAppend } from "../../util/routeAppend";
6
-
7
- export class Route extends PureContainer {
8
- init() {
9
- if (this.path) this.route = this.path;
10
-
11
- super.init();
12
-
13
- if (this.route && this.route[0] !== "+")
14
- this.matcher = new RouteMatcher(this.route + (this.prefix ? "(*remainder)" : ""));
15
- }
16
-
17
- initInstance(context, instance) {
18
- instance.store = new ReadOnlyDataView({
19
- store: instance.parentStore,
20
- });
21
- super.initInstance(context, instance);
22
- }
23
-
24
- applyParentStore(instance) {
25
- instance.store.setStore(instance.parentStore);
26
- }
27
-
28
- declareData() {
29
- super.declareData(...arguments, {
30
- url: undefined,
31
- });
32
- }
33
-
34
- checkVisible(context, instance, data) {
35
- if (!data.visible) return false;
36
-
37
- if (data.url !== instance.cached.url) {
38
- instance.cached.url = data.url;
39
- let matcher = this.matcher;
40
- let route = this.route;
41
- if (this.route[0] === "+") {
42
- route = routeAppend(context.lastRoute.route, this.route.substring(1));
43
- if (!instance.cached.matcher || instance.cached.route !== route)
44
- instance.cached.matcher = new RouteMatcher(route + (this.prefix ? "(*remainder)" : ""));
45
- matcher = instance.cached.matcher;
46
- }
47
- instance.cached.result = matcher.match(data.url);
48
- instance.cached.matcher = matcher;
49
- instance.cached.route = data.route = route;
50
- }
51
- if (!instance.cached.result) return false;
52
-
53
- return super.checkVisible(context, instance, data);
54
- }
55
-
56
- prepareData(context, { data, store, cached }) {
57
- super.prepareData(...arguments);
58
-
59
- store.setData({
60
- [this.recordName]: cached.result,
61
- });
62
-
63
- //TODO: Replace comparison with deepEquals
64
- if (this.params && this.params.bind) {
65
- var params = store.get(this.params.bind);
66
- if (JSON.stringify(params) != JSON.stringify(cached.result)) {
67
- store.set(this.params.bind, cached.result);
68
- }
69
- }
70
-
71
- if (this.map) {
72
- for (var key in result) {
73
- var binding = this.map[key];
74
- if (binding) store.set(binding, result[key]);
75
- }
76
- }
77
- }
78
-
79
- explore(context, instance) {
80
- context.push("lastRoute", {
81
- route: instance.cached.route,
82
- result: instance.cached.result,
83
- reverse: function (data) {
84
- return instance.cached.matcher.reverse({
85
- ...instance.cached.result,
86
- remainder: "",
87
- ...data,
88
- });
89
- },
90
- });
91
- super.explore(context, instance);
92
- }
93
-
94
- exploreCleanup(context, instance) {
95
- context.pop("lastRoute");
96
- }
97
- }
98
-
99
- Route.prototype.recordName = "$route";
100
- Route.prototype.prefix = false;
101
-
102
- Widget.alias("route", Route);
1
+ import { Widget } from "../../ui/Widget";
2
+ import { PureContainer } from "../../ui/PureContainer";
3
+ import RouteMatcher from "route-parser";
4
+ import { ReadOnlyDataView } from "../../data/ReadOnlyDataView";
5
+ import { routeAppend } from "../../util/routeAppend";
6
+
7
+ export class Route extends PureContainer {
8
+ init() {
9
+ if (this.path) this.route = this.path;
10
+
11
+ super.init();
12
+
13
+ if (this.route && this.route[0] !== "+")
14
+ this.matcher = new RouteMatcher(this.route + (this.prefix ? "(*remainder)" : ""));
15
+ }
16
+
17
+ initInstance(context, instance) {
18
+ instance.store = new ReadOnlyDataView({
19
+ store: instance.parentStore,
20
+ });
21
+ super.initInstance(context, instance);
22
+ }
23
+
24
+ applyParentStore(instance) {
25
+ instance.store.setStore(instance.parentStore);
26
+ }
27
+
28
+ declareData() {
29
+ super.declareData(...arguments, {
30
+ url: undefined,
31
+ });
32
+ }
33
+
34
+ checkVisible(context, instance, data) {
35
+ if (!data.visible) return false;
36
+
37
+ if (data.url !== instance.cached.url) {
38
+ instance.cached.url = data.url;
39
+ let matcher = this.matcher;
40
+ let route = this.route;
41
+ if (this.route[0] === "+") {
42
+ route = routeAppend(context.lastRoute.route, this.route.substring(1));
43
+ if (!instance.cached.matcher || instance.cached.route !== route)
44
+ instance.cached.matcher = new RouteMatcher(route + (this.prefix ? "(*remainder)" : ""));
45
+ matcher = instance.cached.matcher;
46
+ }
47
+ instance.cached.result = matcher.match(data.url);
48
+ instance.cached.matcher = matcher;
49
+ instance.cached.route = data.route = route;
50
+ }
51
+ if (!instance.cached.result) return false;
52
+
53
+ return super.checkVisible(context, instance, data);
54
+ }
55
+
56
+ prepareData(context, { data, store, cached }) {
57
+ super.prepareData(...arguments);
58
+
59
+ store.setData({
60
+ [this.recordName]: cached.result,
61
+ });
62
+
63
+ //TODO: Replace comparison with deepEquals
64
+ if (this.params && this.params.bind) {
65
+ var params = store.get(this.params.bind);
66
+ if (JSON.stringify(params) != JSON.stringify(cached.result)) {
67
+ store.set(this.params.bind, cached.result);
68
+ }
69
+ }
70
+
71
+ if (this.map) {
72
+ for (var key in result) {
73
+ var binding = this.map[key];
74
+ if (binding) store.set(binding, result[key]);
75
+ }
76
+ }
77
+ }
78
+
79
+ explore(context, instance) {
80
+ context.push("lastRoute", {
81
+ route: instance.cached.route,
82
+ result: instance.cached.result,
83
+ reverse: function (data) {
84
+ return instance.cached.matcher.reverse({
85
+ ...instance.cached.result,
86
+ remainder: "",
87
+ ...data,
88
+ });
89
+ },
90
+ });
91
+ super.explore(context, instance);
92
+ }
93
+
94
+ exploreCleanup(context, instance) {
95
+ context.pop("lastRoute");
96
+ }
97
+ }
98
+
99
+ Route.prototype.recordName = "$route";
100
+ Route.prototype.prefix = false;
101
+
102
+ Widget.alias("route", Route);