@yesilyazilim/web.spa 1.0.31
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/__.npmrc +1 -0
- package/bootstrap-icons.3536be6d.woff2 +0 -0
- package/bootstrap-icons.5b9cac4e.woff +0 -0
- package/index.css +13674 -0
- package/index.css.map +1 -0
- package/index.js +6866 -0
- package/index.js.map +1 -0
- package/package.json +18 -0
- package/types.d.ts +1173 -0
- package/types.d.ts.map +1 -0
package/types.d.ts
ADDED
|
@@ -0,0 +1,1173 @@
|
|
|
1
|
+
export interface ComponentOptions {
|
|
2
|
+
elementName: string;
|
|
3
|
+
classes?: string[];
|
|
4
|
+
styles?: Partial<CSSStyleDeclaration>;
|
|
5
|
+
extends?: string;
|
|
6
|
+
}
|
|
7
|
+
export function Component(componentOptions: ComponentOptions): ClassDecorator;
|
|
8
|
+
export function Prop(): PropertyDecorator;
|
|
9
|
+
export enum CommandTypes {
|
|
10
|
+
Command = 0,
|
|
11
|
+
Tool = 1,
|
|
12
|
+
Select = 2,
|
|
13
|
+
Custom = 3
|
|
14
|
+
}
|
|
15
|
+
export enum SystemEvents {
|
|
16
|
+
ApplicationStart = "ApplicationStart",
|
|
17
|
+
ApplicationShow = "ApplicationShow",
|
|
18
|
+
ApplicationHide = "ApplicationHide",
|
|
19
|
+
ApplicationEnd = "ApplicationEnd",
|
|
20
|
+
PageNavigated = "PageNavigated",
|
|
21
|
+
CommandStart = "CommandStart",
|
|
22
|
+
CommandCancel = "CommandCancel",
|
|
23
|
+
PanelResizeStart = "PanelResizeStart",
|
|
24
|
+
PanelResizeEnd = "PanelResizeEnd",
|
|
25
|
+
UserLogin = "UserLogin",
|
|
26
|
+
UserLogout = "UserLogout",
|
|
27
|
+
TokenRefresh = "TokenRefresh"
|
|
28
|
+
}
|
|
29
|
+
export enum FrameworkPages {
|
|
30
|
+
App = "AppPage",
|
|
31
|
+
Admin = "AdminPage"
|
|
32
|
+
}
|
|
33
|
+
export enum FrameworkCommandTargets {
|
|
34
|
+
Ribbon = "ribbon",
|
|
35
|
+
UserMenu = "user-menu"
|
|
36
|
+
}
|
|
37
|
+
export enum StartupJobTypes {
|
|
38
|
+
PreLoad = 0,
|
|
39
|
+
PostLoad = 1
|
|
40
|
+
}
|
|
41
|
+
export enum ServiceTypes {
|
|
42
|
+
Scoped = 0,
|
|
43
|
+
Singleton = 1,
|
|
44
|
+
Transient = 2
|
|
45
|
+
}
|
|
46
|
+
export enum PanelPos {
|
|
47
|
+
Center = 0,
|
|
48
|
+
Left = 1,
|
|
49
|
+
Right = 2,
|
|
50
|
+
Bottom = 3
|
|
51
|
+
}
|
|
52
|
+
export const IconClass: {
|
|
53
|
+
search: string;
|
|
54
|
+
save: string;
|
|
55
|
+
query: string;
|
|
56
|
+
add: string;
|
|
57
|
+
new: string;
|
|
58
|
+
delete: string;
|
|
59
|
+
edit: string;
|
|
60
|
+
cancel: string;
|
|
61
|
+
chevron_down: string;
|
|
62
|
+
chevron_up: string;
|
|
63
|
+
chevron_left: string;
|
|
64
|
+
chevron_right: string;
|
|
65
|
+
caret_up: string;
|
|
66
|
+
caret_down: string;
|
|
67
|
+
caret_left: string;
|
|
68
|
+
caret_right: string;
|
|
69
|
+
caret_up_fill: string;
|
|
70
|
+
caret_down_fill: string;
|
|
71
|
+
caret_left_fill: string;
|
|
72
|
+
caret_right_fill: string;
|
|
73
|
+
X: string;
|
|
74
|
+
error: string;
|
|
75
|
+
warning: string;
|
|
76
|
+
info: string;
|
|
77
|
+
success: string;
|
|
78
|
+
dots: string;
|
|
79
|
+
dots_v: string;
|
|
80
|
+
logout: string;
|
|
81
|
+
settings: string;
|
|
82
|
+
world: string;
|
|
83
|
+
alert: string;
|
|
84
|
+
hand: string;
|
|
85
|
+
zoom_in: string;
|
|
86
|
+
zoom_out: string;
|
|
87
|
+
alarm: string;
|
|
88
|
+
cursor: string;
|
|
89
|
+
key: string;
|
|
90
|
+
layers: string;
|
|
91
|
+
person: string;
|
|
92
|
+
people: string;
|
|
93
|
+
pin: string;
|
|
94
|
+
};
|
|
95
|
+
export type DebounceOptions<Result> = {
|
|
96
|
+
isImmediate?: boolean;
|
|
97
|
+
maxWait?: number;
|
|
98
|
+
callback?: (data: Result) => void;
|
|
99
|
+
};
|
|
100
|
+
export interface DebouncedFunction<Args extends unknown[], F extends (...args: Args) => unknown> {
|
|
101
|
+
(this: ThisParameterType<F>, ...args: Args & Parameters<F>): Promise<ReturnType<F>>;
|
|
102
|
+
cancel: (reason?: unknown) => void;
|
|
103
|
+
}
|
|
104
|
+
export function debounce<Args extends unknown[], F extends (...args: Args) => unknown>(func: F, waitMilliseconds?: number, options?: DebounceOptions<ReturnType<F>>): DebouncedFunction<Args, F>;
|
|
105
|
+
export type EventListener<TData extends AnObject = {}, TResult = void> = (data?: TData) => TResult;
|
|
106
|
+
export class Eventer<TData = any, TResult = void> {
|
|
107
|
+
debounceMs: number;
|
|
108
|
+
constructor(debounceMs?: number);
|
|
109
|
+
register(listener: EventListener<TData, TResult>): void;
|
|
110
|
+
unregister(listener: EventListener<TData, TResult>): void;
|
|
111
|
+
raise(data: TData): Promise<TResult[]>;
|
|
112
|
+
}
|
|
113
|
+
export type DomEventName = keyof HTMLElementEventMap;
|
|
114
|
+
export type DomEventData = HTMLElementEventMap[DomEventName];
|
|
115
|
+
export class DomEventAction extends Eventer<DomEventData, void> {
|
|
116
|
+
constructor(target: HTMLElement, eventName: DomEventName);
|
|
117
|
+
}
|
|
118
|
+
export type LookupValue = string | number;
|
|
119
|
+
export type AnObject = {
|
|
120
|
+
[key: string]: any;
|
|
121
|
+
};
|
|
122
|
+
export type Constructable<T extends AnObject = {}> = {
|
|
123
|
+
new (...args: any[]): T;
|
|
124
|
+
};
|
|
125
|
+
export type ClassType<T extends AnObject = {}> = Function & Constructable<T>;
|
|
126
|
+
export type CreatorFunc = () => unknown;
|
|
127
|
+
export type LookupLoaderFunction = () => Promise<ILookup[]>;
|
|
128
|
+
export type Action<R = void, P = void> = (p?: P) => R;
|
|
129
|
+
export type AsyncAction<R = void, P = void> = Action<Promise<R>, P>;
|
|
130
|
+
export type OpResult<T = void> = {
|
|
131
|
+
success: boolean;
|
|
132
|
+
message?: string;
|
|
133
|
+
data?: T;
|
|
134
|
+
};
|
|
135
|
+
export type AsyncOpResult<T = void> = Promise<OpResult<T>>;
|
|
136
|
+
export type Operation<T = void> = Action<OpResult<T>>;
|
|
137
|
+
export type AsyncOperation<T = void> = Action<AsyncOpResult<T>>;
|
|
138
|
+
export interface ILookup {
|
|
139
|
+
key?: LookupValue;
|
|
140
|
+
title: string;
|
|
141
|
+
}
|
|
142
|
+
export type Keyed<T> = T & {
|
|
143
|
+
key: string;
|
|
144
|
+
};
|
|
145
|
+
export type IdValue<T> = {
|
|
146
|
+
id: number;
|
|
147
|
+
value: T;
|
|
148
|
+
};
|
|
149
|
+
export type SelfParent<T> = T & {
|
|
150
|
+
children?: SelfParent<T>[];
|
|
151
|
+
};
|
|
152
|
+
export interface IOrderable {
|
|
153
|
+
order?: number;
|
|
154
|
+
}
|
|
155
|
+
export type PropChangeInfo = {
|
|
156
|
+
name: string;
|
|
157
|
+
newValue: any;
|
|
158
|
+
oldValue?: any;
|
|
159
|
+
};
|
|
160
|
+
export interface IObservable {
|
|
161
|
+
readonly onPropChanged: Eventer<PropChangeInfo, void>;
|
|
162
|
+
raisePropChanged(info: PropChangeInfo): void;
|
|
163
|
+
}
|
|
164
|
+
export type LookupFunc = (context: any) => Promise<Array<ILookup>>;
|
|
165
|
+
export type ISimpleArray<T> = Iterable<T> & ArrayLike<T>;
|
|
166
|
+
declare class DevLoggerClass {
|
|
167
|
+
constructor();
|
|
168
|
+
set enable(value: boolean);
|
|
169
|
+
get enable(): boolean;
|
|
170
|
+
log(...data: any[]): void;
|
|
171
|
+
}
|
|
172
|
+
export const DevLogger: DevLoggerClass;
|
|
173
|
+
export interface IButtonInfo {
|
|
174
|
+
text?: string;
|
|
175
|
+
tootip?: string;
|
|
176
|
+
iconClass?: string;
|
|
177
|
+
}
|
|
178
|
+
export interface IBag<T> {
|
|
179
|
+
bag: T;
|
|
180
|
+
}
|
|
181
|
+
export type IKeyedButtonInfo = Keyed<IButtonInfo>;
|
|
182
|
+
export type BaggedButtonElement = HTMLButtonElement & IBag<IButtonInfo>;
|
|
183
|
+
export type MenuItem = SelfParent<IKeyedButtonInfo>;
|
|
184
|
+
export type ButtonClickAction = (info: IButtonInfo) => void;
|
|
185
|
+
export type Orientation = 'horizonal' | 'vertical';
|
|
186
|
+
export type Alignment = 'start' | 'center' | 'end';
|
|
187
|
+
export type RibbonItemType = 'Button' | 'DropDownButton' | 'RadioButton' | 'Select' | 'Custom';
|
|
188
|
+
export type FormInputType = 'hidden' | 'readonly' | 'text' | 'textarea' | 'int' | 'double' | 'date' | 'datetime-local' | 'boolean' | 'password' | 'color' | HTMLElement;
|
|
189
|
+
export type DisplayClasses = 'danger' | 'warning' | 'success' | 'info';
|
|
190
|
+
export type ButtonListProperties = {
|
|
191
|
+
orientation?: Orientation;
|
|
192
|
+
align?: Alignment;
|
|
193
|
+
gap?: string;
|
|
194
|
+
};
|
|
195
|
+
export type MenuProperties = {
|
|
196
|
+
align?: Alignment;
|
|
197
|
+
gap?: string;
|
|
198
|
+
};
|
|
199
|
+
export type OptionMenuProperties = MenuProperties & {
|
|
200
|
+
iconClass?: string;
|
|
201
|
+
};
|
|
202
|
+
export type CustomOption = HTMLOptionElement & {
|
|
203
|
+
originalValue: LookupValue;
|
|
204
|
+
};
|
|
205
|
+
export interface IValidationRule {
|
|
206
|
+
getError(value: any): string;
|
|
207
|
+
}
|
|
208
|
+
export interface IFormInput {
|
|
209
|
+
key: string;
|
|
210
|
+
title: string;
|
|
211
|
+
input: FormInputType;
|
|
212
|
+
readonlyInput?: HTMLElement;
|
|
213
|
+
rules?: IValidationRule[];
|
|
214
|
+
getter?: (inputElm: HTMLElement) => any;
|
|
215
|
+
setter?: (inputElm: HTMLElement, value: any) => void;
|
|
216
|
+
}
|
|
217
|
+
export interface IRibbonTab extends IOrderable {
|
|
218
|
+
key: string;
|
|
219
|
+
text: string;
|
|
220
|
+
groups: IRibbonGroup[];
|
|
221
|
+
onDemand?: boolean;
|
|
222
|
+
color?: string;
|
|
223
|
+
}
|
|
224
|
+
export interface IRibbonGroup extends IOrderable {
|
|
225
|
+
key: string;
|
|
226
|
+
text: string;
|
|
227
|
+
items: IRibbonItem[];
|
|
228
|
+
}
|
|
229
|
+
export interface IRibbonItem extends IOrderable {
|
|
230
|
+
type: RibbonItemType;
|
|
231
|
+
key: string;
|
|
232
|
+
}
|
|
233
|
+
export interface IRibbonCmd extends IKeyedButtonInfo {
|
|
234
|
+
action: () => void;
|
|
235
|
+
active?: boolean;
|
|
236
|
+
}
|
|
237
|
+
export interface IRibbonItemButton extends IRibbonItem, IRibbonCmd {
|
|
238
|
+
type: 'Button';
|
|
239
|
+
size: 'small' | 'big';
|
|
240
|
+
}
|
|
241
|
+
export interface IRibbonItemDropDown extends IRibbonItem {
|
|
242
|
+
type: 'DropDownButton';
|
|
243
|
+
mainButton: IRibbonCmd;
|
|
244
|
+
children: IRibbonCmd[];
|
|
245
|
+
}
|
|
246
|
+
export interface IRibbonItemRadioButton extends IRibbonItem {
|
|
247
|
+
type: 'RadioButton';
|
|
248
|
+
buttons: IRibbonCmd[];
|
|
249
|
+
}
|
|
250
|
+
export interface IRibbonItemSelect extends IRibbonItem {
|
|
251
|
+
type: 'Select';
|
|
252
|
+
title: string;
|
|
253
|
+
items: ILookup[];
|
|
254
|
+
action: (key: string) => void;
|
|
255
|
+
}
|
|
256
|
+
export interface IRibbonItemCustom extends IRibbonItem {
|
|
257
|
+
type: 'Custom';
|
|
258
|
+
title: string;
|
|
259
|
+
element: HTMLElement;
|
|
260
|
+
}
|
|
261
|
+
export type TreeItemActionInfo = IKeyedButtonInfo | HTMLInputElement;
|
|
262
|
+
export interface ITreeItem extends IOrderable {
|
|
263
|
+
id: string;
|
|
264
|
+
title: string;
|
|
265
|
+
checked?: boolean;
|
|
266
|
+
hidden?: boolean;
|
|
267
|
+
passive?: boolean;
|
|
268
|
+
actions?: TreeItemActionInfo[];
|
|
269
|
+
children?: ISimpleArray<ITreeItem>;
|
|
270
|
+
onAction?: (id: string) => void;
|
|
271
|
+
propsChanged?: Eventer<{
|
|
272
|
+
key: string;
|
|
273
|
+
value: any;
|
|
274
|
+
}, void>;
|
|
275
|
+
actionPropChanged?: Eventer<{
|
|
276
|
+
action: TreeItemActionInfo;
|
|
277
|
+
key: string;
|
|
278
|
+
value: any;
|
|
279
|
+
}, void>;
|
|
280
|
+
displayClass?: DisplayClasses;
|
|
281
|
+
icon?: HTMLElement;
|
|
282
|
+
}
|
|
283
|
+
export type TreeViewProperties = {
|
|
284
|
+
hideCheck?: boolean;
|
|
285
|
+
selectable?: boolean;
|
|
286
|
+
expanded?: boolean;
|
|
287
|
+
};
|
|
288
|
+
export type MessageBoxStyles = '' | 'error' | 'info' | 'warning' | 'success';
|
|
289
|
+
export class IndeterminateProgress extends HTMLElement {
|
|
290
|
+
constructor(attachMode?: 'bottom' | 'top' | null);
|
|
291
|
+
start(): void;
|
|
292
|
+
stop(): void;
|
|
293
|
+
}
|
|
294
|
+
export type ObserverFunc = (object: object, key: string, newValue: any, oldValue: any) => void;
|
|
295
|
+
export class System {
|
|
296
|
+
static observe(object: object, key: string, observer: ObserverFunc): void;
|
|
297
|
+
static isString(value: any): value is string;
|
|
298
|
+
static isNumber(value: any): value is number;
|
|
299
|
+
static isFunction(value: any): value is Function;
|
|
300
|
+
static isDate(value: any): value is Date;
|
|
301
|
+
static isHtmlElement(value: any): value is HTMLElement;
|
|
302
|
+
static isNullOrUndefined(value: any): boolean;
|
|
303
|
+
static isEmpty(value: any): boolean;
|
|
304
|
+
static toString(value: number | string, defaultValue?: string): string;
|
|
305
|
+
static toNumber(value: string, defaultValue?: number | null): number | null;
|
|
306
|
+
static getExecuterInfo(): string;
|
|
307
|
+
static epoch2Date(epoch: number): Date | null;
|
|
308
|
+
static epoch2DateStr(epoch: number, skipTime?: boolean): string;
|
|
309
|
+
static sortFnc(a: IOrderable, b: IOrderable): number;
|
|
310
|
+
static sort(arr: IOrderable[]): void;
|
|
311
|
+
static assignDefault<T extends AnObject>(properties: T, defaultProps: Required<T>): Required<T>;
|
|
312
|
+
}
|
|
313
|
+
export class MessageDisplay extends HTMLElement {
|
|
314
|
+
constructor(type: MessageBoxStyles, message: string | HTMLElement);
|
|
315
|
+
setMessage(message: string | HTMLElement): void;
|
|
316
|
+
}
|
|
317
|
+
export class Spinner extends HTMLElement {
|
|
318
|
+
constructor(message?: string);
|
|
319
|
+
setMessage(message: string): void;
|
|
320
|
+
}
|
|
321
|
+
export interface IDomItem {
|
|
322
|
+
tag: keyof HTMLElementTagNameMap;
|
|
323
|
+
styles?: Partial<CSSStyleDeclaration>;
|
|
324
|
+
attrs?: Record<string, string>;
|
|
325
|
+
children?: Array<IDomItem | HTMLElement>;
|
|
326
|
+
}
|
|
327
|
+
export class ELF {
|
|
328
|
+
static create<K extends keyof HTMLElementTagNameMap>(tag: K, styles?: Partial<CSSStyleDeclaration>, attrs?: Partial<HTMLElementTagNameMap[K]>, children?: Array<HTMLElement | string>): HTMLElementTagNameMap[K];
|
|
329
|
+
static build(item: IDomItem): HTMLElement;
|
|
330
|
+
static button(text?: string, tooltip?: string, btnClasses?: string, iconClass?: string, action?: (ev?: PointerEvent, btn?: HTMLButtonElement) => void): HTMLButtonElement;
|
|
331
|
+
static Buttons: {
|
|
332
|
+
fromButtonInfo: (info: IButtonInfo, classes?: string, action?: (ev?: PointerEvent, btn?: BaggedButtonElement) => void) => BaggedButtonElement;
|
|
333
|
+
search: (action: (ev?: PointerEvent, btn?: HTMLButtonElement) => void, text?: string, tooltip?: string) => HTMLButtonElement;
|
|
334
|
+
save: (action: (ev?: PointerEvent, btn?: HTMLButtonElement) => void, text?: string, tooltip?: string) => HTMLButtonElement;
|
|
335
|
+
query: (action: (ev?: PointerEvent, btn?: HTMLButtonElement) => void, text?: string, tooltip?: string) => HTMLButtonElement;
|
|
336
|
+
add: (action: (ev?: PointerEvent, btn?: HTMLButtonElement) => void, text?: string, tooltip?: string) => HTMLButtonElement;
|
|
337
|
+
delete: (action: (ev?: PointerEvent, btn?: HTMLButtonElement) => void, text?: string, tooltip?: string) => HTMLButtonElement;
|
|
338
|
+
edit: (action: (ev?: PointerEvent, btn?: HTMLButtonElement) => void, text?: string, tooltip?: string) => HTMLButtonElement;
|
|
339
|
+
cancel: (action: (ev?: PointerEvent, btn?: HTMLButtonElement) => void, text?: string, tooltip?: string) => HTMLButtonElement;
|
|
340
|
+
mini: (action: (ev?: PointerEvent, btn?: HTMLButtonElement) => void, iconClass: string, tooltip?: string) => HTMLButtonElement;
|
|
341
|
+
};
|
|
342
|
+
static div(classes?: string, ...children: Array<HTMLElement | string>): HTMLDivElement;
|
|
343
|
+
static dialog(classes?: string, ...children: Array<HTMLElement | string>): HTMLDialogElement;
|
|
344
|
+
static span(text?: string, classes?: string): HTMLSpanElement;
|
|
345
|
+
static ul(attrs?: Record<string, string>, styles?: Partial<CSSStyleDeclaration>): HTMLUListElement;
|
|
346
|
+
static li(attrs?: Record<string, string>, styles?: Partial<CSSStyleDeclaration>): HTMLLIElement;
|
|
347
|
+
static label(label: string, classes?: string): HTMLLabelElement;
|
|
348
|
+
static closeButton(): HTMLAnchorElement;
|
|
349
|
+
static input(type: 'hidden' | 'text' | 'number' | 'date' | 'checkbox' | 'textarea' | 'password' | 'time' | 'datetime-local' | 'month' | 'color' | 'range', value?: string): HTMLInputElement;
|
|
350
|
+
static textarea(value?: string): HTMLTextAreaElement;
|
|
351
|
+
static switch(): HTMLInputElement;
|
|
352
|
+
static icon(className: string): HTMLElement;
|
|
353
|
+
static h(num: 1 | 2 | 3 | 4 | 5 | 6, text: string, className?: string): HTMLHeadingElement;
|
|
354
|
+
static p(text: string, className?: string): HTMLParagraphElement;
|
|
355
|
+
static option(text: string, value?: LookupValue): HTMLOptionElement;
|
|
356
|
+
static select(): HTMLSelectElement;
|
|
357
|
+
static selectWithOptions(...values: string[]): HTMLSelectElement;
|
|
358
|
+
static selectWithLookup(...lookups: ILookup[]): HTMLSelectElement;
|
|
359
|
+
static setClasses<T extends HTMLElement>(elm: T, ...arr: string[]): T;
|
|
360
|
+
static setStyles<T extends HTMLElement>(elm: T, styles?: Partial<CSSStyleDeclaration>): T;
|
|
361
|
+
static setAttributes<T extends HTMLElement>(elm: T, attrs: Record<string, string>): T;
|
|
362
|
+
static switchClassesIf<T extends HTMLElement>(elm: T, condition: boolean, trueClass: string, falseClass?: string): T;
|
|
363
|
+
static nextElementId(prefix?: string): string;
|
|
364
|
+
static showHideSpinnerAt(elm: HTMLElement, show: boolean, message?: string): void;
|
|
365
|
+
static showHideWorkingAt(elm: HTMLElement, show: boolean, attachMode?: 'bottom' | 'top'): void;
|
|
366
|
+
static getSpinnerAt(elm: HTMLElement): Spinner;
|
|
367
|
+
static showHideMessageDisplayAt(elm: HTMLElement, show: boolean, style?: MessageBoxStyles, message?: string | HTMLElement): void;
|
|
368
|
+
}
|
|
369
|
+
export abstract class BaseElement extends HTMLElement implements IObservable {
|
|
370
|
+
eid: number;
|
|
371
|
+
canClose(): Promise<boolean>;
|
|
372
|
+
protected onConnected?(): void;
|
|
373
|
+
protected onDisconnected?(): void;
|
|
374
|
+
onPanelResize?(start: boolean): void;
|
|
375
|
+
readonly onPropChanged: Eventer<PropChangeInfo, void>;
|
|
376
|
+
constructor();
|
|
377
|
+
raisePropChanged(info: PropChangeInfo): void;
|
|
378
|
+
connectedCallback(): void;
|
|
379
|
+
disconnectedCallback(): void;
|
|
380
|
+
set bag(value: any);
|
|
381
|
+
get bag(): any;
|
|
382
|
+
grapFocus(child: HTMLElement): void;
|
|
383
|
+
get isBusy(): boolean;
|
|
384
|
+
setBusy(value: boolean, message?: string): void;
|
|
385
|
+
set visible(v: boolean);
|
|
386
|
+
removeAllChildNodes(): void;
|
|
387
|
+
isExist(): boolean;
|
|
388
|
+
}
|
|
389
|
+
export abstract class BaseFormElement extends BaseElement {
|
|
390
|
+
abstract check(): boolean;
|
|
391
|
+
abstract getData(): any;
|
|
392
|
+
abstract isReadonly: boolean;
|
|
393
|
+
}
|
|
394
|
+
export type TabItem = {
|
|
395
|
+
name: string;
|
|
396
|
+
header: string;
|
|
397
|
+
content: HTMLElement;
|
|
398
|
+
closable: boolean;
|
|
399
|
+
hidden?: boolean;
|
|
400
|
+
draggable?: boolean;
|
|
401
|
+
color?: string;
|
|
402
|
+
} & IOrderable;
|
|
403
|
+
export interface ITabContainer {
|
|
404
|
+
tabsChanged: Eventer<TabsChangedData, void>;
|
|
405
|
+
addTab(ti: TabItem): any;
|
|
406
|
+
containsTab(name: string): boolean;
|
|
407
|
+
removeTabAsync(name: string): Promise<boolean>;
|
|
408
|
+
activateTab(indexOrName: number | string): boolean;
|
|
409
|
+
showHideTab(indexOrName: number | string, show: boolean): any;
|
|
410
|
+
getActiveTabItem(): TabItem | null;
|
|
411
|
+
}
|
|
412
|
+
export type TabsChangedData = {
|
|
413
|
+
type: 'add' | 'remove' | 'activated' | 'deactivated';
|
|
414
|
+
tab: TabItem;
|
|
415
|
+
};
|
|
416
|
+
export class TabContainer extends BaseElement implements ITabContainer {
|
|
417
|
+
tabs: Tab[];
|
|
418
|
+
headers: TabHeader[];
|
|
419
|
+
tabsChanged: Eventer<TabsChangedData, void>;
|
|
420
|
+
onTabItemDragStarted: Eventer<TabItem>;
|
|
421
|
+
constructor();
|
|
422
|
+
connectedCallback(): void;
|
|
423
|
+
disconnectedCallback(): void;
|
|
424
|
+
addTab(ti: TabItem): void;
|
|
425
|
+
containsTab(name: string): boolean;
|
|
426
|
+
removeTabAsync(name: string): Promise<boolean>;
|
|
427
|
+
activateTab(indexOrName: number | string): boolean;
|
|
428
|
+
getActiveTabItem(): TabItem | null;
|
|
429
|
+
showHideTab(indexOrName: string | number, show: boolean): boolean;
|
|
430
|
+
disableTab(indexOrName: string | number, disable: boolean): boolean;
|
|
431
|
+
moveTo(name: string, other: TabContainer, activate?: boolean): boolean;
|
|
432
|
+
warnChildrenResize(start: boolean): void;
|
|
433
|
+
}
|
|
434
|
+
declare class Tab extends BaseElement {
|
|
435
|
+
item: TabItem;
|
|
436
|
+
name: string;
|
|
437
|
+
constructor(item: TabItem);
|
|
438
|
+
setActive(active: boolean): void;
|
|
439
|
+
}
|
|
440
|
+
declare class TabHeader extends BaseElement {
|
|
441
|
+
constructor(tabContainer: TabContainer, tab: Tab);
|
|
442
|
+
setActive(active: boolean): void;
|
|
443
|
+
}
|
|
444
|
+
export interface ServiceConfig {
|
|
445
|
+
type?: ServiceTypes;
|
|
446
|
+
creator?: CreatorFunc | any;
|
|
447
|
+
}
|
|
448
|
+
export interface IUserInfo<T = void> {
|
|
449
|
+
key: string;
|
|
450
|
+
title: string;
|
|
451
|
+
auths: string[];
|
|
452
|
+
props?: T;
|
|
453
|
+
}
|
|
454
|
+
export interface ILoginInfo {
|
|
455
|
+
token: string;
|
|
456
|
+
expires: number;
|
|
457
|
+
user: IUserInfo;
|
|
458
|
+
}
|
|
459
|
+
export interface ILoginComponent extends BaseElement {
|
|
460
|
+
onLogined: Eventer<ILoginInfo, any>;
|
|
461
|
+
}
|
|
462
|
+
export type AuthLocalProperties = {
|
|
463
|
+
type: 'Local';
|
|
464
|
+
autoLogin: boolean;
|
|
465
|
+
createLoginComponent: () => ILoginComponent;
|
|
466
|
+
};
|
|
467
|
+
export type AuthCookieProperties = {
|
|
468
|
+
type: 'Cookie';
|
|
469
|
+
logoutUrl: string;
|
|
470
|
+
loginInfoUrl: string;
|
|
471
|
+
};
|
|
472
|
+
export type AuthProperties = AuthLocalProperties | AuthCookieProperties;
|
|
473
|
+
export type AppMenuItemGroupInfo = {
|
|
474
|
+
key: string;
|
|
475
|
+
title: string;
|
|
476
|
+
order: number;
|
|
477
|
+
};
|
|
478
|
+
export type AppMenuTabInfo = {
|
|
479
|
+
key: string;
|
|
480
|
+
title: string;
|
|
481
|
+
items: AppMenuItemGroupInfo[];
|
|
482
|
+
order: number;
|
|
483
|
+
onDemand?: boolean;
|
|
484
|
+
color?: string;
|
|
485
|
+
};
|
|
486
|
+
export type AppMenuProperties = {
|
|
487
|
+
defaultTool: string;
|
|
488
|
+
tabs: AppMenuTabInfo[];
|
|
489
|
+
};
|
|
490
|
+
export type ApplicationProperties = {
|
|
491
|
+
title: string;
|
|
492
|
+
hostElement: HTMLElement;
|
|
493
|
+
auth: AuthProperties;
|
|
494
|
+
ribbon: AppMenuProperties;
|
|
495
|
+
apiEndPoint: string;
|
|
496
|
+
logoUrl: string;
|
|
497
|
+
defaultPage: string;
|
|
498
|
+
};
|
|
499
|
+
export interface PageProperties {
|
|
500
|
+
key: string;
|
|
501
|
+
title: string;
|
|
502
|
+
auth?: string;
|
|
503
|
+
iconClass?: string;
|
|
504
|
+
}
|
|
505
|
+
export interface PagePartProperties {
|
|
506
|
+
key: string;
|
|
507
|
+
page: string;
|
|
508
|
+
title: string;
|
|
509
|
+
auth?: string;
|
|
510
|
+
}
|
|
511
|
+
type BaseCommandProperties = {
|
|
512
|
+
type: CommandTypes;
|
|
513
|
+
container: 'ribbon' | string;
|
|
514
|
+
key: string;
|
|
515
|
+
title: string;
|
|
516
|
+
group: string;
|
|
517
|
+
order?: number;
|
|
518
|
+
auth?: string;
|
|
519
|
+
preload?: boolean;
|
|
520
|
+
};
|
|
521
|
+
export type ActionCommandProperties = BaseCommandProperties & {
|
|
522
|
+
type: CommandTypes.Command | CommandTypes.Tool;
|
|
523
|
+
iconClass: string;
|
|
524
|
+
};
|
|
525
|
+
export type SelectCommandProperties = BaseCommandProperties & {
|
|
526
|
+
type: CommandTypes.Select;
|
|
527
|
+
selectItems?: ILookup[];
|
|
528
|
+
};
|
|
529
|
+
export type CustomCommandProperties = BaseCommandProperties & {
|
|
530
|
+
type: CommandTypes.Custom;
|
|
531
|
+
customElementCreator?: () => HTMLElement;
|
|
532
|
+
};
|
|
533
|
+
export type CommandProperties = ActionCommandProperties | SelectCommandProperties | CustomCommandProperties;
|
|
534
|
+
export interface ICommand {
|
|
535
|
+
start(childKey?: string, param?: any): void;
|
|
536
|
+
enabled: boolean;
|
|
537
|
+
active: boolean;
|
|
538
|
+
}
|
|
539
|
+
export interface ITool extends ICommand {
|
|
540
|
+
cancel(): boolean;
|
|
541
|
+
}
|
|
542
|
+
export type StartupJobProperties = {
|
|
543
|
+
type: StartupJobTypes;
|
|
544
|
+
title: string;
|
|
545
|
+
required: boolean;
|
|
546
|
+
errorMessage?: string;
|
|
547
|
+
order?: number;
|
|
548
|
+
};
|
|
549
|
+
export interface IAppStartupJob {
|
|
550
|
+
name: string;
|
|
551
|
+
run(): Promise<boolean>;
|
|
552
|
+
}
|
|
553
|
+
export type PageNavigatedEventArgs = {
|
|
554
|
+
pageKey: string;
|
|
555
|
+
pageTitle: string;
|
|
556
|
+
fromPageKey: string;
|
|
557
|
+
};
|
|
558
|
+
export interface IMainPanel {
|
|
559
|
+
openItem(pos: PanelPos, item: TabItem): any;
|
|
560
|
+
closeItemAsync(name: string): Promise<boolean>;
|
|
561
|
+
onResizeStatusChanged(start: boolean, pos: PanelPos, affecteds: PanelPos[]): void;
|
|
562
|
+
}
|
|
563
|
+
export type FormFactoryProperties = {
|
|
564
|
+
type: string;
|
|
565
|
+
order: number;
|
|
566
|
+
};
|
|
567
|
+
export interface IFormFactory {
|
|
568
|
+
name: string;
|
|
569
|
+
createForm(row: AnObject, serviceKey: string, tableKey: string, targetType?: string): AsyncOpResult<HTMLElement>;
|
|
570
|
+
}
|
|
571
|
+
export interface ICommandDisplayer {
|
|
572
|
+
setActive(key: string, value: boolean): any;
|
|
573
|
+
setDisabled(key: string, value: boolean): any;
|
|
574
|
+
isExist(): boolean;
|
|
575
|
+
}
|
|
576
|
+
export abstract class BasePage extends BaseElement {
|
|
577
|
+
constructor();
|
|
578
|
+
canClose(): Promise<boolean>;
|
|
579
|
+
pageProps: PageProperties;
|
|
580
|
+
abstract OnShow(): void;
|
|
581
|
+
abstract OnHide(): void;
|
|
582
|
+
}
|
|
583
|
+
export abstract class BasePagePart extends BaseElement {
|
|
584
|
+
constructor();
|
|
585
|
+
canClose(): Promise<boolean>;
|
|
586
|
+
abstract OnShow(): void;
|
|
587
|
+
abstract OnHide(): void;
|
|
588
|
+
}
|
|
589
|
+
export type PagePartItem = {
|
|
590
|
+
pagePart: BasePagePart;
|
|
591
|
+
props: PagePartProperties;
|
|
592
|
+
};
|
|
593
|
+
export class LazyInstance<T> {
|
|
594
|
+
constructor(_constructor: ClassType<T>);
|
|
595
|
+
get instance(): T;
|
|
596
|
+
get newInstance(): T;
|
|
597
|
+
get isCreated(): boolean;
|
|
598
|
+
reset(): void;
|
|
599
|
+
}
|
|
600
|
+
export class LasyInstanceMap<T, L extends LazyInstance<T>> {
|
|
601
|
+
registerLazy(key: string, li: L): void;
|
|
602
|
+
has(key: string): boolean;
|
|
603
|
+
getLazy(key: string): L;
|
|
604
|
+
get allItems(): L[];
|
|
605
|
+
resetInstances(): void;
|
|
606
|
+
}
|
|
607
|
+
export class LazyCommand extends LazyInstance<ICommand> {
|
|
608
|
+
config: CommandProperties;
|
|
609
|
+
constructor(_constructor: ClassType<ICommand>, config: CommandProperties);
|
|
610
|
+
}
|
|
611
|
+
export class PageLazy extends LazyInstance<BasePage> {
|
|
612
|
+
props: PageProperties;
|
|
613
|
+
constructor(ctor: ClassType<BasePage>, props: PageProperties);
|
|
614
|
+
}
|
|
615
|
+
export class PagePartLazy extends LazyInstance<BasePagePart> {
|
|
616
|
+
props: PagePartProperties;
|
|
617
|
+
constructor(ctor: ClassType<BasePagePart>, props: PagePartProperties);
|
|
618
|
+
}
|
|
619
|
+
export class StartupJobLazy extends LazyInstance<IAppStartupJob> {
|
|
620
|
+
config: StartupJobProperties;
|
|
621
|
+
constructor(classType: ClassType<IAppStartupJob>, config: StartupJobProperties);
|
|
622
|
+
}
|
|
623
|
+
export class FormFactoryLazy extends LazyInstance<IFormFactory> {
|
|
624
|
+
key: string;
|
|
625
|
+
constructor(classType: ClassType<IFormFactory>, key: string);
|
|
626
|
+
}
|
|
627
|
+
export class ServiceItem {
|
|
628
|
+
serviceType: ServiceTypes;
|
|
629
|
+
constructor(_type: ClassType | string, config: ServiceConfig);
|
|
630
|
+
getInstance(): any;
|
|
631
|
+
onScopeChanged(): void;
|
|
632
|
+
}
|
|
633
|
+
declare class ServicePooler {
|
|
634
|
+
register(type: ClassType, config: ServiceConfig): void;
|
|
635
|
+
registerKeyed(key: string, type: ServiceTypes, service: AnObject | (() => any)): void;
|
|
636
|
+
get<T>(type: any): T;
|
|
637
|
+
find<T>(type: any): T | null;
|
|
638
|
+
get scopeActive(): boolean;
|
|
639
|
+
set scopeActive(value: boolean);
|
|
640
|
+
}
|
|
641
|
+
export const ServicePool: ServicePooler;
|
|
642
|
+
export function Inject(): PropertyDecorator;
|
|
643
|
+
export function Service(config?: ServiceConfig): ClassDecorator;
|
|
644
|
+
export function ServiceKeyed(key: string, type: ServiceTypes): ClassDecorator;
|
|
645
|
+
export class EventService {
|
|
646
|
+
constructor();
|
|
647
|
+
listen<TData, TResult>(eventName: string, listener: EventListener<TData, TResult>, debunceMs?: number): void;
|
|
648
|
+
forgot<TData, TResult>(eventName: string, listener: EventListener<TData, TResult>): void;
|
|
649
|
+
raise<TData, TResult>(eventName: string, data: TData): Promise<TResult[]>;
|
|
650
|
+
}
|
|
651
|
+
declare class TokenManagerClass {
|
|
652
|
+
refreshing: boolean;
|
|
653
|
+
refreshMin: number;
|
|
654
|
+
get isExpired(): boolean;
|
|
655
|
+
get needRefresh(): boolean;
|
|
656
|
+
get isValid(): boolean;
|
|
657
|
+
get headerValue(): string;
|
|
658
|
+
setToken(token: string, expiresAtSec: number): boolean;
|
|
659
|
+
clearToken(): void;
|
|
660
|
+
}
|
|
661
|
+
export const TokenManager: TokenManagerClass;
|
|
662
|
+
declare class StoreObj {
|
|
663
|
+
eventService: EventService;
|
|
664
|
+
constructor();
|
|
665
|
+
set<T>(key: string, value: T, keep?: boolean): void;
|
|
666
|
+
get<T>(key: string): T | null;
|
|
667
|
+
_initLocal(): void;
|
|
668
|
+
}
|
|
669
|
+
export const Store: StoreObj;
|
|
670
|
+
export function getAppProperties(): ApplicationProperties;
|
|
671
|
+
export class AuthService {
|
|
672
|
+
eventService: EventService;
|
|
673
|
+
constructor();
|
|
674
|
+
startAsync(): Promise<boolean>;
|
|
675
|
+
onSuccessLogin(loginInfo: ILoginInfo): void;
|
|
676
|
+
get isLogined(): boolean;
|
|
677
|
+
get currentUser(): IUserInfo | null;
|
|
678
|
+
hasAuth(auth: string): boolean;
|
|
679
|
+
refreshToken(token: string, expires: number): void;
|
|
680
|
+
logOut(): void;
|
|
681
|
+
getHeaderUserDisplayText(): string;
|
|
682
|
+
}
|
|
683
|
+
export interface IWindow {
|
|
684
|
+
close(): any;
|
|
685
|
+
}
|
|
686
|
+
export class DialogWindow {
|
|
687
|
+
static DialogHost: HTMLElement;
|
|
688
|
+
static ShowAsync(title: string, content: HTMLElement): Promise<void>;
|
|
689
|
+
}
|
|
690
|
+
export interface INofityItem {
|
|
691
|
+
hide(): void;
|
|
692
|
+
}
|
|
693
|
+
export type NotifyProperties = {
|
|
694
|
+
title: string;
|
|
695
|
+
message?: string | HTMLElement;
|
|
696
|
+
iconClass?: string;
|
|
697
|
+
autoHideMs?: number;
|
|
698
|
+
preventHideOnClick?: boolean;
|
|
699
|
+
type?: '' | 'error' | 'info' | 'warning' | 'success';
|
|
700
|
+
onClose?: Action;
|
|
701
|
+
};
|
|
702
|
+
export class Notify {
|
|
703
|
+
static container: HTMLDivElement;
|
|
704
|
+
static Error(title: string, message?: string, replace?: INofityItem): INofityItem;
|
|
705
|
+
static Success(title: string, message?: string, replace?: INofityItem): INofityItem;
|
|
706
|
+
static Warning(title: string, message?: string, replace?: INofityItem): INofityItem;
|
|
707
|
+
static Info(title: string, message?: string, replace?: INofityItem): INofityItem;
|
|
708
|
+
static Show(properties: NotifyProperties, replace?: INofityItem): INofityItem;
|
|
709
|
+
static Wait(title: string, message?: string, replace?: INofityItem): INofityItem;
|
|
710
|
+
}
|
|
711
|
+
export abstract class PartContainerPage extends BasePage {
|
|
712
|
+
leftMenu: HTMLDivElement;
|
|
713
|
+
partSide: HTMLDivElement;
|
|
714
|
+
partContainer: HTMLDivElement;
|
|
715
|
+
activePart: BasePagePart;
|
|
716
|
+
authService: AuthService;
|
|
717
|
+
constructor(title: string);
|
|
718
|
+
loadParts(items: PagePartItem[]): void;
|
|
719
|
+
_onMenuClicked(item: PagePartItem, menuItem: HTMLDivElement): void;
|
|
720
|
+
}
|
|
721
|
+
export class NavigationService {
|
|
722
|
+
authService: AuthService;
|
|
723
|
+
eventService: EventService;
|
|
724
|
+
init(pageContainerElement: HTMLElement, headerActionsContainer: HTMLDivElement): void;
|
|
725
|
+
goto(key: string): Promise<boolean>;
|
|
726
|
+
getUserPagesForNav(): PageProperties[];
|
|
727
|
+
get headerActionsContainer(): HTMLDivElement;
|
|
728
|
+
getDefaultPage(): string;
|
|
729
|
+
}
|
|
730
|
+
export function Command(cmdProps: CommandProperties): ClassDecorator;
|
|
731
|
+
export function Page(properties: PageProperties): ClassDecorator;
|
|
732
|
+
export function PagePart(properties: PagePartProperties): ClassDecorator;
|
|
733
|
+
export function StartupJob(key: string, properties: StartupJobProperties): ClassDecorator;
|
|
734
|
+
export function FormFactory(key: string): ClassDecorator;
|
|
735
|
+
export class CommandService {
|
|
736
|
+
eventService: EventService;
|
|
737
|
+
authService: AuthService;
|
|
738
|
+
constructor();
|
|
739
|
+
startCommand(key: string, childKey: string, param?: any): boolean;
|
|
740
|
+
startDefault(): void;
|
|
741
|
+
getCommandsFor(container: string, displayer: ICommandDisplayer): CommandProperties[];
|
|
742
|
+
}
|
|
743
|
+
type EventKeysType = HTMLElementEventMap & {
|
|
744
|
+
"change": Event;
|
|
745
|
+
};
|
|
746
|
+
export class ButtonRadioChangedEvent extends CustomEvent<{
|
|
747
|
+
key: string;
|
|
748
|
+
}> {
|
|
749
|
+
constructor(key: string);
|
|
750
|
+
}
|
|
751
|
+
export class ButtonRadio<T extends IKeyedButtonInfo = IKeyedButtonInfo> extends BaseElement {
|
|
752
|
+
addEventListener<K extends keyof EventKeysType>(type: K, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
753
|
+
constructor(items: T[], cssClass?: string);
|
|
754
|
+
get value(): string;
|
|
755
|
+
set value(val: string);
|
|
756
|
+
}
|
|
757
|
+
export class ButtonList extends BaseElement {
|
|
758
|
+
constructor(properties: ButtonListProperties);
|
|
759
|
+
}
|
|
760
|
+
export class Dropdown extends BaseElement {
|
|
761
|
+
constructor(content: HTMLElement);
|
|
762
|
+
toggle(): void;
|
|
763
|
+
get visible(): boolean;
|
|
764
|
+
set visible(value: boolean);
|
|
765
|
+
}
|
|
766
|
+
export class DropdownButton extends BaseElement {
|
|
767
|
+
constructor(main: IKeyedButtonInfo, children: IKeyedButtonInfo[], clickAction: (info: IKeyedButtonInfo) => void);
|
|
768
|
+
}
|
|
769
|
+
export class RibbonMenu extends BaseElement implements ICommandDisplayer {
|
|
770
|
+
constructor();
|
|
771
|
+
addRibbonTab(tab: IRibbonTab): void;
|
|
772
|
+
removeRibbonTab(name: string): void;
|
|
773
|
+
findElement(key: string): HTMLElement;
|
|
774
|
+
activateFirstTab(): void;
|
|
775
|
+
setActive(key: string, value: boolean): void;
|
|
776
|
+
setDisabled(key: string, value: boolean): void;
|
|
777
|
+
}
|
|
778
|
+
export class Application {
|
|
779
|
+
constructor();
|
|
780
|
+
start(body: HTMLElement): Promise<boolean>;
|
|
781
|
+
openPanel(item: TabItem, pos: PanelPos): void;
|
|
782
|
+
movePanel(name: string, pos: PanelPos): void;
|
|
783
|
+
}
|
|
784
|
+
declare global {
|
|
785
|
+
interface Array<T> {
|
|
786
|
+
removeAt(index: number): boolean;
|
|
787
|
+
remove(item: T): boolean;
|
|
788
|
+
}
|
|
789
|
+
interface HTMLElement {
|
|
790
|
+
setClasses(...value: string[]): HTMLElement;
|
|
791
|
+
setStyles(styles?: Partial<CSSStyleDeclaration>): HTMLElement;
|
|
792
|
+
setAttributes(attrs: Record<string, string>): HTMLElement;
|
|
793
|
+
appendChildren(...elements: HTMLElement[]): void;
|
|
794
|
+
clearChildren(): void;
|
|
795
|
+
showhide(visible: boolean): void;
|
|
796
|
+
get active(): boolean;
|
|
797
|
+
set active(value: boolean);
|
|
798
|
+
get disabled(): boolean;
|
|
799
|
+
set disabled(value: boolean);
|
|
800
|
+
}
|
|
801
|
+
interface String {
|
|
802
|
+
format(...params: string[]): string;
|
|
803
|
+
}
|
|
804
|
+
interface Date {
|
|
805
|
+
toStr(skipTime?: boolean): string;
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
export type ListChangeInfo<T> = {
|
|
809
|
+
added?: T[];
|
|
810
|
+
removed?: T[];
|
|
811
|
+
replaced?: {
|
|
812
|
+
old: T;
|
|
813
|
+
new: T;
|
|
814
|
+
};
|
|
815
|
+
sorted?: boolean;
|
|
816
|
+
};
|
|
817
|
+
export class List<T> implements ISimpleArray<T> {
|
|
818
|
+
readonly [n: number]: T;
|
|
819
|
+
get length(): number;
|
|
820
|
+
readonly changeEvent: Eventer<ListChangeInfo<T>, void>;
|
|
821
|
+
constructor(...arr: T[]);
|
|
822
|
+
[Symbol.iterator](): Generator<T, void, unknown>;
|
|
823
|
+
add(item: T): void;
|
|
824
|
+
addMany(...items: T[]): void;
|
|
825
|
+
getAt(inx: number): T | null;
|
|
826
|
+
setAt(inx: number, item: T): boolean;
|
|
827
|
+
remove(item: T): boolean;
|
|
828
|
+
removeMany(...items: T[]): boolean;
|
|
829
|
+
removeAt(inx: number): boolean;
|
|
830
|
+
clear(): void;
|
|
831
|
+
indexOf(item: T): number;
|
|
832
|
+
contains(item: T): boolean;
|
|
833
|
+
find(predicate: (value: T) => boolean): T;
|
|
834
|
+
filter(predicate: (value: T) => boolean): T[];
|
|
835
|
+
map<U>(callbackfn: (value: T) => U): U[];
|
|
836
|
+
forEach(callbackfn: (value: T) => void): void;
|
|
837
|
+
sort(callbackfn: (a: T, b: T) => number): void;
|
|
838
|
+
toArray(): T[];
|
|
839
|
+
}
|
|
840
|
+
export type ListItemInx<T> = IdValue<T> & {
|
|
841
|
+
inx: number;
|
|
842
|
+
};
|
|
843
|
+
export type IndexedListChangeInfo<T> = {
|
|
844
|
+
added?: ListItemInx<T>[];
|
|
845
|
+
removed?: ListItemInx<T>[];
|
|
846
|
+
replaced?: {
|
|
847
|
+
old: ListItemInx<T>;
|
|
848
|
+
new: ListItemInx<T>;
|
|
849
|
+
};
|
|
850
|
+
sorted?: boolean;
|
|
851
|
+
};
|
|
852
|
+
export class IndexedList<T> implements ISimpleArray<T> {
|
|
853
|
+
readonly [n: number]: T;
|
|
854
|
+
get length(): number;
|
|
855
|
+
readonly changeEvent: Eventer<IndexedListChangeInfo<T>, void>;
|
|
856
|
+
constructor(...arr: T[]);
|
|
857
|
+
[Symbol.iterator](): Generator<T, void, unknown>;
|
|
858
|
+
add(item: T): number;
|
|
859
|
+
addMany(...items: T[]): IdValue<T>[];
|
|
860
|
+
getById(id: number): ListItemInx<T> | null;
|
|
861
|
+
getValueById(id: number): T | null;
|
|
862
|
+
setById(id: number, value: T): boolean;
|
|
863
|
+
removeById(id: number): boolean;
|
|
864
|
+
removeManyById(...ids: number[]): boolean;
|
|
865
|
+
clear(): void;
|
|
866
|
+
idsOf(value: T): number[];
|
|
867
|
+
contains(value: T): boolean;
|
|
868
|
+
find(predicate: (value: T) => boolean): T | null;
|
|
869
|
+
filter(predicate: (value: T) => boolean): T[];
|
|
870
|
+
map<U>(callbackfn: (value: T) => U): U[];
|
|
871
|
+
forEach(callbackfn: (value: T) => void): void;
|
|
872
|
+
forEachItem(callbackfn: (value: ListItemInx<T>) => void): void;
|
|
873
|
+
sort(callbackfn: (a: T, b: T) => number): void;
|
|
874
|
+
toArray(): T[];
|
|
875
|
+
}
|
|
876
|
+
export abstract class Observable implements IObservable {
|
|
877
|
+
readonly onPropChanged: Eventer<PropChangeInfo, void>;
|
|
878
|
+
raisePropChanged(info: PropChangeInfo): void;
|
|
879
|
+
}
|
|
880
|
+
export function Observe(): PropertyDecorator;
|
|
881
|
+
export function MakePropObservable(target: Object, propertyKey: string | symbol): void;
|
|
882
|
+
export abstract class ReactiveElement<TState extends object> extends BaseElement {
|
|
883
|
+
readonly state: TState;
|
|
884
|
+
constructor(state: TState);
|
|
885
|
+
bindToUi<TElm extends HTMLElement, KState extends Extract<keyof TState, string>, KElm extends Extract<keyof TElm, string>>(stateProperty: KState, targetElm: TElm, targetProperty: KElm): void;
|
|
886
|
+
}
|
|
887
|
+
export type AccordionItem = {
|
|
888
|
+
header: string;
|
|
889
|
+
content: string | HTMLElement;
|
|
890
|
+
};
|
|
891
|
+
export type AccordionProps = {
|
|
892
|
+
items: AccordionItem[];
|
|
893
|
+
connected: boolean;
|
|
894
|
+
};
|
|
895
|
+
export class Accordion extends BaseElement {
|
|
896
|
+
protected _item: AccordionItem;
|
|
897
|
+
protected _isOpen: boolean;
|
|
898
|
+
protected _header: HTMLElement;
|
|
899
|
+
protected _content: HTMLElement;
|
|
900
|
+
constructor(_item: AccordionItem);
|
|
901
|
+
get isOpen(): boolean;
|
|
902
|
+
get item(): AccordionItem;
|
|
903
|
+
toggle(): void;
|
|
904
|
+
}
|
|
905
|
+
export class AccordionContainer extends BaseElement {
|
|
906
|
+
constructor(prop: AccordionProps);
|
|
907
|
+
}
|
|
908
|
+
export type CardProperties = {
|
|
909
|
+
imageUrl?: string;
|
|
910
|
+
title?: string;
|
|
911
|
+
content: HTMLElement | string;
|
|
912
|
+
};
|
|
913
|
+
export class Card extends BaseElement {
|
|
914
|
+
constructor(_props: CardProperties);
|
|
915
|
+
_buildUi(): void;
|
|
916
|
+
}
|
|
917
|
+
export interface ListComponentProperties<T> {
|
|
918
|
+
source: IndexedList<T>;
|
|
919
|
+
itemFactory: (item: T) => HTMLElement;
|
|
920
|
+
filterFnc?: (txt: string, item: T) => boolean;
|
|
921
|
+
conditionFunc?: (item: T) => boolean;
|
|
922
|
+
selectable?: boolean;
|
|
923
|
+
}
|
|
924
|
+
export class ListComponent<T> extends BaseElement {
|
|
925
|
+
SelectedIdChanged: Eventer<number>;
|
|
926
|
+
constructor(props: ListComponentProperties<T>);
|
|
927
|
+
getElementForId(itemId: number): HTMLElement;
|
|
928
|
+
get selectedId(): number;
|
|
929
|
+
set selectedId(id: number);
|
|
930
|
+
}
|
|
931
|
+
export class ListComponentHelper {
|
|
932
|
+
static CreateStringListComponent(source: IndexedList<string>, selectable?: boolean): ListComponent<string>;
|
|
933
|
+
}
|
|
934
|
+
export type CheckListProperties = {
|
|
935
|
+
items: ILookup[] | LookupLoaderFunction;
|
|
936
|
+
selecteds?: LookupValue[];
|
|
937
|
+
};
|
|
938
|
+
export class CheckList extends BaseElement {
|
|
939
|
+
constructor(properties: CheckListProperties);
|
|
940
|
+
get value(): LookupValue[];
|
|
941
|
+
set value(val: LookupValue[]);
|
|
942
|
+
}
|
|
943
|
+
export class Menu extends BaseElement implements ICommandDisplayer {
|
|
944
|
+
ItemClicked: Eventer<MenuItem>;
|
|
945
|
+
constructor(properties: MenuProperties, _isDrop?: boolean);
|
|
946
|
+
setActive(key: string, value: boolean): void;
|
|
947
|
+
setDisabled(key: string, value: boolean): void;
|
|
948
|
+
set items(items: MenuItem[]);
|
|
949
|
+
setItemHidden(hidden: boolean, key: string): void;
|
|
950
|
+
findItemByKey(key: string): HTMLElement;
|
|
951
|
+
}
|
|
952
|
+
export type ContextMenuProperties = {
|
|
953
|
+
target: HTMLElement;
|
|
954
|
+
items?: IKeyedButtonInfo[] | AsyncAction<IKeyedButtonInfo[]>;
|
|
955
|
+
auto?: boolean;
|
|
956
|
+
};
|
|
957
|
+
export class ContextMenu implements ICommandDisplayer {
|
|
958
|
+
ItemClicked: Eventer<IKeyedButtonInfo>;
|
|
959
|
+
constructor(props: ContextMenuProperties);
|
|
960
|
+
setItems(items: AsyncAction<IKeyedButtonInfo[]> | IKeyedButtonInfo[]): void;
|
|
961
|
+
setActive(key: string, value: boolean): void;
|
|
962
|
+
setDisabled(key: string, value: boolean): void;
|
|
963
|
+
isExist(): boolean;
|
|
964
|
+
showAt(x: number, y: number): Promise<boolean>;
|
|
965
|
+
hide(): void;
|
|
966
|
+
}
|
|
967
|
+
export type HtmlElementLike = HTMLElement | ((...params: any[]) => HTMLElement);
|
|
968
|
+
export class ConditionalElement extends BaseElement {
|
|
969
|
+
constructor(observingItem: IObservable, observingProp: string, trueElement: HtmlElementLike, falseElement?: HtmlElementLike);
|
|
970
|
+
}
|
|
971
|
+
export class TreeView extends BaseElement {
|
|
972
|
+
ItemActionClicked: Eventer<{
|
|
973
|
+
item: ITreeItem;
|
|
974
|
+
actionId: string;
|
|
975
|
+
}, void>;
|
|
976
|
+
ItemCheckChanged: Eventer<{
|
|
977
|
+
item: ITreeItem;
|
|
978
|
+
checked: boolean;
|
|
979
|
+
}, void>;
|
|
980
|
+
props: Required<TreeViewProperties>;
|
|
981
|
+
constructor(_source: IndexedList<ITreeItem>, properties?: TreeViewProperties);
|
|
982
|
+
onChildAction(item: ITreeItem, actionId: string): void;
|
|
983
|
+
onChildCheckChanged(item: ITreeItem, checked: boolean): void;
|
|
984
|
+
getCheckedItems(): ITreeItem[];
|
|
985
|
+
setCheckItems(ids: string[]): void;
|
|
986
|
+
}
|
|
987
|
+
export class DropdownTree extends BaseElement {
|
|
988
|
+
get treeView(): TreeView;
|
|
989
|
+
constructor(source: IndexedList<ITreeItem>);
|
|
990
|
+
getCheckedItems(): ITreeItem[];
|
|
991
|
+
setCheckedIds(ids: string[]): void;
|
|
992
|
+
}
|
|
993
|
+
export class Empty extends BaseElement {
|
|
994
|
+
constructor();
|
|
995
|
+
connectedCallback(): void;
|
|
996
|
+
disconnectedCallback(): void;
|
|
997
|
+
}
|
|
998
|
+
export type FlexProperies = {
|
|
999
|
+
direction?: 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
1000
|
+
gap?: string;
|
|
1001
|
+
wrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
1002
|
+
itemPosH?: 'flex-start' | 'flex-end' | 'center' | 'stretch';
|
|
1003
|
+
itemPosV?: 'flex-start' | 'flex-end' | 'center' | 'stretch';
|
|
1004
|
+
contentPosH?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'space-around' | 'space-between' | 'space-evenly';
|
|
1005
|
+
contentPosV?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'space-around' | 'space-between' | 'space-evenly';
|
|
1006
|
+
};
|
|
1007
|
+
export class Flex extends HTMLDivElement {
|
|
1008
|
+
constructor(prop: FlexProperies, ...children: HTMLElement[]);
|
|
1009
|
+
set visible(v: boolean);
|
|
1010
|
+
static GetCenteredHV(): Flex;
|
|
1011
|
+
static GetCenteredH(): Flex;
|
|
1012
|
+
static GetCenteredV(): Flex;
|
|
1013
|
+
}
|
|
1014
|
+
export class Form extends BaseFormElement {
|
|
1015
|
+
isReadonly: boolean;
|
|
1016
|
+
constructor(isReadonly?: boolean);
|
|
1017
|
+
setData(inputs: IFormInput[], model?: any): void;
|
|
1018
|
+
check(): boolean;
|
|
1019
|
+
clearErrors(): void;
|
|
1020
|
+
getData(): any;
|
|
1021
|
+
}
|
|
1022
|
+
export type GridProperies = {
|
|
1023
|
+
cols?: string;
|
|
1024
|
+
rows?: string;
|
|
1025
|
+
gap?: string;
|
|
1026
|
+
itemPosH?: 'start' | 'end' | 'center' | 'stretch';
|
|
1027
|
+
itemPosV?: 'start' | 'end' | 'center' | 'stretch';
|
|
1028
|
+
contentPosH?: 'start' | 'end' | 'center' | 'stretch' | 'space-around' | 'space-between' | 'space-evenly';
|
|
1029
|
+
contentPosV?: 'start' | 'end' | 'center' | 'stretch' | 'space-around' | 'space-between' | 'space-evenly';
|
|
1030
|
+
};
|
|
1031
|
+
export class Grid extends HTMLDivElement {
|
|
1032
|
+
constructor(prop: GridProperies, ...children: HTMLElement[]);
|
|
1033
|
+
set visible(v: boolean);
|
|
1034
|
+
}
|
|
1035
|
+
export class GroupBox extends BaseElement {
|
|
1036
|
+
constructor(caption: string, ...elements: HTMLElement[]);
|
|
1037
|
+
addChild<T extends Node>(node: T): T;
|
|
1038
|
+
deleteChild<T extends Node>(node: T): T;
|
|
1039
|
+
get body(): HTMLDivElement;
|
|
1040
|
+
get caption(): string;
|
|
1041
|
+
set caption(value: string);
|
|
1042
|
+
}
|
|
1043
|
+
export type MessageBoxButtonTypes = 'Ok' | 'OkCancel' | 'YesNo';
|
|
1044
|
+
export type MessageBoxProperties = {
|
|
1045
|
+
content: string | BaseFormElement | HTMLElement;
|
|
1046
|
+
title?: string;
|
|
1047
|
+
buttons?: MessageBoxButtonTypes;
|
|
1048
|
+
style?: MessageBoxStyles;
|
|
1049
|
+
okText?: string;
|
|
1050
|
+
cancelText?: string;
|
|
1051
|
+
};
|
|
1052
|
+
export type MessageBoxResult = {
|
|
1053
|
+
ok: boolean;
|
|
1054
|
+
data?: any;
|
|
1055
|
+
};
|
|
1056
|
+
export class MessageBox {
|
|
1057
|
+
static activeDialog: HTMLDialogElement | null;
|
|
1058
|
+
static Error(message: string, title?: string): Promise<void>;
|
|
1059
|
+
static Success(message: string, title?: string): Promise<void>;
|
|
1060
|
+
static Warning(message: string, title?: string): Promise<void>;
|
|
1061
|
+
static Info(message: string, title?: string): Promise<void>;
|
|
1062
|
+
static ShowOk(message: string, title?: string): Promise<void>;
|
|
1063
|
+
static Yesno(message: string, title?: string, style?: MessageBoxStyles): Promise<boolean>;
|
|
1064
|
+
static InputText(title: string, type?: 'text' | 'textarea'): Promise<string>;
|
|
1065
|
+
static ShowAsync(props: MessageBoxProperties): Promise<MessageBoxResult | null>;
|
|
1066
|
+
}
|
|
1067
|
+
export class OptionsMenu extends BaseElement implements ICommandDisplayer {
|
|
1068
|
+
ItemClicked: Eventer<IKeyedButtonInfo>;
|
|
1069
|
+
menu: Menu;
|
|
1070
|
+
constructor(props: OptionMenuProperties);
|
|
1071
|
+
set items(items: MenuItem[]);
|
|
1072
|
+
setActive(key: string, value: boolean): void;
|
|
1073
|
+
setDisabled(key: string, value: boolean): void;
|
|
1074
|
+
}
|
|
1075
|
+
export type RadialMenuOptions = {
|
|
1076
|
+
items: IKeyedButtonInfo[] | AsyncAction<IKeyedButtonInfo[]>;
|
|
1077
|
+
autoOpen: boolean;
|
|
1078
|
+
size?: number;
|
|
1079
|
+
};
|
|
1080
|
+
export class RadialMenu extends BaseElement {
|
|
1081
|
+
ItemClicked: Eventer<IKeyedButtonInfo>;
|
|
1082
|
+
constructor(props: RadialMenuOptions);
|
|
1083
|
+
showAt(x: number, y: number): Promise<boolean>;
|
|
1084
|
+
hide(): void;
|
|
1085
|
+
protected onConnected(): void;
|
|
1086
|
+
_onMouseUp: () => void;
|
|
1087
|
+
_onMouseMove: (e: MouseEvent) => void;
|
|
1088
|
+
}
|
|
1089
|
+
export class TagInput extends BaseElement {
|
|
1090
|
+
constructor(type?: 'number' | 'text');
|
|
1091
|
+
connectedCallback(): void;
|
|
1092
|
+
disconnectedCallback(): void;
|
|
1093
|
+
get value(): string;
|
|
1094
|
+
set value(val: string);
|
|
1095
|
+
addValue(val: string, silent?: boolean): void;
|
|
1096
|
+
triggerChanged(): void;
|
|
1097
|
+
}
|
|
1098
|
+
export class Toolbar extends ButtonList implements ICommandDisplayer {
|
|
1099
|
+
ItemClicked: Eventer<IKeyedButtonInfo>;
|
|
1100
|
+
constructor(orientation: Orientation);
|
|
1101
|
+
setActive(key: string, value: boolean): void;
|
|
1102
|
+
setDisabled(key: string, value: boolean): void;
|
|
1103
|
+
set items(items: IKeyedButtonInfo[]);
|
|
1104
|
+
get items(): IKeyedButtonInfo[];
|
|
1105
|
+
}
|
|
1106
|
+
export class RequiredRule implements IValidationRule {
|
|
1107
|
+
constructor();
|
|
1108
|
+
getError(value: any): string;
|
|
1109
|
+
}
|
|
1110
|
+
export class MinLengthRule implements IValidationRule {
|
|
1111
|
+
len: number;
|
|
1112
|
+
constructor(len: number);
|
|
1113
|
+
getError(value: string): string;
|
|
1114
|
+
}
|
|
1115
|
+
export class MaxLengthRule implements IValidationRule {
|
|
1116
|
+
len: number;
|
|
1117
|
+
constructor(len: number);
|
|
1118
|
+
getError(value: string): string;
|
|
1119
|
+
}
|
|
1120
|
+
export class RegexpRule implements IValidationRule {
|
|
1121
|
+
pattern: string;
|
|
1122
|
+
constructor(pattern: string);
|
|
1123
|
+
getError(value: string): string;
|
|
1124
|
+
}
|
|
1125
|
+
export class MinValueRule implements IValidationRule {
|
|
1126
|
+
min: number;
|
|
1127
|
+
constructor(min: number);
|
|
1128
|
+
getError(value: number): string;
|
|
1129
|
+
}
|
|
1130
|
+
export class MaxValueRule implements IValidationRule {
|
|
1131
|
+
max: number;
|
|
1132
|
+
constructor(max: number);
|
|
1133
|
+
getError(value: number): string;
|
|
1134
|
+
}
|
|
1135
|
+
export class MinDateRule implements IValidationRule {
|
|
1136
|
+
min: string;
|
|
1137
|
+
constructor(min: string);
|
|
1138
|
+
getError(value: string): string;
|
|
1139
|
+
}
|
|
1140
|
+
export class MaxDateRule implements IValidationRule {
|
|
1141
|
+
max: string;
|
|
1142
|
+
constructor(max: string);
|
|
1143
|
+
getError(value: string): string;
|
|
1144
|
+
}
|
|
1145
|
+
export class FormUtils {
|
|
1146
|
+
static createOptionEmpty(title?: string, value?: string): CustomOption;
|
|
1147
|
+
static createOptionFromLookup(lookup: ILookup): CustomOption;
|
|
1148
|
+
static generateFormInputForSelect(field: string, title: string, list: ILookup[]): IFormInput;
|
|
1149
|
+
static generateFormInputForSelectSecondary(field: string, title: string, primary: IFormInput, loaderFunc: (parentVal: LookupValue) => Promise<ILookup[]>): IFormInput;
|
|
1150
|
+
static generateFormInputForCheckList(field: string, title: string, cp: CheckListProperties): IFormInput;
|
|
1151
|
+
static generateFormInputForSelectFunc(field: string, title: string, lookupFnc: LookupFunc, context: any): IFormInput;
|
|
1152
|
+
}
|
|
1153
|
+
export abstract class AppStartup {
|
|
1154
|
+
run(props: ApplicationProperties): Promise<void>;
|
|
1155
|
+
abstract onReady(): void;
|
|
1156
|
+
}
|
|
1157
|
+
export abstract class BaseCommand implements ICommand {
|
|
1158
|
+
protected _enabled: boolean;
|
|
1159
|
+
protected _active: boolean;
|
|
1160
|
+
abstract start(childKey?: string, param?: any): void;
|
|
1161
|
+
get enabled(): boolean;
|
|
1162
|
+
get active(): boolean;
|
|
1163
|
+
set enabled(value: boolean);
|
|
1164
|
+
set active(value: boolean);
|
|
1165
|
+
}
|
|
1166
|
+
export abstract class BaseTool extends BaseCommand implements ITool {
|
|
1167
|
+
abstract cancel(): boolean;
|
|
1168
|
+
}
|
|
1169
|
+
export class FormService {
|
|
1170
|
+
createFormAsync(item: AnObject, factoryKey: string, serviceKey: string, tableKey: string, targetType?: string): AsyncOpResult<HTMLElement>;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
//# sourceMappingURL=types.d.ts.map
|