@topconsultnpm/sdkui-react 6.19.0-dev2.1 → 6.19.0-dev2.2

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.
@@ -18,6 +18,10 @@ const fontSizes = [
18
18
  { value: "19px", display: "19px" },
19
19
  { value: "20px", display: "20px" }
20
20
  ];
21
+ const fontFamilies = [
22
+ { value: "Inter", display: "Inter" },
23
+ { value: "Roboto", display: "Roboto" }
24
+ ];
21
25
  const SettingsAppearance = ({ landingPagesOptions, permissions = { canArchive: true, canSearch: true, dossiersLicense: true, wgGroupLicense: true, workFlowLicense: true } }) => {
22
26
  const [, setForceUpdate] = useState(0); // Dummy state to force re-renders
23
27
  const triggerUIUpdate = () => setForceUpdate((prev) => prev + 1); // Increment dummy state to re-render
@@ -47,6 +51,10 @@ const SettingsAppearance = ({ landingPagesOptions, permissions = { canArchive: t
47
51
  let newpx = e.target.value;
48
52
  SDKUI_Globals.userSettings.themeSettings.fontSize = newpx;
49
53
  triggerUIUpdate();
54
+ } }), _jsx(TMDropDown, { label: 'Family', dataSource: fontFamilies, width: '230px', value: SDKUI_Globals.userSettings.themeSettings.fontFamily, onValueChanged: (e) => {
55
+ let newFamily = e.target.value;
56
+ SDKUI_Globals.userSettings.themeSettings.fontFamily = newFamily;
57
+ triggerUIUpdate();
50
58
  } }), _jsx("p", { style: { fontSize: '1rem', fontWeight: 'bold', marginTop: '10px', marginBottom: '5px' }, children: SDKUI_Localizator.Grids }), _jsx(TMCheckBox, { label: SDKUI_Localizator.ShowRowSeparatingLines, value: SDKUI_Globals.userSettings.themeSettings.gridSettings.showRowLines, onValueChanged: (newValue) => {
51
59
  SDKUI_Globals.userSettings.themeSettings.gridSettings.showRowLines = newValue;
52
60
  triggerUIUpdate();
@@ -32,6 +32,7 @@ export declare class DataGridSettings {
32
32
  }
33
33
  export declare class ThemeSettings {
34
34
  fontSize: string;
35
+ fontFamily: string;
35
36
  gridSettings: DataGridSettings;
36
37
  constructor(skipCssUpdate?: boolean);
37
38
  /**
@@ -40,6 +41,7 @@ export declare class ThemeSettings {
40
41
  */
41
42
  toJSON(): {
42
43
  fontSize: string;
44
+ fontFamily: string;
43
45
  gridSettings: DataGridSettings;
44
46
  };
45
47
  }
@@ -36,8 +36,9 @@ export class UserSettings {
36
36
  // Ensure userID and archiveID are set
37
37
  settings.userID = userID;
38
38
  settings.archiveID = archiveID;
39
- // Update the CSS variable for font size
39
+ // Update the CSS variables for font size and font family
40
40
  document.documentElement.style.setProperty('--base-font-size', settings.themeSettings.fontSize);
41
+ document.documentElement.style.setProperty('--base-font-family', settings.themeSettings.fontFamily);
41
42
  // Wrap the settings object in a Proxy to intercept property updates
42
43
  const proxiedSettings = createProxy(settings, UserSettings.SaveSettings);
43
44
  // Automatically set the global userSettings
@@ -68,10 +69,12 @@ export class DataGridSettings {
68
69
  export class ThemeSettings {
69
70
  constructor(skipCssUpdate = false) {
70
71
  this.fontSize = FontSize.defaultFontSizeInPixel;
72
+ this.fontFamily = 'Inter';
71
73
  this.gridSettings = new DataGridSettings();
72
74
  // Automatically update the CSS variable for font size
73
75
  if (!skipCssUpdate) {
74
76
  document.documentElement.style.setProperty('--base-font-size', this.fontSize);
77
+ document.documentElement.style.setProperty('--base-font-family', this.fontFamily);
75
78
  }
76
79
  }
77
80
  /**
@@ -81,6 +84,7 @@ export class ThemeSettings {
81
84
  toJSON() {
82
85
  return {
83
86
  fontSize: this.fontSize,
87
+ fontFamily: this.fontFamily,
84
88
  gridSettings: this.gridSettings,
85
89
  };
86
90
  }
@@ -148,6 +152,10 @@ function createProxy(obj, saveCallback, rootObj) {
148
152
  if (prop === 'fontSize' && root instanceof UserSettings) {
149
153
  document.documentElement.style.setProperty('--base-font-size', value);
150
154
  }
155
+ // Handle specific property (fontFamily) updates
156
+ if (prop === 'fontFamily' && root instanceof UserSettings) {
157
+ document.documentElement.style.setProperty('--base-font-family', value);
158
+ }
151
159
  // Handle specific property (invoiceRetrieveFormat, orderRetrieveFormat) updates
152
160
  if ((prop === 'invoiceRetrieveFormat' || prop === 'orderRetrieveFormat') && root instanceof UserSettings) {
153
161
  clearDcmtsFileCache();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react",
3
- "version": "6.19.0-dev2.1",
3
+ "version": "6.19.0-dev2.2",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -39,7 +39,7 @@
39
39
  "lib"
40
40
  ],
41
41
  "dependencies": {
42
- "@topconsultnpm/sdk-ts": "6.19.0-dev2.1",
42
+ "@topconsultnpm/sdk-ts": "6.19.0-test.1",
43
43
  "buffer": "^6.0.3",
44
44
  "devextreme": "25.1.4",
45
45
  "devextreme-react": "25.1.4",