@singularsystems/neo-core 1.0.0-alpha.2 → 1.0.0-alpha.4
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.
- package/CHANGELOG.md +15 -0
- package/dist/ApiClient/ApiClientBase.d.ts +5 -5
- package/dist/ApiClient/ApiClientBase.js +13 -13
- package/dist/ApiClient/ReadApiClient.d.ts +16 -16
- package/dist/ApiClient/ReadApiClient.js +24 -24
- package/dist/ApiClient/UpdateableApiClient.d.ts +28 -28
- package/dist/ApiClient/UpdateableApiClient.js +33 -33
- package/dist/AppServices/AppService.d.ts +46 -46
- package/dist/AppServices/AppService.js +25 -25
- package/dist/AppServices/Config/ConfigModel.d.ts +21 -20
- package/dist/AppServices/Config/ConfigModel.js +28 -17
- package/dist/AppServices/Config/ConfigService.d.ts +15 -15
- package/dist/AppServices/Config/ConfigService.js +49 -53
- package/dist/AppServices/Module.d.ts +11 -11
- package/dist/AppServices/Module.js +13 -13
- package/dist/AppServices/NeoContainer.d.ts +22 -22
- package/dist/AppServices/NeoContainer.js +42 -42
- package/dist/AppServices/NeoModule.d.ts +3 -3
- package/dist/AppServices/NeoModule.js +30 -30
- package/dist/AppServices/NeoTypes.d.ts +61 -61
- package/dist/AppServices/NeoTypes.js +42 -42
- package/dist/AppServices/ServiceIdentifier.d.ts +23 -23
- package/dist/AppServices/ServiceIdentifier.js +38 -39
- package/dist/AppServices/index.d.ts +7 -7
- package/dist/AppServices/index.js +7 -7
- package/dist/Components/AnimationHelper.d.ts +69 -69
- package/dist/Components/AnimationHelper.js +182 -182
- package/dist/Components/BootstrapHelpers.d.ts +8 -8
- package/dist/Components/BootstrapHelpers.js +30 -30
- package/dist/Components/BootstrapTypes.d.ts +35 -35
- package/dist/Components/BootstrapTypes.js +1 -1
- package/dist/Components/ButtonOptions.d.ts +63 -61
- package/dist/Components/ButtonOptions.js +1 -1
- package/dist/Components/ContextMenu/ContextMenu.d.ts +16 -16
- package/dist/Components/ContextMenu/ContextMenu.js +1 -1
- package/dist/Components/ContextMenu/MenuUtils.d.ts +16 -16
- package/dist/Components/ContextMenu/MenuUtils.js +34 -34
- package/dist/Components/DatePicker/DatePicker.d.ts +70 -69
- package/dist/Components/DatePicker/DatePicker.js +502 -487
- package/dist/Components/DatePicker/DatePickerOptions.d.ts +43 -34
- package/dist/Components/DatePicker/DatePickerOptions.js +33 -33
- package/dist/Components/ErrorHandler.d.ts +59 -55
- package/dist/Components/ErrorHandler.js +210 -138
- package/dist/Components/FileManager/BoundFileManager.d.ts +18 -18
- package/dist/Components/FileManager/BoundFileManager.js +60 -60
- package/dist/Components/FileManager/FileManager.d.ts +80 -78
- package/dist/Components/FileManager/FileManager.js +277 -257
- package/dist/Components/FileManager/FileUploadBatch.d.ts +37 -37
- package/dist/Components/FileManager/FileUploadBatch.js +83 -82
- package/dist/Components/FileManager/IFileManagerOptions.d.ts +42 -42
- package/dist/Components/FileManager/IFileManagerOptions.js +1 -1
- package/dist/Components/FormOptions.d.ts +34 -34
- package/dist/Components/FormOptions.js +1 -1
- package/dist/Components/ICollapsableOptions.d.ts +11 -11
- package/dist/Components/ICollapsableOptions.js +1 -1
- package/dist/Components/Modal/ModalHelper.d.ts +31 -31
- package/dist/Components/Modal/ModalHelper.js +174 -174
- package/dist/Components/Modal/ModalOptions.d.ts +61 -61
- package/dist/Components/Modal/ModalOptions.js +1 -1
- package/dist/Components/Modal/ModalStore.d.ts +32 -32
- package/dist/Components/Modal/ModalStore.js +82 -82
- package/dist/Components/Modal/ModalUtils.d.ts +61 -61
- package/dist/Components/Modal/ModalUtils.js +109 -109
- package/dist/Components/Notifications/INotificationHelper.d.ts +56 -56
- package/dist/Components/Notifications/INotificationHelper.js +1 -1
- package/dist/Components/Notifications/Notification.d.ts +32 -32
- package/dist/Components/Notifications/Notification.js +26 -27
- package/dist/Components/Notifications/NotificationHelper.d.ts +63 -63
- package/dist/Components/Notifications/NotificationHelper.js +111 -112
- package/dist/Components/Notifications/NotificationStore.d.ts +34 -34
- package/dist/Components/Notifications/NotificationStore.js +78 -79
- package/dist/Components/PositionHelper.d.ts +10 -10
- package/dist/Components/PositionHelper.js +43 -43
- package/dist/Components/TaskRunner/Decorators.d.ts +6 -6
- package/dist/Components/TaskRunner/Decorators.js +24 -24
- package/dist/Components/TaskRunner/ProgressState.d.ts +22 -22
- package/dist/Components/TaskRunner/ProgressState.js +71 -72
- package/dist/Components/TaskRunner/TaskRunner.d.ts +114 -114
- package/dist/Components/TaskRunner/TaskRunner.js +253 -244
- package/dist/Components/TooltipOptions.d.ts +8 -8
- package/dist/Components/TooltipOptions.js +1 -1
- package/dist/Components/index.d.ts +22 -22
- package/dist/Components/index.js +13 -13
- package/dist/ConnectionManager.d.ts +45 -45
- package/dist/ConnectionManager.js +60 -61
- package/dist/Data/ApiDataSource.d.ts +46 -46
- package/dist/Data/ApiDataSource.js +140 -144
- package/dist/Data/AsyncDataSource.d.ts +35 -35
- package/dist/Data/AsyncDataSource.js +79 -80
- package/dist/Data/CacheService.d.ts +40 -40
- package/dist/Data/CacheService.js +63 -64
- package/dist/Data/DataCacheEntry.d.ts +42 -42
- package/dist/Data/DataCacheEntry.js +80 -80
- package/dist/Data/DataView.d.ts +43 -43
- package/dist/Data/DataView.js +173 -172
- package/dist/Data/Deserialiser.d.ts +42 -42
- package/dist/Data/Deserialiser.js +255 -255
- package/dist/Data/Paging/PageManager.d.ts +167 -167
- package/dist/Data/Paging/PageManager.js +323 -323
- package/dist/Data/Paging/PageRequest.d.ts +24 -24
- package/dist/Data/Paging/PageRequest.js +38 -39
- package/dist/Data/Paging/PageResult.d.ts +10 -10
- package/dist/Data/Paging/PageResult.js +14 -14
- package/dist/Data/Serialiser.d.ts +41 -41
- package/dist/Data/Serialiser.js +201 -201
- package/dist/Data/SortOperation.d.ts +8 -8
- package/dist/Data/SortOperation.js +26 -26
- package/dist/Data/StaticDataSource.d.ts +9 -9
- package/dist/Data/StaticDataSource.js +27 -27
- package/dist/Data/WindowedDataView.d.ts +8 -8
- package/dist/Data/WindowedDataView.js +49 -50
- package/dist/Data/index.d.ts +15 -15
- package/dist/Data/index.js +15 -15
- package/dist/Dates/DateUtils.d.ts +47 -47
- package/dist/Dates/DateUtils.js +226 -226
- package/dist/Dates/TimeSpan.d.ts +24 -24
- package/dist/Dates/TimeSpan.js +46 -46
- package/dist/DebounceHelper.d.ts +44 -38
- package/dist/DebounceHelper.js +122 -95
- package/dist/Extensions.d.ts +82 -82
- package/dist/Extensions.js +182 -182
- package/dist/FileUtils.d.ts +6 -6
- package/dist/FileUtils.js +37 -37
- package/dist/Globals.d.ts +19 -19
- package/dist/Globals.js +41 -41
- package/dist/JsonSchema/ClassMetadata.d.ts +25 -25
- package/dist/JsonSchema/ClassMetadata.js +53 -53
- package/dist/JsonSchema/JsonData.d.ts +16 -16
- package/dist/JsonSchema/JsonData.js +97 -97
- package/dist/JsonSchema/JsonSchemaTypes.d.ts +37 -37
- package/dist/JsonSchema/JsonSchemaTypes.js +1 -1
- package/dist/JsonSchema/PropertyMetadata.d.ts +8 -8
- package/dist/JsonSchema/PropertyMetadata.js +8 -8
- package/dist/JsonSchema/TypeCache.d.ts +16 -16
- package/dist/JsonSchema/TypeCache.js +44 -44
- package/dist/JsonSchema/TypeMetadata.d.ts +45 -45
- package/dist/JsonSchema/TypeMetadata.js +170 -170
- package/dist/JsonSchema/index.d.ts +7 -7
- package/dist/JsonSchema/index.js +6 -6
- package/dist/Localisation/ILocalisationService.d.ts +11 -11
- package/dist/Localisation/ILocalisationService.js +1 -1
- package/dist/Localisation/LocalisationService.d.ts +4 -4
- package/dist/Localisation/LocalisationService.js +17 -17
- package/dist/Localisation/index.d.ts +1 -1
- package/dist/Localisation/index.js +1 -1
- package/dist/Misc.d.ts +6 -6
- package/dist/Misc.js +6 -6
- package/dist/Model/BaseModels/AuditValues.d.ts +12 -12
- package/dist/Model/BaseModels/AuditValues.js +46 -48
- package/dist/Model/BaseModels/CriteriaBase.d.ts +18 -16
- package/dist/Model/BaseModels/CriteriaBase.js +45 -34
- package/dist/Model/BaseModels/FileDescriptorBase.d.ts +12 -12
- package/dist/Model/BaseModels/FileDescriptorBase.js +22 -22
- package/dist/Model/BaseModels/ReasonedUserEvent.d.ts +5 -4
- package/dist/Model/BaseModels/ReasonedUserEvent.js +23 -19
- package/dist/Model/BaseModels/UserEvent.d.ts +9 -8
- package/dist/Model/BaseModels/UserEvent.js +36 -32
- package/dist/Model/BindableBase.d.ts +46 -40
- package/dist/Model/BindableBase.js +79 -76
- package/dist/Model/Decorators.d.ts +47 -44
- package/dist/Model/Decorators.js +182 -177
- package/dist/Model/EnumHelper.d.ts +54 -54
- package/dist/Model/EnumHelper.js +104 -100
- package/dist/Model/IAutoRunner.d.ts +5 -5
- package/dist/Model/IAutoRunner.js +1 -1
- package/dist/Model/IModelBase.d.ts +92 -79
- package/dist/Model/IModelBase.js +1 -1
- package/dist/Model/IModelCreatorBase.d.ts +9 -9
- package/dist/Model/IModelCreatorBase.js +1 -1
- package/dist/Model/List.d.ts +79 -77
- package/dist/Model/List.js +208 -198
- package/dist/Model/LookupBase.d.ts +13 -6
- package/dist/Model/LookupBase.js +19 -10
- package/dist/Model/Misc.d.ts +83 -81
- package/dist/Model/Misc.js +59 -59
- package/dist/Model/ModelBase.d.ts +88 -86
- package/dist/Model/ModelBase.js +182 -180
- package/dist/Model/ModelCreatorBase.d.ts +24 -23
- package/dist/Model/ModelCreatorBase.js +92 -92
- package/dist/Model/ModelFieldInfo.d.ts +29 -12
- package/dist/Model/ModelFieldInfo.js +35 -26
- package/dist/Model/ModelGraphTraverser.d.ts +35 -35
- package/dist/Model/ModelGraphTraverser.js +101 -99
- package/dist/Model/NeoModel.d.ts +6 -6
- package/dist/Model/NeoModel.js +13 -13
- package/dist/Model/NeoTypeInfo.d.ts +52 -41
- package/dist/Model/NeoTypeInfo.js +300 -250
- package/dist/Model/ObservableProperty.d.ts +8 -8
- package/dist/Model/ObservableProperty.js +41 -41
- package/dist/Model/ObservableValue.d.ts +9 -9
- package/dist/Model/ObservableValue.js +25 -26
- package/dist/Model/PropertyInfo.d.ts +83 -81
- package/dist/Model/PropertyInfo.js +138 -137
- package/dist/Model/PropertyInstance.d.ts +84 -48
- package/dist/Model/PropertyInstance.js +173 -113
- package/dist/Model/ValueObject.d.ts +3 -3
- package/dist/Model/ValueObject.js +10 -10
- package/dist/Model/index.d.ts +15 -14
- package/dist/Model/index.js +13 -12
- package/dist/NumberUtils.d.ts +63 -49
- package/dist/NumberUtils.js +247 -197
- package/dist/Routing/IMenuItemProvider.d.ts +9 -9
- package/dist/Routing/IMenuItemProvider.js +1 -1
- package/dist/Routing/IMenuRoute.d.ts +18 -18
- package/dist/Routing/IMenuRoute.js +1 -1
- package/dist/Routing/INavigationHelper.d.ts +7 -7
- package/dist/Routing/INavigationHelper.js +1 -1
- package/dist/Routing/IPageLeaveHandler.d.ts +23 -23
- package/dist/Routing/IPageLeaveHandler.js +7 -7
- package/dist/Routing/IRoute.d.ts +27 -27
- package/dist/Routing/IRoute.js +1 -1
- package/dist/Routing/IRouteSecurityService.d.ts +14 -14
- package/dist/Routing/IRouteSecurityService.js +1 -1
- package/dist/Routing/MenuItemProvider.d.ts +17 -17
- package/dist/Routing/MenuItemProvider.js +53 -54
- package/dist/Routing/RouteSecurityService.d.ts +18 -18
- package/dist/Routing/RouteSecurityService.js +35 -36
- package/dist/Routing/index.d.ts +7 -7
- package/dist/Routing/index.js +3 -3
- package/dist/Security/IAuthenticationService.d.ts +41 -36
- package/dist/Security/IAuthenticationService.js +1 -1
- package/dist/Security/IAuthorisationService.d.ts +11 -11
- package/dist/Security/IAuthorisationService.js +1 -1
- package/dist/Security/ILoginErrorHandler.d.ts +4 -4
- package/dist/Security/ILoginErrorHandler.js +1 -1
- package/dist/Security/ISecurityService.d.ts +10 -10
- package/dist/Security/ISecurityService.js +1 -1
- package/dist/Security/IUser.d.ts +10 -10
- package/dist/Security/IUser.js +1 -1
- package/dist/Security/IUserRole.d.ts +6 -6
- package/dist/Security/IUserRole.js +1 -1
- package/dist/Security/LoginErrorHandler.d.ts +15 -15
- package/dist/Security/LoginErrorHandler.js +97 -98
- package/dist/Security/Oidc/OidcAuthService.d.ts +67 -60
- package/dist/Security/Oidc/OidcAuthService.js +216 -189
- package/dist/Security/Oidc/OidcTypes.d.ts +46 -29
- package/dist/Security/Oidc/OidcTypes.js +1 -1
- package/dist/Security/Oidc/OidcUser.d.ts +9 -9
- package/dist/Security/Oidc/OidcUser.js +33 -33
- package/dist/Security/SecurityService.d.ts +12 -12
- package/dist/Security/SecurityService.js +33 -34
- package/dist/Security/SignInResult.d.ts +13 -13
- package/dist/Security/SignInResult.js +8 -8
- package/dist/Security/User.d.ts +12 -12
- package/dist/Security/User.js +24 -24
- package/dist/Security/index.d.ts +10 -10
- package/dist/Security/index.js +5 -5
- package/dist/Settings.d.ts +71 -57
- package/dist/Settings.js +100 -87
- package/dist/SignalR/HubBase.d.ts +70 -70
- package/dist/SignalR/HubBase.js +164 -164
- package/dist/SignalR/HubReceiver.d.ts +11 -11
- package/dist/SignalR/HubReceiver.js +25 -25
- package/dist/SignalR/HubSubscription.d.ts +12 -12
- package/dist/SignalR/HubSubscription.js +14 -14
- package/dist/SignalR/index.d.ts +3 -3
- package/dist/SignalR/index.js +1 -1
- package/dist/StringUtils.d.ts +7 -7
- package/dist/StringUtils.js +24 -24
- package/dist/Utils.d.ts +81 -80
- package/dist/Utils.js +220 -218
- package/dist/Validation/Decorators.d.ts +12 -12
- package/dist/Validation/Decorators.js +52 -52
- package/dist/Validation/DisplayHelper.d.ts +20 -19
- package/dist/Validation/DisplayHelper.js +104 -104
- package/dist/Validation/Misc.d.ts +10 -10
- package/dist/Validation/Misc.js +11 -11
- package/dist/Validation/ModelProxy.d.ts +20 -20
- package/dist/Validation/ModelProxy.js +46 -46
- package/dist/Validation/RuleContext.d.ts +86 -86
- package/dist/Validation/RuleContext.js +130 -130
- package/dist/Validation/Rules.d.ts +70 -70
- package/dist/Validation/Rules.js +177 -177
- package/dist/Validation/ValidationHelpers.d.ts +12 -12
- package/dist/Validation/ValidationHelpers.js +57 -57
- package/dist/Validation/ValidationRules.d.ts +18 -18
- package/dist/Validation/ValidationRules.js +34 -34
- package/dist/Validation/ValidationState.d.ts +42 -42
- package/dist/Validation/ValidationState.js +74 -74
- package/dist/Validation/Validators/IModelValidator.d.ts +28 -24
- package/dist/Validation/Validators/IModelValidator.js +1 -1
- package/dist/Validation/Validators/IPropertyValidator.d.ts +21 -21
- package/dist/Validation/Validators/IPropertyValidator.js +15 -15
- package/dist/Validation/Validators/ModelValidator.d.ts +46 -45
- package/dist/Validation/Validators/ModelValidator.js +143 -137
- package/dist/Validation/Validators/PropertyValidator.d.ts +21 -21
- package/dist/Validation/Validators/PropertyValidator.js +64 -67
- package/dist/Validation/Validators/RuleValidator.d.ts +19 -19
- package/dist/Validation/Validators/RuleValidator.js +51 -55
- package/dist/Validation/index.d.ts +9 -9
- package/dist/Validation/index.js +7 -7
- package/dist/Views/IViewBase.d.ts +5 -5
- package/dist/Views/IViewBase.js +1 -1
- package/dist/index.d.ts +37 -36
- package/dist/index.js +44 -43
- package/package.json +11 -10
package/dist/NumberUtils.js
CHANGED
|
@@ -1,197 +1,247 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
NumberFormat[NumberFormat["
|
|
9
|
-
NumberFormat[NumberFormat["
|
|
10
|
-
NumberFormat[NumberFormat["
|
|
11
|
-
NumberFormat[NumberFormat["
|
|
12
|
-
NumberFormat[NumberFormat["
|
|
13
|
-
NumberFormat[NumberFormat["
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
NumberUtils.numberFormats[
|
|
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
|
-
var
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
if (
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
var
|
|
158
|
-
if (
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
var
|
|
171
|
-
if (
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
1
|
+
var _a;
|
|
2
|
+
import Decimal from "decimal.js-light";
|
|
3
|
+
import { DataType } from "./Model/Misc";
|
|
4
|
+
import Globals from './Globals';
|
|
5
|
+
export var NumberFormat;
|
|
6
|
+
(function (NumberFormat) {
|
|
7
|
+
// Mask is [Thousands Seperator, Decimals (2 places), Percent, Currency Symbol]
|
|
8
|
+
NumberFormat[NumberFormat["None"] = 0] = "None";
|
|
9
|
+
NumberFormat[NumberFormat["NoDecimals"] = 4096] = "NoDecimals";
|
|
10
|
+
NumberFormat[NumberFormat["Decimals"] = 4352] = "Decimals";
|
|
11
|
+
NumberFormat[NumberFormat["PercentNoDecimals"] = 4112] = "PercentNoDecimals";
|
|
12
|
+
NumberFormat[NumberFormat["PercentDecimals"] = 4368] = "PercentDecimals";
|
|
13
|
+
NumberFormat[NumberFormat["CurrencyNoDecimals"] = 4097] = "CurrencyNoDecimals";
|
|
14
|
+
NumberFormat[NumberFormat["CurrencyDecimals"] = 4353] = "CurrencyDecimals";
|
|
15
|
+
})(NumberFormat || (NumberFormat = {}));
|
|
16
|
+
var NumberUtils = /** @class */ (function () {
|
|
17
|
+
function NumberUtils() {
|
|
18
|
+
}
|
|
19
|
+
/** Gets a format string for the pre-defined number format.
|
|
20
|
+
* @param displayDecimals No of decimals to display if using a decimals format.
|
|
21
|
+
*/
|
|
22
|
+
NumberUtils.getFormatString = function (format, currencySymbol, displayDecimals) {
|
|
23
|
+
if (displayDecimals === void 0) { displayDecimals = 2; }
|
|
24
|
+
var formatString = NumberUtils.numberFormats[format];
|
|
25
|
+
if ((format & 0x0100) === 0x0100) {
|
|
26
|
+
if (displayDecimals === 0) {
|
|
27
|
+
formatString = formatString.replace(/.00/g, "");
|
|
28
|
+
}
|
|
29
|
+
else if (displayDecimals === 1) {
|
|
30
|
+
formatString = formatString.replace(/.00/g, ".0");
|
|
31
|
+
}
|
|
32
|
+
else if (displayDecimals > 2) {
|
|
33
|
+
formatString = formatString.replace(/.00/g, ".00" + "#".repeat(displayDecimals - 2));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return formatString.replace(/_/g, currencySymbol || NumberUtils.defaultCurrencySymbol);
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Formats a number into a string that can be parsed back to a number. E.g. without currency symbol or group separators
|
|
40
|
+
* @param number js number
|
|
41
|
+
* @param format Format string including group separators / currency symbol. This is used to get the number of decimal to display.
|
|
42
|
+
* @param hasExternalPercentSymbol True if this is a percent, but the format string doesn't contain a % symbol.
|
|
43
|
+
* @param maxDecimals Max no of decimals supported by the value. For percentages this should be 2 more than the no of displayed decimals.
|
|
44
|
+
*/
|
|
45
|
+
NumberUtils.formatRaw = function (number, format, hasExternalPercentSymbol, maxDecimals) {
|
|
46
|
+
var parts = format.split(";");
|
|
47
|
+
var isPercent = format.indexOf("%") >= 0 || hasExternalPercentSymbol;
|
|
48
|
+
if (isPercent && NumberUtils.transformPercent) {
|
|
49
|
+
number *= 100;
|
|
50
|
+
isPercent = false; //Don't allow extra precision below.
|
|
51
|
+
if (maxDecimals !== undefined) {
|
|
52
|
+
maxDecimals -= 2;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
var positive = "#0" + NumberUtils.getDecimalsFormatPart(parts[0], isPercent, maxDecimals), negative = "-#0" + NumberUtils.getDecimalsFormatPart(parts[1] ? parts[1] : parts[0], isPercent, maxDecimals);
|
|
56
|
+
return NumberUtils.format(number, positive + ";" + negative);
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Rounds a number, getting the precision from the format string
|
|
60
|
+
* @param hasExternalPercentSymbol True if this is a percent, but the format string doesn't contain a % symbol.
|
|
61
|
+
*/
|
|
62
|
+
NumberUtils.roundUsingFormat = function (number, formatString, hasExternalPercentSymbol) {
|
|
63
|
+
var decimals = this.getDecimalPlaces(formatString, number);
|
|
64
|
+
if (formatString.indexOf("%") >= 0 || hasExternalPercentSymbol) {
|
|
65
|
+
decimals += 2;
|
|
66
|
+
}
|
|
67
|
+
return this.round(number, decimals);
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Rounds a number to the nearest no of decimals.
|
|
71
|
+
*/
|
|
72
|
+
NumberUtils.round = function (number, decimals) {
|
|
73
|
+
if (number instanceof Globals.decimalType) {
|
|
74
|
+
// Round away from zero.
|
|
75
|
+
return number.toDecimalPlaces(decimals, Decimal.ROUND_HALF_UP);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
if (decimals > 0) {
|
|
79
|
+
return parseFloat((number).toFixed(decimals));
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
return parseInt(number.toFixed(0));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Returns the number of decimal places in a format string.
|
|
88
|
+
* @param formatString Format string.
|
|
89
|
+
* @param value Value if the negative format string is different to positive.
|
|
90
|
+
*/
|
|
91
|
+
NumberUtils.getDecimalPlaces = function (formatString, value) {
|
|
92
|
+
var parts = formatString.split(";");
|
|
93
|
+
var part = value === undefined || value >= 0 || parts.length == 1 ? parts[0] : parts[1];
|
|
94
|
+
var startIndex = part.indexOf(".");
|
|
95
|
+
var endIndex = Math.max(part.lastIndexOf("0"), part.lastIndexOf("#"));
|
|
96
|
+
if (startIndex >= 0 && endIndex > 0) {
|
|
97
|
+
return endIndex - startIndex;
|
|
98
|
+
}
|
|
99
|
+
return 0;
|
|
100
|
+
};
|
|
101
|
+
NumberUtils.getDecimalsFormatPart = function (formatString, isPercent, maxDecimals) {
|
|
102
|
+
if (isPercent === void 0) { isPercent = false; }
|
|
103
|
+
var decimalsPart = "";
|
|
104
|
+
var startIndex = formatString.indexOf(".");
|
|
105
|
+
var endIndex = Math.max(formatString.lastIndexOf("0"), formatString.lastIndexOf("#"));
|
|
106
|
+
if (startIndex >= 0 && endIndex > 0) {
|
|
107
|
+
decimalsPart = formatString.substring(startIndex, endIndex + 1) + (isPercent ? "##" : "");
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
decimalsPart = isPercent ? ".##" : "";
|
|
111
|
+
}
|
|
112
|
+
if (maxDecimals !== undefined && maxDecimals > 0) {
|
|
113
|
+
// If the format string has less decimals than maxDecimals, then add # characters on the end.
|
|
114
|
+
if (!decimalsPart) {
|
|
115
|
+
decimalsPart = ".";
|
|
116
|
+
}
|
|
117
|
+
if (decimalsPart.length - 1 < maxDecimals) {
|
|
118
|
+
decimalsPart += "#".repeat(maxDecimals - (decimalsPart.length - 1));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return decimalsPart;
|
|
122
|
+
};
|
|
123
|
+
NumberUtils.format = function (number, format, currencySymbol) {
|
|
124
|
+
if (number instanceof Globals.decimalType) {
|
|
125
|
+
number = number.toNumber();
|
|
126
|
+
}
|
|
127
|
+
if (number !== null && typeof number === "object") {
|
|
128
|
+
var numberValue = number.propertyInfo.propertyType === DataType.Decimal ? number.value.toNumber() : number.value;
|
|
129
|
+
return NumberUtils.formatUsingEnum(numberValue, number.propertyInfo.propertyType === DataType.Float || number.propertyInfo.propertyType === DataType.Decimal ? NumberFormat.Decimals : NumberFormat.NoDecimals);
|
|
130
|
+
}
|
|
131
|
+
else if (typeof format === "string") {
|
|
132
|
+
return NumberUtils.formatInternal(number, format);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
return NumberUtils.formatUsingEnum(number, format, currencySymbol);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
NumberUtils.formatUsingEnum = function (number, format, currencySymbol) {
|
|
139
|
+
return NumberUtils.formatInternal(number, NumberUtils.getFormatString(format, currencySymbol));
|
|
140
|
+
};
|
|
141
|
+
NumberUtils.formatInternal = function (number, formatString) {
|
|
142
|
+
if (number === undefined) {
|
|
143
|
+
// Developer has made a mistake somewhere, let them know.
|
|
144
|
+
return "undefined";
|
|
145
|
+
}
|
|
146
|
+
if (number === null) {
|
|
147
|
+
// Developer has made a mistake somewhere, let them know.
|
|
148
|
+
return "null";
|
|
149
|
+
}
|
|
150
|
+
if (!formatString || isNaN(number)) {
|
|
151
|
+
return number.toString(); //return as it is.
|
|
152
|
+
}
|
|
153
|
+
var isNegative = number < 0;
|
|
154
|
+
number = Math.abs(number);
|
|
155
|
+
formatString = formatString.replace(/ /g, '\xA0'); //replace spaces with non-breaking spaces.
|
|
156
|
+
//Check if the format string is a 2 part string
|
|
157
|
+
var negSeparatorIndex = formatString.indexOf(';');
|
|
158
|
+
if (negSeparatorIndex > 0) {
|
|
159
|
+
if (isNegative) {
|
|
160
|
+
//use the negative part
|
|
161
|
+
formatString = formatString.substr(negSeparatorIndex + 1);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
//use the positive part
|
|
165
|
+
formatString = formatString.substr(0, negSeparatorIndex);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
var fmtStart = formatString.indexOf('#');
|
|
169
|
+
var fmtEnd = Math.max(formatString.lastIndexOf('#'), formatString.lastIndexOf('0'));
|
|
170
|
+
var beforeText = '', afterText = '';
|
|
171
|
+
if (fmtStart > 0) {
|
|
172
|
+
beforeText = formatString.substr(0, fmtStart);
|
|
173
|
+
}
|
|
174
|
+
if (fmtEnd < formatString.length - 1) {
|
|
175
|
+
afterText = formatString.substr(fmtEnd + 1);
|
|
176
|
+
}
|
|
177
|
+
formatString = formatString.substr(fmtStart, fmtEnd - fmtStart + 1);
|
|
178
|
+
//search for separator for group & decimal, anything not digit, not +/- sign, not #.
|
|
179
|
+
var formatChars = formatString.match(/[^\d\-\+#]/g);
|
|
180
|
+
var decimal = (formatChars && formatChars[formatChars.length - 1]) || '.'; //treat the right most symbol as decimal
|
|
181
|
+
var group = (formatChars && formatChars[1] && formatChars[0]) || ','; //treat the left most symbol as group separator
|
|
182
|
+
if (decimal == group)
|
|
183
|
+
decimal = '.';
|
|
184
|
+
//split the decimal for the format string if any.
|
|
185
|
+
var numberParts = formatString.split(decimal);
|
|
186
|
+
//Check if this is a percent
|
|
187
|
+
number = afterText.indexOf('%') < 0 ? number : number * 100;
|
|
188
|
+
//Fix the decimal first, toFixed will auto fill trailing zero.
|
|
189
|
+
var numberString = number.toFixed(numberParts[1] ? numberParts[1].length : 0);
|
|
190
|
+
numberString = +(numberString) + ''; //convert number to string to trim off *all* trailing decimal zero(es)
|
|
191
|
+
//fill back any trailing zero according to format
|
|
192
|
+
var pos_trail_zero = numberParts[1] ? numberParts[1].lastIndexOf('0') : 0; //look for last zero in format
|
|
193
|
+
var part = numberString.split('.');
|
|
194
|
+
//integer will get !part[1]
|
|
195
|
+
if (!part[1] || part[1] && part[1].length <= pos_trail_zero) {
|
|
196
|
+
numberString = (+numberString).toFixed(pos_trail_zero + 1);
|
|
197
|
+
}
|
|
198
|
+
var szSep = numberParts[0].split(group); //look for separator
|
|
199
|
+
numberParts[0] = szSep.join(''); //join back without separator for counting the pos of any leading 0.
|
|
200
|
+
var pos_lead_zero = numberParts[0] ? numberParts[0].indexOf('0') : 0;
|
|
201
|
+
if (pos_lead_zero > -1) {
|
|
202
|
+
while (part[0].length < (numberParts[0].length - pos_lead_zero)) {
|
|
203
|
+
part[0] = '0' + part[0];
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
else if (+part[0] == 0) {
|
|
207
|
+
part[0] = '';
|
|
208
|
+
}
|
|
209
|
+
var numberStrings = numberString.split('.');
|
|
210
|
+
numberStrings[0] = part[0];
|
|
211
|
+
//process the first group separator from decimal (.) only, the rest ignore.
|
|
212
|
+
//get the length of the last slice of split result.
|
|
213
|
+
var pos_separator = (szSep[1] && szSep[szSep.length - 1].length);
|
|
214
|
+
if (pos_separator) {
|
|
215
|
+
var integer = numberStrings[0];
|
|
216
|
+
var str = '';
|
|
217
|
+
var offset = integer.length % pos_separator;
|
|
218
|
+
for (var i = 0, l = integer.length; i < l; i++) {
|
|
219
|
+
str += integer.charAt(i); //ie6 only support charAt for sz.
|
|
220
|
+
//-pos_separator so that won't trail separator on full length
|
|
221
|
+
if (!((i - offset + 1) % pos_separator) && i < l - pos_separator) {
|
|
222
|
+
str += group;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
numberStrings[0] = str;
|
|
226
|
+
}
|
|
227
|
+
numberStrings[1] = (numberParts[1] && numberStrings[1]) ? decimal + numberStrings[1] : "";
|
|
228
|
+
numberStrings[0] = numberStrings[0].replace(/,/g, NumberUtils.thousandsSeparator);
|
|
229
|
+
return beforeText + numberStrings[0] + numberStrings[1] + afterText; //put back any negation and combine integer and fraction.
|
|
230
|
+
};
|
|
231
|
+
;
|
|
232
|
+
NumberUtils.thousandsSeparator = "\xA0"; // non breaking space.
|
|
233
|
+
NumberUtils.defaultCurrencySymbol = "R";
|
|
234
|
+
NumberUtils.numberFormats = (_a = {},
|
|
235
|
+
_a[NumberFormat.None] = "#",
|
|
236
|
+
_a[NumberFormat.NoDecimals] = "#,##0;(#,##0)",
|
|
237
|
+
_a[NumberFormat.Decimals] = "#,##0.00;(#,##0.00)",
|
|
238
|
+
_a[NumberFormat.PercentNoDecimals] = "#,##0%;(#,##0)%",
|
|
239
|
+
_a[NumberFormat.PercentDecimals] = "#,##0.00%;(#,##0.00%)",
|
|
240
|
+
_a[NumberFormat.CurrencyNoDecimals] = "_#,##0;(_#,##0)",
|
|
241
|
+
_a[NumberFormat.CurrencyDecimals] = "_#,##0.00;(_#,##0.00)",
|
|
242
|
+
_a);
|
|
243
|
+
/** If values typed into numeric editors should be divided by 100 when stored. */
|
|
244
|
+
NumberUtils.transformPercent = true;
|
|
245
|
+
return NumberUtils;
|
|
246
|
+
}());
|
|
247
|
+
export default NumberUtils;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IMenuRoute } from './IMenuRoute';
|
|
2
|
-
export interface IMenuItemProvider<TMenuItem extends IMenuRoute = IMenuRoute> {
|
|
3
|
-
/**
|
|
4
|
-
* Processes a list of routes into a list of menu items for display in a menu component.
|
|
5
|
-
* @param routeItems List of items from the route provider.
|
|
6
|
-
* @param defaults Defaults to apply to menu items.
|
|
7
|
-
*/
|
|
8
|
-
processRoutes(routeItems: TMenuItem[], defaults: Partial<TMenuItem>): TMenuItem[];
|
|
9
|
-
}
|
|
1
|
+
import { IMenuRoute } from './IMenuRoute';
|
|
2
|
+
export interface IMenuItemProvider<TMenuItem extends IMenuRoute = IMenuRoute> {
|
|
3
|
+
/**
|
|
4
|
+
* Processes a list of routes into a list of menu items for display in a menu component.
|
|
5
|
+
* @param routeItems List of items from the route provider.
|
|
6
|
+
* @param defaults Defaults to apply to menu items.
|
|
7
|
+
*/
|
|
8
|
+
processRoutes(routeItems: TMenuItem[], defaults: Partial<TMenuItem>): TMenuItem[];
|
|
9
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { IRoute } from './IRoute';
|
|
2
|
-
/**
|
|
3
|
-
* Extends IRoute and describes how the to display the route as a menu item in a menu component.
|
|
4
|
-
*/
|
|
5
|
-
export interface IMenuRoute extends IRoute {
|
|
6
|
-
/** Display name of the menu item. */
|
|
7
|
-
name: string;
|
|
8
|
-
/** Hide if item has no visible children. True by default if the item has no path of its own. */
|
|
9
|
-
hideWhenEmpty?: boolean;
|
|
10
|
-
/** If there is only 1 visible child, collapse it into this parent item. True by default if the parent has no path. */
|
|
11
|
-
collapseSingle?: boolean;
|
|
12
|
-
/** If the menu item should be expanded by default */
|
|
13
|
-
expanded?: boolean;
|
|
14
|
-
/** Children to show as sub menu items. The breadCrumbParent property of each child will also be set to this item. */
|
|
15
|
-
children?: IMenuRoute[];
|
|
16
|
-
/** Icon to show on the menu. */
|
|
17
|
-
icon?:
|
|
18
|
-
}
|
|
1
|
+
import { IRoute } from './IRoute';
|
|
2
|
+
/**
|
|
3
|
+
* Extends IRoute and describes how the to display the route as a menu item in a menu component.
|
|
4
|
+
*/
|
|
5
|
+
export interface IMenuRoute extends IRoute {
|
|
6
|
+
/** Display name of the menu item. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Hide if item has no visible children. True by default if the item has no path of its own. */
|
|
9
|
+
hideWhenEmpty?: boolean;
|
|
10
|
+
/** If there is only 1 visible child, collapse it into this parent item. True by default if the parent has no path. */
|
|
11
|
+
collapseSingle?: boolean;
|
|
12
|
+
/** If the menu item should be expanded by default */
|
|
13
|
+
expanded?: boolean;
|
|
14
|
+
/** Children to show as sub menu items. The breadCrumbParent property of each child will also be set to this item. */
|
|
15
|
+
children?: IMenuRoute[];
|
|
16
|
+
/** Icon to show on the menu. */
|
|
17
|
+
icon?: any;
|
|
18
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export interface INavigationHelper {
|
|
2
|
-
/**
|
|
3
|
-
* Navigates to an internal url using the router.
|
|
4
|
-
* @param replace Replace the url instead of adding to the history. This prevents the back button returning the params to the current state.
|
|
5
|
-
* */
|
|
6
|
-
navigateInternal(url: string, replace?: boolean): void;
|
|
7
|
-
}
|
|
1
|
+
export interface INavigationHelper {
|
|
2
|
+
/**
|
|
3
|
+
* Navigates to an internal url using the router.
|
|
4
|
+
* @param replace Replace the url instead of adding to the history. This prevents the back button returning the params to the current state.
|
|
5
|
+
* */
|
|
6
|
+
navigateInternal(url: string, replace?: boolean): void;
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { IViewBase } from '../Views/IViewBase';
|
|
2
|
-
export declare enum NavigateLocation {
|
|
3
|
-
/** Navigating within the app. */
|
|
4
|
-
Internal = 0,
|
|
5
|
-
/** Navigating to another site / closing the browser. */
|
|
6
|
-
External = 1
|
|
7
|
-
}
|
|
8
|
-
export interface IPageLeaveHandler {
|
|
9
|
-
/**
|
|
10
|
-
* Called when the windows beforeunload event fires.
|
|
11
|
-
* @param view The currently active view.
|
|
12
|
-
* @param e beforeunload event.
|
|
13
|
-
*/
|
|
14
|
-
onWindowUnload(view: IViewBase | null, e: BeforeUnloadEvent): void;
|
|
15
|
-
/**
|
|
16
|
-
* Called when the user tries to leave the page, and viewbase has returned a message prompting the user if they want to leave.
|
|
17
|
-
* @param view The currently active view.
|
|
18
|
-
* @param prompt The prompt to display to the user.
|
|
19
|
-
* @param location If the user is nagivating within the app, or externally.
|
|
20
|
-
* @returns A boolean promise with a value indicating whether the user wants to leave the page.
|
|
21
|
-
*/
|
|
22
|
-
onLeavePage(view: IViewBase | null, prompt: string, location: NavigateLocation): Promise<boolean>;
|
|
23
|
-
}
|
|
1
|
+
import { IViewBase } from '../Views/IViewBase';
|
|
2
|
+
export declare enum NavigateLocation {
|
|
3
|
+
/** Navigating within the app. */
|
|
4
|
+
Internal = 0,
|
|
5
|
+
/** Navigating to another site / closing the browser. */
|
|
6
|
+
External = 1
|
|
7
|
+
}
|
|
8
|
+
export interface IPageLeaveHandler {
|
|
9
|
+
/**
|
|
10
|
+
* Called when the windows beforeunload event fires.
|
|
11
|
+
* @param view The currently active view.
|
|
12
|
+
* @param e beforeunload event.
|
|
13
|
+
*/
|
|
14
|
+
onWindowUnload(view: IViewBase | null, e: BeforeUnloadEvent): void;
|
|
15
|
+
/**
|
|
16
|
+
* Called when the user tries to leave the page, and viewbase has returned a message prompting the user if they want to leave.
|
|
17
|
+
* @param view The currently active view.
|
|
18
|
+
* @param prompt The prompt to display to the user.
|
|
19
|
+
* @param location If the user is nagivating within the app, or externally.
|
|
20
|
+
* @returns A boolean promise with a value indicating whether the user wants to leave the page.
|
|
21
|
+
*/
|
|
22
|
+
onLeavePage(view: IViewBase | null, prompt: string, location: NavigateLocation): Promise<boolean>;
|
|
23
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export var NavigateLocation;
|
|
2
|
-
(function (NavigateLocation) {
|
|
3
|
-
/** Navigating within the app. */
|
|
4
|
-
NavigateLocation[NavigateLocation["Internal"] = 0] = "Internal";
|
|
5
|
-
/** Navigating to another site / closing the browser. */
|
|
6
|
-
NavigateLocation[NavigateLocation["External"] = 1] = "External";
|
|
7
|
-
})(NavigateLocation || (NavigateLocation = {}));
|
|
1
|
+
export var NavigateLocation;
|
|
2
|
+
(function (NavigateLocation) {
|
|
3
|
+
/** Navigating within the app. */
|
|
4
|
+
NavigateLocation[NavigateLocation["Internal"] = 0] = "Internal";
|
|
5
|
+
/** Navigating to another site / closing the browser. */
|
|
6
|
+
NavigateLocation[NavigateLocation["External"] = 1] = "External";
|
|
7
|
+
})(NavigateLocation || (NavigateLocation = {}));
|