@reltio/components 1.4.1909 → 1.4.1910
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/cjs/ProfileResizablePanes/ProfileResizablePanes.spec.js +113 -68
- package/cjs/ResizablePanes/ResizablePanes.d.ts +3 -2
- package/cjs/ResizablePanes/ResizablePanes.js +83 -16
- package/cjs/ResizablePanes/ResizablePanes.test.js +289 -0
- package/cjs/ResizablePanes/styles.d.ts +1 -1
- package/cjs/ResizablePanes/styles.js +47 -38
- package/cjs/SimpleMatchRulesBlock/SimpleMatchRulesBlock.js +1 -1
- package/cjs/SimpleMatchRulesBlock/SimpleMatchRulesBlock.test.js +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +2 -1
- package/cjs/test-utils/index.d.ts +1 -0
- package/cjs/test-utils/index.js +15 -1
- package/esm/ProfileResizablePanes/ProfileResizablePanes.spec.js +113 -68
- package/esm/ResizablePanes/ResizablePanes.d.ts +3 -2
- package/esm/ResizablePanes/ResizablePanes.js +84 -17
- package/esm/ResizablePanes/ResizablePanes.test.js +284 -0
- package/esm/ResizablePanes/styles.d.ts +1 -1
- package/esm/ResizablePanes/styles.js +47 -38
- package/esm/SimpleMatchRulesBlock/SimpleMatchRulesBlock.js +1 -1
- package/esm/SimpleMatchRulesBlock/SimpleMatchRulesBlock.test.js +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/test-utils/index.d.ts +1 -0
- package/esm/test-utils/index.js +13 -0
- package/package.json +3 -3
- package/cjs/ResizablePanes/ResizablePanes.spec.js +0 -192
- package/esm/ResizablePanes/ResizablePanes.spec.js +0 -164
- /package/cjs/ResizablePanes/{ResizablePanes.spec.d.ts → ResizablePanes.test.d.ts} +0 -0
- /package/esm/ResizablePanes/{ResizablePanes.spec.d.ts → ResizablePanes.test.d.ts} +0 -0
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
import React from 'react';
|
|
49
|
+
import { render, screen } from '@testing-library/react';
|
|
50
|
+
import userEvent from '@testing-library/user-event';
|
|
51
|
+
import { ResizablePanes } from './ResizablePanes';
|
|
52
|
+
import { delayPromise } from '../test-utils';
|
|
53
|
+
var defaultProps = {
|
|
54
|
+
allowResize: true,
|
|
55
|
+
children: []
|
|
56
|
+
};
|
|
57
|
+
var setUp = function (props) {
|
|
58
|
+
if (props === void 0) { props = defaultProps; }
|
|
59
|
+
var user = userEvent.setup();
|
|
60
|
+
return __assign(__assign({}, render(React.createElement(ResizablePanes, __assign({}, props),
|
|
61
|
+
React.createElement("div", null, "Panel 1 content"),
|
|
62
|
+
React.createElement("div", null, "Panel 2 content")))), { user: user });
|
|
63
|
+
};
|
|
64
|
+
var getPanel1 = function (container) { return container.querySelectorAll('[data-panel-id]')[0]; };
|
|
65
|
+
var getPanel2 = function (container) { return container.querySelectorAll('[data-panel-id]')[1]; };
|
|
66
|
+
var getResizeHandle = function (container) { return container.querySelector('[data-resize-handle]'); };
|
|
67
|
+
var isResizingDisabled = function (container) {
|
|
68
|
+
return getResizeHandle(container).getAttribute('data-panel-resize-handle-enabled') === 'false';
|
|
69
|
+
};
|
|
70
|
+
var checkPanelSize = function (panel, size) { return expect(panel.getAttribute('data-panel-size')).toBe(size); };
|
|
71
|
+
var moveResizeHandle = function (container, user, from, to) { return __awaiter(void 0, void 0, void 0, function () {
|
|
72
|
+
var resizeHandle;
|
|
73
|
+
return __generator(this, function (_a) {
|
|
74
|
+
switch (_a.label) {
|
|
75
|
+
case 0:
|
|
76
|
+
resizeHandle = getResizeHandle(container);
|
|
77
|
+
return [4 /*yield*/, user.pointer([
|
|
78
|
+
{
|
|
79
|
+
keys: '[MouseLeft>]',
|
|
80
|
+
target: resizeHandle,
|
|
81
|
+
coords: {
|
|
82
|
+
x: from.x,
|
|
83
|
+
y: from.y
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
target: resizeHandle,
|
|
88
|
+
coords: {
|
|
89
|
+
x: to.x,
|
|
90
|
+
y: to.y
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
keys: '[/MouseLeft]',
|
|
95
|
+
target: resizeHandle,
|
|
96
|
+
coords: {
|
|
97
|
+
x: to.x,
|
|
98
|
+
y: to.y
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
])];
|
|
102
|
+
case 1:
|
|
103
|
+
_a.sent();
|
|
104
|
+
return [2 /*return*/];
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}); };
|
|
108
|
+
describe('ResizablePanes tests', function () {
|
|
109
|
+
beforeAll(function () {
|
|
110
|
+
jest.spyOn(HTMLElement.prototype, 'clientWidth', 'get').mockReturnValue(1000);
|
|
111
|
+
jest.spyOn(HTMLElement.prototype, 'getBoundingClientRect').mockReturnValue({
|
|
112
|
+
width: 1000,
|
|
113
|
+
height: 1000,
|
|
114
|
+
top: 0,
|
|
115
|
+
left: 0,
|
|
116
|
+
right: 1000,
|
|
117
|
+
bottom: 1000,
|
|
118
|
+
x: 0,
|
|
119
|
+
y: 0,
|
|
120
|
+
toJSON: function () { return ''; }
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
it('should render main parts', function () {
|
|
124
|
+
var container = setUp().container;
|
|
125
|
+
expect(getPanel1(container)).toBeInTheDocument();
|
|
126
|
+
expect(screen.getByText('Panel 1 content')).toBeInTheDocument();
|
|
127
|
+
expect(getPanel2(container)).toBeInTheDocument();
|
|
128
|
+
expect(screen.getByText('Panel 2 content')).toBeInTheDocument();
|
|
129
|
+
expect(getResizeHandle(container)).toBeInTheDocument();
|
|
130
|
+
});
|
|
131
|
+
it('should allow to resize the panels', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
132
|
+
var _a, container, user;
|
|
133
|
+
return __generator(this, function (_b) {
|
|
134
|
+
switch (_b.label) {
|
|
135
|
+
case 0:
|
|
136
|
+
_a = setUp(__assign(__assign({}, defaultProps), { size: '320px', minSize: '320px', maxSize: '640px', onChange: function () { }, debounceInterval: 0 })), container = _a.container, user = _a.user;
|
|
137
|
+
expect(isResizingDisabled(container)).toBe(false);
|
|
138
|
+
checkPanelSize(getPanel1(container), '32.0');
|
|
139
|
+
checkPanelSize(getPanel2(container), '68.0');
|
|
140
|
+
// move mouse to an x-coordinate between minSize and maxSize
|
|
141
|
+
return [4 /*yield*/, moveResizeHandle(container, user, { x: 320, y: 0 }, { x: 500, y: 20 })];
|
|
142
|
+
case 1:
|
|
143
|
+
// move mouse to an x-coordinate between minSize and maxSize
|
|
144
|
+
_b.sent();
|
|
145
|
+
checkPanelSize(getPanel1(container), '50.0');
|
|
146
|
+
checkPanelSize(getPanel2(container), '50.0');
|
|
147
|
+
// move mouse to a larger x-coordinate than max size
|
|
148
|
+
return [4 /*yield*/, moveResizeHandle(container, user, { x: 500, y: 0 }, { x: 650, y: 20 })];
|
|
149
|
+
case 2:
|
|
150
|
+
// move mouse to a larger x-coordinate than max size
|
|
151
|
+
_b.sent();
|
|
152
|
+
checkPanelSize(getPanel1(container), '64.0');
|
|
153
|
+
checkPanelSize(getPanel2(container), '36.0');
|
|
154
|
+
// move mouse to a smaller x-coordinate than min size
|
|
155
|
+
return [4 /*yield*/, moveResizeHandle(container, user, { x: 640, y: 0 }, { x: 310, y: 20 })];
|
|
156
|
+
case 3:
|
|
157
|
+
// move mouse to a smaller x-coordinate than min size
|
|
158
|
+
_b.sent();
|
|
159
|
+
checkPanelSize(getPanel1(container), '32.0');
|
|
160
|
+
checkPanelSize(getPanel2(container), '68.0');
|
|
161
|
+
return [2 /*return*/];
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}); });
|
|
165
|
+
it('should call onChange prop with debounce on panels resizing', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
166
|
+
var debounceInterval, props, _a, user, container;
|
|
167
|
+
return __generator(this, function (_b) {
|
|
168
|
+
switch (_b.label) {
|
|
169
|
+
case 0:
|
|
170
|
+
debounceInterval = 200;
|
|
171
|
+
props = __assign(__assign({}, defaultProps), { size: 320, debounceInterval: debounceInterval, onChange: jest.fn() });
|
|
172
|
+
_a = setUp(props), user = _a.user, container = _a.container;
|
|
173
|
+
return [4 /*yield*/, moveResizeHandle(container, user, { x: 320, y: 0 }, { x: 510, y: 20 })];
|
|
174
|
+
case 1:
|
|
175
|
+
_b.sent();
|
|
176
|
+
expect(props.onChange).not.toHaveBeenCalled();
|
|
177
|
+
return [4 /*yield*/, delayPromise(debounceInterval + 1)];
|
|
178
|
+
case 2:
|
|
179
|
+
_b.sent();
|
|
180
|
+
expect(props.onChange).toHaveBeenCalledWith({
|
|
181
|
+
isMaxSize: false,
|
|
182
|
+
isMinSize: false,
|
|
183
|
+
percentageSize: '51%',
|
|
184
|
+
size: 510
|
|
185
|
+
});
|
|
186
|
+
return [2 /*return*/];
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}); });
|
|
190
|
+
it('should set correct isMaxSize in props.onChange argument for positive props.maxSize', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
191
|
+
var debounceInterval, props, _a, user, container;
|
|
192
|
+
return __generator(this, function (_b) {
|
|
193
|
+
switch (_b.label) {
|
|
194
|
+
case 0:
|
|
195
|
+
debounceInterval = 0;
|
|
196
|
+
props = __assign(__assign({}, defaultProps), { size: 320, maxSize: 500, debounceInterval: debounceInterval, onChange: jest.fn() });
|
|
197
|
+
_a = setUp(props), user = _a.user, container = _a.container;
|
|
198
|
+
return [4 /*yield*/, moveResizeHandle(container, user, { x: 320, y: 0 }, { x: 510, y: 20 })];
|
|
199
|
+
case 1:
|
|
200
|
+
_b.sent();
|
|
201
|
+
expect(props.onChange).toHaveBeenCalledWith({
|
|
202
|
+
isMaxSize: true,
|
|
203
|
+
isMinSize: false,
|
|
204
|
+
percentageSize: '50%',
|
|
205
|
+
size: 500
|
|
206
|
+
});
|
|
207
|
+
return [2 /*return*/];
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
}); });
|
|
211
|
+
it('should set correct isMaxSize in props.onChange argument for negative props.maxSize', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
212
|
+
var debounceInterval, props, _a, user, container;
|
|
213
|
+
return __generator(this, function (_b) {
|
|
214
|
+
switch (_b.label) {
|
|
215
|
+
case 0:
|
|
216
|
+
debounceInterval = 0;
|
|
217
|
+
props = __assign(__assign({}, defaultProps), { size: 320, maxSize: -200, debounceInterval: debounceInterval, onChange: jest.fn() });
|
|
218
|
+
_a = setUp(props), user = _a.user, container = _a.container;
|
|
219
|
+
return [4 /*yield*/, moveResizeHandle(container, user, { x: 320, y: 0 }, { x: 800, y: 20 })];
|
|
220
|
+
case 1:
|
|
221
|
+
_b.sent();
|
|
222
|
+
expect(props.onChange).toHaveBeenCalledWith({
|
|
223
|
+
isMaxSize: true,
|
|
224
|
+
isMinSize: false,
|
|
225
|
+
percentageSize: '80%',
|
|
226
|
+
size: 800
|
|
227
|
+
});
|
|
228
|
+
return [2 /*return*/];
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
}); });
|
|
232
|
+
it('should set correct isMaxSize in props.onChange argument if props.maxSize omitted', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
233
|
+
var debounceInterval, props, _a, user, container;
|
|
234
|
+
return __generator(this, function (_b) {
|
|
235
|
+
switch (_b.label) {
|
|
236
|
+
case 0:
|
|
237
|
+
debounceInterval = 0;
|
|
238
|
+
props = __assign(__assign({}, defaultProps), { size: 320, debounceInterval: debounceInterval, onChange: jest.fn() });
|
|
239
|
+
_a = setUp(props), user = _a.user, container = _a.container;
|
|
240
|
+
return [4 /*yield*/, moveResizeHandle(container, user, { x: 320, y: 0 }, { x: 1000, y: 20 })];
|
|
241
|
+
case 1:
|
|
242
|
+
_b.sent();
|
|
243
|
+
expect(props.onChange).toHaveBeenCalledWith({
|
|
244
|
+
isMaxSize: true,
|
|
245
|
+
isMinSize: false,
|
|
246
|
+
percentageSize: '100%',
|
|
247
|
+
size: 1000
|
|
248
|
+
});
|
|
249
|
+
return [2 /*return*/];
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
}); });
|
|
253
|
+
it('should set correct isMinSize in props.onChange argument for positive props.minSize', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
254
|
+
var debounceInterval, props, _a, user, container;
|
|
255
|
+
return __generator(this, function (_b) {
|
|
256
|
+
switch (_b.label) {
|
|
257
|
+
case 0:
|
|
258
|
+
debounceInterval = 0;
|
|
259
|
+
props = __assign(__assign({}, defaultProps), { size: 320, minSize: 200, debounceInterval: debounceInterval, onChange: jest.fn() });
|
|
260
|
+
_a = setUp(props), user = _a.user, container = _a.container;
|
|
261
|
+
return [4 /*yield*/, moveResizeHandle(container, user, { x: 320, y: 0 }, { x: 200, y: 20 })];
|
|
262
|
+
case 1:
|
|
263
|
+
_b.sent();
|
|
264
|
+
expect(props.onChange).toHaveBeenCalledWith({
|
|
265
|
+
isMaxSize: false,
|
|
266
|
+
isMinSize: true,
|
|
267
|
+
percentageSize: '20%',
|
|
268
|
+
size: 200
|
|
269
|
+
});
|
|
270
|
+
return [2 /*return*/];
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
}); });
|
|
274
|
+
it('should apply negative size correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
275
|
+
var props, container;
|
|
276
|
+
return __generator(this, function (_a) {
|
|
277
|
+
props = __assign(__assign({}, defaultProps), { size: -40 });
|
|
278
|
+
container = setUp(props).container;
|
|
279
|
+
checkPanelSize(getPanel1(container), '96.0');
|
|
280
|
+
checkPanelSize(getPanel2(container), '4.0');
|
|
281
|
+
return [2 /*return*/];
|
|
282
|
+
});
|
|
283
|
+
}); });
|
|
284
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"container">;
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"container" | "horizontal" | "vertical" | "resizer" | "disabled" | "panel">;
|
|
@@ -1,46 +1,55 @@
|
|
|
1
1
|
import { makeStyles } from '@mui/styles';
|
|
2
2
|
export var useStyles = makeStyles(function () { return ({
|
|
3
3
|
container: {
|
|
4
|
-
position: 'relative'
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
position: 'relative'
|
|
5
|
+
},
|
|
6
|
+
panel: {
|
|
7
|
+
position: 'relative'
|
|
8
|
+
},
|
|
9
|
+
horizontal: {},
|
|
10
|
+
vertical: {},
|
|
11
|
+
disabled: {},
|
|
12
|
+
resizer: {
|
|
13
|
+
zIndex: 1,
|
|
14
|
+
boxSizing: 'border-box',
|
|
15
|
+
backgroundClip: 'padding-box',
|
|
16
|
+
'&$disabled': {
|
|
17
|
+
cursor: 'initial',
|
|
18
|
+
height: 0,
|
|
19
|
+
margin: 0
|
|
20
|
+
},
|
|
21
|
+
'&$horizontal': {
|
|
22
|
+
height: '11px',
|
|
23
|
+
backgroundImage: 'linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))',
|
|
24
|
+
backgroundRepeat: 'no-repeat',
|
|
25
|
+
backgroundSize: '100% 1px',
|
|
26
|
+
backgroundPosition: 'top',
|
|
27
|
+
width: '100%',
|
|
28
|
+
marginBottom: '-10px',
|
|
29
|
+
'&$disabled': {
|
|
30
|
+
background: 'transparent'
|
|
13
31
|
},
|
|
14
|
-
'
|
|
15
|
-
|
|
16
|
-
backgroundImage: 'linear-gradient(rgba(0,0,0,0.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
'&:not($disabled):hover': {
|
|
33
|
+
cursor: 'ns-resize',
|
|
34
|
+
backgroundImage: 'linear-gradient(rgba(0, 114, 206, 0), rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1))',
|
|
35
|
+
backgroundSize: '100% 3px'
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
'&$vertical': {
|
|
39
|
+
width: '11px',
|
|
40
|
+
backgroundImage: 'linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))',
|
|
41
|
+
backgroundRepeat: 'no-repeat',
|
|
42
|
+
backgroundSize: '1px 100%',
|
|
43
|
+
backgroundPosition: 'left',
|
|
44
|
+
height: '100%',
|
|
45
|
+
marginRight: '-10px',
|
|
46
|
+
'&$disabled': {
|
|
47
|
+
background: 'transparent'
|
|
30
48
|
},
|
|
31
|
-
'
|
|
32
|
-
|
|
33
|
-
backgroundImage: 'linear-gradient(rgba(0,
|
|
34
|
-
|
|
35
|
-
backgroundSize: '1px 100%',
|
|
36
|
-
backgroundPosition: 'left',
|
|
37
|
-
height: '100%',
|
|
38
|
-
marginRight: '-10px',
|
|
39
|
-
'&:not(.disabled):hover': {
|
|
40
|
-
cursor: 'col-resize',
|
|
41
|
-
backgroundImage: 'linear-gradient(to left, rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1), rgba(0, 114, 206, 0.35))',
|
|
42
|
-
backgroundSize: '3px 100%'
|
|
43
|
-
}
|
|
49
|
+
'&:not($disabled):hover': {
|
|
50
|
+
cursor: 'ew-resize',
|
|
51
|
+
backgroundImage: 'linear-gradient(to left, rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1), rgba(0, 114, 206, 0.35))',
|
|
52
|
+
backgroundSize: '3px 100%'
|
|
44
53
|
}
|
|
45
54
|
}
|
|
46
55
|
}
|
|
@@ -15,6 +15,6 @@ export var SimpleMatchRulesBlock = function (_a) {
|
|
|
15
15
|
return (React.createElement("div", { className: styles.container, "data-reltio-id": "simple-match-rules-block" },
|
|
16
16
|
React.createElement(MatchRuleBadgeWithTooltip, { tooltipTitle: React.createElement(MatchRulesTooltip, { matchRules: matchRules, isMlMatch: isMlMatch }), tooltipPlacement: "bottom-start", onExpand: handleOnExpand, expanded: expanded }, isMlMatch ? (React.createElement(React.Fragment, null,
|
|
17
17
|
React.createElement(AIPowered, { className: styles.icon }),
|
|
18
|
-
i18n.text('AI-
|
|
18
|
+
i18n.text('AI-powered'))) : (i18n.text('Rules'))),
|
|
19
19
|
expanded ? (React.createElement(SimpleMatchRules, { className: styles.rulesContainer, matchRules: matchRules, isMlMatch: isMlMatch, matchRuleSummaries: matchRuleSummaries })) : null));
|
|
20
20
|
};
|
|
@@ -31,7 +31,7 @@ describe('SimpleMatchRulesBlock test', function () {
|
|
|
31
31
|
});
|
|
32
32
|
it('should render correct MatchRuleBadgeWithTooltip for Ml match', function () {
|
|
33
33
|
var component = shallow(React.createElement(SimpleMatchRulesBlock, { isMlMatch: true, matchRules: matchRules }));
|
|
34
|
-
expect(getMatchRuleBadgeWithTooltip(component).text()).toBe('<AIPowered />AI-
|
|
34
|
+
expect(getMatchRuleBadgeWithTooltip(component).text()).toBe('<AIPowered />AI-powered');
|
|
35
35
|
});
|
|
36
36
|
it('should render correct MatchRuleBadgeWithTooltip for non Ml match', function () {
|
|
37
37
|
var component = shallow(React.createElement(SimpleMatchRulesBlock, { matchRules: matchRules }));
|
package/esm/index.d.ts
CHANGED
|
@@ -270,7 +270,7 @@ export * from './types';
|
|
|
270
270
|
export * from './constants';
|
|
271
271
|
export { TestPerspectivesSettingsProvider } from './test-utils/TestPerspectiveSettingsProvider';
|
|
272
272
|
export { TestStylesProvider } from './test-utils/TestStylesProvider';
|
|
273
|
-
export { awaitMockPromises, deepFreeze, delayPromise, getMuiIconByName, getMuiIconsByName, mockBasicTableSizing, mockElementSizes, rerenderWrapper, FakeMouseEvent } from './test-utils';
|
|
273
|
+
export { awaitMockPromises, deepFreeze, delayPromise, getMuiIconByName, getMuiIconsByName, mockBasicTableSizing, fixClicksOnResizablePanes, mockElementSizes, rerenderWrapper, FakeMouseEvent } from './test-utils';
|
|
274
274
|
export * from './features/activity-log';
|
|
275
275
|
export * from './features/crosswalks';
|
|
276
276
|
export * from './features/graph';
|
package/esm/index.js
CHANGED
|
@@ -273,7 +273,7 @@ export * from './constants';
|
|
|
273
273
|
// test-utils
|
|
274
274
|
export { TestPerspectivesSettingsProvider } from './test-utils/TestPerspectiveSettingsProvider';
|
|
275
275
|
export { TestStylesProvider } from './test-utils/TestStylesProvider';
|
|
276
|
-
export { awaitMockPromises, deepFreeze, delayPromise, getMuiIconByName, getMuiIconsByName, mockBasicTableSizing, mockElementSizes, rerenderWrapper, FakeMouseEvent } from './test-utils';
|
|
276
|
+
export { awaitMockPromises, deepFreeze, delayPromise, getMuiIconByName, getMuiIconsByName, mockBasicTableSizing, fixClicksOnResizablePanes, mockElementSizes, rerenderWrapper, FakeMouseEvent } from './test-utils';
|
|
277
277
|
// features / activity-log
|
|
278
278
|
export * from './features/activity-log';
|
|
279
279
|
// features / crosswalks
|
|
@@ -15,6 +15,7 @@ export declare const mockBasicTableSizing: ({ width, height }?: {
|
|
|
15
15
|
width?: number;
|
|
16
16
|
height?: number;
|
|
17
17
|
}) => () => void;
|
|
18
|
+
export declare const fixClicksOnResizablePanes: () => void;
|
|
18
19
|
export declare const getMuiIconByName: (name: string, el?: HTMLElement) => HTMLElement;
|
|
19
20
|
export declare const getMuiIconsByName: (name: string, el?: HTMLElement) => HTMLElement[];
|
|
20
21
|
interface MouseEventWithOffsets extends MouseEventInit {
|
package/esm/test-utils/index.js
CHANGED
|
@@ -128,6 +128,19 @@ export var mockBasicTableSizing = function (_a) {
|
|
|
128
128
|
mock();
|
|
129
129
|
return unmock;
|
|
130
130
|
};
|
|
131
|
+
var originalPreventDefault = Event.prototype.preventDefault;
|
|
132
|
+
export var fixClicksOnResizablePanes = function () {
|
|
133
|
+
// https://github.com/bvaughn/react-resizable-panels/issues/367
|
|
134
|
+
// https://github.com/testing-library/user-event/issues/1206
|
|
135
|
+
// Workaround until the user-event issue is resolved
|
|
136
|
+
jest.spyOn(Event.prototype, 'preventDefault').mockImplementation(function () {
|
|
137
|
+
var e = this;
|
|
138
|
+
if (e.currentTarget === document.body && e.eventPhase === Event.CAPTURING_PHASE) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
originalPreventDefault.call(e);
|
|
142
|
+
});
|
|
143
|
+
};
|
|
131
144
|
export var getMuiIconByName = function (name, el) {
|
|
132
145
|
if (el === void 0) { el = document.documentElement; }
|
|
133
146
|
var dataTestId = name + 'Icon';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1910",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE FILE",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@fluentui/react-context-selector": "^9.1.26",
|
|
9
9
|
"@react-google-maps/api": "2.7.0",
|
|
10
10
|
"@react-sigma/core": "3.4.0",
|
|
11
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1839",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"react-lifecycles-compat": "^3.0.4",
|
|
32
32
|
"react-mentions": "4.3.0",
|
|
33
33
|
"react-number-format": "^4.3.0",
|
|
34
|
+
"react-resizable-panels": "^2.0.20",
|
|
34
35
|
"react-resize-detector": "^4.2.0",
|
|
35
36
|
"react-router-dom": "^6.2.1",
|
|
36
37
|
"react-select": "^3.0.4",
|
|
37
38
|
"react-simple-maps": "^2.3.0",
|
|
38
|
-
"react-split-pane": "^0.1.89",
|
|
39
39
|
"react-virtualized": "^9.21.2",
|
|
40
40
|
"react-window": "^1.8.5",
|
|
41
41
|
"recharts": "^2.10.1",
|