x4js 1.5.18 → 1.5.20

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.
Files changed (242) hide show
  1. package/lib/{README.md → README.txt} +0 -0
  2. package/lib/cjs/index.js +39 -103
  3. package/lib/cjs/index.js.map +7 -0
  4. package/lib/esm/index.mjs +39 -87
  5. package/lib/esm/index.mjs.map +7 -0
  6. package/lib/{license.md → licence.md} +0 -0
  7. package/lib/src/MIT-license.md +14 -0
  8. package/lib/{types/action.d.ts → src/action.ts} +64 -33
  9. package/lib/src/alpha.jpg +0 -0
  10. package/lib/src/app_sockets.ts +81 -0
  11. package/lib/src/application.ts +251 -0
  12. package/lib/src/autocomplete.ts +197 -0
  13. package/lib/src/base64.ts +166 -0
  14. package/lib/src/base_component.ts +152 -0
  15. package/lib/src/button.ts +355 -0
  16. package/lib/src/calendar.ts +328 -0
  17. package/lib/src/canvas.ts +505 -0
  18. package/lib/src/cardview.ts +227 -0
  19. package/lib/src/checkbox.ts +188 -0
  20. package/lib/src/color.ts +752 -0
  21. package/lib/src/colorpicker.ts +1639 -0
  22. package/lib/src/combobox.ts +465 -0
  23. package/lib/src/component.ts +2329 -0
  24. package/lib/{esm/dom_events.js → src/copyright.txt} +27 -29
  25. package/lib/src/datastore.ts +1322 -0
  26. package/lib/src/dialog.ts +656 -0
  27. package/lib/src/dom_events.ts +315 -0
  28. package/lib/src/drag_manager.ts +199 -0
  29. package/lib/src/drawtext.ts +355 -0
  30. package/lib/src/fileupload.ts +213 -0
  31. package/lib/src/form.ts +375 -0
  32. package/lib/src/formatters.ts +105 -0
  33. package/lib/src/gridview.ts +1185 -0
  34. package/lib/src/i18n.ts +346 -0
  35. package/lib/src/icon.ts +335 -0
  36. package/lib/src/image.ts +204 -0
  37. package/lib/src/index.ts +89 -0
  38. package/lib/src/input.ts +249 -0
  39. package/lib/src/label.ts +128 -0
  40. package/lib/src/layout.ts +430 -0
  41. package/lib/src/link.ts +86 -0
  42. package/lib/src/listview.ts +765 -0
  43. package/lib/{esm/md5.js → src/md5.ts} +438 -403
  44. package/lib/src/menu.ts +425 -0
  45. package/lib/src/messagebox.ts +224 -0
  46. package/lib/src/panel.ts +86 -0
  47. package/lib/src/popup.ts +494 -0
  48. package/lib/src/property_editor.ts +337 -0
  49. package/lib/src/radiobtn.ts +197 -0
  50. package/lib/src/rating.ts +135 -0
  51. package/lib/src/request.ts +300 -0
  52. package/lib/src/router.ts +185 -0
  53. package/lib/src/settings.ts +77 -0
  54. package/lib/src/sidebarview.ts +103 -0
  55. package/lib/src/spreadsheet.ts +1449 -0
  56. package/lib/src/styles.ts +343 -0
  57. package/lib/src/svgcomponent.ts +577 -0
  58. package/lib/src/tabbar.ts +151 -0
  59. package/lib/src/tabview.ts +110 -0
  60. package/lib/src/textarea.ts +235 -0
  61. package/lib/src/textedit.ts +544 -0
  62. package/lib/src/toaster.ts +80 -0
  63. package/lib/src/tools.ts +1473 -0
  64. package/lib/src/tooltips.ts +191 -0
  65. package/lib/src/treeview.ts +716 -0
  66. package/lib/{esm/version.js → src/version.ts} +30 -29
  67. package/lib/{styles → src}/x4.less +0 -0
  68. package/lib/src/x4dom.ts +57 -0
  69. package/lib/src/x4events.ts +585 -0
  70. package/lib/src/x4react.ts +90 -0
  71. package/package.json +52 -46
  72. package/lib/cjs/action.js +0 -58
  73. package/lib/cjs/app_sockets.js +0 -74
  74. package/lib/cjs/application.js +0 -182
  75. package/lib/cjs/autocomplete.js +0 -155
  76. package/lib/cjs/base_component.js +0 -124
  77. package/lib/cjs/button.js +0 -263
  78. package/lib/cjs/calendar.js +0 -254
  79. package/lib/cjs/canvas.js +0 -361
  80. package/lib/cjs/cardview.js +0 -161
  81. package/lib/cjs/checkbox.js +0 -139
  82. package/lib/cjs/color.js +0 -591
  83. package/lib/cjs/colorpicker.js +0 -1468
  84. package/lib/cjs/combobox.js +0 -349
  85. package/lib/cjs/component.js +0 -1719
  86. package/lib/cjs/datastore.js +0 -985
  87. package/lib/cjs/dialog.js +0 -478
  88. package/lib/cjs/dom_events.js +0 -30
  89. package/lib/cjs/drag_manager.js +0 -145
  90. package/lib/cjs/drawtext.js +0 -276
  91. package/lib/cjs/fileupload.js +0 -167
  92. package/lib/cjs/form.js +0 -304
  93. package/lib/cjs/formatters.js +0 -90
  94. package/lib/cjs/gridview.js +0 -881
  95. package/lib/cjs/i18n.js +0 -266
  96. package/lib/cjs/icon.js +0 -272
  97. package/lib/cjs/image.js +0 -157
  98. package/lib/cjs/input.js +0 -174
  99. package/lib/cjs/label.js +0 -95
  100. package/lib/cjs/layout.js +0 -322
  101. package/lib/cjs/link.js +0 -64
  102. package/lib/cjs/listview.js +0 -546
  103. package/lib/cjs/md5.js +0 -403
  104. package/lib/cjs/menu.js +0 -301
  105. package/lib/cjs/messagebox.js +0 -177
  106. package/lib/cjs/panel.js +0 -68
  107. package/lib/cjs/popup.js +0 -383
  108. package/lib/cjs/property_editor.js +0 -252
  109. package/lib/cjs/radiobtn.js +0 -140
  110. package/lib/cjs/rating.js +0 -102
  111. package/lib/cjs/request.js +0 -246
  112. package/lib/cjs/router.js +0 -139
  113. package/lib/cjs/settings.js +0 -69
  114. package/lib/cjs/sidebarview.js +0 -82
  115. package/lib/cjs/spreadsheet.js +0 -1084
  116. package/lib/cjs/styles.js +0 -275
  117. package/lib/cjs/svgcomponent.js +0 -447
  118. package/lib/cjs/tabbar.js +0 -111
  119. package/lib/cjs/tabview.js +0 -85
  120. package/lib/cjs/textarea.js +0 -165
  121. package/lib/cjs/textedit.js +0 -415
  122. package/lib/cjs/toaster.js +0 -64
  123. package/lib/cjs/tools.js +0 -1197
  124. package/lib/cjs/tooltips.js +0 -157
  125. package/lib/cjs/treeview.js +0 -535
  126. package/lib/cjs/version.js +0 -32
  127. package/lib/cjs/x4dom.js +0 -32
  128. package/lib/cjs/x4events.js +0 -384
  129. package/lib/cjs/x4react.js +0 -72
  130. package/lib/esm/action.js +0 -53
  131. package/lib/esm/app_sockets.js +0 -70
  132. package/lib/esm/application.js +0 -184
  133. package/lib/esm/autocomplete.js +0 -155
  134. package/lib/esm/base_component.js +0 -107
  135. package/lib/esm/button.js +0 -257
  136. package/lib/esm/calendar.js +0 -249
  137. package/lib/esm/canvas.js +0 -358
  138. package/lib/esm/cardview.js +0 -159
  139. package/lib/esm/checkbox.js +0 -134
  140. package/lib/esm/color.js +0 -588
  141. package/lib/esm/colorpicker.js +0 -1475
  142. package/lib/esm/combobox.js +0 -351
  143. package/lib/esm/component.js +0 -1711
  144. package/lib/esm/datastore.js +0 -990
  145. package/lib/esm/dialog.js +0 -490
  146. package/lib/esm/drag_manager.js +0 -147
  147. package/lib/esm/drawtext.js +0 -271
  148. package/lib/esm/fileupload.js +0 -163
  149. package/lib/esm/form.js +0 -304
  150. package/lib/esm/formatters.js +0 -81
  151. package/lib/esm/gridview.js +0 -889
  152. package/lib/esm/i18n.js +0 -257
  153. package/lib/esm/icon.js +0 -261
  154. package/lib/esm/image.js +0 -154
  155. package/lib/esm/input.js +0 -182
  156. package/lib/esm/label.js +0 -90
  157. package/lib/esm/layout.js +0 -310
  158. package/lib/esm/link.js +0 -59
  159. package/lib/esm/listview.js +0 -534
  160. package/lib/esm/menu.js +0 -300
  161. package/lib/esm/messagebox.js +0 -161
  162. package/lib/esm/panel.js +0 -65
  163. package/lib/esm/popup.js +0 -379
  164. package/lib/esm/property_editor.js +0 -251
  165. package/lib/esm/radiobtn.js +0 -136
  166. package/lib/esm/rating.js +0 -97
  167. package/lib/esm/request.js +0 -224
  168. package/lib/esm/router.js +0 -136
  169. package/lib/esm/settings.js +0 -66
  170. package/lib/esm/sidebarview.js +0 -79
  171. package/lib/esm/spreadsheet.js +0 -1097
  172. package/lib/esm/styles.js +0 -270
  173. package/lib/esm/svgcomponent.js +0 -450
  174. package/lib/esm/tabbar.js +0 -107
  175. package/lib/esm/tabview.js +0 -83
  176. package/lib/esm/textarea.js +0 -160
  177. package/lib/esm/textedit.js +0 -412
  178. package/lib/esm/toaster.js +0 -62
  179. package/lib/esm/tools.js +0 -1158
  180. package/lib/esm/tooltips.js +0 -153
  181. package/lib/esm/treeview.js +0 -527
  182. package/lib/esm/x4dom.js +0 -29
  183. package/lib/esm/x4events.js +0 -376
  184. package/lib/esm/x4react.js +0 -71
  185. package/lib/types/app_sockets.d.ts +0 -29
  186. package/lib/types/application.d.ts +0 -104
  187. package/lib/types/autocomplete.d.ts +0 -58
  188. package/lib/types/base_component.d.ts +0 -88
  189. package/lib/types/button.d.ts +0 -151
  190. package/lib/types/calendar.d.ts +0 -82
  191. package/lib/types/canvas.d.ts +0 -92
  192. package/lib/types/cardview.d.ts +0 -87
  193. package/lib/types/checkbox.d.ts +0 -77
  194. package/lib/types/color.d.ts +0 -148
  195. package/lib/types/colorpicker.d.ts +0 -107
  196. package/lib/types/combobox.d.ts +0 -107
  197. package/lib/types/component.d.ts +0 -601
  198. package/lib/types/datastore.d.ts +0 -396
  199. package/lib/types/dialog.d.ts +0 -175
  200. package/lib/types/dom_events.d.ts +0 -302
  201. package/lib/types/drag_manager.d.ts +0 -54
  202. package/lib/types/drawtext.d.ts +0 -48
  203. package/lib/types/fileupload.d.ts +0 -64
  204. package/lib/types/form.d.ts +0 -133
  205. package/lib/types/formatters.d.ts +0 -35
  206. package/lib/types/gridview.d.ts +0 -175
  207. package/lib/types/i18n.d.ts +0 -73
  208. package/lib/types/icon.d.ts +0 -64
  209. package/lib/types/image.d.ts +0 -55
  210. package/lib/types/index.d.ts +0 -84
  211. package/lib/types/input.d.ts +0 -91
  212. package/lib/types/label.d.ts +0 -58
  213. package/lib/types/layout.d.ts +0 -87
  214. package/lib/types/link.d.ts +0 -50
  215. package/lib/types/listview.d.ts +0 -178
  216. package/lib/types/md5.d.ts +0 -61
  217. package/lib/types/menu.d.ts +0 -130
  218. package/lib/types/messagebox.d.ts +0 -69
  219. package/lib/types/panel.d.ts +0 -47
  220. package/lib/types/popup.d.ts +0 -75
  221. package/lib/types/property_editor.d.ts +0 -71
  222. package/lib/types/radiobtn.d.ts +0 -73
  223. package/lib/types/rating.d.ts +0 -53
  224. package/lib/types/request.d.ts +0 -52
  225. package/lib/types/router.d.ts +0 -42
  226. package/lib/types/settings.d.ts +0 -37
  227. package/lib/types/sidebarview.d.ts +0 -49
  228. package/lib/types/spreadsheet.d.ts +0 -222
  229. package/lib/types/styles.d.ts +0 -85
  230. package/lib/types/svgcomponent.d.ts +0 -215
  231. package/lib/types/tabbar.d.ts +0 -58
  232. package/lib/types/tabview.d.ts +0 -49
  233. package/lib/types/textarea.d.ts +0 -77
  234. package/lib/types/textedit.d.ts +0 -123
  235. package/lib/types/toaster.d.ts +0 -42
  236. package/lib/types/tools.d.ts +0 -394
  237. package/lib/types/tooltips.d.ts +0 -46
  238. package/lib/types/treeview.d.ts +0 -144
  239. package/lib/types/version.d.ts +0 -29
  240. package/lib/types/x4dom.d.ts +0 -49
  241. package/lib/types/x4events.d.ts +0 -269
  242. package/lib/types/x4react.d.ts +0 -41
