@reltio/components 1.4.1666 → 1.4.1668
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/components/ConnectionEditor/ConnectionEditor.js +2 -2
- package/cjs/components/EntityUriLink/EntityUriLink.d.ts +3 -5
- package/cjs/components/EntityUriLink/EntityUriLink.js +6 -8
- package/cjs/components/ValueChip/ValueChip.d.ts +7 -14
- package/cjs/components/ValueChip/ValueChip.js +1 -7
- package/cjs/components/ValueChip/styles.d.ts +2 -2
- package/cjs/components/attributes/editMode/AttributesPager/AttributesPager.js +1 -1
- package/cjs/components/attributes/editMode/AttributesPager/ImageLineRenderer.d.ts +5 -2
- package/cjs/components/attributes/editMode/AttributesPager/ImageLineRenderer.js +44 -9
- package/cjs/components/attributes/editMode/AttributesPager/styles.d.ts +1 -1
- package/cjs/components/attributes/editMode/AttributesPager/styles.js +7 -0
- package/cjs/components/attributes/editMode/ImageAttributesLine/ImageAttributesLine.js +1 -1
- package/cjs/components/attributes/editMode/ImageAttributesLine/styles.js +1 -2
- package/cjs/components/attributes/editMode/NestedAttribute/NestedAttribute.d.ts +1 -1
- package/cjs/components/attributes/editMode/Tags/Tags.js +63 -19
- package/cjs/components/attributes/inline/ComplexAttribute/ComplexAttribute.js +2 -2
- package/cjs/components/attributes/inline/NestedAttributesBlock/NestedAttributesBlock.js +1 -1
- package/cjs/components/attributes/inline/SimpleAttribute/SimpleAttribute.js +2 -2
- package/cjs/components/attributes/inline/SimpleAttributesBlock/SimpleAttributesBlock.js +1 -1
- package/cjs/components/attributes/readMode/NestedAttribute/NestedAttribute.d.ts +1 -1
- package/cjs/components/crosswalks/AttributesTable/AddAttributesButton/AddAttributesButton.js +1 -1
- package/cjs/components/editors/DataTypeValueEditor/useEditorContext.d.ts +1 -1
- package/cjs/components/editors/TypeaheadEditor/TypeaheadEditor.d.ts +20 -24
- package/cjs/components/editors/TypeaheadEditor/TypeaheadEditor.js +155 -83
- package/cjs/components/editors/TypeaheadEditor/styles.d.ts +1 -1
- package/cjs/components/editors/TypeaheadEditor/styles.js +17 -17
- package/cjs/components/history/ContributorsPanel/styles.d.ts +1 -1
- package/cjs/hooks/useCommentsEntitiesMap.js +1 -1
- package/cjs/hooks/useMatchesLoader.js +2 -2
- package/esm/components/ConnectionEditor/ConnectionEditor.js +3 -3
- package/esm/components/EntityUriLink/EntityUriLink.d.ts +3 -5
- package/esm/components/EntityUriLink/EntityUriLink.js +6 -8
- package/esm/components/ValueChip/ValueChip.d.ts +7 -14
- package/esm/components/ValueChip/ValueChip.js +1 -7
- package/esm/components/ValueChip/styles.d.ts +2 -2
- package/esm/components/attributes/editMode/AttributesPager/AttributesPager.js +2 -2
- package/esm/components/attributes/editMode/AttributesPager/ImageLineRenderer.d.ts +5 -2
- package/esm/components/attributes/editMode/AttributesPager/ImageLineRenderer.js +21 -9
- package/esm/components/attributes/editMode/AttributesPager/styles.d.ts +1 -1
- package/esm/components/attributes/editMode/AttributesPager/styles.js +7 -0
- package/esm/components/attributes/editMode/ImageAttributesLine/ImageAttributesLine.js +1 -1
- package/esm/components/attributes/editMode/ImageAttributesLine/styles.js +1 -2
- package/esm/components/attributes/editMode/NestedAttribute/NestedAttribute.d.ts +1 -1
- package/esm/components/attributes/editMode/Tags/Tags.js +65 -21
- package/esm/components/attributes/inline/ComplexAttribute/ComplexAttribute.js +3 -3
- package/esm/components/attributes/inline/NestedAttributesBlock/NestedAttributesBlock.js +2 -2
- package/esm/components/attributes/inline/SimpleAttribute/SimpleAttribute.js +3 -3
- package/esm/components/attributes/inline/SimpleAttributesBlock/SimpleAttributesBlock.js +2 -2
- package/esm/components/attributes/readMode/NestedAttribute/NestedAttribute.d.ts +1 -1
- package/esm/components/crosswalks/AttributesTable/AddAttributesButton/AddAttributesButton.js +2 -2
- package/esm/components/editors/DataTypeValueEditor/useEditorContext.d.ts +1 -1
- package/esm/components/editors/TypeaheadEditor/TypeaheadEditor.d.ts +20 -24
- package/esm/components/editors/TypeaheadEditor/TypeaheadEditor.js +155 -83
- package/esm/components/editors/TypeaheadEditor/styles.d.ts +1 -1
- package/esm/components/editors/TypeaheadEditor/styles.js +17 -17
- package/esm/components/history/ContributorsPanel/styles.d.ts +1 -1
- package/esm/hooks/useCommentsEntitiesMap.js +2 -2
- package/esm/hooks/useMatchesLoader.js +3 -3
- package/package.json +2 -2
|
@@ -113,7 +113,7 @@ var ConnectionEditor = function (_a) {
|
|
|
113
113
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
114
114
|
onChangeRelationType && (react_1.default.createElement(ConnectionRelationTypeSelector_1.default, { className: styles.item, relation: selectorCompatibleRelation, metadata: metadata, inRelationTypes: inRelationTypes, outRelationTypes: outRelationTypes, onChange: handleChangeRelationType })),
|
|
115
115
|
onChangeEntity && (react_1.default.createElement(ErrorWrapper_1.default, { errorMessage: entityErrorMessage, className: styles.item },
|
|
116
|
-
react_1.default.createElement(EntitySelector_1.default, { key: relationTypeUri, className: (0, classnames_1.default)((_b = {}, _b[styles.dense] = entityErrorMessage, _b)), entity: selectorCompatibleEntity || {}, entityTypesUris: availableEntityTypeUris, max: 20, globalSearchRequestOptions: globalSearchRequestOptions, mode: mdm_sdk_1.
|
|
117
|
-
relationTypeUri && (react_1.default.createElement(AttributesList_1.default, { attrTypes: relationAttrTypes, entity: attributeListEntity, showEmptyEditors: showEmptyEditors, mode: mdm_sdk_1.
|
|
116
|
+
react_1.default.createElement(EntitySelector_1.default, { key: relationTypeUri, className: (0, classnames_1.default)((_b = {}, _b[styles.dense] = entityErrorMessage, _b)), entity: selectorCompatibleEntity || {}, entityTypesUris: availableEntityTypeUris, max: 20, globalSearchRequestOptions: globalSearchRequestOptions, mode: mdm_sdk_1.Mode.Editing, onChange: onChangeEntity, onCreate: undefined, metadata: metadata, attributeTypesSelectionStrategy: undefined }))),
|
|
117
|
+
relationTypeUri && (react_1.default.createElement(AttributesList_1.default, { attrTypes: relationAttrTypes, entity: attributeListEntity, showEmptyEditors: showEmptyEditors, mode: mdm_sdk_1.Mode.Editing, parentUri: relationUri, onAddAttributes: onAddAttributes, onChangeAttribute: onChangeAttribute, onDeleteAttribute: onRemoveAttribute }))));
|
|
118
118
|
};
|
|
119
119
|
exports.ConnectionEditor = ConnectionEditor;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
className?: string;
|
|
2
|
+
declare const EntityUriLink: React.ForwardRefExoticComponent<Pick<Omit<React.HTMLProps<HTMLAnchorElement>, "target" | "href" | "onClick"> & {
|
|
4
3
|
value: string;
|
|
5
4
|
screen?: string;
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
declare const EntityUriLink: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLAnchorElement>>;
|
|
5
|
+
shouldOpenInNewTab?: boolean;
|
|
6
|
+
}, "value" | "label" | "id" | "step" | "type" | "name" | "hidden" | "content" | "max" | "open" | "title" | "data" | "list" | "scope" | "key" | "children" | "default" | "defaultValue" | "required" | "size" | "method" | "headers" | "start" | "prefix" | "action" | "width" | "height" | "screen" | "pattern" | "integrity" | "results" | "cite" | "form" | "slot" | "span" | "style" | "summary" | "color" | "translate" | "wrap" | "multiple" | "disabled" | "className" | "lang" | "media" | "min" | "role" | "tabIndex" | "crossOrigin" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "classID" | "useMap" | "wmode" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "security" | "unselectable" | "inputMode" | "is" | "htmlFor" | "as" | "hrefLang" | "rel" | "sizes" | "charSet" | "cellPadding" | "cellSpacing" | "selected" | "src" | "srcSet" | "autoComplete" | "autoFocus" | "dateTime" | "manifest" | "download" | "alt" | "coords" | "shape" | "autoPlay" | "controls" | "loop" | "mediaGroup" | "muted" | "playsInline" | "preload" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "acceptCharset" | "encType" | "noValidate" | "allowFullScreen" | "allowTransparency" | "frameBorder" | "marginHeight" | "marginWidth" | "sandbox" | "scrolling" | "seamless" | "srcDoc" | "accept" | "capture" | "checked" | "maxLength" | "minLength" | "readOnly" | "challenge" | "keyType" | "keyParams" | "httpEquiv" | "high" | "low" | "optimum" | "reversed" | "async" | "defer" | "nonce" | "scoped" | "colSpan" | "rowSpan" | "cols" | "rows" | "kind" | "srcLang" | "poster" | "shouldOpenInNewTab"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
9
7
|
export default EntityUriLink;
|
|
@@ -48,20 +48,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
48
48
|
var react_1 = __importStar(require("react"));
|
|
49
49
|
var contexts_1 = require("../../contexts");
|
|
50
50
|
var EntityUriLink = (0, react_1.forwardRef)(function (_a, ref) {
|
|
51
|
-
var value = _a.value, children = _a.children, screen = _a.screen, className = _a.className, otherProps = __rest(_a, ["value", "children", "screen", "className"]);
|
|
51
|
+
var value = _a.value, children = _a.children, screen = _a.screen, className = _a.className, _b = _a.shouldOpenInNewTab, shouldOpenInNewTab = _b === void 0 ? false : _b, otherProps = __rest(_a, ["value", "children", "screen", "className", "shouldOpenInNewTab"]);
|
|
52
52
|
var viewId = (0, react_1.useContext)(contexts_1.ViewIdContext);
|
|
53
53
|
var generateEntityUrl = (0, react_1.useContext)(contexts_1.UrlGeneratorsContext).generateEntityUrl;
|
|
54
54
|
var openEntity = (0, contexts_1.useMdmAction)('openEntity');
|
|
55
55
|
var uiPath = (0, contexts_1.useMdmUiPath)();
|
|
56
56
|
var generateEntityUrlByUri = function (uri) { return generateEntityUrl({ uiPath: uiPath, uri: uri, screen: screen }); };
|
|
57
|
-
var
|
|
57
|
+
var handleClick = (0, react_1.useCallback)(function (e) {
|
|
58
58
|
openEntity({ uri: value, viewId: viewId, screen: screen });
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
e.preventDefault();
|
|
64
|
-
}, className: className }, otherProps), children));
|
|
59
|
+
e.stopPropagation();
|
|
60
|
+
e.preventDefault();
|
|
61
|
+
}, [openEntity, screen, value, viewId]);
|
|
62
|
+
return (react_1.default.createElement("a", __assign({ ref: ref, href: generateEntityUrlByUri(value), onClick: shouldOpenInNewTab ? undefined : handleClick, target: shouldOpenInNewTab ? '_blank' : '_self', className: className }, otherProps), children));
|
|
65
63
|
});
|
|
66
64
|
EntityUriLink.displayName = 'EntityUriLink';
|
|
67
65
|
exports.default = EntityUriLink;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ChipProps } from '@mui/material/Chip';
|
|
3
|
+
type Props = Omit<ChipProps, 'label'> & {
|
|
4
|
+
label: string;
|
|
5
|
+
count?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const ValueChip: ({ classes: classesProp, label, count, ...otherProp }: Props) => JSX.Element;
|
|
1
8
|
export default ValueChip;
|
|
2
|
-
declare function ValueChip({ classes: classesProp, label, count, ...otherProp }: {
|
|
3
|
-
[x: string]: any;
|
|
4
|
-
classes?: {};
|
|
5
|
-
label: any;
|
|
6
|
-
count: any;
|
|
7
|
-
}): JSX.Element;
|
|
8
|
-
declare namespace ValueChip {
|
|
9
|
-
namespace propTypes {
|
|
10
|
-
const classes: PropTypes.Requireable<object>;
|
|
11
|
-
const label: PropTypes.Requireable<string>;
|
|
12
|
-
const count: PropTypes.Requireable<string>;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
import PropTypes from 'prop-types';
|
|
@@ -26,11 +26,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
28
|
var react_1 = __importDefault(require("react"));
|
|
29
|
-
var prop_types_1 = __importDefault(require("prop-types"));
|
|
30
29
|
var Chip_1 = __importDefault(require("@mui/material/Chip"));
|
|
31
|
-
var styles_1 = require("./styles");
|
|
32
30
|
var utils_1 = require("../../core/utils");
|
|
33
31
|
var ExpandedValueTooltip_1 = __importDefault(require("../ExpandedValueTooltip/ExpandedValueTooltip"));
|
|
32
|
+
var styles_1 = require("./styles");
|
|
34
33
|
var ValueChip = function (_a) {
|
|
35
34
|
var _b = _a.classes, classesProp = _b === void 0 ? {} : _b, label = _a.label, count = _a.count, otherProp = __rest(_a, ["classes", "label", "count"]);
|
|
36
35
|
var classes = (0, styles_1.useChipStyles)();
|
|
@@ -40,9 +39,4 @@ var ValueChip = function (_a) {
|
|
|
40
39
|
react_1.default.createElement("div", { className: styles.label }, label)),
|
|
41
40
|
count && react_1.default.createElement("div", { className: styles.count }, count)) }, otherProp)));
|
|
42
41
|
};
|
|
43
|
-
ValueChip.propTypes = {
|
|
44
|
-
classes: prop_types_1.default.object,
|
|
45
|
-
label: prop_types_1.default.string,
|
|
46
|
-
count: prop_types_1.default.string
|
|
47
|
-
};
|
|
48
42
|
exports.default = ValueChip;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const useChipStyles: (props?: any) => import("@mui/styles").ClassNameMap<"label" | "root" | "deleteIcon">;
|
|
2
|
-
export const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"label" | "count" | "container">;
|
|
1
|
+
export declare const useChipStyles: (props?: any) => import("@mui/styles").ClassNameMap<"label" | "root" | "deleteIcon">;
|
|
2
|
+
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"label" | "count" | "container">;
|
|
@@ -70,7 +70,7 @@ var AttributesPager = function (_a) {
|
|
|
70
70
|
}
|
|
71
71
|
case RENDERER_TYPES.imageLine:
|
|
72
72
|
return (react_1.default.createElement(BranchDecorator_1.default, { enabled: drawLines },
|
|
73
|
-
react_1.default.createElement(ImageLineRenderer_1.ImageLineRenderer, { attributeValues: visibleValues, attributeType: attributeType, paging: paging, onDeleteAttribute: onDeleteAttribute, parentUri: parentUri, onChangeAttribute: onChangeAttribute, requestNextPageOfAttributeValues: requestNextPageOfAttributeValues, showNonOv: showNonOv, highlightedAttribute: highlightedAttribute })));
|
|
73
|
+
react_1.default.createElement(ImageLineRenderer_1.ImageLineRenderer, { attributeValues: visibleValues, attributeType: attributeType, paging: paging, onDeleteAttribute: onDeleteAttribute, parentUri: parentUri, onChangeAttribute: onChangeAttribute, requestNextPageOfAttributeValues: requestNextPageOfAttributeValues, showNonOv: showNonOv, highlightedAttribute: highlightedAttribute, error: (0, mdm_sdk_1.getAttributeErrorByTypeUri)(attributeType.uri, activeErrors), highlightedError: highlightedError, onDeactivateError: onDeactivateError })));
|
|
74
74
|
default:
|
|
75
75
|
return (react_1.default.createElement(AttributeRenderer_1.default, __assign({ values: visibleValues, attributeType: attributeType, max: max, paging: paging, crosswalks: crosswalks, drawLines: drawLines, requestNextPageOfAttributeValues: requestNextPageOfAttributeValues, showNonOv: showNonOv, nonVisibleValues: nonVisibleValues }, commonProps)));
|
|
76
76
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AttributeItem, AttributeType, ImageAttributeValue, Paging, RequestNextPageOfAttributeValuesPayload } from '@reltio/mdm-sdk';
|
|
2
|
+
import { AttributeError, AttributeItem, AttributeType, ImageAttributeValue, Paging, RequestNextPageOfAttributeValuesPayload } from '@reltio/mdm-sdk';
|
|
3
3
|
import { ScrollToElementContext } from '../../../../contexts';
|
|
4
4
|
type Props = {
|
|
5
5
|
attributeType: AttributeType;
|
|
@@ -11,6 +11,9 @@ type Props = {
|
|
|
11
11
|
onChangeAttribute: (param: AttributeItem) => void;
|
|
12
12
|
requestNextPageOfAttributeValues?: (payload: RequestNextPageOfAttributeValuesPayload) => void;
|
|
13
13
|
highlightedAttribute?: React.ContextType<typeof ScrollToElementContext>;
|
|
14
|
+
error?: AttributeError;
|
|
15
|
+
highlightedError?: React.ContextType<typeof ScrollToElementContext>;
|
|
16
|
+
onDeactivateError?: (id: string) => void;
|
|
14
17
|
};
|
|
15
|
-
export declare const ImageLineRenderer: ({ attributeType, attributeValues, paging, parentUri, showNonOv, onDeleteAttribute, onChangeAttribute, requestNextPageOfAttributeValues, highlightedAttribute }: Props) => JSX.Element;
|
|
18
|
+
export declare const ImageLineRenderer: ({ attributeType, attributeValues, paging, parentUri, showNonOv, onDeleteAttribute, onChangeAttribute, requestNextPageOfAttributeValues, highlightedAttribute, error, highlightedError, onDeactivateError }: Props) => JSX.Element;
|
|
16
19
|
export {};
|
|
@@ -1,25 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
5
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
29
|
exports.ImageLineRenderer = void 0;
|
|
7
|
-
var react_1 =
|
|
30
|
+
var react_1 = __importStar(require("react"));
|
|
8
31
|
var classnames_1 = __importDefault(require("classnames"));
|
|
32
|
+
var ramda_1 = require("ramda");
|
|
33
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
9
34
|
var Title_1 = __importDefault(require("../../../Title/Title"));
|
|
10
35
|
var DescriptionIcon_1 = __importDefault(require("../../DescriptionIcon"));
|
|
11
36
|
var ImageAttributesLine_1 = __importDefault(require("../ImageAttributesLine"));
|
|
12
37
|
var useScrollToAttribute_1 = require("../hooks/useScrollToAttribute/useScrollToAttribute");
|
|
38
|
+
var hooks_1 = require("../../../../hooks");
|
|
39
|
+
var ErrorWrapper_1 = __importDefault(require("../../../ErrorWrapper/ErrorWrapper"));
|
|
13
40
|
var styles_1 = require("./styles");
|
|
14
41
|
var ImageLineRenderer = function (_a) {
|
|
15
|
-
var attributeType = _a.attributeType, attributeValues = _a.attributeValues, paging = _a.paging, parentUri = _a.parentUri, showNonOv = _a.showNonOv, onDeleteAttribute = _a.onDeleteAttribute, onChangeAttribute = _a.onChangeAttribute, requestNextPageOfAttributeValues = _a.requestNextPageOfAttributeValues, highlightedAttribute = _a.highlightedAttribute;
|
|
42
|
+
var attributeType = _a.attributeType, attributeValues = _a.attributeValues, paging = _a.paging, parentUri = _a.parentUri, showNonOv = _a.showNonOv, onDeleteAttribute = _a.onDeleteAttribute, onChangeAttribute = _a.onChangeAttribute, requestNextPageOfAttributeValues = _a.requestNextPageOfAttributeValues, highlightedAttribute = _a.highlightedAttribute, error = _a.error, highlightedError = _a.highlightedError, onDeactivateError = _a.onDeactivateError;
|
|
16
43
|
var styles = (0, styles_1.useStyles)();
|
|
17
|
-
var label = attributeType.label, description = attributeType.description;
|
|
18
|
-
var _b = (0, useScrollToAttribute_1.useScrollToAttribute)(highlightedAttribute),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
44
|
+
var label = attributeType.label, description = attributeType.description, isRequired = attributeType.required;
|
|
45
|
+
var _b = (0, useScrollToAttribute_1.useScrollToAttribute)(highlightedAttribute), highlightedRef = _b.ref, highlightedClassName = _b.highlightedClassName;
|
|
46
|
+
var _c = (0, hooks_1.useScrollToAttributeError)({ highlightedError: highlightedError }), errorRef = _c.ref, errorClassName = _c.errorClassName;
|
|
47
|
+
var deactivateError = (0, react_1.useCallback)(function () {
|
|
48
|
+
if (error && !!onDeactivateError) {
|
|
49
|
+
onDeactivateError((0, mdm_sdk_1.getErrorId)(error));
|
|
50
|
+
}
|
|
51
|
+
}, [error, onDeactivateError]);
|
|
52
|
+
return (react_1.default.createElement("div", { ref: highlightedRef, className: (0, classnames_1.default)(styles.wrapper, highlightedClassName) },
|
|
53
|
+
react_1.default.createElement("div", { ref: errorRef, className: (0, classnames_1.default)(styles.imagesWrapper, errorClassName) },
|
|
54
|
+
react_1.default.createElement("div", { className: styles.titleWrapper },
|
|
55
|
+
react_1.default.createElement(Title_1.default, { className: styles.title, label: label, "data-reltio-id": "reltio-attribute-label", isRequired: isRequired }),
|
|
56
|
+
react_1.default.createElement(DescriptionIcon_1.default, { className: styles.description, description: description })),
|
|
57
|
+
react_1.default.createElement(ErrorWrapper_1.default, { errorMessage: error === null || error === void 0 ? void 0 : error.message, className: styles.errorWrapper },
|
|
58
|
+
react_1.default.createElement(ImageAttributesLine_1.default, { attributeValues: attributeValues, attributeType: attributeType, paging: paging, onDeleteAttribute: onDeleteAttribute, parentUri: parentUri, onChangeAttribute: (0, ramda_1.pipe)(onChangeAttribute, deactivateError), requestNextPageOfAttributeValues: requestNextPageOfAttributeValues, showNonOv: showNonOv })))));
|
|
24
59
|
};
|
|
25
60
|
exports.ImageLineRenderer = ImageLineRenderer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"link" | "description" | "caption" | "title" | "wrapper" | "ovIcon" | "svg-icon__root" | "attributesWrapper" | "typeError" | "titleWrapper">;
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"link" | "description" | "caption" | "title" | "wrapper" | "ovIcon" | "svg-icon__root" | "attributesWrapper" | "imagesWrapper" | "typeError" | "titleWrapper" | "errorWrapper">;
|
|
@@ -20,6 +20,10 @@ exports.useStyles = (0, styles_1.makeStyles)(function (theme) { return ({
|
|
|
20
20
|
width: '100%',
|
|
21
21
|
marginBottom: '10px'
|
|
22
22
|
},
|
|
23
|
+
imagesWrapper: {
|
|
24
|
+
paddingBottom: '10px',
|
|
25
|
+
width: '100%'
|
|
26
|
+
},
|
|
23
27
|
link: {
|
|
24
28
|
display: 'flex',
|
|
25
29
|
marginTop: 4
|
|
@@ -44,5 +48,8 @@ exports.useStyles = (0, styles_1.makeStyles)(function (theme) { return ({
|
|
|
44
48
|
titleWrapper: {
|
|
45
49
|
flex: 1,
|
|
46
50
|
paddingBottom: '3px'
|
|
51
|
+
},
|
|
52
|
+
errorWrapper: {
|
|
53
|
+
paddingBottom: '10px'
|
|
47
54
|
}
|
|
48
55
|
}); });
|
|
@@ -103,7 +103,7 @@ var ImageAttributesLine = function (_a) {
|
|
|
103
103
|
return (react_1.default.createElement("div", { className: styles.root },
|
|
104
104
|
react_1.default.createElement(ImageAttributesLine_1.default, { attributeValues: attributeValues, attributeType: attributeType, renderImage: renderImage, overlay: true, countFixedItems: 1, onUpload: toggleVisibilityUploadDialog, onDeleteAttribute: handleDeleteAttribute, imageSize: imageSize, requestNextPageOfAttributeValues: requestNextPageOfAttributeValues, paging: paging, parentUri: parentUri, showNonOv: showNonOv },
|
|
105
105
|
react_1.default.createElement("div", { className: styles.uploadContainer, onClick: toggleVisibilityUploadDialog },
|
|
106
|
-
react_1.default.createElement(SmallIconButton_1.SmallIconButton, { className: styles.uploadButton, iconClassName: styles.uploadIcon, icon: CloudUpload_1.default }))),
|
|
106
|
+
react_1.default.createElement(SmallIconButton_1.SmallIconButton, { className: styles.uploadButton, iconClassName: styles.uploadIcon, icon: CloudUpload_1.default, "data-reltio-id": "reltio-upload-image-button" }))),
|
|
107
107
|
react_1.default.createElement(UploadImageDialog_1.UploadImageDialog, { open: isVisibleUploadDialog, onUpload: handleAddAttributes, onClose: toggleVisibilityUploadDialog })));
|
|
108
108
|
};
|
|
109
109
|
exports.default = ImageAttributesLine;
|
|
@@ -4,8 +4,7 @@ exports.useStyles = void 0;
|
|
|
4
4
|
var styles_1 = require("@mui/styles");
|
|
5
5
|
exports.useStyles = (0, styles_1.makeStyles)(function () { return ({
|
|
6
6
|
root: {
|
|
7
|
-
width: '100%'
|
|
8
|
-
marginBottom: '10px'
|
|
7
|
+
width: '100%'
|
|
9
8
|
},
|
|
10
9
|
image: function (_a) {
|
|
11
10
|
var imageMargin = _a.imageMargin;
|
|
@@ -18,7 +18,7 @@ declare const _default: React.MemoExoticComponent<{
|
|
|
18
18
|
}>>;
|
|
19
19
|
showEmptyEditors: import("prop-types").Requireable<boolean>;
|
|
20
20
|
lazy: import("prop-types").Requireable<boolean>;
|
|
21
|
-
mode: import("prop-types").Requireable<
|
|
21
|
+
mode: import("prop-types").Requireable<import("@reltio/mdm-sdk").Mode>;
|
|
22
22
|
metadata: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
23
23
|
uri: import("prop-types").Requireable<string>;
|
|
24
24
|
description: import("prop-types").Requireable<string>;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
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
|
+
};
|
|
2
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
14
|
if (k2 === undefined) k2 = k;
|
|
4
15
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -22,6 +33,42 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
33
|
__setModuleDefault(result, mod);
|
|
23
34
|
return result;
|
|
24
35
|
};
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
46
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
47
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
48
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
49
|
+
function step(op) {
|
|
50
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
51
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
52
|
+
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;
|
|
53
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
54
|
+
switch (op[0]) {
|
|
55
|
+
case 0: case 1: t = op; break;
|
|
56
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
57
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
58
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
59
|
+
default:
|
|
60
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
61
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
62
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
63
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
64
|
+
if (t[2]) _.ops.pop();
|
|
65
|
+
_.trys.pop(); continue;
|
|
66
|
+
}
|
|
67
|
+
op = body.call(thisArg, _);
|
|
68
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
69
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
70
|
+
}
|
|
71
|
+
};
|
|
25
72
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
73
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
74
|
};
|
|
@@ -33,29 +80,26 @@ var TypeaheadEditor_1 = __importDefault(require("../../../editors/TypeaheadEdito
|
|
|
33
80
|
var SmallIconButton_1 = __importDefault(require("../../../SmallIconButton/SmallIconButton"));
|
|
34
81
|
var contexts_1 = require("../../../../contexts");
|
|
35
82
|
var styles_1 = require("./styles");
|
|
36
|
-
var filtersWithSearch = function (searchQuery) { return [
|
|
37
|
-
{
|
|
38
|
-
filter: 'containsWordStartingWith',
|
|
39
|
-
fieldName: 'tags',
|
|
40
|
-
values: [searchQuery]
|
|
41
|
-
}
|
|
42
|
-
]; };
|
|
43
|
-
var getQuery = function (searchQuery) {
|
|
44
|
-
return searchQuery ? "?filter=".concat((0, mdm_sdk_1.buildFilterQueryString)()(filtersWithSearch(searchQuery))) : '';
|
|
45
|
-
};
|
|
46
|
-
var body = [
|
|
47
|
-
{
|
|
48
|
-
fieldName: 'tags',
|
|
49
|
-
orderType: 'reversedCount'
|
|
50
|
-
}
|
|
51
|
-
];
|
|
52
|
-
var getSuggestions = function (searchQuery) {
|
|
53
|
-
return (0, mdm_sdk_1.getFacets)({ query: getQuery(searchQuery), body: body }).then(function (response) { return Object.keys(response.tags); });
|
|
54
|
-
};
|
|
55
83
|
var Tags = function (_a) {
|
|
56
84
|
var className = _a.className, values = _a.values, onChange = _a.onChange, onDelete = _a.onDelete;
|
|
57
85
|
var styles = (0, styles_1.useStyles)();
|
|
58
86
|
var entityUri = (0, contexts_1.useMdmEntityUri)();
|
|
87
|
+
var globalSearchRequestOptions = (0, contexts_1.useMdmGlobalSearchRequestOptions)();
|
|
88
|
+
var getSuggestions = (0, react_1.useCallback)(function (searchValue, max, pageNo) { return __awaiter(void 0, void 0, void 0, function () {
|
|
89
|
+
var response;
|
|
90
|
+
return __generator(this, function (_a) {
|
|
91
|
+
switch (_a.label) {
|
|
92
|
+
case 0: return [4 /*yield*/, (0, mdm_sdk_1.getFacetedAttributeData)({
|
|
93
|
+
fieldName: 'tags',
|
|
94
|
+
searchValue: searchValue,
|
|
95
|
+
options: __assign(__assign({}, globalSearchRequestOptions), { max: max, pageNo: pageNo })
|
|
96
|
+
})];
|
|
97
|
+
case 1:
|
|
98
|
+
response = _a.sent();
|
|
99
|
+
return [2 /*return*/, Object.keys(response.tags)];
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}); }, [globalSearchRequestOptions]);
|
|
59
103
|
var handleChange = (0, react_1.useCallback)(function (tags) {
|
|
60
104
|
onChange({
|
|
61
105
|
value: tags,
|
|
@@ -44,8 +44,8 @@ var ComplexAttribute = function (_a) {
|
|
|
44
44
|
var attributeType = _a.attributeType, attributeValue = _a.attributeValue, attributeTypesList = _a.attributeTypesList, label = _a.label, crosswalksMap = _a.crosswalksMap, disableEdit = _a.disableEdit, disableDelete = _a.disableDelete, onPin = _a.onPin, onIgnore = _a.onIgnore, onDelete = _a.onDelete, onEdit = _a.onEdit, onAdd = _a.onAdd, emptyTempAttributeUris = _a.emptyTempAttributeUris;
|
|
45
45
|
var styles = (0, styles_1.useStyles)();
|
|
46
46
|
var _b = (0, useAttributeState_1.useAttributeState)(), isReadingMode = _b.isReadingMode, onMouseEnter = _b.onMouseEnter, onMouseLeave = _b.onMouseLeave;
|
|
47
|
-
var canEdit = !disableEdit && (0, mdm_sdk_1.checkMetadataForUpdate)(mdm_sdk_1.
|
|
48
|
-
var canDelete = !disableDelete && (0, mdm_sdk_1.checkMetadataForDelete)(mdm_sdk_1.
|
|
47
|
+
var canEdit = !disableEdit && (0, mdm_sdk_1.checkMetadataForUpdate)(mdm_sdk_1.Mode.Editing, attributeType);
|
|
48
|
+
var canDelete = !disableDelete && (0, mdm_sdk_1.checkMetadataForDelete)(mdm_sdk_1.Mode.Editing, attributeType);
|
|
49
49
|
var isTemporary = (0, mdm_sdk_1.isTempUri)(attributeValue.uri);
|
|
50
50
|
var showPin = !isTemporary && ((!isReadingMode && canEdit) || attributeValue.pin);
|
|
51
51
|
var showIgnore = !isTemporary && ((!isReadingMode && canEdit) || attributeValue.ignored);
|
|
@@ -32,7 +32,7 @@ var Button_1 = __importDefault(require("@mui/material/Button"));
|
|
|
32
32
|
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
33
33
|
var NestedAttributesBlock = function (_a) {
|
|
34
34
|
var className = _a.className, attributeValues = _a.attributeValues, attributeType = _a.attributeType, onAdd = _a.onAdd, parentUri = _a.parentUri, disableEdit = _a.disableEdit, props = __rest(_a, ["className", "attributeValues", "attributeType", "onAdd", "parentUri", "disableEdit"]);
|
|
35
|
-
var canCreate = !disableEdit && (0, mdm_sdk_1.checkMetadataForCreate)(mdm_sdk_1.
|
|
35
|
+
var canCreate = !disableEdit && (0, mdm_sdk_1.checkMetadataForCreate)(mdm_sdk_1.Mode.Editing, attributeType);
|
|
36
36
|
return attributeValues.length === 0 && canCreate ? (react_1.default.createElement(Button_1.default, { variant: "text", color: "primary", onClick: function () {
|
|
37
37
|
return onAdd({
|
|
38
38
|
parentUri: parentUri,
|
|
@@ -50,8 +50,8 @@ var SimpleAttribute = function (_a) {
|
|
|
50
50
|
var id = (0, mdm_sdk_1.getLastUriPart)(attributeValue.uri);
|
|
51
51
|
var crosswalkDisabled = (0, mdm_sdk_1.isCrosswalkDisabled)(crosswalk);
|
|
52
52
|
var canModifyAttribute = !attributeType.system && !crosswalkDisabled;
|
|
53
|
-
var canEdit = canModifyAttribute && !disableEdit && (0, mdm_sdk_1.checkMetadataForUpdate)(mdm_sdk_1.
|
|
54
|
-
var canDelete = canModifyAttribute && !disableDelete && (0, mdm_sdk_1.checkMetadataForDelete)(mdm_sdk_1.
|
|
53
|
+
var canEdit = canModifyAttribute && !disableEdit && (0, mdm_sdk_1.checkMetadataForUpdate)(mdm_sdk_1.Mode.Editing, attributeType);
|
|
54
|
+
var canDelete = canModifyAttribute && !disableDelete && (0, mdm_sdk_1.checkMetadataForDelete)(mdm_sdk_1.Mode.Editing, attributeType);
|
|
55
55
|
var isTemporary = (0, mdm_sdk_1.isTempUri)(attributeValue.uri);
|
|
56
56
|
var hasBasicPermission = (0, mdm_sdk_1.checkBasicMetadataPermission)(mdm_sdk_1.MetadataPermissions.UPDATE, attributeType) && !disableEdit && canModifyAttribute;
|
|
57
57
|
var showPin = !isTemporary && ((!isReadingMode && hasBasicPermission) || attributeValue.pin);
|
|
@@ -40,7 +40,7 @@ var SimpleAttributesBlock = function (_a) {
|
|
|
40
40
|
var crosswalk = _a.crosswalk;
|
|
41
41
|
var isRelationCrosswalk = (0, mdm_sdk_1.isRelationUri)(crosswalk.uri) || crosswalk.ownerType === 'relation';
|
|
42
42
|
var isEntityCrosswalk = (0, mdm_sdk_1.isEntityUri)(crosswalk.uri) && crosswalk.ownerType === 'entity';
|
|
43
|
-
return ((0, mdm_sdk_1.checkMetadataForCreate)(mdm_sdk_1.
|
|
43
|
+
return ((0, mdm_sdk_1.checkMetadataForCreate)(mdm_sdk_1.Mode.Editing, attributeType) &&
|
|
44
44
|
!disableEdit &&
|
|
45
45
|
((isRelationCrosswalk && (0, mdm_sdk_1.isRelationTypeUri)(attributeType.uri)) ||
|
|
46
46
|
(isEntityCrosswalk && (0, mdm_sdk_1.isEntityTypeUri)(attributeType.uri))));
|
|
@@ -22,7 +22,7 @@ declare const _default: React.MemoExoticComponent<{
|
|
|
22
22
|
}>>;
|
|
23
23
|
showEmptyEditors: import("prop-types").Requireable<boolean>;
|
|
24
24
|
lazy: import("prop-types").Requireable<boolean>;
|
|
25
|
-
mode: import("prop-types").Requireable<
|
|
25
|
+
mode: import("prop-types").Requireable<import("@reltio/mdm-sdk").Mode>;
|
|
26
26
|
metadata: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
27
27
|
uri: import("prop-types").Requireable<string>;
|
|
28
28
|
description: import("prop-types").Requireable<string>;
|
package/cjs/components/crosswalks/AttributesTable/AddAttributesButton/AddAttributesButton.js
CHANGED
|
@@ -27,7 +27,7 @@ var AddAttributesButton = function (_a) {
|
|
|
27
27
|
var metadata = (0, contexts_1.useMdmMetadata)();
|
|
28
28
|
var parentType = __spreadArray(__spreadArray([], metadata.entityTypes, true), (metadata.relationTypes || []), true).find((0, ramda_1.propEq)('uri', parentTypeUri));
|
|
29
29
|
var isNotSelected = function (attrType) { return !(selectedAttributeTypes === null || selectedAttributeTypes === void 0 ? void 0 : selectedAttributeTypes.find((0, ramda_1.propEq)('uri', attrType.uri))); };
|
|
30
|
-
var canCreate = function (attributeType) { return (0, mdm_sdk_1.checkCanCreateAttribute)({ attributeType: attributeType, mode: mdm_sdk_1.
|
|
30
|
+
var canCreate = function (attributeType) { return (0, mdm_sdk_1.checkCanCreateAttribute)({ attributeType: attributeType, mode: mdm_sdk_1.Mode.Editing }); };
|
|
31
31
|
var data = (0, ramda_1.pipe)((0, ramda_1.propOr)([], 'attributes'), (0, ramda_1.reject)((0, ramda_1.either)(mdm_sdk_1.isReference, mdm_sdk_1.isImage)), (0, ramda_1.filter)((0, ramda_1.either)(mdm_sdk_1.isNested, isNotSelected)), (0, ramda_1.filter)((0, ramda_1.both)(mdm_sdk_1.isReadableAttribute, canCreate)))(parentType);
|
|
32
32
|
var handleAdd = function (addedTypes) {
|
|
33
33
|
var typesToSelect = addedTypes.filter(isNotSelected);
|
|
@@ -33,7 +33,7 @@ declare function useEditorContext(fieldName: any, dataTypeDefinition: any): {
|
|
|
33
33
|
format?: undefined;
|
|
34
34
|
tenant?: undefined;
|
|
35
35
|
} | {
|
|
36
|
-
getSuggestions: (searchValue: any, max: any, pageNo: any) => Promise<
|
|
36
|
+
getSuggestions: (searchValue: any, max: any, pageNo: any) => Promise<Record<string, unknown>>;
|
|
37
37
|
entries?: undefined;
|
|
38
38
|
lookups?: undefined;
|
|
39
39
|
lookupCode?: undefined;
|
|
@@ -1,26 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value:
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TextFieldProps } from '@mui/material/TextField';
|
|
3
|
+
type CommonProps = Omit<TextFieldProps, 'onChange' | 'value'> & {
|
|
4
|
+
getSuggestions?: (value: string, pageSize: number, pageNumber?: number) => Promise<string[]>;
|
|
5
5
|
max?: number;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
multiple: any;
|
|
9
|
-
fullWidth: any;
|
|
10
|
-
InputProps?: {};
|
|
6
|
+
multiple?: boolean;
|
|
7
|
+
fullWidth?: boolean;
|
|
11
8
|
isCrossedOut?: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
import PropTypes from 'prop-types';
|
|
9
|
+
};
|
|
10
|
+
type MultipleProps = CommonProps & {
|
|
11
|
+
value: string[];
|
|
12
|
+
onChange: (values: string[]) => void;
|
|
13
|
+
multiple: true;
|
|
14
|
+
};
|
|
15
|
+
type SingleProps = CommonProps & {
|
|
16
|
+
value: string;
|
|
17
|
+
onChange: (value: string) => void;
|
|
18
|
+
multiple?: false;
|
|
19
|
+
};
|
|
20
|
+
export type Props = MultipleProps | SingleProps;
|
|
21
|
+
declare const TypeaheadEditor: ({ value, max, getSuggestions, onChange, multiple, fullWidth, InputProps, isCrossedOut, ...inputProps }: Props) => JSX.Element;
|
|
22
|
+
export default TypeaheadEditor;
|