@topconsultnpm/sdkui-react 6.20.0-dev1.13 → 6.20.0-dev1.131
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/lib/assets/Toppy-help-center.png +0 -0
- package/lib/assets/headergradient.svg +87 -0
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +322 -30
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +8 -1
- package/lib/components/NewComponents/ContextMenu/hooks.js +80 -8
- package/lib/components/NewComponents/ContextMenu/index.d.ts +3 -0
- package/lib/components/NewComponents/ContextMenu/index.js +2 -0
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +9 -1
- package/lib/components/NewComponents/ContextMenu/styles.js +146 -47
- package/lib/components/NewComponents/ContextMenu/types.d.ts +22 -3
- package/lib/components/NewComponents/ContextMenu/useLongPress.d.ts +21 -0
- package/lib/components/NewComponents/ContextMenu/useLongPress.js +112 -0
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +620 -125
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +25 -5
- package/lib/components/NewComponents/FloatingMenuBar/styles.js +215 -59
- package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +12 -3
- package/lib/components/base/TMAccordionNew.js +35 -14
- package/lib/components/base/TMButton.js +6 -0
- package/lib/components/base/TMClosableList.js +4 -0
- package/lib/components/base/TMCustomButton.js +61 -17
- package/lib/components/base/TMDataGrid.d.ts +7 -4
- package/lib/components/base/TMDataGrid.js +153 -11
- package/lib/components/base/TMDropDownMenu.js +21 -18
- package/lib/components/base/TMFileManager.d.ts +4 -3
- package/lib/components/base/TMFileManager.js +32 -24
- package/lib/components/base/TMFileManagerDataGridView.d.ts +3 -2
- package/lib/components/base/TMFileManagerDataGridView.js +1 -11
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +7 -1
- package/lib/components/base/TMFileManagerThumbnailItems.js +5 -2
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +17 -4
- package/lib/components/base/TMFileManagerThumbnailsView.js +18 -6
- package/lib/components/base/TMFileManagerUtils.d.ts +0 -12
- package/lib/components/base/TMListView.js +33 -15
- package/lib/components/base/TMPanel.d.ts +1 -1
- package/lib/components/base/TMPanel.js +4 -2
- package/lib/components/base/TMPopUp.js +6 -0
- package/lib/components/base/TMToolbarCard.js +2 -0
- package/lib/components/base/TMTreeView.d.ts +2 -1
- package/lib/components/base/TMTreeView.js +33 -26
- package/lib/components/choosers/TMDataListItemChooser.d.ts +2 -0
- package/lib/components/choosers/TMDataListItemChooser.js +8 -2
- package/lib/components/choosers/TMDcmtTypeChooser.d.ts +1 -0
- package/lib/components/choosers/TMDcmtTypeChooser.js +11 -3
- package/lib/components/choosers/TMDistinctValues.js +2 -2
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +2 -0
- package/lib/components/choosers/TMDynDataListItemChooser.js +8 -2
- package/lib/components/choosers/TMInvoiceRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.d.ts +2 -0
- package/lib/components/choosers/TMMetadataChooser.js +19 -4
- package/lib/components/choosers/TMOrderRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMUserChooser.d.ts +2 -5
- package/lib/components/choosers/TMUserChooser.js +33 -47
- package/lib/components/editors/TMCheckBox.js +2 -0
- package/lib/components/editors/TMDateBox.js +18 -9
- package/lib/components/editors/TMEditorStyled.js +7 -0
- package/lib/components/editors/TMLocalizedTextBox.d.ts +3 -1
- package/lib/components/editors/TMLocalizedTextBox.js +16 -14
- package/lib/components/editors/TMMetadataEditor.d.ts +1 -0
- package/lib/components/editors/TMMetadataEditor.js +4 -4
- package/lib/components/editors/TMMetadataTextBox.d.ts +9 -0
- package/lib/components/editors/TMMetadataTextBox.js +92 -0
- package/lib/components/editors/TMMetadataValues.d.ts +2 -0
- package/lib/components/editors/TMMetadataValues.js +26 -8
- package/lib/components/editors/TMRadioButton.js +2 -0
- package/lib/components/editors/TMTextArea.js +18 -30
- package/lib/components/editors/TMTextBox.d.ts +1 -1
- package/lib/components/editors/TMTextBox.js +29 -4
- package/lib/components/editors/TMTextExpression.js +6 -91
- package/lib/components/features/archive/TMArchive.js +2 -2
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +15 -0
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +462 -0
- package/lib/components/features/assistant/TMToppySpeechBubble.d.ts +11 -0
- package/lib/components/features/assistant/TMToppySpeechBubble.js +126 -0
- package/lib/components/features/documents/TMDcmtBlog.js +1 -1
- package/lib/components/features/documents/TMDcmtForm.d.ts +14 -2
- package/lib/components/features/documents/TMDcmtForm.js +576 -292
- package/lib/components/features/documents/TMDcmtPreview.js +42 -155
- package/lib/components/features/documents/TMDcmtTasks.js +9 -9
- package/lib/components/features/documents/TMMasterDetailDcmts.js +38 -53
- package/lib/components/features/documents/TMRelationViewer.d.ts +1 -1
- package/lib/components/features/documents/TMRelationViewer.js +2 -2
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +8 -0
- package/lib/components/features/search/{TMSearchResultCheckoutInfoForm.js → TMDcmtCheckoutInfoForm.js} +2 -2
- package/lib/components/features/search/TMSavedQuerySelector.js +72 -67
- package/lib/components/features/search/TMSearch.d.ts +3 -0
- package/lib/components/features/search/TMSearch.js +50 -11
- package/lib/components/features/search/TMSearchQueryEditor.d.ts +1 -0
- package/lib/components/features/search/TMSearchQueryEditor.js +10 -10
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -0
- package/lib/components/features/search/TMSearchQueryPanel.js +40 -25
- package/lib/components/features/search/TMSearchResult.d.ts +3 -0
- package/lib/components/features/search/TMSearchResult.js +370 -252
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +3 -3
- package/lib/components/features/search/TMSearchResultsMenuItems.js +227 -171
- package/lib/components/features/search/TMSignSettingsForm.js +1 -1
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +6 -0
- package/lib/components/features/search/TMSignatureInfoContent.js +140 -0
- package/lib/components/features/search/TMViewHistoryDcmt.js +47 -52
- package/lib/components/features/tasks/TMTaskForm.js +75 -25
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +3 -1
- package/lib/components/features/tasks/TMTasksAgenda.js +48 -9
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +2 -0
- package/lib/components/features/tasks/TMTasksCalendar.js +19 -7
- package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -2
- package/lib/components/features/tasks/TMTasksUtils.js +57 -37
- package/lib/components/features/tasks/TMTasksView.js +28 -19
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +33 -2
- package/lib/components/features/workflow/TMWorkflowPopup.js +140 -34
- package/lib/components/features/workflow/diagram/DiagramItemComponent.d.ts +2 -0
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +14 -7
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
- package/lib/components/features/workflow/diagram/RecipientList.js +3 -2
- package/lib/components/features/workflow/diagram/WFDiagram.d.ts +4 -0
- package/lib/components/features/workflow/diagram/WFDiagram.js +164 -13
- package/lib/components/forms/Login/LoginValidatorService.d.ts +2 -0
- package/lib/components/forms/Login/LoginValidatorService.js +7 -2
- package/lib/components/forms/Login/TMLoginForm.js +35 -7
- package/lib/components/forms/TMChooserForm.js +1 -1
- package/lib/components/grids/TMBlogsPost.js +56 -31
- package/lib/components/grids/TMRecentsManager.js +20 -10
- package/lib/components/grids/TMValidationItemsList.js +6 -0
- package/lib/components/index.d.ts +6 -3
- package/lib/components/index.js +6 -3
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +13 -5
- package/lib/components/query/TMQueryEditor.d.ts +6 -1
- package/lib/components/query/TMQueryEditor.js +105 -101
- package/lib/components/settings/SettingsAppearance.d.ts +2 -1
- package/lib/components/settings/SettingsAppearance.js +99 -30
- package/lib/components/sidebar/TMHeader.js +11 -7
- package/lib/components/sidebar/TMSidebar.d.ts +0 -1
- package/lib/components/sidebar/TMSidebar.js +16 -44
- package/lib/components/sidebar/TMSidebarItem.js +36 -17
- package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -1
- package/lib/components/viewers/TMDataListItemViewer.js +35 -71
- package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +8 -0
- package/lib/components/viewers/TMDataUserIdItemViewer.js +39 -0
- package/lib/css/tm-sdkui.css +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +22 -0
- package/lib/helper/SDKUI_Globals.js +10 -1
- package/lib/helper/SDKUI_Localizator.d.ts +21 -3
- package/lib/helper/SDKUI_Localizator.js +196 -10
- package/lib/helper/TMCommandsContextMenu.d.ts +4 -2
- package/lib/helper/TMCommandsContextMenu.js +15 -4
- package/lib/helper/TMIcons.d.ts +4 -0
- package/lib/helper/TMIcons.js +13 -3
- package/lib/helper/TMPdfViewer.d.ts +8 -0
- package/lib/helper/TMPdfViewer.js +373 -0
- package/lib/helper/TMToppyMessage.js +4 -0
- package/lib/helper/checkinCheckoutManager.d.ts +31 -1
- package/lib/helper/checkinCheckoutManager.js +112 -30
- package/lib/helper/devextremeCustomMessages.d.ts +30 -0
- package/lib/helper/devextremeCustomMessages.js +30 -0
- package/lib/helper/helpers.d.ts +30 -2
- package/lib/helper/helpers.js +132 -4
- package/lib/helper/index.d.ts +2 -0
- package/lib/helper/index.js +2 -0
- package/lib/helper/queryHelper.d.ts +2 -2
- package/lib/helper/queryHelper.js +80 -24
- package/lib/helper/workItemsHelper.d.ts +6 -0
- package/lib/helper/workItemsHelper.js +230 -0
- package/lib/hooks/useCheckInOutOperations.d.ts +28 -0
- package/lib/hooks/useCheckInOutOperations.js +223 -0
- package/lib/hooks/useDataListItem.d.ts +12 -0
- package/lib/hooks/useDataListItem.js +132 -0
- package/lib/hooks/useDataUserIdItem.d.ts +10 -0
- package/lib/hooks/useDataUserIdItem.js +96 -0
- package/lib/hooks/useFloatingBarPinnedItems.d.ts +11 -0
- package/lib/hooks/useFloatingBarPinnedItems.js +54 -0
- package/lib/hooks/useMetadataExpression.d.ts +19 -0
- package/lib/hooks/useMetadataExpression.js +99 -0
- package/lib/hooks/useSettingsFeedback.d.ts +11 -0
- package/lib/hooks/useSettingsFeedback.js +38 -0
- package/lib/hooks/useWorkflowApprove.d.ts +4 -0
- package/lib/hooks/useWorkflowApprove.js +14 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -2
- package/lib/services/platform_services.d.ts +3 -3
- package/lib/ts/types.d.ts +61 -1
- package/lib/utils/theme.d.ts +1 -1
- package/lib/utils/theme.js +1 -1
- package/package.json +8 -6
- package/lib/components/NewComponents/Notification/Notification.d.ts +0 -4
- package/lib/components/NewComponents/Notification/Notification.js +0 -60
- package/lib/components/NewComponents/Notification/NotificationContainer.d.ts +0 -8
- package/lib/components/NewComponents/Notification/NotificationContainer.js +0 -33
- package/lib/components/NewComponents/Notification/index.d.ts +0 -2
- package/lib/components/NewComponents/Notification/index.js +0 -2
- package/lib/components/NewComponents/Notification/styles.d.ts +0 -21
- package/lib/components/NewComponents/Notification/styles.js +0 -180
- package/lib/components/NewComponents/Notification/types.d.ts +0 -18
- package/lib/components/NewComponents/Notification/types.js +0 -1
- package/lib/components/base/TMContextMenu.d.ts +0 -25
- package/lib/components/base/TMContextMenu.js +0 -109
- package/lib/components/base/TMContextMenuOLD.d.ts +0 -26
- package/lib/components/base/TMContextMenuOLD.js +0 -56
- package/lib/components/base/TMFloatingToolbar.d.ts +0 -9
- package/lib/components/base/TMFloatingToolbar.js +0 -101
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +0 -30
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +0 -482
- package/lib/components/features/assistant/ToppySpeechBubble.d.ts +0 -9
- package/lib/components/features/assistant/ToppySpeechBubble.js +0 -117
- package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +0 -8
|
@@ -3,7 +3,7 @@ import { useCallback, useEffect, useState } from 'react';
|
|
|
3
3
|
import { SDK_Localizator, AccessLevels, OnJoinItem, JoinTypes, PlatformObjectValidator, MetadataDataDomains, DcmtTypeListCacheService, JoinItem, MetadataDataTypes, OrderByItem, QueryFunctions, QueryOperators, ResultTypes, SelectItem, SDK_Globals, UserListCacheService, WhereItem, SearchEngine, SelectItemVisibilities, DataListCacheService, QueryValidatorOptions, TMPropertyNames, AppModules, LayoutModes } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import Accordion, { Item } from 'devextreme-react/accordion';
|
|
6
|
-
import { SDKUI_Localizator, IconSearch, IconCount, getQueryCountAsync, calcIsModified, IconClear, IconAddCircleOutline, IconDotsVerticalCircleOutline, IconHide, IconShow, IconDraggabledots, genUniqueId, LocalizeQueryOperators, LocalizeQueryFunctions, LocalizeQueryJoinTypes, IconArchiveDoc, IconArrowRight,
|
|
6
|
+
import { SDKUI_Localizator, IconSearch, IconCount, getQueryCountAsync, calcIsModified, IconClear, IconAddCircleOutline, IconDotsVerticalCircleOutline, IconHide, IconShow, IconDraggabledots, genUniqueId, LocalizeQueryOperators, LocalizeQueryFunctions, LocalizeQueryJoinTypes, IconArchiveDoc, IconArrowRight, SDKUI_Globals } from '../../helper';
|
|
7
7
|
import { displayMetadataValue, getDcmtTypesByQdAsync, getTIDsByQd, IsParametricQuery, prepareQdForSearchAsync } from '../../helper/queryHelper';
|
|
8
8
|
import { useOutsideClick } from '../../hooks/useOutsideClick';
|
|
9
9
|
import { FormModes, SearchResultContext } from '../../ts';
|
|
@@ -27,7 +27,7 @@ import { useApplyForm } from '../../hooks/useForm';
|
|
|
27
27
|
import ShowAlert from '../base/TMAlert';
|
|
28
28
|
import { TMDynDataListItemChooserForm } from '../choosers/TMDynDataListItemChooser';
|
|
29
29
|
import TMMetadataEditor from '../editors/TMMetadataEditor';
|
|
30
|
-
import { ContextMenu } from '
|
|
30
|
+
import { ContextMenu } from '../NewComponents/ContextMenu';
|
|
31
31
|
import { useQueryParametersDialog } from '../../hooks/useQueryParametersDialog';
|
|
32
32
|
import TMSearchResult from '../features/search/TMSearchResult';
|
|
33
33
|
export const StyledRowItem = styled.div ` display: flex; flex-direction: row; align-items: center; justify-content: flex-start; margin-bottom: 5px; gap: 3px; `;
|
|
@@ -62,7 +62,7 @@ export function useQueryApplyForm(d, formMode, inputData, onApplied, parameters)
|
|
|
62
62
|
const [validationItems, setValidationItems] = useState([]);
|
|
63
63
|
return { formData, setFormData, formDataOrig, validationItems, setValidationItems, exception, applyData };
|
|
64
64
|
}
|
|
65
|
-
const TMQueryEditor = ({ formMode, inputData, onQDChanged, isExpertMode, showDistinct = false, showToolbar = true, validateSelect = true, validateOrderBy = true, raiseWarningForOnlyMetadataDcmtTypes = false, onApplied, onClose, height = 'auto', borderRadius = '4px', searchText, showApply, showUndo, showBack, onFromTIDChanged, ShowOnlySAP }) => {
|
|
65
|
+
const TMQueryEditor = ({ formMode, inputData, onQDChanged, isExpertMode, showDistinct = false, showToolbar = true, validateSelect = true, validateOrderBy = true, raiseWarningForOnlyMetadataDcmtTypes = false, onApplied, onClose, height = 'auto', borderRadius = '4px', searchText, showApply, showUndo, showBack, onFromTIDChanged, ShowOnlySAP, updateIsModalOpen, showSearchResultSidebar = true, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false }) => {
|
|
66
66
|
const [confirmQueryParams, ConfirmQueryParamsDialog] = useQueryParametersDialog();
|
|
67
67
|
const { formData, setFormData, formDataOrig, validationItems, setValidationItems, exception, applyData } = useQueryApplyForm(Descriptors.Query, formMode, inputData, onApplied);
|
|
68
68
|
const [dcmtTypesList, setDcmtTypesList] = useState([]);
|
|
@@ -244,11 +244,11 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, isExpertMode, showDis
|
|
|
244
244
|
};
|
|
245
245
|
const getJoinTypesMenuItems = (index) => {
|
|
246
246
|
let items = [
|
|
247
|
-
{
|
|
248
|
-
{
|
|
249
|
-
{
|
|
250
|
-
{
|
|
251
|
-
{
|
|
247
|
+
{ name: LocalizeQueryJoinTypes(JoinTypes.InnerJoin), onClick: () => onChange_JoinItem_JoinType(JoinTypes.InnerJoin, index) },
|
|
248
|
+
{ name: LocalizeQueryJoinTypes(JoinTypes.LeftOuterJoin), onClick: () => onChange_JoinItem_JoinType(JoinTypes.LeftOuterJoin, index) },
|
|
249
|
+
{ name: LocalizeQueryJoinTypes(JoinTypes.RightOuterJoin), onClick: () => onChange_JoinItem_JoinType(JoinTypes.RightOuterJoin, index) },
|
|
250
|
+
{ name: LocalizeQueryJoinTypes(JoinTypes.FullOuterJoin), onClick: () => onChange_JoinItem_JoinType(JoinTypes.FullOuterJoin, index) },
|
|
251
|
+
{ name: LocalizeQueryJoinTypes(JoinTypes.CrossJoin), onClick: () => onChange_JoinItem_JoinType(JoinTypes.CrossJoin, index) }
|
|
252
252
|
];
|
|
253
253
|
return items;
|
|
254
254
|
};
|
|
@@ -335,24 +335,24 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, isExpertMode, showDis
|
|
|
335
335
|
};
|
|
336
336
|
const getQueryFunctionsMenuItems = (si, index) => {
|
|
337
337
|
let items = [];
|
|
338
|
-
items.push({
|
|
339
|
-
items.push({
|
|
340
|
-
items.push({
|
|
341
|
-
items.push({
|
|
338
|
+
items.push({ name: LocalizeQueryFunctions(QueryFunctions.None), onClick: () => onChange_SelectItem_QueryFunction(QueryFunctions.None, index) });
|
|
339
|
+
items.push({ name: LocalizeQueryFunctions(QueryFunctions.Count), onClick: () => onChange_SelectItem_QueryFunction(QueryFunctions.Count, index) });
|
|
340
|
+
items.push({ name: LocalizeQueryFunctions(QueryFunctions.Min), onClick: () => onChange_SelectItem_QueryFunction(QueryFunctions.Min, index) });
|
|
341
|
+
items.push({ name: LocalizeQueryFunctions(QueryFunctions.Max), onClick: () => onChange_SelectItem_QueryFunction(QueryFunctions.Max, index) });
|
|
342
342
|
let dataType = getMetadataDataType(si.tid, si.mid);
|
|
343
343
|
if (dataType == MetadataDataTypes.Number)
|
|
344
|
-
items.push({
|
|
344
|
+
items.push({ name: LocalizeQueryFunctions(QueryFunctions.Sum), onClick: () => onChange_SelectItem_QueryFunction(QueryFunctions.Sum, index) });
|
|
345
345
|
return items;
|
|
346
346
|
};
|
|
347
347
|
const getSelectMenuItems = (index) => {
|
|
348
348
|
let items = [];
|
|
349
|
-
items.push({
|
|
350
|
-
items.push({
|
|
349
|
+
items.push({ name: SDKUI_Localizator.AddAbove, onClick: () => onAdd_SelectItem(index) });
|
|
350
|
+
items.push({ name: SDKUI_Localizator.AddBelow, onClick: () => onAdd_SelectItem(index + 1) });
|
|
351
351
|
for (const tid_alias of qdTIDs) {
|
|
352
|
-
items.push({
|
|
352
|
+
items.push({ name: `${SDKUI_Localizator.AddAlls} ${dcmtTypesList.length > 1 ? `(${getDisplayAlias(getDcmtTypeName(tid_alias.tid), tid_alias.alias)})` : ""}`, onClick: () => onAddAll_SelectItem(tid_alias) });
|
|
353
353
|
}
|
|
354
|
-
items.push({
|
|
355
|
-
items.push({
|
|
354
|
+
items.push({ name: SDKUI_Localizator.Remove, onClick: () => onRemove_SelectItem(index) });
|
|
355
|
+
items.push({ name: SDKUI_Localizator.RemoveAll, onClick: () => setFormData({ ...formData, select: undefined }) });
|
|
356
356
|
return items;
|
|
357
357
|
};
|
|
358
358
|
// #endregion
|
|
@@ -441,59 +441,59 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, isExpertMode, showDis
|
|
|
441
441
|
const onRemove_WhereItem = (index) => { setFormData({ ...formData, where: formData?.where?.filter((o, i) => i !== index) }); };
|
|
442
442
|
const getQueryOperatorsMenuItems = (wi, index) => {
|
|
443
443
|
let items = [];
|
|
444
|
-
items.push({
|
|
445
|
-
items.push({
|
|
446
|
-
items.push({
|
|
447
|
-
items.push({
|
|
448
|
-
items.push({
|
|
449
|
-
items.push({
|
|
444
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.Equal), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.Equal, index) });
|
|
445
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.NotEqual), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.NotEqual, index) });
|
|
446
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.IsNull), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.IsNull, index) });
|
|
447
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.IsNotNull), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.IsNotNull, index) });
|
|
448
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.In), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.In, index) });
|
|
449
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.NotIn), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.NotIn, index) });
|
|
450
450
|
let mdDataType = getMetadataDataType(wi.tid, wi.mid);
|
|
451
451
|
if (mdDataType != MetadataDataTypes.Varchar) {
|
|
452
|
-
items.push({
|
|
453
|
-
items.push({
|
|
454
|
-
items.push({
|
|
455
|
-
items.push({
|
|
456
|
-
items.push({
|
|
457
|
-
items.push({
|
|
458
|
-
items.push({
|
|
459
|
-
items.push({
|
|
452
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.Greater), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.Greater, index) });
|
|
453
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.GreaterOrEqual), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.GreaterOrEqual, index) });
|
|
454
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.Less), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.Less, index) });
|
|
455
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.LessOrEqual), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.LessOrEqual, index) });
|
|
456
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.BetweenExclusive), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.BetweenExclusive, index) });
|
|
457
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.BetweenInclusive), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.BetweenInclusive, index) });
|
|
458
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.OutsideExclusive), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.OutsideExclusive, index) });
|
|
459
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.OutsideInclusive), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.OutsideInclusive, index) });
|
|
460
460
|
}
|
|
461
461
|
else {
|
|
462
|
-
items.push({
|
|
463
|
-
items.push({
|
|
464
|
-
items.push({
|
|
465
|
-
items.push({
|
|
466
|
-
items.push({
|
|
467
|
-
items.push({
|
|
468
|
-
items.push({
|
|
469
|
-
items.push({
|
|
462
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.Contain), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.Contain, index) });
|
|
463
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.NotContain), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.NotContain, index) });
|
|
464
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.BeginWith), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.BeginWith, index) });
|
|
465
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.NotBeginWith), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.NotBeginWith, index) });
|
|
466
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.EndWith), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.EndWith, index) });
|
|
467
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.NotEndWith), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.NotEndWith, index) });
|
|
468
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.Like), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.Like, index) });
|
|
469
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.NotLike), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.NotLike, index) });
|
|
470
470
|
}
|
|
471
|
-
items.push({
|
|
471
|
+
items.push({ name: LocalizeQueryOperators(QueryOperators.Custom), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.Custom, index) });
|
|
472
472
|
if (mdDataType == MetadataDataTypes.DateTime) {
|
|
473
473
|
items.push({
|
|
474
|
-
|
|
475
|
-
{
|
|
476
|
-
{
|
|
477
|
-
{
|
|
478
|
-
{
|
|
479
|
-
{
|
|
480
|
-
{
|
|
481
|
-
{
|
|
482
|
-
{
|
|
483
|
-
{
|
|
484
|
-
{
|
|
485
|
-
{
|
|
486
|
-
{
|
|
487
|
-
{
|
|
488
|
-
{
|
|
489
|
-
{
|
|
490
|
-
{
|
|
491
|
-
{
|
|
492
|
-
{
|
|
493
|
-
{
|
|
494
|
-
{
|
|
495
|
-
{
|
|
496
|
-
{
|
|
474
|
+
name: "Operatori speciali", submenu: [
|
|
475
|
+
{ name: LocalizeQueryOperators(QueryOperators.Yesterday), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.Yesterday, index) },
|
|
476
|
+
{ name: LocalizeQueryOperators(QueryOperators.Today), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.Today, index) },
|
|
477
|
+
{ name: LocalizeQueryOperators(QueryOperators.Tomorrow), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.Tomorrow, index) },
|
|
478
|
+
{ name: LocalizeQueryOperators(QueryOperators.PreviousWeek), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.PreviousWeek, index) },
|
|
479
|
+
{ name: LocalizeQueryOperators(QueryOperators.ThisWeek), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.ThisWeek, index) },
|
|
480
|
+
{ name: LocalizeQueryOperators(QueryOperators.NextWeek), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.NextWeek, index) },
|
|
481
|
+
{ name: LocalizeQueryOperators(QueryOperators.PreviousMonth), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.PreviousMonth, index) },
|
|
482
|
+
{ name: LocalizeQueryOperators(QueryOperators.ThisMonth), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.ThisMonth, index) },
|
|
483
|
+
{ name: LocalizeQueryOperators(QueryOperators.NextMonth), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.NextMonth, index) },
|
|
484
|
+
{ name: LocalizeQueryOperators(QueryOperators.PreviousYear), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.PreviousYear, index) },
|
|
485
|
+
{ name: LocalizeQueryOperators(QueryOperators.ThisYear), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.ThisYear, index) },
|
|
486
|
+
{ name: LocalizeQueryOperators(QueryOperators.NextYear), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.NextYear, index) },
|
|
487
|
+
{ name: LocalizeQueryOperators(QueryOperators.LastXHours), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.LastXHours, index) },
|
|
488
|
+
{ name: LocalizeQueryOperators(QueryOperators.NextXHours), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.NextXHours, index) },
|
|
489
|
+
{ name: LocalizeQueryOperators(QueryOperators.LastXDays), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.LastXDays, index) },
|
|
490
|
+
{ name: LocalizeQueryOperators(QueryOperators.NextXDays), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.NextXDays, index) },
|
|
491
|
+
{ name: LocalizeQueryOperators(QueryOperators.LastXWeeks), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.LastXWeeks, index) },
|
|
492
|
+
{ name: LocalizeQueryOperators(QueryOperators.NextXWeeks), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.NextXWeeks, index) },
|
|
493
|
+
{ name: LocalizeQueryOperators(QueryOperators.LastXMonths), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.LastXMonths, index) },
|
|
494
|
+
{ name: LocalizeQueryOperators(QueryOperators.NextXMonths), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.NextXMonths, index) },
|
|
495
|
+
{ name: LocalizeQueryOperators(QueryOperators.LastXYears), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.LastXYears, index) },
|
|
496
|
+
{ name: LocalizeQueryOperators(QueryOperators.NextXYears), onClick: () => onChange_WhereItem_QueryOperator(QueryOperators.NextXYears, index) }
|
|
497
497
|
]
|
|
498
498
|
});
|
|
499
499
|
}
|
|
@@ -596,7 +596,9 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, isExpertMode, showDis
|
|
|
596
596
|
};
|
|
597
597
|
// #endregion
|
|
598
598
|
// #region Ricerca
|
|
599
|
-
const renderResultSearchForm = _jsx(TMSearchResult, { context: SearchResultContext.METADATA_SEARCH, allowFloatingBar: false, onClose: () => {
|
|
599
|
+
const renderResultSearchForm = (_jsx(TMSearchResult, { context: SearchResultContext.METADATA_SEARCH, allowFloatingBar: false, onClose: () => {
|
|
600
|
+
setShowResultSearch(false);
|
|
601
|
+
}, searchResults: resultSearch, showSearchResultSidebar: showSearchResultSidebar, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal }));
|
|
600
602
|
const onSearchAsync = async (qdInput) => {
|
|
601
603
|
try {
|
|
602
604
|
let qdSearch = await prepareQdForSearchAsync(qdInput);
|
|
@@ -713,23 +715,23 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, isExpertMode, showDis
|
|
|
713
715
|
}
|
|
714
716
|
}
|
|
715
717
|
}, children: [(!isReadOnly || fromCount > 0) && _jsx(Item, { title: SDKUI_Localizator.Source, titleRender: (tabItemProps) => renderAccordionTitle(tabItemProps, fromCount, validationItems.filter((o) => [TMPropertyNames.fromTid, TMPropertyNames.join].includes(o.PropertyName))), children: _jsx(StyledAccordionItemContainer, { style: { maxHeight: fromCount > 0 ? '330px' : '100%' }, children: _jsxs(StyledAccordionItemContent, { "$disabled": isReadOnly, style: { height: '100%' }, children: [_jsxs(StyledRowItem, { children: [!isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconClear, { color: TMColors.button_icon }), caption: SDKUI_Localizator.Remove, onClick: () => { let qd = SearchEngine.NewQueryDescriptor(); setFormData({ ...qd }); } }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', elementStyle: { opacity: !formData?.from?.tid ? 0.4 : 1 }, disabled: !formData?.from?.tid, icon: _jsx(IconAddCircleOutline, { color: TMColors.button_icon }), caption: SDKUI_Localizator.AddBelow, onClick: onAdd_JoinItem }), _jsx("div", { style: { pointerEvents: 'all' }, children: _jsx(TMQdDropDownMenu, { content: _jsx(IconDotsVerticalCircleOutline, { color: TMColors.button_icon }), items: [
|
|
716
|
-
{ icon:
|
|
717
|
-
{ icon:
|
|
718
|
-
] }) }), _jsx(TMDcmtTypeChooser, { disabled: isReadOnly, showEditButton: false, placeHolder: `<${SDKUI_Localizator.DcmtTypeSelect} ...>`, borderRadius: borderRadius, ShowOnlySAP: ShowOnlySAP, openEditorOnSummaryClick: true, showBorder: false, showId: showId, backgroundColor: getColorIndex({ tid: formData.from?.tid, alias: undefined }), values: [formData.from?.tid], validationItems: validationItems.filter((o) => o.PropertyName === TMPropertyNames.fromTid), onValueChanged: (tids) => { let qd = SearchEngine.NewQueryDescriptor(); qd.from.tid = tids[0]; setFormData({ ...qd }); onFromTIDChanged?.(tids[0]); } })] }), formData?.join?.map((ji, index) => {
|
|
718
|
+
{ icon: showId ? _jsx(IconHide, { color: TMColors.button_icon }) : _jsx(IconShow, { color: TMColors.button_icon }), name: showId ? SDKUI_Localizator.ID_Hide : SDKUI_Localizator.ID_Show, onClick: () => setShowId(!showId) },
|
|
719
|
+
{ icon: showCompleteMetadataName ? _jsx(IconHide, { color: TMColors.primary }) : _jsx(IconShow, { color: TMColors.primary }), name: showCompleteMetadataName ? SDKUI_Localizator.Hide_CompleteName : SDKUI_Localizator.Show_CompleteName, onClick: () => setShowCompleteMetadataName(!showCompleteMetadataName) }
|
|
720
|
+
] }) }), _jsx(TMDcmtTypeChooser, { disabled: isReadOnly, showEditButton: false, placeHolder: `<${SDKUI_Localizator.DcmtTypeSelect} ...>`, borderRadius: borderRadius, ShowOnlySAP: ShowOnlySAP, openEditorOnSummaryClick: true, showBorder: false, showId: showId, backgroundColor: getColorIndex({ tid: formData.from?.tid, alias: undefined }), values: [formData.from?.tid], validationItems: validationItems.filter((o) => o.PropertyName === TMPropertyNames.fromTid), onValueChanged: (tids) => { let qd = SearchEngine.NewQueryDescriptor(); qd.from.tid = tids[0]; setFormData({ ...qd }); onFromTIDChanged?.(tids[0]); }, updateIsModalOpen: updateIsModalOpen })] }), formData?.join?.map((ji, index) => {
|
|
719
721
|
return (_jsxs("div", { style: { width: 'max-content', padding: isReadOnly ? '0px 20px' : 0 }, children: [_jsxs(StyledRowItem, { onDragEnd: dragEnd, onDragOver: dragOver, onDrop: (e) => dropJoin(e, ji), children: [!isReadOnly && _jsx(StyledDraggableDiv, { draggable: true, onDragStart: (e) => dragStart(e, ji), children: _jsx(IconDraggabledots, { fontSize: 15, color: TMColors.button_icon }) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconClear, { color: TMColors.button_icon }), caption: SDKUI_Localizator.Remove, onClick: () => onRemove_JoinItem(index) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconAddCircleOutline, { color: TMColors.button_icon }), caption: SDKUI_Localizator.AddBelow, onClick: () => onAdd_JoinItem(index + 1) }), !isReadOnly && _jsx(TMQdDropDownMenu, { content: _jsx(TMTooltip, { content: SDK_Localizator.toCaseWord(SDKUI_Localizator.OneMore), children: _jsx(IconDotsVerticalCircleOutline, { color: TMColors.button_icon }) }), items: [
|
|
720
|
-
{
|
|
721
|
-
{
|
|
722
|
-
{
|
|
723
|
-
{
|
|
724
|
-
{
|
|
722
|
+
{ name: SDKUI_Localizator.AddAbove, onClick: () => onAdd_JoinItem(index) },
|
|
723
|
+
{ name: SDKUI_Localizator.AddBelow, onClick: () => onAdd_JoinItem(index + 1) },
|
|
724
|
+
{ name: SDKUI_Localizator.AddDefinition, onClick: () => onAdd_OnJoinItem(index, 0) },
|
|
725
|
+
{ name: SDKUI_Localizator.Remove, onClick: () => onRemove_JoinItem(index) },
|
|
726
|
+
{ name: SDKUI_Localizator.RemoveAll, onClick: () => setFormData({ ...formData, join: undefined }) }
|
|
725
727
|
] }), _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, color: 'green', borderRadius: borderRadius, content: _jsx(StyledItemWrapper, { children: LocalizeQueryJoinTypes(ji.joinType) }), items: getJoinTypesMenuItems(index) }), _jsx(TMDcmtTypeChooser, { disabled: isReadOnly, showEditButton: false, placeHolder: `<${SDKUI_Localizator.DcmtTypeSelect} ...>`, borderRadius: borderRadius, ShowOnlySAP: ShowOnlySAP, openEditorOnSummaryClick: true, showBorder: false, showId: showId, backgroundColor: getColorIndex({ tid: ji.tid, alias: ji.alias }), values: ji.tid ? [ji.tid] : [], onValueChanged: (newValues) => onChange_JoinItem_TID(newValues[0], index) }), ji.alias &&
|
|
726
728
|
_jsx(StyledItemWrapper, { style: { fontStyle: 'italic', color: TMColors.primary }, children: `AS ${getDisplayAlias(getDcmtTypeName(ji.tid), ji.alias)}` })] }), ji.on?.map((onItem, indexOn) => {
|
|
727
729
|
return (_jsxs(StyledRowItem, { style: { marginLeft: '40px' }, children: [!isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconClear, { color: TMColors.button_icon }), caption: SDKUI_Localizator.Remove, onClick: () => onRemove_OnJoinItem(index, indexOn) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconAddCircleOutline, { color: TMColors.button_icon }), caption: SDKUI_Localizator.AddBelow, onClick: () => onAdd_OnJoinItem(index, indexOn + 1) }), !isReadOnly && _jsx(TMQdDropDownMenu, { content: _jsx(TMTooltip, { content: SDK_Localizator.toCaseWord(SDKUI_Localizator.OneMore), children: _jsx(IconDotsVerticalCircleOutline, { color: TMColors.button_icon }) }), items: [
|
|
728
|
-
{
|
|
729
|
-
{
|
|
730
|
-
{
|
|
730
|
+
{ name: SDKUI_Localizator.AddAbove, onClick: () => onAdd_OnJoinItem(index, indexOn) },
|
|
731
|
+
{ name: SDKUI_Localizator.AddBelow, onClick: () => onAdd_OnJoinItem(index, indexOn + 1) },
|
|
732
|
+
{ name: SDKUI_Localizator.Remove, onClick: () => onRemove_OnJoinItem(index, indexOn) },
|
|
731
733
|
{
|
|
732
|
-
|
|
734
|
+
name: SDKUI_Localizator.RemoveAll, onClick: () => {
|
|
733
735
|
if (!formData.join)
|
|
734
736
|
return;
|
|
735
737
|
const joinCopy = formData?.join?.map((ji) => { return { ...ji }; }) ?? [];
|
|
@@ -737,41 +739,41 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, isExpertMode, showDis
|
|
|
737
739
|
setFormData({ ...formData, join: joinCopy });
|
|
738
740
|
}
|
|
739
741
|
}
|
|
740
|
-
] }), _jsx(TMMetadataChooser, { disabled: isReadOnly, showEditButton: false, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, borderRadius: borderRadius, showId: showId, backgroundColor: getColorIndex({ tid: onItem.leftTID, alias: onItem.leftAlias }), qd: formData, values: onItem.leftTID ? [{ tid: onItem.leftTID, mid: onItem.leftMID, aliasTID: onItem.leftAlias }] : [], onValueChanged: (values) => { values.length > 0 && onChange_OnJoinMetadatoLeft(values[0], index, indexOn); } }), _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, color: 'green', borderRadius: borderRadius, content: _jsx(StyledItemWrapper, { children: LocalizeQueryOperators(onItem.operator) }), items: [] }), _jsx(TMMetadataChooser, { disabled: isReadOnly, showEditButton: false, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, borderRadius: borderRadius, showId: showId, backgroundColor: getColorIndex({ tid: onItem.rightTID, alias: onItem.rightAlias }), qd: formData, values: onItem.rightTID ? [{ tid: onItem.rightTID, mid: onItem.rightMID, aliasTID: onItem.rightAlias }] : [], onValueChanged: (values) => { values.length > 0 && onChange_OnJoinMetadatoRight(values[0], index, indexOn); } })] }, indexOn));
|
|
742
|
+
] }), _jsx(TMMetadataChooser, { disabled: isReadOnly, showEditButton: false, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, borderRadius: borderRadius, showId: showId, backgroundColor: getColorIndex({ tid: onItem.leftTID, alias: onItem.leftAlias }), qd: formData, values: onItem.leftTID ? [{ tid: onItem.leftTID, mid: onItem.leftMID, aliasTID: onItem.leftAlias }] : [], onValueChanged: (values) => { values.length > 0 && onChange_OnJoinMetadatoLeft(values[0], index, indexOn); }, updateIsModalOpen: updateIsModalOpen }), _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, color: 'green', borderRadius: borderRadius, content: _jsx(StyledItemWrapper, { children: LocalizeQueryOperators(onItem.operator) }), items: [] }), _jsx(TMMetadataChooser, { disabled: isReadOnly, showEditButton: false, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, borderRadius: borderRadius, showId: showId, backgroundColor: getColorIndex({ tid: onItem.rightTID, alias: onItem.rightAlias }), qd: formData, values: onItem.rightTID ? [{ tid: onItem.rightTID, mid: onItem.rightMID, aliasTID: onItem.rightAlias }] : [], onValueChanged: (values) => { values.length > 0 && onChange_OnJoinMetadatoRight(values[0], index, indexOn); }, updateIsModalOpen: updateIsModalOpen })] }, indexOn));
|
|
741
743
|
})] }, `${ji.tid}_${index}`));
|
|
742
744
|
}), _jsx(TMVilViewer, { vil: validationItems.filter((o) => o.PropertyName === TMPropertyNames.join) })] }) }) }), canShowSelect && _jsx(Item, { title: SDK_Localizator.QuerySelect, titleRender: (tabItemProps) => renderAccordionTitle(tabItemProps, selectCount, validationItems.filter((o) => o.PropertyName == TMPropertyNames.select)), children: _jsx(StyledAccordionItemContainer, { children: _jsxs(StyledAccordionItemContent, { "$disabled": isReadOnly, children: [_jsx(TMVilViewer, { vil: validationItems.filter((o) => o.PropertyName === TMPropertyNames.select) }), (!formData?.select || formData?.select.length <= 0) && !isReadOnly &&
|
|
743
745
|
_jsxs(StyledRowItem, { children: [_jsx(TMButton, { btnStyle: 'normal', disabled: !formData?.from?.tid, caption: SDKUI_Localizator.Add, onClick: onAdd_SelectItem }), dcmtTypesList.length == 1
|
|
744
746
|
? _jsx(TMButton, { btnStyle: 'normal', disabled: !formData?.from?.tid, caption: SDKUI_Localizator.AddAlls, onClick: () => { onAddAll_SelectItem(qdTIDs[0]); } })
|
|
745
|
-
: _jsx(TMQdDropDownMenu, { backgroundColor: 'white', borderRadius: '3px', content: _jsx(TMButton, { btnStyle: 'normal', disabled: !formData?.from?.tid, caption: SDKUI_Localizator.AddAlls }), items: qdTIDs.map((tid_alias) => ({
|
|
746
|
-
return (_jsxs(StyledRowItem, { onDragEnd: dragEnd, onDragOver: dragOver, onDrop: (e) => dropSelect(e, si), children: [!isReadOnly && _jsx(StyledDraggableDiv, { draggable: true, onDragStart: (e) => dragStart(e, si), children: _jsx(IconDraggabledots, { fontSize: 15, color: TMColors.button_icon }) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconClear, { color: TMColors.button_icon }), caption: SDKUI_Localizator.Remove, onClick: () => onRemove_SelectItem(index) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconAddCircleOutline, { color: TMColors.button_icon }), caption: SDKUI_Localizator.AddBelow, onClick: () => onAdd_SelectItem(index + 1) }), !isReadOnly && _jsx(TMQdDropDownMenu, { content: _jsx(TMTooltip, { content: SDK_Localizator.toCaseWord(SDKUI_Localizator.OneMore), children: _jsx(IconDotsVerticalCircleOutline, { color: TMColors.button_icon }) }), items: getSelectMenuItems(index) }), (!isReadOnly || (si.function && si.function != QueryFunctions.None)) && _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, color: 'green', borderRadius: borderRadius, content: _jsx(StyledItemWrapper, { children: si.function === QueryFunctions.None ? "..." : LocalizeQueryFunctions(si.function) }), items: getQueryFunctionsMenuItems(si, index) }), _jsx(TMMetadataChooser, { disabled: isReadOnly, filterMetadata: (o => o.perm?.canView === AccessLevels.Yes || o.perm?.canUpdate === AccessLevels.Yes), showEditButton: false, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, borderRadius: borderRadius, showId: showId, backgroundColor: getColorIndex({ tid: si.tid, alias: si.alias }), qd: formData, values: [{ tid: si.tid, mid: si.mid, aliasTID: si.alias }], onValueChanged: (values) => { values.length > 0 && onChange_SelectItem_MID(values[0], index); } }), (!isReadOnly || si.as) && _jsx(TMQdEditableItem, { value: si.as, backgroundColor: colorValue, placeHolder: `<${SDKUI_Localizator.Query_EnterAlias}...>`, width: '100%', onValueChanged: (value) => { onChange_SelectItem_As(value, index); } })] }, `${si.tid}_${si.mid}_${index}`));
|
|
747
|
+
: _jsx(TMQdDropDownMenu, { backgroundColor: 'white', borderRadius: '3px', content: _jsx(TMButton, { btnStyle: 'normal', disabled: !formData?.from?.tid, caption: SDKUI_Localizator.AddAlls }), items: qdTIDs.map((tid_alias) => ({ name: `${getDisplayAlias(getDcmtTypeName(tid_alias.tid), tid_alias.alias)}`, onClick: () => { onAddAll_SelectItem(tid_alias); } })) })] }), formData?.select?.map((si, index) => {
|
|
748
|
+
return (_jsxs(StyledRowItem, { onDragEnd: dragEnd, onDragOver: dragOver, onDrop: (e) => dropSelect(e, si), children: [!isReadOnly && _jsx(StyledDraggableDiv, { draggable: true, onDragStart: (e) => dragStart(e, si), children: _jsx(IconDraggabledots, { fontSize: 15, color: TMColors.button_icon }) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconClear, { color: TMColors.button_icon }), caption: SDKUI_Localizator.Remove, onClick: () => onRemove_SelectItem(index) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconAddCircleOutline, { color: TMColors.button_icon }), caption: SDKUI_Localizator.AddBelow, onClick: () => onAdd_SelectItem(index + 1) }), !isReadOnly && _jsx(TMQdDropDownMenu, { content: _jsx(TMTooltip, { content: SDK_Localizator.toCaseWord(SDKUI_Localizator.OneMore), children: _jsx(IconDotsVerticalCircleOutline, { color: TMColors.button_icon }) }), items: getSelectMenuItems(index) }), (!isReadOnly || (si.function && si.function != QueryFunctions.None)) && _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, color: 'green', borderRadius: borderRadius, content: _jsx(StyledItemWrapper, { children: si.function === QueryFunctions.None ? "..." : LocalizeQueryFunctions(si.function) }), items: getQueryFunctionsMenuItems(si, index) }), _jsx(TMMetadataChooser, { disabled: isReadOnly, filterMetadata: (o => o.perm?.canView === AccessLevels.Yes || o.perm?.canUpdate === AccessLevels.Yes), showEditButton: false, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, borderRadius: borderRadius, showId: showId, backgroundColor: getColorIndex({ tid: si.tid, alias: si.alias }), qd: formData, values: [{ tid: si.tid, mid: si.mid, aliasTID: si.alias }], onValueChanged: (values) => { values.length > 0 && onChange_SelectItem_MID(values[0], index); }, updateIsModalOpen: updateIsModalOpen }), (!isReadOnly || si.as) && _jsx(TMQdEditableItem, { value: si.as, backgroundColor: colorValue, placeHolder: `<${SDKUI_Localizator.Query_EnterAlias}...>`, width: '100%', onValueChanged: (value) => { onChange_SelectItem_As(value, index); } })] }, `${si.tid}_${si.mid}_${index}`));
|
|
747
749
|
})] }) }) }), fromCount > 0 && (!isReadOnly || whereCount > 0) && _jsx(Item, { title: SDK_Localizator.QueryWhere, titleRender: (tabItemProps) => renderAccordionTitle(tabItemProps, whereCount, validationItems.filter((o) => o.PropertyName == TMPropertyNames.where)), children: _jsx(StyledAccordionItemContainer, { children: _jsxs(StyledAccordionItemContent, { "$disabled": isReadOnly, children: [_jsx(TMVilViewer, { vil: validationItems.filter((o) => o.PropertyName === TMPropertyNames.where) }), (!formData?.where || formData?.where.length <= 0) && !isReadOnly &&
|
|
748
750
|
_jsx(StyledRowItem, { children: _jsx(TMButton, { btnStyle: 'normal', disabled: !formData?.from?.tid, caption: SDKUI_Localizator.Add, onClick: onAdd_WhereItem }) }), formData?.where?.map((wi, index) => {
|
|
749
751
|
return (_jsxs(StyledRowItem, { onDragEnd: dragEnd, onDragOver: dragOver, onDrop: (e) => dropWhere(e, wi), children: [!isReadOnly && _jsx(StyledDraggableDiv, { draggable: true, onDragStart: (e) => dragStart(e, wi), children: _jsx(IconDraggabledots, { fontSize: 15, color: TMColors.button_icon }) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconClear, { color: TMColors.button_icon }), caption: SDKUI_Localizator.Remove, onClick: () => onRemove_WhereItem(index) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconAddCircleOutline, { color: TMColors.button_icon }), caption: SDKUI_Localizator.AddBelow, onClick: () => onAdd_WhereItem(index + 1) }), !isReadOnly && _jsx(TMQdDropDownMenu, { content: _jsx(TMTooltip, { content: SDK_Localizator.toCaseWord(SDKUI_Localizator.OneMore), children: _jsx(IconDotsVerticalCircleOutline, { color: TMColors.button_icon }) }), items: [
|
|
750
|
-
{
|
|
751
|
-
{
|
|
752
|
-
{
|
|
753
|
-
{
|
|
752
|
+
{ name: SDKUI_Localizator.AddAbove, onClick: () => onAdd_WhereItem(index) },
|
|
753
|
+
{ name: SDKUI_Localizator.AddBelow, onClick: () => onAdd_WhereItem(index + 1) },
|
|
754
|
+
{ name: SDKUI_Localizator.Remove, onClick: () => onRemove_WhereItem(index) },
|
|
755
|
+
{ name: SDKUI_Localizator.RemoveAll, onClick: () => setFormData({ ...formData, where: undefined }) },
|
|
754
756
|
{
|
|
755
|
-
|
|
756
|
-
{
|
|
757
|
-
{
|
|
758
|
-
{
|
|
757
|
+
name: "Imposta parametro", submenu: [
|
|
758
|
+
{ name: "{@UserName}", onClick: () => onChange_WhereItem_Values("{@UserName}", undefined, index) },
|
|
759
|
+
{ name: "{@UserID}", onClick: () => onChange_WhereItem_Values("{@UserID}", undefined, index) },
|
|
760
|
+
{ name: "{@QueryParam...N}", onClick: () => onChange_WhereItem_Values(calcQueryParamN(), undefined, index) }
|
|
759
761
|
]
|
|
760
762
|
},
|
|
761
763
|
] }), _jsx(TMQdDropDownMenu, { disabled: index == 0, color: 'green', content: _jsx("div", { style: { fontSize: '1rem' }, children: wi.or ? 'OR' : 'AND' }), items: [
|
|
762
|
-
{
|
|
763
|
-
{
|
|
764
|
-
] }), _jsx(TMQdEditableItem, { value: wi.leftBrackets, allowedPattern: /\(/g, backgroundColor: colorBrackets, onValueChanged: (value) => { onChange_WhereItem_Brackets(value, true, index); } }), _jsx(TMMetadataChooser, { disabled: isReadOnly, filterMetadata: (o => o.perm?.canSearch === AccessLevels.Yes), showEditButton: false, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, borderRadius: borderRadius, showId: showId, backgroundColor: getColorIndex({ tid: wi.tid, alias: wi.alias }), qd: formData, values: [{ tid: wi.tid, mid: wi.mid, aliasTID: wi.alias }], onValueChanged: (values) => { values.length > 0 && onChange_WhereItem_Metadato(values[0], index); } }), _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, color: 'green', borderRadius: borderRadius, content: _jsx(StyledDivHorizontal, { children: _jsx(StyledItemWrapper, { children: LocalizeQueryOperators(wi.operator) }) }), items: getQueryOperatorsMenuItems(wi, index) }), _jsx(TMQdWhereItemValue, { whereItem: wi, index: index, onValueChanged: (values) => { onChange_WhereItem_Values(values[0], values[1], index); } }), _jsx(TMQdEditableItem, { value: wi.rightBrackets, allowedPattern: /\)/g, backgroundColor: colorBrackets, onValueChanged: (value) => { onChange_WhereItem_Brackets(value, false, index); } })] }, `${wi.tid}_${wi.mid}_${index}`));
|
|
764
|
+
{ name: 'AND', onClick: () => onChange_WhereItem_Or(false, index) },
|
|
765
|
+
{ name: 'OR', onClick: () => onChange_WhereItem_Or(true, index) }
|
|
766
|
+
] }), _jsx(TMQdEditableItem, { value: wi.leftBrackets, allowedPattern: /\(/g, backgroundColor: colorBrackets, onValueChanged: (value) => { onChange_WhereItem_Brackets(value, true, index); } }), _jsx(TMMetadataChooser, { disabled: isReadOnly, filterMetadata: (o => o.perm?.canSearch === AccessLevels.Yes), showEditButton: false, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, borderRadius: borderRadius, showId: showId, backgroundColor: getColorIndex({ tid: wi.tid, alias: wi.alias }), qd: formData, values: [{ tid: wi.tid, mid: wi.mid, aliasTID: wi.alias }], onValueChanged: (values) => { values.length > 0 && onChange_WhereItem_Metadato(values[0], index); }, updateIsModalOpen: updateIsModalOpen }), _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, color: 'green', borderRadius: borderRadius, content: _jsx(StyledDivHorizontal, { children: _jsx(StyledItemWrapper, { children: LocalizeQueryOperators(wi.operator) }) }), items: getQueryOperatorsMenuItems(wi, index) }), _jsx(TMQdWhereItemValue, { whereItem: wi, index: index, onValueChanged: (values) => { onChange_WhereItem_Values(values[0], values[1], index); }, updateIsModalOpen: updateIsModalOpen }), _jsx(TMQdEditableItem, { value: wi.rightBrackets, allowedPattern: /\)/g, backgroundColor: colorBrackets, onValueChanged: (value) => { onChange_WhereItem_Brackets(value, false, index); } })] }, `${wi.tid}_${wi.mid}_${index}`));
|
|
765
767
|
})] }) }) }), fromCount > 0 && (!isReadOnly || orderByCount > 0) && _jsx(Item, { title: SDK_Localizator.QueryOrderBy, titleRender: (tabItemProps) => renderAccordionTitle(tabItemProps, orderByCount, validationItems.filter((o) => o.PropertyName == TMPropertyNames.orderBy)), children: _jsx(StyledAccordionItemContainer, { children: _jsxs(StyledAccordionItemContent, { "$disabled": isReadOnly, children: [(!formData?.orderBy || formData?.orderBy.length <= 0) && !isReadOnly &&
|
|
766
768
|
_jsx(StyledRowItem, { children: _jsx(TMButton, { btnStyle: 'normal', disabled: !formData?.from?.tid, caption: SDKUI_Localizator.Add, onClick: onAdd_OrderByItem }) }), formData?.orderBy?.map((oi, index) => {
|
|
767
769
|
return (_jsxs(StyledRowItem, { onDragEnd: dragEnd, onDragOver: dragOver, onDrop: (e) => dropOrderBy(e, oi), children: [!isReadOnly && _jsx(StyledDraggableDiv, { draggable: true, onDragStart: (e) => dragStart(e, oi), children: _jsx(IconDraggabledots, { fontSize: 15, color: TMColors.button_icon }) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconClear, { color: TMColors.button_icon }), caption: SDKUI_Localizator.Remove, onClick: () => onRemove_OrderByItem(index) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconAddCircleOutline, { color: TMColors.button_icon }), caption: SDKUI_Localizator.AddBelow, onClick: () => onAdd_OrderByItem(index + 1) }), !isReadOnly && _jsx(TMQdDropDownMenu, { content: _jsx(TMTooltip, { content: SDK_Localizator.toCaseWord(SDKUI_Localizator.OneMore), children: _jsx(IconDotsVerticalCircleOutline, { color: TMColors.button_icon }) }), items: [
|
|
768
|
-
{
|
|
769
|
-
{
|
|
770
|
-
{
|
|
771
|
-
{
|
|
772
|
-
] }), _jsx(TMMetadataChooser, { disabled: isReadOnly, filterMetadata: (o => o.perm?.canView === AccessLevels.Yes || o.perm?.canUpdate === AccessLevels.Yes), showEditButton: false, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, showId: showId, borderRadius: borderRadius, backgroundColor: getColorIndex({ tid: oi.tid, alias: oi.alias }), qd: formData, values: [{ tid: oi.tid, mid: oi.mid, aliasTID: oi.alias }], onValueChanged: (values) => onChange_OrderByItem_MID(values[0], index) }), _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, borderRadius: borderRadius, content: _jsx(StyledItemWrapper, { children: oi.asc ? 'ASC' : 'DESC' }), items: [
|
|
773
|
-
{
|
|
774
|
-
{
|
|
770
|
+
{ name: SDKUI_Localizator.AddAbove, onClick: () => onAdd_OrderByItem(index) },
|
|
771
|
+
{ name: SDKUI_Localizator.AddBelow, onClick: () => onAdd_OrderByItem(index + 1) },
|
|
772
|
+
{ name: SDKUI_Localizator.Remove, onClick: () => onRemove_OrderByItem(index) },
|
|
773
|
+
{ name: SDKUI_Localizator.RemoveAll, onClick: () => setFormData({ ...formData, orderBy: undefined }) },
|
|
774
|
+
] }), _jsx(TMMetadataChooser, { disabled: isReadOnly, filterMetadata: (o => o.perm?.canView === AccessLevels.Yes || o.perm?.canUpdate === AccessLevels.Yes), showEditButton: false, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, showId: showId, borderRadius: borderRadius, backgroundColor: getColorIndex({ tid: oi.tid, alias: oi.alias }), qd: formData, values: [{ tid: oi.tid, mid: oi.mid, aliasTID: oi.alias }], onValueChanged: (values) => onChange_OrderByItem_MID(values[0], index), updateIsModalOpen: updateIsModalOpen }), _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, borderRadius: borderRadius, content: _jsx(StyledItemWrapper, { children: oi.asc ? 'ASC' : 'DESC' }), items: [
|
|
775
|
+
{ name: 'ASC', onClick: () => onChange_OrderByItem_Asc(true, oi, index) },
|
|
776
|
+
{ name: 'DESC', onClick: () => onChange_OrderByItem_Asc(false, oi, index) }
|
|
775
777
|
] })] }, `${oi.tid}_${oi.mid}_${index}`));
|
|
776
778
|
})] }) }) }), fromCount > 0 && _jsx(Item, { title: SDKUI_Localizator.Options, titleRender: (tabItemProps) => renderAccordionTitle(tabItemProps, undefined, []), children: _jsx(StyledAccordionItemContainer, { children: _jsxs(StyledAccordionItemContent, { "$disabled": isReadOnly, children: [showDistinct && _jsx(TMCheckBox, { label: SDK_Localizator.QueryDistinct, value: formData.isDistinct, onValueChanged: () => { setFormData({ ...formData, isDistinct: !formData.isDistinct }); } }), _jsx(TMTextBox, { type: 'number', width: '200px', label: SDKUI_Localizator.MaxDcmtsToBeReturned, validationItems: validationItems.filter((o) => o.PropertyName == TMPropertyNames.maxDcmtsToBeReturned), value: formData.maxDcmtsToBeReturned, onBlur: (newValue) => setFormData({ ...formData, maxDcmtsToBeReturned: Number(newValue) }) })] }) }) })] }), _jsx(ConfirmQueryParamsDialog, {})] }), showResultSearch && _jsxs(StyledModalContainer, { children: [" ", renderResultSearchForm, " "] })] }));
|
|
777
779
|
};
|
|
@@ -795,7 +797,7 @@ const TMQdEditableItem = ({ value, placeHolder, width, backgroundColor, allowedP
|
|
|
795
797
|
:
|
|
796
798
|
_jsx(StyledItemWrapper, { onClick: () => setIsComponentVisible(true), style: { backgroundColor: backgroundColor, cursor: 'pointer' }, children: value ?? placeHolder }) }));
|
|
797
799
|
};
|
|
798
|
-
const TMQdWhereItemValue = ({ whereItem, index, queryParamsDynDataList, onlyEditing = false, onValueChanged, onCascadeRefreshDynDataLists }) => {
|
|
800
|
+
const TMQdWhereItemValue = ({ whereItem, index, queryParamsDynDataList, onlyEditing = false, onValueChanged, onCascadeRefreshDynDataLists, updateIsModalOpen }) => {
|
|
799
801
|
let EditingModes;
|
|
800
802
|
(function (EditingModes) {
|
|
801
803
|
EditingModes[EditingModes["None"] = 0] = "None";
|
|
@@ -943,7 +945,7 @@ const TMQdWhereItemValue = ({ whereItem, index, queryParamsDynDataList, onlyEdit
|
|
|
943
945
|
};
|
|
944
946
|
const mdValueEmptyDescr = `<${SDKUI_Localizator.Search_EnterValue}...>`;
|
|
945
947
|
return (_jsxs("div", { ref: ref, id: containerId, style: { width: isEditing && whereItem.operator == QueryOperators.Custom && !onlyEditing ? "100%" : undefined }, children: [(isEditing || onlyEditing) &&
|
|
946
|
-
_jsxs(StyledRowItem, { children: [showValue1 && _jsx(TMMetadataEditor, { tid: whereItem.tid, mid: whereItem.mid, layoutMode: LayoutModes.None, isEditable: isEditableList, value: whereItem.value1, queryOperator: whereItem.operator, autoFocus: !onlyEditing, containerElement: containerElement, onValueChange: (value) => setCurrentValue1(value), onValueChanged: (value) => { normalizeValue(value, true); } }), showValue2 && _jsx(TMMetadataEditor, { tid: whereItem.tid, mid: whereItem.mid, layoutMode: LayoutModes.None, isEditable: isEditableList, value: whereItem.value1, queryOperator: whereItem.operator, autoFocus: !onlyEditing, containerElement: containerElement, onValueChange: (value) => setCurrentValue2(value), onValueChanged: (value) => { normalizeValue(value, false); } })] }), !isEditing && !onlyEditing && (showValue1 || showValue2) &&
|
|
948
|
+
_jsxs(StyledRowItem, { children: [showValue1 && _jsx(TMMetadataEditor, { tid: whereItem.tid, mid: whereItem.mid, layoutMode: LayoutModes.None, isEditable: isEditableList, value: whereItem.value1, queryOperator: whereItem.operator, autoFocus: !onlyEditing, containerElement: containerElement, onValueChange: (value) => setCurrentValue1(value), onValueChanged: (value) => { normalizeValue(value, true); }, updateIsModalOpen: updateIsModalOpen }), showValue2 && _jsx(TMMetadataEditor, { tid: whereItem.tid, mid: whereItem.mid, layoutMode: LayoutModes.None, isEditable: isEditableList, value: whereItem.value1, queryOperator: whereItem.operator, autoFocus: !onlyEditing, containerElement: containerElement, onValueChange: (value) => setCurrentValue2(value), onValueChanged: (value) => { normalizeValue(value, false); }, updateIsModalOpen: updateIsModalOpen })] }), !isEditing && !onlyEditing && (showValue1 || showValue2) &&
|
|
947
949
|
_jsxs(StyledDivHorizontal, { children: [(editingMode == EditingModes.Chooser) &&
|
|
948
950
|
_jsxs(_Fragment, { children: [showDataListChooseForm && !isEditableList &&
|
|
949
951
|
_jsx(TMDataListItemChooserForm, { height: '500px', width: '450px', allowMultipleSelection: whereItem.operator == QueryOperators.In || whereItem.operator == QueryOperators.NotIn, dataListId: md?.dataListID, selectedIDs: whereItem.value1?.split(',').map((item) => !item.startsWith("'") ? item : item.slice(1, -1)) ?? [], onClose: () => setShowDataListChooseForm(false), onChoose: (IDs) => { IDs && normalizeValue(IDs.length == 1 ? IDs[0] : IDs.map((item) => `${item}`).join(","), true); } }), showDynDataListChooseForm && !isEditableList &&
|
|
@@ -985,6 +987,8 @@ const StyledContent = styled.div `
|
|
|
985
987
|
opacity: ${props => props.$disabled ? 0.4 : 1};
|
|
986
988
|
pointer-events: ${props => props.$disabled ? 'none' : ''};
|
|
987
989
|
user-select: none;
|
|
990
|
+
-webkit-touch-callout: none;
|
|
991
|
+
-webkit-user-select: none;
|
|
988
992
|
display: flex;
|
|
989
993
|
align-items: center;
|
|
990
994
|
|
|
@@ -997,5 +1001,5 @@ const StyledContent = styled.div `
|
|
|
997
1001
|
const TMQdDropDownMenu = ({ content, items, disabled = false, color = TMColors.text_normal, backgroundColor = TMColors.default_background, borderRadius }) => {
|
|
998
1002
|
const [id, setID] = useState('');
|
|
999
1003
|
useEffect(() => { setID(genUniqueId()); }, [content]);
|
|
1000
|
-
return (
|
|
1004
|
+
return (_jsx(ContextMenu, { target: `#idContainer${id}`, items: items || [], trigger: "left", children: _jsx(StyledContent, { id: `idContainer${id}`, tabIndex: disabled ? -1 : 0, "$disabled": disabled, "$color": color, "$backgroundColor": backgroundColor, "$borderRadius": borderRadius, children: content }) }));
|
|
1001
1005
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const SettingsAppearance: ({ landingPagesOptions, permissions }: {
|
|
1
|
+
declare const SettingsAppearance: ({ landingPagesOptions, permissions, showConfirmPopup }: {
|
|
2
2
|
landingPagesOptions?: {
|
|
3
3
|
display: string;
|
|
4
4
|
value: string;
|
|
@@ -10,5 +10,6 @@ declare const SettingsAppearance: ({ landingPagesOptions, permissions }: {
|
|
|
10
10
|
dossiersLicense: boolean;
|
|
11
11
|
workFlowLicense: boolean;
|
|
12
12
|
};
|
|
13
|
+
showConfirmPopup?: (title: string, onConfirm: () => void) => void;
|
|
13
14
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export default SettingsAppearance;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo
|
|
3
|
-
import TMLayoutContainer from '../base/TMLayout';
|
|
2
|
+
import { useMemo } from 'react';
|
|
4
3
|
import TMDropDown from '../editors/TMDropDown';
|
|
5
4
|
import TMCheckBox from '../editors/TMCheckBox';
|
|
6
5
|
import TMButton from '../base/TMButton';
|
|
7
6
|
import { LandingPages, SDKUI_Globals, SDKUI_Localizator, ThemeSettings } from '../../helper';
|
|
7
|
+
import { useSettingsFeedback } from '../../hooks/useSettingsFeedback';
|
|
8
|
+
import TMTooltip from '../base/TMTooltip';
|
|
8
9
|
const fontSizes = [
|
|
9
10
|
{ value: "10px", display: "10px" },
|
|
10
11
|
{ value: "11px", display: "11px" },
|
|
@@ -22,9 +23,18 @@ const fontFamilies = [
|
|
|
22
23
|
{ value: "Inter", display: "Inter" },
|
|
23
24
|
{ value: "Roboto", display: "Roboto" }
|
|
24
25
|
];
|
|
25
|
-
const SettingsAppearance = ({ landingPagesOptions, permissions = { canArchive: true, canSearch: true, dossiersLicense: true, wgGroupLicense: true, workFlowLicense: true } }) => {
|
|
26
|
-
const
|
|
27
|
-
const
|
|
26
|
+
const SettingsAppearance = ({ landingPagesOptions, permissions = { canArchive: true, canSearch: true, dossiersLicense: true, wgGroupLicense: true, workFlowLicense: true }, showConfirmPopup }) => {
|
|
27
|
+
const { showSavedBadge, lastChanged, triggerUIUpdate, closeBadge } = useSettingsFeedback();
|
|
28
|
+
const handleRestoreClick = () => {
|
|
29
|
+
if (!showConfirmPopup) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
showConfirmPopup(SDKUI_Localizator.ConfirmRestoreDefaultSettings, () => {
|
|
33
|
+
SDKUI_Globals.userSettings.themeSettings = new ThemeSettings();
|
|
34
|
+
SDKUI_Globals.userSettings.landingPage = LandingPages.DASHBOARD;
|
|
35
|
+
triggerUIUpdate(SDKUI_Localizator.Restore, 'Impostazioni predefinite', true);
|
|
36
|
+
});
|
|
37
|
+
};
|
|
28
38
|
const filteredLandingPageOptopns = useMemo(() => {
|
|
29
39
|
let options = landingPagesOptions ?? [];
|
|
30
40
|
if (!permissions?.canArchive) {
|
|
@@ -44,30 +54,89 @@ const SettingsAppearance = ({ landingPagesOptions, permissions = { canArchive: t
|
|
|
44
54
|
}
|
|
45
55
|
return options;
|
|
46
56
|
}, [permissions?.canArchive, permissions?.canSearch, permissions?.wgGroupLicense, permissions?.dossiersLicense, permissions?.workFlowLicense, landingPagesOptions]);
|
|
47
|
-
return (_jsxs(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
57
|
+
return (_jsxs("div", { style: { width: "100%", height: "100%", display: "flex", flexDirection: "column", position: "relative" }, children: [_jsxs("div", { style: { flex: 1, overflowY: "auto" }, children: [_jsxs("div", { style: {
|
|
58
|
+
backgroundColor: "rgba(var(--primary-rgb, 33, 150, 243), 0.04)",
|
|
59
|
+
borderLeft: "3px solid var(--primary-color, #2196f3)",
|
|
60
|
+
borderRadius: "4px",
|
|
61
|
+
padding: "10px 12px",
|
|
62
|
+
marginBottom: "4px"
|
|
63
|
+
}, children: [_jsxs("div", { style: {
|
|
64
|
+
display: "flex",
|
|
65
|
+
alignItems: "center",
|
|
66
|
+
gap: "6px",
|
|
67
|
+
marginBottom: "4px"
|
|
68
|
+
}, children: [_jsx("i", { className: "dx-icon-font", style: { fontSize: "1.1rem", color: "var(--primary-color, #2196f3)" } }), _jsx("p", { style: { fontSize: '1.05rem', fontWeight: '600', margin: 0, color: "var(--text-primary, #333)" }, children: "Font" })] }), _jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "2px" }, children: [_jsx(TMDropDown, { label: SDKUI_Localizator.Name, dataSource: fontFamilies, width: '100%', value: SDKUI_Globals.userSettings.themeSettings.fontFamily, onValueChanged: (e) => {
|
|
69
|
+
let newFamily = e.target.value;
|
|
70
|
+
SDKUI_Globals.userSettings.themeSettings.fontFamily = newFamily;
|
|
71
|
+
triggerUIUpdate(SDKUI_Localizator.Name, newFamily);
|
|
72
|
+
} }), _jsx(TMDropDown, { label: SDKUI_Localizator.Size, dataSource: fontSizes, width: '100%', value: SDKUI_Globals.userSettings.themeSettings.fontSize, onValueChanged: (e) => {
|
|
73
|
+
let newpx = e.target.value;
|
|
74
|
+
SDKUI_Globals.userSettings.themeSettings.fontSize = newpx;
|
|
75
|
+
triggerUIUpdate(SDKUI_Localizator.Size, newpx);
|
|
76
|
+
} })] })] }), _jsxs("div", { style: {
|
|
77
|
+
backgroundColor: "rgba(var(--success-rgb, 76, 175, 80), 0.04)",
|
|
78
|
+
borderLeft: "3px solid var(--success-color, #4caf50)",
|
|
79
|
+
borderRadius: "4px",
|
|
80
|
+
padding: "10px 12px",
|
|
81
|
+
marginBottom: "4px"
|
|
82
|
+
}, children: [_jsxs("div", { style: {
|
|
83
|
+
display: "flex",
|
|
84
|
+
alignItems: "center",
|
|
85
|
+
gap: "6px",
|
|
86
|
+
marginBottom: "4px"
|
|
87
|
+
}, children: [_jsx("i", { className: "dx-icon-tableproperties", style: { fontSize: "1.1rem", color: "var(--success-color, #4caf50)" } }), _jsx("p", { style: { fontSize: '1.05rem', fontWeight: '600', margin: 0, color: "var(--text-primary, #333)" }, children: SDKUI_Localizator.Grids })] }), _jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "5px" }, children: [_jsx(TMCheckBox, { label: SDKUI_Localizator.ShowRowSeparatingLines, value: SDKUI_Globals.userSettings.themeSettings.gridSettings.showRowLines, onValueChanged: (newValue) => {
|
|
88
|
+
SDKUI_Globals.userSettings.themeSettings.gridSettings.showRowLines = newValue;
|
|
89
|
+
triggerUIUpdate(SDKUI_Localizator.ShowRowSeparatingLines, newValue ? 'Attivo' : 'Non attivo');
|
|
90
|
+
} }), _jsx(TMCheckBox, { label: SDKUI_Localizator.ShowColumnSeparatingLines, value: SDKUI_Globals.userSettings.themeSettings.gridSettings.showColumnLines, onValueChanged: (newValue) => {
|
|
91
|
+
SDKUI_Globals.userSettings.themeSettings.gridSettings.showColumnLines = newValue;
|
|
92
|
+
triggerUIUpdate(SDKUI_Localizator.ShowColumnSeparatingLines, newValue ? 'Attivo' : 'Non attivo');
|
|
93
|
+
} }), _jsx(TMCheckBox, { label: SDKUI_Localizator.UseNativeScrollbar, value: SDKUI_Globals.userSettings.themeSettings.gridSettings.useNativeScrollbar, onValueChanged: (newValue) => {
|
|
94
|
+
SDKUI_Globals.userSettings.themeSettings.gridSettings.useNativeScrollbar = newValue;
|
|
95
|
+
triggerUIUpdate(SDKUI_Localizator.UseNativeScrollbar, newValue ? 'Attivo' : 'Non attivo');
|
|
96
|
+
} })] })] }), landingPagesOptions && (_jsxs("div", { style: {
|
|
97
|
+
backgroundColor: "rgba(var(--warning-rgb, 255, 152, 0), 0.04)",
|
|
98
|
+
borderLeft: "3px solid var(--warning-color, #ff9800)",
|
|
99
|
+
borderRadius: "4px",
|
|
100
|
+
padding: "10px 12px"
|
|
101
|
+
}, children: [_jsxs("div", { style: {
|
|
102
|
+
display: "flex",
|
|
103
|
+
alignItems: "center",
|
|
104
|
+
gap: "6px",
|
|
105
|
+
marginBottom: "4px"
|
|
106
|
+
}, children: [_jsx("i", { className: "dx-icon-home", style: { fontSize: "1.1rem", color: "var(--warning-color, #ff9800)" } }), _jsx("p", { style: { fontSize: '1.05rem', fontWeight: '600', margin: 0, color: "var(--text-primary, #333)" }, children: SDKUI_Localizator.LandingPage })] }), _jsx(TMDropDown, { dataSource: filteredLandingPageOptopns, value: SDKUI_Globals.userSettings.landingPage, width: '100%', onValueChanged: (e) => {
|
|
107
|
+
const selectedOption = filteredLandingPageOptopns.find(opt => opt.value === e.target.value);
|
|
108
|
+
SDKUI_Globals.userSettings.landingPage = e.target.value;
|
|
109
|
+
triggerUIUpdate(SDKUI_Localizator.LandingPage, selectedOption?.display || e.target.value);
|
|
110
|
+
} })] }))] }), _jsxs("div", { style: { borderTop: "1px solid #e0e0e0", flexShrink: 0, paddingTop: "5px", display: "flex", flexDirection: "column", alignItems: "flex-end" }, children: [_jsx(TMButton, { elementStyle: { marginTop: '0px' }, caption: SDKUI_Localizator.Restore, showTooltip: false, onClick: handleRestoreClick }), showSavedBadge && (_jsxs("div", { style: {
|
|
111
|
+
marginTop: "5px",
|
|
112
|
+
backgroundColor: "#4caf50",
|
|
113
|
+
color: "white",
|
|
114
|
+
padding: "7px 12px",
|
|
115
|
+
fontSize: "0.95rem",
|
|
116
|
+
borderRadius: "4px",
|
|
117
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.15)",
|
|
118
|
+
display: "flex",
|
|
119
|
+
alignItems: "center",
|
|
120
|
+
gap: "10px",
|
|
121
|
+
width: "100%",
|
|
122
|
+
maxWidth: "350px",
|
|
123
|
+
boxSizing: "border-box"
|
|
124
|
+
}, children: [_jsx("i", { className: "dx-icon-save", style: { fontSize: "1rem", flexShrink: 0 } }), _jsx("div", { style: {
|
|
125
|
+
flex: 1,
|
|
126
|
+
minWidth: 0,
|
|
127
|
+
overflow: "hidden"
|
|
128
|
+
}, children: _jsxs("div", { style: {
|
|
129
|
+
display: "inline-flex",
|
|
130
|
+
alignItems: "center",
|
|
131
|
+
gap: "5px",
|
|
132
|
+
whiteSpace: "nowrap",
|
|
133
|
+
overflow: "hidden",
|
|
134
|
+
textOverflow: "ellipsis"
|
|
135
|
+
}, children: [_jsx("span", { children: SDKUI_Localizator.SettingSavedSuccessfully }), _jsx(TMTooltip, { content: `${lastChanged.label}: ${lastChanged.value}`, children: _jsx("i", { className: "dx-icon-info" }) })] }) }), _jsx("i", { className: "dx-icon-close", style: {
|
|
136
|
+
fontSize: "0.9rem",
|
|
137
|
+
flexShrink: 0,
|
|
138
|
+
cursor: "pointer",
|
|
139
|
+
opacity: 0.8
|
|
140
|
+
}, onClick: closeBadge })] }))] })] }));
|
|
72
141
|
};
|
|
73
142
|
export default SettingsAppearance;
|