x4js 1.5.40 → 1.6.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 -1
- package/changelog.txt +23 -0
- package/lib/README.txt +1 -1
- package/lib/changelog.txt +3 -0
- package/lib/cjs/{index.js → x4js.js} +3 -3
- package/lib/cjs/x4js.js.map +7 -0
- package/lib/esm/{index.mjs → x4js.mjs} +3 -3
- package/lib/esm/{index.mjs.map → x4js.mjs.map} +1 -1
- package/lib/src/MIT-license.md +1 -1
- package/lib/src/action.ts +1 -1
- package/lib/src/app_sockets.ts +1 -1
- package/lib/src/application.ts +1 -1
- package/lib/src/autocomplete.ts +1 -1
- package/lib/src/base64.ts +1 -1
- package/lib/src/base_component.ts +1 -1
- package/lib/src/button.ts +1 -1
- package/lib/src/calendar.ts +1 -1
- package/lib/src/canvas.ts +1 -1
- package/lib/src/cardview.ts +1 -1
- package/lib/src/checkbox.ts +1 -1
- package/lib/src/color.ts +1 -1
- package/lib/src/colorpicker.ts +1 -1
- package/lib/src/combobox.ts +1 -1
- package/lib/src/component.ts +1 -1
- package/lib/src/copyright.txt +1 -1
- package/lib/src/datastore.ts +1 -1
- package/lib/src/dialog.ts +1 -1
- package/lib/src/dom_events.ts +1 -1
- package/lib/src/drag_manager.ts +1 -1
- package/lib/src/drawtext.ts +1 -1
- package/lib/src/fileupload.ts +1 -1
- package/lib/src/form.ts +1 -1
- package/lib/src/formatters.ts +1 -1
- package/lib/src/gridview.ts +1 -1
- package/lib/src/i18n.ts +1 -1
- package/lib/src/icon.ts +1 -1
- package/lib/src/image.ts +1 -1
- package/lib/src/index.ts +1 -1
- package/lib/src/input.ts +1 -1
- package/lib/src/label.ts +1 -1
- package/lib/src/layout.ts +1 -1
- package/lib/src/link.ts +1 -1
- package/lib/src/listview.ts +1 -1
- package/lib/src/md5.ts +1 -1
- package/lib/src/menu.ts +1 -1
- package/lib/src/messagebox.ts +1 -1
- package/lib/src/panel.ts +1 -1
- package/lib/src/popup.ts +1 -1
- package/lib/src/property_editor.ts +1 -1
- package/lib/src/radiobtn.ts +1 -1
- package/lib/src/rating.ts +1 -1
- package/lib/src/request.ts +1 -1
- package/lib/src/router.ts +1 -1
- package/lib/src/settings.ts +1 -1
- package/lib/src/sidebarview.ts +1 -1
- package/lib/src/spreadsheet.ts +1 -1
- package/lib/src/styles.ts +1 -1
- package/lib/src/svgcomponent.ts +1 -1
- package/lib/src/tabbar.ts +1 -1
- package/lib/src/tabview.ts +1 -1
- package/lib/src/textarea.ts +1 -1
- package/lib/src/textedit.ts +1 -1
- package/lib/src/toaster.ts +1 -1
- package/lib/src/tools.ts +1 -1
- package/lib/src/tooltips.ts +1 -1
- package/lib/src/treeview.ts +1 -1
- package/lib/src/version.ts +2 -2
- package/lib/src/x4.less +1 -1
- package/lib/src/x4dom.ts +1 -1
- package/lib/src/x4events.ts +1 -1
- package/lib/src/x4js.ts +89 -0
- package/lib/src/x4react.ts +1 -1
- package/lib/styles/x4.css +1 -1
- package/lib/styles/x4.less +1 -1
- package/lib/types/x4js.d.ts +6762 -0
- package/package.json +10 -8
- package/lib/cjs/index.js.map +0 -7
- package/lib/esm/index.js.map +0 -7
- package/lib/types/action.d.ts +0 -57
- package/lib/types/app_sockets.d.ts +0 -29
- package/lib/types/application.d.ts +0 -108
- package/lib/types/autocomplete.d.ts +0 -63
- package/lib/types/base_component.d.ts +0 -88
- package/lib/types/button.d.ts +0 -151
- package/lib/types/calendar.d.ts +0 -82
- package/lib/types/canvas.d.ts +0 -92
- package/lib/types/cardview.d.ts +0 -87
- package/lib/types/checkbox.d.ts +0 -77
- package/lib/types/color.d.ts +0 -148
- package/lib/types/colorpicker.d.ts +0 -107
- package/lib/types/combobox.d.ts +0 -111
- package/lib/types/component.d.ts +0 -603
- package/lib/types/datastore.d.ts +0 -396
- package/lib/types/dialog.d.ts +0 -175
- package/lib/types/dom_events.d.ts +0 -302
- package/lib/types/drag_manager.d.ts +0 -58
- package/lib/types/drawtext.d.ts +0 -48
- package/lib/types/fileupload.d.ts +0 -64
- package/lib/types/form.d.ts +0 -142
- package/lib/types/formatters.d.ts +0 -35
- package/lib/types/gridview.d.ts +0 -175
- package/lib/types/i18n.d.ts +0 -73
- package/lib/types/icon.d.ts +0 -71
- package/lib/types/image.d.ts +0 -56
- package/lib/types/index.d.ts +0 -84
- package/lib/types/input.d.ts +0 -97
- package/lib/types/label.d.ts +0 -67
- package/lib/types/layout.d.ts +0 -89
- package/lib/types/link.d.ts +0 -50
- package/lib/types/listview.d.ts +0 -178
- package/lib/types/md5.d.ts +0 -61
- package/lib/types/menu.d.ts +0 -130
- package/lib/types/messagebox.d.ts +0 -69
- package/lib/types/panel.d.ts +0 -47
- package/lib/types/popup.d.ts +0 -75
- package/lib/types/property_editor.d.ts +0 -71
- package/lib/types/radiobtn.d.ts +0 -73
- package/lib/types/rating.d.ts +0 -53
- package/lib/types/request.d.ts +0 -52
- package/lib/types/router.d.ts +0 -67
- package/lib/types/settings.d.ts +0 -37
- package/lib/types/sidebarview.d.ts +0 -51
- package/lib/types/spreadsheet.d.ts +0 -222
- package/lib/types/styles.d.ts +0 -85
- package/lib/types/svgcomponent.d.ts +0 -216
- package/lib/types/tabbar.d.ts +0 -58
- package/lib/types/tabview.d.ts +0 -49
- package/lib/types/textarea.d.ts +0 -77
- package/lib/types/textedit.d.ts +0 -126
- package/lib/types/toaster.d.ts +0 -42
- package/lib/types/tools.d.ts +0 -394
- package/lib/types/tooltips.d.ts +0 -46
- package/lib/types/treeview.d.ts +0 -144
- package/lib/types/version.d.ts +0 -29
- package/lib/types/x4dom.d.ts +0 -49
- package/lib/types/x4events.d.ts +0 -269
- package/lib/types/x4react.d.ts +0 -41
package/lib/types/datastore.d.ts
DELETED
|
@@ -1,396 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ___ ___ __
|
|
3
|
-
* \ \/ / / _
|
|
4
|
-
* \ / /_| |_
|
|
5
|
-
* / \____ _|
|
|
6
|
-
* /__/\__\ |_|
|
|
7
|
-
*
|
|
8
|
-
* @file datastore.ts
|
|
9
|
-
* @author Etienne Cochard
|
|
10
|
-
*
|
|
11
|
-
* Copyright (c) 2019-2022 R-libre ingenierie
|
|
12
|
-
*
|
|
13
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
15
|
-
* in the Software without restriction, including without limitation the rights
|
|
16
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
17
|
-
* of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
18
|
-
* subject to the following conditions:
|
|
19
|
-
* The above copyright notice and this permission notice shall be included in all copies
|
|
20
|
-
* or substantial portions of the Software.
|
|
21
|
-
*
|
|
22
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
23
|
-
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
24
|
-
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
25
|
-
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
26
|
-
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
27
|
-
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
|
-
**/
|
|
29
|
-
import { BasicEvent, EvChange, EventSource, EventMap } from './x4events';
|
|
30
|
-
import { BaseComponent, BaseComponentEventMap, BaseComponentProps } from './base_component';
|
|
31
|
-
export type ChangeCallback = (type: string, id?: any) => void;
|
|
32
|
-
export type CalcCallback = () => string;
|
|
33
|
-
export type FieldType = 'string' | 'int' | 'float' | 'date' | 'bool' | 'array' | 'object' | 'any' | 'calc';
|
|
34
|
-
export type DataIndex = Uint32Array;
|
|
35
|
-
export interface EvDataChange extends BasicEvent {
|
|
36
|
-
type: string;
|
|
37
|
-
id: any;
|
|
38
|
-
}
|
|
39
|
-
export declare function EvDataChange(type: 'create' | 'update' | 'delete' | 'data' | 'change', id?: any): EvDataChange;
|
|
40
|
-
/**
|
|
41
|
-
* fields definition
|
|
42
|
-
* field with index=0 is record id
|
|
43
|
-
*/
|
|
44
|
-
export interface MetaData {
|
|
45
|
-
type?: FieldType;
|
|
46
|
-
prec?: number;
|
|
47
|
-
required?: boolean;
|
|
48
|
-
calc?: (rec: Record) => any;
|
|
49
|
-
model?: Record;
|
|
50
|
-
}
|
|
51
|
-
export interface FieldInfo extends MetaData {
|
|
52
|
-
name: string;
|
|
53
|
-
}
|
|
54
|
-
export declare namespace data {
|
|
55
|
-
/**
|
|
56
|
-
* define a record id
|
|
57
|
-
* @example
|
|
58
|
-
* \@data_id()
|
|
59
|
-
* id: string; // this field is the record id
|
|
60
|
-
**/
|
|
61
|
-
export function id(): (ownerCls: any, fldName: any) => void;
|
|
62
|
-
/**
|
|
63
|
-
* @ignore
|
|
64
|
-
*/
|
|
65
|
-
export function field(data: MetaData): (ownerCls: any, fldName: any) => void;
|
|
66
|
-
/**
|
|
67
|
-
* following member is a string field
|
|
68
|
-
* @example
|
|
69
|
-
* \@data_string()
|
|
70
|
-
* my_field: string; // this field will be seen as a string
|
|
71
|
-
*/
|
|
72
|
-
export function string(props?: MetaData): (ownerCls: any, fldName: any) => void;
|
|
73
|
-
/**
|
|
74
|
-
* following member is an integer field
|
|
75
|
-
* @example
|
|
76
|
-
* \@data_string()
|
|
77
|
-
* my_field: number; // this field will be seen as an integer
|
|
78
|
-
*/
|
|
79
|
-
export function int(props?: MetaData): (ownerCls: any, fldName: any) => void;
|
|
80
|
-
/**
|
|
81
|
-
* following member is a float field
|
|
82
|
-
* @example
|
|
83
|
-
* \@data_float()
|
|
84
|
-
* my_field: number; // this field will be seen as a float
|
|
85
|
-
*/
|
|
86
|
-
export function float(props?: MetaData): (ownerCls: any, fldName: any) => void;
|
|
87
|
-
/**
|
|
88
|
-
* following member is a boolean field
|
|
89
|
-
* @example
|
|
90
|
-
* \@data_bool()
|
|
91
|
-
* my_field: boolean; // this field will be seen as a boolean
|
|
92
|
-
*/
|
|
93
|
-
export function bool(props?: MetaData): (ownerCls: any, fldName: any) => void;
|
|
94
|
-
/**
|
|
95
|
-
* following member is a date field
|
|
96
|
-
* @example
|
|
97
|
-
* \@data_date()
|
|
98
|
-
* my_field: date; // this field will be seen as a date
|
|
99
|
-
*/
|
|
100
|
-
export function date(props?: MetaData): (ownerCls: any, fldName: any) => void;
|
|
101
|
-
/**
|
|
102
|
-
* following member is a calculated field
|
|
103
|
-
* @example
|
|
104
|
-
* \@data_calc( )
|
|
105
|
-
* get my_field(): string => {
|
|
106
|
-
* return 'hello';
|
|
107
|
-
* };
|
|
108
|
-
*/
|
|
109
|
-
export function calc(props?: MetaData): (ownerCls: any, fldName: any) => void;
|
|
110
|
-
/**
|
|
111
|
-
*
|
|
112
|
-
*/
|
|
113
|
-
interface RecordConstructor {
|
|
114
|
-
new (data?: any, id?: any): Record;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* following member is a record array
|
|
118
|
-
* @example
|
|
119
|
-
* \@data_array( )
|
|
120
|
-
* my_field(): TypedRecord[];
|
|
121
|
-
*/
|
|
122
|
-
export function array(ctor: RecordConstructor, props?: MetaData): (ownerCls: any, fldName: any) => void;
|
|
123
|
-
export {};
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* record model
|
|
127
|
-
*/
|
|
128
|
-
export declare class Record {
|
|
129
|
-
constructor(data?: any, id?: any);
|
|
130
|
-
clone(source?: any): any;
|
|
131
|
-
/**
|
|
132
|
-
* get the record unique identifier
|
|
133
|
-
* by default the return value is the first field
|
|
134
|
-
* @return unique identifier
|
|
135
|
-
*/
|
|
136
|
-
getID(): any;
|
|
137
|
-
/**
|
|
138
|
-
* MUST IMPLEMENT
|
|
139
|
-
* @returns fields descriptors
|
|
140
|
-
*/
|
|
141
|
-
getFields(): FieldInfo[];
|
|
142
|
-
/**
|
|
143
|
-
*
|
|
144
|
-
*/
|
|
145
|
-
validate(): Error[];
|
|
146
|
-
getFieldIndex(name: string): number;
|
|
147
|
-
/**
|
|
148
|
-
* default serializer
|
|
149
|
-
* @returns an object with known record values
|
|
150
|
-
*/
|
|
151
|
-
serialize(): any;
|
|
152
|
-
/**
|
|
153
|
-
* default unserializer
|
|
154
|
-
* @param data - input data
|
|
155
|
-
* @returns a new Record
|
|
156
|
-
*/
|
|
157
|
-
unSerialize(data: any, id?: any): Record;
|
|
158
|
-
/**
|
|
159
|
-
* field conversion
|
|
160
|
-
* @param field - field descriptor
|
|
161
|
-
* @param input - value to convert
|
|
162
|
-
* @returns the field value in it's original form
|
|
163
|
-
*/
|
|
164
|
-
protected _convertField(field: FieldInfo, input: any): any;
|
|
165
|
-
/**
|
|
166
|
-
* get raw value of a field
|
|
167
|
-
* @param name - field name or field index
|
|
168
|
-
*/
|
|
169
|
-
getRaw(name: string | number): any;
|
|
170
|
-
/**
|
|
171
|
-
*
|
|
172
|
-
* @param name
|
|
173
|
-
* @param data
|
|
174
|
-
*/
|
|
175
|
-
setRaw(name: string, data: string): void;
|
|
176
|
-
/**
|
|
177
|
-
* get field value (as string)
|
|
178
|
-
* @param name - field name
|
|
179
|
-
* @example
|
|
180
|
-
* let value = record.get('field1');
|
|
181
|
-
*/
|
|
182
|
-
getField(name: string): string;
|
|
183
|
-
/**
|
|
184
|
-
* set field value
|
|
185
|
-
* @param name - field name
|
|
186
|
-
* @param value - value to set
|
|
187
|
-
* @example
|
|
188
|
-
* record.set( 'field1', 7 );
|
|
189
|
-
*/
|
|
190
|
-
setField(name: string, value: any): void;
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* by default, the field id is rhe first member or the record
|
|
194
|
-
*/
|
|
195
|
-
export declare class AutoRecord extends Record {
|
|
196
|
-
private m_data;
|
|
197
|
-
private m_fid;
|
|
198
|
-
constructor(data: any);
|
|
199
|
-
getID(): any;
|
|
200
|
-
getFields(): FieldInfo[];
|
|
201
|
-
getRaw(name: string): string;
|
|
202
|
-
setRaw(name: string, data: string): void;
|
|
203
|
-
clone(data: any): AutoRecord;
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
*
|
|
207
|
-
*/
|
|
208
|
-
interface DataEventMap extends BaseComponentEventMap {
|
|
209
|
-
change?: EvChange;
|
|
210
|
-
}
|
|
211
|
-
type DataSolver = (data: any) => Record[];
|
|
212
|
-
export interface DataProxyProps extends BaseComponentProps<DataEventMap> {
|
|
213
|
-
url: string;
|
|
214
|
-
params?: string[];
|
|
215
|
-
solver?: DataSolver;
|
|
216
|
-
}
|
|
217
|
-
export declare class DataProxy extends BaseComponent<DataProxyProps, DataEventMap> {
|
|
218
|
-
constructor(props: DataProxyProps);
|
|
219
|
-
load(url?: string): Promise<void>;
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
*
|
|
223
|
-
*/
|
|
224
|
-
interface DataStoreProps<T extends Record> extends BaseComponentProps<DataStoreEventMap> {
|
|
225
|
-
model: T;
|
|
226
|
-
data?: T[];
|
|
227
|
-
url?: string;
|
|
228
|
-
autoload?: false;
|
|
229
|
-
}
|
|
230
|
-
interface DataStoreEventMap extends EventMap {
|
|
231
|
-
data_change: EvDataChange;
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
*
|
|
235
|
-
*/
|
|
236
|
-
export declare class DataStore<T extends Record = Record> extends EventSource<DataStoreEventMap> {
|
|
237
|
-
protected m_model: T;
|
|
238
|
-
protected m_fields: FieldInfo[];
|
|
239
|
-
protected m_records: T[];
|
|
240
|
-
protected m_proxy: DataProxy;
|
|
241
|
-
protected m_rec_index: DataIndex;
|
|
242
|
-
constructor(props: DataStoreProps<T>);
|
|
243
|
-
/**
|
|
244
|
-
*
|
|
245
|
-
* @param records
|
|
246
|
-
*/
|
|
247
|
-
load(url?: string): Promise<void>;
|
|
248
|
-
reload(): Promise<void>;
|
|
249
|
-
/**
|
|
250
|
-
* convert raw objects to real records from model
|
|
251
|
-
* @param records
|
|
252
|
-
*/
|
|
253
|
-
setData(records: any[]): void;
|
|
254
|
-
/**
|
|
255
|
-
* just set the records
|
|
256
|
-
* @param records - must be of the same type as model
|
|
257
|
-
*/
|
|
258
|
-
setRawData(records: T[]): void;
|
|
259
|
-
private _rebuildIndex;
|
|
260
|
-
/**
|
|
261
|
-
*
|
|
262
|
-
*/
|
|
263
|
-
update(rec: T): boolean;
|
|
264
|
-
/**
|
|
265
|
-
*
|
|
266
|
-
* @param data
|
|
267
|
-
*/
|
|
268
|
-
append(rec: T | any): void;
|
|
269
|
-
/**
|
|
270
|
-
*
|
|
271
|
-
*/
|
|
272
|
-
getMaxId(): any;
|
|
273
|
-
/**
|
|
274
|
-
*
|
|
275
|
-
* @param id
|
|
276
|
-
*/
|
|
277
|
-
delete(id: any): boolean;
|
|
278
|
-
/**
|
|
279
|
-
* return the number of records
|
|
280
|
-
*/
|
|
281
|
-
get count(): number;
|
|
282
|
-
/**
|
|
283
|
-
* return the fields
|
|
284
|
-
*/
|
|
285
|
-
get fields(): FieldInfo[];
|
|
286
|
-
/**
|
|
287
|
-
* find the index of the element with the given id
|
|
288
|
-
*/
|
|
289
|
-
indexOfId(id: any): number;
|
|
290
|
-
/**
|
|
291
|
-
* return the record by it's id
|
|
292
|
-
* @returns record or null
|
|
293
|
-
*/
|
|
294
|
-
getById(id: any): T;
|
|
295
|
-
/**
|
|
296
|
-
* return a record by it's index
|
|
297
|
-
* @returns record or null
|
|
298
|
-
*/
|
|
299
|
-
getByIndex(index: number): T;
|
|
300
|
-
private _getRecord;
|
|
301
|
-
moveTo(other: DataStore<T>): void;
|
|
302
|
-
/**
|
|
303
|
-
* create a new view on the DataStore
|
|
304
|
-
* @param opts
|
|
305
|
-
*/
|
|
306
|
-
createView(opts?: DataViewProps<T>): DataView<T>;
|
|
307
|
-
/**
|
|
308
|
-
*
|
|
309
|
-
*/
|
|
310
|
-
createIndex(filter: FilterInfo): DataIndex;
|
|
311
|
-
sortIndex(index: DataIndex, sort: SortProp[]): Uint32Array;
|
|
312
|
-
/**
|
|
313
|
-
*
|
|
314
|
-
*/
|
|
315
|
-
forEach(cb: (rec: T, index: number) => any): void;
|
|
316
|
-
export(): T[];
|
|
317
|
-
changed(): void;
|
|
318
|
-
}
|
|
319
|
-
export interface EvViewChange extends BasicEvent {
|
|
320
|
-
action: string;
|
|
321
|
-
}
|
|
322
|
-
export declare function EvViewChange(action: 'filter' | 'sort' | 'change'): EvViewChange;
|
|
323
|
-
interface DataViewEventMap extends BaseComponentEventMap {
|
|
324
|
-
view_change: EvViewChange;
|
|
325
|
-
}
|
|
326
|
-
interface DataViewProps<T extends Record> extends BaseComponentProps<DataViewEventMap> {
|
|
327
|
-
store?: DataStore<T>;
|
|
328
|
-
filter?: FilterInfo;
|
|
329
|
-
order?: string | SortProp[] | SortProp;
|
|
330
|
-
}
|
|
331
|
-
export type FilterFunc = (rec: Record) => boolean;
|
|
332
|
-
export interface FilterInfo {
|
|
333
|
-
op: '<' | '<=' | '=' | '>=' | '>' | '<>' | 'empty-result' | FilterFunc;
|
|
334
|
-
field?: string;
|
|
335
|
-
value?: string | RegExp;
|
|
336
|
-
caseSensitive?: boolean;
|
|
337
|
-
}
|
|
338
|
-
export interface SortProp {
|
|
339
|
-
field: string;
|
|
340
|
-
ascending: boolean;
|
|
341
|
-
}
|
|
342
|
-
/**
|
|
343
|
-
* Dataview allow different views of the DataStore.
|
|
344
|
-
* You can sort the columns & filter data
|
|
345
|
-
* You can have multiple views for a single DataStore
|
|
346
|
-
*/
|
|
347
|
-
export declare class DataView<T extends Record = Record> extends BaseComponent<DataViewProps<T>, DataViewEventMap> {
|
|
348
|
-
protected m_index: DataIndex;
|
|
349
|
-
protected m_store: DataStore<T>;
|
|
350
|
-
protected m_sort: SortProp[];
|
|
351
|
-
protected m_filter: FilterInfo;
|
|
352
|
-
constructor(props: DataViewProps<T>);
|
|
353
|
-
private _storeChange;
|
|
354
|
-
/**
|
|
355
|
-
*
|
|
356
|
-
* @param filter
|
|
357
|
-
*/
|
|
358
|
-
filter(filter?: FilterInfo): number;
|
|
359
|
-
private _filter;
|
|
360
|
-
/**
|
|
361
|
-
*
|
|
362
|
-
* @param columns
|
|
363
|
-
* @param ascending
|
|
364
|
-
*/
|
|
365
|
-
sort(props: SortProp[]): void;
|
|
366
|
-
private _sort;
|
|
367
|
-
/**
|
|
368
|
-
*
|
|
369
|
-
*/
|
|
370
|
-
get store(): DataStore<T>;
|
|
371
|
-
/**
|
|
372
|
-
*
|
|
373
|
-
*/
|
|
374
|
-
get count(): number;
|
|
375
|
-
/**
|
|
376
|
-
*
|
|
377
|
-
* @param id
|
|
378
|
-
*/
|
|
379
|
-
indexOfId(id: any): number;
|
|
380
|
-
/**
|
|
381
|
-
*
|
|
382
|
-
* @param index
|
|
383
|
-
*/
|
|
384
|
-
getByIndex(index: number): T;
|
|
385
|
-
/**
|
|
386
|
-
*
|
|
387
|
-
* @param id
|
|
388
|
-
*/
|
|
389
|
-
getById(id: any): T;
|
|
390
|
-
changed(): void;
|
|
391
|
-
/**
|
|
392
|
-
*
|
|
393
|
-
*/
|
|
394
|
-
forEach(cb: (rec: T, index: number) => any): void;
|
|
395
|
-
}
|
|
396
|
-
export {};
|
package/lib/types/dialog.d.ts
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ___ ___ __
|
|
3
|
-
* \ \/ / / _
|
|
4
|
-
* \ / /_| |_
|
|
5
|
-
* / \____ _|
|
|
6
|
-
* /__/\__\ |_|
|
|
7
|
-
*
|
|
8
|
-
* @file dialog.ts
|
|
9
|
-
* @author Etienne Cochard
|
|
10
|
-
*
|
|
11
|
-
* Copyright (c) 2019-2022 R-libre ingenierie
|
|
12
|
-
*
|
|
13
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
15
|
-
* in the Software without restriction, including without limitation the rights
|
|
16
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
17
|
-
* of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
18
|
-
* subject to the following conditions:
|
|
19
|
-
* The above copyright notice and this permission notice shall be included in all copies
|
|
20
|
-
* or substantial portions of the Software.
|
|
21
|
-
*
|
|
22
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
23
|
-
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
24
|
-
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
25
|
-
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
26
|
-
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
27
|
-
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
|
-
**/
|
|
29
|
-
import { Popup, PopupProps, PopupEventMap } from './popup';
|
|
30
|
-
import { IconID } from './icon';
|
|
31
|
-
import { Label } from './label';
|
|
32
|
-
import { Form, FormButtons } from './form';
|
|
33
|
-
import { Component, ComponentContent } from './component';
|
|
34
|
-
import { BasicEvent, EventCallback } from './x4events';
|
|
35
|
-
import { Rect, Size } from './tools';
|
|
36
|
-
interface Geometry {
|
|
37
|
-
left: number;
|
|
38
|
-
top: number;
|
|
39
|
-
width: number;
|
|
40
|
-
height: number;
|
|
41
|
-
minimized: boolean;
|
|
42
|
-
maximized: boolean;
|
|
43
|
-
}
|
|
44
|
-
export interface EvClose extends BasicEvent {
|
|
45
|
-
}
|
|
46
|
-
export interface EvBtnClick extends BasicEvent {
|
|
47
|
-
button: string;
|
|
48
|
-
}
|
|
49
|
-
export declare function EvBtnClick(button: string): EvBtnClick;
|
|
50
|
-
export interface DialogBoxEventMap extends PopupEventMap {
|
|
51
|
-
close: EvClose;
|
|
52
|
-
btnClick: EvBtnClick;
|
|
53
|
-
}
|
|
54
|
-
export type InitFormCallback = () => Form;
|
|
55
|
-
export interface DialogProps<E extends DialogBoxEventMap = DialogBoxEventMap> extends PopupProps<E> {
|
|
56
|
-
title?: string;
|
|
57
|
-
icon?: IconID;
|
|
58
|
-
buttons?: FormButtons;
|
|
59
|
-
btnClick?: EventCallback<EvBtnClick>;
|
|
60
|
-
closable?: boolean;
|
|
61
|
-
movable?: boolean;
|
|
62
|
-
maximized?: boolean;
|
|
63
|
-
maximizable?: boolean;
|
|
64
|
-
minimizable?: boolean;
|
|
65
|
-
autoClose?: boolean;
|
|
66
|
-
width?: number;
|
|
67
|
-
height?: number;
|
|
68
|
-
dlgWidth?: number;
|
|
69
|
-
dlgHeight?: number;
|
|
70
|
-
form?: Form | InitFormCallback;
|
|
71
|
-
disableSuggestions?: boolean;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Standard dialog class
|
|
75
|
-
*/
|
|
76
|
-
export declare class Dialog<P extends DialogProps = DialogProps, E extends DialogBoxEventMap = DialogBoxEventMap> extends Popup<P, E> {
|
|
77
|
-
protected m_icon: IconID;
|
|
78
|
-
protected m_title: string;
|
|
79
|
-
protected m_form: Form;
|
|
80
|
-
protected m_buttons: FormButtons;
|
|
81
|
-
protected m_closable: boolean;
|
|
82
|
-
protected m_movable: boolean;
|
|
83
|
-
protected m_maximized: boolean;
|
|
84
|
-
protected m_minimized: boolean;
|
|
85
|
-
protected m_maximizable: boolean;
|
|
86
|
-
protected m_minimizable: boolean;
|
|
87
|
-
protected m_minFormSize: Size;
|
|
88
|
-
protected m_rc_max: Rect;
|
|
89
|
-
protected m_rc_min: Rect;
|
|
90
|
-
protected m_el_title: Component;
|
|
91
|
-
protected m_last_down: number;
|
|
92
|
-
protected m_auto_close: boolean;
|
|
93
|
-
protected m_ui_title: Label;
|
|
94
|
-
protected m_form_cb: InitFormCallback;
|
|
95
|
-
constructor(props: P);
|
|
96
|
-
/**
|
|
97
|
-
*
|
|
98
|
-
*/
|
|
99
|
-
componentCreated(): void;
|
|
100
|
-
/**
|
|
101
|
-
*
|
|
102
|
-
*/
|
|
103
|
-
private _handleClick;
|
|
104
|
-
/**
|
|
105
|
-
* restore the geometry
|
|
106
|
-
*/
|
|
107
|
-
setGeometry(geom: Geometry): void;
|
|
108
|
-
/**
|
|
109
|
-
* return the geometry (usefull to save state)
|
|
110
|
-
*/
|
|
111
|
-
getGeometry(): Geometry;
|
|
112
|
-
/**
|
|
113
|
-
* resize the dialog
|
|
114
|
-
* @param width
|
|
115
|
-
* @param height
|
|
116
|
-
*/
|
|
117
|
-
setSize(width: number, height: number): void;
|
|
118
|
-
/** @ignore */
|
|
119
|
-
render(): void;
|
|
120
|
-
/**
|
|
121
|
-
* change the dialog content
|
|
122
|
-
* @param els
|
|
123
|
-
* @param refreshAll
|
|
124
|
-
*/
|
|
125
|
-
setContent(els: ComponentContent, refreshAll?: boolean): void;
|
|
126
|
-
/**
|
|
127
|
-
* change the dialog buttons
|
|
128
|
-
* @param buttons
|
|
129
|
-
*/
|
|
130
|
-
setButtons(buttons: FormButtons): void;
|
|
131
|
-
/**
|
|
132
|
-
* return the dialog form
|
|
133
|
-
*/
|
|
134
|
-
get form(): Form;
|
|
135
|
-
/**
|
|
136
|
-
* close the dialog
|
|
137
|
-
*/
|
|
138
|
-
close(): void;
|
|
139
|
-
/**
|
|
140
|
-
*
|
|
141
|
-
*/
|
|
142
|
-
private _toggleMax;
|
|
143
|
-
/**
|
|
144
|
-
*
|
|
145
|
-
*/
|
|
146
|
-
private _toggleMin;
|
|
147
|
-
/**
|
|
148
|
-
*
|
|
149
|
-
*/
|
|
150
|
-
private _mouseDown;
|
|
151
|
-
/**
|
|
152
|
-
* maximize the dialog
|
|
153
|
-
*/
|
|
154
|
-
maximize(): void;
|
|
155
|
-
/**
|
|
156
|
-
*
|
|
157
|
-
*/
|
|
158
|
-
private _maximize;
|
|
159
|
-
/**
|
|
160
|
-
* minimize the dialog
|
|
161
|
-
*/
|
|
162
|
-
minimize(): void;
|
|
163
|
-
/**
|
|
164
|
-
*
|
|
165
|
-
*/
|
|
166
|
-
private _minimize;
|
|
167
|
-
/**
|
|
168
|
-
* change the dialog title
|
|
169
|
-
*/
|
|
170
|
-
set title(title: string);
|
|
171
|
-
itemWithName<T extends Component>(name: string): T;
|
|
172
|
-
getValues(): any;
|
|
173
|
-
validate(): boolean;
|
|
174
|
-
}
|
|
175
|
-
export {};
|