@@ -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
- interface EvDataChange extends BasicEvent {
36
- type: string;
37
- id: any;
38
- }
39
- 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
- export interface DataProxyProps extends BaseComponentProps<DataEventMap> {
212
- type: 'local' | 'immediate' | 'ajax';
213
- path?: string;
214
- params?: any;
215
- }
216
- export declare class DataProxy extends BaseComponent<DataProxyProps, DataEventMap> {
217
- constructor(props: DataProxyProps);
218
- load(): void;
219
- save(data: any): void;
220
- private _refresh;
221
- }
222
- /**
223
- *
224
- */
225
- interface DataStoreProps extends BaseComponentProps<DataStoreEventMap> {
226
- model: Record;
227
- data?: Record[];
228
- url?: string;
229
- }
230
- interface DataStoreEventMap extends EventMap {
231
- data_change: EvDataChange;
232
- }
233
- /**
234
- *
235
- */
236
- export declare class DataStore extends EventSource<DataStoreEventMap> {
237
- protected m_model: Record;
238
- protected m_fields: FieldInfo[];
239
- protected m_records: Record[];
240
- protected m_proxy: DataProxy;
241
- protected m_rec_index: DataIndex;
242
- constructor(props: DataStoreProps);
243
- /**
244
- *
245
- * @param records
246
- */
247
- load(url: string): void;
248
- reload(): 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: any[]): void;
259
- private _rebuildIndex;
260
- /**
261
- *
262
- */
263
- update(rec: Record): boolean;
264
- /**
265
- *
266
- * @param data
267
- */
268
- append(rec: Record | 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): Record;
295
- /**
296
- * return a record by it's index
297
- * @returns record or null
298
- */
299
- getByIndex(index: number): Record;
300
- private _getRecord;
301
- moveTo(other: DataStore): void;
302
- /**
303
- * create a new view on the DataStore
304
- * @param opts
305
- */
306
- createView(opts?: DataViewProps): DataView;
307
- /**
308
- *
309
- */
310
- createIndex(filter: FilterInfo): DataIndex;
311
- sortIndex(index: DataIndex, sort: SortProp[]): Uint32Array;
312
- /**
313
- *
314
- */
315
- forEach(cb: (rec: Record, index: number) => any): void;
316
- export(): Record[];
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 extends BaseComponentProps<DataViewEventMap> {
327
- store?: DataStore;
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 extends BaseComponent<DataViewProps, DataViewEventMap> {
348
- protected m_index: DataIndex;
349
- protected m_store: DataStore;
350
- protected m_sort: SortProp[];
351
- protected m_filter: FilterInfo;
352
- constructor(props: DataViewProps);
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;
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): Record;
385
- /**
386
- *
387
- * @param id
388
- */
389
- getById(id: any): Record;
390
- changed(): void;
391
- /**
392
- *
393
- */
394
- forEach(cb: (rec: Record, index: number) => any): void;
395
- }
396
- export {};
@@ -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 {};