cx 26.6.0 → 26.7.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.
Files changed (69) hide show
  1. package/build/data/ExposedValueView.js +1 -1
  2. package/build/data/comparer.d.ts +6 -8
  3. package/build/data/comparer.d.ts.map +1 -1
  4. package/build/ui/Cx.d.ts +5 -0
  5. package/build/ui/Cx.d.ts.map +1 -1
  6. package/build/ui/Cx.js +34 -3
  7. package/build/ui/Prop.d.ts +1 -1
  8. package/build/ui/Prop.d.ts.map +1 -1
  9. package/build/ui/Restate.d.ts +6 -0
  10. package/build/ui/Restate.d.ts.map +1 -1
  11. package/build/ui/Restate.js +2 -1
  12. package/build/ui/adapter/ArrayAdapter.d.ts +4 -6
  13. package/build/ui/adapter/ArrayAdapter.d.ts.map +1 -1
  14. package/build/ui/adapter/GroupAdapter.d.ts +22 -2
  15. package/build/ui/adapter/GroupAdapter.d.ts.map +1 -1
  16. package/build/ui/adapter/GroupAdapter.js +80 -5
  17. package/build/widgets/DocumentTitle.d.ts.map +1 -1
  18. package/build/widgets/DocumentTitle.js +2 -0
  19. package/build/widgets/drag-drop/DragSource.d.ts +3 -2
  20. package/build/widgets/drag-drop/DragSource.d.ts.map +1 -1
  21. package/build/widgets/drag-drop/DropZone.d.ts +4 -4
  22. package/build/widgets/drag-drop/DropZone.d.ts.map +1 -1
  23. package/build/widgets/drag-drop/ops.d.ts +13 -2
  24. package/build/widgets/drag-drop/ops.d.ts.map +1 -1
  25. package/build/widgets/drag-drop/ops.js +36 -9
  26. package/build/widgets/form/NumberField.js +1 -0
  27. package/build/widgets/grid/Grid.d.ts +19 -3
  28. package/build/widgets/grid/Grid.d.ts.map +1 -1
  29. package/build/widgets/grid/Grid.js +2 -0
  30. package/build/widgets/grid/TreeNode.d.ts +2 -0
  31. package/build/widgets/grid/TreeNode.d.ts.map +1 -1
  32. package/build/widgets/overlay/captureMouse.d.ts +4 -4
  33. package/build/widgets/overlay/captureMouse.d.ts.map +1 -1
  34. package/build/widgets/overlay/captureMouse.js +8 -3
  35. package/dist/data.js +1 -1
  36. package/dist/manifest.js +866 -866
  37. package/dist/ui.js +130 -12
  38. package/dist/widgets.css +4 -0
  39. package/dist/widgets.js +43 -10
  40. package/package.json +1 -1
  41. package/src/data/ExposedValueView.spec.ts +57 -0
  42. package/src/data/ExposedValueView.ts +1 -1
  43. package/src/data/comparer.ts +6 -7
  44. package/src/ui/Cx.tsx +44 -3
  45. package/src/ui/DataProxy.ts +55 -55
  46. package/src/ui/Prop.ts +1 -1
  47. package/src/ui/Rescope.ts +50 -50
  48. package/src/ui/Restate.tsx +9 -0
  49. package/src/ui/adapter/ArrayAdapter.ts +6 -8
  50. package/src/ui/adapter/GroupAdapter.spec.ts +75 -0
  51. package/src/ui/adapter/GroupAdapter.ts +103 -10
  52. package/src/ui/exprHelpers.ts +96 -96
  53. package/src/widgets/DocumentTitle.ts +2 -0
  54. package/src/widgets/Sandbox.ts +104 -104
  55. package/src/widgets/drag-drop/DragSource.tsx +3 -3
  56. package/src/widgets/drag-drop/DropZone.tsx +5 -5
  57. package/src/widgets/drag-drop/ops.tsx +54 -12
  58. package/src/widgets/form/ColorField.scss +112 -112
  59. package/src/widgets/form/DateTimeField.scss +111 -111
  60. package/src/widgets/form/LookupField.maps.scss +26 -26
  61. package/src/widgets/form/MonthField.scss +113 -113
  62. package/src/widgets/form/NumberField.scss +4 -0
  63. package/src/widgets/form/NumberField.tsx +1 -0
  64. package/src/widgets/form/Select.scss +104 -104
  65. package/src/widgets/form/TextField.scss +66 -66
  66. package/src/widgets/grid/Grid.tsx +23 -2
  67. package/src/widgets/grid/TreeNode.tsx +3 -0
  68. package/src/widgets/nav/MenuItem.tsx +525 -525
  69. package/src/widgets/overlay/captureMouse.ts +14 -7
@@ -31,7 +31,7 @@ interface CaptureMouseOptions {
31
31
  export function captureMouse2(
32
32
  e: React.MouseEvent | React.TouchEvent | MouseEvent | TouchEvent,
33
33
  options: CaptureMouseOptions,
34
- ): void {
34
+ ): () => void {
35
35
  let surface = document.createElement("div");
36
36
  surface.className = "cxb-mousecapture";
37
37
  surface.style.cursor = options.cursor || getComputedStyle(e.currentTarget as Element).cursor;
@@ -67,6 +67,8 @@ export function captureMouse2(
67
67
 
68
68
  e.stopPropagation();
69
69
 
70
+ return tear;
71
+
70
72
  function move(e: Event) {
71
73
  if (!active) {
72
74
  tear();
@@ -110,7 +112,7 @@ export function captureMouse2(
110
112
  export function captureMouseOrTouch2(
111
113
  e: React.MouseEvent | React.TouchEvent | MouseEvent | TouchEvent,
112
114
  options: CaptureMouseOptions,
113
- ): void {
115
+ ): () => void {
114
116
  if (e.type.indexOf("touch") == 0) {
115
117
  let el = e.currentTarget as HTMLElement;
116
118
 
@@ -136,7 +138,12 @@ export function captureMouseOrTouch2(
136
138
  el.addEventListener("touchend", end);
137
139
 
138
140
  e.stopPropagation();
139
- } else captureMouse2(e, options);
141
+
142
+ return () => {
143
+ el.removeEventListener("touchmove", move);
144
+ el.removeEventListener("touchend", end);
145
+ };
146
+ } else return captureMouse2(e, options);
140
147
  }
141
148
 
142
149
  /**
@@ -153,8 +160,8 @@ export function captureMouse(
153
160
  onMouseUp?: (e: MouseEvent | TouchEvent, captureData?: any) => void,
154
161
  captureData?: any,
155
162
  cursor?: string,
156
- ): void {
157
- captureMouse2(e, {
163
+ ): () => void {
164
+ return captureMouse2(e, {
158
165
  onMouseMove,
159
166
  onMouseUp,
160
167
  captureData,
@@ -176,8 +183,8 @@ export function captureMouseOrTouch(
176
183
  onMouseUp?: (e: MouseEvent, captureData?: any) => void,
177
184
  captureData?: any,
178
185
  cursor?: string,
179
- ): void {
180
- captureMouseOrTouch2(e, { onMouseMove, onMouseUp, captureData, cursor });
186
+ ): () => void {
187
+ return captureMouseOrTouch2(e, { onMouseMove, onMouseUp, captureData, cursor });
181
188
  }
182
189
 
183
190
  /**