@reltio/components 1.4.2192 → 1.4.2194
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/AttributesFiltersBuilder/AttributesFiltersBuilder.d.ts +2 -2
- package/AttributesFiltersButton/AttributesFiltersButton.d.ts +2 -2
- package/LogicOperatorWithPlaceholder/LogicOperatorWithPlaceholder.d.ts +12 -0
- package/LogicOperatorWithPlaceholder/LogicOperatorWithPlaceholder.js +9 -0
- package/LogicOperatorWithPlaceholder/LogicOperatorWithPlaceholder.module.css.js +9 -0
- package/LogicOperatorWithPlaceholder/LogicOperatorWithPlaceholder.test.d.ts +1 -0
- package/LogicOperatorWithPlaceholder/LogicOperatorWithPlaceholder.test.js +92 -0
- package/LogicOperatorWithPlaceholder/index.d.ts +1 -0
- package/LogicOperatorWithPlaceholder/index.js +1 -0
- package/cjs/AttributesFiltersBuilder/AttributesFiltersBuilder.d.ts +2 -2
- package/cjs/AttributesFiltersButton/AttributesFiltersButton.d.ts +2 -2
- package/cjs/LogicOperatorWithPlaceholder/LogicOperatorWithPlaceholder.d.ts +12 -0
- package/cjs/LogicOperatorWithPlaceholder/LogicOperatorWithPlaceholder.js +16 -0
- package/cjs/LogicOperatorWithPlaceholder/LogicOperatorWithPlaceholder.module.css.js +9 -0
- package/cjs/LogicOperatorWithPlaceholder/LogicOperatorWithPlaceholder.test.d.ts +1 -0
- package/cjs/LogicOperatorWithPlaceholder/LogicOperatorWithPlaceholder.test.js +97 -0
- package/cjs/LogicOperatorWithPlaceholder/index.d.ts +1 -0
- package/cjs/LogicOperatorWithPlaceholder/index.js +5 -0
- package/cjs/helpers/attributesSelector.d.ts +2 -2
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +8 -6
- package/cjs/types/index.d.ts +0 -5
- package/helpers/attributesSelector.d.ts +2 -2
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +2 -2
- package/types/index.d.ts +0 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SearchFilter } from '@reltio/mdm-sdk';
|
|
3
|
-
import { AttributeSelectionInfo, AttributeSelectorItemsGroup, AttributesFilterComponentsClasses
|
|
2
|
+
import { AttributesTypesGroup, SearchFilter } from '@reltio/mdm-sdk';
|
|
3
|
+
import { AttributeSelectionInfo, AttributeSelectorItemsGroup, AttributesFilterComponentsClasses } from '../types';
|
|
4
4
|
type Props = {
|
|
5
5
|
classes?: AttributesFilterComponentsClasses;
|
|
6
6
|
filters: SearchFilter[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PopoverOrigin } from '@mui/material/Popover';
|
|
3
|
-
import { SearchFilter } from '@reltio/mdm-sdk';
|
|
4
|
-
import { AttributeSelectionInfo, AttributeSelectorItemsGroup, AttributesFilterComponentsClasses
|
|
3
|
+
import { AttributesTypesGroup, SearchFilter } from '@reltio/mdm-sdk';
|
|
4
|
+
import { AttributeSelectionInfo, AttributeSelectorItemsGroup, AttributesFilterComponentsClasses } from '../types';
|
|
5
5
|
type Props = {
|
|
6
6
|
classes?: AttributesFilterComponentsClasses;
|
|
7
7
|
filters: SearchFilter[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SearchOperator } from '@reltio/mdm-sdk';
|
|
3
|
+
type Props = {
|
|
4
|
+
operator?: SearchOperator | null;
|
|
5
|
+
onChange: (operator: SearchOperator) => void;
|
|
6
|
+
classes?: {
|
|
7
|
+
wrapper?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare const LogicOperatorWithPlaceholder: ({ operator, onChange, classes }: Props) => React.JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import i18n from 'ui-i18n';
|
|
4
|
+
import { LogicOperator } from '../LogicOperator';
|
|
5
|
+
import styles from './LogicOperatorWithPlaceholder.module.css';
|
|
6
|
+
export var LogicOperatorWithPlaceholder = function (_a) {
|
|
7
|
+
var operator = _a.operator, onChange = _a.onChange, classes = _a.classes;
|
|
8
|
+
return (React.createElement("div", { className: classnames(styles.wrapper, classes === null || classes === void 0 ? void 0 : classes.wrapper) }, operator ? (React.createElement(LogicOperator, { className: styles.operator, value: operator, onChange: onChange })) : (React.createElement("div", { className: classnames(styles.operator, styles.placeholder, classes === null || classes === void 0 ? void 0 : classes.placeholder) }, i18n.text('Where')))));
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"wrapper":"LogicOperatorWithPlaceholder-wrapper--hEiwo","operator":"LogicOperatorWithPlaceholder-operator--FO6R6","placeholder":"LogicOperatorWithPlaceholder-placeholder--IRiyW"};
|
|
2
|
+
if (typeof document !== 'undefined') {
|
|
3
|
+
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
const style = document.createElement('style');
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
style.innerHTML = `.LogicOperatorWithPlaceholder-wrapper--hEiwo{margin-right:40px;margin-top:7px;width:100px}.LogicOperatorWithPlaceholder-operator--FO6R6{color:var(--mui-palette-text-secondary);font-size:14px}.LogicOperatorWithPlaceholder-placeholder--IRiyW{padding-left:16px;padding-top:10px}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
export default styles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
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 = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
23
|
+
return g.next = verb(0), g["throw"] = verb(1), g["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 { LogicOperatorWithPlaceholder } from './LogicOperatorWithPlaceholder';
|
|
52
|
+
describe('LogicOperatorWithPlaceholder', function () {
|
|
53
|
+
var defaultProps = {
|
|
54
|
+
operator: 'and',
|
|
55
|
+
onChange: jest.fn()
|
|
56
|
+
};
|
|
57
|
+
var setUp = function (props) {
|
|
58
|
+
if (props === void 0) { props = {}; }
|
|
59
|
+
var user = userEvent.setup();
|
|
60
|
+
return __assign({ user: user }, render(React.createElement(LogicOperatorWithPlaceholder, __assign({}, defaultProps, props))));
|
|
61
|
+
};
|
|
62
|
+
it('should work correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
63
|
+
var user, selector;
|
|
64
|
+
return __generator(this, function (_a) {
|
|
65
|
+
switch (_a.label) {
|
|
66
|
+
case 0:
|
|
67
|
+
user = setUp().user;
|
|
68
|
+
selector = screen.getByText('And');
|
|
69
|
+
expect(selector).toBeInTheDocument();
|
|
70
|
+
return [4 /*yield*/, user.click(selector)];
|
|
71
|
+
case 1:
|
|
72
|
+
_a.sent();
|
|
73
|
+
expect(screen.getByRole('listbox')).toBeInTheDocument();
|
|
74
|
+
expect(screen.getByRole('option', { name: 'And' })).toBeInTheDocument();
|
|
75
|
+
expect(screen.getByRole('option', { name: 'Or' })).toBeInTheDocument();
|
|
76
|
+
expect(screen.getByRole('option', { name: 'And not' })).toBeInTheDocument();
|
|
77
|
+
expect(screen.getByRole('option', { name: 'Or not' })).toBeInTheDocument();
|
|
78
|
+
return [4 /*yield*/, user.click(screen.getByRole('option', { name: 'Or' }))];
|
|
79
|
+
case 2:
|
|
80
|
+
_a.sent();
|
|
81
|
+
expect(screen.queryByRole('listbox')).not.toBeInTheDocument();
|
|
82
|
+
expect(defaultProps.onChange).toHaveBeenCalledWith('or');
|
|
83
|
+
return [2 /*return*/];
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}); });
|
|
87
|
+
it('should render placeholder when operator is not provided', function () {
|
|
88
|
+
setUp({ operator: null });
|
|
89
|
+
expect(screen.getByText('Where')).toBeInTheDocument();
|
|
90
|
+
expect(screen.queryByText('And')).not.toBeInTheDocument();
|
|
91
|
+
});
|
|
92
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LogicOperatorWithPlaceholder } from './LogicOperatorWithPlaceholder';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LogicOperatorWithPlaceholder } from './LogicOperatorWithPlaceholder';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SearchFilter } from '@reltio/mdm-sdk';
|
|
3
|
-
import { AttributeSelectionInfo, AttributeSelectorItemsGroup, AttributesFilterComponentsClasses
|
|
2
|
+
import { AttributesTypesGroup, SearchFilter } from '@reltio/mdm-sdk';
|
|
3
|
+
import { AttributeSelectionInfo, AttributeSelectorItemsGroup, AttributesFilterComponentsClasses } from '../types';
|
|
4
4
|
type Props = {
|
|
5
5
|
classes?: AttributesFilterComponentsClasses;
|
|
6
6
|
filters: SearchFilter[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PopoverOrigin } from '@mui/material/Popover';
|
|
3
|
-
import { SearchFilter } from '@reltio/mdm-sdk';
|
|
4
|
-
import { AttributeSelectionInfo, AttributeSelectorItemsGroup, AttributesFilterComponentsClasses
|
|
3
|
+
import { AttributesTypesGroup, SearchFilter } from '@reltio/mdm-sdk';
|
|
4
|
+
import { AttributeSelectionInfo, AttributeSelectorItemsGroup, AttributesFilterComponentsClasses } from '../types';
|
|
5
5
|
type Props = {
|
|
6
6
|
classes?: AttributesFilterComponentsClasses;
|
|
7
7
|
filters: SearchFilter[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SearchOperator } from '@reltio/mdm-sdk';
|
|
3
|
+
type Props = {
|
|
4
|
+
operator?: SearchOperator | null;
|
|
5
|
+
onChange: (operator: SearchOperator) => void;
|
|
6
|
+
classes?: {
|
|
7
|
+
wrapper?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare const LogicOperatorWithPlaceholder: ({ operator, onChange, classes }: Props) => React.JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.LogicOperatorWithPlaceholder = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
9
|
+
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
10
|
+
var LogicOperator_1 = require("../LogicOperator");
|
|
11
|
+
var LogicOperatorWithPlaceholder_module_css_1 = __importDefault(require("./LogicOperatorWithPlaceholder.module.css"));
|
|
12
|
+
var LogicOperatorWithPlaceholder = function (_a) {
|
|
13
|
+
var operator = _a.operator, onChange = _a.onChange, classes = _a.classes;
|
|
14
|
+
return (react_1.default.createElement("div", { className: (0, classnames_1.default)(LogicOperatorWithPlaceholder_module_css_1.default.wrapper, classes === null || classes === void 0 ? void 0 : classes.wrapper) }, operator ? (react_1.default.createElement(LogicOperator_1.LogicOperator, { className: LogicOperatorWithPlaceholder_module_css_1.default.operator, value: operator, onChange: onChange })) : (react_1.default.createElement("div", { className: (0, classnames_1.default)(LogicOperatorWithPlaceholder_module_css_1.default.operator, LogicOperatorWithPlaceholder_module_css_1.default.placeholder, classes === null || classes === void 0 ? void 0 : classes.placeholder) }, ui_i18n_1.default.text('Where')))));
|
|
15
|
+
};
|
|
16
|
+
exports.LogicOperatorWithPlaceholder = LogicOperatorWithPlaceholder;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"wrapper":"LogicOperatorWithPlaceholder-wrapper--hEiwo","operator":"LogicOperatorWithPlaceholder-operator--FO6R6","placeholder":"LogicOperatorWithPlaceholder-placeholder--IRiyW"};
|
|
2
|
+
if (typeof document !== 'undefined') {
|
|
3
|
+
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
const style = document.createElement('style');
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
style.innerHTML = `.LogicOperatorWithPlaceholder-wrapper--hEiwo{margin-right:40px;margin-top:7px;width:100px}.LogicOperatorWithPlaceholder-operator--FO6R6{color:var(--mui-palette-text-secondary);font-size:14px}.LogicOperatorWithPlaceholder-placeholder--IRiyW{padding-left:16px;padding-top:10px}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
module.exports = styles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
24
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
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;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
+
};
|
|
52
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
+
var react_1 = __importDefault(require("react"));
|
|
54
|
+
var react_2 = require("@testing-library/react");
|
|
55
|
+
var user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
56
|
+
var LogicOperatorWithPlaceholder_1 = require("./LogicOperatorWithPlaceholder");
|
|
57
|
+
describe('LogicOperatorWithPlaceholder', function () {
|
|
58
|
+
var defaultProps = {
|
|
59
|
+
operator: 'and',
|
|
60
|
+
onChange: jest.fn()
|
|
61
|
+
};
|
|
62
|
+
var setUp = function (props) {
|
|
63
|
+
if (props === void 0) { props = {}; }
|
|
64
|
+
var user = user_event_1.default.setup();
|
|
65
|
+
return __assign({ user: user }, (0, react_2.render)(react_1.default.createElement(LogicOperatorWithPlaceholder_1.LogicOperatorWithPlaceholder, __assign({}, defaultProps, props))));
|
|
66
|
+
};
|
|
67
|
+
it('should work correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
68
|
+
var user, selector;
|
|
69
|
+
return __generator(this, function (_a) {
|
|
70
|
+
switch (_a.label) {
|
|
71
|
+
case 0:
|
|
72
|
+
user = setUp().user;
|
|
73
|
+
selector = react_2.screen.getByText('And');
|
|
74
|
+
expect(selector).toBeInTheDocument();
|
|
75
|
+
return [4 /*yield*/, user.click(selector)];
|
|
76
|
+
case 1:
|
|
77
|
+
_a.sent();
|
|
78
|
+
expect(react_2.screen.getByRole('listbox')).toBeInTheDocument();
|
|
79
|
+
expect(react_2.screen.getByRole('option', { name: 'And' })).toBeInTheDocument();
|
|
80
|
+
expect(react_2.screen.getByRole('option', { name: 'Or' })).toBeInTheDocument();
|
|
81
|
+
expect(react_2.screen.getByRole('option', { name: 'And not' })).toBeInTheDocument();
|
|
82
|
+
expect(react_2.screen.getByRole('option', { name: 'Or not' })).toBeInTheDocument();
|
|
83
|
+
return [4 /*yield*/, user.click(react_2.screen.getByRole('option', { name: 'Or' }))];
|
|
84
|
+
case 2:
|
|
85
|
+
_a.sent();
|
|
86
|
+
expect(react_2.screen.queryByRole('listbox')).not.toBeInTheDocument();
|
|
87
|
+
expect(defaultProps.onChange).toHaveBeenCalledWith('or');
|
|
88
|
+
return [2 /*return*/];
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}); });
|
|
92
|
+
it('should render placeholder when operator is not provided', function () {
|
|
93
|
+
setUp({ operator: null });
|
|
94
|
+
expect(react_2.screen.getByText('Where')).toBeInTheDocument();
|
|
95
|
+
expect(react_2.screen.queryByText('And')).not.toBeInTheDocument();
|
|
96
|
+
});
|
|
97
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LogicOperatorWithPlaceholder } from './LogicOperatorWithPlaceholder';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LogicOperatorWithPlaceholder = void 0;
|
|
4
|
+
var LogicOperatorWithPlaceholder_1 = require("./LogicOperatorWithPlaceholder");
|
|
5
|
+
Object.defineProperty(exports, "LogicOperatorWithPlaceholder", { enumerable: true, get: function () { return LogicOperatorWithPlaceholder_1.LogicOperatorWithPlaceholder; } });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AttributeType, Metadata } from '@reltio/mdm-sdk';
|
|
2
|
-
import { AttributeSelectorItemsGroup
|
|
1
|
+
import { AttributesTypesGroup, AttributeType, Metadata } from '@reltio/mdm-sdk';
|
|
2
|
+
import { AttributeSelectorItemsGroup } from '../types';
|
|
3
3
|
export declare const getOperationalTypeUriFromAttrTypes: (attributeTypes: AttributeType[]) => any;
|
|
4
4
|
export declare const getAttributeSelectorItems: (metadata: Metadata, attributesTypesGroups: AttributesTypesGroup[], attributesTypesGroupFilter: (attributeSelectorItemsGroup: AttributeSelectorItemsGroup[]) => AttributeSelectorItemsGroup[]) => AttributeSelectorItemsGroup[];
|
package/cjs/index.d.ts
CHANGED
|
@@ -132,6 +132,7 @@ export { TenantLabel } from './TenantLabel';
|
|
|
132
132
|
export { StepNavigation } from './StepNavigation';
|
|
133
133
|
export { TableSkeleton } from './TableSkeleton';
|
|
134
134
|
export { LogicOperator } from './LogicOperator';
|
|
135
|
+
export { LogicOperatorWithPlaceholder } from './LogicOperatorWithPlaceholder';
|
|
135
136
|
export { ReadableSearchQuery } from './ReadableSearchQuery';
|
|
136
137
|
export { ReadableSearchQueryBuilder } from './ReadableSearchQueryBuilder';
|
|
137
138
|
export { ImportButton } from './ImportButton';
|
package/cjs/index.js
CHANGED
|
@@ -16,12 +16,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.NestedAttribute = exports.MoreAttributesButton = exports.InlineReferenceAttribute = exports.InlineNestedAttribute = exports.InlineImageAttribute = exports.InlineAttributesPager = exports.InfoIcon = exports.EditableImageAttributesLine = exports.FilterButton = exports.FacetViewHeader = exports.ExpandedValueTooltip = exports.EntitySelector = exports.EntityCreator = exports.AttributesPager = exports.AttributesList = exports.EditableAttribute = exports.DropDownMenuButton = exports.DescriptionIcon = exports.DefaultCellValueRenderer = exports.ControlAttributeIcon = exports.ColumnsSettingsPopup = exports.ColumnsSettings = exports.ColorBar = exports.CollapseRowButton = exports.BasicChartsFactory = exports.ChartsFactory = exports.CardinalityMessage = exports.BranchDecorator = exports.BasicViewHeader = exports.BasicViewContent = exports.BasicView = exports.BasicTablePagination = exports.basicTableViewState = exports.BasicTable = exports.BasicAttributeSelector = exports.BarChart = exports.AvatarWithFallback = exports.AutoSizeList = exports.AttributesView = exports.AttributesValuesEditor = exports.AttributeRowCellRenderer = exports.AttributesFiltersButton = exports.AttributesFiltersBuilder = exports.AttributesFilterSelector = exports.AttributesErrorsPanel = exports.AttributeListItem = exports.AttributeGroupIcon = exports.ArrowExpandButton = exports.ActionsPanel = exports.ActionButton = void 0;
|
|
18
18
|
exports.ReactSelectMenuList = exports.ReactSelectLoadMoreButton = exports.ReactSelectDropdownIndicatorWithIconButton = exports.ReactSelectDropdownIndicator = exports.Highlighter = exports.HierarchyNodeTitle = exports.HierarchicalAttributeTooltip = exports.HideOnShrink = exports.ExpandableSearchInput = exports.ErrorPopup = exports.ErrorBoundary = exports.SegmentIdLink = exports.EntityUriLink = exports.EntityTypesSelector = exports.EntityTypeIcon = exports.EntityTypeBadge = exports.EntityAvatar = exports.EMPTY_STATE_VARIANTS = exports.EMPTY_STATE_ICONS = exports.EmptyState = exports.Drawer = exports.DataTypeValue = exports.DataTenantBadge = exports.ConnectionRelationTypeSelector = exports.CollaborationItem = exports.ConfirmationDialog = exports.CommentsContainer = exports.ColoredSourceIcon = exports.CollapseButton = exports.TreeChart = exports.TableWithBars = exports.SourceIcon = exports.SmallIconButtonWithTooltip = exports.SmallIconButton = exports.SimpleAttributeEditor = exports.SimpleAttribute = exports.RowCellChips = exports.RowCellChipWithTooltip = exports.RowCellAutoSizer = exports.RelationTypeSelector = exports.ReferenceAttributeEditor = exports.ReferenceAttribute = exports.ImageAttributesLine = exports.ReadOnlyAttributesPager = exports.ReadOnlyAttributesList = exports.ReadOnlyAttribute = exports.ReadOnlyAttributeValuesBlock = exports.PieChart = exports.OvIcon = exports.NestedAttributeEditor = void 0;
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
exports.
|
|
24
|
-
exports.mockComputedStyles = exports.FakeMouseEvent = exports.rerenderWrapper = exports.mockElementSizes = exports.fixClicksOnResizablePanes = exports.mockBasicTableSizing = exports.getMuiIconsByName = exports.getMuiIconByName = exports.deepFreeze = void 0;
|
|
19
|
+
exports.LoadingSpinner = exports.Link = exports.LinearLoadIndicator = exports.ImportButton = exports.ReadableSearchQueryBuilder = exports.ReadableSearchQuery = exports.LogicOperatorWithPlaceholder = exports.LogicOperator = exports.TableSkeleton = exports.StepNavigation = exports.TenantLabel = exports.RelevanceScoreBadge = exports.RequiredMark = exports.SettingsMenu = exports.TenantsDropDownSelector = exports.TenantIcon = exports.SourceSystemsSelector = exports.MatchRulesSelector = exports.MultiValueSelector = exports.ProfilesList = exports.NotMatchButton = exports.MergeButton = exports.ProfileMatchCard = exports.ImageGalleryDialog = exports.RelationTypesSelector = exports.ScreenProfileBand = exports.ProfileBandNavigation = exports.EmptyStub = exports.MaskingSwitcher = exports.FileTypeEditor = exports.EmptySearchResult = exports.DropDownEditor = exports.FilterValueEditor = exports.MultiValueChip = exports.TextEditor = exports.DateRangeEditor = exports.NumberEditor = exports.DataTypeValueEditor = exports.DateEditor = exports.ErrorWrapper = exports.ErrorMessage = exports.HIDE = exports.INSERT_RIGHT = exports.INSERT_LEFT = exports.ConfigColumnPopup = exports.ConfigureColumnsPopup = exports.ConnectionEditor = exports.DropDownSelector = exports.ReactSelectOptionWithCheckIcon = exports.ReactSelectMenuWithPopper = void 0;
|
|
20
|
+
exports.DefaultHeadCellRendererWithTooltip = exports.LazyRenderer = exports.MetadataTypesSelector = exports.DateRangeSelector = exports.UpSetChart = exports.GaugeChart = exports.RelationEditor = exports.ReltioMap = exports.Marginator = exports.LightArrowTooltip = exports.ScrollableTabs = exports.VirtualGroupedList = exports.ViewMoreToggle = exports.VerticalHeadingsTable = exports.VerticalDivider = exports.AttributeTitle = exports.Spacer = exports.SimpleDropDownSelector = exports.SidePanelContentHeader = exports.SidePanel = exports.SidePanelEmptyState = exports.SideButtonsPanel = exports.SelectorWithOnlyOptionAutoSelect = exports.SelectionPopup = exports.WhiteSearchInput = exports.SearchInput = exports.ProfileResizablePanes = exports.ResizablePanes = exports.ReltioGridLayout = exports.RCTreeSwitchRenderer = exports.RCTreeLevelLines = exports.RCTree = exports.reactSortableTreeHelpers = exports.ReactSortableTree = exports.MultiSelect = exports.QueryBuilderRowsGroup = exports.QueryBuilderRow = exports.ProfileCard = exports.ProfileBand = exports.PotentialMatchReviewCard = exports.PopupWithArrow = exports.Popper = exports.MultipleInput = exports.ModeSwitcherSelect = exports.ModeSwitcher = exports.TransitiveMatchBlock = exports.SimpleMatchRulesBuilder = exports.SimpleMatchRulesBlock = exports.SimpleMatchRules = exports.MatchRulesBlock = void 0;
|
|
21
|
+
exports.SandboxAPIContext = exports.RelationContext = exports.EntityContext = exports.RelatedObjectUrisContext = exports.WorkflowTasksContext = exports.useEntityLoadingIndication = exports.EntityLoadingIndicationProvider = exports.EntityMarkerContext = exports.useAttributeExpanded = exports.ExpandedAttributesProvider = exports.useHighlightedCrosswalks = exports.useCrosswalkHighlight = exports.useCrosswalkFocus = exports.useCrosswalkColor = exports.CrosswalksDisplayProvider = exports.EntitiesMapContext = exports.IdContext = exports.ProfilePerspectiveViewContext = exports.usePerspectivesSettings = exports.PerspectivesSettingsContext = exports.PivotingAttributeContext = exports.UsersContext = exports.InitialCollaborationContextValue = exports.CollaborationContextProvider = exports.CollaborationContext = exports.BlockNavigationContext = exports.BlockImageGalleryDialogContext = exports.PopupBoundariesContext = exports.HistoryDiffContext = exports.AsyncMountContext = exports.MdmModuleProvider = exports.withColumnConfigurator = exports.withBlockNavigation = exports.withCollapseButton = exports.withTableContext = exports.withFilterAtBottom = exports.withPercents = exports.withContext = exports.withDateRangeSelector = exports.withDragHandle = exports.withAsyncMount = exports.withTooltip = exports.FacetContainer = exports.FacetsSelector = exports.FacetGroupTitle = exports.QuickFiltersEntityTypeFacet = exports.FacetGroup = exports.QuickFiltersFacetPanel = exports.AdvancedSearchFabButton = exports.QuickFiltersDrawer = void 0;
|
|
22
|
+
exports.useUsers = exports.useSavedState = exports.useSafePromise = exports.useRunOnceAfterValueInitialization = exports.useRelationsLoader = exports.useRelationTypeSelector = exports.usePrevious = exports.useDidUpdateEffect = exports.useCommentsEntitiesMap = exports.useCollaboration = exports.useAsyncMount = exports.useAPI = exports.useActions = exports.useMatchesColumnsData = exports.useScrollToAttributeError = exports.ThemeProvider = exports.ProfileTablesContext = exports.HiddenAttributesContext = exports.BasicTableContext = exports.BasicTableRowCollapseContext = exports.useDeleteUnmaskedAttributeForRelation = exports.useUnmaskedAttributeValue = exports.useUnmaskAttributeValue = exports.useMaskAttributeValue = exports.MaskedAttributesProvider = exports.useReloadData = exports.ReloadDataProvider = exports.useAttributeValueConfigPermissions = exports.ConfigPermissionsContextProvider = exports.ConfigPermissionsContext = exports.useActionsHook = exports.ActionsHookProvider = exports.PageRequestsAbortingContext = exports.DependentLookupAutopopulationContext = exports.FeaturesContext = exports.LabelsContext = exports.UrlGeneratorsContext = exports.isHighlightedAttributeType = exports.isHighlightedErrorType = exports.ScrollType = exports.ScrollToElementProvider = exports.ScrollToElementContext = exports.SearchValueContext = exports.InterceptHandlersContext = exports.HighlightedValuesContext = exports.SnackbarContext = exports.SearchFiltersContext = exports.useReloadFacet = exports.ReloadFacetProvider = exports.useReloadAllFacets = void 0;
|
|
23
|
+
exports.TestStylesProvider = exports.TestPerspectivesSettingsProvider = exports.getAttrPathFromColumnId = exports.getAttributeHeight = exports.getNestedPathByColumnId = exports.applyCompactValuesCountConstraint = exports.getAttributeSelectorItems = exports.mergeClasses = exports.isControlOrCommandPressed = exports.getValue = exports.getChecked = exports.showErrorMessage = exports.showDefaultErrorMessage = exports.enrichDataWithPercents = exports.defaultRenderRowCell = exports.defaultGetRowCellHeight = exports.columnFilterToMdmFilter = exports.buildColumnsSizeById = exports.buildColumnsFilter = exports.useSegmentsLoader = exports.useDndBasicTableScrollModifier = exports.useDynamicYAxisWidth = exports.useFilterAutoFocus = exports.useSegmentationRequest = exports.resolveMarkers = exports.useMarkers = exports.useMaskedAttribute = exports.useKeyboardNavigation = exports.useDynamicRowCellHeight = exports.useClickableStyle = exports.BasicTableCellRenderer = exports.useBasicTableCellRenderer = exports.useHiddenAttributes = exports.useSavedSearchesRequest = exports.useRequestDCRReview = exports.useAutoFocus = exports.useExpandInvalidRelations = exports.useLayoutResetter = exports.useIsMountedRef = exports.useSnackbar = exports.useSavedStateForEntityType = exports.useReadableSearchState = exports.useEditableConnection = exports.useCustomScripts = exports.useMarkAsNotMatchRequest = exports.useMergeAllRequest = exports.usePagingSimulator = exports.useMatchesLoader = exports.useConfigPermissions = exports.useWhyDidYouUpdate = void 0;
|
|
24
|
+
exports.mockComputedStyles = exports.FakeMouseEvent = exports.rerenderWrapper = exports.mockElementSizes = exports.fixClicksOnResizablePanes = exports.mockBasicTableSizing = exports.getMuiIconsByName = exports.getMuiIconByName = exports.deepFreeze = exports.awaitMockPromises = void 0;
|
|
25
25
|
// components
|
|
26
26
|
var ActionButton_1 = require("./ActionButton");
|
|
27
27
|
Object.defineProperty(exports, "ActionButton", { enumerable: true, get: function () { return ActionButton_1.ActionButton; } });
|
|
@@ -300,6 +300,8 @@ var TableSkeleton_1 = require("./TableSkeleton");
|
|
|
300
300
|
Object.defineProperty(exports, "TableSkeleton", { enumerable: true, get: function () { return TableSkeleton_1.TableSkeleton; } });
|
|
301
301
|
var LogicOperator_1 = require("./LogicOperator");
|
|
302
302
|
Object.defineProperty(exports, "LogicOperator", { enumerable: true, get: function () { return LogicOperator_1.LogicOperator; } });
|
|
303
|
+
var LogicOperatorWithPlaceholder_1 = require("./LogicOperatorWithPlaceholder");
|
|
304
|
+
Object.defineProperty(exports, "LogicOperatorWithPlaceholder", { enumerable: true, get: function () { return LogicOperatorWithPlaceholder_1.LogicOperatorWithPlaceholder; } });
|
|
303
305
|
var ReadableSearchQuery_1 = require("./ReadableSearchQuery");
|
|
304
306
|
Object.defineProperty(exports, "ReadableSearchQuery", { enumerable: true, get: function () { return ReadableSearchQuery_1.ReadableSearchQuery; } });
|
|
305
307
|
var ReadableSearchQueryBuilder_1 = require("./ReadableSearchQueryBuilder");
|
package/cjs/types/index.d.ts
CHANGED
|
@@ -55,11 +55,6 @@ export type AttributeSelectorItemsGroup = {
|
|
|
55
55
|
title: string;
|
|
56
56
|
attributes: AttributeSelectorItem[];
|
|
57
57
|
};
|
|
58
|
-
export type AttributesTypesGroup = {
|
|
59
|
-
id?: string;
|
|
60
|
-
title: string;
|
|
61
|
-
attributeTypes: AttributeType[];
|
|
62
|
-
};
|
|
63
58
|
export type AttributeSelectionInfo = {
|
|
64
59
|
index: number;
|
|
65
60
|
checked: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AttributeType, Metadata } from '@reltio/mdm-sdk';
|
|
2
|
-
import { AttributeSelectorItemsGroup
|
|
1
|
+
import { AttributesTypesGroup, AttributeType, Metadata } from '@reltio/mdm-sdk';
|
|
2
|
+
import { AttributeSelectorItemsGroup } from '../types';
|
|
3
3
|
export declare const getOperationalTypeUriFromAttrTypes: (attributeTypes: AttributeType[]) => any;
|
|
4
4
|
export declare const getAttributeSelectorItems: (metadata: Metadata, attributesTypesGroups: AttributesTypesGroup[], attributesTypesGroupFilter: (attributeSelectorItemsGroup: AttributeSelectorItemsGroup[]) => AttributeSelectorItemsGroup[]) => AttributeSelectorItemsGroup[];
|
package/index.d.ts
CHANGED
|
@@ -132,6 +132,7 @@ export { TenantLabel } from './TenantLabel';
|
|
|
132
132
|
export { StepNavigation } from './StepNavigation';
|
|
133
133
|
export { TableSkeleton } from './TableSkeleton';
|
|
134
134
|
export { LogicOperator } from './LogicOperator';
|
|
135
|
+
export { LogicOperatorWithPlaceholder } from './LogicOperatorWithPlaceholder';
|
|
135
136
|
export { ReadableSearchQuery } from './ReadableSearchQuery';
|
|
136
137
|
export { ReadableSearchQueryBuilder } from './ReadableSearchQueryBuilder';
|
|
137
138
|
export { ImportButton } from './ImportButton';
|
package/index.js
CHANGED
|
@@ -133,6 +133,7 @@ export { TenantLabel } from './TenantLabel';
|
|
|
133
133
|
export { StepNavigation } from './StepNavigation';
|
|
134
134
|
export { TableSkeleton } from './TableSkeleton';
|
|
135
135
|
export { LogicOperator } from './LogicOperator';
|
|
136
|
+
export { LogicOperatorWithPlaceholder } from './LogicOperatorWithPlaceholder';
|
|
136
137
|
export { ReadableSearchQuery } from './ReadableSearchQuery';
|
|
137
138
|
export { ReadableSearchQueryBuilder } from './ReadableSearchQueryBuilder';
|
|
138
139
|
export { ImportButton } from './ImportButton';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2194",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE FILE",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"@fluentui/react-context-selector": "^9.1.26",
|
|
12
12
|
"@googlemaps/markerclusterer": "^2.5.3",
|
|
13
13
|
"@react-sigma/core": "3.4.0",
|
|
14
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
14
|
+
"@reltio/mdm-sdk": "^1.4.1999",
|
|
15
15
|
"@vis.gl/react-google-maps": "^1.3.0",
|
|
16
16
|
"d3-cloud": "^1.2.5",
|
|
17
17
|
"d3-geo": "^2.0.1",
|
package/types/index.d.ts
CHANGED
|
@@ -55,11 +55,6 @@ export type AttributeSelectorItemsGroup = {
|
|
|
55
55
|
title: string;
|
|
56
56
|
attributes: AttributeSelectorItem[];
|
|
57
57
|
};
|
|
58
|
-
export type AttributesTypesGroup = {
|
|
59
|
-
id?: string;
|
|
60
|
-
title: string;
|
|
61
|
-
attributeTypes: AttributeType[];
|
|
62
|
-
};
|
|
63
58
|
export type AttributeSelectionInfo = {
|
|
64
59
|
index: number;
|
|
65
60
|
checked: boolean;
|