-
Notifications
You must be signed in to change notification settings - Fork 208
/
Variables.ts
73 lines (62 loc) · 2.04 KB
/
Variables.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module PresentationRules
*/
/**
* Presentation rules support variables that allow having additional customization of the hierarchy
* and content based on variables whose values can change during application session.
*
* There are [special ECExpression symbols]($docs/presentation/advanced/ECExpressions.md#ruleset-variables-user-settings)
* that can be used to access variables by their ID, so rule conditions can check for a value and change
* the behavior. It allows showing / hiding some nodes in the hierarchy, change the grouping, etc.
*
* @public
*/
export interface VariablesGroup {
/**
* Group label to display in the UI.
* May be [localized]($docs/presentation/advanced/Localization.md).
*/
label: string;
/** Grouped variables */
vars: Variable[];
/** Nested variable groups. */
nestedGroups?: VariablesGroup[];
}
/**
* Available value types of user-controllable variables
* @public
*/
export enum VariableValueType {
/** Bool value, that uses Yes / No strings in the UI */
YesNo = "YesNo",
/** Bool value, that uses Show / Hide strings in the UI */
ShowHide = "ShowHide",
/** Any string value */
String = "StringValue",
/** Any integer value */
Int = "IntValue",
}
/**
* Definition for single user-controllable variable
* @public
*/
export interface Variable {
/** Id of the variable */
id: string;
/**
* Label of the variable that is shown in the UI.
* May be [localized]($docs/presentation/advanced/Localization.md).
*/
label: string;
/**
* Defines value type. Defaults to [[VariableValueType.YesNo]].
* @see VariableValueType
*/
type?: `${VariableValueType}`;
/** Default value. */
defaultValue?: string;
}