@topconsultnpm/sdkui-react 6.19.0-dev1.61 → 6.19.0-dev1.63

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.
@@ -152,24 +152,11 @@ const ResponsiveMessageText = styled.div `
152
152
  line-height: 1.1;
153
153
  }
154
154
  `;
155
- const ResponsiveButton = styled(TMButton) `
156
- font-size: ${props => props.fontSize || 'clamp(12px, 2vw, 1.1rem)'} !important;
157
- padding: clamp(2px, 1vw, 8px) clamp(4px, 2vw, 12px) !important;
158
- min-width: clamp(30px, 10vw, 60px) !important;
159
- white-space: nowrap !important;
160
-
161
- @media (max-width: 200px) {
162
- padding: 2px 4px !important;
163
- min-width: 25px !important;
164
- font-size: 8px !important;
165
- }
166
-
167
- @media (max-width: 150px) {
168
- padding: 1px 3px !important;
169
- min-width: 20px !important;
170
- font-size: 7px !important;
171
- }
172
- `;
155
+ // ResponsiveButton wrapper component to avoid circular dependency
156
+ const ResponsiveButton = (props) => {
157
+ const { fontSize: customFontSize, ...otherProps } = props;
158
+ return _jsx(TMButton, { fontSize: customFontSize || 'clamp(12px, 2vw, 1.1rem)', padding: "clamp(2px, 1vw, 8px) clamp(4px, 2vw, 12px)", width: "clamp(30px, 10vw, 60px)", ...otherProps });
159
+ };
173
160
  const ResponsiveMessageBody = ({ message, isMobile, MessageToolbar, showToppy }) => {
174
161
  return (_jsxs(ResponsiveMessageContainer, { children: [_jsxs(ResponsiveMessageContent, { "$isMobile": isMobile, children: [showToppy && _jsx(ResponsiveToppyImage, { "$isMobile": isMobile, src: toppy, alt: "Toppy" }), _jsx(ResponsiveMessageText, { "$isMobile": isMobile, children: typeof message === 'string' ? _jsx(Message, { msg: message }) : message })] }), _jsx(MessageToolbar, {})] }));
175
162
  };
