@ebertjendustries/cswrapper 1.0.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.
- package/README.md +1 -0
- package/dist/index.d.mts +787 -0
- package/dist/index.d.ts +787 -0
- package/dist/index.js +2147 -0
- package/dist/index.mjs +2037 -0
- package/package.json +58 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,787 @@
|
|
|
1
|
+
import React, { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { FormFieldProps } from '@cloudscape-design/components/form-field/interfaces';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { AlertProps, BoxProps, ButtonProps, DatePickerProps, MultiselectProps, SegmentedControlProps, SelectProps, TilesProps, LinkProps, HeaderProps, InputProps, StatusIndicatorProps, TextContentProps, TextareaProps, TimeInputProps, ToggleProps } from '@cloudscape-design/components';
|
|
5
|
+
import { CheckboxProps } from '@cloudscape-design/components/checkbox/interfaces';
|
|
6
|
+
import { OptionDefinition } from '@cloudscape-design/components/internal/components/option/interfaces';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* class for client-side Logging.
|
|
10
|
+
* Wraps console.log
|
|
11
|
+
*/
|
|
12
|
+
declare class Log {
|
|
13
|
+
private readonly prefix;
|
|
14
|
+
private readonly debugLogging;
|
|
15
|
+
constructor(prefix?: string);
|
|
16
|
+
static toReadableObjectString(object: any): string;
|
|
17
|
+
static toCompactReadableObjectString(object: any, dependencyCharLimit: number): string;
|
|
18
|
+
private static toObjectStr;
|
|
19
|
+
/**
|
|
20
|
+
* log at debugging level
|
|
21
|
+
*/
|
|
22
|
+
debug(msg: string, ...supportingDetails: any[]): void;
|
|
23
|
+
/**
|
|
24
|
+
* log at information level
|
|
25
|
+
*/
|
|
26
|
+
info(msg: string, ...supportingDetails: any[]): void;
|
|
27
|
+
/**
|
|
28
|
+
* log at warning level
|
|
29
|
+
*/
|
|
30
|
+
warn(msg: string, ...supportingDetails: any[]): void;
|
|
31
|
+
/**
|
|
32
|
+
* log at error level
|
|
33
|
+
*/
|
|
34
|
+
error(msg: string, ...supportingDetails: any[]): void;
|
|
35
|
+
object(prefixMsg: string, object: any): void;
|
|
36
|
+
effectStart(effectName: string, msg: string, dependencies: any[], dependencyCharLimit?: number): void;
|
|
37
|
+
effectEnd(effectName: string): void;
|
|
38
|
+
effect(effectName: string, msg: string): void;
|
|
39
|
+
/**
|
|
40
|
+
* creates a log message with some detailed information
|
|
41
|
+
* @param msgType type of message (debug, info, warn, error)
|
|
42
|
+
* @param msg the message as string
|
|
43
|
+
* @param supportingDetails details that should be logged
|
|
44
|
+
*/
|
|
45
|
+
private emitLogMessage;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
declare class FieldProperties {
|
|
49
|
+
key: string;
|
|
50
|
+
required?: boolean | undefined;
|
|
51
|
+
maxLength?: number | undefined;
|
|
52
|
+
minValue?: number | undefined;
|
|
53
|
+
maxValue?: number | undefined;
|
|
54
|
+
constructor(key: string, required?: boolean | undefined, maxLength?: number | undefined, minValue?: number | undefined, maxValue?: number | undefined);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare class EnumFactory<E> {
|
|
58
|
+
enumName: string;
|
|
59
|
+
values: E[];
|
|
60
|
+
constructor(enumName: string, values: E[]);
|
|
61
|
+
getEnumIndex(instance: E): number;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare enum MessageSeverity {
|
|
65
|
+
INFO = "INFO",
|
|
66
|
+
WARN = "WARN",
|
|
67
|
+
ERR = "ERR",
|
|
68
|
+
SUCCESS = "SUCCESS"
|
|
69
|
+
}
|
|
70
|
+
declare const MESSAGE_SEVERITY_FACTORY: EnumFactory<MessageSeverity>;
|
|
71
|
+
|
|
72
|
+
declare class MessageCodeTO {
|
|
73
|
+
static readonly CONTROLLER_ID_PROPS: FieldProperties;
|
|
74
|
+
static readonly HTTP_STATUS_CODE_PROPS: FieldProperties;
|
|
75
|
+
static readonly LOCAL_CODE_PROPS: FieldProperties;
|
|
76
|
+
static readonly MESSAGE_SEVERITY_PROPS: FieldProperties;
|
|
77
|
+
static readonly UNIQUE_CODE_PROPS: FieldProperties;
|
|
78
|
+
componentId: string;
|
|
79
|
+
httpStatusCode: number;
|
|
80
|
+
localCode: string;
|
|
81
|
+
messageSeverity: MessageSeverity;
|
|
82
|
+
uniqueCode: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
declare class MessageCTO {
|
|
86
|
+
static readonly TIMESTAMP_PROPS: FieldProperties;
|
|
87
|
+
static readonly DETAIL_MESSAGE_PROPS: FieldProperties;
|
|
88
|
+
static readonly CORRELATION_ID_PROPS: FieldProperties;
|
|
89
|
+
static readonly OPERATION_PROPS: FieldProperties;
|
|
90
|
+
code: MessageCodeTO;
|
|
91
|
+
timestamp: string;
|
|
92
|
+
detailMessage: string;
|
|
93
|
+
correlationId: string;
|
|
94
|
+
operation: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
interface ContentWithMessagesCTO<T> {
|
|
98
|
+
content: T | undefined;
|
|
99
|
+
messages: MessageCTO[];
|
|
100
|
+
}
|
|
101
|
+
declare function isContentWithMessages(object: any): boolean;
|
|
102
|
+
|
|
103
|
+
declare enum ControllerState {
|
|
104
|
+
UNMOUNTED = 0,
|
|
105
|
+
INITIALIZING = 1,
|
|
106
|
+
NORMAL = 2,
|
|
107
|
+
FATAL_ERROR = 3
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
interface UseMessagesHook {
|
|
111
|
+
messages: MessageWithDetailToggle[];
|
|
112
|
+
addMessages: (messages: ContentWithMessagesCTO<any>) => void;
|
|
113
|
+
clearMessages: () => void;
|
|
114
|
+
onDismissMessage: (message: MessageWithDetailToggle) => void;
|
|
115
|
+
onToggleMessageDetail: (message: MessageWithDetailToggle) => void;
|
|
116
|
+
}
|
|
117
|
+
type MessageWithDetailToggle = MessageCTO & {
|
|
118
|
+
showDetails: boolean;
|
|
119
|
+
};
|
|
120
|
+
declare function useMessages(LOGGER: Log): UseMessagesHook;
|
|
121
|
+
|
|
122
|
+
interface ModalState {
|
|
123
|
+
modalId?: string;
|
|
124
|
+
confirmFunction?: () => void;
|
|
125
|
+
show: (modalId: string, confirmFunction?: () => void) => void;
|
|
126
|
+
hide: (modalId: string) => void;
|
|
127
|
+
}
|
|
128
|
+
type RunFunction = <T>(service: Function, execute: () => Promise<ContentWithMessagesCTO<T>>, failureIsFatal?: boolean, resultHistory?: any) => Promise<RunFunctionResult<T>>;
|
|
129
|
+
declare class RunFunctionResult<T> {
|
|
130
|
+
success: boolean;
|
|
131
|
+
messages: MessageCTO[];
|
|
132
|
+
result?: T | undefined;
|
|
133
|
+
resultHistory?: any | undefined;
|
|
134
|
+
constructor(success: boolean, messages: MessageCTO[], result?: T | undefined, resultHistory?: any | undefined);
|
|
135
|
+
}
|
|
136
|
+
declare const fatalRunErrorFunction: (reason: any) => never;
|
|
137
|
+
interface UseControllerDisplayStateHook<DM> {
|
|
138
|
+
state: ControllerState;
|
|
139
|
+
setState: Dispatch<SetStateAction<ControllerState>>;
|
|
140
|
+
run: RunFunction;
|
|
141
|
+
isLoading: (service: Function) => boolean;
|
|
142
|
+
setDirty: (dirty: boolean) => void;
|
|
143
|
+
isDirty: () => boolean;
|
|
144
|
+
displayMode: DM;
|
|
145
|
+
enterDisplayMode: (mode: DM) => void;
|
|
146
|
+
modalState: ModalState;
|
|
147
|
+
}
|
|
148
|
+
interface BooleanStateIndication {
|
|
149
|
+
[key: string]: boolean;
|
|
150
|
+
}
|
|
151
|
+
declare function useControllerDisplayState<DM>(initialDisplayMode: DM, messages: UseMessagesHook, logger: Log): UseControllerDisplayStateHook<DM>;
|
|
152
|
+
|
|
153
|
+
type CommandFunction = () => void;
|
|
154
|
+
type InputChangedFunction<T> = (input: T) => void;
|
|
155
|
+
type PropertyChangeFunction = (propertyName: string, changedValue: any, automaticChange?: boolean) => void;
|
|
156
|
+
type MultiPropertyChangeFunction = (properties: {
|
|
157
|
+
[key: string]: any;
|
|
158
|
+
}, automaticChange?: boolean) => void;
|
|
159
|
+
|
|
160
|
+
declare enum ElementValidityLevel {
|
|
161
|
+
VALID = "VALID",
|
|
162
|
+
REQUIRED_VALUE_IS_NOT_PRESENT = "REQUIRED_VALUE_IS_NOT_PRESENT",
|
|
163
|
+
MAX_LENGTH_EXCEEDED = "MAX_LENGTH_EXCEEDED",
|
|
164
|
+
LOWER_BOUND_ONLY_TOO_SMALL = "LOWER_BOUND_ONLY_TOO_SMALL",
|
|
165
|
+
UPPER_BOUND_ONLY_TOO_BIG = "UPPER_BOUND_ONLY_TOO_BIG",
|
|
166
|
+
BOTH_BOUNDS_OUT_OF_BOUNDS = "BOTH_BOUNDS_OUT_OF_BOUNDS"
|
|
167
|
+
}
|
|
168
|
+
declare const ELEMENT_VALIDITY_LEVEL_FACTORY: EnumFactory<ElementValidityLevel>;
|
|
169
|
+
|
|
170
|
+
declare class LocalisationNamespace {
|
|
171
|
+
name: string;
|
|
172
|
+
constructor(name: string);
|
|
173
|
+
/**
|
|
174
|
+
*
|
|
175
|
+
* @param parts The parts. Call this with comma-separated args, e.g. createKey(arg1, arg2, arg3) or with array using following syntax:
|
|
176
|
+
* createKey(...[arg1, arg2, arg3]). DO NOT call it directly with an array!
|
|
177
|
+
* This is WRONG: createKey([arg1, arg2, arg3]). It will treat the array as single arg and call toString() on it.
|
|
178
|
+
*/
|
|
179
|
+
createKey(...parts: (string | any)[]): string;
|
|
180
|
+
}
|
|
181
|
+
declare const NSK_CONTENT: string;
|
|
182
|
+
|
|
183
|
+
type Indexable = {
|
|
184
|
+
[key: string]: any;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
interface IViewElementSpec {
|
|
188
|
+
readonly key: string;
|
|
189
|
+
readonly instanceId?: string;
|
|
190
|
+
getDataTestId(): string;
|
|
191
|
+
getLocalisationKey(): string;
|
|
192
|
+
getKeyHierarchy(): string[];
|
|
193
|
+
getValueValidityLevel(value: any): ElementValidityLevel;
|
|
194
|
+
}
|
|
195
|
+
declare abstract class ViewElementSpec implements IViewElementSpec {
|
|
196
|
+
readonly key: string;
|
|
197
|
+
readonly instanceId?: string | undefined;
|
|
198
|
+
parent?: IViewElementSpec;
|
|
199
|
+
ns: LocalisationNamespace;
|
|
200
|
+
private dataTestId;
|
|
201
|
+
private localisationKey;
|
|
202
|
+
private keyHierarchy;
|
|
203
|
+
protected constructor(key: string, instanceId?: string | undefined);
|
|
204
|
+
getDataTestId(): string;
|
|
205
|
+
getLocalisationKey(): string;
|
|
206
|
+
getKeyHierarchy(): string[];
|
|
207
|
+
abstract getValueValidityLevel(value: any): ElementValidityLevel;
|
|
208
|
+
}
|
|
209
|
+
type FieldValidatorFunctionType = (fieldSpec: IFieldSpec, value: any) => ElementValidityLevel;
|
|
210
|
+
interface IFieldSpec extends IViewElementSpec {
|
|
211
|
+
readonly required?: boolean;
|
|
212
|
+
readonly maxLength?: number;
|
|
213
|
+
readonly minValue?: number;
|
|
214
|
+
readonly maxValue?: number;
|
|
215
|
+
readonly customFieldValidator?: FieldValidatorFunctionType;
|
|
216
|
+
}
|
|
217
|
+
declare class FieldSpec extends ViewElementSpec implements IFieldSpec {
|
|
218
|
+
readonly required?: boolean | undefined;
|
|
219
|
+
readonly maxLength?: number | undefined;
|
|
220
|
+
readonly minValue?: number | undefined;
|
|
221
|
+
readonly maxValue?: number | undefined;
|
|
222
|
+
readonly customFieldValidator?: FieldValidatorFunctionType | undefined;
|
|
223
|
+
constructor(key: string, required?: boolean | undefined, maxLength?: number | undefined, minValue?: number | undefined, maxValue?: number | undefined, customFieldValidator?: FieldValidatorFunctionType | undefined, instanceId?: string);
|
|
224
|
+
static getTOValidityLevel<TO extends Indexable>(transportObject: TO, elements: IViewElementSpec[]): ElementValidityLevel;
|
|
225
|
+
static isTOValid<TO extends Indexable>(transportObject: TO, Elements: IViewElementSpec[]): boolean;
|
|
226
|
+
static debugLogElementValidityArray<TO extends Indexable>(elements: TO[], Elements: IViewElementSpec[]): void;
|
|
227
|
+
static debugLogElementValidity<TO extends Indexable>(element: TO, elementId: string, Elements: IViewElementSpec[]): void;
|
|
228
|
+
getValueValidityLevel(value: any): ElementValidityLevel;
|
|
229
|
+
private getMaxLength;
|
|
230
|
+
}
|
|
231
|
+
type ViewValidatorFunctionType<F extends Object> = (viewSpec: ViewSpec<F>, value: any) => ElementValidityLevel;
|
|
232
|
+
declare class ViewSpec<F extends Object> extends ViewElementSpec {
|
|
233
|
+
ns: LocalisationNamespace;
|
|
234
|
+
elements: F;
|
|
235
|
+
private readonly viewValidator;
|
|
236
|
+
private constructor();
|
|
237
|
+
static create<F extends Object>(key: string, ns: LocalisationNamespace, elementDefinition: (spec: ViewSpec<F>) => F, instanceId?: string, parent?: ViewSpec<any>, customViewValidator?: ViewValidatorFunctionType<F>): ViewSpec<F>;
|
|
238
|
+
addField(fieldSpec: FieldSpec): FieldSpec;
|
|
239
|
+
addFieldFromProps(fieldProps: FieldProperties, customFieldValidator?: FieldValidatorFunctionType, instanceId?: string): FieldSpec;
|
|
240
|
+
addView<FieldType extends Object>(viewSpecProvider: (parent: ViewSpec<any>, key: string, instanceId?: string) => ViewSpec<FieldType>, key: string, instanceId?: string): ViewSpec<FieldType>;
|
|
241
|
+
getAllElements(): IViewElementSpec[];
|
|
242
|
+
getValueValidityLevel(value: any): ElementValidityLevel;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
type LocalisedElements = {
|
|
246
|
+
[field: string]: LocalisedElements | any;
|
|
247
|
+
};
|
|
248
|
+
type FieldValidityLocalisationFunction = (fieldProps: FieldProperties | FieldSpec, validityLevel: ElementValidityLevel) => string | undefined;
|
|
249
|
+
type LocalisationVariableType = {
|
|
250
|
+
[name: string]: string | number | undefined;
|
|
251
|
+
};
|
|
252
|
+
interface LocalisedEnumDetails {
|
|
253
|
+
label: string | undefined;
|
|
254
|
+
description: string | undefined;
|
|
255
|
+
}
|
|
256
|
+
declare abstract class Localiser {
|
|
257
|
+
translate: Function;
|
|
258
|
+
ns: LocalisationNamespace;
|
|
259
|
+
protected constructor(translate: Function, ns: LocalisationNamespace);
|
|
260
|
+
abstract getFieldValidityLocalisationFunction(): FieldValidityLocalisationFunction;
|
|
261
|
+
abstract keyExists(key: string, alternateNs?: LocalisationNamespace): boolean;
|
|
262
|
+
abstract localiseKey(key: string, variables?: LocalisationVariableType, alternateNs?: LocalisationNamespace): string;
|
|
263
|
+
abstract localiseField(key: string, variables?: LocalisationVariableType, alternateNs?: LocalisationNamespace): LocalisedElements;
|
|
264
|
+
abstract getEnumLocalisation<E extends Object>(factory: EnumFactory<E>, instance: E): LocalisedEnumDetails;
|
|
265
|
+
getEnumLabel<E extends Object>(factory: EnumFactory<E>, instance: E): string;
|
|
266
|
+
getAllEnumLabels<E extends Object>(factory: EnumFactory<E>): string[];
|
|
267
|
+
abstract language(): string;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
declare class FromPropsHelper {
|
|
271
|
+
static getBasicProps: (props: CSReadOnlyFormProps) => {
|
|
272
|
+
localisationObject: LocalisedElements;
|
|
273
|
+
uniqueId: string;
|
|
274
|
+
};
|
|
275
|
+
static usesFormField: (props: CSReadOnlyFormProps) => boolean;
|
|
276
|
+
static getLocalisedErrorText: (props: CSReadOnlyFormProps, value: any, localiseValidity: FieldValidityLocalisationFunction) => React.ReactNode | string;
|
|
277
|
+
static sanitizeValueToString: (value: any) => string;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Use for read-only form elements.
|
|
281
|
+
*/
|
|
282
|
+
interface CSReadOnlyFormProps {
|
|
283
|
+
/** The central properties of the field, used for identification and localization, especially also in tests. */
|
|
284
|
+
fieldSpec: IFieldSpec;
|
|
285
|
+
localiser: Localiser;
|
|
286
|
+
localisationVariables?: any;
|
|
287
|
+
alternateNs?: LocalisationNamespace;
|
|
288
|
+
childrenWrapper?: (children: React.ReactNode) => React.ReactNode;
|
|
289
|
+
preventOverflow?: boolean;
|
|
290
|
+
inlineLabel?: boolean;
|
|
291
|
+
/**
|
|
292
|
+
* Only use this if you want to use any non-localised Elements from {@link FormFieldProps} or you need to create
|
|
293
|
+
* dynamic localised texts that use variables. If you only want to localise the FormField component props, you can do
|
|
294
|
+
* this with the localiser prop.
|
|
295
|
+
*/
|
|
296
|
+
formField?: FormFieldProps;
|
|
297
|
+
customRef?: any;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Use for read-write form elements.
|
|
301
|
+
*/
|
|
302
|
+
interface CSFormProps extends CSReadOnlyFormProps {
|
|
303
|
+
/** Simplifies use of onChange by extracting the relevant value and allowing to listen to changes via a {@link PropertyChangeFunction}. */
|
|
304
|
+
onChangeValue: PropertyChangeFunction;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
interface CSViewProps<ElementType extends Object> {
|
|
308
|
+
viewSpec: ViewSpec<ElementType>;
|
|
309
|
+
localiser: Localiser;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
type CSVEnumRatingViewElements = {
|
|
313
|
+
rating: FieldSpec;
|
|
314
|
+
boxRatingName: FieldSpec;
|
|
315
|
+
};
|
|
316
|
+
declare const CSV_ENUM_RATING_VIEW_SPEC: (parent: ViewSpec<any>, key: string, instanceId?: string) => ViewSpec<CSVEnumRatingViewElements>;
|
|
317
|
+
interface CSVEnumRatingViewProps<E extends Object> extends CSViewProps<CSVEnumRatingViewElements> {
|
|
318
|
+
onChangeValue: PropertyChangeFunction;
|
|
319
|
+
factory: EnumFactory<E>;
|
|
320
|
+
selectedEnum: E | undefined;
|
|
321
|
+
disabled?: boolean;
|
|
322
|
+
toOrderNumber?: (value: E) => number;
|
|
323
|
+
}
|
|
324
|
+
declare function getEnumRatingValues<E extends Object>(factory: EnumFactory<E>, toOrderNumber?: (value: E) => number): E[];
|
|
325
|
+
declare function getEnumRatingLabel<E extends Object>(enumInstance: E, instanceId?: string): string;
|
|
326
|
+
declare function CSVEnumRatingView<E extends Object>(props: CSVEnumRatingViewProps<E>): react_jsx_runtime.JSX.Element;
|
|
327
|
+
|
|
328
|
+
type CSVNoItemsViewElements = {
|
|
329
|
+
boxHeading: FieldSpec;
|
|
330
|
+
boxBody: FieldSpec;
|
|
331
|
+
};
|
|
332
|
+
declare const CSV_NO_ITEMS_VIEW_SPEC: (ns: LocalisationNamespace) => ViewSpec<CSVNoItemsViewElements>;
|
|
333
|
+
interface CSVNoItemsViewProps<EntityType extends Object> extends CSViewProps<CSVNoItemsViewElements> {
|
|
334
|
+
itemType: EntityType;
|
|
335
|
+
factory: EnumFactory<EntityType>;
|
|
336
|
+
headingText?: string;
|
|
337
|
+
bodyText?: string;
|
|
338
|
+
bodyNode?: React.ReactNode;
|
|
339
|
+
}
|
|
340
|
+
declare function CSVNoItemsView<EntityType extends Object>(props: CSVNoItemsViewProps<EntityType>): react_jsx_runtime.JSX.Element;
|
|
341
|
+
|
|
342
|
+
interface IPrice<CurrencyType extends Object> {
|
|
343
|
+
priceInCents: number;
|
|
344
|
+
currency: CurrencyType;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
type CSVPriceInputViewElements = {
|
|
348
|
+
inputPrice: FieldSpec;
|
|
349
|
+
selectCurrency: FieldSpec;
|
|
350
|
+
boxPriceDisplay: FieldSpec;
|
|
351
|
+
};
|
|
352
|
+
declare const CSV_PRICE_INPUT_VIEW_SPEC: (parent: ViewSpec<any>, key: string) => ViewSpec<CSVPriceInputViewElements>;
|
|
353
|
+
interface CSVPriceInputViewProps<CurrencyType extends Object> extends CSViewProps<CSVPriceInputViewElements> {
|
|
354
|
+
defaultCurrency: CurrencyType;
|
|
355
|
+
currencyFactory: EnumFactory<CurrencyType>;
|
|
356
|
+
value: IPrice<CurrencyType> | undefined;
|
|
357
|
+
label?: string;
|
|
358
|
+
disabled?: boolean;
|
|
359
|
+
onChange: PropertyChangeFunction;
|
|
360
|
+
expandToViewport?: boolean;
|
|
361
|
+
}
|
|
362
|
+
declare function CSVPriceInputView<CurrencyType extends Object>(props: CSVPriceInputViewProps<CurrencyType>): react_jsx_runtime.JSX.Element;
|
|
363
|
+
|
|
364
|
+
type CSVSearchFilterViewElements = {
|
|
365
|
+
buttonSearch: FieldSpec;
|
|
366
|
+
inputSearch: FieldSpec;
|
|
367
|
+
};
|
|
368
|
+
declare const CSV_SEARCH_FILTER_VIEW_SPEC: (parent: ViewSpec<any>, key: string) => ViewSpec<CSVSearchFilterViewElements>;
|
|
369
|
+
interface CSVSearchFilterViewProps extends CSViewProps<CSVSearchFilterViewElements> {
|
|
370
|
+
loading: boolean;
|
|
371
|
+
searchDisabled: boolean;
|
|
372
|
+
searchString: string;
|
|
373
|
+
onChangeValue: PropertyChangeFunction;
|
|
374
|
+
onConfirmSearch: CommandFunction;
|
|
375
|
+
inputSearch?: string | React.ReactNode;
|
|
376
|
+
buttonSearch?: string | React.ReactNode;
|
|
377
|
+
}
|
|
378
|
+
declare function CSVSearchFilterView(props: CSVSearchFilterViewProps): react_jsx_runtime.JSX.Element;
|
|
379
|
+
|
|
380
|
+
type CSVTextPromptModalViewElements = {
|
|
381
|
+
headerHeading: FieldSpec;
|
|
382
|
+
boxBodyText: FieldSpec;
|
|
383
|
+
buttonPrimary: FieldSpec;
|
|
384
|
+
buttonSecondary: FieldSpec;
|
|
385
|
+
};
|
|
386
|
+
declare const CSV_TEXT_PROMPT_MODAL_VIEW_SPEC: (parent: ViewSpec<any>, key: string) => ViewSpec<CSVTextPromptModalViewElements>;
|
|
387
|
+
interface CSVTextPromptModalViewProps extends CSViewProps<CSVTextPromptModalViewElements> {
|
|
388
|
+
visible: boolean;
|
|
389
|
+
onDismiss: () => void;
|
|
390
|
+
onPrimaryAction: () => void;
|
|
391
|
+
onSecondaryAction?: () => void;
|
|
392
|
+
headerHeading?: string | React.ReactNode;
|
|
393
|
+
boxBodyText?: string | React.ReactNode;
|
|
394
|
+
buttonPrimary?: string | React.ReactNode;
|
|
395
|
+
buttonSecondary?: string | React.ReactNode;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* A simple modal with header and body text as well as up to two action buttons: primary and secondary.
|
|
399
|
+
*
|
|
400
|
+
* @param props The properties
|
|
401
|
+
* @returns The component
|
|
402
|
+
*/
|
|
403
|
+
declare function CSVTextPromptModalView(props: CSVTextPromptModalViewProps): react_jsx_runtime.JSX.Element;
|
|
404
|
+
|
|
405
|
+
declare const REST_CLIENT_LOGGER: Log;
|
|
406
|
+
interface IRestClient {
|
|
407
|
+
get<T>(endpoint: string, operation?: string, header?: any): Promise<ContentWithMessagesCTO<T>>;
|
|
408
|
+
put<T>(endpoint: string, payload: object | string, operation?: string): Promise<ContentWithMessagesCTO<T>>;
|
|
409
|
+
post<T>(endpoint: string, payload: object | string | null, operation?: string): Promise<ContentWithMessagesCTO<T>>;
|
|
410
|
+
del<T>(endpoint: string, payload?: object, operation?: string): Promise<ContentWithMessagesCTO<T>>;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Factory function to create a new default rest client.
|
|
414
|
+
*
|
|
415
|
+
* Mostly exist to ensure we can mock creation of the rest client in tests.
|
|
416
|
+
*/
|
|
417
|
+
declare function createRestClient(): IRestClient;
|
|
418
|
+
/**
|
|
419
|
+
* A basic REST client, based on fetch API that offers get, put, post, del.
|
|
420
|
+
*/
|
|
421
|
+
declare class RestClient implements IRestClient {
|
|
422
|
+
baseUrl: string;
|
|
423
|
+
prepareFetchConfig(method: string, payload: object | string | null, header?: any | null): {};
|
|
424
|
+
/**
|
|
425
|
+
* Creates a new REST client.
|
|
426
|
+
* @param baseUrl base URL, so client can be called with relative URLs.
|
|
427
|
+
*/
|
|
428
|
+
constructor(baseUrl?: string);
|
|
429
|
+
/**
|
|
430
|
+
* Make a GET request on the specified endpoint
|
|
431
|
+
*
|
|
432
|
+
* @param {string} endpoint the endpoint relative to the baseUrl with a preceeding slash. e.g. '/users'.
|
|
433
|
+
* @param {string} operation the operation name for logging.
|
|
434
|
+
* @param {string} headers the HTTP headers to pass.
|
|
435
|
+
*/
|
|
436
|
+
get<T>(endpoint: string, operation?: string, headers?: any): Promise<ContentWithMessagesCTO<T>>;
|
|
437
|
+
/**
|
|
438
|
+
* Make a PUT request on the specified endpoint
|
|
439
|
+
*
|
|
440
|
+
* @param {string} endpoint the endpoint relative to the baseUrl with a preceeding slash. e.g. '/users'.
|
|
441
|
+
* @param {object} payload the request payload as object.
|
|
442
|
+
* @param {string} operation the operation name for logging.
|
|
443
|
+
*/
|
|
444
|
+
put<T>(endpoint: string, payload: object | string, operation?: string): Promise<ContentWithMessagesCTO<T>>;
|
|
445
|
+
/**
|
|
446
|
+
* Make a POST request on the specified endpoint
|
|
447
|
+
*
|
|
448
|
+
* @param {string} endpoint the endpoint relative to the baseUrl with a preceeding slash. e.g. '/users'.
|
|
449
|
+
* @param {object} payload the request payload as object.
|
|
450
|
+
* @param {string} operation the operation name for logging.
|
|
451
|
+
*/
|
|
452
|
+
post<T>(endpoint: string, payload: object | string | null, operation?: string): Promise<ContentWithMessagesCTO<T>>;
|
|
453
|
+
/**
|
|
454
|
+
* Make a DELETE request on the specified endpoint
|
|
455
|
+
*
|
|
456
|
+
* @param {string} endpoint the endpoint relative to the baseUrl with a preceeding slash. e.g. '/users'.
|
|
457
|
+
* @param {object} payload the request payload as object.
|
|
458
|
+
* @param {string} operation the operation name for logging.
|
|
459
|
+
*/
|
|
460
|
+
del<T>(endpoint: string, payload?: object, operation?: string): Promise<ContentWithMessagesCTO<T>>;
|
|
461
|
+
callApi<T>(method: string, endpoint?: string, payload?: object | string | null, operation?: string, header?: any | null): Promise<ContentWithMessagesCTO<T>>;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
type IdType = number | string | undefined;
|
|
465
|
+
declare class ObjectWithId {
|
|
466
|
+
id: IdType;
|
|
467
|
+
static idToString: (objectWithId: ObjectWithId) => string;
|
|
468
|
+
static toObjectWithId: <T>(array: T[], idExtractor: (object: T) => IdType) => (T & ObjectWithId)[];
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
declare const QUERY_START: string;
|
|
472
|
+
declare const QUERY_SEP: string;
|
|
473
|
+
type QueryKeyValueParams = {
|
|
474
|
+
[key: string]: string;
|
|
475
|
+
};
|
|
476
|
+
declare class QueryParamHelper {
|
|
477
|
+
static appendQueryParam(query: string, key: string, value: any): string;
|
|
478
|
+
static getQueryParams(queryString: string): QueryKeyValueParams;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
interface UseAWSUIRefHook {
|
|
482
|
+
customRef: any;
|
|
483
|
+
focus: () => void;
|
|
484
|
+
scrollToView: () => void;
|
|
485
|
+
scrollToViewRef: (element: any) => void;
|
|
486
|
+
}
|
|
487
|
+
declare function useAWSUIRef(): UseAWSUIRefHook;
|
|
488
|
+
|
|
489
|
+
interface UseTOChangeHandlerHook {
|
|
490
|
+
onPropertyChange: PropertyChangeFunction;
|
|
491
|
+
onPropertyChangeMulti: (properties: Indexable, automaticChange?: boolean) => void;
|
|
492
|
+
}
|
|
493
|
+
interface UseTOArrayChangeHandlerHook {
|
|
494
|
+
onChangeElement: <T>(element: T | undefined, properties: Indexable, automaticChange?: boolean) => void;
|
|
495
|
+
onRemoveElements: <T>(removedElements: T[]) => void;
|
|
496
|
+
onAddElements: <T>(newElements: T[]) => void;
|
|
497
|
+
}
|
|
498
|
+
type ArrayChangeHandler<T> = (changedArrayElements: T[], newArrayContent: T[]) => void;
|
|
499
|
+
type ArrayNotifications<T> = {
|
|
500
|
+
onChange?: ArrayChangeHandler<T>;
|
|
501
|
+
onAdd?: ArrayChangeHandler<T>;
|
|
502
|
+
onRemove?: ArrayChangeHandler<T>;
|
|
503
|
+
};
|
|
504
|
+
type ChangeHandler<T> = (changedObject: T, propertyName: string, changedValue: any) => void;
|
|
505
|
+
type Notifications<T> = {
|
|
506
|
+
onChange?: ChangeHandler<T>;
|
|
507
|
+
};
|
|
508
|
+
declare function useTOChangeHandler<T extends Indexable | undefined>(logger: Log, toName: string, setTOState: Dispatch<SetStateAction<T>>, notifications?: Notifications<T>, setDirty?: (dirty: boolean) => void): UseTOChangeHandlerHook;
|
|
509
|
+
declare const singleChangeHandlerToMulti: (onPropertyChangeMulti: (properties: Indexable, automaticChange?: boolean) => void) => PropertyChangeFunction;
|
|
510
|
+
declare function useTOArrayChangeHandler<T>(logger: Log, toName: string, setArrayState: Dispatch<SetStateAction<T[]>>, handlers: ArrayNotifications<T>, setDirty?: (dirty: boolean) => void): UseTOArrayChangeHandlerHook;
|
|
511
|
+
|
|
512
|
+
interface CSAlertProps extends CSReadOnlyFormProps, AlertProps {
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* Represents a {@link Alert} with extra features.
|
|
516
|
+
*/
|
|
517
|
+
declare function CSAlert(props: CSAlertProps): react_jsx_runtime.JSX.Element;
|
|
518
|
+
|
|
519
|
+
interface CSBoxProps extends CSReadOnlyFormProps, BoxProps {
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Represents a {@link Box} with extra features.
|
|
523
|
+
*/
|
|
524
|
+
declare function CSBox(props: CSBoxProps): react_jsx_runtime.JSX.Element;
|
|
525
|
+
|
|
526
|
+
interface CSButtonProps extends CSReadOnlyFormProps, ButtonProps {
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Represents a {@link Button} with extra features.
|
|
530
|
+
*/
|
|
531
|
+
declare function CSButton(props: CSButtonProps): react_jsx_runtime.JSX.Element;
|
|
532
|
+
|
|
533
|
+
interface CSCheckboxProps extends CSFormProps, CheckboxProps {
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Represents a {@link Checkbox} with extra features.
|
|
537
|
+
*/
|
|
538
|
+
declare function CSCheckbox(props: CSCheckboxProps): react_jsx_runtime.JSX.Element;
|
|
539
|
+
|
|
540
|
+
interface CSDatePickerProps extends CSFormProps, Omit<DatePickerProps, 'value'> {
|
|
541
|
+
value: string | undefined | null;
|
|
542
|
+
}
|
|
543
|
+
declare function CSDatePicker(props: CSDatePickerProps): react_jsx_runtime.JSX.Element;
|
|
544
|
+
|
|
545
|
+
interface CSEnumMultiselectProps<E extends Object> extends CSFormProps, Omit<MultiselectProps, 'selectedOptions'> {
|
|
546
|
+
selectedEnums: E[];
|
|
547
|
+
factory: EnumFactory<E>;
|
|
548
|
+
enforceSelection?: boolean;
|
|
549
|
+
}
|
|
550
|
+
declare function CSEnumMultiselect<E extends Object>(props: CSEnumMultiselectProps<E>): react_jsx_runtime.JSX.Element;
|
|
551
|
+
|
|
552
|
+
interface CSEnumSegmentedControlProps<E extends Object> extends CSFormProps, Omit<SegmentedControlProps, 'selectedId'> {
|
|
553
|
+
selectedEnum: E | undefined;
|
|
554
|
+
factory: EnumFactory<E>;
|
|
555
|
+
exclude?: E[];
|
|
556
|
+
}
|
|
557
|
+
declare function CSEnumSegmentedControl<E extends Object>(props: CSEnumSegmentedControlProps<E>): react_jsx_runtime.JSX.Element;
|
|
558
|
+
|
|
559
|
+
interface CSEnumSelectProps<E extends Object> extends CSFormProps, Omit<SelectProps, 'selectedOption'> {
|
|
560
|
+
selectedEnum: E | undefined;
|
|
561
|
+
factory: EnumFactory<E>;
|
|
562
|
+
exclude?: E[];
|
|
563
|
+
}
|
|
564
|
+
declare function CSEnumSelect<E extends Object>(props: CSEnumSelectProps<E>): react_jsx_runtime.JSX.Element;
|
|
565
|
+
|
|
566
|
+
interface CSEnumTilesProps<E extends Object> extends CSFormProps, Omit<TilesProps, 'value'> {
|
|
567
|
+
selectedEnum: E | undefined;
|
|
568
|
+
factory: EnumFactory<E>;
|
|
569
|
+
exclude?: E[];
|
|
570
|
+
}
|
|
571
|
+
declare function CSEnumTiles<E extends Object>(props: CSEnumTilesProps<E>): react_jsx_runtime.JSX.Element;
|
|
572
|
+
|
|
573
|
+
interface CSLinkProps extends CSReadOnlyFormProps, LinkProps {
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Represents a {@link Link} with extra features.
|
|
577
|
+
*/
|
|
578
|
+
declare function CSLink(props: CSLinkProps): react_jsx_runtime.JSX.Element;
|
|
579
|
+
interface CSExternalLinkProps extends CSLinkProps {
|
|
580
|
+
link: string;
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Represents a {@link Link} that opens a new external tab.
|
|
584
|
+
*/
|
|
585
|
+
declare function CSExternalLink(props: CSExternalLinkProps): react_jsx_runtime.JSX.Element;
|
|
586
|
+
|
|
587
|
+
declare const FORM_FIELD_ID_SUFFIX: string;
|
|
588
|
+
interface CSFormFieldProps extends CSReadOnlyFormProps {
|
|
589
|
+
/** The children embedded within the form field, typically a single form component. */
|
|
590
|
+
children: React.ReactNode;
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* Represents a {@link FormField} with extra features. First of all, if the given props do not contain any form-field
|
|
594
|
+
* props, only the child component is returned, not wrapped in a FormField.
|
|
595
|
+
*
|
|
596
|
+
* It also passes on any localization-related props and gives the form field a data-testid.
|
|
597
|
+
*/
|
|
598
|
+
declare function CSFormField(props: CSFormFieldProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
599
|
+
|
|
600
|
+
interface CSHeaderProps extends CSReadOnlyFormProps, HeaderProps {
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* Represents a {@link Header} with extra features.
|
|
604
|
+
*/
|
|
605
|
+
declare function CSHeader(props: CSHeaderProps): react_jsx_runtime.JSX.Element;
|
|
606
|
+
|
|
607
|
+
interface CSInputProps extends CSFormProps, Omit<InputProps, 'value'> {
|
|
608
|
+
value: string | undefined | null;
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* Represents an {@link Input} for generic data with extra features such as generic validation of input.
|
|
612
|
+
*/
|
|
613
|
+
declare function CSInput(props: CSInputProps): react_jsx_runtime.JSX.Element;
|
|
614
|
+
|
|
615
|
+
interface CSMultiselectProps extends CSFormProps, MultiselectProps {
|
|
616
|
+
enforceSelection?: boolean;
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Represents a {@link Multiselect} with extra features.
|
|
620
|
+
*/
|
|
621
|
+
declare function CSMultiselect(props: CSMultiselectProps): react_jsx_runtime.JSX.Element;
|
|
622
|
+
|
|
623
|
+
interface CSNumericInputProps extends CSFormProps, Omit<InputProps, 'value'> {
|
|
624
|
+
value: number | undefined | null;
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* Represents an {@link Input} for numeric values with extra features such as generic validation of input.
|
|
628
|
+
*/
|
|
629
|
+
declare function CSNumericInput(props: CSNumericInputProps): react_jsx_runtime.JSX.Element;
|
|
630
|
+
|
|
631
|
+
interface CSSegmentedControlProps extends CSFormProps, SegmentedControlProps {
|
|
632
|
+
}
|
|
633
|
+
declare function CSSegmentedControl(props: CSSegmentedControlProps): react_jsx_runtime.JSX.Element;
|
|
634
|
+
|
|
635
|
+
interface CSSelectProps extends CSFormProps, SelectProps {
|
|
636
|
+
}
|
|
637
|
+
/**
|
|
638
|
+
* Represents a {@link Select} with extra features.
|
|
639
|
+
*/
|
|
640
|
+
declare function CSSelect(props: CSSelectProps): react_jsx_runtime.JSX.Element;
|
|
641
|
+
|
|
642
|
+
interface CSStatusIndicatorProps extends CSReadOnlyFormProps, StatusIndicatorProps {
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* Represents a {@link StatusIndicator} with extra features.
|
|
646
|
+
*/
|
|
647
|
+
declare function CSStatusIndicator(props: CSStatusIndicatorProps): react_jsx_runtime.JSX.Element;
|
|
648
|
+
|
|
649
|
+
interface CSTextContentProps extends CSReadOnlyFormProps, TextContentProps {
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Represents an {@link TextContent} for generic data with extra features such as generic validation of input.
|
|
653
|
+
*/
|
|
654
|
+
declare function CSTextContent(props: CSTextContentProps): react_jsx_runtime.JSX.Element;
|
|
655
|
+
|
|
656
|
+
interface CSTextareaProps extends CSFormProps, Omit<TextareaProps, 'value'> {
|
|
657
|
+
value: string | undefined | null;
|
|
658
|
+
}
|
|
659
|
+
/**
|
|
660
|
+
* Represents an {@link Textarea} for generic data with extra features such as generic validation of input.
|
|
661
|
+
*/
|
|
662
|
+
declare function CSTextarea(props: CSTextareaProps): react_jsx_runtime.JSX.Element;
|
|
663
|
+
|
|
664
|
+
interface CSTimeInputProps extends CSFormProps, TimeInputProps {
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* Represents a {@link TimeInput} with extra features.
|
|
668
|
+
*/
|
|
669
|
+
declare function CSTimeInput(props: CSTimeInputProps): react_jsx_runtime.JSX.Element;
|
|
670
|
+
|
|
671
|
+
interface CSToggleProps extends CSFormProps, ToggleProps {
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* Represents a {@link Toggle} with extra features.
|
|
675
|
+
*/
|
|
676
|
+
declare function CSToggle(props: CSToggleProps): react_jsx_runtime.JSX.Element;
|
|
677
|
+
|
|
678
|
+
interface CSPropsType extends CSReadOnlyFormProps {
|
|
679
|
+
children?: any;
|
|
680
|
+
preventOverflow?: boolean;
|
|
681
|
+
inlineLabel?: boolean;
|
|
682
|
+
}
|
|
683
|
+
declare class ChildUtils {
|
|
684
|
+
static getChildren: <P extends CSPropsType>(props: P, localisationObject: LocalisedElements) => {
|
|
685
|
+
children: any;
|
|
686
|
+
formProps: any;
|
|
687
|
+
};
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
declare class DateUtils {
|
|
691
|
+
static dateAsString(date: Date): string;
|
|
692
|
+
static dateAsDateTimeString(date: Date, language: string): string;
|
|
693
|
+
static nextSundayAt(hour: number, minute: number, second: number): Date;
|
|
694
|
+
static getCurrentUserTimezone(): string;
|
|
695
|
+
static dateTimeAsUTCISO8601String(date: Date): string;
|
|
696
|
+
static currentDateTimeAsUTCISO8601String(): string;
|
|
697
|
+
static currentDateAsISO8601String(): string;
|
|
698
|
+
static toFormattedLocalizedDate(locale: string, inputInUTCISO8601: string, timezone: string): string;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
declare function FixedWidth(props: {
|
|
702
|
+
minWidth: string;
|
|
703
|
+
maxWidth: string;
|
|
704
|
+
children: React.JSX.Element;
|
|
705
|
+
}): react_jsx_runtime.JSX.Element;
|
|
706
|
+
|
|
707
|
+
declare class LocalStorageService {
|
|
708
|
+
static getItemStringArrayWithDefault(key: string, defaultValue: string[]): string[];
|
|
709
|
+
static getItemEnumArrayWithDefault<T extends {
|
|
710
|
+
[key: string]: string;
|
|
711
|
+
}>(enumClass: T, key: string, defaultValue: T[]): any[];
|
|
712
|
+
static setItemEnumArray<T extends {
|
|
713
|
+
[key: number]: string;
|
|
714
|
+
}>(key: string, value: T[]): void;
|
|
715
|
+
static setItemStringArray(key: string, value: string[]): void;
|
|
716
|
+
static getItemWithDefault(key: string, defaultValue: string): string;
|
|
717
|
+
static setItem(key: string, value: string): void | null;
|
|
718
|
+
static clear(): void;
|
|
719
|
+
static setObject(key: string, value: any): void | null;
|
|
720
|
+
static getObjectWithDefault(key: string, defaultValue: any): any;
|
|
721
|
+
private static safeGetItem;
|
|
722
|
+
private static safeSetItem;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
declare const TECHNICAL_CONTROLLER_ID: string;
|
|
726
|
+
declare const NO_HTTP_CODE: number;
|
|
727
|
+
declare class MessageService {
|
|
728
|
+
static getResponseTOWithMessagesFromUnknownResponse<T>(json: any, op: string, status: number): ContentWithMessagesCTO<T>;
|
|
729
|
+
static getSuccessContentWithMessagesCTO<T>(json: any, op: string): ContentWithMessagesCTO<T>;
|
|
730
|
+
static createContentWithSuccessMessage: (operation: string, message: string) => ContentWithMessagesCTO<any>;
|
|
731
|
+
static createContentWithoutMessages: (content: any) => ContentWithMessagesCTO<any>;
|
|
732
|
+
static createContentWithInfoMessage: (operation: string, message: string) => ContentWithMessagesCTO<any>;
|
|
733
|
+
static createGenericErrorMessageTO: (httpStatusCode: number, operation: string) => ContentWithMessagesCTO<any>;
|
|
734
|
+
static createCriticalErrorFrontendProcessingMessageTO: (operation: string, message: string) => MessageCTO;
|
|
735
|
+
static isAPIClientCallError: (httpStatusCode: number) => boolean;
|
|
736
|
+
static isBackendError: (httpStatusCode: number) => boolean;
|
|
737
|
+
private static createContentWithMessage;
|
|
738
|
+
private static createMessageTO;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
declare class PriceUtils {
|
|
742
|
+
static getFormattedPrice: <CurrencyType extends Object>(locale: string, price: IPrice<CurrencyType>) => string;
|
|
743
|
+
static sumPrices: <CurrencyType extends Object>(prices: IPrice<CurrencyType>[], defaultCurrency: CurrencyType) => IPrice<CurrencyType>;
|
|
744
|
+
static getCurrenciesFromPrices: <CurrencyType extends Object>(prices: IPrice<CurrencyType>[]) => Set<CurrencyType>;
|
|
745
|
+
static getPriceValidityLevel: <CurrencyType extends Object>(spec: ViewSpec<CSVPriceInputViewElements>, value: IPrice<CurrencyType>) => ElementValidityLevel;
|
|
746
|
+
static parseFormattedPrice: <CurrencyType extends Object>(locale: string, formattedPrice: string, currency: CurrencyType) => IPrice<CurrencyType>;
|
|
747
|
+
static parseFormattedPriceWithCurrency: <CurrencyType extends Object>(locale: string, formattedPrice: string, currencySymbolMapping: {
|
|
748
|
+
[key: string]: string;
|
|
749
|
+
}) => IPrice<CurrencyType>;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
declare class SelectHelper {
|
|
753
|
+
static singleSelectOptionWithId: <T extends ObjectWithId>(objects: T[], selectedObjectId: IdType | undefined, toOptionDefinition: (object: T) => OptionDefinition) => {
|
|
754
|
+
options: OptionDefinition[];
|
|
755
|
+
selectedOption: OptionDefinition | null;
|
|
756
|
+
};
|
|
757
|
+
static singleSelectOption: <T extends ObjectWithId>(objects: T[], selectedObject: T | undefined, toOptionDefinition: (object: T) => OptionDefinition) => {
|
|
758
|
+
options: OptionDefinition[];
|
|
759
|
+
selectedOption: OptionDefinition | null;
|
|
760
|
+
};
|
|
761
|
+
static singleSelectEnum: <E extends Object>(enumFactory: EnumFactory<E>, selectedEnum: E | undefined, localiser: Localiser, exclude?: E[]) => {
|
|
762
|
+
options: OptionDefinition[];
|
|
763
|
+
selectedOption: OptionDefinition | null;
|
|
764
|
+
};
|
|
765
|
+
static multiSelectOptions: <T extends ObjectWithId>(objects: T[], selectedObjects: T[], toOptionDefinition: (object: T) => OptionDefinition) => {
|
|
766
|
+
options: OptionDefinition[];
|
|
767
|
+
selectedOptions: OptionDefinition[];
|
|
768
|
+
};
|
|
769
|
+
static multiSelectEnums: <E extends Object>(enumFactory: EnumFactory<E>, selectedEnums: E[], localiser: Localiser) => {
|
|
770
|
+
options: OptionDefinition[];
|
|
771
|
+
selectedOptions: OptionDefinition[];
|
|
772
|
+
};
|
|
773
|
+
private static getSelectedOptions;
|
|
774
|
+
private static getSelectedEnumOptions;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
declare const indexRangeArray: (length: number) => number[];
|
|
778
|
+
declare function filterArrayByIndices<T>(items: T[], indices: number[]): T[];
|
|
779
|
+
declare function sortArrayByIndices<T>(items: T[], indices: number[]): T[];
|
|
780
|
+
declare const sleep: (delaySeconds: number) => Promise<unknown>;
|
|
781
|
+
|
|
782
|
+
declare const openInNewTab: (link: string) => void;
|
|
783
|
+
declare const warnWhenTabIsClosed: (isDirty?: () => boolean) => () => void;
|
|
784
|
+
|
|
785
|
+
declare const useHotkey: (key: string, shift: boolean, ctrl: boolean, alt: boolean, callback: Function, node?: null) => void;
|
|
786
|
+
|
|
787
|
+
export { type BooleanStateIndication, CSAlert, CSBox, CSButton, CSCheckbox, CSDatePicker, CSEnumMultiselect, CSEnumSegmentedControl, CSEnumSelect, CSEnumTiles, CSExternalLink, CSFormField, type CSFormProps, CSHeader, CSInput, CSLink, CSMultiselect, CSNumericInput, type CSReadOnlyFormProps, CSSegmentedControl, CSSelect, CSStatusIndicator, CSTextContent, CSTextarea, CSTimeInput, CSToggle, CSVEnumRatingView, type CSVEnumRatingViewElements, CSVNoItemsView, type CSVNoItemsViewElements, CSVPriceInputView, type CSVPriceInputViewElements, CSVSearchFilterView, type CSVSearchFilterViewElements, CSVTextPromptModalView, type CSVTextPromptModalViewElements, type CSVTextPromptModalViewProps, CSV_ENUM_RATING_VIEW_SPEC, CSV_NO_ITEMS_VIEW_SPEC, CSV_PRICE_INPUT_VIEW_SPEC, CSV_SEARCH_FILTER_VIEW_SPEC, CSV_TEXT_PROMPT_MODAL_VIEW_SPEC, type CSViewProps, ChildUtils, type CommandFunction, type ContentWithMessagesCTO, ControllerState, DateUtils, ELEMENT_VALIDITY_LEVEL_FACTORY, ElementValidityLevel, EnumFactory, FORM_FIELD_ID_SUFFIX, FieldProperties, FieldSpec, type FieldValidatorFunctionType, type FieldValidityLocalisationFunction, FixedWidth, FromPropsHelper, type IFieldSpec, type IPrice, type IRestClient, type IViewElementSpec, type IdType, type Indexable, type InputChangedFunction, LocalStorageService, LocalisationNamespace, type LocalisationVariableType, type LocalisedElements, type LocalisedEnumDetails, Localiser, Log, MESSAGE_SEVERITY_FACTORY, MessageCTO, MessageCodeTO, MessageService, MessageSeverity, type MessageWithDetailToggle, type ModalState, type MultiPropertyChangeFunction, NO_HTTP_CODE, NSK_CONTENT, ObjectWithId, PriceUtils, type PropertyChangeFunction, QUERY_SEP, QUERY_START, type QueryKeyValueParams, QueryParamHelper, REST_CLIENT_LOGGER, RestClient, type RunFunction, RunFunctionResult, SelectHelper, TECHNICAL_CONTROLLER_ID, type UseAWSUIRefHook, type UseControllerDisplayStateHook, type UseMessagesHook, type UseTOArrayChangeHandlerHook, type UseTOChangeHandlerHook, ViewSpec, type ViewValidatorFunctionType, createRestClient, fatalRunErrorFunction, filterArrayByIndices, getEnumRatingLabel, getEnumRatingValues, indexRangeArray, isContentWithMessages, openInNewTab, singleChangeHandlerToMulti, sleep, sortArrayByIndices, useAWSUIRef, useControllerDisplayState, useHotkey, useMessages, useTOArrayChangeHandler, useTOChangeHandler, warnWhenTabIsClosed };
|