@deviceinsight/ng-ui-scale-lib 10.2.2 → 10.3.0

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.
Files changed (46) hide show
  1. package/dist/{AccessEditModal-kndFZDt-.js → AccessEditModal-EVgqtRQn.js} +17 -17
  2. package/dist/{AccessEditModal-kndFZDt-.js.map → AccessEditModal-EVgqtRQn.js.map} +1 -1
  3. package/dist/{BundleManagementContainer-vMlhg6fJ.js → BundleManagementContainer-48Mfx5AV.js} +4 -4
  4. package/dist/{BundleManagementContainer-vMlhg6fJ.js.map → BundleManagementContainer-48Mfx5AV.js.map} +1 -1
  5. package/dist/{BundlesContainer-CaC__bAh.js → BundlesContainer-nZS9tMML.js} +40 -40
  6. package/dist/{BundlesContainer-CaC__bAh.js.map → BundlesContainer-nZS9tMML.js.map} +1 -1
  7. package/dist/{DatapointImport-Cq8cifAI.js → DatapointImport-DGgPh1uk.js} +10 -10
  8. package/dist/DatapointImport-DGgPh1uk.js.map +1 -0
  9. package/dist/{FileUploadInput-DSyHVZUT.js → FileUploadInput-COocUgkB.js} +2 -2
  10. package/dist/{FileUploadInput-DSyHVZUT.js.map → FileUploadInput-COocUgkB.js.map} +1 -1
  11. package/dist/{Files-CJ7EHXzr.js → Files-DfQGLE39.js} +3 -3
  12. package/dist/{Files-CJ7EHXzr.js.map → Files-DfQGLE39.js.map} +1 -1
  13. package/dist/{GlobalPowerBiReports-PsiWcApU.js → GlobalPowerBiReports-B1nYGKvp.js} +2 -2
  14. package/dist/{GlobalPowerBiReports-PsiWcApU.js.map → GlobalPowerBiReports-B1nYGKvp.js.map} +1 -1
  15. package/dist/{JsonSettingWidget-CpZmTuBe.js → JsonSettingWidget-CGANHs8P.js} +9 -9
  16. package/dist/JsonSettingWidget-CGANHs8P.js.map +1 -0
  17. package/dist/{LicensesEditPage-CwGor2gV.js → LicensesEditPage-D1I6dogi.js} +11 -11
  18. package/dist/{LicensesEditPage-CwGor2gV.js.map → LicensesEditPage-D1I6dogi.js.map} +1 -1
  19. package/dist/{LicensesList-DWQlVNdR.js → LicensesList-CYyuylk_.js} +2 -2
  20. package/dist/{LicensesList-DWQlVNdR.js.map → LicensesList-CYyuylk_.js.map} +1 -1
  21. package/dist/{PropertiesEditPage-C4jjCoPp.js → PropertiesEditPage-BOlFs_u9.js} +29 -29
  22. package/dist/{PropertiesEditPage-C4jjCoPp.js.map → PropertiesEditPage-BOlFs_u9.js.map} +1 -1
  23. package/dist/{PropertiesList-CBLvLopM.js → PropertiesList-DCPkWqaf.js} +5 -5
  24. package/dist/{PropertiesList-CBLvLopM.js.map → PropertiesList-DCPkWqaf.js.map} +1 -1
  25. package/dist/{TemplateEditPage-d-3_n4YW.js → TemplateEditPage-BeV5ZSVV.js} +25 -25
  26. package/dist/{TemplateEditPage-d-3_n4YW.js.map → TemplateEditPage-BeV5ZSVV.js.map} +1 -1
  27. package/dist/{TemplateTextInput-CQ6XJiql.js → TemplateTextInput-EDyDopjf.js} +2 -2
  28. package/dist/{TemplateTextInput-CQ6XJiql.js.map → TemplateTextInput-EDyDopjf.js.map} +1 -1
  29. package/dist/{TemplatesListPage-roTvuqft.js → TemplatesListPage-BVAiLKAE.js} +13 -13
  30. package/dist/{TemplatesListPage-roTvuqft.js.map → TemplatesListPage-BVAiLKAE.js.map} +1 -1
  31. package/dist/{UserGroupAssignments-DTXRBp_V.js → UserGroupAssignments-C7c3INUy.js} +10 -10
  32. package/dist/{UserGroupAssignments-DTXRBp_V.js.map → UserGroupAssignments-C7c3INUy.js.map} +1 -1
  33. package/dist/{UserGroupTheme-CAHBWb9Q.js → UserGroupTheme-CFaudF3q.js} +5 -5
  34. package/dist/{UserGroupTheme-CAHBWb9Q.js.map → UserGroupTheme-CFaudF3q.js.map} +1 -1
  35. package/dist/api.js +23 -23
  36. package/dist/index.js +567 -562
  37. package/dist/index.js.map +1 -1
  38. package/dist/{setTitle-CjnK8p-J.js → setTitle-Cyf8DxtL.js} +4569 -4565
  39. package/dist/setTitle-Cyf8DxtL.js.map +1 -0
  40. package/package.json +11 -10
  41. package/dist/DatapointImport-Cq8cifAI.js.map +0 -1
  42. package/dist/JsonSettingWidget-CpZmTuBe.js.map +0 -1
  43. package/dist/api.d.ts +0 -1192
  44. package/dist/index.d.ts +0 -7
  45. package/dist/setTitle-CjnK8p-J.js.map +0 -1
  46. package/dist/setupRuntimeEnv.js +0 -27
