@topconsultnpm/sdkui-react 6.19.0-dev1.47 → 6.19.0-dev1.48
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.
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ITMChooserFormProps } from '../../ts';
|
|
2
|
-
declare const TMChooserForm: <T>({ children, title, allowMultipleSelection, allowApplyWithZeroSelection, startWithShowOnlySelectedItems, hasShowOnlySelectedItems, allowGrouping, allowSorting, width, height, dataSource, selectedIDs, manageUseLocalizedName, hasShowId, hideRefresh, keyName, customButtons, showDefaultColumns, columns, summaryItems, convertID, customFilter, getItems, cellRenderIcon, cellRenderNameAndDesc, onChoose, onClose, onShowIdChanged }: ITMChooserFormProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const TMChooserForm: <T>({ children, title, allowMultipleSelection, allowApplyWithZeroSelection, startWithShowOnlySelectedItems, hasShowOnlySelectedItems, allowGrouping, allowSorting, width, height, dataSource, selectedIDs, manageUseLocalizedName, hasShowId, hideRefresh, keyName, customButtons, showFilterPanel, showDefaultColumns, columns, summaryItems, convertID, customFilter, getItems, cellRenderIcon, cellRenderNameAndDesc, onChoose, onClose, onShowIdChanged }: ITMChooserFormProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default TMChooserForm;
|
|
@@ -8,7 +8,7 @@ import TMModal from '../base/TMModal';
|
|
|
8
8
|
import TMLayoutContainer, { TMLayoutItem } from '../base/TMLayout';
|
|
9
9
|
import { TMColors } from '../../utils/theme';
|
|
10
10
|
import TMDataGrid from '../base/TMDataGrid';
|
|
11
|
-
const TMChooserForm = ({ children, title, allowMultipleSelection = false, allowApplyWithZeroSelection = false, startWithShowOnlySelectedItems = true, hasShowOnlySelectedItems = false, allowGrouping, allowSorting = true, width, height, dataSource, selectedIDs, manageUseLocalizedName = true, hasShowId = true, hideRefresh = false, keyName = "id", customButtons, showDefaultColumns = true, columns = [], summaryItems, convertID, customFilter, getItems, cellRenderIcon, cellRenderNameAndDesc, onChoose, onClose, onShowIdChanged }) => {
|
|
11
|
+
const TMChooserForm = ({ children, title, allowMultipleSelection = false, allowApplyWithZeroSelection = false, startWithShowOnlySelectedItems = true, hasShowOnlySelectedItems = false, allowGrouping, allowSorting = true, width, height, dataSource, selectedIDs, manageUseLocalizedName = true, hasShowId = true, hideRefresh = false, keyName = "id", customButtons, showFilterPanel = false, showDefaultColumns = true, columns = [], summaryItems, convertID, customFilter, getItems, cellRenderIcon, cellRenderNameAndDesc, onChoose, onClose, onShowIdChanged }) => {
|
|
12
12
|
const [showId, setShowId] = useState(false);
|
|
13
13
|
const [showOnlySelectedItems, setShowOnlySelectedItems] = useState(allowMultipleSelection && hasShowOnlySelectedItems && startWithShowOnlySelectedItems && selectedIDs != undefined && selectedIDs.length > 0);
|
|
14
14
|
const [allItems, setAllItems] = useState([]);
|
|
@@ -88,7 +88,7 @@ const TMChooserForm = ({ children, title, allowMultipleSelection = false, allowA
|
|
|
88
88
|
}, [manageUseLocalizedName, summaryItems]);
|
|
89
89
|
return (_jsx(TMModal, { title: renderTitle(), width: width ?? '550px', height: height ?? '600px', toolbar: _jsx(ToolbarButtons, {}), onClose: onClose, children: children ??
|
|
90
90
|
filteredItems.length > 0
|
|
91
|
-
? _jsx(TMDataGrid, { dataSource: filteredItems, keyExpr: keyName, dataColumns: dataColumns, focusedRowKey: focusedRowKey, selectedRowKeys: selectedRowKeys, searchPanelFocusStarting: true, headerFilter: { visible: true }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single', showCheckBoxesMode: 'always', selectAllMode: 'allPages' }, grouping: allowGrouping ? { autoExpandAll: false, expandMode: 'rowClick' } : undefined, summary: customSummary, onFocusedRowChanged: handleFocusedRowChange, onSelectionChanged: handleSelectionChanged, onRowDblClick: handleRowDoubleClick })
|
|
91
|
+
? _jsx(TMDataGrid, { dataSource: filteredItems, keyExpr: keyName, dataColumns: dataColumns, focusedRowKey: focusedRowKey, selectedRowKeys: selectedRowKeys, searchPanelFocusStarting: true, headerFilter: { visible: true }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single', showCheckBoxesMode: 'always', selectAllMode: 'allPages' }, grouping: allowGrouping ? { autoExpandAll: false, expandMode: 'rowClick' } : undefined, summary: customSummary, showFilterPanel: showFilterPanel, onFocusedRowChanged: handleFocusedRowChange, onSelectionChanged: handleSelectionChanged, onRowDblClick: handleRowDoubleClick })
|
|
92
92
|
: _jsx(TMLayoutContainer, { gap: 30, alignItems: 'center', justifyContent: 'center', children: _jsx(TMLayoutItem, { children: _jsx("p", { style: { height: "100%", color: TMColors.primaryColor, fontSize: "1.5rem", display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: SDKUI_Localizator.NoDataToDisplay }) }) }) }));
|
|
93
93
|
};
|
|
94
94
|
export default TMChooserForm;
|
package/lib/ts/types.d.ts
CHANGED
|
@@ -263,6 +263,7 @@ export interface ITMChooserFormProps<T> {
|
|
|
263
263
|
title?: any;
|
|
264
264
|
manageUseLocalizedName?: boolean;
|
|
265
265
|
tmSession?: ITopMediaSession;
|
|
266
|
+
showFilterPanel?: boolean;
|
|
266
267
|
getItems?: (refreshCache: boolean) => Promise<T[]>;
|
|
267
268
|
convertID?: (item: T) => any;
|
|
268
269
|
customFilter?: (items: T[]) => T[];
|