@topconsultnpm/sdkui-react-beta 6.16.9 → 6.16.11
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.
|
@@ -169,7 +169,7 @@ const TMDataGrid = React.forwardRef((props, ref) => {
|
|
|
169
169
|
if (!internalRef.current)
|
|
170
170
|
return;
|
|
171
171
|
// Update state with the current number of visible rows in the DataGrid
|
|
172
|
-
setVisibleItemsCount(internalRef.current.instance()
|
|
172
|
+
setVisibleItemsCount(internalRef.current.instance()?.getVisibleRows()?.length ?? 0);
|
|
173
173
|
// Focusing SearchPanel
|
|
174
174
|
if (showSearchPanel && searchPanelFocusStarting) {
|
|
175
175
|
// Use a small delay to ensure the DOM is fully rendered before trying to focus
|
|
@@ -27,6 +27,8 @@ interface ITMMetadataChooserProps extends ITMChooserProps {
|
|
|
27
27
|
filterMetadata?: (value: MetadataDescriptor, index: number, array: MetadataDescriptor[]) => unknown;
|
|
28
28
|
/** Gets the color related to the document type */
|
|
29
29
|
getColorIndex?: (tid: TID_Alias) => string;
|
|
30
|
+
/** Allows you to view system metadata directly */
|
|
31
|
+
showSysMetadataDirectly?: boolean;
|
|
30
32
|
}
|
|
31
33
|
declare const TMMetadataChooser: React.FunctionComponent<ITMMetadataChooserProps>;
|
|
32
34
|
export default TMMetadataChooser;
|
|
@@ -11,13 +11,13 @@ import TMButton from '../base/TMButton';
|
|
|
11
11
|
import TMSummary from '../editors/TMSummary';
|
|
12
12
|
import TMChooserForm from '../forms/TMChooserForm';
|
|
13
13
|
import TMSpinner from '../base/TMSpinner';
|
|
14
|
-
const TMMetadataChooser = ({ tmSession, dataSource, showEditButton = true, buttons = [], disabled, validationItems, getColorIndex, showCompleteMetadataName, qdShowOnlySelectItems, borderRadius = '4px', fontSize = FontSize.defaultFontSize, backgroundColor, openEditorOnSummaryClick, showBorder = true, showId = false, elementStyle, allowMultipleSelection, allowSysMetadata, value, values, isModifiedWhen, tids, label, width, height, showClearButton, qd, placeHolder, filterMetadata, onValueChanged }) => {
|
|
14
|
+
const TMMetadataChooser = ({ tmSession, dataSource, showEditButton = true, buttons = [], disabled, validationItems, getColorIndex, showCompleteMetadataName, qdShowOnlySelectItems, borderRadius = '4px', fontSize = FontSize.defaultFontSize, backgroundColor, openEditorOnSummaryClick, showBorder = true, showId = false, elementStyle, allowMultipleSelection, allowSysMetadata, showSysMetadataDirectly, value, values, isModifiedWhen, tids, label, width, height, showClearButton, qd, placeHolder, filterMetadata, onValueChanged }) => {
|
|
15
15
|
const [showChooser, setShowChooser] = useState(false);
|
|
16
16
|
const renderTemplate = () => {
|
|
17
17
|
return (_jsxs(StyledDivHorizontal, { style: { width: 'max-content', height: '100%' }, children: [values && _jsx(TMMidViewer, { tmSession: tmSession, tid_mid: values[0], showIcon: true, showId: showId, showCompleteName: showCompleteMetadataName }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` }), (values == undefined || values.length == 0) && _jsx("p", { children: placeHolder })] }));
|
|
18
18
|
};
|
|
19
19
|
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { label: label, width: width, height: height, validationItems: validationItems, backgroundColor: backgroundColor, buttons: buttons, placeHolder: placeHolder, fontSize: fontSize, showBorder: showBorder, borderRadius: borderRadius, hasValue: values && values.length > 0, showClearButton: showClearButton, showEditButton: showEditButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), openEditorOnSummaryClick: openEditorOnSummaryClick, onEditorClick: () => !disabled && setShowChooser(true), elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, template: renderTemplate(), onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined }), showChooser &&
|
|
20
|
-
_jsx(TMMetadataChooserForm, { tmSession: tmSession, allowMultipleSelection: allowMultipleSelection, height: '500px', width: '600px', allowSysMetadata: allowSysMetadata, getColorIndex: getColorIndex, dataSource: dataSource, tids: tids, qd: qd, qdShowOnlySelectItems: qdShowOnlySelectItems, filterMetadata: filterMetadata, selectedIDs: values, onClose: () => setShowChooser(false), onChoose: (tid_mids) => { onValueChanged?.(tid_mids); } })] }));
|
|
20
|
+
_jsx(TMMetadataChooserForm, { tmSession: tmSession, allowMultipleSelection: allowMultipleSelection, height: '500px', width: '600px', allowSysMetadata: allowSysMetadata, showSysMetadataDirectly: showSysMetadataDirectly, getColorIndex: getColorIndex, dataSource: dataSource, tids: tids, qd: qd, qdShowOnlySelectItems: qdShowOnlySelectItems, filterMetadata: filterMetadata, selectedIDs: values, onClose: () => setShowChooser(false), onChoose: (tid_mids) => { onValueChanged?.(tid_mids); } })] }));
|
|
21
21
|
};
|
|
22
22
|
export default TMMetadataChooser;
|
|
23
23
|
export const TMMetadataChooserForm = ({ tmSession, tids, qd, filterMetadata, qdShowOnlySelectItems, selectedIDs, dataSource, allowMultipleSelection, allowSysMetadata = true, showSysMetadataDirectly, width, height, getColorIndex, onClose, onChoose }) => {
|