package/dist/api.d.ts DELETED
@@ -1,1192 +0,0 @@
1
- import * as _deviceinsight_ng_ui_api_client from '@deviceinsight/ng-ui-api-client';
2
- import { Datapoint, User, UserGroup, Role, Asset, Gateway, AssetGroup, Event, AssetGroupDefinition, PaginationSettings, Pageable, AssetDefinition, Bundle, BundleVersion, AuthInfo, Sort } from '@deviceinsight/ng-ui-api-client';
3
- import { ReactableColumnDef, Period } from '@deviceinsight/ng-ui-components';
4
- import * as react_jsx_runtime from 'react/jsx-runtime';
5
- import * as React from 'react';
6
- import { ButtonHTMLAttributes, ReactNode, PropsWithChildren, ComponentType } from 'react';
7
- import { TOptions, i18n } from 'i18next';
8
- import { Layout } from 'react-grid-layout';
9
- import { useTranslation as useTranslation$1, Trans as Trans$1 } from 'react-i18next';
10
- import { HttpBackendOptions } from 'i18next-http-backend';
11
- import { GrantRequestFunctionType } from 'ux4iot-react';
12
- import { AxiosInstance } from 'axios';
13
-
14
- type DatapointValue = [number, boolean | string | number | {
15
- latitude: number;
16
- longitude: number;
17
- }];
18
-
19
- type DatapointWithLastValue = Datapoint & {
20
- lastValue: DatapointValue | null | undefined;
21
- lastValueTimestamp: number | null | undefined;
22
- };
23
-
24
- type UserWithGroupsAndRoles = User & {
25
- userGroups: Array<UserGroup>;
26
- roles: Array<Role>;
27
- };
28
-
29
- type Context = Asset | Gateway | AssetGroup | User | UserWithGroupsAndRoles | UserGroup | Datapoint | DatapointWithLastValue | Event | void;
30
- type TranslationRule = {
31
- pattern: string;
32
- modification: (key: string, context: Context) => string;
33
- };
34
- /**
35
- * Translation API class
36
- */
37
- declare class TranslationApi {
38
- context: Context;
39
- rules: TranslationRule[];
40
- setRules: (rules: TranslationRule[]) => void;
41
- getRules: () => TranslationRule[];
42
- setContext: (context: Context) => void;
43
- getContext: () => Context;
44
- modifyTranslationKey: (key: string, context?: Context | undefined) => string;
45
- }
46
- declare const _default$5: TranslationApi;
47
-
48
- type TranslationDescriptor = {
49
- id: string;
50
- defaultValue: string;
51
- };
52
- /**
53
- * Translation function type.
54
- * @param {string} key The key of the text to translate.
55
- * @param {Record<string, any>} [data] The data to pass to the translation function.
56
- * @returns {string} The translated text.
57
- */
58
- type TFunction = (key: string, options?: TOptions, context?: Context) => string;
59
-
60
- type Result = {
61
- t: TFunction;
62
- i18n: i18n;
63
- ready: boolean;
64
- };
65
- /**
66
- * Hook to use the translation function in a functional component.
67
- * @param args - forwarded to react-i18next's useTranslation (namespace, options)
68
- * @returns object with `t`, `i18n`, and `ready`
69
- * @example
70
- * const { t } = useTranslation('namespace');
71
- * const text = t('my.title', {defaultValue: 'My Title'});
72
- */
73
- declare function useTranslation(...args: Parameters<typeof useTranslation$1>): Result;
74
-
75
- interface Props$2 extends Omit<React.ComponentProps<typeof Trans$1>, 'context'> {
76
- context?: Context;
77
- }
78
- declare const StaticTrans: (props: Props$2) => react_jsx_runtime.JSX.Element;
79
- /**
80
- * Component to translate a text.
81
- * This component mimics the functionality of the `Trans` component of `react-i18next`.
82
- * @param {string} props.i18nKey The key of the text to translate.
83
- * @param {ReactNode} props.children The default value of the text to translate.
84
- * @example
85
- * ```tsx
86
- * import { Trans } from '@deviceinsight/scale-ui-types';
87
- *
88
- * <Trans i18nKey="my.key">My Default Translation</Trans>
89
- * ```
90
- */
91
- declare function Trans(props: React.ComponentProps<typeof StaticTrans>): react_jsx_runtime.JSX.Element;
92
-
93
- type UserColumnDefs = Array<ReactableColumnDef<UserWithGroupsAndRoles>>;
94
-
95
- type UserGroupInfo = UserGroup & {
96
- roleName?: string;
97
- licenseDisplayName?: string[];
98
- };
99
-
100
- type UserGroupColumnDefs = Array<ReactableColumnDef<UserGroupInfo>>;
101
-
102
- type Props$1 = ButtonHTMLAttributes<HTMLButtonElement> & {
103
- icon: ReactNode;
104
- };
105
- declare function ContextBarAction({ className, icon, ...props }: Props$1): react_jsx_runtime.JSX.Element;
106
-
107
- declare function ContextBarActionContainer({ children }: PropsWithChildren): null;
108
-
109
- type AssetGroupInfo = {
110
- id: number;
111
- assetGroup: AssetGroup;
112
- assetGroupDefinition: AssetGroupDefinition;
113
- ancestors: Array<AssetGroup>;
114
- };
115
-
116
- type AssetAndGroupsAndGateway = {
117
- id: number;
118
- asset: Asset;
119
- assetGroups: Array<AssetGroup>;
120
- gateway: Gateway | null | undefined;
121
- };
122
-
123
- type CanDeleteResult = {
124
- canBeDeleted: boolean;
125
- error?: string;
126
- };
127
-
128
- type SearchProps<T> = {
129
- query: string;
130
- paginationSettings: PaginationSettings;
131
- searchResult: Pageable<T> | null | undefined;
132
- isSearching: boolean;
133
- search?: (query: string, paginationSettings: PaginationSettings) => Promise<Pageable<any>>;
134
- onChangePageSize?: (size: number) => void;
135
- };
136
-
137
- type DashboardWidgetType = 'default' | 'map' | 'image' | 'dpvalue' | 'datapoints' | 'trend' | 'trendv2' | 'properties' | 'barchart' | 'digitalio' | 'link' | 'svg' | 'assignedAssets' | 'emptyInfoWidget' | 'aggregation' | 'assetsInfo' | 'testWidget';
138
- type DashboardWidgetConfig = {
139
- key: string;
140
- type: DashboardWidgetType;
141
- span?: number;
142
- title: string;
143
- settings: any;
144
- };
145
- type DashboardConfig = {
146
- key: string;
147
- name: string | null | undefined;
148
- description: string | null | undefined;
149
- labels?: string[];
150
- isAssetDefinitionDashboard?: boolean;
151
- shared: boolean;
152
- assetGroupId?: number;
153
- creationDate: number;
154
- orderId?: number;
155
- widgets: Array<DashboardWidgetConfig>;
156
- layout: Layout[];
157
- columnsCount: number;
158
- /** By default for new dashboards set to TRUE, but for old (based on rows) to FALSE */
159
- autoAdjustLayout: boolean;
160
- };
161
- type AssetContext = {
162
- type: 'asset';
163
- asset: Asset;
164
- };
165
- type AssetGroupContext = {
166
- type: 'assetGroup';
167
- assetGroup: AssetGroup;
168
- };
169
- type GlobalDashboardContext = {
170
- type: 'global';
171
- };
172
- type AssetDefinitionContext = {
173
- type: 'assetDefinition';
174
- assetDefinition: AssetDefinition;
175
- };
176
- type DashboardContext = AssetContext | AssetGroupContext | GlobalDashboardContext | AssetDefinitionContext;
177
-
178
- type WidgetProps = {
179
- context: DashboardContext;
180
- config: DashboardWidgetConfig;
181
- assetGroupId: number | null | undefined;
182
- editMode: boolean;
183
- dashboardId: string;
184
- dashboardPeriod?: Period | null | undefined;
185
- dashboardTime?: number | null | undefined;
186
- setTimeDriveSupported?: (supported: boolean) => void;
187
- };
188
- type WidgetConfigProps = {
189
- context: DashboardContext;
190
- config: DashboardWidgetConfig;
191
- assetGroupId: number | null | undefined;
192
- onChangeConfig: (config: DashboardWidgetConfig, withoutLivePreview?: boolean) => void;
193
- setApplyButtonDisabled: (value: boolean) => void;
194
- configChanged: boolean;
195
- };
196
- type WidgetDefinition = {
197
- name: DashboardWidgetType;
198
- widgetComponent: React.ComponentType<WidgetProps>;
199
- configComponent?: React.ComponentType<WidgetConfigProps>;
200
- contextComponent?: React.ComponentType<React.PropsWithChildren<unknown>>;
201
- title: TranslationDescriptor;
202
- subtitle?: TranslationDescriptor;
203
- autoOpenConfig?: boolean;
204
- defaultSettings?: Record<string, any>;
205
- scope: Array<'asset' | 'gateway' | 'assetGroup' | 'global' | 'assetDefinition'>;
206
- disabledByDefault?: boolean;
207
- timeDriveSupport?: boolean | ((config: any) => boolean | null | undefined);
208
- };
209
-
210
- type ContextInfoPathName = {
211
- pathname: string;
212
- };
213
- type ContextInfoString = ContextInfoPathName & {
214
- type: 'string';
215
- value: string;
216
- };
217
- type ContextInfoSearch = ContextInfoPathName & {
218
- type: 'search';
219
- elements: number;
220
- totalElements: number | null | undefined;
221
- totalElementsAccurate?: boolean;
222
- context: string;
223
- customTranslations?: {
224
- all: TranslationDescriptor;
225
- some: TranslationDescriptor;
226
- };
227
- tooltip?: string;
228
- };
229
- type ContextInfoAsset = ContextInfoPathName & {
230
- type: 'asset';
231
- asset: Asset;
232
- assetGroups: Array<AssetGroup>;
233
- assetDefinition: AssetDefinition | undefined;
234
- gateway: Gateway | null | undefined;
235
- };
236
- type ContextInfoAssetGroup = ContextInfoPathName & {
237
- type: 'assetGroup';
238
- assetGroup: AssetGroup;
239
- assetGroupDefinition: AssetGroupDefinition;
240
- };
241
- type ContextInfo = ContextInfoString | ContextInfoSearch | ContextInfoAsset | ContextInfoAssetGroup;
242
-
243
- type AppConfiguration<ConfigurationType> = {
244
- enabled: boolean;
245
- configuration: ConfigurationType;
246
- };
247
- type AppConfigurationBundle = Record<string, AppConfiguration<any>>;
248
- type validateAppConfigurationFunctionType = (appConfigurationUntyped: AppConfiguration<any>) => AppConfiguration<any>;
249
- type ThemeConfig = {
250
- logo?: string;
251
- favicon?: string;
252
- primaryColor?: string;
253
- };
254
- type EventPriority = {
255
- priority: number;
256
- label: string;
257
- icon: string;
258
- color: string;
259
- };
260
-
261
- type Authorities = string[] | string[][];
262
- /**
263
- * Checks if the current user has the given authorities.
264
- * @param {Authorities} authorities The authorities to check. Can be a list of authorities or a list of lists of authorities. In first case the user needs to have all authorities, in the second case the user needs to have all the authorities in at leat one list.
265
- * @returns {boolean} True if the current user has the given authorities, false otherwise.
266
- * @example
267
- * import { hasAuthorities } from '@deviceinsight/scale-ui-types';
268
- *
269
- * const hasAdminOrUserAuthorities = hasAuthorities(['ROLE_ADMIN', 'ROLE_USER']);
270
- */
271
- declare const hasAuthorities: (authorities?: Authorities) => boolean;
272
-
273
- type ContextInfoProps = {
274
- pathname: string;
275
- contextInfo?: ContextInfo;
276
- };
277
- type ContextActionType = {
278
- pathname: string;
279
- HasAuthorities: React.ComponentType<{
280
- authorities: Authorities;
281
- children: React.ReactNode;
282
- }>;
283
- };
284
- type App = 'dashboard' | 'trend' | 'events' | 'files' | 'usergroupthemes' | 'auditLog' | 'bundleManagement';
285
- type VisibilityProps = {
286
- onlyOnAsset?: string;
287
- onlyOnAssetGroup?: string;
288
- onlyIfInAssetGroup?: string;
289
- onlyIfAsset?: boolean;
290
- onlyIfGateway?: boolean;
291
- onlyWithAssetGroupProperties?: Array<string>;
292
- onlyWithAssetGroupDefinition?: string;
293
- onlyWithAssetDefinition?: string;
294
- sidebarIndex?: number;
295
- onlyIfRouteChildrenAllowed?: boolean;
296
- };
297
- type RouteConfig = {
298
- relativePath: string;
299
- label?: TranslationDescriptor;
300
- component?: React.ComponentType<any>;
301
- className?: string;
302
- childRoutes?: RouteConfig[];
303
- childRoutesContainer?: React.ComponentType<any>;
304
- iconSvg?: React.ComponentType<any>;
305
- iconLight?: string;
306
- iconDark?: string;
307
- show?: (contextInfo: ContextInfo | null | undefined, user: User) => boolean;
308
- requiredAuthorities?: string[] | Array<string[]>;
309
- appName?: App;
310
- scope?: string;
311
- validateAppConfiguration?: validateAppConfigurationFunctionType;
312
- config?: VisibilityProps;
313
- getTitleSegments?: (contextInfo: ContextInfo) => Array<string | TranslationDescriptor>;
314
- contextAction?: React.ComponentType<ContextActionType>;
315
- contextInfo?: React.ComponentType<ContextInfoProps>;
316
- excludeFromNavigation?: boolean;
317
- };
318
- type RouteLink = {
319
- path: string;
320
- label: TranslationDescriptor | null | undefined;
321
- active: boolean;
322
- iconSvg?: React.ComponentType<any>;
323
- iconLight?: string;
324
- iconDark?: string;
325
- requiredAuthorities?: string[] | string[][];
326
- };
327
- type NavGroup = {
328
- label: TranslationDescriptor;
329
- icon?: string;
330
- iconSvg?: React.ComponentType<any>;
331
- paths: Array<string>;
332
- appName?: App;
333
- scope?: string;
334
- separator?: boolean;
335
- };
336
-
337
- type Props = {
338
- authorities: Authorities;
339
- };
340
- /**
341
- * Renders the wrapped component only if the current user has the given authorities.
342
- * @param {Authorities} authorities The authorities to check. Can be a list of authorities or a list of lists of authorities. In first case the user needs to have all authorities, in the second case the user needs to have all the authorities in at leat one list.
343
- * @returns {React.ReactNode} The wrapped component.
344
- * @example
345
- * import { HasAuthorities } from '@deviceinsight/scale-ui-types';
346
- *
347
- * <HasAuthorities authorities={['ROLE_ADMIN', 'ROLE_USER']}>
348
- * <div>Only visible for users with ROLE_ADMIN or ROLE_USER</div>
349
- * </HasAuthorities>
350
- *
351
- * // ...
352
- * <HasAuthorities authorities={[['ROLE_ADMIN'], ['ROLE_CUSTOMER', 'ROLE_MAINTENANCE']}>
353
- * <div>Only visible for users with ROLE_ADMIN or both roles: ROLE_USER and ROLE_MAINTENANCE</div>
354
- * </HasAuthorities>
355
- */
356
- declare const HasAuthorities: ({ authorities, children }: React.PropsWithChildren<Props>) => react_jsx_runtime.JSX.Element | null;
357
-
358
- /**
359
- * Sets the globally available information about the current context.
360
- * Note it's an internal scale-ui function. Use it only if you know what you are doing.
361
- * @param {ContextInfo} contextInfo The context information.
362
- */
363
- declare function setContextInfo(contextInfo: ContextInfo): void;
364
-
365
- /**
366
- * Adds a i18next XHR backend to the i18next instance.
367
- * It's helpful if you store the translations in a json file.
368
- * @param {Record<string, any>} httpBackendOptions The configuration for the i18next XHR backend.
369
- * @example
370
- * ```ts
371
- * import { addI18nextXHRBackend } from '@deviceinsight/scale-ui-types';
372
- *
373
- * addI18nextXHRBackend({
374
- * loadPath: '/lib/public/i18n/{{lng}}/{{ns}}.json'
375
- * });
376
- * ```
377
- */
378
- declare const addI18nextXHRBackend: (httpBackendOptions: HttpBackendOptions) => Promise<void>;
379
-
380
- /**
381
- * Returns the timezone selected by the user. Might be the browser timezone or the timezone set in the current asset object.
382
- * @returns {string} The timezone selected by the user.
383
- * @example
384
- * import { useAssetTimezone } from '@deviceinsight/scale-ui-types';
385
- * const timezone = useAssetTimezone();
386
- */
387
- declare function useAssetTimezone(): string;
388
-
389
- /**
390
- * Allows to define a custom function for determining if a bundle can be deleted or not.
391
- * @param {function(bundle: Bundle): Promise<CanDeleteResult>} modifier The custom function for determining if a bundle can be deleted or not.
392
- */
393
- declare const modifyCanDeleteBundle: (customCanDeleteBundle: (arg0: Bundle) => Promise<CanDeleteResult>) => Promise<void>;
394
-
395
- /**
396
- * Allows to define a custom function for determining if a bundle version can be deleted or not.
397
- * @param {function(bundle: Bundle, version: BundleVersion): Promise<CanDeleteResult>} modifier The custom function for determining if a bundle version can be deleted or not.
398
- */
399
- declare const modifyCanDeleteBundleVersion: (customCanDeleteBundleVersion: (bundle: Bundle, version: BundleVersion) => Promise<CanDeleteResult>) => Promise<void>;
400
-
401
- /**
402
- * Helper function to retrieve the auth info of the current user.
403
- * @returns {Promise<AuthInfo>} The auth info of the current user.
404
- */
405
- declare const retrieveAuthInfo: () => Promise<AuthInfo>;
406
-
407
- /**
408
- * Returns the user start page. If it is not defined, returns `/`.
409
- * @returns Promise<string>
410
- */
411
- declare const getStartPage: () => Promise<string>;
412
-
413
- /**
414
- * @deprecated Please use the RouteApi.
415
- * Allows to define a custom list of routes.
416
- * @param {function(routes: Array<RouteConfig>): Array<RouteConfig>} modifyRoutesFn The custom function for determining the list of routes.
417
- * The function receives the default list of routes and returns the modified list of routes.
418
- * @example Adding a new custom route
419
- * ```ts
420
- * import { modifyRoutes } from '@deviceinsight/scale-ui-types';
421
- *
422
- * modifyRoutes((routes) => {
423
- * return [...routes, {
424
- * relativePath: 'my-route',
425
- * label: {
426
- * id: 'my-route.label',
427
- * defaultValue: 'My Route'
428
- * },
429
- * component: MyRouteComponent,
430
- * requiredAuthorities: ['ROLE_ADMIN']
431
- * }];
432
- * });
433
- * ```
434
- */
435
- declare const modifyRoutes: (modifyRoutesFn: (currentRoutes: Array<RouteConfig>) => Array<RouteConfig>) => Promise<void>;
436
-
437
- declare const ux4iotGrantRequestFunction: GrantRequestFunctionType;
438
-
439
- /**
440
- * Allows to add a custom React element in the header
441
- * @param {string} customHeaderElementId A unique id of the custom header element
442
- * @param {ComponentType<any>} customHeaderElementComponent The React component to render
443
- * @example
444
- * ```ts
445
- * import { addCustomHeaderElement } from '@deviceinsight/scale-ui-types';
446
- * import { MyCustomHeaderElement } from './MyCustomHeaderElement';
447
- *
448
- * addCustomHeaderElement('my-custom-header-element', MyCustomHeaderElement);
449
- * ```
450
- */
451
- declare const addCustomHeaderElement: (customHeaderElementId: string, customHeaderElementComponent: ComponentType<any>) => void;
452
- /**
453
- * Allows to remove a custom React element from the header added with `addCustomHeaderElement`
454
- * @param {string} customHeaderElementId The id of the custom header element to remove
455
- * @example
456
- * ```ts
457
- * import { removeCustomHeaderElement } from '@deviceinsight/scale-ui-types';
458
- * removeCustomHeaderElement('my-custom-header-element');
459
- * ```
460
- */
461
- declare const removeCustomHeaderElement: (customHeaderElementId: string) => void;
462
-
463
- type CustomLoginPageElementsContextType = {
464
- aboveForm: ReactNode;
465
- belowForm: ReactNode;
466
- belowLoginButton: ReactNode;
467
- nextToLoginButton: ReactNode;
468
- };
469
- type Position = keyof CustomLoginPageElementsContextType;
470
-
471
- /**
472
- * Sets a custom login page element.
473
- * @param {'aboveForm' | 'belowForm' | 'belowLoginButton' | 'nextToLoginButton'} position The position of the custom element.
474
- * @param {ReactNode} element The custom element.
475
- * @returns {Promise<void>}
476
- * @example
477
- * import { setCustomLoginPageElement } from '@deviceinsight/scale-ui-types';
478
- * setCustomLoginPageElement('aboveForm', <div>Custom element</div>);
479
- */
480
- declare function setCustomLoginPageElement(position: Position, element: ReactNode): Promise<void>;
481
-
482
- type CustomCategory = {
483
- categoryName: string;
484
- type: 'documents' | 'images';
485
- locizeKey: string;
486
- locizeDefaultValue: string;
487
- };
488
- /**
489
- * Sets custom file categories for the files app.
490
- * @param {CustomCategory[]} categories The custom file categories.
491
- * @example
492
- * import { setCustomFilesCategories } from '@deviceinsight/scale-ui-types';
493
- * setCustomFilesCategories([
494
- * {
495
- * categoryName: 'Custom Category',
496
- * type: 'documents',
497
- * locizeKey: 'customCategory',
498
- * locizeDefaultValue: 'Custom Category'
499
- * }
500
- * ]);
501
- */
502
- declare function setCustomFilesCategories(categories: CustomCategory[]): void;
503
-
504
- /**
505
- * Register a hook that can process datapoints returned by the API before they are used in the UI.
506
- *
507
- * Example:
508
- * setDatapointsByAssetIdPreprocessHook(async (assetId, dps) => dps.filter(dp => dp.name.startsWith('kpi.')));
509
- */
510
- declare function setDatapointsByAssetIdPreprocessHook(fn: (assetId: number, datapoints: Datapoint[]) => Promise<Datapoint[]> | Datapoint[]): void;
511
-
512
- type GetCustomMapMarkerIconFunction = (asset: Asset) => string;
513
- /**
514
- * Allows to define a custom function returning a map icon for a specific asset.
515
- * @param {function(asset: Asset): string} modifier The custom function for determining the map icon.
516
- * The function receives the asset and returns the map icon.
517
- */
518
- declare const modifyMapMarkerIcon: (getTenantSpecificMapMarkerIcon: GetCustomMapMarkerIconFunction) => Promise<void>;
519
-
520
- /**
521
- * Returns the current user account info.
522
- * @returns {User} The current user account info.
523
- * @example
524
- * import { useUserAccountInfo } from '@deviceinsight/scale-ui-types';
525
- * const user = useUserAccountInfo();
526
- */
527
- declare function useUserAccountInfo(): User;
528
-
529
- type IsDashboardVisible = (dashboard: DashboardConfig, context: DashboardContext, user: User) => Promise<boolean>;
530
- /**
531
- * Allows to define a custom function to determine if a dashboard is visible for the current user.
532
- * @param {IsDashboardVisible} isDashboardVisible The custom function to determine if a dashboard is visible for the current user.
533
- * @example
534
- * import { modifyIsDashboardVisible } from '@deviceinsight/scale-ui-types';
535
- *
536
- * modifyIsDashboardVisible(async (dashboard, context, user) => {
537
- * if (dashboard.key === 'settings' && context.type === 'assetGroup' && !user.userGroups.some(userGroup => userGroup.name === 'admin')) {
538
- * return false;
539
- * }
540
- * return true;
541
- * });
542
- */
543
- declare function modifyIsDashboardVisible(isDashboardVisible: IsDashboardVisible): void;
544
-
545
- /**
546
- * Allows to change the initial sort configuration for the child asset groups table placed in the asset group masterdata page.
547
- * @param {Sort} sort The sort configuration.
548
- * @example <caption>Sort by definition name ascending</caption>
549
- * import { modifyChildAssetGroupsInitialSort } from '@deviceinsight/scale-ui-types';
550
- *
551
- * modifyChildAssetGroupsInitialSort({
552
- * property: 'definitionName',
553
- * direction: 'ASC'
554
- * });
555
- */
556
- declare const modifyChildAssetGroupsInitialSort: (sort: Sort) => void;
557
-
558
- type AssetColumnDefs = Array<ReactableColumnDef<AssetAndGroupsAndGateway>>;
559
-
560
- type AssetGroupColumnDefs = Array<ReactableColumnDef<AssetGroupInfo>>;
561
-
562
- /**
563
- * Asset Column Definition Customization
564
- * */
565
- type GetCustomAssetColumnDefsFunction = (defaultColumnDefinitions: AssetColumnDefs, context: string, withLink?: boolean) => AssetColumnDefs;
566
- /**
567
- * Allows to define a custom list of columns for the asset table.
568
- * @param {function(defaultColumnDefinitions: Array<ReactableColumnDef<AssetAndGroupsAndGateway>>): Array<ReactableColumnDef<AssetAndGroupsAndGateway>>} modifier The custom function for determining the list of columns.
569
- * The function receives the default list of columns and returns the modified list of columns.
570
- * @example
571
- * ```ts
572
- * import { modifyAssetColumnDefinitions } from '@deviceinsight/scale-ui-types';
573
- * import { AssetAndGroupsAndGateway } from '@deviceinsight/ng-ui-api-client';
574
- * import { MyCustomAssetColumnDefs } from './MyCustomAssetColumnDefs';
575
- *
576
- * modifyAssetColumnDefinitions((defaultColumnDefinitions) => {
577
- * return [...defaultColumnDefinitions, ...MyCustomAssetColumnDefs];
578
- * });
579
- * ```
580
- */
581
- declare const modifyAssetColumnDefinitions: (getTenantSpecificColumnDefs: GetCustomAssetColumnDefsFunction) => Promise<void>;
582
- /**
583
- * Asset Group Column Definition Customization
584
- * */
585
- type GetCustomAssetGroupColumnDefsFunction = (defaultColumnDefinitions: AssetGroupColumnDefs, context: string, withLink?: boolean) => AssetGroupColumnDefs;
586
- /**
587
- * Allows to define a custom list of columns for the asset group table.
588
- * @param {function(defaultColumnDefinitions: Array<ReactableColumnDef<AssetGroupInfo>>): Array<ReactableColumnDef<AssetGroupInfo>>} modifier The custom function for determining the list of columns.
589
- * The function receives the default list of columns and returns the modified list of columns.
590
- * @example
591
- * ```ts
592
- * import { modifyAssetGroupColumnDefinitions } from '@deviceinsight/scale-ui-types';
593
- * import { AssetGroupInfo } from '@deviceinsight/ng-ui-api-client';
594
- * import { MyCustomAssetGroupColumnDefs } from './MyCustomAssetGroupColumnDefs';
595
- *
596
- * modifyAssetGroupColumnDefinitions((defaultColumnDefinitions) => {
597
- * return [...defaultColumnDefinitions, ...MyCustomAssetGroupColumnDefs];
598
- * });
599
- * ```
600
- */
601
- declare const modifyAssetGroupColumnDefinitions: (getTenantSpecificColumnDefs: GetCustomAssetGroupColumnDefsFunction) => Promise<void>;
602
- /**
603
- * User Column Definition Customization
604
- * */
605
- type GetCustomUserColumnDefsFunction = (defaultColumnDefinitions: UserColumnDefs, withLink?: boolean) => UserColumnDefs;
606
- /**
607
- * Allows to define a custom list of columns for the user table.
608
- * @param {function(defaultColumnDefinitions: Array<ReactableColumnDef<UserWithGroupsAndRoles>>): Array<ReactableColumnDef<UserWithGroupsAndRoles>>} getTenantSpecificColumnDefs The custom function for determining the list of columns.
609
- * The function receives the default list of columns and returns the modified list of columns.
610
- * @example
611
- * ```ts
612
- * import { modifyUserColumnDefinitions } from '@deviceinsight/scale-ui-types';
613
- * import { UserWithGroupsAndRoles } from '@deviceinsight/ng-ui-api-client';
614
- * import { MyCustomUserColumnDefs } from './MyCustomUserColumnDefs';
615
- *
616
- * modifyUserColumnDefinitions((defaultColumnDefinitions) => {
617
- * return [...defaultColumnDefinitions, ...MyCustomUserColumnDefs];
618
- * });
619
- * ```
620
- */
621
- declare const modifyUserColumnDefinitions: (getTenantSpecificColumnDefs: GetCustomUserColumnDefsFunction) => Promise<void>;
622
- /**
623
- * User Group Column Definition Customization
624
- * */
625
- type GetCustomColumnDefsFunction = (defaultColumnDefinitions: UserGroupColumnDefs, withLink?: boolean) => UserGroupColumnDefs;
626
- /**
627
- * Allows to define a custom list of columns for the user group table.
628
- * @param {function(defaultColumnDefinitions: Array<ReactableColumnDef<UserGroup>>): Array<ReactableColumnDef<UserGroup>>} getTenantSpecificColumnDefs The custom function for determining the list of columns.
629
- * The function receives the default list of columns and returns the modified list of columns.
630
- * @example
631
- * ```ts
632
- * import { modifyUserGroupColumnDefinitions } from '@deviceinsight/scale-ui-types';
633
- * import { UserGroup } from '@deviceinsight/ng-ui-api-client';
634
- * import { MyCustomUserGroupColumnDefs } from './MyCustomUserGroupColumnDefs';
635
- *
636
- * modifyUserGroupColumnDefinitions((defaultColumnDefinitions) => {
637
- * return [...defaultColumnDefinitions, ...MyCustomUserGroupColumnDefs];
638
- * });
639
- * ```
640
- */
641
- declare const modifyUserGroupColumnDefinitions: (getTenantSpecificColumnDefs: GetCustomColumnDefsFunction) => Promise<void>;
642
-
643
- type CustomSearchProperty = {
644
- key: string;
645
- type: 'string' | 'number' | 'boolean';
646
- };
647
-
648
- /**
649
- * Allows to define custom search properties in the advanced search panel.
650
- * @param {Array<CustomSearchProperty> | undefined} properties The custom search properties.
651
- * @example
652
- * import {modifyCustomSearchProperties} from '@deviceinsight/ng-ui-scale-lib/api';
653
- *
654
- * modifyCustomSearchProperties([{key: 'custom.prop', type: 'string'}, {key: 'custom.bool', type: 'boolean'}]);
655
- */
656
- declare const modifyCustomSearchProperties: (properties: CustomSearchProperty[]) => void;
657
-
658
- type GetCustomDashboardWidgets = (widgets: WidgetDefinition[]) => WidgetDefinition[];
659
- /**
660
- * Allows to define a custom list of available widgets on the dashboards.
661
- * @param {function(widgets: Array<WidgetDefinition<any, any>>): Array<WidgetDefinition<any, any>>} modifier The custom function for determining the list of available widgets.
662
- * The function receives the default list of available widgets and returns the modified list of available widgets.
663
- *
664
- * @example Adding a custom widget
665
- * ```ts
666
- * import { modifyDashboardWidgets } from '@deviceinsight/scale-ui-types';
667
- * import { MyCustomWidgetDefinition } from './MyCustomWidget';
668
- *
669
- * modifyDashboardWidgets((widgets) => {
670
- * return [...widgets, MyCustomWidgetDefinition];
671
- * });
672
- * ```
673
- * @example Removing a widget
674
- * ```ts
675
- * import { modifyDashboardWidgets } from '@deviceinsight/scale-ui-types';
676
- *
677
- * modifyDashboardWidgets((widgets) => {
678
- * return widgets.filter(widget => widget.name !== 'MyCustomWidget');
679
- * });
680
- * ```
681
- */
682
- declare const modifyDashboardWidgets: (modifyWidgetsFn: GetCustomDashboardWidgets) => void;
683
-
684
- type GenerateAssetUrnFn = (isGateway: boolean) => string;
685
- /**
686
- * Allows to define a custom function for generating the asset URN.
687
- * @param {function(boolean): string} generator The custom function for generating the asset URN.
688
- * It takes a boolean parameter indicating if the asset is a gateway or not and returns the generated URN.
689
- * @param {boolean} editable Indicates if the URN is editable or not.
690
- * @example
691
- * ```ts
692
- * import { generateAssetUrn } from '@deviceinsight/scale-ui-types';
693
- *
694
- * modifyGenerateAssetUrn((isGateway) => {
695
- * return isGateway ? 'urn:scale:gateway:' : 'urn:scale:asset:';
696
- * }, true);
697
- * ```
698
- */
699
- declare const modifyGenerateAssetUrn: (generator: GenerateAssetUrnFn, editable: boolean) => void;
700
-
701
- type UpdateAuthoritiesConfig = {
702
- onlyChildren: boolean;
703
- } | {
704
- includeChildren: boolean;
705
- };
706
- type Link = {
707
- appName?: string;
708
- scope: string[];
709
- value: string;
710
- label: TranslationDescriptor;
711
- };
712
- /**
713
- * Route API class.
714
- * Allows to manage the client-side routes.
715
- *
716
- * ## Adding a route
717
- * The class allows to add a custom route on different levels:
718
- * - global level ([`addGlobalApp`](#addglobalapp))
719
- * - asset level ([`addAssetTopLevelApp`](#addassettoplevelapp))
720
- * - asset details level ([`addAssetApp`](#addassetapp))
721
- * - asset group level ([`addAssetGroupTopLevelApp`](#addassetgrouptoplevelapp))
722
- * - asset group details level ([`addAssetGroupApp`](#addassetgroupapp))
723
- * - user level ([`addUserTopLevelApp`](#addusertoplevelapp))
724
- * - user details level ([`addUserApp`](#adduserapp))
725
- * - user group level ([`addUserGroupTopLevelApp`](#addusergrouptoplevelapp)
726
- * - user group details level ([`addUserGroupApp`](#addusergroupapp))
727
- *
728
- * The above functions accept a [RouteConfig](../modules.html#routeconfig) object as parameter. The parameter defines the path of the route, the component to render, the appeareance in the navigation menu and the access rules.
729
- *
730
- * @example
731
- * ```ts
732
- * // adding a route on the asset details level, visible only for users
733
- * // having the ROLE_ADMIN authority and only if the asset is in the asset group
734
- * // with id 'my-asset-group'.
735
- * RouteApi.addAssetApp({
736
- * relativePath: 'my-route',
737
- * label: {
738
- * id: 'my-route.label',
739
- * defaultValue: 'My Route'
740
- * },
741
- * component: MyRouteComponent,
742
- * requiredAuthorities: ['ROLE_ADMIN'],
743
- * config: {
744
- * onlyIfInAssetGroup: 'my-asset-group'
745
- * });
746
- * ```
747
- * ## Removing a route
748
- * The class allows to remove a custom route on different levels:
749
- * - global level ([`removeGlobalApp`](#removeglobalapp))
750
- * - asset level ([`removeAssetTopLevelApp`](#removeassettoplevelapp))
751
- * - asset details level ([`removeAssetApp`](#removeassetapp))
752
- * - asset group level ([`removeAssetGroupTopLevelApp`](#removeassetgrouptoplevelapp))
753
- * - asset group details level ([`removeAssetGroupApp`](#removeassetgroupapp)
754
- * - user level ([`removeUserTopLevelApp`](#removeusertoplevelapp))
755
- * - user details level ([`removeUserApp`](#removeuserapp))
756
- * - user group level ([`removeUserGroupTopLevelApp`](#removeusergrouptoplevelapp)
757
- * - user group details level ([`removeUserGroupApp`](#removeusergroupapp)
758
- *
759
- * The above functions accept a `string` as parameter. The parameter defines the name (`relativePath` field) of the route to remove.
760
- *
761
- * ## Adding a navigation group
762
- * The class allows to add a custom navigation group with a function [`addNavGroup`](#addnavgroup). This allows to group the custom routes in the navigation menu.
763
- * The function [`addNavGroup`](#addNavGroup) accepts a [`NavGroup`](../modules.html#navgroup) object as parameter.
764
- * The parameter defines the label of the navigation group, the icon to show in the navigation menu and the routes to include in the navigation group.
765
- * The routes are identified by the `relativePath` field of the [`RouteConfig`](../modules.html#routeconfig) object.
766
- * @example
767
- * ```ts
768
- * // adding a navigation group with the label 'My Group' and the icon 'my-icon'
769
- * // containing the routes 'my-route-1' and 'my-route-2'
770
- * RouteApi.addNavGroup({
771
- * label: {
772
- * id: 'my-group.label',
773
- * defaultValue: 'My Group'
774
- * },
775
- * icon: 'my-icon',
776
- * paths: ['my-route-1', 'my-route-2']
777
- * });
778
- * ```
779
- */
780
- declare class RouteApi {
781
- routes: Array<RouteConfig>;
782
- navGroups: Array<NavGroup>;
783
- /** @hidden */
784
- constructor(routes: Array<RouteConfig>);
785
- /** returns routes having name equal to the passed parameter */
786
- findRoutes: (routeName: string, routes?: Array<RouteConfig>) => Array<RouteConfig>;
787
- /** @deprecated please use findRoutes instead.*/
788
- findRoute: (routeName: string, routes?: Array<RouteConfig>) => RouteConfig | null | undefined;
789
- /** returns all routes */
790
- getRoutes: () => RouteConfig[];
791
- /** set routes: internal function to avoid circular dependency issues with the routes defined in routes.ts: routes were undefined when the ng-ui-scale-lib was used in the custom project */
792
- scaleUiInternal_setRoutes: (routes: Array<RouteConfig>) => void;
793
- /** returns all navigation groups */
794
- getNavGroups: () => NavGroup[];
795
- /** @internal returns the given routes filtered by the enabled apps */
796
- filterRoutes: (routes: Array<RouteConfig> | undefined, user: User, contextInfo: ContextInfo | null | undefined) => Array<RouteConfig>;
797
- /** returns the given links filtered by the enabled apps */
798
- filterLinksByEnabledApps: (links: Array<Link>) => Array<Link>;
799
- /** returns the given routes filtered by the enabled apps */
800
- filterRoutesByEnabledApps: (routes?: Array<RouteConfig>) => RouteConfig[];
801
- /** returns the given navigation groups filtered by the enabled apps */
802
- filterNavGroupsByEnabledApps: (navGroups?: Array<NavGroup>) => Array<NavGroup>;
803
- private findAppRoute;
804
- private addApp;
805
- private removeApp;
806
- /** adds a route on the asset details level */
807
- addAssetApp: (assetApp: RouteConfig) => void;
808
- /** adds a route on the asset level */
809
- addAssetTopLevelApp: (assetTopLevelApp: RouteConfig) => void;
810
- /** adds a route on the asset group details level */
811
- addAssetGroupApp: (assetGroupApp: RouteConfig) => void;
812
- /** adds a route on the asset group level */
813
- addAssetGroupTopLevelApp: (assetGroupTopLevelApp: RouteConfig) => void;
814
- /** adds a route on the user details level */
815
- addUserApp: (userApp: RouteConfig) => void;
816
- /** adds a route on the user level */
817
- addUserTopLevelApp: (userTopLevelApp: RouteConfig) => void;
818
- /** adds a route on the user group details level */
819
- addUserGroupApp: (userGroupApp: RouteConfig) => void;
820
- /** adds a route on the user group level */
821
- addUserGroupTopLevelApp: (userGroupTopLevelApp: RouteConfig) => void;
822
- /** adds a navigation group */
823
- addNavGroup: (navGroup: NavGroup) => number;
824
- /** removes a route on the asset details level */
825
- removeAssetApp: (assetAppName: string) => void;
826
- /** removes a route on the asset group details level */
827
- removeAssetGroupApp: (assetGroupAppName: string) => void;
828
- /** removes a route on the asset level */
829
- removeAssetTopLevelApp: (assetTopLevelAppName: string) => void;
830
- /** removes a route on the asset group level */
831
- removeAssetGroupTopLevelApp: (assetGroupTopLevelAppName: string) => void;
832
- /** removes a route on the user details level */
833
- removeUserApp: (userAppName: string) => void;
834
- /** removes a route on the user group details level */
835
- removeUserGroupApp: (userGroupAppName: string) => void;
836
- /** removes a route on the user level */
837
- removeUserTopLevelApp: (userTopLevelAppName: string) => void;
838
- /** removes a route on the user group level */
839
- removeUserGroupTopLevelApp: (userGroupTopLevelAppName: string) => void;
840
- /** adds a route on the global level */
841
- addGlobalApp: (globalApp: RouteConfig) => void;
842
- /** removes a route on the global level */
843
- removeGlobalApp: (globalAppName: string) => void;
844
- updateSingleRouteAuthorities: (route: RouteConfig, authorities: Array<string>) => void;
845
- /**
846
- * Makes all routes having name equal to the passed parameter enabled only for users having the specified authorities.
847
- *
848
- * @param {string} routeName
849
- * @param {string[]} authorities
850
- * @param {object} [config] extra configuration
851
- * @param {boolean} [config.onlyChildren] only direct children of the found routes will be enabled or disabled
852
- * @param {boolean} [config.includeChildren] fond routes and their direct children will be enabled or disabled
853
- */
854
- updateAuthorities: (routeName: string, authorities: Array<string>, config?: UpdateAuthoritiesConfig) => void;
855
- }
856
- declare const _default$4: RouteApi;
857
-
858
- type CustomizableComponentName = 'Logo' | 'Footer' | 'AssetConnectionState' | 'HeaderSearch';
859
- /**
860
- * Allows to replace some of the scale-ui components with custom ones.
861
- * @param {'Logo' | 'Footer' | 'AssetConnectionState' | 'HeaderSearch'} name The name of the component to replace.
862
- * @param {ComponentType<any> | null} component The React component to render.
863
- * @example
864
- * ```ts
865
- * import { replaceComponent } from '@deviceinsight/scale-ui-types';
866
- * import { MyCustomLogo } from './MyCustomLogo';
867
- *
868
- * replaceComponent('Logo', MyCustomLogo);
869
- * ```
870
- */
871
- declare const replaceComponent: (name: CustomizableComponentName, component: ComponentType<any>) => Promise<void>;
872
-
873
- type DefaultStyleCustomization = {
874
- colorPalette: Array<string>;
875
- trueColors: Array<string>;
876
- falseColors: Array<string>;
877
- };
878
- type StyleCustomization = {
879
- colorPalette?: Array<string>;
880
- trueColors?: Array<string>;
881
- falseColors?: Array<string>;
882
- };
883
- /**
884
- * Style API class.
885
- *
886
- * Allows to manage the CSS variables and the custom style customizations, as well as the color palette.
887
- *
888
- * ## Customizing the style configuration
889
- * The class allows to customize the style configuration with the method `setStyleCustomizations`.
890
- * The method accepts a `StyleCustomization` object as parameter.
891
- * The object can contain the following properties:
892
- * - `colorPalette`: an array of colors to be used as color palette. The colors can be any valid CSS color.
893
- * - `trueColors`: an array of colors to be used as true colors. The colors can be any valid CSS color. Used by the DigitalIO widget.
894
- * - `falseColors`: an array of colors to be used as false colors. The colors can be any valid CSS color. Used by the DigitalIO widget.
895
- *
896
- * @example
897
- * ```ts
898
- * await StyleApi.setStyleCustomizations({
899
- * colorPalette: ['#000000', '#ffffff']
900
- * });
901
- * ```
902
- *
903
- *
904
- * ## CSS variables
905
- * The class allows to define custom CSS variables and custom style customizations.
906
- *
907
- * @example
908
- * await StyleApi.setCssVariables({
909
- * '--primary-color-darker-10-percent': '#dedede'
910
- * });
911
- *
912
- *
913
- */
914
- declare class StyleApi {
915
- defaultStyleSettings: DefaultStyleCustomization;
916
- customStyleSettings: StyleCustomization;
917
- /** @hidden */
918
- constructor();
919
- /** allows to set the global css variables */
920
- setCssVariables: (variablesToSet: Record<string, string>) => Promise<void>;
921
- /** allows to set the color palette */
922
- setStyleCustomizations: (styleCustomizations: StyleCustomization) => Promise<void>;
923
- /** returns the color palette */
924
- getColorPalette: (defaults?: boolean) => Array<string>;
925
- /** @internal returns the true colors. Used internally by the DigitalIO widget */
926
- getTrueColors: () => Array<string>;
927
- /** @internal returns the default true color. Used internally by the DigitalIO widget */
928
- getDefaultTrueColor: () => string;
929
- /** @internal returns the default false color. Used internally by the DigitalIO widget */
930
- getDefaultFalseColor: () => string;
931
- /** @internal returns the false colors. Used internally by the DigitalIO widget */
932
- getFalseColors: () => Array<string>;
933
- /**
934
- * Helper function allowing to get the next color from the color palette.
935
- * @param {Array<string>} [excludeColors] An array of colors to exclude from the color palette.
936
- * @param {Array<string>} [colorList] An array of colors to use as color palette. If not specified, the color palette is used.
937
- * @returns {string} The next color from the color palette.
938
- */
939
- getNextColor: (excludeColors?: Array<string>, colorList?: Array<string>) => string;
940
- }
941
- /**
942
- * Style API Singleton instance.
943
- */
944
- declare const _default$3: StyleApi;
945
-
946
- /**
947
- * Theme API class.
948
- * @example
949
- * import { ThemeApi } from '@deviceinsight/scale-ui-types';
950
- *
951
- * ThemeApi.setCustomTheme({
952
- * logo: 'https://www.example.com/logo.png',
953
- * favicon: 'https://www.example.com/favicon.ico',
954
- * primaryColor: '#000000'
955
- * });
956
- */
957
- declare class ThemeApi {
958
- /**
959
- * @internal
960
- * Stores the default theme.
961
- */
962
- private defaultTheme;
963
- private userTheme;
964
- private customTheme;
965
- /**
966
- * @internal
967
- * Internal initialization function. Shouldn't be used directly.
968
- */
969
- initializeThemeConfiguration: () => void;
970
- /**
971
- * @internal
972
- * sets the current theme. Shouldn't be used directly.
973
- */
974
- setTheme: (config?: ThemeConfig) => void;
975
- /**
976
- * returns a default theme
977
- */
978
- getDefaultTheme: () => ThemeConfig;
979
- /**
980
- * sets the default theme
981
- */
982
- setDefaultTheme: (config: ThemeConfig) => void;
983
- /**
984
- * returns the user theme, which is taken from the user group configuration.
985
- */
986
- getUserTheme: () => ThemeConfig;
987
- /**
988
- * @internal
989
- * Internal function to set the user theme. Shouldn't be used directly.
990
- */
991
- setUserTheme: (config: ThemeConfig) => void;
992
- /**
993
- * sets the custom theme
994
- */
995
- setCustomTheme: (config: ThemeConfig) => void;
996
- /**
997
- * @internal
998
- * Internal function to set the user theme. Shouldn't be used directly.
999
- */
1000
- loadThemeForUser: (user: User) => Promise<void>;
1001
- }
1002
- /**
1003
- * Singleton instance of the ThemeApiClass.
1004
- * Allows to change the theme programmatically.
1005
- */
1006
- declare const _default$2: ThemeApi;
1007
-
1008
- type PowerBiReportConfigBase = {
1009
- reportHeading: string;
1010
- workspaceId: string;
1011
- reportId: string;
1012
- };
1013
- type PowerBiReportConfig = PowerBiReportConfigBase & {
1014
- tabName: string;
1015
- };
1016
-
1017
- type RoleTemplate = {
1018
- id: number;
1019
- name: string;
1020
- description: string;
1021
- authorities: string[];
1022
- };
1023
-
1024
- /**
1025
- * UI Configuration API class.
1026
- * Provides the Tenant UI configuration.
1027
- */
1028
- declare class UIConfiguration {
1029
- appConfiguration: AppConfigurationBundle | null | undefined;
1030
- private storedConfiguration;
1031
- syncWithBackend(uiConfiguration: Record<string, any>): Promise<any>;
1032
- getAppName(): string;
1033
- getFavicon(): string;
1034
- /**
1035
- * returns a boolean indicating if the app is enabled
1036
- * @param {string} appName The name of the app
1037
- * @param {string} scope The scope
1038
- */
1039
- isAppEnabled(appName: string, scope?: string): boolean;
1040
- /** @internal */
1041
- getAppConfiguration(appName: string, validateAppConfiguration?: validateAppConfigurationFunctionType): AppConfiguration<any> | null | undefined;
1042
- getPrimaryColor(): string;
1043
- getLogo(): string;
1044
- getErrorMessageAutocloseTimeout(): number | null | undefined;
1045
- getCustomStyleConfiguration(): StyleCustomization;
1046
- getTenantConfigUrl(): string | null | undefined;
1047
- isTenantShowingAssetQRCodes(): boolean;
1048
- getTenant(): string;
1049
- getApiBaseUrl(): string;
1050
- getDefaultTimezone(): string;
1051
- getGoogleMapsAPIKey(): string;
1052
- getDefaultMapCenter(): string;
1053
- getDefaultMapZoom(): string;
1054
- getTenantStartPageUrl(): string | null | undefined;
1055
- getTransportChannelsAvailable(): string;
1056
- getSupportedTimezones(): string[];
1057
- getDatapointExplorerEnabled(): boolean;
1058
- getInitialUserState(): 'TERMS_ACCEPTANCE_PENDING' | 'ACTIVE';
1059
- isPubSubStompDebuggingEnabled(): boolean;
1060
- getMainLocizeProject(): {
1061
- apiKey: string;
1062
- projectId: string;
1063
- version: string;
1064
- };
1065
- getTenantLocizeProject(): null | {
1066
- apiKey: any;
1067
- projectId: any;
1068
- version: any;
1069
- };
1070
- getSvgWidgetFieldIdentifier(): string;
1071
- getGatewayPrefix(): string;
1072
- getAssetPrefix(): string;
1073
- getFallbackLocale(): string;
1074
- getConfigurationsStatusInterval(): number;
1075
- hasLegalPages(): boolean;
1076
- getAppFooter(): string | null | undefined;
1077
- getPublicAppFooter(): string | null | undefined;
1078
- getAppWhatsNewVersion(): string | null | undefined;
1079
- getDocumentationStandardBaseUrl(): string | null | undefined;
1080
- getDocumentationStandardNamespace(): string | null | undefined;
1081
- getDocumentationStandardVersion(): string | null | undefined;
1082
- getDocumentationCustomBaseUrl(): string | null | undefined;
1083
- getDocumentationCustomNamespace(): string | null | undefined;
1084
- getDocumentationCustomVersion(): string | null | undefined;
1085
- getAvailableApps(): Array<string> | null | undefined;
1086
- getTrendExactValuesMinutes(): number;
1087
- getTrendMaxSlices(): number;
1088
- getTrendPreferOutliers(): boolean;
1089
- getAccountCreationPrinciple(): 'username' | 'email';
1090
- getEnabledWidgets(): string[] | null | undefined;
1091
- isDashboardTimeDriveEnabled(context: DashboardContext['type']): boolean;
1092
- isWidgetTimeDriveEnabled(widgetType: DashboardWidgetType, context: DashboardContext['type']): boolean;
1093
- getEventPriorities(): EventPriority[];
1094
- getEventPriority(priorityValue: number): EventPriority | null;
1095
- getDefaultEventPriority(): EventPriority;
1096
- getAggregationListSize(): number;
1097
- getDisplayWelcomeScreen(): boolean;
1098
- getGitCommitShaShort(): string;
1099
- getPowerBiReports(): PowerBiReportConfig[] | null | undefined;
1100
- getUx4iotUrl(): string | null | undefined;
1101
- getAssetListDefaultSearch(): string | null | undefined;
1102
- getAssetListAssetTypes(): 'all' | 'only_gateways' | 'only_assets';
1103
- getAssetGroupAssetAssignmentAssetTypes(): 'all' | 'only_assets' | 'only_gateways';
1104
- isFavoritesEnabled(): boolean;
1105
- isHistoryEnabled(): boolean;
1106
- isDatapointValuesUseAdx(): boolean;
1107
- getDashboardLabels(): string[];
1108
- getDefaultDashboardLabel(): string | undefined;
1109
- isReleaseNotesHidden(): boolean;
1110
- getDefaultSearchMode(): 'context' | 'full';
1111
- getRoleTemplates(): RoleTemplate[];
1112
- getGlobalAssetTimezoneMode(): 'browser' | 'asset' | 'user';
1113
- getPrimaryColorAvoidingGray(): string;
1114
- getUx4IotGrantRequestEndpoint(): string;
1115
- isTestTenant(): boolean;
1116
- private getConfigurationValue;
1117
- getDefaultPlotType(): 'step' | 'line' | 'line-area' | 'step-area' | 'dots' | null;
1118
- isTrendDotsPlotTypeEnabled(): boolean;
1119
- getDatapointSortingDisabled(): boolean;
1120
- getTrendShowLiveModeIndicator(): boolean;
1121
- getDatapointsShowLiveModeIndicator(): boolean;
1122
- isEulaDownloadRequired(): boolean;
1123
- }
1124
- declare const _default$1: UIConfiguration;
1125
-
1126
- /**
1127
- * Returns an axios instance storing the current user's token and preconfigured to handle token refresh when needed.
1128
- */
1129
- declare const _default: () => AxiosInstance;
1130
-
1131
- type IsPropertyVisible = (propertyKey: string, userRoles: Role[]) => boolean;
1132
- /**
1133
- * Allows to define a rule for determining if a property is visible or not.
1134
- * @param {IsPropertyVisible} customFunction The custom function for determining if a property is visible or not.
1135
- * @example
1136
- * ```ts
1137
- * import { modifyPropertyVisibility } from '@deviceinsight/scale-ui-types';
1138
- *
1139
- * const isPropertyVisible: IsPropertyVisible = (propertyKey, userRoles) => {
1140
- * return propertyKey !== 'my-property' || userRoles.some(role => role.name === 'ROLE_ADMIN');
1141
- * };
1142
- *
1143
- * modifyPropertyVisibility(isPropertyVisible);
1144
- * ```
1145
- */
1146
- declare const modifyPropertyVisibility: (customFunction: IsPropertyVisible) => void;
1147
-
1148
- /**
1149
- * Allows setting runtime environment variables
1150
- * @param {Record<string, string>} env The environment variables to set.
1151
- */
1152
- declare const setEnvironment: (env: Record<string, string>) => Promise<void>;
1153
-
1154
- /**
1155
- * Allows to load the custom locize.io project.
1156
- * @param {object} locizeProject The configuration for the locize.io project.
1157
- * @param {string} locizeProject.projectId The project id.
1158
- * @param {string} locizeProject.apiKey The api key.
1159
- * @param {string} locizeProject.version The version.
1160
- * @example
1161
- * ```ts
1162
- * import { setLocizeProject } from '@deviceinsight/scale-ui-types';
1163
- *
1164
- * setLocizeProject({
1165
- * projectId: 'my-project-id',
1166
- * apiKey: 'my-api-key',
1167
- * version: 'latest'
1168
- * });
1169
- * ```
1170
- */
1171
- declare const setLocizeProject: (locizeProject: {
1172
- projectId: string;
1173
- apiKey: string;
1174
- version: string;
1175
- }) => Promise<void>;
1176
-
1177
- /**
1178
- * Sets the application title.
1179
- * @param {string} title The application title.
1180
- */
1181
- declare const setTitle: (title: string) => Promise<void>;
1182
-
1183
- declare function setFavicon(filename: string): Promise<void>;
1184
- declare function setPrimaryColor(color: string): Promise<void>;
1185
- declare const eventBus: {
1186
- onSignin: (eventHandler: (user: _deviceinsight_ng_ui_api_client.User, autoSignin: boolean) => any, once?: boolean) => void;
1187
- onSignout: (eventHandler: (arg0: _deviceinsight_ng_ui_api_client.User) => any, once?: boolean) => void;
1188
- onThemeChange: (eventHandler: (config: ThemeConfig) => any, once?: boolean) => void;
1189
- onUserProfileChange: (eventHandler: (user: _deviceinsight_ng_ui_api_client.User) => void, once?: boolean) => void;
1190
- };
1191
-
1192
- export { App, AppConfigurationBundle, AssetAndGroupsAndGateway, AssetGroupInfo, CanDeleteResult, ContextActionType, ContextBarAction, ContextBarActionContainer, ContextInfoProps, DashboardConfig, DashboardWidgetConfig, DashboardWidgetType, HasAuthorities, NavGroup, _default$4 as RouteApi, RouteConfig, RouteLink, SearchProps, _default$3 as StyleApi, StyleCustomization, TFunction, _default$2 as ThemeApi, ThemeConfig, Trans, _default$5 as TranslationApi, TranslationDescriptor, _default$1 as UiConfigurationApi, UserColumnDefs, UserGroupColumnDefs, VisibilityProps, WidgetConfigProps, WidgetDefinition, WidgetProps, addCustomHeaderElement, addI18nextXHRBackend, eventBus, modifyGenerateAssetUrn as generateAssetUrn, _default as getNguiAxios, getStartPage, hasAuthorities, modifyAssetColumnDefinitions, modifyAssetGroupColumnDefinitions, modifyCanDeleteBundle, modifyCanDeleteBundleVersion, modifyChildAssetGroupsInitialSort, modifyCustomSearchProperties, modifyDashboardWidgets, modifyIsDashboardVisible, modifyMapMarkerIcon, modifyPropertyVisibility, modifyRoutes, modifyUserColumnDefinitions, modifyUserGroupColumnDefinitions, removeCustomHeaderElement, replaceComponent, retrieveAuthInfo, setContextInfo, setCustomFilesCategories, setCustomLoginPageElement, setDatapointsByAssetIdPreprocessHook, setEnvironment, setFavicon, setLocizeProject, setPrimaryColor, setTitle, useAssetTimezone, useTranslation, useUserAccountInfo, ux4iotGrantRequestFunction };