@topconsultnpm/sdkui-react-beta 6.13.28 → 6.13.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // ResizableGrid.tsx
3
3
  import React, { useRef, useState } from 'react';
4
+ import { SDKUI_Globals } from '../../helper';
4
5
  const ResizableGrid = ({ panels, minPercents, initialPercents, }) => {
5
6
  const panelCount = panels.length;
6
7
  const defaultMinPercents = minPercents ?? Array(panelCount).fill(0.1);
@@ -37,18 +38,19 @@ const ResizableGrid = ({ panels, minPercents, initialPercents, }) => {
37
38
  };
38
39
  // Build gridTemplateColumns string
39
40
  const gridTemplateColumns = percents
40
- .map((p, i) => `${(p * 100).toFixed(2)}%${i < panelCount - 1 ? ' 6px' : ''}`)
41
+ .map((p, i) => `${(p * 100).toFixed(2)}%${i < panelCount - 1 ? ` ${SDKUI_Globals.userSettings.themeSettings.gutters}px` : ''}`)
41
42
  .join(' ');
42
43
  return (_jsx("div", { ref: containerRef, style: {
43
44
  display: 'grid',
44
45
  gridTemplateColumns,
45
- width: '100%',
46
+ width: 'calc(100% - 20px)',
46
47
  height: '100%',
47
48
  position: 'relative',
48
- }, children: panels.map((panel, idx) => (_jsxs(React.Fragment, { children: [_jsx("div", { style: { overflow: 'auto', height: '100%' }, children: panel }), idx < panelCount - 1 && (_jsx("div", { style: {
49
+ overflow: 'hidden',
50
+ }, children: panels.map((panel, idx) => (_jsxs(React.Fragment, { children: [panel, idx < panelCount - 1 && (_jsx("div", { style: {
49
51
  cursor: 'col-resize',
50
- background: '#e0e0e0',
51
- width: 6,
52
+ background: 'transparent',
53
+ width: `${SDKUI_Globals.userSettings.themeSettings.gutters}px`,
52
54
  zIndex: 1,
53
55
  height: '100%',
54
56
  }, onMouseDown: e => handleMouseDown(idx, e) }))] }, idx))) }));
@@ -1,7 +1,11 @@
1
- declare const SettingsAppearance: ({ landingPagesOptions }: {
1
+ declare const SettingsAppearance: ({ landingPagesOptions, permissions }: {
2
2
  landingPagesOptions?: {
3
3
  display: string;
4
4
  value: string;
5
5
  }[];
6
+ permissions?: {
7
+ canArchive: boolean;
8
+ canSearch: boolean;
9
+ };
6
10
  }) => import("react/jsx-runtime").JSX.Element;
7
11
  export default SettingsAppearance;
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from 'react';
2
+ import { useMemo, useState } from 'react';
3
3
  import TMLayoutContainer from '../base/TMLayout';
4
4
  import TMDropDown from '../editors/TMDropDown';
5
5
  import TMCheckBox from '../editors/TMCheckBox';
6
6
  import TMButton from '../base/TMButton';
7
- import { SDKUI_Globals, SDKUI_Localizator, ThemeSettings } from '../../helper';
7
+ import { LandingPages, SDKUI_Globals, SDKUI_Localizator, ThemeSettings } from '../../helper';
8
8
  const fontSizes = [
9
9
  { value: "10px", display: "10px" },
10
10
  { value: "11px", display: "11px" },
@@ -18,10 +18,20 @@ const fontSizes = [
18
18
  { value: "19px", display: "19px" },
19
19
  { value: "20px", display: "20px" }
20
20
  ];
21
- const SettingsAppearance = ({ landingPagesOptions }) => {
21
+ const SettingsAppearance = ({ landingPagesOptions, permissions = { canArchive: true, canSearch: true } }) => {
22
22
  const [, setForceUpdate] = useState(0); // Dummy state to force re-renders
23
23
  const triggerUIUpdate = () => setForceUpdate((prev) => prev + 1); // Increment dummy state to re-render
24
- return (_jsxs(TMLayoutContainer, { children: [landingPagesOptions && _jsx("p", { style: { fontSize: '1.h1rem', fontWeight: 'bold', marginBottom: '5px' }, children: 'Pagina iniziale' }), landingPagesOptions && _jsx(TMDropDown, { dataSource: landingPagesOptions, value: SDKUI_Globals.userSettings.landingPage, width: '230px', onValueChanged: (e) => {
24
+ const filteredLandingPageOptopns = useMemo(() => {
25
+ let options = landingPagesOptions ?? [];
26
+ if (!permissions?.canArchive) {
27
+ options = options.filter(option => option.value !== LandingPages.ARCHIVE);
28
+ }
29
+ if (!permissions?.canSearch) {
30
+ options = options.filter(option => option.value !== LandingPages.SEARCH);
31
+ }
32
+ return options;
33
+ }, [permissions?.canArchive, permissions?.canSearch]);
34
+ return (_jsxs(TMLayoutContainer, { children: [landingPagesOptions && _jsx("p", { style: { fontSize: '1.h1rem', fontWeight: 'bold', marginBottom: '5px' }, children: 'Pagina iniziale' }), landingPagesOptions && _jsx(TMDropDown, { dataSource: filteredLandingPageOptopns, value: SDKUI_Globals.userSettings.landingPage, width: '230px', onValueChanged: (e) => {
25
35
  SDKUI_Globals.userSettings.landingPage = e.target.value;
26
36
  triggerUIUpdate();
27
37
  } }), _jsx("p", { style: { fontSize: '1.h1rem', fontWeight: 'bold', marginTop: '10px' }, children: 'Font' }), _jsx(TMDropDown, { label: SDKUI_Localizator.Size, dataSource: fontSizes, width: '230px', value: SDKUI_Globals.userSettings.themeSettings.fontSize, onValueChanged: (e) => {
@@ -39,6 +39,19 @@ export declare function stringIsNullOrEmpty(value: string | undefined): boolean;
39
39
  export declare function isPositiveNumber(val: unknown): val is number;
40
40
  export declare function sleep(ms: number): Promise<void>;
41
41
  export declare const dialogConfirmOperation: (title: string, msg: string, operationAsync: () => Promise<void>) => void;
42
+ export declare enum LandingPages {
43
+ HOME_PAGE = "homepage",
44
+ SEARCH = "search",
45
+ ARCHIVE = "archive",
46
+ WORKING_GROUPS = "workingGroups",
47
+ APPR_WORKFLOW = "approvazioneWorkflow",
48
+ DOSSIERS = "pratiche",
49
+ PREFERITI = "preferiti",
50
+ RECENTI = "recenti",
51
+ AREA_MANAGER = "areaDiAppoggio",
52
+ NOTIFICATIONS = "notifications",
53
+ ACTIVITIES = "activities"
54
+ }
42
55
  export declare function getExceptionMessage(ex: any): string;
43
56
  export declare function getContrastColor(inputColor: string): {
44
57
  bgColor: string;
@@ -658,6 +658,20 @@ export const dialogConfirmOperation = (title, msg, operationAsync) => {
658
658
  }
659
659
  });
660
660
  };
661
+ export var LandingPages;
662
+ (function (LandingPages) {
663
+ LandingPages["HOME_PAGE"] = "homepage";
664
+ LandingPages["SEARCH"] = "search";
665
+ LandingPages["ARCHIVE"] = "archive";
666
+ LandingPages["WORKING_GROUPS"] = "workingGroups";
667
+ LandingPages["APPR_WORKFLOW"] = "approvazioneWorkflow";
668
+ LandingPages["DOSSIERS"] = "pratiche";
669
+ LandingPages["PREFERITI"] = "preferiti";
670
+ LandingPages["RECENTI"] = "recenti";
671
+ LandingPages["AREA_MANAGER"] = "areaDiAppoggio";
672
+ LandingPages["NOTIFICATIONS"] = "notifications";
673
+ LandingPages["ACTIVITIES"] = "activities";
674
+ })(LandingPages || (LandingPages = {}));
661
675
  // #endregion
662
676
  // #region Exception
663
677
  export function getExceptionMessage(ex) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.13.28",
3
+ "version": "6.13.29",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",