@@ -16,6 +16,7 @@ export interface TMTaskFormProps {
16
16
  visualizedTasks: Array<TaskDescriptor>;
17
17
  currentTask: TaskDescriptor | null;
18
18
  setCurrentTask?: React.Dispatch<React.SetStateAction<TaskDescriptor | null>>;
19
+ isContextualCreate?: boolean;
19
20
  selectedRowKeys: Array<number>;
20
21
  handleFocusedRowKeyChange?: (row: TaskDescriptor | undefined) => void;
21
22
  onStatusChanged?: () => void;
@@ -62,26 +62,30 @@ const TMTaskForm = (props) => {
62
62
  const { refreshWorkflowApprove } = useWorkflowApprove();
63
63
  const validator = async (taskDescriptor) => { return await taskValidatorAsync(taskDescriptor); };
64
64
  // Destructure the props object to extract individual properties
65
- const { id, title, isModal, formMode, visualizedTasks, editTaskCallback, currentTask, setCurrentTask, selectedRowKeys, handleFocusedRowKeyChange, onStatusChanged, onSaved, onClose, onCancel, taskContext, startDate, endDate, showBackButton = true, hasNavigation = true, width = "100%", height = "100%", usersList, onOpenS4TViewerRequest, s4TViewerDialogComponent, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, handleNavigateToWGs, handleNavigateToDossiers } = props;
65
+ const { id, title, isModal, formMode, visualizedTasks, editTaskCallback, currentTask, setCurrentTask, isContextualCreate = false, selectedRowKeys, handleFocusedRowKeyChange, onStatusChanged, onSaved, onClose, onCancel, taskContext, startDate, endDate, showBackButton = true, hasNavigation = true, width = "100%", height = "100%", usersList, onOpenS4TViewerRequest, s4TViewerDialogComponent, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, handleNavigateToWGs, handleNavigateToDossiers } = props;
66
66
  const sfo = new SaveFormOptions();
67
67
  sfo.objClass = ObjectClasses.Task;
68
68
  const customizeFormData = (task) => {
69
- if (taskContext?.document && formMode === FormModes.Create) {
69
+ if (!isContextualCreate)
70
+ return task;
71
+ if (formMode !== FormModes.Create)
72
+ return task;
73
+ if (taskContext?.document) {
70
74
  task.pdG = PdGs.DT;
71
75
  task.iD1 = taskContext.document.tid;
72
76
  task.iD2 = taskContext.document.did;
73
77
  }
74
- else if (taskContext?.workingGroup && formMode === FormModes.Create) {
78
+ else if (taskContext?.workingGroup) {
75
79
  task.pdG = PdGs.WG;
76
80
  task.iD1 = taskContext.workingGroup.id;
77
81
  }
78
- else if (taskContext?.dossier && formMode === FormModes.Create) {
82
+ else if (taskContext?.dossier) {
79
83
  task.pdG = PdGs.CF;
80
84
  task.iD1 = taskContext.dossier.id;
81
85
  if (currentTask)
82
86
  task.name = currentTask.name;
83
87
  }
84
- else if (taskContext?.workItem && formMode === FormModes.Create) {
88
+ else if (taskContext?.workItem) {
85
89
  task.pdG = PdGs.DT;
86
90
  task.iD1 = taskContext.workItem.tid;
87
91
  task.iD2 = taskContext.workItem.did;
@@ -315,7 +319,7 @@ const TMTaskForm = (props) => {
315
319
  && !areDifferentIDs(formData?.toID, SDK_Globals.tmSession?.SessionDescr?.userID))
316
320
  && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsxs("div", { style: { width: '100%', display: 'flex', alignItems: 'center', color: "#2559A5" }, children: [_jsx("i", { className: "dx-icon-info", style: { fontSize: 20 } }), "\u00A0", _jsx("span", { children: SDKUI_Localizator.PersonalTaskAssignmentMessage })] }) }), (!areDifferentIDs(formData?.fromID, SDK_Globals.tmSession?.SessionDescr?.userID)
317
321
  && areDifferentIDs(formData?.toID, SDK_Globals.tmSession?.SessionDescr?.userID))
318
- && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsxs("div", { style: { width: '100%', display: 'flex', alignItems: 'center', color: "#2559A5" }, children: [_jsx("i", { className: "dx-icon-info", style: { fontSize: 20 } }), "\u00A0", _jsx("span", { children: SDKUI_Localizator.TaskAssignedToUserMessage.replaceParams(users.find(user => user.id === formData?.toID)?.name ?? '-') })] }) }), (formMode === FormModes.Create && taskContext && taskContext.workingGroup && taskContext.workingGroup.id) && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%', display: 'flex', alignItems: 'center', color: "#000", marginTop: 10 }, children: _jsxs(TMTooltip, { content: getOriginLabel(PdGs.WG, taskContext.workingGroup.name), children: [_jsx("span", { children: getPdgsIconMap().get(PdGs.WG) }), "\u00A0", _jsx("span", { children: getOriginLabel(PdGs.WG, taskContext.workingGroup.name) })] }) }) }), (formMode === FormModes.Create && taskContext && taskContext.dossier && taskContext.dossier.id) && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%', display: 'flex', alignItems: 'center', color: "#000", marginTop: 10 }, children: _jsxs(TMTooltip, { content: getOriginLabel(PdGs.CF, taskContext.dossier.name), children: [_jsx("span", { children: getPdgsIconMap().get(PdGs.CF) }), "\u00A0", _jsx("span", { children: getOriginLabel(PdGs.CF, taskContext.dossier.name) })] }) }) }), (formMode === FormModes.Create && taskContext && taskContext.document && taskContext.document.tid && taskContext.document.did && taskContext.document.name) && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%', display: 'flex', alignItems: 'center', color: "#000", marginTop: 10 }, children: _jsxs(TMTooltip, { content: getOriginLabel(PdGs.DT, taskContext.document.name), children: [_jsx("span", { children: getPdgsIconMap().get(PdGs.DT) }), "\u00A0", _jsx("span", { children: getOriginLabel(PdGs.DT, taskContext.document.name) })] }) }) }), (formMode === FormModes.Create && taskContext && taskContext.workItem && taskContext.workItem.tid && taskContext.workItem.did && taskContext.workItem.name) && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%', display: 'flex', alignItems: 'center', color: "#000", marginTop: 10 }, children: _jsxs(TMTooltip, { content: getOriginLabel(PdGs.DT, taskContext.workItem.name), children: [_jsx("span", { children: getPdgsIconMap().get(PdGs.DT) }), "\u00A0", _jsx("span", { children: getOriginLabel(PdGs.DT, taskContext.workItem.name) })] }) }) }), formMode === FormModes.Update && formData?.pdG && formData?.iD1Name && (_jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => (_jsx("div", { style: {
322
+ && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsxs("div", { style: { width: '100%', display: 'flex', alignItems: 'center', color: "#2559A5" }, children: [_jsx("i", { className: "dx-icon-info", style: { fontSize: 20 } }), "\u00A0", _jsx("span", { children: SDKUI_Localizator.TaskAssignedToUserMessage.replaceParams(users.find(user => user.id === formData?.toID)?.name ?? '-') })] }) }), (formMode === FormModes.Create && isContextualCreate && taskContext && taskContext.workingGroup && taskContext.workingGroup.id) && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%', display: 'flex', alignItems: 'center', color: "#000", marginTop: 10 }, children: _jsxs(TMTooltip, { content: getOriginLabel(PdGs.WG, taskContext.workingGroup.name), children: [_jsx("span", { children: getPdgsIconMap().get(PdGs.WG) }), "\u00A0", _jsx("span", { children: getOriginLabel(PdGs.WG, taskContext.workingGroup.name) })] }) }) }), (formMode === FormModes.Create && isContextualCreate && taskContext && taskContext.dossier && taskContext.dossier.id) && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%', display: 'flex', alignItems: 'center', color: "#000", marginTop: 10 }, children: _jsxs(TMTooltip, { content: getOriginLabel(PdGs.CF, taskContext.dossier.name), children: [_jsx("span", { children: getPdgsIconMap().get(PdGs.CF) }), "\u00A0", _jsx("span", { children: getOriginLabel(PdGs.CF, taskContext.dossier.name) })] }) }) }), (formMode === FormModes.Create && isContextualCreate && taskContext && taskContext.document && taskContext.document.tid && taskContext.document.did && taskContext.document.name) && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%', display: 'flex', alignItems: 'center', color: "#000", marginTop: 10 }, children: _jsxs(TMTooltip, { content: getOriginLabel(PdGs.DT, taskContext.document.name), children: [_jsx("span", { children: getPdgsIconMap().get(PdGs.DT) }), "\u00A0", _jsx("span", { children: getOriginLabel(PdGs.DT, taskContext.document.name) })] }) }) }), (formMode === FormModes.Create && isContextualCreate && taskContext && taskContext.workItem && taskContext.workItem.tid && taskContext.workItem.did && taskContext.workItem.name) && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%', display: 'flex', alignItems: 'center', color: "#000", marginTop: 10 }, children: _jsxs(TMTooltip, { content: getOriginLabel(PdGs.DT, taskContext.workItem.name), children: [_jsx("span", { children: getPdgsIconMap().get(PdGs.DT) }), "\u00A0", _jsx("span", { children: getOriginLabel(PdGs.DT, taskContext.workItem.name) })] }) }) }), formMode === FormModes.Update && formData?.pdG && formData?.iD1Name && (_jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => (_jsx("div", { style: {
319
323
  display: 'flex',
320
324
  flexDirection: 'row',
321
325
  width: '100%',
@@ -99,7 +99,7 @@ export declare const gotoPDGExtendedLabel: (gotoVisible: boolean, pdg: PdGs, iD1
99
99
  export declare const convertToSchedulerAppointments: (tasks: Array<TaskDescriptor>) => Array<Appointment>;
100
100
  export declare const formatDate: (date: Date) => string;
101
101
  export declare const areDifferentIDs: (fromID: number | undefined, userID: number | undefined) => boolean;
102
- export declare const createTasksMenuItems: (taskDescriptor: TaskDescriptor | undefined, showId: boolean, setShowId: React.Dispatch<React.SetStateAction<boolean>>, showSearch: boolean, setShowSearch: React.Dispatch<React.SetStateAction<boolean>>, openTaskForm: (formMode: FormModes, task?: TaskDescriptor) => void, editTaskCallback: (rowId: number | undefined) => void, duplicateTaskCallback: (rowId: number | undefined) => void, onDeleteCallback: (rowIds: Array<number>) => void, markAsStatus: (rowIds: Array<number>, status: Task_States) => void, getAllTasks: () => Promise<void>, fromWG: boolean, showContextualWG: boolean, setShowContextualWG: React.Dispatch<React.SetStateAction<boolean>>, fromDossier: boolean, showContextualDossier: boolean, setShowContextualDossier: React.Dispatch<React.SetStateAction<boolean>>, fromDocument: boolean, showContextualDocument: boolean, setShowContextualDocument: React.Dispatch<React.SetStateAction<boolean>>, showGoToToday: boolean, handleGoToToday?: () => void, fromDatagrid?: boolean) => Array<TMDataGridContextMenuItem>;
102
+ export declare const createTasksMenuItems: (taskDescriptor: TaskDescriptor | undefined, showId: boolean, setShowId: React.Dispatch<React.SetStateAction<boolean>>, showSearch: boolean, setShowSearch: React.Dispatch<React.SetStateAction<boolean>>, openTaskForm: (formMode: FormModes, task?: TaskDescriptor, isContextual?: boolean) => void, openEditTaskForm: (rowId: number | undefined) => void, openDuplicateTaskForm: (rowId: number | undefined) => void, onDeleteCallback: (rowIds: Array<number>) => void, markAsStatus: (rowIds: Array<number>, status: Task_States) => void, getAllTasks: () => Promise<void>, fromWG: boolean, showContextualWG: boolean, setShowContextualWG: React.Dispatch<React.SetStateAction<boolean>>, fromDossier: boolean, showContextualDossier: boolean, setShowContextualDossier: React.Dispatch<React.SetStateAction<boolean>>, fromDocument: boolean, showContextualDocument: boolean, setShowContextualDocument: React.Dispatch<React.SetStateAction<boolean>>, showGoToToday: boolean, handleGoToToday?: () => void, fromDatagrid?: boolean) => Array<TMDataGridContextMenuItem>;
103
103
  export declare const checkIfNew: (fromId: number | undefined, isNew: number | undefined) => boolean;
104
104
  export declare const getNewTaskCount: (tasks: Array<TaskDescriptor>) => number;
105
105
  export declare const isTaskAssignedToAnotherUser: (task: TaskDescriptor) => boolean;
@@ -381,7 +381,7 @@ export const areDifferentIDs = (fromID, userID) => {
381
381
  }
382
382
  return false;
383
383
  };
384
- export const createTasksMenuItems = (taskDescriptor, showId, setShowId, showSearch, setShowSearch, openTaskForm, editTaskCallback, duplicateTaskCallback, onDeleteCallback, markAsStatus, getAllTasks, fromWG, showContextualWG, setShowContextualWG, fromDossier, showContextualDossier, setShowContextualDossier, fromDocument, showContextualDocument, setShowContextualDocument, showGoToToday, handleGoToToday, fromDatagrid = true) => {
384
+ export const createTasksMenuItems = (taskDescriptor, showId, setShowId, showSearch, setShowSearch, openTaskForm, openEditTaskForm, openDuplicateTaskForm, onDeleteCallback, markAsStatus, getAllTasks, fromWG, showContextualWG, setShowContextualWG, fromDossier, showContextualDossier, setShowContextualDossier, fromDocument, showContextualDocument, setShowContextualDocument, showGoToToday, handleGoToToday, fromDatagrid = true) => {
385
385
  const isTaskDescriptorDefined = taskDescriptor !== undefined;
386
386
  const isTaskFromAnotherUser = isTaskDescriptorDefined && areDifferentIDs(taskDescriptor.fromID, SDK_Globals.tmSession?.SessionDescr?.userID);
387
387
  const menuItems = [
@@ -389,26 +389,26 @@ export const createTasksMenuItems = (taskDescriptor, showId, setShowId, showSear
389
389
  id: 'createContextualTask',
390
390
  text: SDKUI_Localizator.CreateContextualTask,
391
391
  icon: 'plus',
392
- onClick: () => { openTaskForm(FormModes.Create); },
392
+ onClick: () => { openTaskForm(FormModes.Create, undefined, true); },
393
393
  disabled: false
394
394
  },
395
395
  {
396
396
  text: SDKUI_Localizator.Create,
397
397
  icon: 'plus',
398
- onClick: () => { openTaskForm(FormModes.Create); },
398
+ onClick: () => { openTaskForm(FormModes.Create, undefined, false); },
399
399
  disabled: false
400
400
  },
401
401
  {
402
402
  text: SDKUI_Localizator.Update,
403
403
  icon: 'edit',
404
- onClick: editTaskCallback,
404
+ onClick: openEditTaskForm,
405
405
  operationType: 'singleRow',
406
406
  disabled: fromDatagrid ? false : !isTaskDescriptorDefined
407
407
  },
408
408
  {
409
409
  text: SDKUI_Localizator.Duplicate,
410
410
  icon: 'copy',
411
- onClick: duplicateTaskCallback,
411
+ onClick: openDuplicateTaskForm,
412
412
  operationType: 'singleRow',
413
413
  disabled: fromDatagrid ? isTaskFromAnotherUser : !isTaskDescriptorDefined || isTaskFromAnotherUser
414
414
  },
@@ -52,6 +52,7 @@ const TMTasksView = (props) => {
52
52
  const [waitPanelValuePrimary, setWaitPanelValuePrimary] = useState(0);
53
53
  // State variable to define the maximum value for the primary progress indicator in the wait panel.
54
54
  const [waitPanelMaxValuePrimary, setWaitPanelMaxValuePrimary] = useState(0);
55
+ const [isContextualCreate, setIsContextualCreate] = useState(false);
55
56
  // This function open the task form for editing a selected task
56
57
  const editTaskAgendaCallback = (rowId) => {
57
58
  if (rowId === undefined)
@@ -78,8 +79,7 @@ const TMTasksView = (props) => {
78
79
  const agendaCalendarItems = useCallback(() => {
79
80
  const taskDescriptor = visualizedTasks.find(task => task.id === focusedRowKey);
80
81
  return [
81
- ...createTasksMenuItems(taskDescriptor, showId, setShowId, showSearch, setShowSearch, () => { }, // openTaskForm,
82
- () => { if (focusedRowKey)
82
+ ...createTasksMenuItems(taskDescriptor, showId, setShowId, showSearch, setShowSearch, () => { openTaskFormCallback(FormModes.Create); }, () => { if (focusedRowKey)
83
83
  editTaskAgendaCallback(focusedRowKey); }, () => { if (focusedRowKey)
84
84
  onDuplicateAgendaCallback(focusedRowKey); }, () => { if (focusedRowKey)
85
85
  onDeleteCallback([focusedRowKey]); }, (rowIds, status) => { if (focusedRowKey)
@@ -103,9 +103,10 @@ const TMTasksView = (props) => {
103
103
  setShowTaskForm(false);
104
104
  }, []);
105
105
  // Callback function to open the task form in a specific mode
106
- const openTaskFormCallback = useCallback((mode, task) => {
106
+ const openTaskFormCallback = useCallback((mode, task, isContextual) => {
107
107
  setFormMode(mode);
108
108
  setShowTaskForm(true);
109
+ setIsContextualCreate(isContextual ?? false);
109
110
  // If a task is provided, set it as the current task to be processed
110
111
  if (task)
111
112
  setCurrentTask(task);
@@ -308,7 +309,7 @@ const TMTasksView = (props) => {
308
309
  return;
309
310
  if (e.target === 'content') {
310
311
  e.items = e.items || [];
311
- e.items = createTasksMenuItems(e.row?.data, showId, setShowId, showSearch, setShowSearch, () => { openTaskFormCallback(FormModes.Create); }, () => { openTaskFormCallback(FormModes.Update, e.row?.data); }, () => { openTaskFormCallback(FormModes.Duplicate, e.row?.data); }, onDeleteCallback, markAsStatus, getAllTasks, taskContext?.workingGroup?.id !== undefined, showContextualWG, setShowContextualWG, taskContext?.dossier?.id !== undefined, showContextualDossier, setShowContextualDossier, taskContext?.document?.tid !== undefined && taskContext?.document?.did !== undefined, showContextualDocument, setShowContextualDocument, false);
312
+ e.items = createTasksMenuItems(e.row?.data, showId, setShowId, showSearch, setShowSearch, openTaskFormCallback, () => { openTaskFormCallback(FormModes.Update, e.row?.data); }, () => { openTaskFormCallback(FormModes.Duplicate, e.row?.data); }, onDeleteCallback, markAsStatus, getAllTasks, taskContext?.workingGroup?.id !== undefined, showContextualWG, setShowContextualWG, taskContext?.dossier?.id !== undefined, showContextualDossier, setShowContextualDossier, taskContext?.document?.tid !== undefined && taskContext?.document?.did !== undefined, showContextualDocument, setShowContextualDocument, false);
312
313
  }
313
314
  };
314
315
  const RenderCustomHeader = ({ data }) => { return _jsx("p", { style: { color: TEXT_NOT_SELECTED_COLOR }, children: data.column.caption }); };
@@ -530,7 +531,7 @@ const TMTasksView = (props) => {
530
531
  _jsxs(_Fragment, { children: [activeComponent === TaskView.CALENDAR_TASK && getFromOrToCalendarElement(visualizedTasks, false, true), activeComponent === TaskView.AGENDA_TASK && getFromOrToAgendaElement(visualizedTasks, false, true), activeComponent === TaskView.LIST_TASK && getFromOrToDatagridElement(visualizedTasks, false, true)] }) : '' }), _jsx(Item, { title: SDKUI_Localizator.AllFemale, icon: "fields", tabRender: (params) => {
531
532
  return _jsxs(StyledTabItem, { "$isSelected": activeTabIndex === AssignedTab.All, children: [_jsxs(TMTooltip, { content: SDKUI_Localizator.AllFemale, children: [_jsx("i", { className: `dx-icon-${params.icon}` }), "\u00A0", params.title, " ", (allTasksFilteredCount > 0) ? `(${allTasksFilteredCount})` : ''] }), newTaskCount > 0 && (_jsx(TMTooltip, { content: SDKUI_Localizator.NewAssignedActivitiesNumber + ": " + newTaskCount, children: _jsx(TMCountBadge, { children: newTaskCount }) }))] });
532
533
  }, render: () => activeTabIndex === AssignedTab.All ?
533
- _jsxs(_Fragment, { children: [activeComponent === TaskView.CALENDAR_TASK && getFromOrToCalendarElement(visualizedTasks, true, true), activeComponent === TaskView.AGENDA_TASK && getFromOrToAgendaElement(visualizedTasks, true, true), activeComponent === TaskView.LIST_TASK && getFromOrToDatagridElement(visualizedTasks, true, true)] }) : '' })] }) }), showTaskForm && _jsx(TMTaskForm, { id: currentTask?.id ?? -1, width: calcResponsiveSizes(deviceType, '700px', '700px', '95%'), height: calcResponsiveSizes(deviceType, '700px', '700px', '95%'), title: SDKUI_Localizator.Widget_Activities, isModal: true, formMode: formMode ?? FormModes.Create, visualizedTasks: visualizedTasks, currentTask: currentTask, setCurrentTask: setCurrentTask, selectedRowKeys: selectedRowKeys, handleFocusedRowKeyChange: handleFocusedRowChange, taskContext: taskContext, usersList: usersList, onStatusChanged: () => { }, onClose: closeTaskFormCallback, onCancel: closeTaskFormCallback, showBackButton: false, onSaved: onSavedCallback, startDate: calendarStartDate, endDate: calendarEndDate, onOpenS4TViewerRequest: onOpenS4TViewerRequest, s4TViewerDialogComponent: s4TViewerDialogComponent, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGsWrapper, handleNavigateToDossiers: handleNavigateToDossiersWrapper }), _jsx("button", { style: {
534
+ _jsxs(_Fragment, { children: [activeComponent === TaskView.CALENDAR_TASK && getFromOrToCalendarElement(visualizedTasks, true, true), activeComponent === TaskView.AGENDA_TASK && getFromOrToAgendaElement(visualizedTasks, true, true), activeComponent === TaskView.LIST_TASK && getFromOrToDatagridElement(visualizedTasks, true, true)] }) : '' })] }) }), showTaskForm && _jsx(TMTaskForm, { id: currentTask?.id ?? -1, width: calcResponsiveSizes(deviceType, '700px', '700px', '95%'), height: calcResponsiveSizes(deviceType, '700px', '700px', '95%'), title: SDKUI_Localizator.Widget_Activities, isModal: true, formMode: formMode ?? FormModes.Create, visualizedTasks: visualizedTasks, currentTask: currentTask, setCurrentTask: setCurrentTask, isContextualCreate: isContextualCreate, selectedRowKeys: selectedRowKeys, handleFocusedRowKeyChange: handleFocusedRowChange, taskContext: taskContext, usersList: usersList, onStatusChanged: () => { }, onClose: closeTaskFormCallback, onCancel: closeTaskFormCallback, showBackButton: false, onSaved: onSavedCallback, startDate: calendarStartDate, endDate: calendarEndDate, onOpenS4TViewerRequest: onOpenS4TViewerRequest, s4TViewerDialogComponent: s4TViewerDialogComponent, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGsWrapper, handleNavigateToDossiers: handleNavigateToDossiersWrapper }), _jsx("button", { style: {
534
535
  position: 'absolute',
535
536
  bottom: hasFilters ? '90px' : '18px',
536
537
  right: '20px',
@@ -65,9 +65,10 @@ const FloatingMenu = styled.div `
65
65
  transform: translateY(5px);
66
66
  align-items: center; /* Centra i pulsanti orizzontalmente */
67
67
  `;
68
- const FloatingMenuButton = styled(TMButton) `
69
- width: 100%; /* Rende i pulsanti interni larghi quanto il menu */
70
- `;
68
+ // FloatingMenuButton wrapper component to avoid circular dependency
69
+ const FloatingMenuButton = (props) => {
70
+ return _jsx(TMButton, { width: "100%", ...props });
71
+ };
71
72
  const RecipientList = ({ recipients, title, tid, qd, onAdd, onRemove, onQDChange }) => {
72
73
  const [uiState, setUiState] = useState({
73
74
  isMenuOpen: false,
package/package.json CHANGED
@@ -1,54 +1,54 @@
1
1
  {
2
- "name": "@topconsultnpm/sdkui-react",
3
- "version": "6.19.0-dev1.61",
4
- "description": "",
5
- "scripts": {
6
- "test": "echo \"Error: no test specified\" && exit 1",
7
- "clean": "powershell Remove-Item lib/ -recurse",
8
- "copy-files": "copyfiles -u 1 src/assets/*.* src/assets/ImageLibrary/*.* src/assets/thumbnails/*.* src/assets/IconsS4t/*.* src/assets/Metadata/*.* src/css/tm-sdkui.css lib/",
9
- "tm-build": "npm run clean && tsc && npm run copy-files",
10
- "tm-watch": "tsc -w",
11
- "tm-publish": "npm publish --tag latest",
12
- "storybook": "storybook dev -p 6006",
13
- "build-storybook": "storybook build"
14
- },
15
- "author": "TopConsult",
16
- "license": "ISC",
17
- "devDependencies": {
18
- "@chromatic-com/storybook": "^4.0.1",
19
- "@storybook/addon-docs": "^9.0.18",
20
- "@storybook/addon-onboarding": "^9.0.18",
21
- "@storybook/react-vite": "^9.0.18",
22
- "@types/htmlparser2": "^3.10.7",
23
- "@types/node": "^20.2.5",
24
- "@types/react": "^18.2.7",
25
- "@types/react-dom": "^18.2.4",
26
- "copyfiles": "^2.4.1",
27
- "esbuild": "^0.25.0",
28
- "react": "^18.2.0",
29
- "react-dom": "^18.2.0",
30
- "storybook": "^9.0.18",
31
- "typescript": "^5.9.3",
32
- "vite": "^6.1.1"
33
- },
34
- "main": "dist/cjs/index.js",
35
- "types": "./index.d.ts",
36
- "module": "lib/esm/index.js",
37
- "files": [
38
- "dist",
39
- "lib"
40
- ],
41
- "dependencies": {
42
- "@topconsultnpm/sdk-ts": "6.19.0-dev1.11",
43
- "buffer": "^6.0.3",
44
- "devextreme": "25.1.4",
45
- "devextreme-react": "25.1.4",
46
- "exceljs": "^4.4.0",
47
- "htmlparser2": "^10.0.0",
48
- "react-router-dom": "^6.15.0",
49
- "styled-components": "^6.1.1"
50
- },
51
- "overrides": {
52
- "esbuild": "^0.25.0"
53
- }
2
+ "name": "@topconsultnpm/sdkui-react",
3
+ "version": "6.19.0-dev1.63",
4
+ "description": "",
5
+ "scripts": {
6
+ "test": "echo \"Error: no test specified\" && exit 1",
7
+ "clean": "powershell Remove-Item lib/ -recurse",
8
+ "copy-files": "copyfiles -u 1 src/assets/*.* src/assets/ImageLibrary/*.* src/assets/thumbnails/*.* src/assets/IconsS4t/*.* src/assets/Metadata/*.* src/css/tm-sdkui.css lib/",
9
+ "tm-build": "npm run clean && tsc && npm run copy-files",
10
+ "tm-watch": "tsc -w",
11
+ "tm-publish": "npm publish --tag latest",
12
+ "storybook": "storybook dev -p 6006",
13
+ "build-storybook": "storybook build"
14
+ },
15
+ "author": "TopConsult",
16
+ "license": "ISC",
17
+ "devDependencies": {
18
+ "@chromatic-com/storybook": "^4.1.3",
19
+ "@storybook/addon-docs": "^10.1.0",
20
+ "@storybook/addon-onboarding": "^10.1.0",
21
+ "@storybook/react-vite": "^10.1.0",
22
+ "@types/htmlparser2": "^3.10.7",
23
+ "@types/node": "^20.2.5",
24
+ "@types/react": "^18.2.7",
25
+ "@types/react-dom": "^18.2.4",
26
+ "copyfiles": "^2.4.1",
27
+ "esbuild": "^0.25.0",
28
+ "react": "^18.2.0",
29
+ "react-dom": "^18.2.0",
30
+ "storybook": "^10.1.0",
31
+ "typescript": "^5.9.3",
32
+ "vite": "^6.1.1"
33
+ },
34
+ "main": "dist/cjs/index.js",
35
+ "types": "./index.d.ts",
36
+ "module": "lib/esm/index.js",
37
+ "files": [
38
+ "dist",
39
+ "lib"
40
+ ],
41
+ "dependencies": {
42
+ "@topconsultnpm/sdk-ts": "6.19.0-dev1.11",
43
+ "buffer": "^6.0.3",
44
+ "devextreme": "25.1.4",
45
+ "devextreme-react": "25.1.4",
46
+ "exceljs": "^4.4.0",
47
+ "htmlparser2": "^10.0.0",
48
+ "react-router-dom": "^6.15.0",
49
+ "styled-components": "^6.1.1"
50
+ },
51
+ "overrides": {
52
+ "esbuild": "^0.25.0"
53
+ }
54
54
  }
@@ -1,4 +0,0 @@
1
- import { Meta } from '@storybook/react-vite';
2
- declare const _default: Meta;
3
- export default _default;
4
- export declare const NormalTMButton: any;
@@ -1,29 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import TMButton from '../components/base/TMButton';
3
- import { TMDeviceProvider } from '../components/base/TMDeviceProvider';
4
- import { IconCheck } from '../helper';
5
- import { sortArgTypes } from './TMStoriesUtils';
6
- export default {
7
- // The title will determine how the component appears in the sidebar of Storybook
8
- title: 'Components/TMButton',
9
- // Specifies the component that is being documented in this story
10
- component: TMButton,
11
- decorators: [(Story) => (_jsxs(TMDeviceProvider, { children: [" ", _jsx(Story, {}), " "] })),],
12
- tags: ['autodocs'],
13
- // Tags for categorizing the component within Storybook
14
- argTypes: sortArgTypes({
15
- color: { description: 'The color of the button' },
16
- }),
17
- };
18
- /******* 1. Default Template and Default TMButton *******/
19
- const Template = (args) => _jsx(TMButton, { ...args });
20
- export const NormalTMButton = Template.bind({});
21
- NormalTMButton.args = {
22
- caption: 'Click Me!',
23
- btnStyle: 'normal',
24
- icon: _jsx(IconCheck, {}),
25
- width: '120px',
26
- height: '40px',
27
- showTooltip: false,
28
- onClick: () => alert('NormalButton clicked!')
29
- };
@@ -1,9 +0,0 @@
1
- import { Meta } from '@storybook/react-vite';
2
- import 'devextreme/dist/css/dx.fluent.blue.light.compact.css';
3
- declare const _default: Meta;
4
- export default _default;
5
- export declare const DefaultTMDatagrid: any;
6
- /******* 2. Default Template and Datagrid with Search Panel to Right *******/
7
- export declare const TMDatagridWithSearchPanelToRight: any;
8
- /******* 3. Default Template and Datagrid with Counter enable *******/
9
- export declare const TMDatagridWithCounters: any;
@@ -1,310 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useCallback, useMemo, useState } from 'react';
3
- import { TMDataGrid, TMDeviceProvider } from '../components';
4
- import { TMDataGridPageSize } from '../components/base/TMDataGrid';
5
- // Importing the DevExtreme library's Material Design theme in light blue color scheme
6
- import 'devextreme/dist/css/dx.fluent.blue.light.compact.css';
7
- // Importing custom styles for the tm-sdkui library
8
- // import '/lib/css/tm-sdkui.css';
9
- import { sortArgTypes } from './TMStoriesUtils';
10
- const generateData = (count) => {
11
- const data = [];
12
- for (let i = 1; i <= count; i++) {
13
- data.push({
14
- id: i,
15
- name: `User ${i}`,
16
- email: `user${i}@example.com`,
17
- phone: `+1-555-000${i % 1000}`,
18
- city: `City ${i % 100}`,
19
- age: 20 + (i % 50),
20
- gender: i % 2 === 0 ? "Male" : "Female",
21
- address: `Street ${i}`,
22
- country: `Country ${i % 5}`,
23
- zipCode: `12345-${i % 100}`,
24
- state: `State ${i % 10}`,
25
- occupation: `Occupation ${i % 3}`,
26
- company: `Company ${i % 10}`,
27
- socialSecurityNumber: `SSN-${i % 10000}`,
28
- birthDate: `199${(i % 30) + 1}-01-01`,
29
- maritalStatus: i % 2 === 0 ? "Single" : "Married",
30
- hobby: `Hobby ${i % 5}`,
31
- profilePicture: `https://example.com/pic${i}.jpg`,
32
- lastLogin: `2025-02-0${i % 10}`,
33
- creditScore: 600 + (i % 400),
34
- loyaltyPoints: i % 1000,
35
- referralCode: `REF${i % 1000}`,
36
- preferredLanguage: `Language ${i % 5}`,
37
- subscriptionStatus: i % 2 === 0 ? "Active" : "Inactive",
38
- device: `Device ${i % 5}`,
39
- lastPurchaseDate: `2025-01-0${i % 10}`,
40
- shippingAddress: `Address ${i}`,
41
- preferredPaymentMethod: `Payment ${i % 3}`,
42
- totalSpent: 100 + (i * 10),
43
- referralCount: i % 50,
44
- notes: `Notes about user ${i}`,
45
- lastUpdated: `2025-02-0${i % 10}`,
46
- emergencyContact: `Emergency ${i % 5}`,
47
- jobTitle: `Job ${i % 10}`,
48
- vehicle: `Vehicle ${i % 4}`,
49
- bloodType: i % 4 === 0 ? "O" : i % 4 === 1 ? "A" : i % 4 === 2 ? "B" : "AB",
50
- pet: i % 2 === 0 ? "Dog" : "Cat",
51
- subscriptionPlan: `Plan ${i % 3}`,
52
- favoriteColor: `Color ${i % 7}`,
53
- });
54
- }
55
- return data;
56
- };
57
- // Default export for Storybook configuration for TMDataGrid component
58
- export default {
59
- // The title will determine how the component appears in the sidebar of Storybook
60
- title: 'Components/TMDataGrid',
61
- // Specifies the component that is being documented in this story
62
- component: TMDataGrid,
63
- decorators: [(Story) => (_jsxs(TMDeviceProvider, { children: [" ", _jsx(Story, {}), " "] })),],
64
- // Tags for categorizing the component within Storybook
65
- tags: ['autodocs'],
66
- // Description
67
- description: 'A responsive, customizable data grid component for displaying tabular data efficiently.',
68
- argTypes: sortArgTypes({
69
- accessKey: {
70
- description: "Specifies the shortcut key that sets focus on the UI component",
71
- control: { type: 'text' },
72
- type: { name: "string", required: false },
73
- },
74
- activeStateEnabled: {
75
- description: "Specifies whether the UI component changes its visual state as a result of user interaction"
76
- },
77
- allowColumnReordering: {
78
- description: "Specifies whether a user can reorder columns"
79
- },
80
- allowColumnResizing: {
81
- description: "Specifies whether a user can resize columns"
82
- },
83
- autoNavigateToFocusedRow: {
84
- description: "Automatically scrolls the component to the focused row when the focusedRowKey is changed. Incompatible with infinite scrolling mode"
85
- },
86
- cacheEnabled: {
87
- description: "Specifies whether data should be cached"
88
- },
89
- cellHintEnabled: {
90
- description: "Enables a hint that appears when a user hovers the mouse pointer over a cell with truncated content"
91
- },
92
- columnAutoWidth: {
93
- description: "Specifies whether columns should adjust their widths to the content"
94
- },
95
- columnChooser: {
96
- description: "Configures the column chooser"
97
- },
98
- columnFixing: {
99
- description: "Configures column fixing"
100
- },
101
- columnHidingEnabled: {
102
- description: "Specifies whether the UI component should hide columns to adapt to the screen or container size. Ignored if allowColumnResizing is true and columnResizingMode is 'widget'"
103
- },
104
- columnMinWidth: {
105
- description: "Specifies the minimum width of columns"
106
- },
107
- columnResizingMode: {
108
- description: "Specifies how the UI component resizes columns. Applies only if allowColumnResizing is true"
109
- },
110
- columns: {
111
- description: "An array of grid columns"
112
- },
113
- columnWidth: {
114
- description: "Specifies the width for all data columns. Has a lower priority than the column.width property"
115
- },
116
- customizeColumns: {
117
- description: "Customizes columns after they are created"
118
- },
119
- dataRowComponent: {
120
- description: "An alias for the dataRowTemplate property specified in React. Accepts a custom component"
121
- },
122
- dataRowRender: {
123
- description: "An alias for the dataRowTemplate property specified in React. Accepts a rendering function"
124
- },
125
- dataRowTemplate: {
126
- description: "Specifies a custom template for data rows"
127
- },
128
- dataSource: {
129
- description: "Binds the UI component to data"
130
- },
131
- dateSerializationFormat: {
132
- description: "Specifies the format in which date-time values should be sent to the server"
133
- },
134
- disabled: {
135
- description: "Specifies whether the UI component responds to user interaction"
136
- },
137
- editing: {
138
- description: "Configures editing"
139
- },
140
- elementAttr: {
141
- description: "Specifies the global attributes to be attached to the UI component's container element"
142
- },
143
- errorRowEnabled: {
144
- description: "Indicates whether to show the error row"
145
- },
146
- export: {
147
- description: "Configures client-side exporting"
148
- },
149
- filterBuilder: {
150
- description: "Configures the integrated filter builder"
151
- },
152
- filterBuilderPopup: {
153
- description: "Configures the popup in which the integrated filter builder is shown"
154
- },
155
- filterPanel: {
156
- description: "Configures the filter panel"
157
- },
158
- filterRow: {
159
- description: "Configures the filter row"
160
- },
161
- filterSyncEnabled: {
162
- description: "Specifies whether to synchronize the filter row, header filter, and filter builder"
163
- },
164
- filterValue: {
165
- description: "Specifies a filter expression"
166
- },
167
- focusedColumnIndex: {
168
- description: "The index of the column that contains the focused data cell"
169
- },
170
- focusedRowEnabled: {
171
- description: "Specifies whether the focused row feature is enabled"
172
- },
173
- focusedRowIndex: {
174
- description: "Specifies or indicates the focused data row's index"
175
- },
176
- focusedRowKey: {
177
- description: "Specifies initially or currently focused grid row's key"
178
- },
179
- grouping: {
180
- description: "Configures grouping"
181
- },
182
- groupPanel: {
183
- description: "Configures the group panel"
184
- },
185
- headerFilter: {
186
- description: "Configures the header filter feature"
187
- },
188
- height: {
189
- description: "Specifies the UI component's height"
190
- },
191
- highlightChanges: {
192
- description: "Specifies whether to highlight rows and cells with edited data. repaintChangesOnly should be true"
193
- },
194
- hint: {
195
- description: "Specifies text for a hint that appears when a user pauses on the UI component"
196
- },
197
- hoverStateEnabled: {
198
- description: "Specifies whether to highlight rows when a user moves the mouse pointer over them"
199
- },
200
- keyboardNavigation: {
201
- description: "Configures keyboard navigation"
202
- },
203
- keyExpr: {
204
- description: "Specifies the key property (or properties) that provide key values to access data items"
205
- },
206
- loadPanel: {
207
- description: "Configures the load panel"
208
- },
209
- masterDetail: {
210
- description: "Allows you to build a master-detail interface in the grid"
211
- },
212
- noDataText: {
213
- description: "Specifies a text string shown when the DataGrid does not display any data"
214
- },
215
- pager: {
216
- description: "Configures the pager"
217
- },
218
- paging: {
219
- description: "Configures paging"
220
- },
221
- remoteOperations: {
222
- description: "Notifies the DataGrid of the server's data processing operations"
223
- },
224
- renderAsync: {
225
- description: "Specifies whether to render the filter row, command columns, and columns with showEditorAlways set to true after other elements"
226
- },
227
- rowAlternationEnabled: {
228
- description: "Specifies whether rows should be shaded differently"
229
- },
230
- rowDragging: {
231
- description: "Configures row reordering using drag and drop gestures"
232
- },
233
- rtlEnabled: {
234
- description: "Switches the UI component to a right-to-left representation"
235
- },
236
- scrolling: {
237
- description: "Configures scrolling"
238
- },
239
- searchPanel: {
240
- description: "Configures the search panel"
241
- },
242
- selectedRowKeys: {
243
- description: "Allows you to select rows or determine which rows are selected"
244
- },
245
- selection: {
246
- description: "Configures runtime selection"
247
- },
248
- selectionFilter: {
249
- description: "Specifies filters for the rows that must be selected initially"
250
- },
251
- showBorders: {
252
- description: "Specifies whether the outer borders of the UI component are visible"
253
- },
254
- showColumnHeaders: {
255
- description: "Specifies whether column headers are visible"
256
- },
257
- showColumnLines: {
258
- description: "Specifies whether vertical lines that separate one column from another are visible"
259
- },
260
- showRowLines: {
261
- description: "Specifies whether horizontal lines that separate one row from another are visible"
262
- },
263
- stateStoring: {
264
- description: "Configures state storing"
265
- },
266
- summary: {
267
- description: "Specifies the properties of the grid summary"
268
- },
269
- tabIndex: {
270
- description: "Specifies the number of the element when the Tab key is used for navigating"
271
- },
272
- toolbar: {
273
- description: "Configures the toolbar"
274
- },
275
- visible: {
276
- description: "Specifies whether the UI component is visible"
277
- },
278
- width: {
279
- description: "Specifies the UI component's width"
280
- },
281
- wordWrapEnabled: {
282
- description: "Specifies whether text that does not fit into a column should be wrapped"
283
- },
284
- }),
285
- };
286
- /******* 1. Default Template and Default TMDatagrid *******/
287
- const DefaultTemplate = (args) => {
288
- const dataSource = useMemo(() => generateData(5), []);
289
- const [selectedRowKeys, setSelectedRowKeys] = useState([]);
290
- const [focusedRowKey, setFocusedRowKey] = useState(undefined);
291
- const onSelectionChanged = useCallback((e) => {
292
- setSelectedRowKeys(e.component.getSelectedRowKeys());
293
- }, []);
294
- const onFocusedRowChanged = useCallback((e) => {
295
- setFocusedRowKey(e.row?.key);
296
- }, []);
297
- return (_jsx(TMDataGrid, { ...args, dataSource: dataSource, pageSize: TMDataGridPageSize.Small, keyExpr: "id", width: "100%", height: "100%", focusedRowEnabled: true, focusedRowKey: focusedRowKey, onFocusedRowChanged: onFocusedRowChanged, selectedRowKeys: selectedRowKeys, onSelectionChanged: onSelectionChanged, columnResizingMode: 'widget', columnHidingEnabled: true, columnAutoWidth: true, allowColumnResizing: true, allowColumnReordering: true, style: { userSelect: "none" } }));
298
- };
299
- export const DefaultTMDatagrid = DefaultTemplate.bind({});
300
- DefaultTMDatagrid.args = {};
301
- /******* 2. Default Template and Datagrid with Search Panel to Right *******/
302
- export const TMDatagridWithSearchPanelToRight = DefaultTemplate.bind({});
303
- TMDatagridWithSearchPanelToRight.args = {
304
- searchPanelToolbarPosition: 'default',
305
- };
306
- /******* 3. Default Template and Datagrid with Counter enable *******/
307
- export const TMDatagridWithCounters = DefaultTemplate.bind({});
308
- TMDatagridWithCounters.args = {
309
- counterConfig: { show: true }
310
- };
@@ -1,6 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react-vite';
2
- import TMHtmlContentDisplay from '../components/editors/TMHtmlContentDisplay';
3
- declare const meta: Meta<typeof TMHtmlContentDisplay>;
4
- export default meta;
5
- type Story = StoryObj<typeof TMHtmlContentDisplay>;
6
- export declare const Default: Story;
@@ -1,45 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from 'react';
3
- import TMHtmlContentDisplay from '../components/editors/TMHtmlContentDisplay';
4
- const sampleMarkup = `
5
- <p>This is a <strong>sample</strong> paragraph with <a target="_blank" href="https://www.google.com/">a link</a>.</p>
6
- <p>Another paragraph with the word <u>sample</u> and some <em>emphasized</em> content.</p>
7
- <ul>
8
- <li>First item</li>
9
- <li>Second item with <u>underline</u> and <em>emphasis</em></li>
10
- </ul>
11
- <ol>
12
- <li>Ordered item one</li>
13
- <li>Ordered item <em>two</em> with a sample word</li>
14
- </ol>
15
- <p>Check out this URL: https://www.example.com</p>
16
- <p>Check out this URL: https://www.illibraio.it/test-quiz/test/</p>
17
- <p>Check out this URL: http://www.illibraio.it/test-quiz/test/</p>
18
- <p>Check out this URL: https://www.topconsult.it/it</p>
19
-
20
- `;
21
- const meta = {
22
- title: 'Components/TMHtmlContentDisplay',
23
- component: TMHtmlContentDisplay,
24
- argTypes: {
25
- searchText: { control: false }, // Disable default control
26
- },
27
- };
28
- export default meta;
29
- export const Default = {
30
- render: (args) => {
31
- const [searchText, setSearchText] = useState(args.searchText || '');
32
- return (_jsxs("div", { style: { padding: 20 }, children: [_jsx("input", { type: "text", placeholder: "Search text...", value: searchText, onChange: (e) => setSearchText(e.target.value), style: {
33
- marginBottom: '1rem',
34
- padding: '0.5rem',
35
- width: '100%',
36
- maxWidth: '300px',
37
- fontSize: '1rem',
38
- } }), _jsx(TMHtmlContentDisplay, { ...args, searchText: searchText })] }));
39
- },
40
- args: {
41
- markup: sampleMarkup,
42
- isSelected: false,
43
- searchText: '',
44
- },
45
- };
@@ -1,6 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react-vite';
2
- import TMHtmlEditor from '../components/editors/TMHtmlEditor';
3
- declare const meta: Meta<typeof TMHtmlEditor>;
4
- export default meta;
5
- type Story = StoryObj<typeof TMHtmlEditor>;
6
- export declare const Default: Story;
@@ -1,49 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useState } from 'react';
3
- import TMHtmlEditor from '../components/editors/TMHtmlEditor';
4
- import { TMHtmlContentDisplay } from '../components';
5
- const meta = {
6
- title: 'Components/TMHtmlEditor',
7
- component: TMHtmlEditor,
8
- argTypes: {
9
- onValueChanged: { control: false },
10
- },
11
- };
12
- export default meta;
13
- export const Default = {
14
- render: (args) => {
15
- const [content, setContent] = useState('');
16
- const [cleanComment, setCleanComment] = useState('');
17
- const [mentionsConfig, setMentionsConfig] = useState([]);
18
- useEffect(() => {
19
- const mentions = [{
20
- dataSource: [{ text: 'Marco Rossi', icon: '👤' }, { text: 'Paolo Bianchi', icon: '👩' },],
21
- searchExpr: 'text',
22
- displayExpr: 'text',
23
- valueExpr: 'text',
24
- itemTemplate: function (itemData) {
25
- return `<div style="display: flex; align-items: center; justify-content: center; gap: 8px; height: 100%;">
26
- ${itemData.icon}
27
- <span>${itemData.text}</span>
28
- </div>`;
29
- },
30
- }];
31
- setMentionsConfig(mentions);
32
- }, []);
33
- const handleValueChange = (e) => {
34
- setContent(e.value);
35
- setCleanComment(e.value
36
- // Replace </p> with '' only if followed by <ol> or <ul>
37
- .replace(/<\/p>(?=\s*<(ol|ul)>)/gi, '')
38
- // Replace all other </p> with '\r\n'
39
- .replace(/<\/p>/gi, '\r\n')
40
- // Remove all <p> tags
41
- .replace(/<p>/gi, '')
42
- // Remove all <br> tags
43
- .replace(/<br>/gi, '')
44
- // Trim whitespace
45
- .trim());
46
- };
47
- return (_jsxs("div", { style: { padding: 20 }, children: [_jsx(TMHtmlEditor, { ...args, onValueChanged: handleValueChange, isEditorEnabled: true, mentionsConfig: mentionsConfig }), _jsxs("div", { style: { marginTop: '1rem', padding: '0.5rem', backgroundColor: '#f5f5f5' }, children: [_jsx("h4", { children: "Output" }), _jsx(TMHtmlContentDisplay, { markup: cleanComment, isSelected: false })] }), _jsxs("div", { style: { marginTop: '1rem', padding: '0.5rem', backgroundColor: '#e0e0e0' }, children: [_jsx("h4", { children: "Output (HTML String)" }), _jsx("pre", { style: { whiteSpace: 'pre-wrap', wordBreak: 'break-word' }, children: JSON.stringify(cleanComment) })] })] }));
48
- },
49
- };
@@ -1,4 +0,0 @@
1
- import { Meta } from "@storybook/react-vite";
2
- declare const _default: Meta;
3
- export default _default;
4
- export declare const TMIcons: any;
@@ -1,13 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Icon123, IconABC, IconAccessPoint, IconActivity, IconActivityLog, IconAdd, IconAddCircleOutline, IconAddressBook, IconAdvanced, IconAlarmPlus, IconAll, IconAppAdvancedSettings, IconApply, IconApplyAndClose, IconArchive, IconArchiveDoc, IconArrowDown, IconArrowLeft, IconArrowRight, IconArrowSortedDown, IconArrowSortedUp, IconArrowUnsorted, IconArrowUp, IconAtSign, IconAttachment, IconAutoConfig, IconBackward, IconBasket, IconBatchUpdate, IconBell, IconBellCheck, IconBellCheckOutline, IconBellOutline, IconBoard, IconBoxArchiveIn, IconBxInfo, IconBxLock, IconCalendar, IconChangeUser, IconCheck, IconCheckIn, IconChevronDown, IconChevronRight, IconCircleInfo, IconClear, IconClearButton, IconCloseCircle, IconCloseOutline, IconCloud, IconColumns, IconCommand, IconConvertFilePdf, IconCopy, IconCount, IconCrown, IconDashboard, IconDataList, IconDcmtType, IconDcmtTypeOnlyMetadata, IconDcmtTypeSys, IconDelete, IconDetailDcmts, IconDetails, IconDisk, IconDotsVerticalCircleOutline, IconDown, IconDownload, IconDraggabledots, IconDuplicate, IconEasy, IconEdit, IconEnvelopeOpenText, IconEqual, IconEqualNot, IconEraser, IconExpandRight, IconExport, IconExportTo, IconFactory, IconFastBackward, IconFastForward, IconFastSearch, IconFileDots, IconFileSearch, IconFilter, IconFoldeAdd, IconFolder, IconFolderOpen, IconFolderSearch, IconFolderZip, IconForceStop, IconForward, IconFreeSearch, IconFreeze, IconFunction, IconGreaterThan, IconGreaterThanOrEqual, IconGrid, IconHeart, IconHide, IconHistory, IconHourglass, IconImport, IconInfo, IconInsertAbove, IconInsertBelow, IconKey, IconLanguage, IconLeft, IconLessThan, IconLessThanOrEqual, IconLightningFill, IconLink, IconList, IconLock, IconLockClosed, IconLogin, IconLogout, IconMail, IconMapping, IconMenuHorizontal, IconMenuKebab, IconMenuVertical, IconMetadata, IconMetadata_Computed, IconMetadata_DataList, IconMetadata_Date, IconMetadata_DynamicDataList, IconMetadata_Numerator, IconMetadata_Numeric, IconMetadata_Special, IconMetadata_Text, IconMetadata_User, IconMic, IconMonitor, IconMultipleSelection, IconNone, IconNotification, IconNotStarted, IconNull, IconOpenInNew, IconPalette, IconPassword, IconPaste, IconPencil, IconPlatform, IconPlay, IconPreview, IconPrinter, IconProcess, IconProgress, IconProgressAbortRequested, IconProgressCompleted, IconProgressNotCompleted, IconProgressReady, IconProgressRunning, IconProgressStarted, IconRecentlyViewed, IconRecursiveOps, IconRefresh, IconRelation, IconRelationManyToMany, IconRelationOneToMany, IconReset, IconRight, IconSave, IconSavedQuery, IconSearch, IconSearchCheck, IconSelected, IconServerService, IconSettings, IconShare, IconSharedDcmt, IconShow, IconSignature, IconSignaturePencil, IconSignCert, IconSort, IconSortAsc, IconSortAscClock, IconSortAscLetters, IconSortAscNumbers, IconSortDesc, IconSortDescClock, IconSortDescLetters, IconSortDescNumbers, IconStar, IconStarRemove, IconStatistics, IconStop, IconStopwatch, IconSubstFile, IconSuccess, IconSuccessCirlce, IconSuitcase, IconSum, IconSupport, IconSync, IconTag, IconTest, IconTree, IconUndo, IconUnFreeze, IconUp, IconUpdate, IconUpload, IconUser, IconUserCheck, IconUserExpired, IconUserGroup, IconUserLevelAdministrator, IconUserLevelAutonomousAdministrator, IconUserLevelMember, IconUserLevelSystemAdministrator, IconUserProfile, IconVisible, IconWarning, IconWeb, IconWifi, IconWindowMaximize, IconWindowMinimize, IconWorkflow, IconWorkspace } from "../helper";
3
- export default {
4
- title: "Icons/TMIcons",
5
- component: IconAccessPoint,
6
- argTypes: {
7
- fontSize: { control: "text" },
8
- color: { control: "color" },
9
- },
10
- };
11
- const TMIconsTemplate = (args) => (_jsxs(_Fragment, { children: [_jsxs("div", { style: { display: "flex", gap: "20px" }, children: [_jsx("span", { title: "IconAccessPoint", children: _jsx(IconAccessPoint, { ...args }) }), _jsx("span", { title: "IconCloseOutline", children: _jsx(IconCloseOutline, { ...args }) }), _jsx("span", { title: "IconArchive", children: _jsx(IconArchive, { ...args }) }), _jsx("span", { title: "IconLogin", children: _jsx(IconLogin, { ...args }) }), _jsx("span", { title: "IconUser", children: _jsx(IconUser, { ...args }) }), _jsx("span", { title: "IconPassword", children: _jsx(IconPassword, { ...args }) }), _jsx("span", { title: "IconLanguage", children: _jsx(IconLanguage, { ...args }) }), _jsx("span", { title: "IconSuitcase", children: _jsx(IconSuitcase, { ...args }) }), _jsx("span", { title: "IconProcess", children: _jsx(IconProcess, { ...args }) }), _jsx("span", { title: "IconSupport", children: _jsx(IconSupport, { ...args }) }), _jsx("span", { title: "IconMonitor", children: _jsx(IconMonitor, { ...args }) }), _jsx("span", { title: "IconDashboard", children: _jsx(IconDashboard, { ...args }) }), _jsx("span", { title: "IconAdd", children: _jsx(IconAdd, { ...args }) }), _jsx("span", { title: "IconDelete", children: _jsx(IconDelete, { ...args }) })] }), _jsxs("div", { style: { display: "flex", gap: "20px", marginTop: 20 }, children: [_jsx("span", { title: "IconDuplicate", children: _jsx(IconDuplicate, { ...args }) }), _jsx("span", { title: "IconRefresh", children: _jsx(IconRefresh, { ...args }) }), _jsx("span", { title: "IconExpandRight", children: _jsx(IconExpandRight, { ...args }) }), _jsx("span", { title: "IconColumns", children: _jsx(IconColumns, { ...args }) }), _jsx("span", { title: "IconSave", children: _jsx(IconSave, { ...args }) }), _jsx("span", { title: "IconArrowDown", children: _jsx(IconArrowDown, { ...args }) }), _jsx("span", { title: "IconArrowUp", children: _jsx(IconArrowUp, { ...args }) }), _jsx("span", { title: "IconUndo", children: _jsx(IconUndo, { ...args }) }), _jsx("span", { title: "IconShow", children: _jsx(IconShow, { ...args }) }), _jsx("span", { title: "IconHide", children: _jsx(IconHide, { ...args }) }), _jsx("span", { title: "IconPreview", children: _jsx(IconPreview, { ...args }) }), _jsx("span", { title: "IconCount", children: _jsx(IconCount, { ...args }) }), _jsx("span", { title: "IconPencil", children: _jsx(IconPencil, { ...args }) }), _jsx("span", { title: "IconEraser", children: _jsx(IconEraser, { ...args }) })] }), _jsxs("div", { style: { display: "flex", gap: "20px", marginTop: 20 }, children: [_jsx("span", { title: "IconAll", children: _jsx(IconAll, { ...args }) }), _jsx("span", { title: "IconSelected", children: _jsx(IconSelected, { ...args }) }), _jsx("span", { title: "IconVisible", children: _jsx(IconVisible, { ...args }) }), _jsx("span", { title: "IconCloseCircle", children: _jsx(IconCloseCircle, { ...args }) }), _jsx("span", { title: "IconApplyAndClose", children: _jsx(IconApplyAndClose, { ...args }) }), _jsx("span", { title: "IconApply", children: _jsx(IconApply, { ...args }) }), _jsx("span", { title: "IconSettings", children: _jsx(IconSettings, { ...args }) }), _jsx("span", { title: "IconNotification", children: _jsx(IconNotification, { ...args }) }), _jsx("span", { title: "IconHeart", children: _jsx(IconHeart, { ...args }) }), _jsx("span", { title: "IconUserProfile", children: _jsx(IconUserProfile, { ...args }) }), _jsx("span", { title: "IconWorkflow", children: _jsx(IconWorkflow, { ...args }) }), _jsx("span", { title: "IconBackward", children: _jsx(IconBackward, { ...args }) })] }), _jsxs("div", { style: { display: "flex", gap: "20px", marginTop: 20 }, children: [_jsx("span", { title: "IconForward", children: _jsx(IconForward, { ...args }) }), _jsx("span", { title: "IconFastBackward", children: _jsx(IconFastBackward, { ...args }) }), _jsx("span", { title: "IconFastForward", children: _jsx(IconFastForward, { ...args }) }), _jsx("span", { title: "IconLogout", children: _jsx(IconLogout, { ...args }) }), _jsx("span", { title: "IconWifi", children: _jsx(IconWifi, { ...args }) }), _jsx("span", { title: "IconMenuHorizontal", children: _jsx(IconMenuHorizontal, { ...args }) }), _jsx("span", { title: "IconMenuVertical", children: _jsx(IconMenuVertical, { ...args }) }), _jsx("span", { title: "IconOpenInNew", children: _jsx(IconOpenInNew, { ...args }) }), _jsx("span", { title: "IconMail", children: _jsx(IconMail, { ...args }) }), _jsx("span", { title: "IconCopy", children: _jsx(IconCopy, { ...args }) }), _jsx("span", { title: "IconSearch", children: _jsx(IconSearch, { ...args }) }), _jsx("span", { title: "IconMenuKebab", children: _jsx(IconMenuKebab, { ...args }) }), _jsx("span", { title: "IconDown", children: _jsx(IconDown, { ...args }) }), _jsx("span", { title: "IconUp", children: _jsx(IconUp, { ...args }) })] }), _jsxs("div", { style: { display: "flex", gap: "20px", marginTop: 20 }, children: [_jsx("span", { title: "IconLeft", children: _jsx(IconLeft, { ...args }) }), _jsx("span", { title: "IconRight", children: _jsx(IconRight, { ...args }) }), _jsx("span", { title: "IconArrowLeft", children: _jsx(IconArrowLeft, { ...args }) }), _jsx("span", { title: "IconArrowRight", children: _jsx(IconArrowRight, { ...args }) }), _jsx("span", { title: "IconFileDots", children: _jsx(IconFileDots, { ...args }) }), _jsx("span", { title: "IconDownload", children: _jsx(IconDownload, { ...args }) }), _jsx("span", { title: "IconUpload", children: _jsx(IconUpload, { ...args }) }), _jsx("span", { title: "IconFolderSearch", children: _jsx(IconFolderSearch, { ...args }) }), _jsx("span", { title: "IconFoldeAdd", children: _jsx(IconFoldeAdd, { ...args }) }), _jsx("span", { title: "IconEqual", children: _jsx(IconEqual, { ...args }) }), _jsx("span", { title: "IconEqualNot", children: _jsx(IconEqualNot, { ...args }) }), _jsx("span", { title: "IconGreaterThan", children: _jsx(IconGreaterThan, { ...args }) }), _jsx("span", { title: "IconLessThan", children: _jsx(IconLessThan, { ...args }) }), _jsx("span", { title: "IconLessThanOrEqual", children: _jsx(IconLessThanOrEqual, { ...args }) })] }), _jsxs("div", { style: { display: "flex", gap: "20px", marginTop: 20 }, children: [_jsx("span", { title: "IconGreaterThanOrEqual", children: _jsx(IconGreaterThanOrEqual, { ...args }) }), _jsx("span", { title: "IconSort", children: _jsx(IconSort, { ...args }) }), _jsx("span", { title: "IconPlatform", children: _jsx(IconPlatform, { ...args }) }), _jsx("span", { title: "Icon123", children: _jsx(Icon123, { ...args }) }), _jsx("span", { title: "IconABC", children: _jsx(IconABC, { ...args }) }), _jsx("span", { title: "IconCalendar", children: _jsx(IconCalendar, { ...args }) }), _jsx("span", { title: "IconAtSign", children: _jsx(IconAtSign, { ...args }) }), _jsx("span", { title: "IconEdit", children: _jsx(IconEdit, { ...args }) }), _jsx("span", { title: "IconWarning", children: _jsx(IconWarning, { ...args }) }), _jsx("span", { title: "IconInfo", children: _jsx(IconInfo, { ...args }) }), _jsx("span", { title: "IconSuccess", children: _jsx(IconSuccess, { ...args }) }), _jsx("span", { title: "IconAlarmPlus", children: _jsx(IconAlarmPlus, { ...args }) }), _jsx("span", { title: "IconHourglass", children: _jsx(IconHourglass, { ...args }) }), _jsx("span", { title: "IconNone", children: _jsx(IconNone, { ...args }) })] }), _jsxs("div", { style: { display: "flex", gap: "20px", marginTop: 20 }, children: [_jsx("span", { title: "IconNotStarted", children: _jsx(IconNotStarted, { ...args }) }), _jsx("span", { title: "IconProgress", children: _jsx(IconProgress, { ...args }) }), _jsx("span", { title: "IconInsertAbove", children: _jsx(IconInsertAbove, { ...args }) }), _jsx("span", { title: "IconInsertBelow", children: _jsx(IconInsertBelow, { ...args }) }), _jsx("span", { title: "IconFilter", children: _jsx(IconFilter, { ...args }) }), _jsx("span", { title: "IconDcmtType", children: _jsx(IconDcmtType, { ...args }) }), _jsx("span", { title: "IconDcmtTypeOnlyMetadata", children: _jsx(IconDcmtTypeOnlyMetadata, { ...args }) }), _jsx("span", { title: "IconDcmtTypeSys", children: _jsx(IconDcmtTypeSys, { ...args }) }), _jsx("span", { title: "IconCloud", children: _jsx(IconCloud, { ...args }) }), _jsx("span", { title: "IconWeb", children: _jsx(IconWeb, { ...args }) }), _jsx("span", { title: "IconBxInfo", children: _jsx(IconBxInfo, { ...args }) }), _jsx("span", { title: "IconStop", children: _jsx(IconStop, { ...args }) }), _jsx("span", { title: "IconPlay", children: _jsx(IconPlay, { ...args }) }), _jsx("span", { title: "IconStopwatch", children: _jsx(IconStopwatch, { ...args }) })] }), _jsxs("div", { style: { display: "flex", gap: "20px", marginTop: 20 }, children: [_jsx("span", { title: "IconUpdate", children: _jsx(IconUpdate, { ...args }) }), _jsx("span", { title: "IconSuccessCirlce", children: _jsx(IconSuccessCirlce, { ...args }) }), _jsx("span", { title: "IconCircleInfo", children: _jsx(IconCircleInfo, { ...args }) }), _jsx("span", { title: "IconDetails", children: _jsx(IconDetails, { ...args }) }), _jsx("span", { title: "IconFreeze", children: _jsx(IconFreeze, { ...args }) }), _jsx("span", { title: "IconUnFreeze", children: _jsx(IconUnFreeze, { ...args }) }), _jsx("span", { title: "IconProgressCompleted", children: _jsx(IconProgressCompleted, { ...args }) }), _jsx("span", { title: "IconProgressNotCompleted", children: _jsx(IconProgressNotCompleted, { ...args }) }), _jsx("span", { title: "IconProgressAbortRequested", children: _jsx(IconProgressAbortRequested, { ...args }) }), _jsx("span", { title: "IconProgressReady", children: _jsx(IconProgressReady, { ...args }) }), _jsx("span", { title: "IconProgressStarted", children: _jsx(IconProgressStarted, { ...args }) }), _jsx("span", { title: "IconProgressRunning", children: _jsx(IconProgressRunning, { ...args }) }), _jsx("span", { title: "IconUserLevelMember", children: _jsx(IconUserLevelMember, { ...args }) }), _jsx("span", { title: "IconUserLevelAdministrator", children: _jsx(IconUserLevelAdministrator, { ...args }) })] }), _jsxs("div", { style: { display: "flex", gap: "20px", marginTop: 20 }, children: [_jsx("span", { title: "IconUserLevelSystemAdministrator", children: _jsx(IconUserLevelSystemAdministrator, { ...args }) }), _jsx("span", { title: "IconUserLevelAutonomousAdministrator", children: _jsx(IconUserLevelAutonomousAdministrator, { ...args }) }), _jsx("span", { title: "IconHistory", children: _jsx(IconHistory, { ...args }) }), _jsx("span", { title: "IconForceStop", children: _jsx(IconForceStop, { ...args }) }), _jsx("span", { title: "IconDraggabledots", children: _jsx(IconDraggabledots, { ...args }) }), _jsx("span", { title: "IconClear", children: _jsx(IconClear, { ...args }) }), _jsx("span", { title: "IconClearButton", children: _jsx(IconClearButton, { ...args }) }), _jsx("span", { title: "IconAddCircleOutline", children: _jsx(IconAddCircleOutline, { ...args }) }), _jsx("span", { title: "IconDotsVerticalCircleOutline", children: _jsx(IconDotsVerticalCircleOutline, { ...args }) }), _jsx("span", { title: "IconMapping", children: _jsx(IconMapping, { ...args }) }), _jsx("span", { title: "IconAutoConfig", children: _jsx(IconAutoConfig, { ...args }) }), _jsx("span", { title: "IconArchiveDoc", children: _jsx(IconArchiveDoc, { ...args }) }), _jsx("span", { title: "IconCommand", children: _jsx(IconCommand, { ...args }) }), _jsx("span", { title: "IconSum", children: _jsx(IconSum, { ...args }) })] }), _jsxs("div", { style: { display: "flex", gap: "20px", marginTop: 20 }, children: [_jsx("span", { title: "IconDisk", children: _jsx(IconDisk, { ...args }) }), _jsx("span", { title: "IconDataList", children: _jsx(IconDataList, { ...args }) }), _jsx("span", { title: "IconWindowMaximize", children: _jsx(IconWindowMaximize, { ...args }) }), _jsx("span", { title: "IconWindowMinimize", children: _jsx(IconWindowMinimize, { ...args }) }), _jsx("span", { title: "IconReset", children: _jsx(IconReset, { ...args }) }), _jsx("span", { title: "IconExport", children: _jsx(IconExport, { ...args }) }), _jsx("span", { title: "IconImport", children: _jsx(IconImport, { ...args }) }), _jsx("span", { title: "IconPalette", children: _jsx(IconPalette, { ...args }) }), _jsx("span", { title: "IconFastSearch", children: _jsx(IconFastSearch, { ...args }) }), _jsx("span", { title: "IconUserGroup", children: _jsx(IconUserGroup, { ...args }) }), _jsx("span", { title: "IconBoard", children: _jsx(IconBoard, { ...args }) }), _jsx("span", { title: "IconActivity", children: _jsx(IconActivity, { ...args }) }), _jsx("span", { title: "IconWorkspace", children: _jsx(IconWorkspace, { ...args }) }), _jsx("span", { title: "IconAttachment", children: _jsx(IconAttachment, { ...args }) })] }), _jsxs("div", { style: { display: "flex", gap: "20px", marginTop: 20 }, children: [_jsx("span", { title: "IconActivityLog", children: _jsx(IconActivityLog, { ...args }) }), _jsx("span", { title: "IconCrown", children: _jsx(IconCrown, { ...args }) }), _jsx("span", { title: "IconChangeUser", children: _jsx(IconChangeUser, { ...args }) }), _jsx("span", { title: "IconPaste", children: _jsx(IconPaste, { ...args }) }), _jsx("span", { title: "IconFileSearch", children: _jsx(IconFileSearch, { ...args }) }), _jsx("span", { title: "IconStar", children: _jsx(IconStar, { ...args }) }), _jsx("span", { title: "IconStarRemove", children: _jsx(IconStarRemove, { ...args }) }), _jsx("span", { title: "IconLightningFill", children: _jsx(IconLightningFill, { ...args }) }), _jsx("span", { title: "IconLink", children: _jsx(IconLink, { ...args }) }), _jsx("span", { title: "IconEasy", children: _jsx(IconEasy, { ...args }) }), _jsx("span", { title: "IconConvertFilePdf", children: _jsx(IconConvertFilePdf, { ...args }) }), _jsx("span", { title: "IconRelation", children: _jsx(IconRelation, { ...args }) }), _jsx("span", { title: "IconCheckIn", children: _jsx(IconCheckIn, { ...args }) }), _jsx("span", { title: "IconRecursiveOps", children: _jsx(IconRecursiveOps, { ...args }) })] }), _jsxs("div", { style: { display: "flex", gap: "20px", marginTop: 20 }, children: [_jsx("span", { title: "IconSearchCheck", children: _jsx(IconSearchCheck, { ...args }) }), _jsx("span", { title: "IconSignature", children: _jsx(IconSignature, { ...args }) }), _jsx("span", { title: "IconSavedQuery", children: _jsx(IconSavedQuery, { ...args }) }), _jsx("span", { title: "IconSync", children: _jsx(IconSync, { ...args }) }), _jsx("span", { title: "IconAdvanced", children: _jsx(IconAdvanced, { ...args }) }), _jsx("span", { title: "IconSubstFile", children: _jsx(IconSubstFile, { ...args }) }), _jsx("span", { title: "IconBatchUpdate", children: _jsx(IconBatchUpdate, { ...args }) }), _jsx("span", { title: "IconShare", children: _jsx(IconShare, { ...args }) }), _jsx("span", { title: "IconSharedDcmt", children: _jsx(IconSharedDcmt, { ...args }) }), _jsx("span", { title: "IconExportTo", children: _jsx(IconExportTo, { ...args }) }), _jsx("span", { title: "IconArrowSortedDown", children: _jsx(IconArrowSortedDown, { ...args }) }), _jsx("span", { title: "IconArrowSortedUp", children: _jsx(IconArrowSortedUp, { ...args }) }), _jsx("span", { title: "IconStatistics", children: _jsx(IconStatistics, { ...args }) }), _jsx("span", { title: "IconArrowUnsorted", children: _jsx(IconArrowUnsorted, { ...args }) })] }), _jsxs("div", { style: { display: "flex", gap: "20px", marginTop: 20 }, children: [_jsx("span", { title: "IconPrinter", children: _jsx(IconPrinter, { ...args }) }), _jsx("span", { title: "IconFactory", children: _jsx(IconFactory, { ...args }) }), _jsx("span", { title: "IconTest", children: _jsx(IconTest, { ...args }) }), _jsx("span", { title: "IconCheck", children: _jsx(IconCheck, { ...args }) }), _jsx("span", { title: "IconSortAsc", children: _jsx(IconSortAsc, { ...args }) }), _jsx("span", { title: "IconSortDesc", children: _jsx(IconSortDesc, { ...args }) }), _jsx("span", { title: "IconSortAscLetters", children: _jsx(IconSortAscLetters, { ...args }) }), _jsx("span", { title: "IconSortDescLetters", children: _jsx(IconSortDescLetters, { ...args }) }), _jsx("span", { title: "IconSortAscNumbers", children: _jsx(IconSortAscNumbers, { ...args }) }), _jsx("span", { title: "IconSortDescNumbers", children: _jsx(IconSortDescNumbers, { ...args }) }), _jsx("span", { title: "IconSortAscClock", children: _jsx(IconSortAscClock, { ...args }) }), _jsx("span", { title: "IconSortDescClock", children: _jsx(IconSortDescClock, { ...args }) }), _jsx("span", { title: "IconTree", children: _jsx(IconTree, { ...args }) }), _jsx("span", { title: "IconGrid", children: _jsx(IconGrid, { ...args }) })] }), _jsxs("div", { style: { display: "flex", gap: "20px", marginTop: 20 }, children: [_jsx("span", { title: "IconList", children: _jsx(IconList, { ...args }) }), _jsx("span", { title: "IconLock", children: _jsx(IconLock, { ...args }) }), _jsx("span", { title: "IconLockClosed", children: _jsx(IconLockClosed, { ...args }) }), _jsx("span", { title: "IconBxLock", children: _jsx(IconBxLock, { ...args }) }), _jsx("span", { title: "IconFolder", children: _jsx(IconFolder, { ...args }) }), _jsx("span", { title: "IconFolderOpen", children: _jsx(IconFolderOpen, { ...args }) }), _jsx("span", { title: "IconTag", children: _jsx(IconTag, { ...args }) }), _jsx("span", { title: "IconFolderZip", children: _jsx(IconFolderZip, { ...args }) }), _jsx("span", { title: "IconBell", children: _jsx(IconBell, { ...args }) }), _jsx("span", { title: "IconBellCheck", children: _jsx(IconBellCheck, { ...args }) }), _jsx("span", { title: "IconBellOutline", children: _jsx(IconBellOutline, { ...args }) }), _jsx("span", { title: "IconBellCheckOutline", children: _jsx(IconBellCheckOutline, { ...args }) }), _jsx("span", { title: "IconEnvelopeOpenText", children: _jsx(IconEnvelopeOpenText, { ...args }) }), _jsx("span", { title: "IconMetadata_Computed", children: _jsx(IconMetadata_Computed, { ...args }) })] }), _jsxs("div", { style: { display: "flex", gap: "20px", marginTop: 20 }, children: [_jsx("span", { title: "IconMetadata_Text", children: _jsx(IconMetadata_Text, { ...args }) }), _jsx("span", { title: "IconMetadata_User", children: _jsx(IconMetadata_User, { ...args }) }), _jsx("span", { title: "IconMetadata_Date", children: _jsx(IconMetadata_Date, { ...args }) }), _jsx("span", { title: "IconMetadata_DataList", children: _jsx(IconMetadata_DataList, { ...args }) }), _jsx("span", { title: "IconMetadata_DynamicDataList", children: _jsx(IconMetadata_DynamicDataList, { ...args }) }), _jsx("span", { title: "IconMetadata_Numerator", children: _jsx(IconMetadata_Numerator, { ...args }) }), _jsx("span", { title: "IconMetadata_Special", children: _jsx(IconMetadata_Special, { ...args }) }), _jsx("span", { title: "IconMetadata_Numeric", children: _jsx(IconMetadata_Numeric, { ...args }) }), _jsx("span", { title: "IconMetadata", children: _jsx(IconMetadata, { ...args }) }), _jsx("span", { title: "IconRelationManyToMany", children: _jsx(IconRelationManyToMany, { ...args }) }), _jsx("span", { title: "IconRelationOneToMany", children: _jsx(IconRelationOneToMany, { ...args }) }), _jsx("span", { title: "IconBoxArchiveIn", children: _jsx(IconBoxArchiveIn, { ...args }) }), _jsx("span", { title: "IconBasket", children: _jsx(IconBasket, { ...args }) }), _jsx("span", { title: "IconSignCert", children: _jsx(IconSignCert, { ...args }) })] }), _jsxs("div", { style: { display: "flex", gap: "20px", marginTop: 20 }, children: [_jsx("span", { title: "IconServerService", children: _jsx(IconServerService, { ...args }) }), _jsx("span", { title: "IconUserExpired", children: _jsx(IconUserExpired, { ...args }) }), _jsx("span", { title: "IconUserCheck", children: _jsx(IconUserCheck, { ...args }) }), _jsx("span", { title: "IconAddressBook", children: _jsx(IconAddressBook, { ...args }) }), _jsx("span", { title: "IconFreeSearch", children: _jsx(IconFreeSearch, { ...args }) }), _jsx("span", { title: "IconMic", children: _jsx(IconMic, { ...args }) }), _jsx("span", { title: "IconKey", children: _jsx(IconKey, { ...args }) }), _jsx("span", { title: "IconDetailDcmts", children: _jsx(IconDetailDcmts, { ...args }) }), _jsx("span", { title: "IconMultipleSelection", children: _jsx(IconMultipleSelection, { ...args }) }), _jsx("span", { title: "IconChevronRight", children: _jsx(IconChevronRight, { ...args }) }), _jsx("span", { title: "IconChevronDown", children: _jsx(IconChevronDown, { ...args }) }), _jsx("span", { title: "IconRecentlyViewed", children: _jsx(IconRecentlyViewed, { ...args }) }), _jsx("span", { title: "IconFunction", children: _jsx(IconFunction, { ...args }) }), _jsx("span", { title: "IconNull", children: _jsx(IconNull, { ...args }) })] }), _jsxs("div", { style: { display: "flex", gap: "20px", marginTop: 20 }, children: [_jsx("span", { title: "IconAppAdvancedSettings", children: _jsx(IconAppAdvancedSettings, { ...args }) }), _jsx("span", { title: "IconSignaturePencil", children: _jsx(IconSignaturePencil, { ...args }) })] })] }));
12
- export const TMIcons = TMIconsTemplate.bind({});
13
- TMIcons.args = { fontSize: "48px", color: "black" };
@@ -1,4 +0,0 @@
1
- import { Meta } from "@storybook/react-vite";
2
- declare const _default: Meta;
3
- export default _default;
4
- export declare const DefaultLocalizator: any;
@@ -1,123 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from "react";
3
- import { CultureIDs } from "@topconsultnpm/sdk-ts";
4
- import { SDKUI_Localizator } from "../helper";
5
- // Default export for Storybook configuration
6
- export default {
7
- title: "Localizator/SDKUI_Localizator",
8
- component: () => _jsx("div", {}),
9
- tags: ["autodocs"],
10
- };
11
- // Story component
12
- const Template = () => {
13
- const [language, setLanguage] = useState(CultureIDs.En_US);
14
- const [searchTerm, setSearchTerm] = useState("");
15
- const localizedStrings = [
16
- { key: "Abort", value: SDKUI_Localizator.Abort },
17
- { key: "Abort_Confirm", value: SDKUI_Localizator.Abort_Confirm },
18
- { key: "About", value: SDKUI_Localizator.About },
19
- { key: "Add", value: SDKUI_Localizator.Add },
20
- { key: "AddAbove", value: SDKUI_Localizator.AddAbove },
21
- { key: "AddBelow", value: SDKUI_Localizator.AddBelow },
22
- { key: "AddAlls", value: SDKUI_Localizator.AddAlls },
23
- { key: "AddDefinition", value: SDKUI_Localizator.AddDefinition },
24
- { key: "AddOrSubstFile", value: SDKUI_Localizator.AddOrSubstFile },
25
- { key: "All", value: SDKUI_Localizator.All },
26
- { key: "AllFilesAndFoldersInSupportArea", value: SDKUI_Localizator.AllFilesAndFoldersInSupportArea },
27
- { key: "AllItems", value: SDKUI_Localizator.AllItems },
28
- { key: "AllFemale", value: SDKUI_Localizator.AllFemale },
29
- { key: "Alphabetic", value: SDKUI_Localizator.Alphabetic },
30
- { key: "Applied", value: SDKUI_Localizator.Applied },
31
- { key: "Apply", value: SDKUI_Localizator.Apply },
32
- { key: "ApplyAndClose", value: SDKUI_Localizator.ApplyAndClose },
33
- { key: "Approve", value: SDKUI_Localizator.Approve },
34
- { key: "Archive", value: SDKUI_Localizator.Archive },
35
- { key: "ArchiveConstraint", value: SDKUI_Localizator.ArchiveConstraint },
36
- { key: "ArchiveConstraints_ContentCompulsory", value: SDKUI_Localizator.ArchiveConstraints_ContentCompulsory },
37
- { key: "ArchiveConstraints_None", value: SDKUI_Localizator.ArchiveConstraints_None },
38
- { key: "ArchiveConstraints_OnlyMetadata", value: SDKUI_Localizator.ArchiveConstraints_OnlyMetadata },
39
- { key: "ArchiveID", value: SDKUI_Localizator.ArchiveID },
40
- { key: "Attention", value: SDKUI_Localizator.Attention },
41
- { key: "AuthMode", value: SDKUI_Localizator.AuthMode },
42
- { key: "AuthMode_OnBehalfOf", value: SDKUI_Localizator.AuthMode_OnBehalfOf },
43
- { key: "AuthMode_WindowsViaTopMedia", value: SDKUI_Localizator.AuthMode_WindowsViaTopMedia },
44
- { key: "Author", value: SDKUI_Localizator.Author },
45
- { key: "Back", value: SDKUI_Localizator.Back },
46
- { key: "BatchUpdate", value: SDKUI_Localizator.BatchUpdate },
47
- { key: "BlogCase", value: SDKUI_Localizator.BlogCase },
48
- { key: "Blog_Read", value: SDKUI_Localizator.Blog_Read },
49
- { key: "Blog_Write", value: SDKUI_Localizator.Blog_Write },
50
- { key: "Browser", value: SDKUI_Localizator.Browser },
51
- { key: "BrowseAreaFile", value: SDKUI_Localizator.BrowseAreaFile },
52
- { key: "BrowseAreaFolder", value: SDKUI_Localizator.BrowseAreaFolder },
53
- { key: "CassettoDoganaleExportMRN", value: SDKUI_Localizator.CassettoDoganaleExportMRN },
54
- { key: "CassettoDoganaleExportVU", value: SDKUI_Localizator.CassettoDoganaleExportVU },
55
- { key: "CassettoDoganaleImportMRN", value: SDKUI_Localizator.CassettoDoganaleImportMRN },
56
- { key: "CassettoDoganalePlus_UserName", value: SDKUI_Localizator.CassettoDoganalePlus_UserName },
57
- { key: "Cancel", value: SDKUI_Localizator.Cancel },
58
- { key: "ChangePassword", value: SDKUI_Localizator.ChangePassword },
59
- { key: "CheckIn", value: SDKUI_Localizator.CheckIn },
60
- { key: "CheckOut", value: SDKUI_Localizator.CheckOut },
61
- { key: "ChronologyDelete", value: SDKUI_Localizator.ChronologyDelete },
62
- { key: "Clear", value: SDKUI_Localizator.Clear },
63
- { key: "ClearOTP", value: SDKUI_Localizator.ClearOTP },
64
- { key: "Close", value: SDKUI_Localizator.Close },
65
- { key: "Columns_All_Hide", value: SDKUI_Localizator.Columns_All_Hide },
66
- { key: "Columns_All_Show", value: SDKUI_Localizator.Columns_All_Show },
67
- { key: "CompleteError", value: SDKUI_Localizator.CompleteError },
68
- { key: "Configure", value: SDKUI_Localizator.Configure },
69
- { key: "ConfirmPassword", value: SDKUI_Localizator.ConfirmPassword },
70
- { key: "ConfirmOnCancel", value: SDKUI_Localizator.ConfirmOnCancel },
71
- { key: "ContinueOperation", value: SDKUI_Localizator.ContinueOperation },
72
- { key: "CopiedSuccessfully", value: SDKUI_Localizator.CopiedSuccessfully },
73
- { key: "CopyToClipboard", value: SDKUI_Localizator.CopyToClipboard },
74
- { key: "Count", value: SDKUI_Localizator.Count },
75
- { key: "Create", value: SDKUI_Localizator.Create },
76
- { key: "CreationTime", value: SDKUI_Localizator.CreationTime },
77
- { key: "CultureID", value: SDKUI_Localizator.CultureID },
78
- { key: "Date", value: SDKUI_Localizator.Date },
79
- { key: "Date_Modified", value: SDKUI_Localizator.Date_Modified },
80
- { key: "DcmtCount", value: SDKUI_Localizator.DcmtCount },
81
- { key: "DcmtsDetail", value: SDKUI_Localizator.DcmtsDetail },
82
- { key: "DcmtsMaster", value: SDKUI_Localizator.DcmtsMaster },
83
- { key: "DcmtType", value: SDKUI_Localizator.DcmtType },
84
- { key: "DcmtTypesSelected", value: SDKUI_Localizator.DcmtTypesSelected },
85
- { key: "DcmtTypeSelect", value: SDKUI_Localizator.DcmtTypeSelect },
86
- { key: "Default", value: SDKUI_Localizator.Default },
87
- { key: "Details", value: SDKUI_Localizator.Details },
88
- { key: "Delete", value: SDKUI_Localizator.Delete },
89
- { key: "Delete_ConfirmFor1", value: SDKUI_Localizator.Delete_ConfirmFor1 },
90
- { key: "Delete_ConfirmForN", value: SDKUI_Localizator.Delete_ConfirmForN },
91
- { key: "DeletionCompletedSuccessfully", value: SDKUI_Localizator.DeletionCompletedSuccessfully },
92
- { key: "DeletionOperationInterrupted", value: SDKUI_Localizator.DeletionOperationInterrupted },
93
- { key: "Description", value: SDKUI_Localizator.Description },
94
- { key: "Destination", value: SDKUI_Localizator.Destination },
95
- { key: "DetailsView", value: SDKUI_Localizator.DetailsView },
96
- { key: "Disabled", value: SDKUI_Localizator.Disabled },
97
- { key: "Domain", value: SDKUI_Localizator.Domain },
98
- { key: "Download_in_Process", value: SDKUI_Localizator.Download_in_Process },
99
- { key: "Drafts", value: SDKUI_Localizator.Drafts },
100
- { key: "Duplicate", value: SDKUI_Localizator.Duplicate },
101
- { key: "Duplicate_ConfirmFor1", value: SDKUI_Localizator.Duplicate_ConfirmFor1 },
102
- { key: "Duplicate_ConfirmForN", value: SDKUI_Localizator.Duplicate_ConfirmForN },
103
- { key: "Duplicate_Download", value: SDKUI_Localizator.Duplicate_Download },
104
- { key: "DuplicationCompletedSuccessfully", value: SDKUI_Localizator.DuplicationCompletedSuccessfully },
105
- { key: "DuplicateNameError", value: SDKUI_Localizator.DuplicateNameError },
106
- { key: "DuplicationOperationInterrupted", value: SDKUI_Localizator.DuplicationOperationInterrupted }
107
- ];
108
- // Filter localized strings based on the search term (including digits)
109
- const filteredStrings = localizedStrings.filter((entry) => entry.key.toLowerCase().includes(searchTerm.toLowerCase()) ||
110
- entry.value.toString().toLowerCase().includes(searchTerm.toLowerCase()));
111
- SDKUI_Localizator.setLanguage(language);
112
- return (_jsxs("div", { style: { padding: "16px", border: "1px solid #ccc", borderRadius: "8px" }, children: [_jsx("input", { type: "text", value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), placeholder: "Search for a language...", style: {
113
- marginBottom: "16px",
114
- padding: "8px",
115
- border: "1px solid #ccc",
116
- borderRadius: "4px",
117
- width: "100%",
118
- } }), _jsx("select", { value: language, onChange: (e) => {
119
- setLanguage(e.target.value);
120
- SDKUI_Localizator.setLanguage(e.target.value);
121
- }, style: { marginBottom: "16px", padding: "8px", border: "1px solid #ccc", borderRadius: "4px" }, children: Object.values(CultureIDs).map((lang) => (_jsx("option", { value: lang, children: lang }, lang))) }), _jsx("div", { children: filteredStrings.length > 0 ? (filteredStrings.map((entry) => (_jsxs("p", { children: [_jsxs("strong", { children: [entry.key, ":"] }), " ", entry.value] }, entry.key)))) : (_jsx("p", { children: "No matching results" })) })] }));
122
- };
123
- export const DefaultLocalizator = Template.bind({});
@@ -1 +0,0 @@
1
- export declare const sortArgTypes: (argTypes: Record<string, any>) => Record<string, any>;
@@ -1,10 +0,0 @@
1
- // Helper function to sort an object by its keys alphabetically
2
- export const sortArgTypes = (argTypes) => {
3
- const sortedArgTypes = Object.keys(argTypes)
4
- .sort()
5
- .reduce((acc, key) => {
6
- acc[key] = argTypes[key];
7
- return acc;
8
- }, {});
9
- return sortedArgTypes;
10
- };
@@ -1,6 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react-vite';
2
- import TMUserAvatar from '../components/base/TMUserAvatar';
3
- declare const meta: Meta<typeof TMUserAvatar>;
4
- export default meta;
5
- type Story = StoryObj<typeof TMUserAvatar>;
6
- export declare const MultipleAvatars: Story;
@@ -1,20 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import TMUserAvatar from '../components/base/TMUserAvatar';
3
- import { TMDeviceProvider } from '../components';
4
- const meta = {
5
- title: 'Components/TMUserAvatar',
6
- component: TMUserAvatar,
7
- decorators: [(Story) => (_jsxs(TMDeviceProvider, { children: [" ", _jsx(Story, {}), " "] })),],
8
- tags: ['autodocs'],
9
- args: {
10
- displayName: 'Test User',
11
- nameForColorCalculation: 'Test User',
12
- },
13
- };
14
- export default meta;
15
- export const MultipleAvatars = {
16
- render: () => {
17
- const names = ['Luca', 'Claudio', 'Marco', 'Alessia', 'Giorgio', 'Ashkan', 'Joele', 'Alessandro'];
18
- return (_jsx("div", { style: { display: 'flex', gap: '10px', flexWrap: 'wrap' }, children: names.map((name, index) => (_jsx(TMUserAvatar, { displayName: name, nameForColorCalculation: name }, index))) }));
19
- },
20
- };